-/* calendar.c -- functions for displaying calendar
- Copyright (C) 2003 Hugo Villeneuve */
-
+/*
+ * calendar.c -- functions for displaying calendar
+ *
+ * Copyright (C) 2005 Hugo Villeneuve <hugo@hugovil.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
#if HAVE_CONFIG_H
# include "config.h"
#include "options.h"
#include "calendar.h"
-
#define CALENDAR_BACKGROUND_SRC_X 64
#define CALENDAR_BACKGROUND_SRC_Y 64
#define NUMBERS_DELTA_X 20
#define NUMBERS_DELTA_Y 27
-
static const int number_widths[]={
18, /* 0 */
12, /* 1 */
43 /* Saturday */
};
-
static int
-DisplayDigit( int digit, int dest_x, int dest_y )
+DisplayDigit(int digit, int dest_x, int dest_y)
{
int src_x, src_y;
- if( ( digit % 2 ) == 0 )
+ if ((digit % 2) == 0)
src_x = NUMBERS_SRC_X; /* First column */
else
src_x = NUMBERS_SRC_X + NUMBERS_DELTA_X; /* Second column */
- src_y = NUMBERS_SRC_Y + ( ( digit / 2 ) * NUMBERS_DELTA_Y );
+ src_y = NUMBERS_SRC_Y + ((digit / 2) * NUMBERS_DELTA_Y);
- copyXPMArea( src_x, src_y, number_widths[digit], NUMBERS_DELTA_Y - 1,
- dest_x, dest_y );
+ copyXPMArea(src_x, src_y, number_widths[digit], NUMBERS_DELTA_Y - 1,
+ dest_x, dest_y);
- return ( dest_x + number_widths[digit] + 1 );
+ return (dest_x + number_widths[digit] + 1);
}
-
static int
GetNumberWidth( int number )
{
return width;
}
-
void
UpdateCalendar( void )
{
-/* calendar.h */
-
+/*
+ * calendar.h
+ *
+ * Copyright (C) 2005 Hugo Villeneuve <hugo@hugovil.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
#ifndef CALENDAR_H
#define CALENDAR_H 1
-
void
-UpdateCalendar( void );
-
+UpdateCalendar(void);
#endif /* CALENDAR_H */
-/* clock.c -- functions for displaying and rendering clock and calendar
- Copyright (C) 2003 Hugo Villeneuve */
-
+/*
+ * clock.c -- functions for displaying and rendering clock and calendar
+ *
+ * Copyright (C) 2005 Hugo Villeneuve <hugo@hugovil.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
/* Define filename_M */
#define CLOCK_M 1
-/* clock.h */
-
+/*
+ * clock.h
+ *
+ * Copyright (C) 2005 Hugo Villeneuve <hugo@hugovil.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
#ifndef CLOCK_H
#define CLOCK_H 1
-
void
-UpdateClock( void );
-
+UpdateClock(void);
#endif /* CLOCK_H */
-/* common.h */
+/*
+ * common.h
+ *
+ * Copyright (C) 2005 Hugo Villeneuve <hugo@hugovil.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
#ifndef COMMON_H
#define COMMON_H 1
-
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
-
/* Common constants. */
#ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
# define TRUE 1
#endif
-
/* Returns TRUE if the strings 'a' and 'b' are equal. */
#define STREQ(a, b) (strcmp((a), (b)) == 0)
/* Returns TRUE if the first 'c' characters of strings 'a' and 'b' are equal. */
#define STREQ_LEN(a, b, c) (strncmp((a), (b), (c)) == 0)
-
inline void
-ErrorLocation( const char *file, int line );
+ErrorLocation(const char *file, int line);
-/*@out@*/ /*@only@*/
void *
-xmalloc( size_t size, const char *filename, int line_number );
-
+xmalloc(size_t size, const char *filename, int line_number);
#endif /* COMMON_H */
-/* dockapp.c -- routines for managing dockapp windows and icons. */
-
+/*
+ * dockapp.c -- routines for managing dockapp windows and icons.
+ *
+ * Copyright (C) 2005 Hugo Villeneuve <hugo@hugovil.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
/* Define filename_M */
#define DOCKAPP_M 1
-/* dockapp.h */
+/*
+ * dockapp.h
+ *
+ * Copyright (C) 2005 Hugo Villeneuve <hugo@hugovil.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
#ifndef DOCKAPP_H
#define DOCKAPP_H 1
-
#include <X11/xpm.h>
-
typedef struct XpmIcon
{
XpmAttributes attributes;
XpmIcon xpm_icon;
} dockapp_t;
-
void
InitDockAppWindow( int argc, char *argv[], char *pixmap_data[],
char *display_arg, char *geometry_arg );
void
copyXPMArea( int x, int y, unsigned int sx, unsigned int sy, int dx, int dy );
-
/* Exported variables */
#undef _SCOPE_
#ifdef DOCKAPP_M
_SCOPE_ dockapp_t dockapp;
-
#endif /* DOCKAPP_H */
-/* hvclock.c -- main program
- Copyright (C) 2003 Hugo Villeneuve */
-
+/*
+ * hvclock.c -- main program
+ *
+ * Copyright (C) 2005 Hugo Villeneuve <hugo@hugovil.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
/* Define filename_M */
#define HVCLOCK_M 1
-/* hvclock.h */
-
+/*
+ * hvclock.h
+ *
+ * Copyright (C) 2005 Hugo Villeneuve <hugo@hugovil.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
#ifndef HVCLOCK_H
#define HVCLOCK_H 1
-
typedef struct hvclock_t
{
bool debug;
_SCOPE_ hvclock_t hvclock_infos;
-
#endif /* HVCLOCK_H */
-/* options.c -- functions for processing command-line options and arguments
- Copyright (C) 2003 Hugo Villeneuve */
-
+/*
+ * options.c -- functions for processing command-line options and arguments
+ *
+ * Copyright (C) 2005 Hugo Villeneuve <hugo@hugovil.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
#if HAVE_CONFIG_H
# include "config.h"
-/* options.h */
+/*
+ * options.h
+ *
+ * Copyright (C) 2005 Hugo Villeneuve <hugo@hugovil.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
#ifndef OPTIONS_H
#define OPTIONS_H 1
-
void
-ParseCommandLineOptions( int argc, char *argv[] );
-
+ParseCommandLineOptions(int argc, char *argv[]);
#endif /* OPTIONS_H */
-/* xevents.c -- handling X events, and detecting single-click and double-click
- * mouse events. */
-
+/*
+ * xevents.c -- handling X events, and detecting single-click and double-click
+ * mouse events.
+ *
+ * Copyright (C) 2005 Hugo Villeneuve <hugo@hugovil.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
#if HAVE_CONFIG_H
# include "config.h"
ProcessXlibEventsInit( void (*single_click_callback)( void ),
void (*double_click_callback)( void ) )
{
- int status;
+ int status;
/* This must be called before any other XLib functions. */
status = XInitThreads();
-/* xevents.h */
+/*
+ * xevents.h
+ *
+ * Copyright (C) 2005 Hugo Villeneuve <hugo@hugovil.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
#ifndef XEVENTS_H
#define XEVENTS_H 1
-
void
-ProcessXlibEventsInit( void (*single_click_callback)( void ),
- void (*double_click_callback)( void ) );
+ProcessXlibEventsInit(void (*single_click_callback)(void),
+ void (*double_click_callback)(void));
void
-ProcessXlibEvents( void );
-
+ProcessXlibEvents(void);
#endif /* XEVENTS_H */
-