[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Antiright-devel] antiright configure gtkshell/Makefile gtkshell/...
From: |
Jeffrey Bedard |
Subject: |
[Antiright-devel] antiright configure gtkshell/Makefile gtkshell/... |
Date: |
Sun, 20 May 2007 18:29:59 +0000 |
CVSROOT: /sources/antiright
Module name: antiright
Changes by: Jeffrey Bedard <jefbed> 07/05/20 18:29:58
Modified files:
. : configure
gtkshell : Makefile add_options.c arguments.c button.c
callbacks.c gtkshell.h guidl_widgets.c main.c
module_includes.h options.c update_manager.c
update_manager_struct.h updated_options.c
libantiright : Makefile util.c
Added files:
gtkshell : applets.h clock.c clock.h
Log message:
Added clock applet. Do checking for previously started updating
within update manager.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/configure?cvsroot=antiright&r1=1.96&r2=1.97
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/Makefile?cvsroot=antiright&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/add_options.c?cvsroot=antiright&r1=1.37&r2=1.38
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/arguments.c?cvsroot=antiright&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/button.c?cvsroot=antiright&r1=1.46&r2=1.47
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/callbacks.c?cvsroot=antiright&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/gtkshell.h?cvsroot=antiright&r1=1.49&r2=1.50
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_widgets.c?cvsroot=antiright&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/main.c?cvsroot=antiright&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/module_includes.h?cvsroot=antiright&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/options.c?cvsroot=antiright&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/update_manager.c?cvsroot=antiright&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/update_manager_struct.h?cvsroot=antiright&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/updated_options.c?cvsroot=antiright&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/applets.h?cvsroot=antiright&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/clock.c?cvsroot=antiright&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/clock.h?cvsroot=antiright&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/antiright/libantiright/Makefile?cvsroot=antiright&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/antiright/libantiright/util.c?cvsroot=antiright&r1=1.17&r2=1.18
Patches:
Index: configure
===================================================================
RCS file: /sources/antiright/antiright/configure,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -b -r1.96 -r1.97
--- configure 19 May 2007 03:29:09 -0000 1.96
+++ configure 20 May 2007 18:29:57 -0000 1.97
@@ -99,7 +99,16 @@
else
echo not found
fi
-
+echo -n 'Checking for Boehm-GC... '
+if ([ -f /usr/pkg/lib/libgc.a ]\
+ || [ -f /usr/lib/libgc.a ]\
+ || [ -f /usr/local/lib/libgc.a ]); then
+ echo found
+ echo 'LIBGC=1' >> config.mk
+ DEFS="$DEFS -DLIBGC"
+else
+ echo not found
+fi
INCLUDE="$INCLUDE -I/usr/pkg/include -I/usr/local/include -I/usr/X11R6/include"
LIBDIR="$LIBDIR -L/usr/pkg/lib -L/usr/local/lib -L/usr/X11R6/lib"
Index: gtkshell/Makefile
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/Makefile,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- gtkshell/Makefile 19 May 2007 05:07:19 -0000 1.31
+++ gtkshell/Makefile 20 May 2007 18:29:57 -0000 1.32
@@ -37,6 +37,9 @@
LDFLAGS+=`pkg-config --libs vte`
.endif
+.if defined(LIBGC)
+LDFLAGS+=-lgc
+.endif
#LDFLAGS+=-lefence
@@ -47,7 +50,7 @@
image_button.o terminal.o terminal_options.o menu.o updated.o\
guidl_util.o about_dialog.o init.o guidl_dialog.o guidl_dictionary.o\
guidl_options.o guidl_widgets.o update_manager.o pane.o\
- command_shell.o app_mode.o
+ command_shell.o app_mode.o clock.o
program=main.o
Index: gtkshell/add_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/add_options.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- gtkshell/add_options.c 17 May 2007 16:18:17 -0000 1.37
+++ gtkshell/add_options.c 20 May 2007 18:29:57 -0000 1.38
@@ -119,6 +119,28 @@
* as it is accessed by callbacks. */
}
+static void
+handle_applet_arguments(GSH * gsh, const gint argc, const gchar ** argv,
+ gint * counter)
+{
+ const gchar * current_arg = argv[*counter];
+ g_assert(strlen(current_arg) > 2);
+ switch(current_arg[3])
+ {
+ case 'c': /* Add clock. */
+ {
+ GtkWidget * clock;
+
+ clock=gsh_clock_new(gsh);
+ $(gsh, manage, clock);
+ $(gsh->update, start);
+ }
+ break;
+ default:
+ ARWARN("invalid applet argument");
+ }
+}
+
void
gsh_handle_add_arguments(GSH * gsh, const gint argc, const gchar **argv,
gint *counter)
@@ -126,6 +148,9 @@
g_assert(strlen(argv[(*counter)]) > 1);
switch (argv[(*counter)][2])
{
+ case 'A': /* Add an internally updated applet. */
+ handle_applet_arguments(gsh, argc, argv, counter);
+ break;
case 'b':
GSH_COUNT(argc, counter);
gsh_setup_hpaned(gsh, argv[*counter]);
Index: gtkshell/arguments.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/arguments.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- gtkshell/arguments.c 14 May 2007 20:23:22 -0000 1.27
+++ gtkshell/arguments.c 20 May 2007 18:29:57 -0000 1.28
@@ -88,4 +88,7 @@
(argv[counter][0] == '-') ?
gsh_handle_switch_arguments(gsh, argc, argv, &counter)
: button_parse(gsh, argv[counter]);
+#ifdef LIBGC
+ GC_gcollect();
+#endif /* LIBGC */
}
Index: gtkshell/button.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/button.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -b -r1.46 -r1.47
--- gtkshell/button.c 17 May 2007 15:38:08 -0000 1.46
+++ gtkshell/button.c 20 May 2007 18:29:57 -0000 1.47
@@ -135,6 +135,7 @@
{
GtkWidget * toolbutton;
+ /* FIXME: change to use the gtk tool_button widget. */
toolbutton=gtk_button_new_with_label(command);
common_button_setup(gsh, toolbutton, command);
GSHCA(gsh->widgets.app.toolbar, toolbutton);
Index: gtkshell/callbacks.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/callbacks.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- gtkshell/callbacks.c 19 May 2007 03:29:09 -0000 1.29
+++ gtkshell/callbacks.c 20 May 2007 18:29:57 -0000 1.30
@@ -118,6 +118,9 @@
(void) antiright_system(cb->data);
GSH_TEST_EXIT(cb->gsh);
}
+#ifdef LIBGC
+ GC_gcollect();
+#endif /* LIBGC */
}
static void
Index: gtkshell/gtkshell.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/gtkshell.h,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -b -r1.49 -r1.50
--- gtkshell/gtkshell.h 17 May 2007 16:12:48 -0000 1.49
+++ gtkshell/gtkshell.h 20 May 2007 18:29:58 -0000 1.50
@@ -35,6 +35,10 @@
#include <unistd.h>
#include <signal.h>
+#ifdef LIBGC
+#include <gc.h>
+#endif /* LIBGC */
+
#include "../libantiright/library.h"
#ifndef YYFILE
Index: gtkshell/guidl_widgets.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/guidl_widgets.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- gtkshell/guidl_widgets.c 16 May 2007 20:39:45 -0000 1.9
+++ gtkshell/guidl_widgets.c 20 May 2007 18:29:58 -0000 1.10
@@ -47,6 +47,7 @@
DEF("system button", "-acb");
DEF("vertical pane", "-ab");
DEF("command shell", "-aC");
+ DEF("clock applet", "-aAc");
}
GSH_GUIDL_ITEM_FUNC(widget, DICT);
Index: gtkshell/main.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/main.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- gtkshell/main.c 14 May 2007 18:06:34 -0000 1.21
+++ gtkshell/main.c 20 May 2007 18:29:58 -0000 1.22
@@ -22,6 +22,10 @@
#include "gtkshell.h"
+#ifdef LIBGC
+#include <gc.h>
+#endif /* LIBGC */
+
static void
setup_gui(struct GSH * gsh, const gint argc, const gchar ** argv)
{
@@ -38,9 +42,14 @@
gtk_init(&argc, &argv);
gsh=ARNEW(gsh, GSH);
setup_gui(gsh, (const gint)argc, (const gchar **)argv);
+#ifdef LIBGC
+ GC_gcollect();
+#endif /* LIBGC */
gtk_main(); /* application main loop */
+#ifndef LIBGC
/* Cleanup when finished. */
$(gsh, delete);
+#endif /* not LIBGC */
return (EXIT_SUCCESS);
}
Index: gtkshell/module_includes.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/module_includes.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- gtkshell/module_includes.h 19 May 2007 05:07:20 -0000 1.4
+++ gtkshell/module_includes.h 20 May 2007 18:29:58 -0000 1.5
@@ -56,5 +56,6 @@
#include "pane.h"
#include "command_shell.h"
#include "app_mode.h"
+#include "applets.h"
#endif /* not GSH_MODULE_INCLUDES_H */
Index: gtkshell/options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/options.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- gtkshell/options.c 14 May 2007 18:06:35 -0000 1.26
+++ gtkshell/options.c 20 May 2007 18:29:58 -0000 1.27
@@ -110,6 +110,8 @@
HANDLE(option);
break;
case 't': /* test area. */
+ {
+ }
break;
default:
gsh_invalid_option(argv, *counter);
Index: gtkshell/update_manager.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/update_manager.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- gtkshell/update_manager.c 14 May 2007 18:06:35 -0000 1.4
+++ gtkshell/update_manager.c 20 May 2007 18:29:58 -0000 1.5
@@ -97,11 +97,13 @@
static void
gsh_GSHUpdateManager_start(struct GSHUpdateManager * updaters)
{
-
#ifdef DEBUG
ARBUG("gsh_start_updates()");
#endif /* DEBUG */
-
+ if(updaters->updating)
+ return;
+ else
+ updaters->updating=TRUE;
#ifdef DEBUG
ARWIFNP (updaters)
{
Index: gtkshell/update_manager_struct.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/update_manager_struct.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- gtkshell/update_manager_struct.h 3 May 2007 04:36:18 -0000 1.1
+++ gtkshell/update_manager_struct.h 20 May 2007 18:29:58 -0000 1.2
@@ -27,6 +27,7 @@
{
unsigned int period;
/address@hidden@*/ GSList *list;
+ gboolean updating;
void (*delete)(struct GSHUpdateManager *);
void (*add)(struct GSHUpdateManager * , struct GSHUpdatedWidget *);
void (*start)(struct GSHUpdateManager *);
Index: gtkshell/updated_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/updated_options.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- gtkshell/updated_options.c 14 May 2007 18:06:35 -0000 1.17
+++ gtkshell/updated_options.c 20 May 2007 18:29:58 -0000 1.18
@@ -22,32 +22,13 @@
#include "gtkshell.h"
-#define START_UPDATING(gsh)\
-{\
- $(gsh->update, start);\
- GSH_SET(GSH_UPDATING);\
-}
-
-#define TEST_UPDATING(gsh) \
-{\
- if(!(GSH_FLAG(GSH_UPDATING)))\
- {\
- START_UPDATING(gsh);\
- }\
-}
-
-#define GENERIC_ARGUMENT(gsh, argc, counter)\
-{\
- GSH_COUNT(argc, counter);\
- TEST_UPDATING(gsh);\
-}
-
static void
add_updater(GSH * gsh, const gint argc, gint * counter,
const gchar ** argv, void (*add_func)(GSH *, const gchar *))
{
add_func(gsh, argv[*counter+1]);
- GENERIC_ARGUMENT(gsh, argc, counter);
+ GSH_COUNT(argc, counter);
+ $(gsh->update, start);
}
#define UADD(type) \
Index: libantiright/Makefile
===================================================================
RCS file: /sources/antiright/antiright/libantiright/Makefile,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- libantiright/Makefile 14 May 2007 18:06:35 -0000 1.11
+++ libantiright/Makefile 20 May 2007 18:29:58 -0000 1.12
@@ -1,7 +1,7 @@
include ../config.mk
CFLAGS+=`pkg-config --cflags glib-2.0`
-CFLAGS+=$(DEFS)
+CFLAGS+=$(DEFS) $(INCLUDE)
all: libantiright.a
Index: libantiright/util.c
===================================================================
RCS file: /sources/antiright/antiright/libantiright/util.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- libantiright/util.c 14 May 2007 18:06:35 -0000 1.17
+++ libantiright/util.c 20 May 2007 18:29:58 -0000 1.18
@@ -21,22 +21,36 @@
*/
#include "library.h"
+#ifdef LIBGC
+#include <gc.h>
+#endif /* LIBGC */
gpointer
xmalloc(size_t size)
{
+ gpointer data;
+
/*
* There is no need to check for success, as g_malloc causes
* the application to terminate on failure.
*/
+#ifdef LIBGC
+ data=GC_MALLOC(size);
+#else /* not LIBGC */
+ data=g_malloc(size);
+#endif /* LIBGC */
- return (g_malloc(size));
+ return data;
}
void
xfree(gpointer data)
{
+#ifdef LIBGC
+ GC_FREE(data);
+#else /* not LIBGC */
g_free(data);
+#endif /* LIBGC */
}
static ARActionFunction
Index: gtkshell/applets.h
===================================================================
RCS file: gtkshell/applets.h
diff -N gtkshell/applets.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gtkshell/applets.h 20 May 2007 18:29:57 -0000 1.1
@@ -0,0 +1,3 @@
+
+#include "clock.h"
+
Index: gtkshell/clock.c
===================================================================
RCS file: gtkshell/clock.c
diff -N gtkshell/clock.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gtkshell/clock.c 20 May 2007 18:29:57 -0000 1.1
@@ -0,0 +1,65 @@
+/*
+ AntiRight
+ (c) 2007 Jeffrey Bedard
+ address@hidden
+
+ This file is part of AntiRight.
+
+ AntiRight 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.
+
+ AntiRight 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 AntiRight; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+*/
+
+#include "gtkshell.h"
+#include <time.h>
+
+static gchar *
+get_time_string()
+{
+ gchar * time_string;
+
+ {
+ time_t time_data;
+
+ (void)time(&time_data);
+ time_string=ctime(&time_data);
+ }
+
+ return time_string;
+}
+
+static void
+update_clock(const gchar * command, gpointer clock_pointer)
+{
+ GtkWidget * clock;
+
+ UNUSED(command);
+ clock=(GtkWidget *)clock_pointer;
+ gtk_label_set_text(GTK_LABEL(clock), get_time_string());
+}
+
+GtkWidget *
+gsh_clock_new(GSH * gsh)
+{
+ GtkWidget * clock;
+ struct GSHUpdatedWidget * updated_widget;
+
+ clock=gtk_label_new(NULL);
+ gtk_widget_set_size_request(clock, 96, 48);
+ updated_widget=ARNEW(gsh, GSHUpdatedWidget,
+ &update_clock, NULL, clock);
+ $(gsh->update, add, updated_widget);
+
+ return clock;
+}
+
Index: gtkshell/clock.h
===================================================================
RCS file: gtkshell/clock.h
diff -N gtkshell/clock.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gtkshell/clock.h 20 May 2007 18:29:58 -0000 1.1
@@ -0,0 +1,30 @@
+/*
+ AntiRight
+ (c) 2007 Jeffrey Bedard
+ address@hidden
+
+ This file is part of AntiRight.
+
+ AntiRight 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.
+
+ AntiRight 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 AntiRight; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+*/
+
+#ifndef GSH_CLOCK_H
+#define GSH_CLOCK_H
+
+GtkWidget *
+gsh_clock_new(GSH * gsh);
+
+#endif /* GSH_CLOCK_H */
+