diff options
author | Perberos <[email protected]> | 2012-02-22 01:57:06 -0300 |
---|---|---|
committer | Perberos <[email protected]> | 2012-02-22 01:57:06 -0300 |
commit | 341fc293a5edc0dda25c4a8d465d19bd293fb6da (patch) | |
tree | c5890be2a057599ee512e2cbf54dfb5b17e93a57 /mate-about/mate-about.h | |
parent | c72d30463c6def093499fac8b4b55885975e799d (diff) | |
download | mate-desktop-341fc293a5edc0dda25c4a8d465d19bd293fb6da.tar.bz2 mate-desktop-341fc293a5edc0dda25c4a8d465d19bd293fb6da.tar.xz |
GOptionEntry was added on glib 2.6
Diffstat (limited to 'mate-about/mate-about.h')
-rw-r--r-- | mate-about/mate-about.h | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/mate-about/mate-about.h b/mate-about/mate-about.h index bfa1050..2eb41c8 100644 --- a/mate-about/mate-about.h +++ b/mate-about/mate-about.h @@ -29,6 +29,20 @@ #include <unique/unique.h> #endif +/* "Commandline option parser" fue introducida a la GLIB a partir de la + * version 2.6, esta definicion es para la compatibilidad GTK1.2 */ +#if GLIB_CHECK_VERSION(2, 6, 0) + #define G_OPTIONS_ENTRY_USE +#endif + +/* Debido a que GOptions no está disponible en GLIB versiones inferiores a 2.6 + * voy a utilizar la alternativa de GNU C, */ +#ifdef G_OPTIONS_ENTRY_USE + /* No hay nesecidad de incluir nada, viene por defecto en <glib/glib.h> */ +#else + #include <getopt.h> +#endif + //class mate_about //{ const char* program_name = "MATE Desktop Environment"; @@ -649,10 +663,31 @@ #endif // for command line - static GOptionEntry command_entries[] = { - {"version", 'v', 0, G_OPTION_ARG_NONE, &mate_about_nogui, "Show release version", NULL}, - {NULL} - }; + #ifdef G_OPTIONS_ENTRY_USE + /* GOptionEntry ofrese la posibilidad de acceder a las opciones extras + * de GTK desde la linea de comandos. Tambien muestra automaticamente + * las opciones al llamar --help o -h */ + static GOptionEntry command_entries[] = { + {"version", 'v', 0, G_OPTION_ARG_NONE, &mate_about_nogui, "Show release version", NULL}, + {NULL} + }; + #else + + + /* Quizás hay que agregar una opcion para --help + */ + static struct option command_entries[] = { + #ifdef CMDLINE_OPTIONS + CMDLINE_OPTIONS + #endif + + #define OPTION_VERSION 1000 + {"version", no_argument, NULL, OPTION_VERSION}, + + {NULL, 0, NULL, 0} + }; + #endif + //} #endif /* __MATE_ABOUT_H__ */ |