]> Untitled Git - dockapps/hvclock.git/commitdiff
Removed unused autoconf macro hv-debug
authorHugo Villeneuve <hugo@hugovil.com>
Wed, 6 Jul 2005 02:30:19 +0000 (02:30 +0000)
committerHugo Villeneuve <hugo@hugovil.com>
Wed, 29 May 2013 02:37:23 +0000 (22:37 -0400)
Cleaned-up header files

17 files changed:
Makefile.am
NEWS
config/.gitignore [new file with mode: 0644]
config/hv-debug.m4 [deleted file]
configure.in
doc/hvclock.man
src/calendar.c
src/calendar.h
src/clock.c
src/clock.h
src/dockapp.c
src/dockapp.h
src/hvclock.c
src/hvclock.h
src/options.c
src/xevents.c
src/xevents.h

index 8c6d2871fd013cd71a02c1d54c8eaeb6d0566984..ba93f8f7fd3cd2fadc16d917d47d6712cd9c905e 100644 (file)
@@ -7,7 +7,6 @@ SUBDIRS = src doc
 ## we want these in the dist tarball
 EXTRA_DIST = autogen.sh \
              $(ac_aux_dir)/acx_pthread.m4 \
-             $(ac_aux_dir)/hv-debug.m4 \
              pixmaps
 
 ACLOCAL = aclocal -I $(ac_aux_dir)
diff --git a/NEWS b/NEWS
index 3cf473c07323c56099b1126e0ba9f05ef5eea1b0..f65454b96434789163db76968fe296ef77f4aafe 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,4 @@
 
-2003-04-02: hvclock-0.1.0 has been released.
-       See the file 'ChangeLog' to see what has changed since last version.
+2005-07-05: hvclock-0.1.0 has been released.
+       This is the initial release
+
diff --git a/config/.gitignore b/config/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/config/hv-debug.m4 b/config/hv-debug.m4
deleted file mode 100644 (file)
index f8fc330..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-dnl
-dnl Macro for adding an option to 'configure' for enabling debugging messages
-dnl
-AC_DEFUN([HV_CHECK_FOR_DEBUG],[
-AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
-                                    [enable debugging messages on console
-                                     (default is NO)]),[
-  if test x"${enableval}" = xyes; then
-    debug_messages=1
-    AC_DEFINE([DEBUG],1,[Set to 1 to enable debugging messages.])
-  elif test x"${enableval}" = xno; then
-    debug_messages=0
-  else
-    AC_MSG_ERROR(bad value for --enable-debug option)
-  fi
-], debug_messages=0 )
-])
-
index 535a59557152d3a9c706a83a991d8c00d0d199e4..5c06b3c7b58ab626127ebb7cb833a6c64735ac97 100644 (file)
@@ -23,9 +23,6 @@ AC_C_CONST
 AC_TYPE_PID_T
 AC_TYPE_SIZE_T
 
-dnl Checks for '--enable-debug' option
-HV_CHECK_FOR_DEBUG
-
 dnl Basic CFLAGS values
 CFLAGS="${CFLAGS} -Wall"
 
@@ -86,13 +83,5 @@ echo "  Install path:   ${prefix}"
 echo "  Compiler:       ${CC}"
 echo "  Compiler flags: ${CFLAGS}"
 echo "  Linker flags:   ${LIBS}"
-echo
-echo -n "  Debugging:  "
-if test x"${debug_messages}" = x1; then
-  echo "yes"
-else
-  echo "no"
-fi
-
 echo
 echo "Configure finished. Type 'make' to build."
index 73f9f128ac70f6ebd4389b552a1a5e0a6803b44a..b8d78426598da17cbd89762d7d2f9d8fad5c684c 100644 (file)
@@ -15,6 +15,11 @@ The interface is kept very simple. To switch between calendar view and
 clock view, single-click on the clock or calendar image.
 
 .SH "OPTIONS"
+
+.TP
+\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
index b9603d928b714e1ebb1563bf30a72715b455c5b9..f2a1ca13e5b1c808bb69d48566a5b28726832879 100644 (file)
 #include "calendar.h"
 
 
