… | |
… | |
39 | #include <X11/Xlib.h> |
39 | #include <X11/Xlib.h> |
40 | #include <X11/Xutil.h> |
40 | #include <X11/Xutil.h> |
41 | |
41 | |
42 | #include "ecb.h" |
42 | #include "ecb.h" |
43 | |
43 | |
|
|
44 | #include "version.h" |
|
|
45 | |
44 | #define APL_CLASS "Clock" |
46 | #define APL_CLASS "Clock" |
45 | #define APL_NAME "rclock" |
47 | #define APL_NAME "rclock" |
46 | #define MSG_CLASS "Appointment" |
48 | #define MSG_CLASS "Appointment" |
47 | #define MSG_NAME "Appointment" |
49 | #define MSG_NAME "Appointment" |
48 | #define CONFIG_FILE ".rclock" |
50 | #define CONFIG_FILE ".rclock" |
49 | |
51 | |
50 | #ifndef EXIT_SUCCESS /* missed from <stdlib.h> ? */ |
52 | #ifndef EXIT_SUCCESS /* missed from <stdlib.h> ? */ |
51 | # define EXIT_SUCCESS 0 |
53 | # define EXIT_SUCCESS 0 |
52 | # define EXIT_FAILURE 1 |
54 | # define EXIT_FAILURE 1 |
53 | #endif |
55 | #endif |
54 | |
|
|
55 | #define VERSION "TODO: fetch from urxvt somehow" |
|
|
56 | |
56 | |
57 | /*--------------------------------*-C-*---------------------------------* |
57 | /*--------------------------------*-C-*---------------------------------* |
58 | * Compile-time configuration. |
58 | * Compile-time configuration. |
59 | *----------------------------------------------------------------------* |
59 | *----------------------------------------------------------------------* |
60 | * Copyright (C) 1997 1998 mj olesen <olesen@me.QueensU.CA> |
60 | * Copyright (C) 1997 1998 mj olesen <olesen@me.QueensU.CA> |
… | |
… | |
356 | # endif |
356 | # endif |
357 | #endif |
357 | #endif |
358 | {"#geom", "icon window geometry"} |
358 | {"#geom", "icon window geometry"} |
359 | }; |
359 | }; |
360 | |
360 | |
361 | fprintf (stderr, "\nUsage v" VERSION ":\n " APL_NAME " [options]\n\n" "where options include:\n"); |
361 | fprintf (stderr, "\nUsage for urclock version " VERSION "\n\n urclock [options]\n\n" "where options include:\n"); |
362 | |
362 | |
363 | for (i = 0; i < (int)optList_size (); i++) |
363 | for (i = 0; i < (int)optList_size (); i++) |
364 | fprintf (stderr, " %-29s%s\n", optList[i].opt, optList[i].desc); |
364 | fprintf (stderr, " %-29s%s\n", optList[i].opt, optList[i].desc); |
365 | } |
365 | } |
366 | |
366 | |
… | |
… | |
1039 | #if defined(REMINDERS) && defined(DATE_ON_CLOCK_FACE) |
1039 | #if defined(REMINDERS) && defined(DATE_ON_CLOCK_FACE) |
1040 | if (show_date) |
1040 | if (show_date) |
1041 | { |
1041 | { |
1042 | char date[10]; |
1042 | char date[10]; |
1043 | |
1043 | |
1044 | currentTime = time (NULL) + adjustTime; /* get the current time */ |
|
|
1045 | tmval = localtime (¤tTime); |
|
|
1046 | strftime (date, sizeof (date), "%d", tmval); |
1044 | strftime (date, sizeof (date), "%d", tmval); |
1047 | XDrawString (Xdisplay, W->win, X_gc, |
1045 | XDrawString (Xdisplay, W->win, X_gc, |
1048 | ctr_x - XTextWidth (Xfont, date, strlen (date)) / 2, |
1046 | ctr_x - XTextWidth (Xfont, date, strlen (date)) / 2, |
1049 | ctr_y + FontHeight () + (ctr_y - FontHeight ()) / 2, date, strlen (date)); |
1047 | ctr_y + FontHeight () + (ctr_y - FontHeight ()) / 2, date, strlen (date)); |
1050 | } |
1048 | } |