From nobody Sun Dec 14 05:50:37 2025 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 00C92309EFB for ; Sat, 13 Dec 2025 14:09:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765634974; cv=none; b=jOVWxHv3g8VT3f5cZVSrIBaV/nkIMihqtYL1AHEAMAa0m9b/qLbP5tihundmLxrDXDnGempsbphGJREXb4dPJraRNQIX5EPEOhaLhKvPtGv52fn5vSkvff96cRO77OgJpCP4ikfDb8bZQt9w4Ful9lAdAFGA8aaf/NZ3Gmlxxq8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765634974; c=relaxed/simple; bh=Rq6PX8fhVb4oNv7mzv8GekiV6pRlU/Sog6lNRgPsrgQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gCwQnCGI7OTOafqp8fmOwZlHSmVh0iYakc7uQqJBevcR0W1qPkhv5Cz12KjeCJYWBfEYYbaLDicLeivtx7u9qhx0Fg+tR4IG0yDOxB8KkQKjDziutzUpr6KuyrhVPvz/9U2xojlhSumxq4GoiAOblFbenkRJPwXRgeCfoozi9Yw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=JSfn8c0m; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JSfn8c0m" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-47118259fd8so21126675e9.3 for ; Sat, 13 Dec 2025 06:09:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765634969; x=1766239769; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4wkQdMZhFehM7X9oxK+5FxGCNjYwru8qlopiCNXH2jA=; b=JSfn8c0mlk6sMhrTZdz4QOXywuuB4E12RmXTvYcWc2QMKOlY6pSrnYqp1wUQSsQtWy S1AsCnRDLEikRgSmPS206/kT8oi2VUkFA4d6b42pSncsnjayGz4IbZUIZc9DOj0Q7SRQ LnPxdXzqpPA5Bv0/GpqkMYYpepbO35frPWAMm4ORtRC3Y0KroCB9wOAYhXcwGkyvKBvJ USJ9AMfcX9xHmxSPAePRDrSgashZ+Ie+qoj2rZMoQZiPXMhq4zp7s5FSnpK1WhAR7caX JQyaXyhpO5v0BpbmTHsAfylEYHOwHEPRARtBB8VVVZgjI2zpm5eFP6HPdcdQ79ghW3wW eiYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765634969; x=1766239769; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=4wkQdMZhFehM7X9oxK+5FxGCNjYwru8qlopiCNXH2jA=; b=vesuIc6TFAKjxqi8mB0dN3vpYWaNje1mY8GuQA+mtTMoR6lo73wwMhnDmujFRDBzEU nneC42zQGQQlmIumvu1eTUZOJ2XXPPjy63TxHFui0f0up2KXFZBdcAU8ENO26cO7c3rt IH9xIUk+vugDbQHhMJFABRKJx0WF7dhSrXWH8dc5+aRq1lpPd0fM1PPuoFlF2s2/a31g 6aivY8hlLBYrFDT3oT8C8Bi78whqRpHqwsUjyMlscYaN7ZdWpXhDKqcgbzrWjlpULeK4 ZG6plIli/2pVDZIJQnfTeydzlY2s6Z/yySzW5jPVX/cT1T/oc4O29J1vCNle4KWL7Tyk jttw== X-Forwarded-Encrypted: i=1; AJvYcCXSBaj4UeOQKspBXXTT/jS4ioQFV4vdKkzuaGCAtPA8RezjV5QOSVF23inXNM73aM4PJes/TinLkYbUfcU=@vger.kernel.org X-Gm-Message-State: AOJu0Yw8N4q25XOREIwA/CdyZmEToqwrCn7zXMygsAW5K/pg09EYJ22V HSm0XDks/9XX0zoqciZAYHjEkMEXwUy159dLhKipcdwTN0N/59XcWdis X-Gm-Gg: AY/fxX7tnh7FJqjW+6ADILWeLHnzHy+9A8eF/kprY9wKotlpzVWhAUaUC1WKGOGH44n vBbD0TSgkLJ3lNh8mMpN1xRoSXkfckS6F/CCNhjx/4UHPXnl+nmh7vYe7kDMvYVHsKOzCzJL7er nO1IJT5lCGFjjbcUNxsTAOUb0LMJm4I1MdGuLrKK8l7/jt9iZhhH5WRiwk0HDMEh48SP5f6VlKn Ha8nZRx+mqPKsbstXasDTZ/2XPx/sjwfHfLWvtIISEABMgyBDojwnddXHQ+o45P+BSyb69huUje Tkge1IFvn11EamKIcZPqA4u+M/+KRu26MQypXLA/K+ZMZXuCitGM+8l+Ec6vG5dn7fSVrglXvzy WIJRO1qS+hoyrhVaz+iY+fpYdJzOl+xqpFL8bwwWydF2XflzS4HKf6xEVtVIYwIX+kL6eQPSLYj 0UEc8Wa3pIvTQ= X-Google-Smtp-Source: AGHT+IFP+1RfSnfJoIfQNFSFSD/9i0tZkRKTINn696kj2KvzUYTROBf/7m6yjhmoaQVi6glWTdYT8w== X-Received: by 2002:a05:600d:6443:10b0:477:7b30:a6fc with SMTP id 5b1f17b1804b1-47a8f90f371mr48428025e9.30.1765634968901; Sat, 13 Dec 2025 06:09:28 -0800 (PST) Received: from fedora.lan ([2a0d:6fc1:2:c000:4240:b502:d22f:bb75]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47a8f74b17bsm89216945e9.2.2025.12.13.06.09.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Dec 2025 06:09:28 -0800 (PST) From: Rostislav Krasny To: Nathan Chancellor Cc: Nicolas Schier , Masahiro Yamada , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Rostislav Krasny Subject: [PATCH v2 1/1] kconfig: move XPM icons to separate files Date: Sat, 13 Dec 2025 16:09:23 +0200 Message-ID: <20251213140923.19710-2-rostiprodev@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251213140923.19710-1-rostiprodev@gmail.com> References: <20251213140923.19710-1-rostiprodev@gmail.com> 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" Replace deprecated gdk_pixbuf_new_from_xpm_data() with gdk_pixbuf_new_from_= file() and update both GTK and QT frontends to load XPM icons from separate files in scripts/kconfig/icons/ instead of from the code. xpm_menu_inv and xpm_void were removed and not converted into xpm files because they are not used since 64285dc5c41fc7a031695c2c286a2bfef9eaf2c6 This eliminates the GTK deprecation warnings at compile time, improves memory usage and code organization. Signed-off-by: Rostislav Krasny --- scripts/kconfig/Makefile | 4 +- scripts/kconfig/gconf.c | 35 ++- scripts/kconfig/icons/back.xpm | 29 +++ scripts/kconfig/icons/choice_no.xpm | 18 ++ scripts/kconfig/icons/choice_yes.xpm | 18 ++ scripts/kconfig/icons/load.xpm | 31 +++ scripts/kconfig/icons/menu.xpm | 18 ++ scripts/kconfig/icons/menuback.xpm | 18 ++ scripts/kconfig/icons/save.xpm | 31 +++ scripts/kconfig/icons/single_view.xpm | 28 +++ scripts/kconfig/icons/split_view.xpm | 28 +++ scripts/kconfig/icons/symbol_mod.xpm | 18 ++ scripts/kconfig/icons/symbol_no.xpm | 18 ++ scripts/kconfig/icons/symbol_yes.xpm | 18 ++ scripts/kconfig/icons/tree_view.xpm | 28 +++ scripts/kconfig/images.c | 328 -------------------------- scripts/kconfig/images.h | 33 --- scripts/kconfig/qconf.cc | 29 ++- 18 files changed, 345 insertions(+), 385 deletions(-) create mode 100644 scripts/kconfig/icons/back.xpm create mode 100644 scripts/kconfig/icons/choice_no.xpm create mode 100644 scripts/kconfig/icons/choice_yes.xpm create mode 100644 scripts/kconfig/icons/load.xpm create mode 100644 scripts/kconfig/icons/menu.xpm create mode 100644 scripts/kconfig/icons/menuback.xpm create mode 100644 scripts/kconfig/icons/save.xpm create mode 100644 scripts/kconfig/icons/single_view.xpm create mode 100644 scripts/kconfig/icons/split_view.xpm create mode 100644 scripts/kconfig/icons/symbol_mod.xpm create mode 100644 scripts/kconfig/icons/symbol_no.xpm create mode 100644 scripts/kconfig/icons/symbol_yes.xpm create mode 100644 scripts/kconfig/icons/tree_view.xpm delete mode 100644 scripts/kconfig/images.c delete mode 100644 scripts/kconfig/images.h diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index fb50bd4f4103..5baf1c44ffa2 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -201,7 +201,7 @@ $(addprefix $(obj)/, mconf.o $(lxdialog)): | $(obj)/mco= nf-cflags # qconf: Used for the xconfig target based on Qt hostprogs +=3D qconf qconf-cxxobjs :=3D qconf.o qconf-moc.o -qconf-objs :=3D images.o $(common-objs) +qconf-objs :=3D $(common-objs) =20 HOSTLDLIBS_qconf =3D $(call read-file, $(obj)/qconf-libs) HOSTCXXFLAGS_qconf.o =3D -std=3Dc++11 -fPIC $(call read-file, $(obj)/q= conf-cflags) @@ -219,7 +219,7 @@ targets +=3D qconf-moc.cc =20 # gconf: Used for the gconfig target based on GTK+ hostprogs +=3D gconf -gconf-objs :=3D gconf.o images.o $(common-objs) +gconf-objs :=3D gconf.o $(common-objs) =20 HOSTLDLIBS_gconf =3D $(call read-file, $(obj)/gconf-libs) HOSTCFLAGS_gconf.o =3D $(call read-file, $(obj)/gconf-cflags) diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index 8b164ccfa008..9f8586cb8a3e 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c @@ -5,7 +5,6 @@ =20 #include #include "lkc.h" -#include "images.h" =20 #include =20 @@ -951,12 +950,24 @@ static void fixup_rootmenu(struct menu *menu) } =20 /* Main Window Initialization */ -static void replace_button_icon(GtkWidget *widget, const char * const xpm[= ]) +static void replace_button_icon(GtkWidget *widget, const char *filename) { GdkPixbuf *pixbuf; GtkWidget *image; + GError *err =3D NULL; + + char *env =3D getenv(SRCTREE); + gchar *path =3D g_strconcat(env ? env : g_get_current_dir(), "/scripts/kc= onfig/icons/", filename, NULL); + + pixbuf =3D gdk_pixbuf_new_from_file(path, &err); + g_free(path); + + if (err) { + g_warning("Failed to load icon %s: %s", filename, err->message); + g_error_free(err); + return; + } =20 - pixbuf =3D gdk_pixbuf_new_from_xpm_data((const char **)xpm); image =3D gtk_image_new_from_pixbuf(pixbuf); g_object_unref(pixbuf); =20 @@ -1078,17 +1089,17 @@ static void init_main_window(const gchar *glade_fil= e) 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); + replace_button_icon(single_btn, "single_view.xpm"); =20 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); + replace_button_icon(split_btn, "split_view.xpm"); =20 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); + replace_button_icon(full_btn, "tree_view.xpm"); =20 widget =3D GTK_WIDGET(gtk_builder_get_object(builder, "button7")); g_signal_connect(widget, "clicked", @@ -1269,7 +1280,17 @@ static void init_right_tree(void) g_signal_connect(G_OBJECT(renderer), "edited", G_CALLBACK(renderer_edited), tree2_w); =20 - pix_menu =3D gdk_pixbuf_new_from_xpm_data((const char **)xpm_menu); + char *env =3D getenv(SRCTREE); + gchar *path =3D g_strconcat(env ? env : g_get_current_dir(), "/scripts/kc= onfig/icons/menu.xpm", NULL); + GError *err =3D NULL; + + pix_menu =3D gdk_pixbuf_new_from_file(path, &err); + g_free(path); + + if (err) { + g_warning("Failed to load menu icon: %s", err->message); + g_error_free(err); + } =20 for (i =3D 0; i < COL_VALUE; i++) { column =3D gtk_tree_view_get_column(view, i); diff --git a/scripts/kconfig/icons/back.xpm b/scripts/kconfig/icons/back.xpm new file mode 100644 index 000000000000..2a4c30127608 --- /dev/null +++ b/scripts/kconfig/icons/back.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static char * back_xpm[] =3D { +"22 22 3 1", +". c None", +"# c #000083", +"a c #838183", +"......................", +"......................", +"......................", +"......................", +"......................", +"...........######a....", +"..#......##########...", +"..##...####......##a..", +"..###.###.........##..", +"..######..........##..", +"..#####...........##..", +"..######..........##..", +"..#######.........##..", +"..########.......##a..", +"...............a###...", +"...............###....", +"......................", +"......................", +"......................", +"......................", +"......................", +"......................" +}; diff --git a/scripts/kconfig/icons/choice_no.xpm b/scripts/kconfig/icons/ch= oice_no.xpm new file mode 100644 index 000000000000..306e314ed9c6 --- /dev/null +++ b/scripts/kconfig/icons/choice_no.xpm @@ -0,0 +1,18 @@ +/* XPM */ +static char * choice_no_xpm[] =3D { +"12 12 2 1", +" c white", +". c black", +" ", +" .... ", +" .. .. ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" .. .. ", +" .... ", +" " +}; diff --git a/scripts/kconfig/icons/choice_yes.xpm b/scripts/kconfig/icons/c= hoice_yes.xpm new file mode 100644 index 000000000000..edeb91067379 --- /dev/null +++ b/scripts/kconfig/icons/choice_yes.xpm @@ -0,0 +1,18 @@ +/* XPM */ +static char * choice_yes_xpm[] =3D { +"12 12 2 1", +" c white", +". c black", +" ", +" .... ", +" .. .. ", +" . . ", +" . .. . ", +" . .... . ", +" . .... . ", +" . .. . ", +" . . ", +" .. .. ", +" .... ", +" " +}; diff --git a/scripts/kconfig/icons/load.xpm b/scripts/kconfig/icons/load.xpm new file mode 100644 index 000000000000..8c2d8725d1ef --- /dev/null +++ b/scripts/kconfig/icons/load.xpm @@ -0,0 +1,31 @@ +/* XPM */ +static char * load_xpm[] =3D { +"22 22 5 1", +". c None", +"# c #000000", +"c c #838100", +"a c #ffff00", +"b c #ffffff", +"......................", +"......................", +"......................", +"............####....#.", +"...........#....##.##.", +"..................###.", +".................####.", +".####...........#####.", +"#abab##########.......", +"#babababababab#.......", +"#ababababababa#.......", +"#babababababab#.......", +"#ababab###############", +"#babab##cccccccccccc##", +"#abab##cccccccccccc##.", +"#bab##cccccccccccc##..", +"#ab##cccccccccccc##...", +"#b##cccccccccccc##....", +"###cccccccccccc##.....", +"##cccccccccccc##......", +"###############.......", +"......................" +}; diff --git a/scripts/kconfig/icons/menu.xpm b/scripts/kconfig/icons/menu.xpm new file mode 100644 index 000000000000..8ae1b74b3c0c --- /dev/null +++ b/scripts/kconfig/icons/menu.xpm @@ -0,0 +1,18 @@ +/* XPM */ +static char * menu_xpm[] =3D { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" . . ", +" . .. . ", +" . .... . ", +" . ...... . ", +" . ...... . ", +" . .... . ", +" . .. . ", +" . . ", +" .......... ", +" " +}; diff --git a/scripts/kconfig/icons/menuback.xpm b/scripts/kconfig/icons/men= uback.xpm new file mode 100644 index 000000000000..f988c2c323c3 --- /dev/null +++ b/scripts/kconfig/icons/menuback.xpm @@ -0,0 +1,18 @@ +/* XPM */ +static char * menuback_xpm[] =3D { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" . . ", +" . .. . ", +" . .... . ", +" . ...... . ", +" . ...... . ", +" . .... . ", +" . .. . ", +" . . ", +" .......... ", +" " +}; diff --git a/scripts/kconfig/icons/save.xpm b/scripts/kconfig/icons/save.xpm new file mode 100644 index 000000000000..f8be53d83b40 --- /dev/null +++ b/scripts/kconfig/icons/save.xpm @@ -0,0 +1,31 @@ +/* XPM */ +static char * save_xpm[] =3D { +"22 22 5 1", +". c None", +"# c #000000", +"a c #838100", +"b c #c5c2c5", +"c c #cdb6d5", +"......................", +".####################.", +".#aa#bbbbbbbbbbbb#bb#.", +".#aa#bbbbbbbbbbbb#bb#.", +".#aa#bbbbbbbbbcbb####.", +".#aa#bbbccbbbbbbb#aa#.", +".#aa#bbbccbbbbbbb#aa#.", +".#aa#bbbbbbbbbbbb#aa#.", +".#aa#bbbbbbbbbbbb#aa#.", +".#aa#bbbbbbbbbbbb#aa#.", +".#aa#bbbbbbbbbbbb#aa#.", +".#aaa############aaa#.", +".#aaaaaaaaaaaaaaaaaa#.", +".#aaaaaaaaaaaaaaaaaa#.", +".#aaa#############aa#.", +".#aaa#########bbb#aa#.", +".#aaa#########bbb#aa#.", +".#aaa#########bbb#aa#.", +".#aaa#########bbb#aa#.", +".#aaa#########bbb#aa#.", +"..##################..", +"......................" +}; diff --git a/scripts/kconfig/icons/single_view.xpm b/scripts/kconfig/icons/= single_view.xpm new file mode 100644 index 000000000000..33c3b239dc8e --- /dev/null +++ b/scripts/kconfig/icons/single_view.xpm @@ -0,0 +1,28 @@ +/* XPM */ +static char * single_view_xpm[] =3D { +"22 22 2 1", +". c None", +"# c #000000", +"......................", +"......................", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"......................", +"......................" +}; diff --git a/scripts/kconfig/icons/split_view.xpm b/scripts/kconfig/icons/s= plit_view.xpm new file mode 100644 index 000000000000..09e22246d936 --- /dev/null +++ b/scripts/kconfig/icons/split_view.xpm @@ -0,0 +1,28 @@ +/* XPM */ +static char * split_view_xpm[] =3D { +"22 22 2 1", +". c None", +"# c #000000", +"......................", +"......................", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......................", +"......................" +}; diff --git a/scripts/kconfig/icons/symbol_mod.xpm b/scripts/kconfig/icons/s= ymbol_mod.xpm new file mode 100644 index 000000000000..769465fcb0ce --- /dev/null +++ b/scripts/kconfig/icons/symbol_mod.xpm @@ -0,0 +1,18 @@ +/* XPM */ +static char * symbol_mod_xpm[] =3D { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" . . ", +" . . ", +" . .. . ", +" . .... . ", +" . .... . ", +" . .. . ", +" . . ", +" . . ", +" .......... ", +" " +}; diff --git a/scripts/kconfig/icons/symbol_no.xpm b/scripts/kconfig/icons/sy= mbol_no.xpm new file mode 100644 index 000000000000..e4e9d46c9aca --- /dev/null +++ b/scripts/kconfig/icons/symbol_no.xpm @@ -0,0 +1,18 @@ +/* XPM */ +static char * symbol_no_xpm[] =3D { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" .......... ", +" " +}; diff --git a/scripts/kconfig/icons/symbol_yes.xpm b/scripts/kconfig/icons/s= ymbol_yes.xpm new file mode 100644 index 000000000000..dab7e10ae7a9 --- /dev/null +++ b/scripts/kconfig/icons/symbol_yes.xpm @@ -0,0 +1,18 @@ +/* XPM */ +static char * symbol_yes_xpm[] =3D { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" . . ", +" . . ", +" . . . ", +" . .. . ", +" . . .. . ", +" . .... . ", +" . .. . ", +" . . ", +" .......... ", +" " +}; diff --git a/scripts/kconfig/icons/tree_view.xpm b/scripts/kconfig/icons/tr= ee_view.xpm new file mode 100644 index 000000000000..290835b802eb --- /dev/null +++ b/scripts/kconfig/icons/tree_view.xpm @@ -0,0 +1,28 @@ +/* XPM */ +static char * tree_view_xpm[] =3D { +"22 22 2 1", +". c None", +"# c #000000", +"......................", +"......................", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......########........", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......########........", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......########........", +"......................", +"......................" +}; diff --git a/scripts/kconfig/images.c b/scripts/kconfig/images.c deleted file mode 100644 index 2f9afffa5d79..000000000000 --- a/scripts/kconfig/images.c +++ /dev/null @@ -1,328 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * Copyright (C) 2002 Roman Zippel - */ - -#include "images.h" - -const char * const xpm_load[] =3D { -"22 22 5 1", -". c None", -"# c #000000", -"c c #838100", -"a c #ffff00", -"b c #ffffff", -"......................", -"......................", -"......................", -"............####....#.", -"...........#....##.##.", -"..................###.", -".................####.", -".####...........#####.", -"#abab##########.......", -"#babababababab#.......", -"#ababababababa#.......", -"#babababababab#.......", -"#ababab###############", -"#babab##cccccccccccc##", -"#abab##cccccccccccc##.", -"#bab##cccccccccccc##..", -"#ab##cccccccccccc##...", -"#b##cccccccccccc##....", -"###cccccccccccc##.....", -"##cccccccccccc##......", -"###############.......", -"......................"}; - -const char * const xpm_save[] =3D { -"22 22 5 1", -". c None", -"# c #000000", -"a c #838100", -"b c #c5c2c5", -"c c #cdb6d5", -"......................", -".####################.", -".#aa#bbbbbbbbbbbb#bb#.", -".#aa#bbbbbbbbbbbb#bb#.", -".#aa#bbbbbbbbbcbb####.", -".#aa#bbbccbbbbbbb#aa#.", -".#aa#bbbccbbbbbbb#aa#.", -".#aa#bbbbbbbbbbbb#aa#.", -".#aa#bbbbbbbbbbbb#aa#.", -".#aa#bbbbbbbbbbbb#aa#.", -".#aa#bbbbbbbbbbbb#aa#.", -".#aaa############aaa#.", -".#aaaaaaaaaaaaaaaaaa#.", -".#aaaaaaaaaaaaaaaaaa#.", -".#aaa#############aa#.", -".#aaa#########bbb#aa#.", -".#aaa#########bbb#aa#.", -".#aaa#########bbb#aa#.", -".#aaa#########bbb#aa#.", -".#aaa#########bbb#aa#.", -"..##################..", -"......................"}; - -const char * const xpm_back[] =3D { -"22 22 3 1", -". c None", -"# c #000083", -"a c #838183", -"......................", -"......................", -"......................", -"......................", -"......................", -"...........######a....", -"..#......##########...", -"..##...####......##a..", -"..###.###.........##..", -"..######..........##..", -"..#####...........##..", -"..######..........##..", -"..#######.........##..", -"..########.......##a..", -"...............a###...", -"...............###....", -"......................", -"......................", -"......................", -"......................", -"......................", -"......................"}; - -const char * const xpm_tree_view[] =3D { -"22 22 2 1", -". c None", -"# c #000000", -"......................", -"......................", -"......#...............", -"......#...............", -"......#...............", -"......#...............", -"......#...............", -"......########........", -"......#...............", -"......#...............", -"......#...............", -"......#...............", -"......#...............", -"......########........", -"......#...............", -"......#...............", -"......#...............", -"......#...............", -"......#...............", -"......########........", -"......................", -"......................"}; - -const char * const xpm_single_view[] =3D { -"22 22 2 1", -". c None", -"# c #000000", -"......................", -"......................", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"......................", -"......................"}; - -const char * const xpm_split_view[] =3D { -"22 22 2 1", -". c None", -"# c #000000", -"......................", -"......................", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......................", -"......................"}; - -const char * const xpm_symbol_no[] =3D { -"12 12 2 1", -" c white", -". c black", -" ", -" .......... ", -" . . ", -" . . ", -" . . ", -" . . ", -" . . ", -" . . ", -" . . ", -" . . ", -" .......... ", -" "}; - -const char * const xpm_symbol_mod[] =3D { -"12 12 2 1", -" c white", -". c black", -" ", -" .......... ", -" . . ", -" . . ", -" . .. . ", -" . .... . ", -" . .... . ", -" . .. . ", -" . . ", -" . . ", -" .......... ", -" "}; - -const char * const xpm_symbol_yes[] =3D { -"12 12 2 1", -" c white", -". c black", -" ", -" .......... ", -" . . ", -" . . ", -" . . . ", -" . .. . ", -" . . .. . ", -" . .... . ", -" . .. . ", -" . . ", -" .......... ", -" "}; - -const char * const xpm_choice_no[] =3D { -"12 12 2 1", -" c white", -". c black", -" ", -" .... ", -" .. .. ", -" . . ", -" . . ", -" . . ", -" . . ", -" . . ", -" . . ", -" .. .. ", -" .... ", -" "}; - -const char * const xpm_choice_yes[] =3D { -"12 12 2 1", -" c white", -". c black", -" ", -" .... ", -" .. .. ", -" . . ", -" . .. . ", -" . .... . ", -" . .... . ", -" . .. . ", -" . . ", -" .. .. ", -" .... ", -" "}; - -const char * const xpm_menu[] =3D { -"12 12 2 1", -" c white", -". c black", -" ", -" .......... ", -" . . ", -" . .. . ", -" . .... . ", -" . ...... . ", -" . ...... . ", -" . .... . ", -" . .. . ", -" . . ", -" .......... ", -" "}; - -const char * const xpm_menu_inv[] =3D { -"12 12 2 1", -" c white", -". c black", -" ", -" .......... ", -" .......... ", -" .. ...... ", -" .. .... ", -" .. .. ", -" .. .. ", -" .. .... ", -" .. ...... ", -" .......... ", -" .......... ", -" "}; - -const char * const xpm_menuback[] =3D { -"12 12 2 1", -" c white", -". c black", -" ", -" .......... ", -" . . ", -" . .. . ", -" . .... . ", -" . ...... . ", -" . ...... . ", -" . .... . ", -" . .. . ", -" . . ", -" .......... ", -" "}; - -const char * const xpm_void[] =3D { -"12 12 2 1", -" c white", -". c black", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" "}; diff --git a/scripts/kconfig/images.h b/scripts/kconfig/images.h deleted file mode 100644 index 7212dec2006c..000000000000 --- a/scripts/kconfig/images.h +++ /dev/null @@ -1,33 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * Copyright (C) 2002 Roman Zippel - */ - -#ifndef IMAGES_H -#define IMAGES_H - -#ifdef __cplusplus -extern "C" { -#endif - -extern const char * const xpm_load[]; -extern const char * const xpm_save[]; -extern const char * const xpm_back[]; -extern const char * const xpm_tree_view[]; -extern const char * const xpm_single_view[]; -extern const char * const xpm_split_view[]; -extern const char * const xpm_symbol_no[]; -extern const char * const xpm_symbol_mod[]; -extern const char * const xpm_symbol_yes[]; -extern const char * const xpm_choice_no[]; -extern const char * const xpm_choice_yes[]; -extern const char * const xpm_menu[]; -extern const char * const xpm_menu_inv[]; -extern const char * const xpm_menuback[]; -extern const char * const xpm_void[]; - -#ifdef __cplusplus -} -#endif - -#endif /* IMAGES_H */ diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index b84c9f2485d1..afa73cc4f4fb 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -26,8 +26,6 @@ #include "lkc.h" #include "qconf.h" =20 -#include "images.h" - =20 static QApplication *configApp; static ConfigSettings *configSettings; @@ -1283,13 +1281,14 @@ ConfigMainWindow::ConfigMainWindow(void) move(x.toInt(), y.toInt()); =20 // set up icons - ConfigItem::symbolYesIcon =3D QIcon(QPixmap(xpm_symbol_yes)); - ConfigItem::symbolModIcon =3D QIcon(QPixmap(xpm_symbol_mod)); - ConfigItem::symbolNoIcon =3D QIcon(QPixmap(xpm_symbol_no)); - ConfigItem::choiceYesIcon =3D QIcon(QPixmap(xpm_choice_yes)); - ConfigItem::choiceNoIcon =3D QIcon(QPixmap(xpm_choice_no)); - ConfigItem::menuIcon =3D QIcon(QPixmap(xpm_menu)); - ConfigItem::menubackIcon =3D QIcon(QPixmap(xpm_menuback)); + QString iconsDir =3D QString(getenv("SRCTREE") ? getenv("SRCTREE") : QDir= ::currentPath()) + "/scripts/kconfig/icons/"; + ConfigItem::symbolYesIcon =3D QIcon(QPixmap(iconsDir + "symbol_yes.xpm")); + ConfigItem::symbolModIcon =3D QIcon(QPixmap(iconsDir + "symbol_mod.xpm")); + ConfigItem::symbolNoIcon =3D QIcon(QPixmap(iconsDir + "symbol_no.xpm")); + ConfigItem::choiceYesIcon =3D QIcon(QPixmap(iconsDir + "choice_yes.xpm")); + ConfigItem::choiceNoIcon =3D QIcon(QPixmap(iconsDir + "choice_no.xpm")); + ConfigItem::menuIcon =3D QIcon(QPixmap(iconsDir + "menu.xpm")); + ConfigItem::menubackIcon =3D QIcon(QPixmap(iconsDir + "menuback.xpm")); =20 QWidget *widget =3D new QWidget(this); setCentralWidget(widget); @@ -1312,7 +1311,7 @@ ConfigMainWindow::ConfigMainWindow(void) =20 configList->setFocus(); =20 - backAction =3D new QAction(QPixmap(xpm_back), "Back", this); + backAction =3D new QAction(QPixmap(iconsDir + "back.xpm"), "Back", this); backAction->setShortcut(QKeySequence::Back); connect(backAction, &QAction::triggered, this, &ConfigMainWindow::goBack); @@ -1322,12 +1321,12 @@ ConfigMainWindow::ConfigMainWindow(void) connect(quitAction, &QAction::triggered, this, &ConfigMainWindow::close); =20 - QAction *loadAction =3D new QAction(QPixmap(xpm_load), "&Open", this); + QAction *loadAction =3D new QAction(QPixmap(iconsDir + "load.xpm"), "&Ope= n", this); loadAction->setShortcut(QKeySequence::Open); connect(loadAction, &QAction::triggered, this, &ConfigMainWindow::loadConfig); =20 - saveAction =3D new QAction(QPixmap(xpm_save), "&Save", this); + saveAction =3D new QAction(QPixmap(iconsDir + "save.xpm"), "&Save", this); saveAction->setShortcut(QKeySequence::Save); connect(saveAction, &QAction::triggered, this, &ConfigMainWindow::saveConfig); @@ -1344,15 +1343,15 @@ ConfigMainWindow::ConfigMainWindow(void) searchAction->setShortcut(QKeySequence::Find); connect(searchAction, &QAction::triggered, this, &ConfigMainWindow::searchConfig); - singleViewAction =3D new QAction(QPixmap(xpm_single_view), "Single View",= this); + singleViewAction =3D new QAction(QPixmap(iconsDir + "single_view.xpm"), "= Single View", this); singleViewAction->setCheckable(true); connect(singleViewAction, &QAction::triggered, this, &ConfigMainWindow::showSingleView); - splitViewAction =3D new QAction(QPixmap(xpm_split_view), "Split View", th= is); + splitViewAction =3D new QAction(QPixmap(iconsDir + "split_view.xpm"), "Sp= lit View", this); splitViewAction->setCheckable(true); connect(splitViewAction, &QAction::triggered, this, &ConfigMainWindow::showSplitView); - fullViewAction =3D new QAction(QPixmap(xpm_tree_view), "Full View", this); + fullViewAction =3D new QAction(QPixmap(iconsDir + "tree_view.xpm"), "Full= View", this); fullViewAction->setCheckable(true); connect(fullViewAction, &QAction::triggered, this, &ConfigMainWindow::showFullView); --=20 2.52.0