From aacb2c1aa1e852bdc45abca163f13e199707c5e3 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Sat, 20 Jul 2013 10:53:06 -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/hvclock.man | 11 ----------- src/dockapp.c | 2 +- src/dockapp.h | 2 +- src/hvclock.c | 3 +-- src/hvclock.h | 2 -- src/options.c | 30 +++--------------------------- 6 files changed, 6 insertions(+), 44 deletions(-) diff --git a/doc/hvclock.man b/doc/hvclock.man index eb28fad..a6a4b6d 100644 --- a/doc/hvclock.man +++ b/doc/hvclock.man @@ -20,17 +20,6 @@ clock view, single-click on the clock or calendar image. \fB\-d\fR display debugging messages. -.TP -.BI \-display " host" : display -specifies the host and screen to be used by \fBhvclock\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 d7e268e..df61e5e 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/hvclock.c b/src/hvclock.c index 435bd6d..d4dfae7 100644 --- a/src/hvclock.c +++ b/src/hvclock.c @@ -51,8 +51,7 @@ int main(int argc, char *argv[]) ParseCommandLineOptions(argc, argv); /* Initializing and creating a DockApp window. */ - dockapp_init(argc, argv, hvclock_infos.display_arg, - hvclock_infos.geometry_arg); + dockapp_init(argc, argv); gtk_main(); diff --git a/src/hvclock.h b/src/hvclock.h index 22ca15a..074bd58 100644 --- a/src/hvclock.h +++ b/src/hvclock.h @@ -25,8 +25,6 @@ struct hvclock_t { int debug; int show_seconds; int dockapp_mode; - char *display_arg; - char *geometry_arg; }; /* Exported variables */ diff --git a/src/options.c b/src/options.c index bcf1d52..0b305e7 100644 --- a/src/options.c +++ b/src/options.c @@ -44,9 +44,7 @@ static void DisplayUsage(void) printf("Usage: %s [OPTIONS]...\n", PACKAGE); 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"); + (" -d display debugging messages.\n"); printf(" -h display this help and exit\n"); printf(" -n disable dockapp mode\n"); printf(" -s display seconds hand\n"); @@ -84,8 +82,6 @@ void ParseCommandLineOptions(int argc, char *argv[]) { int i; char *token; - int display_on = false; - int geometry_on = false; /* Default values. */ hvclock_infos.debug = false; @@ -99,14 +95,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) - hvclock_infos.debug = true; - break; - case 'g': - if (STREQ("geometry", &token[1])) - geometry_on = true; + hvclock_infos.debug = true; break; case 'h': DisplayUsage(); @@ -131,21 +120,8 @@ void ParseCommandLineOptions(int argc, char *argv[]) break; default: /* Processing options arguments */ - if (display_on != false) { - display_on = false; - hvclock_infos.display_arg = token; - } else if (geometry_on != false) { - geometry_on = false; - hvclock_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