From e7eab579978220556a4ea7a7fb1dc070b3184867 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sun, 26 Feb 2012 11:25:31 +0100 Subject: [PATCH] frontends: share the images definitions across graphical frontends The images definitions are currently duplicated in the two graphical frontends. Make it a common include file. Signed-off-by: "Yann E. MORIN" --- configure.ac | 1 + frontends/gconf/Makefile.am | 2 +- frontends/gconf/gconf.c | 2 +- frontends/gconf/gconf.c.patch | 9 + frontends/qconf/Makefile.am | 8 +- frontends/qconf/images.c | 326 ------------------ frontends/qconf/qconf.cc | 2 +- frontends/qconf/qconf.cc.patch | 12 + libs/Makefile.am | 2 +- libs/images/Makefile.am | 1 + .../gconf/images.c => libs/images/images.h | 0 misc/kernel2kfrontends.list | 3 +- 12 files changed, 32 insertions(+), 336 deletions(-) delete mode 100644 frontends/qconf/images.c create mode 100644 frontends/qconf/qconf.cc.patch create mode 100644 libs/images/Makefile.am rename frontends/gconf/images.c => libs/images/images.h (100%) diff --git a/configure.ac b/configure.ac index 5a6acef..f0dd26c 100644 --- a/configure.ac +++ b/configure.ac @@ -333,6 +333,7 @@ AC_SUBST( AC_CONFIG_FILES([ Makefile libs/Makefile + libs/images/Makefile libs/lxdialog/Makefile libs/parser/Makefile frontends/Makefile diff --git a/frontends/gconf/Makefile.am b/frontends/gconf/Makefile.am index 310198e..be0c7b9 100644 --- a/frontends/gconf/Makefile.am +++ b/frontends/gconf/Makefile.am @@ -1,10 +1,10 @@ bin_PROGRAMS = gconf gconf_SOURCES = gconf.c gconf.glade -dist_EXTRA_gconf_SOURCES = images.c gconf_CPPFLAGS = $(AM_CPPFLAGS) \ $(GETTEXT) \ -I../../libs/parser \ + -I../../libs/images \ -DGUI_PATH='"$(pkgdatadir)/gconf.glade"' gconf_CFLAGS = $(AM_CFLAGS) \ $(gtk_CFLAGS) diff --git a/frontends/gconf/gconf.c b/frontends/gconf/gconf.c index d8eb3dd..a40292c 100644 --- a/frontends/gconf/gconf.c +++ b/frontends/gconf/gconf.c @@ -11,7 +11,7 @@ #endif #include "lkc.h" -#include "images.c" +#include "images.h" #include #include diff --git a/frontends/gconf/gconf.c.patch b/frontends/gconf/gconf.c.patch index 05a6e81..c27f650 100644 --- a/frontends/gconf/gconf.c.patch +++ b/frontends/gconf/gconf.c.patch @@ -1,6 +1,15 @@ diff --git a/frontends/gconf/gconf.c b/frontends/gconf/gconf.c --- a/frontends/gconf/gconf.c +++ b/frontends/gconf/gconf.c +@@ -11,7 +11,7 @@ + #endif + + #include "lkc.h" +-#include "images.c" ++#include "images.h" + + #include + #include @@ -1469,7 +1469,7 @@ { const char *name; diff --git a/frontends/qconf/Makefile.am b/frontends/qconf/Makefile.am index f93fe70..a27bab1 100644 --- a/frontends/qconf/Makefile.am +++ b/frontends/qconf/Makefile.am @@ -1,11 +1,11 @@ bin_PROGRAMS = qconf qconf_SOURCES = qconf.cc qconf.h -dist_EXTRA_qconf_SOURCES = images.c BUILT_SOURCES = qconf.moc -qconf_CPPFLAGS = $(AM_CPPFLAGS) \ - $(GETTEXT) \ - -I../../libs/parser +qconf_CPPFLAGS = $(AM_CPPFLAGS) \ + $(GETTEXT) \ + -I../../libs/parser \ + -I../../libs/images qconf_CXXFLAGS = $(AM_CXXFLAGS) \ $(qt4_CFLAGS) qconf_LDADD = $(qt4_LIBS) \ diff --git a/frontends/qconf/images.c b/frontends/qconf/images.c deleted file mode 100644 index d4f84bd..0000000 --- a/frontends/qconf/images.c +++ /dev/null @@ -1,326 +0,0 @@ -/* - * Copyright (C) 2002 Roman Zippel - * Released under the terms of the GNU GPL v2.0. - */ - -static const char *xpm_load[] = { -"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##......", -"###############.......", -"......................"}; - -static const char *xpm_save[] = { -"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#.", -"..##################..", -"......................"}; - -static const char *xpm_back[] = { -"22 22 3 1", -". c None", -"# c #000083", -"a c #838183", -"......................", -"......................", -"......................", -"......................", -"......................", -"...........######a....", -"..#......##########...", -"..##...####......##a..", -"..###.###.........##..", -"..######..........##..", -"..#####...........##..", -"..######..........##..", -"..#######.........##..", -"..########.......##a..", -"...............a###...", -"...............###....", -"......................", -"......................", -"......................", -"......................", -"......................", -"......................"}; - -static const char *xpm_tree_view[] = { -"22 22 2 1", -". c None", -"# c #000000", -"......................", -"......................", -"......#...............", -"......#...............", -"......#...............", -"......#...............", -"......#...............", -"......########........", -"......#...............", -"......#...............", -"......#...............", -"......#...............", -"......#...............", -"......########........", -"......#...............", -"......#...............", -"......#...............", -"......#...............", -"......#...............", -"......########........", -"......................", -"......................"}; - -static const char *xpm_single_view[] = { -"22 22 2 1", -". c None", -"# c #000000", -"......................", -"......................", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"..........#...........", -"......................", -"......................"}; - -static const char *xpm_split_view[] = { -"22 22 2 1", -". c None", -"# c #000000", -"......................", -"......................", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......#......#........", -"......................", -"......................"}; - -static const char *xpm_symbol_no[] = { -"12 12 2 1", -" c white", -". c black", -" ", -" .......... ", -" . . ", -" . . ", -" . . ", -" . . ", -" . . ", -" . . ", -" . . ", -" . . ", -" .......... ", -" "}; - -static const char *xpm_symbol_mod[] = { -"12 12 2 1", -" c white", -". c black", -" ", -" .......... ", -" . . ", -" . . ", -" . .. . ", -" . .... . ", -" . .... . ", -" . .. . ", -" . . ", -" . . ", -" .......... ", -" "}; - -static const char *xpm_symbol_yes[] = { -"12 12 2 1", -" c white", -". c black", -" ", -" .......... ", -" . . ", -" . . ", -" . . . ", -" . .. . ", -" . . .. . ", -" . .... . ", -" . .. . ", -" . . ", -" .......... ", -" "}; - -static const char *xpm_choice_no[] = { -"12 12 2 1", -" c white", -". c black", -" ", -" .... ", -" .. .. ", -" . . ", -" . . ", -" . . ", -" . . ", -" . . ", -" . . ", -" .. .. ", -" .... ", -" "}; - -static const char *xpm_choice_yes[] = { -"12 12 2 1", -" c white", -". c black", -" ", -" .... ", -" .. .. ", -" . . ", -" . .. . ", -" . .... . ", -" . .... . ", -" . .. . ", -" . . ", -" .. .. ", -" .... ", -" "}; - -static const char *xpm_menu[] = { -"12 12 2 1", -" c white", -". c black", -" ", -" .......... ", -" . . ", -" . .. . ", -" . .... . ", -" . ...... . ", -" . ...... . ", -" . .... . ", -" . .. . ", -" . . ", -" .......... ", -" "}; - -static const char *xpm_menu_inv[] = { -"12 12 2 1", -" c white", -". c black", -" ", -" .......... ", -" .......... ", -" .. ...... ", -" .. .... ", -" .. .. ", -" .. .. ", -" .. .... ", -" .. ...... ", -" .......... ", -" .......... ", -" "}; - -static const char *xpm_menuback[] = { -"12 12 2 1", -" c white", -". c black", -" ", -" .......... ", -" . . ", -" . .. . ", -" . .... . ", -" . ...... . ", -" . ...... . ", -" . .... . ", -" . .. . ", -" . . ", -" .......... ", -" "}; - -static const char *xpm_void[] = { -"12 12 2 1", -" c white", -". c black", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" "}; diff --git a/frontends/qconf/qconf.cc b/frontends/qconf/qconf.cc index df274fe..1b2b086 100644 --- a/frontends/qconf/qconf.cc +++ b/frontends/qconf/qconf.cc @@ -46,7 +46,7 @@ #include "qconf.h" #include "qconf.moc" -#include "images.c" +#include "images.h" #ifdef _ # undef _ diff --git a/frontends/qconf/qconf.cc.patch b/frontends/qconf/qconf.cc.patch new file mode 100644 index 0000000..fb7a129 --- /dev/null +++ b/frontends/qconf/qconf.cc.patch @@ -0,0 +1,12 @@ +diff --git a/frontends/qconf/qconf.cc b/frontends/qconf/qconf.cc +--- a/frontends/qconf/qconf.cc ++++ b/frontends/qconf/qconf.cc +@@ -46,7 +46,7 @@ + #include "qconf.h" + + #include "qconf.moc" +-#include "images.c" ++#include "images.h" + + #ifdef _ + # undef _ diff --git a/libs/Makefile.am b/libs/Makefile.am index 43dae80..5069f5d 100644 --- a/libs/Makefile.am +++ b/libs/Makefile.am @@ -1,4 +1,4 @@ if COND_lxdialog MAYBE_lxdialog = lxdialog endif -SUBDIRS = parser $(MAYBE_lxdialog) +SUBDIRS = parser images $(MAYBE_lxdialog) diff --git a/libs/images/Makefile.am b/libs/images/Makefile.am new file mode 100644 index 0000000..d9c4123 --- /dev/null +++ b/libs/images/Makefile.am @@ -0,0 +1 @@ +EXTRA_DIST = images.h diff --git a/frontends/gconf/images.c b/libs/images/images.h similarity index 100% rename from frontends/gconf/images.c rename to libs/images/images.h diff --git a/misc/kernel2kfrontends.list b/misc/kernel2kfrontends.list index bb7f4ec..78a7829 100644 --- a/misc/kernel2kfrontends.list +++ b/misc/kernel2kfrontends.list @@ -25,6 +25,5 @@ scripts/kconfig/lxdialog/yesno.c --> libs/lxdialog/yesno.c scripts/kconfig/lxdialog/menubox.c --> libs/lxdialog/menubox.c scripts/kconfig/lxdialog/dialog.h --> libs/lxdialog/dialog.h scripts/kconfig/nconf.h --> frontends/nconf/nconf.h -scripts/kconfig/images.c --> frontends/qconf/images.c -scripts/kconfig/images.c --> frontends/gconf/images.c +scripts/kconfig/images.c --> libs/images/images.h scripts/kconfig/lkc.h --> libs/parser/lkc.h -- 2.39.5