+#define CALENDAR_BACKGROUND_SRC_X 64
+#define CALENDAR_BACKGROUND_SRC_Y 64
+
+#define WEEKDAYS_BASE_X  3
+#define WEEKDAYS_BASE_Y  65
+#define WEEKDAYS_HEIGHT  10
+#define WEEKDAYS_DELTA_Y 12
+
+#define MONTHS_BASE_X  130
+#define MONTHS_BASE_Y  1
+#define MONTHS_HEIGHT  10
+#define MONTHS_DELTA_Y 11
+
+#define NUMBERS_SRC_X 184
+#define NUMBERS_SRC_Y 0
+#define NUMBERS_DELTA_X 20
+#define NUMBERS_DELTA_Y 27
+
+
 static const int number_widths[]={
   18, /* 0 */
   12, /* 1 */
index 591710a66ffab77d5d859394ceecb2ae62ea37c6..eb2ecc7fc1426f265f715aef689391076abeab05 100644 (file)
@@ -4,28 +4,6 @@
 #ifndef CALENDAR_H
 #define CALENDAR_H 1
 
-/* Constants */
-
-#define CALENDAR_BACKGROUND_SRC_X 64
-#define CALENDAR_BACKGROUND_SRC_Y 64
-
-#define WEEKDAYS_BASE_X  3
-#define WEEKDAYS_BASE_Y  65
-#define WEEKDAYS_HEIGHT  10
-#define WEEKDAYS_DELTA_Y 12
-
-#define MONTHS_BASE_X  130
-#define MONTHS_BASE_Y  1
-#define MONTHS_HEIGHT  10
-#define MONTHS_DELTA_Y 11
-
-#define NUMBERS_SRC_X 184
-#define NUMBERS_SRC_Y 0
-#define NUMBERS_DELTA_X 20
-#define NUMBERS_DELTA_Y 27
-
-
-/* Functions */
 
 void
 UpdateCalendar( void );
index c7efda821d471e4e4250d0107283e299cfd3c1bf..89fc62a0e4960909a7207c5df6cc9b00f049cf1d 100644 (file)
 #include "clock.h"
 
 
+#define SIZE 64
+#define HAND_WIDTH 2
+#define HOUR_HAND_LENGTH 16
+#define MINUTE_HAND_LENGTH 25
+
+
 static const char *clock_cfg =
 "bg_image gfx/2.png "
 "second_hand "
index 7265271ebb6ca3ef436c45fd39f1b33256c8e4fc..1643555d40915602c04971318abdb14e0ed63c95 100644 (file)
@@ -4,15 +4,6 @@
 #ifndef CLOCK_H
 #define CLOCK_H 1
 
-/* Constants */
-
-#define SIZE 64
-#define HAND_WIDTH 2
-#define HOUR_HAND_LENGTH 16
-#define MINUTE_HAND_LENGTH 25
-
-
-/* Functions */
 
 void
 UpdateClock( void );
index 351637f494824319afc69128f882630b6ec47276..71d5f61b751ad8a1ca534e745faa322883f7a9c4 100644 (file)
 #include "dockapp.h"
 
 
+#define XLIB_FAILURE 0
+#define XLIB_SUCCESS 1
+
+/* Specifies the border width */
+#define BWIDTH 1
+
+/* Width and height in pixels of Window Maker icons. */
+#define ICON_SIZE 64
+
+
 static void
 CreateIconFromXpmData( char *pixmap_data[] )
 {
index 996f6c1bfe9d4472d8f010aad946cf3e88014ca4..39fde8c1bab86638a821771181b22e7a6b11c3a6 100644 (file)
@@ -7,16 +7,6 @@
 #include <X11/xpm.h>
 
 
-#define XLIB_FAILURE 0
-#define XLIB_SUCCESS 1
-
-/* Specifies the border width */
-#define BWIDTH 1
-
-/* Width and height in pixels of Window Maker icons. */
-#define ICON_SIZE 64
-
-
 typedef struct XpmIcon
 {
   XpmAttributes attributes;
index f0ecc80c042335627b2c17d0016b5d0eb1073b6f..910c5c3c31f43ef0e36fe41e20528c8f75b27afd 100644 (file)
 #include "hvclock.h"
 
 
+/* Constants */
+#define CLOCK_MODE    0
+#define CALENDAR_MODE 1
+
+
 /* Thread ID */
 static pthread_t timer_thread;
 
@@ -74,9 +79,9 @@ xmalloc( size_t size, const char *filename, int line_number )
 static void
 CatchTimerSignal( /*@unused@*/ int signal )
 {
-#if defined(DEBUG)
+  if( hvclock_infos.debug ) {
     printf( "%s: Catching signal SIGUSR1.\n", PACKAGE );
-#endif
+  }
 }
 
 
@@ -85,9 +90,9 @@ SingleClick( void )
 { 
   int status;
   
-#if defined(DEBUG)
-  printf( "%s: SingleClick() Entry\n", PACKAGE );
-#endif
+  if( hvclock_infos.debug ) {
+    printf( "%s: SingleClick() Entry\n", PACKAGE );
+  }
 
   /* single-click --> changing viewing mode */
   if( mode == CLOCK_MODE )
@@ -103,9 +108,9 @@ SingleClick( void )
     exit( EXIT_FAILURE );
   }
 
-#if defined(DEBUG)
-  printf( "%s: SingleClick() Exit\n", PACKAGE );
-#endif
+  if( hvclock_infos.debug ) {
+    printf( "%s: SingleClick() Exit\n", PACKAGE );
+  }
 }
 
 
@@ -136,9 +141,9 @@ TimerThread( /*@unused@*/ void *arg )
        (the requested time minus the time actually slept) in seconds. */
     time_remaining = sleep( thread_sleep_time );
     if( time_remaining != 0 ) {
-#if defined(DEBUG)
-      printf( "%s: TimerThread() interrupted by signal\n", PACKAGE );
-#endif
+      if( hvclock_infos.debug ) {
+       printf( "%s: TimerThread() interrupted by signal\n", PACKAGE );
+      }
     }
   }
   
index cb02f70997e2de2c2aabbed19e25f85ab6ea0147..c910a8e8c27dcef179829be5847a6421a078a290 100644 (file)
@@ -4,13 +4,10 @@
 #ifndef HVCLOCK_H
 #define HVCLOCK_H 1
 
-/* Constants */
-#define CLOCK_MODE    0
-#define CALENDAR_MODE 1
-
 
 typedef struct hvclock_t
 {
+  bool debug;
   char *display_arg;
   char *geometry_arg;
 } hvclock_t;
index 263d5bfc0d15d4e481404444a9e24612e7e9250b..9b7b5756f6864e94998c3b0331a1407a4c0b9d27 100644 (file)
@@ -29,6 +29,7 @@ DisplayUsage( void )
 {
   printf( "Usage: %s [OPTIONS]...\n", PACKAGE );
   printf( "Dockable analog clock and calendar.\n\n" );
+  printf( "  -d                        Display debugging messages.\n" );
   printf( "  -display <host:display>   X display name\n" );
   printf( "  -geometry +XPOS+YPOS      initial window position\n" );
   printf( "  -h                        display this help and exit\n" );
@@ -74,6 +75,9 @@ ParseCommandLineOptions( int argc, char *argv[] )
   bool display_on     = FALSE;
   bool geometry_on    = FALSE;
 
+  /* Default values. */
+  hvclock_infos.debug = FALSE;
+
   for( i = 1; i < argc; i++ ) {
     token = argv[i];
     switch( token[0] ) {
@@ -84,6 +88,9 @@ ParseCommandLineOptions( int argc, char *argv[] )
        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] ) ) {
index eafe36f1ba09a9a901918844cdc4e3792e33ed89..ea23e0549a328011d40dc5c33c7a967d186d81c7 100644 (file)
 #include "xevents.h"
 
 
+/* Maximum time between mouse double-clicks, in milliseconds */
+#define DOUBLE_CLICK_MAX_INTERVAL_MS 250
+
+
 /* Function pointers to handle single and double mouse click events. */
 void (*SingleClickCallback)( void ) = NULL;
 
index 1d1e3621c7f0a45e696e6e69881ceaa92b4af54b..c3d8a39eb37080b48870b8cb6ad8b71836515200 100644 (file)
@@ -4,10 +4,6 @@
 #define XEVENTS_H 1
 
 
-/* Maximum time between mouse double-clicks, in milliseconds */
-#define DOUBLE_CLICK_MAX_INTERVAL_MS 250
-
-
 void
 ProcessXlibEventsInit( void (*single_click_callback)( void ),
                       void (*double_click_callback)( void ) );