From ce5b4693b78f270fa47835e65f9060726297b6b0 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Sat, 20 Jul 2013 11:13:11 -0400 Subject: [PATCH] Remove display and geometry command line options These options are never used for a dockapp as WindowMaker position our dockapp automatically in the dock area. As for the display option, the same can be achieved using the DISPLAY environment variable. --- doc/dockbatmon.man | 11 ----------- src/dockapp.c | 2 +- src/dockapp.h | 2 +- src/main.c | 3 +-- src/main.h | 2 -- src/options.c | 28 ++-------------------------- 6 files changed, 5 insertions(+), 43 deletions(-) diff --git a/doc/dockbatmon.man b/doc/dockbatmon.man index 6a87304..3ae89a5 100644 --- a/doc/dockbatmon.man +++ b/doc/dockbatmon.man @@ -17,17 +17,6 @@ of a laptop battery for the WindowMaker window manager. \fB\-d\fR display debugging messages. -.TP -.BI \-display " host" : display -specifies the host and screen to be used by \fBdockbatmon\fR. By default this -is obtained from the environment variable -.SB DISPLAY. - -.TP -.BI \-geometry " geometry" -.RB ( *geometry ) -specifies the initial geometry of the window. - .TP \fB\-h\fR display usage and exit diff --git a/src/dockapp.c b/src/dockapp.c index 87da243..c184895 100644 --- a/src/dockapp.c +++ b/src/dockapp.c @@ -122,7 +122,7 @@ dockapp_set_mask(GtkWidget *iconwin, char **xpm) * New window creation and initialization for a Dockable Application ******************************************************************************/ void -dockapp_init(int argc, char *argv[], char *display_arg, char *geometry_arg) +dockapp_init(int argc, char *argv[]) { GtkWidget *dockwin; GtkWidget *iconwin; diff --git a/src/dockapp.h b/src/dockapp.h index 5ae2ac5..28dec5e 100644 --- a/src/dockapp.h +++ b/src/dockapp.h @@ -25,7 +25,7 @@ #include void -dockapp_init(int argc, char *argv[], char *display_arg, char *geometry_arg); +dockapp_init(int argc, char *argv[]); void dockapp_set_mask(GtkWidget *iconwin, char **xpm); diff --git a/src/main.c b/src/main.c index 5182a9b..860c7f8 100644 --- a/src/main.c +++ b/src/main.c @@ -51,8 +51,7 @@ int main(int argc, char *argv[]) ParseCommandLineOptions(argc, argv); /* Initializing and creating a DockApp window. */ - dockapp_init(argc, argv, batmon_infos.display_arg, - batmon_infos.geometry_arg); + dockapp_init(argc, argv); gtk_main(); diff --git a/src/main.h b/src/main.h index b68c32e..b0be521 100644 --- a/src/main.h +++ b/src/main.h @@ -23,8 +23,6 @@ struct batmon_t { int debug; - char *display_arg; - char *geometry_arg; }; /* Exported variables */ diff --git a/src/options.c b/src/options.c index bafe665..3de6e37 100644 --- a/src/options.c +++ b/src/options.c @@ -45,8 +45,6 @@ static void DisplayUsage(void) printf("Dockable analog clock and calendar.\n\n"); printf (" -d Display debugging messages.\n"); - printf(" -display X display name\n"); - printf(" -geometry +XPOS+YPOS initial window position\n"); printf(" -h display this help and exit\n"); printf(" -version display version information"); printf(" and exit\n"); @@ -82,8 +80,6 @@ void ParseCommandLineOptions(int argc, char *argv[]) { int i; char *token; - int display_on = false; - int geometry_on = false; /* Default values. */ batmon_infos.debug = false; @@ -95,14 +91,7 @@ void ParseCommandLineOptions(int argc, char *argv[]) /* Processing options names */ switch (token[1]) { case 'd': - if (STREQ("display", &token[1])) - display_on = true; - else if (strlen(&token[1]) == 1) - batmon_infos.debug = true; - break; - case 'g': - if (STREQ("geometry", &token[1])) - geometry_on = true; + batmon_infos.debug = true; break; case 'h': DisplayUsage(); @@ -121,21 +110,8 @@ void ParseCommandLineOptions(int argc, char *argv[]) break; default: /* Processing options arguments */ - if (display_on != false) { - display_on = false; - batmon_infos.display_arg = token; - } else if (geometry_on != false) { - geometry_on = false; - batmon_infos.geometry_arg = token; - } else { - InvalidOption("invalid option", token); - } + InvalidOption("invalid option", token); break; } /* end switch( token[0] ) */ } /* end for */ - - if (display_on != false) - InvalidOption("missing display parameter", NULL); - else if (geometry_on != false) - InvalidOption("missing geometry parameter", NULL); } -- 2.20.1