--- wmclockmon-0.8.1.orig/configure.ac +++ wmclockmon-0.8.1/configure.ac @@ -98,7 +98,7 @@ ignore_buffers=yes ignore_cached=yes ;; -freebsd*) +[k]freebsd*) OS=freebsd ignore_wired=yes ignore_cached=yes --- wmclockmon-0.8.1.orig/wmclockmon-cal/mainwindow.c +++ wmclockmon-0.8.1/wmclockmon-cal/mainwindow.c @@ -51,7 +51,6 @@ gtk_widget_hide(calendar); gtk_widget_hide(closewindow); gtk_widget_grab_default(GTK_WIDGET(cancel)); - gtk_widget_draw_default(GTK_WIDGET(cancel)); gtk_widget_grab_focus(GTK_WIDGET(edit)); gtk_widget_show(text_buttons); gtk_widget_show(edit); @@ -69,7 +68,6 @@ gtk_widget_hide(cancel); gtk_widget_show(calendar); gtk_widget_grab_default(GTK_WIDGET(closewindow)); - gtk_widget_draw_default(GTK_WIDGET(closewindow)); gtk_widget_grab_focus(GTK_WIDGET(closewindow)); gtk_widget_show(closewindow); } @@ -93,13 +91,20 @@ FILE *file; char *filename = get_file(datestr); + GtkTextIter iter; + GtkTextBuffer *buf; + + buf = GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(edit))); + gtk_text_buffer_get_end_iter(GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(edit))), &iter); + gtk_text_buffer_place_cursor(GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(edit))), &iter); + if ((file = fopen(filename, "r")) != NULL) { while (! feof(file)) { char line[MAXSTRLEN + 1]; bzero(line, MAXSTRLEN + 1); fgets(line, MAXSTRLEN, file); if (line[0] != 0) - gtk_text_insert(GTK_TEXT(edit), NULL, NULL, NULL, line, -1); + gtk_text_buffer_insert(buf, &iter, line, -1); } fclose(file); } @@ -128,7 +133,7 @@ static void to_button(int button) { - if (dateb == 0) dateb == button; + if (dateb == 0) dateb = button; if (button != dateb) { int b = dateb; dateb = button; @@ -138,7 +143,7 @@ static void set_buttons_text() { - int year, month, day; + unsigned int year, month, day; char datestr[MAXSTRLEN + 1]; bzero(datestr, MAXSTRLEN + 1); @@ -154,21 +159,14 @@ static void editor_flush() { - int cont = TRUE; - - while (cont) { - cont = gtk_text_backward_delete(GTK_TEXT(edit), 1); - } - cont = TRUE; - while (cont) { - cont = gtk_text_forward_delete(GTK_TEXT(edit), 1); - } + gtk_text_buffer_set_text(GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(edit))), "", 0); } static void editor_fill(int which) { - char *filename, *dstr; - GtkWidget *label; + char *dstr; + GtkWidget *label = NULL; + GtkTextIter iter; switch (which) { case UNIQUE: label = label_u; break; @@ -179,11 +177,10 @@ gtk_label_get(GTK_LABEL(label), &dstr); strcpy(daystr, dstr); to_button(which); - gtk_text_freeze(GTK_TEXT(edit)); editor_flush(); load_file(daystr); - gtk_text_set_point(GTK_TEXT(edit), gtk_text_get_length(GTK_TEXT(edit))); - gtk_text_thaw(GTK_TEXT(edit)); + gtk_text_buffer_get_end_iter(GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(edit))), &iter); + gtk_text_buffer_place_cursor(GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(edit))), &iter); } @@ -225,23 +222,28 @@ char *dirname = xmalloc(len + 2); struct stat stat_buf; + GtkTextIter ts, te; + gchar *tbuf; + int tlen; + + tlen = gtk_text_buffer_get_char_count(GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(edit)))); + gtk_text_buffer_get_bounds(GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(edit))), &ts, &te); + sprintf(dirname, "%s/%s", robust_home(), DEFAULT_CONFIGDIR); - if (gtk_text_get_length(GTK_TEXT(edit)) > 0) { + if (tlen > 0) { if (! ((stat(dirname, &stat_buf) == 0) && S_ISDIR(stat_buf.st_mode))) mkdir(dirname, 0755); if ((stat(dirname, &stat_buf) == 0) && S_ISDIR(stat_buf.st_mode)) { FILE *file = fopen(filename, "w"); - int year, month, day; + unsigned int year, month, day; if (file) { - int i; - for (i = 0 ; i < gtk_text_get_length(GTK_TEXT(edit)) ; i++) { - char t = GTK_TEXT_INDEX(GTK_TEXT(edit), i); - fprintf(file, "%c", t); - } - fflush(file); - fclose(file); + tbuf = gtk_text_buffer_get_text(GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(edit))), &ts, &te, TRUE); + fprintf(file, "%s", tbuf); + g_free(tbuf); + fflush(file); + fclose(file); } gtk_calendar_get_date(GTK_CALENDAR(calendar), &year, &month, &day); gtk_calendar_mark_day(GTK_CALENDAR(calendar), day); @@ -253,15 +255,13 @@ static void delete_file() { char *filename = get_file(daystr); - int year, month, day; + unsigned int year, month, day; unlink(filename); gtk_calendar_get_date(GTK_CALENDAR(calendar), &year, &month, &day); gtk_calendar_unmark_day(GTK_CALENDAR(calendar), day); FREE(filename); - gtk_text_freeze(GTK_TEXT(edit)); editor_flush(); - gtk_text_thaw(GTK_TEXT(edit)); } @@ -293,7 +293,7 @@ char startstr_u[9]; /* unique (full date) */ char startstr_y[9]; /* yearly date */ char startstr_m[9]; /* monthly date */ - int year, month, day; + unsigned int year, month, day; gtk_calendar_get_date(GTK_CALENDAR(calendar), &year, &month, &day); month++; @@ -357,10 +357,10 @@ GTK_SIGNAL_FUNC(mark_days), NULL); gtk_widget_show(calendar); - edit = gtk_text_new(NULL, NULL); - gtk_text_set_editable(GTK_TEXT(edit), TRUE); - gtk_text_set_word_wrap(GTK_TEXT(edit), TRUE); - gtk_text_set_line_wrap(GTK_TEXT(edit), TRUE); + edit = gtk_text_view_new(); + gtk_text_view_set_editable(GTK_TEXT_VIEW(edit), TRUE); + gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(edit), GTK_WRAP_WORD_CHAR); + gtk_box_pack_start(GTK_BOX(main_vbox), edit, TRUE, TRUE, 1); @@ -413,7 +413,6 @@ gtk_box_pack_start(GTK_BOX(buttons_hbox), closewindow, TRUE, TRUE, 0); GTK_WIDGET_SET_FLAGS(GTK_WIDGET(closewindow), GTK_CAN_DEFAULT); gtk_widget_grab_default(GTK_WIDGET(closewindow)); - gtk_widget_draw_default(GTK_WIDGET(closewindow)); gtk_widget_show(closewindow); --- wmclockmon-0.8.1.orig/wmclockmon-cal/Makefile.in +++ wmclockmon-0.8.1/wmclockmon-cal/Makefile.in @@ -85,7 +85,7 @@ INCLUDES = @HEADER_SEARCH_PATH@ -wmclockmon_LDADD = @LIBRARY_SEARCH_PATH@ @XLIBS@ +wmclockmon_LDADD = @LIBRARY_SEARCH_PATH@ @XLIBS@ `pkg-config gtk+-2.0 --libs` INSTALL_PROGRAM = @INSTALL_PROGRAM@ @SETGID_FLAGS@ $(AM_INSTALL_PROGRAM_FLAGS) @@ -96,14 +96,14 @@ DEFS = @DEFS@ -I. -I$(srcdir) -I.. -LDFLAGS = @LDFLAGS@ `gtk-config --libs` +LDFLAGS = @LDFLAGS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ wmclockmon_OBJECTS = main.o mainwindow.o tools.o wmclockmon_DEPENDENCIES = wmclockmon_LDFLAGS = -CFLAGS = @CFLAGS@ `gtk-config --cflags` +CFLAGS = @CFLAGS@ `pkg-config gtk+-2.0 --cflags` COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ --- wmclockmon-0.8.1.orig/src/main.c +++ wmclockmon-0.8.1/src/main.c @@ -251,14 +251,12 @@ static void print_help(char *prog); static void time_update(); static Bool raise_alarm(); -static Bool fexist(const char *filename); static Bool filestat(const char *filename, time_t *time, int mode); static int my_system(char *cmd, char *opt); void *xmalloc(size_t size); char *xstrdup(const char *string); static void alrm_add(Alarm **list, const char *value); static void free_alrm(Alarm **list); -static int nb_alrm(Alarm *list); static Bool alarms_on(Alarm *list); static void switch_alarms(Alarm *list); static Bool getbool(char *value); @@ -271,9 +269,6 @@ static void show_cal_file(int type); static void show_cal(); static char *robust_home(); -static void signal_reload(); - - int main(int argc, char **argv) { XEvent event; @@ -1326,17 +1321,6 @@ return False; } - -static Bool fexist(const char *filename) { - FILE *file; - - if ((file = fopen(filename, "r")) == NULL) return False; - fclose(file); - - return True; -} - - static Bool filestat(const char *filename, time_t *time, int mode) { struct stat s; time_t t = *time; @@ -1471,17 +1455,6 @@ } -static int nb_alrm(Alarm *list) { - Alarm *alrm = list; - int n = 0; - while (alrm) { - n++; - alrm = alrm->next; - } - return n; -} - - static Bool alarms_on(Alarm *list) { Alarm *alrm = list; --- wmclockmon-0.8.1.orig/debian/compat +++ wmclockmon-0.8.1/debian/compat @@ -0,0 +1 @@ +7 --- wmclockmon-0.8.1.orig/debian/examples +++ wmclockmon-0.8.1/debian/examples @@ -0,0 +1,2 @@ +doc/sample1.wmclockmonrc +doc/sample2.wmclockmonrc --- wmclockmon-0.8.1.orig/debian/rules +++ wmclockmon-0.8.1/debian/rules @@ -1,5 +1,4 @@ #!/usr/bin/make -f -export DH_COMPAT=3 TMP=$(CURDIR)/debian/wmclockmon @@ -13,7 +12,15 @@ configure: configure-stamp configure-stamp: dh_testdir - CFLAGS="$(CFLAGS)" ./configure --prefix=$(TMP)/usr --mandir=$(TMP)/usr/share/man + if [ -r /usr/share/misc/config.sub ]; then\ + mv $(CURDIR)/config.sub $(CURDIR)/config.sub.backup;\ + cp /usr/share/misc/config.sub $(CURDIR)/config.sub;\ + fi + if [ -r /usr/share/misc/config.guess ]; then\ + mv $(CURDIR)/config.guess $(CURDIR)/config.guess.backup;\ + cp /usr/share/misc/config.guess $(CURDIR)/config.guess;\ + fi + CFLAGS="$(CFLAGS)" ./configure --prefix=/usr --mandir=/usr/share/man touch configure-stamp build: configure build-stamp @@ -26,16 +33,22 @@ dh_testdir dh_testroot rm -f build-stamp install-stamp configure-stamp - -$(MAKE) clean - rm -f config.h config.log config.status stamp-h Makefile src/Makefile doc/Makefile wmclockmon-config/Makefile + [ ! -f Makefile ] || $(MAKE) maintainer-clean + if [ -r $(CURDIR)/config.sub.backup ]; then\ + mv $(CURDIR)/config.sub.backup $(CURDIR)/config.sub;\ + fi + if [ -r $(CURDIR)/config.guess.backup ]; then\ + mv $(CURDIR)/config.guess.backup $(CURDIR)/config.guess;\ + fi + rm -f config.h config.log config.status stamp-h Makefile src/Makefile doc/Makefile wmclockmon-config/Makefile wmclockmon-cal/Makefile dh_clean install: install-stamp install-stamp: build-stamp dh_testdir dh_testroot - dh_clean -k - $(MAKE) install-strip + dh_prep + $(MAKE) install DESTDIR=$(TMP) touch install-stamp # Build architecture-independent files here. --- wmclockmon-0.8.1.orig/debian/control +++ wmclockmon-0.8.1/debian/control @@ -1,13 +1,14 @@ Source: wmclockmon Section: x11 Priority: optional -Maintainer: Marc Brockschmidt -Build-Depends: libglib1.2-dev, libgtk1.2-dev, xlibs-dev (>> 4.1.0), debhelper (>= 3.0.0) -Standards-Version: 3.6.0 +Maintainer: Marc 'HE' Brockschmidt +Build-Depends: libgtk2.0-dev, libx11-dev | xlibs-dev (>> 4.1.0), libxext-dev | xlibs-dev (>> 4.1.0), libxi-dev | xlibs-dev (>> 4.1.0), libxpm-dev | xlibs-dev (>> 4.1.0), libxt-dev | xlibs-dev (>> 4.1.0), debhelper (>= 7), autotools-dev +Standards-Version: 3.8.3 Package: wmclockmon Architecture: any Depends: ${shlibs:Depends} -Description: Displays a clock in 12/24h mode with alarm mode and 3 different LCD styles +Description: Displays a clock in 12/24h mode with alarm mode wmclockmon displays a clock like wmtime, but with an alarm timer and - different styles. + different styles (14 + user customized ones). There's also a "binary + clock" style available. --- wmclockmon-0.8.1.orig/debian/menu +++ wmclockmon-0.8.1/debian/menu @@ -1,6 +1,6 @@ ?package(wmclockmon):\ - needs=X11\ - section=Apps/Tools\ + needs="X11"\ + section="Applications/System/Monitoring"\ hints="Clocks"\ title="wmclockmon"\ command="/usr/bin/wmclockmon" --- wmclockmon-0.8.1.orig/debian/docs +++ wmclockmon-0.8.1/debian/docs @@ -1 +1 @@ -doc/sample.wmclockmonrc + --- wmclockmon-0.8.1.orig/debian/changelog +++ wmclockmon-0.8.1/debian/changelog @@ -1,3 +1,84 @@ +wmclockmon (0.8.1-2ubuntu1) oneiric; urgency=low + + * Fix FTBFS with ld --as-needed. + + -- Matthias Klose Mon, 12 Sep 2011 15:50:54 +0200 + +wmclockmon (0.8.1-2) unstable; urgency=low + + * Port to Gtk+ 2, patch provided by Julien BLACHE - + Thanks! (Closes: #437442, #527784) + * Fix configure.ac to correctly handle kfreebsd (not only freebsd), patch + provided by Pierre Chifflier . (Closes: #376735) + * Fixed packaging to drag in fresh config.{sub,guess} at every build. + (Closes: #355731) + * Updated to debhelper 7 and policy 3.8.3. + * Squashed several lintian warnings (doing the menu transition on the way) + + -- Marc 'HE' Brockschmidt Sun, 16 Aug 2009 13:05:34 +0200 + +wmclockmon (0.8.1-1) unstable; urgency=low + + * New upstream release. + * src/main.c,wmclockmon-cal: Fixed some compilation warnings. + + -- Marc 'HE' Brockschmidt Wed, 15 Jun 2005 16:06:12 +0200 + +wmclockmon (0.8.0-2) unstable; urgency=low + + * debian/control: Added libxt-dev to make the damn thing build. (Closes: + #256421) + + -- Marc 'HE' Brockschmidt Sun, 27 Jun 2004 22:36:54 +0200 + +wmclockmon (0.8.0-1) unstable; urgency=low + + * New upstream release. + * debian/control: I'm a DD. + + -- Marc 'HE' Brockschmidt Thu, 3 Jun 2004 20:24:21 +0200 + +wmclockmon (0.7.2-1) unstable; urgency=low + + * New upstream release. + + -- Marc 'HE' Brockschmidt Tue, 9 Mar 2004 17:28:39 +0100 + +wmclockmon (0.7.1-1) unstable; urgency=low + + * New upstream release. + * debian/control: New xlib packaging, change build-depends. + + -- Marc 'HE' Brockschmidt Mon, 1 Mar 2004 00:23:58 +0100 + +wmclockmon (0.7.0-1) unstable; urgency=low + + * New upstream release: Now also provides a binary clock (this seems to be + a needed feature atm) + * debian/watch: Added, upstream releases fast :) + * debian/menu: Added quotes to make new lintian happy. + + -- Marc 'HE' Brockschmidt Thu, 26 Feb 2004 13:51:24 +0100 + +wmclockmon (0.6.2-1) unstable; urgency=low + + * Yet another new upstream release. + + -- Marc Brockschmidt Sat, 14 Feb 2004 12:20:44 +0100 + +wmclockmon (0.6.1-1) unstable; urgency=low + + * New upstream release. + * debian/rules: Some small changes to get the nostrip thing working. + + -- Marc Brockschmidt Wed, 11 Feb 2004 20:28:13 +0100 + +wmclockmon (0.5.2-1) unstable; urgency=low + + * New upstream release. + + -- Marc Brockschmidt Sun, 7 Dec 2003 16:09:49 +0100 + wmclockmon (0.5.0-1) unstable; urgency=low * New upstream release: --- wmclockmon-0.8.1.orig/debian/watch +++ wmclockmon-0.8.1/debian/watch @@ -0,0 +1,3 @@ +version=2 + +http://tnemeth.free.fr/projets/programmes/wmclockmon-(.*)\.tar\.gz --- wmclockmon-0.8.1.orig/wmclockmon-config/mainwindow.c +++ wmclockmon-0.8.1/wmclockmon-config/mainwindow.c @@ -10,9 +10,9 @@ #include "actions.h" -static GtkWidget *edit; -static GtkWidget *set; -static GtkWidget *remove; +static GtkWidget *b_edit; +static GtkWidget *b_set; +static GtkWidget *b_remove; static gint list_sel_cb (GtkCList *clist, gint row, @@ -20,9 +20,9 @@ GdkEventButton *event, void *data) { selected_row = row; - gtk_widget_set_sensitive(edit, TRUE); - gtk_widget_set_sensitive(set, TRUE); - gtk_widget_set_sensitive(remove, TRUE); + gtk_widget_set_sensitive(b_edit, TRUE); + gtk_widget_set_sensitive(b_set, TRUE); + gtk_widget_set_sensitive(b_remove, TRUE); return TRUE; } @@ -33,9 +33,9 @@ GdkEventButton *event, void *data) { selected_row = -1; - gtk_widget_set_sensitive(edit, FALSE); - gtk_widget_set_sensitive(set, FALSE); - gtk_widget_set_sensitive(remove, FALSE); + gtk_widget_set_sensitive(b_edit, FALSE); + gtk_widget_set_sensitive(b_set, FALSE); + gtk_widget_set_sensitive(b_remove, FALSE); return TRUE; } @@ -267,7 +267,7 @@ gtk_table_attach_defaults(GTK_TABLE(table), bouton, 0, 1, 1, 2); gtk_widget_set_sensitive(bouton, FALSE); gtk_widget_show(bouton); - edit = bouton; + b_edit = bouton; bouton = gtk_button_new_with_label(" Switch On/Off "); gtk_signal_connect(GTK_OBJECT(bouton), "clicked", @@ -275,7 +275,7 @@ gtk_table_attach_defaults(GTK_TABLE(table), bouton, 1, 2, 1, 2); gtk_widget_set_sensitive(bouton, FALSE); gtk_widget_show(bouton); - set = bouton; + b_set = bouton; bouton = gtk_button_new_with_label(" Remove alarm "); gtk_signal_connect(GTK_OBJECT(bouton), "clicked", @@ -283,7 +283,7 @@ gtk_table_attach_defaults(GTK_TABLE(table), bouton, 1, 2, 0, 1); gtk_widget_set_sensitive(bouton, FALSE); gtk_widget_show(bouton); - remove = bouton; + b_remove = bouton; label = gtk_label_new(" Alarms "); @@ -312,7 +312,6 @@ gtk_box_pack_start(GTK_BOX(buttons_hbox), bouton, TRUE, TRUE, 0); GTK_WIDGET_SET_FLAGS(GTK_WIDGET(bouton), GTK_CAN_DEFAULT); gtk_widget_grab_default(GTK_WIDGET(bouton)); - gtk_widget_draw_default(GTK_WIDGET(bouton)); gtk_widget_show(bouton); bouton = gtk_button_new_with_label(" Cancel "); --- wmclockmon-0.8.1.orig/wmclockmon-config/edit.c +++ wmclockmon-0.8.1/wmclockmon-config/edit.c @@ -76,7 +76,6 @@ bouton, TRUE, TRUE, 0); GTK_WIDGET_SET_FLAGS(GTK_WIDGET(bouton), GTK_CAN_DEFAULT); gtk_widget_grab_default(GTK_WIDGET(bouton)); - gtk_widget_draw_default(GTK_WIDGET(bouton)); gtk_widget_show(bouton); bouton = gtk_button_new_with_label("Cancel"); --- wmclockmon-0.8.1.orig/wmclockmon-config/dialogs.c +++ wmclockmon-0.8.1/wmclockmon-config/dialogs.c @@ -38,7 +38,6 @@ bouton, TRUE, TRUE, 0); GTK_WIDGET_SET_FLAGS(GTK_WIDGET(bouton), GTK_CAN_DEFAULT); gtk_widget_grab_default(GTK_WIDGET(bouton)); - gtk_widget_draw_default(GTK_WIDGET(bouton)); gtk_widget_show(bouton); bouton = gtk_button_new_with_label("No"); @@ -96,7 +95,6 @@ bouton, TRUE, TRUE, 0); GTK_WIDGET_SET_FLAGS(GTK_WIDGET(bouton), GTK_CAN_DEFAULT); gtk_widget_grab_default(GTK_WIDGET(bouton)); - gtk_widget_draw_default(GTK_WIDGET(bouton)); gtk_widget_show(bouton); gtk_container_set_border_width(GTK_CONTAINER --- wmclockmon-0.8.1.orig/wmclockmon-config/Makefile.in +++ wmclockmon-0.8.1/wmclockmon-config/Makefile.in @@ -85,7 +85,7 @@ INCLUDES = @HEADER_SEARCH_PATH@ -wmclockmon_LDADD = @LIBRARY_SEARCH_PATH@ @XLIBS@ +wmclockmon_LDADD = @LIBRARY_SEARCH_PATH@ @XLIBS@ `pkg-config gtk+-2.0 --libs` INSTALL_PROGRAM = @INSTALL_PROGRAM@ @SETGID_FLAGS@ $(AM_INSTALL_PROGRAM_FLAGS) @@ -96,14 +96,14 @@ DEFS = @DEFS@ -I. -I$(srcdir) -I.. -LDFLAGS = @LDFLAGS@ `gtk-config --libs` +LDFLAGS = @LDFLAGS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ wmclockmon_OBJECTS = actions.o dialogs.o edit.o main.o mainwindow.o tools.o wmclockmon_DEPENDENCIES = wmclockmon_LDFLAGS = -CFLAGS = @CFLAGS@ `gtk-config --cflags` +CFLAGS = @CFLAGS@ `pkg-config gtk+-2.0 --cflags` COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@