From nobody Wed Oct 8 22:32:50 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B3AF302CC1; Tue, 24 Jun 2025 15:09:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750777767; cv=none; b=nXzXnaLjy8tXiCJj6il/IAmMDmq4qdFC2SR5eRaWFAK9eYhT/MvLJsWRuAlgjXCGNgDy1LNc2xs3WWKFxcpJREQyBlI77/91pyR6JodZOLiZY/5o4Yh1WJZhhlCYP9N9iksHE8HuH48SyUHCbqKtBJF8vWndonaQTPr8ovkMXzo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750777767; c=relaxed/simple; bh=E57QtEgtUWtuFVBzYKMcq15VHy6oZ1mCKarLh20U/4k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IZtHCGl6LpQkdaPwTbffH7/WC5MyuxMWZNS/hGvPPmyci6wTH3kpLUQTIvM1icgRZduWaXQHJ9i1s/Fu0wx2RWEYhu5JOmM6ebXDlbGKNFaEpSY0qo4nRtr01gmFPAaaFhoCTznndZborrc/mKMe5A1ahECB6umr/dB4mpDq6kk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=K6ynx9qw; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="K6ynx9qw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB65DC4CEE3; Tue, 24 Jun 2025 15:09:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1750777767; bh=E57QtEgtUWtuFVBzYKMcq15VHy6oZ1mCKarLh20U/4k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K6ynx9qweO3sDDLJteK/2U69GW00yA3smYWR9Vfnj8Akk42SIAiMU2OmmTCEstmHl y3sc2tAwe2taNuMQtowzcZnoUvIez7T+S9ymEy3osMzOODkqw8DGLWxundyRhrndqt IQUkByInVjtv8LaZNfuk7acTW+4TdN7PTPjZBWN8l3tNmYY6SGabQlUOZYZ3kCGaSm UsoxFSBautoQ+///Sbttz+fyP7QeVZg6YriDjMixEgjx/UswQIRpt+KXYLL4Lj7V6P Wckw9Vaz9XPXVnPT3daI06bNBDDjx+THRVQeVt/peZoABqus9ITAL7Sy5hKJh2Hk/w xS5oiK8DCr7zQ== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 63/66] kconfig: gconf: migrate to GTK 3 Date: Wed, 25 Jun 2025 00:05:51 +0900 Message-ID: <20250624150645.1107002-64-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250624150645.1107002-1-masahiroy@kernel.org> References: <20250624150645.1107002-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This commit switches from GTK 2.x to GTK 3, applying the following necessary changes: - Do not include invidual headers - GtkObject is gone - Convert glade to GtkBuilder [1]: https://docs.gtk.org/gtk3/migrating-2to3.html Signed-off-by: Masahiro Yamada --- scripts/kconfig/gconf-cfg.sh | 11 +- scripts/kconfig/gconf.c | 72 ++++++------- scripts/kconfig/gconf.ui | 200 +++++++++++++++++------------------ 3 files changed, 136 insertions(+), 147 deletions(-) diff --git a/scripts/kconfig/gconf-cfg.sh b/scripts/kconfig/gconf-cfg.sh index fc954c0538fa..856c692f480c 100755 --- a/scripts/kconfig/gconf-cfg.sh +++ b/scripts/kconfig/gconf-cfg.sh @@ -6,7 +6,7 @@ set -eu cflags=3D$1 libs=3D$2 =20 -PKG=3D"gtk+-2.0 gmodule-2.0 libglade-2.0" +PKG=3Dgtk+-3.0 =20 if [ -z "$(command -v ${HOSTPKG_CONFIG})" ]; then echo >&2 "*" @@ -18,18 +18,11 @@ fi if ! ${HOSTPKG_CONFIG} --exists $PKG; then echo >&2 "*" echo >&2 "* Unable to find the GTK+ installation. Please make sure that" - echo >&2 "* the GTK+ 2.0 development package is correctly installed." + echo >&2 "* the GTK 3 development package is correctly installed." echo >&2 "* You need $PKG" echo >&2 "*" exit 1 fi =20 -if ! ${HOSTPKG_CONFIG} --atleast-version=3D2.0.0 gtk+-2.0; then - echo >&2 "*" - echo >&2 "* GTK+ is present but version >=3D 2.0.0 is required." - echo >&2 "*" - exit 1 -fi - ${HOSTPKG_CONFIG} --cflags ${PKG} > ${cflags} ${HOSTPKG_CONFIG} --libs ${PKG} > ${libs} diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index 4c6459cc26e7..5959ed255d12 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c @@ -7,10 +7,7 @@ #include "lkc.h" #include "images.h" =20 -#include #include -#include -#include =20 #include #include @@ -655,7 +652,7 @@ static void on_expand_clicked(GtkButton *button, gpoint= er user_data) =20 /* Main Windows Callbacks */ =20 -static void on_window1_destroy(GtkObject *object, gpointer user_data) +static void on_window1_destroy(GtkWidget *widget, gpointer user_data) { gtk_main_quit(); } @@ -982,15 +979,15 @@ static void replace_button_icon(GtkWidget *widget, co= nst char * const xpm[]) =20 static void init_main_window(const gchar *glade_file) { - GladeXML *xml; + GtkBuilder *builder; GtkWidget *widget; GtkTextBuffer *txtbuf; =20 - xml =3D glade_xml_new(glade_file, "window1", NULL); - if (!xml) + builder =3D gtk_builder_new_from_file(glade_file); + if (!builder) g_error("GUI loading failed !\n"); =20 - main_wnd =3D glade_xml_get_widget(xml, "window1"); + main_wnd =3D GTK_WIDGET(gtk_builder_get_object(builder, "window1")); g_signal_connect(main_wnd, "destroy", G_CALLBACK(on_window1_destroy), NULL); g_signal_connect(main_wnd, "size_allocate", @@ -998,9 +995,9 @@ static void init_main_window(const gchar *glade_file) g_signal_connect(main_wnd, "delete_event", G_CALLBACK(on_window1_delete_event), NULL); =20 - hpaned =3D glade_xml_get_widget(xml, "hpaned1"); - vpaned =3D glade_xml_get_widget(xml, "vpaned1"); - tree1_w =3D glade_xml_get_widget(xml, "treeview1"); + hpaned =3D GTK_WIDGET(gtk_builder_get_object(builder, "hpaned1")); + vpaned =3D GTK_WIDGET(gtk_builder_get_object(builder, "vpaned1")); + tree1_w =3D GTK_WIDGET(gtk_builder_get_object(builder, "treeview1")); g_signal_connect(tree1_w, "cursor_changed", G_CALLBACK(on_treeview2_cursor_changed), NULL); g_signal_connect(tree1_w, "button_press_event", @@ -1008,7 +1005,7 @@ static void init_main_window(const gchar *glade_file) g_signal_connect(tree1_w, "key_press_event", G_CALLBACK(on_treeview2_key_press_event), NULL); =20 - tree2_w =3D glade_xml_get_widget(xml, "treeview2"); + tree2_w =3D GTK_WIDGET(gtk_builder_get_object(builder, "treeview2")); g_signal_connect(tree2_w, "cursor_changed", G_CALLBACK(on_treeview2_cursor_changed), NULL); g_signal_connect(tree2_w, "button_press_event", @@ -1016,96 +1013,96 @@ static void init_main_window(const gchar *glade_fil= e) g_signal_connect(tree2_w, "key_press_event", G_CALLBACK(on_treeview2_key_press_event), NULL); =20 - text_w =3D glade_xml_get_widget(xml, "textview3"); + text_w =3D GTK_WIDGET(gtk_builder_get_object(builder, "textview3")); =20 /* menubar */ - widget =3D glade_xml_get_widget(xml, "load1"); + widget =3D GTK_WIDGET(gtk_builder_get_object(builder, "load1")); g_signal_connect(widget, "activate", G_CALLBACK(on_load1_activate), NULL); =20 - widget =3D glade_xml_get_widget(xml, "save1"); + widget =3D GTK_WIDGET(gtk_builder_get_object(builder, "save1")); g_signal_connect(widget, "activate", G_CALLBACK(on_save_activate), NULL); =20 - widget =3D glade_xml_get_widget(xml, "save_as1"); + widget =3D GTK_WIDGET(gtk_builder_get_object(builder, "save_as1")); g_signal_connect(widget, "activate", G_CALLBACK(on_save_as1_activate), NU= LL); =20 - widget =3D glade_xml_get_widget(xml, "quit1"); + widget =3D GTK_WIDGET(gtk_builder_get_object(builder, "quit1")); g_signal_connect(widget, "activate", G_CALLBACK(on_quit1_activate), NULL); =20 - widget =3D glade_xml_get_widget(xml, "show_name1"); + widget =3D GTK_WIDGET(gtk_builder_get_object(builder, "show_name1")); g_signal_connect(widget, "activate", G_CALLBACK(on_show_name1_activate), = NULL); gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget, show_name); =20 - widget =3D glade_xml_get_widget(xml, "show_range1"); + widget =3D GTK_WIDGET(gtk_builder_get_object(builder, "show_range1")); g_signal_connect(widget, "activate", G_CALLBACK(on_show_range1_activate),= NULL); gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget, show_range); =20 - widget =3D glade_xml_get_widget(xml, "show_data1"); + widget =3D GTK_WIDGET(gtk_builder_get_object(builder, "show_data1")); g_signal_connect(widget, "activate", G_CALLBACK(on_show_data1_activate), = NULL); gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget, show_value); =20 - widget =3D glade_xml_get_widget(xml, "set_option_mode1"); + widget =3D GTK_WIDGET(gtk_builder_get_object(builder, "set_option_mode1")= ); g_signal_connect(widget, "activate", G_CALLBACK(on_set_option_mode1_activate), NULL); =20 - widget =3D glade_xml_get_widget(xml, "set_option_mode2"); + widget =3D GTK_WIDGET(gtk_builder_get_object(builder, "set_option_mode2")= ); g_signal_connect(widget, "activate", G_CALLBACK(on_set_option_mode2_activate), NULL); =20 - widget =3D glade_xml_get_widget(xml, "set_option_mode3"); + widget =3D GTK_WIDGET(gtk_builder_get_object(builder, "set_option_mode3")= ); g_signal_connect(widget, "activate", G_CALLBACK(on_set_option_mode3_activate), NULL); =20 - widget =3D glade_xml_get_widget(xml, "introduction1"); + widget =3D GTK_WIDGET(gtk_builder_get_object(builder, "introduction1")); g_signal_connect(widget, "activate", G_CALLBACK(on_introduction1_activate), NULL); =20 - widget =3D glade_xml_get_widget(xml, "about1"); + widget =3D GTK_WIDGET(gtk_builder_get_object(builder, "about1")); g_signal_connect(widget, "activate", G_CALLBACK(on_about1_activate), NULL); =20 - widget =3D glade_xml_get_widget(xml, "license1"); + widget =3D GTK_WIDGET(gtk_builder_get_object(builder, "license1")); g_signal_connect(widget, "activate", G_CALLBACK(on_license1_activate), NULL); =20 /* toolbar */ - back_btn =3D glade_xml_get_widget(xml, "button1"); + back_btn =3D GTK_WIDGET(gtk_builder_get_object(builder, "button1")); g_signal_connect(back_btn, "clicked", G_CALLBACK(on_back_clicked), NULL); gtk_widget_set_sensitive(back_btn, FALSE); =20 - widget =3D glade_xml_get_widget(xml, "button2"); + widget =3D GTK_WIDGET(gtk_builder_get_object(builder, "button2")); g_signal_connect(widget, "clicked", G_CALLBACK(on_load_clicked), NULL); =20 - save_btn =3D glade_xml_get_widget(xml, "button3"); + save_btn =3D GTK_WIDGET(gtk_builder_get_object(builder, "button3")); g_signal_connect(save_btn, "clicked", G_CALLBACK(on_save_clicked), NULL); - save_menu_item =3D glade_xml_get_widget(xml, "save1"); + save_menu_item =3D GTK_WIDGET(gtk_builder_get_object(builder, "save1")); conf_set_changed_callback(conf_changed); =20 - single_btn =3D glade_xml_get_widget(xml, "button4"); + single_btn =3D GTK_WIDGET(gtk_builder_get_object(builder, "button4")); g_signal_connect(single_btn, "clicked", G_CALLBACK(on_single_clicked), NULL); replace_button_icon(single_btn, xpm_single_view); =20 - split_btn =3D glade_xml_get_widget(xml, "button5"); + split_btn =3D GTK_WIDGET(gtk_builder_get_object(builder, "button5")); g_signal_connect(split_btn, "clicked", G_CALLBACK(on_split_clicked), NULL); replace_button_icon(split_btn, xpm_split_view); =20 - full_btn =3D glade_xml_get_widget(xml, "button6"); + full_btn =3D GTK_WIDGET(gtk_builder_get_object(builder, "button6")); g_signal_connect(full_btn, "clicked", G_CALLBACK(on_full_clicked), NULL); replace_button_icon(full_btn, xpm_tree_view); =20 - widget =3D glade_xml_get_widget(xml, "button7"); + widget =3D GTK_WIDGET(gtk_builder_get_object(builder, "button7")); g_signal_connect(widget, "clicked", G_CALLBACK(on_collapse_clicked), NULL); =20 - widget =3D glade_xml_get_widget(xml, "button8"); + widget =3D GTK_WIDGET(gtk_builder_get_object(builder, "button8")); g_signal_connect(widget, "clicked", G_CALLBACK(on_expand_clicked), NULL); =20 @@ -1120,7 +1117,9 @@ static void init_main_window(const gchar *glade_file) =20 gtk_window_set_title(GTK_WINDOW(main_wnd), rootmenu.prompt->text); =20 - gtk_widget_show(main_wnd); + gtk_widget_show_all(main_wnd); + + g_object_unref(builder); } =20 static gboolean visible_func(GtkTreeModel *model, GtkTreeIter *iter, @@ -1296,7 +1295,6 @@ int main(int ac, char *av[]) =20 /* GTK stuffs */ gtk_init(&ac, &av); - glade_init(); =20 /* Determine GUI path */ env =3D getenv(SRCTREE); diff --git a/scripts/kconfig/gconf.ui b/scripts/kconfig/gconf.ui index f0c572c7f47c..e5dad2b06502 100644 --- a/scripts/kconfig/gconf.ui +++ b/scripts/kconfig/gconf.ui @@ -1,8 +1,8 @@ =20 - + =20 - + True Gtk Kernel Configurator GTK_WINDOW_TOPLEVEL @@ -19,193 +19,193 @@ GDK_GRAVITY_NORTH_WEST =20 - + True False 0 =20 - + True =20 - + True _File True =20 - - + + =20 - + True Load a config= file _Load True - + =20 - + True Save the conf= ig in .config _Save True - + =20 - + True Save the conf= ig in a file Save _as True - + =20 - + True - + =20 - + True _Quit True - + - + - + =20 - + True _Options True =20 - - + + =20 - + True Show name Show _name True False - + =20 - + True Show range (Y= /M/N) Show _range True False - + =20 - + True Show value of= the option Show _data True False - + =20 - + True - + =20 - + True Show normal o= ptions Show normal options<= /property> True True - + =20 - + True Show all opti= ons Show all _options True False set_option_mode1 - + =20 - + True Show all opti= ons with prompts Show all prompt opti= ons True False set_option_mode1 - + =20 - + - + =20 - + True _Help True =20 - - + + =20 - + True _Introduction True - + =20 - + True _About True - + =20 - + True _License True - + - + - + - + 0 False @@ -214,14 +214,14 @@ =20 - + True GTK_ORIENTATION_HORIZONTAL GTK_TOOLBAR_BOTH True =20 - + True Goes up of one le= vel (single view) Back @@ -230,7 +230,7 @@ True True False - + False True @@ -238,18 +238,18 @@ =20 - + True True True False =20 - + True - + - + False False @@ -257,7 +257,7 @@ =20 - + True Load a config fil= e Load @@ -266,7 +266,7 @@ True True False - + False True @@ -274,7 +274,7 @@ =20 - + True Save a config fil= e Save @@ -283,7 +283,7 @@ True True False - + False True @@ -291,18 +291,18 @@ =20 - + True True True False =20 - + True - + - + False False @@ -310,7 +310,7 @@ =20 - + True Single view Single @@ -319,7 +319,7 @@ True True False - + False True @@ -327,7 +327,7 @@ =20 - + True Split view Split @@ -336,7 +336,7 @@ True True False - + False True @@ -344,7 +344,7 @@ =20 - + True Full view Full @@ -353,7 +353,7 @@ True True False - + False True @@ -361,18 +361,18 @@ =20 - + True True True False =20 - + True - + - + False False @@ -380,7 +380,7 @@ =20 - + True Collapse the whol= e tree in the right frame Collapse @@ -389,7 +389,7 @@ True True False - + False True @@ -397,7 +397,7 @@ =20 - + True Expand the whole = tree in the right frame Expand @@ -406,13 +406,13 @@ True True False - + False True - + 0 False @@ -421,14 +421,13 @@ =20 - + 1 True True - 0 =20 - + True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC @@ -436,16 +435,16 @@ GTK_CORNER_TOP_LEFT =20 - + True True True False False False - + - + True False @@ -453,13 +452,12 @@ =20 - + True True - 0 =20 - + True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC @@ -467,7 +465,7 @@ GTK_CORNER_TOP_LEFT =20 - + True True True @@ -475,9 +473,9 @@ False False False - + - + True False @@ -485,7 +483,7 @@ =20 - + True GTK_POLICY_NEVER GTK_POLICY_AUTOMATIC @@ -493,7 +491,7 @@ GTK_CORNER_TOP_LEFT =20 - + True True False @@ -508,29 +506,29 @@ 0 0 0 - + - + True True - + True True - + 0 True True - + - + =20 - + --=20 2.43.0