From ff19c165eda1374eb7f2e3b154040f1ded9ee6ba Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Fri, 20 Jan 2012 22:23:09 +0100 Subject: [PATCH] frontends: add qconf Signed-off-by: "Yann E. MORIN" --- .hgignore | 2 + configure.ac | 28 +++- frontends/Makefile.am | 5 +- frontends/qconf/Makefile.am | 15 ++ frontends/qconf/images.c | 326 ++++++++++++++++++++++++++++++++++++ 5 files changed, 373 insertions(+), 3 deletions(-) create mode 100644 frontends/qconf/Makefile.am create mode 100644 frontends/qconf/images.c diff --git a/.hgignore b/.hgignore index ec7eb5d..b5aff72 100644 --- a/.hgignore +++ b/.hgignore @@ -8,6 +8,8 @@ frontends/conf/conf frontends/gconf/gconf frontends/mconf/mconf frontends/nconf/nconf +frontends/qconf/qconf +frontends/qconf/qconf.moc libs/parser/?conf.c diff --git a/configure.ac b/configure.ac index 9b6bf39..2827968 100644 --- a/configure.ac +++ b/configure.ac @@ -66,6 +66,12 @@ AC_ARG_ENABLE( [--enable-gconf], [gconf, the GTK-based frontend (default=yes)])]) AC_SUBST([enable_gconf], [${enable_gconf:-yes}]) +AC_ARG_ENABLE( + [qconf], + [AS_HELP_STRING( + [--enable-qconf], + [qconf, the QT-based frontend (default=yes)])]) +AC_SUBST([enable_qconf], [${enable_qconf:-yes}]) #---------------------------------------- # Some program checks @@ -113,15 +119,29 @@ AS_IF( [test -z "$ac_ct_curses_lib_found"], [AC_MSG_ERROR([could not find curses library])]) +#---------------------------------------- +# Check pkg-config if needed +AS_IF( + [test "$enable_gconf" = "yes" \ + -o "$enable_qconf" = "yes"], + [PKG_PROG_PKG_CONFIG()]) + #---------------------------------------- # Check headers and libs for gconf AS_IF( [test "$enable_gconf" = yes ], - [PKG_PROG_PKG_CONFIG() - PKG_CHECK_MODULES( + [PKG_CHECK_MODULES( [gtk], [gtk+-2.0 gmodule-2.0 libglade-2.0])]) +#---------------------------------------- +# Check headers and libs for gconf +AS_IF( + [test "$enable_qconf" = "yes"], + [PKG_CHECK_MODULES( + [qt4], + [QtCore QtGui Qt3Support])]) + #--------------------------------------------------------------------------- # Prepare automake AM_INIT_AUTOMAKE @@ -138,6 +158,9 @@ AM_CONDITIONAL( AM_CONDITIONAL( [COND_gconf], [test "$enable_gconf" = "yes"]) +AM_CONDITIONAL( + [COND_qconf], + [test "$enable_qconf" = "yes"]) #---------------------------------------- # Finalise @@ -151,5 +174,6 @@ AC_CONFIG_FILES([ frontends/mconf/Makefile frontends/nconf/Makefile frontends/gconf/Makefile + frontends/qconf/Makefile ]) AC_OUTPUT diff --git a/frontends/Makefile.am b/frontends/Makefile.am index f8f24ab..0badbc8 100644 --- a/frontends/Makefile.am +++ b/frontends/Makefile.am @@ -10,4 +10,7 @@ endif if COND_gconf MAYBE_gconf = gconf endif -SUBDIRS = $(MAYBE_conf) $(MAYBE_mconf) $(MAYBE_nconf) $(MAYBE_gconf) +if COND_qconf + MAYBE_qconf = qconf +endif +SUBDIRS = $(MAYBE_conf) $(MAYBE_mconf) $(MAYBE_nconf) $(MAYBE_gconf) $(MAYBE_qconf) diff --git a/frontends/qconf/Makefile.am b/frontends/qconf/Makefile.am new file mode 100644 index 0000000..0f4b199 --- /dev/null +++ b/frontends/qconf/Makefile.am @@ -0,0 +1,15 @@ +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_CXXFLAGS = $(AM_CXXFLAGS) \ + $(qt4_CFLAGS) +qconf_LDADD = $(qt4_LIBS) \ + ../../libs/parser/libkconfigparser.a + +.h.moc: + moc -i $< -o $@ diff --git a/frontends/qconf/images.c b/frontends/qconf/images.c new file mode 100644 index 0000000..d4f84bd --- /dev/null +++ b/frontends/qconf/images.c @@ -0,0 +1,326 @@ +/* + * 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", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" "}; -- 2.39.5