[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Antiright-devel] antiright configure gtkshell/add_options.c gtks...
From: |
Jeffrey Bedard |
Subject: |
[Antiright-devel] antiright configure gtkshell/add_options.c gtks... |
Date: |
Thu, 26 Aug 2010 18:50:20 +0000 |
CVSROOT: /sources/antiright
Module name: antiright
Changes by: Jeffrey Bedard <jefbed> 10/08/26 18:50:20
Modified files:
. : configure
gtkshell : add_options.c app_mode.c button.c
command_shell.c geometry.c geometry.h init.c
macros.h main.c menu.c module_includes.h
options.c ptk-app-menu.c row.c terminal.c
text.c
libantiright : Makefile string.c util.h
pygsh : pygui.py
rootcat : Makefile rootcat.c
xshell : Makefile
Removed files:
gtkshell : swallow.c swallow.h
Log message:
Simplified rootcat.c logic to facilitate faster execution. Use late
realization of widgets when possible in gtkshell. Remove swallow.[ch].
Add option to enable boehmgc in configure. Program execution speed is
negatively affected by gc operations, so boehmgc is disabled by
default.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/configure?cvsroot=antiright&r1=1.126&r2=1.127
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/add_options.c?cvsroot=antiright&r1=1.64&r2=1.65
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/app_mode.c?cvsroot=antiright&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/button.c?cvsroot=antiright&r1=1.65&r2=1.66
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/command_shell.c?cvsroot=antiright&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/geometry.c?cvsroot=antiright&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/geometry.h?cvsroot=antiright&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/init.c?cvsroot=antiright&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/macros.h?cvsroot=antiright&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/main.c?cvsroot=antiright&r1=1.39&r2=1.40
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/menu.c?cvsroot=antiright&r1=1.35&r2=1.36
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/module_includes.h?cvsroot=antiright&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/options.c?cvsroot=antiright&r1=1.51&r2=1.52
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/ptk-app-menu.c?cvsroot=antiright&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/row.c?cvsroot=antiright&r1=1.32&r2=1.33
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/terminal.c?cvsroot=antiright&r1=1.42&r2=1.43
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/text.c?cvsroot=antiright&r1=1.49&r2=1.50
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/swallow.c?cvsroot=antiright&r1=1.10&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/swallow.h?cvsroot=antiright&r1=1.7&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/libantiright/Makefile?cvsroot=antiright&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/antiright/libantiright/string.c?cvsroot=antiright&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/antiright/libantiright/util.h?cvsroot=antiright&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/antiright/pygsh/pygui.py?cvsroot=antiright&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/antiright/rootcat/Makefile?cvsroot=antiright&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/antiright/rootcat/rootcat.c?cvsroot=antiright&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/antiright/xshell/Makefile?cvsroot=antiright&r1=1.12&r2=1.13
Patches:
Index: configure
===================================================================
RCS file: /sources/antiright/antiright/configure,v
retrieving revision 1.126
retrieving revision 1.127
diff -u -b -r1.126 -r1.127
--- configure 25 Aug 2010 20:50:49 -0000 1.126
+++ configure 26 Aug 2010 18:50:18 -0000 1.127
@@ -29,6 +29,8 @@
TRUE=0
FALSE=1
+#USE_LIBGC=TRUE
+
check_component()
{
local COMPONENT=$1
@@ -138,13 +140,15 @@
MAKE=make
set_if_found gmake MAKE
-if check_path_for libgc.a || check_path_for libgc.so\
+if [ "$USE_GC" = "TRUE" ]; then
+ if check_path_for libgc.a || check_path_for libgc.so\
|| check_path_for libgc.so.1; then
if check_path_for gc.h; then
echo 'LIBGC=1' >> config.mk
- DEFS="$DEFS -DLIBGC"
+ DEFS="$DEFS -DLIBGC -DREDIRECT_MALLOC=GC_malloc -DIGNORE_FREE"
LDFLAGS="$LDFLAGS -lgc"
fi
+ fi
fi
set_if_found lex LEX
Index: gtkshell/add_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/add_options.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -b -r1.64 -r1.65
--- gtkshell/add_options.c 25 Aug 2010 20:50:49 -0000 1.64
+++ gtkshell/add_options.c 26 Aug 2010 18:50:19 -0000 1.65
@@ -216,10 +216,3 @@
gsh_add_updated_label (gsh, argv[++(*counter)]);
}
-void
-gsh_add_embedded_cb (GSH * gsh, gint * counter, const gchar ** argv)
-{
-#ifndef WIN32
- gsh_swallow_app (gsh, argv[++(*counter)]);
-#endif
-}
Index: gtkshell/app_mode.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/app_mode.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- gtkshell/app_mode.c 25 Aug 2010 20:50:49 -0000 1.8
+++ gtkshell/app_mode.c 26 Aug 2010 18:50:19 -0000 1.9
@@ -29,7 +29,7 @@
gsh_setup_app_mode (GSH *gsh)
{
/* setup row */
- GSH_SHOW_CREATE (GWA.row, vbox, FALSE, 1);
+ GSH_CREATE (GWA.row, vbox, FALSE, 1);
/* add menu bar to application column */
GSHCA_TIGHT (GWA.row, GWA.menubar);
/* setup toolbar */
Index: gtkshell/button.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/button.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -b -r1.65 -r1.66
--- gtkshell/button.c 25 Aug 2010 20:50:49 -0000 1.65
+++ gtkshell/button.c 26 Aug 2010 18:50:19 -0000 1.66
@@ -121,8 +121,8 @@
GtkWidget *toolitem;
GtkWidget *toolbutton;
- GSH_SHOW_CREATE (toolitem, tool_item);
- GSH_SHOW_CREATE (toolbutton, button);
+ GSH_CREATE (toolitem, tool_item);
+ GSH_CREATE (toolbutton, button);
setup_label_for_toolbutton (toolbutton, command);
setup_common(gsh, toolbutton, command);
gtk_button_set_relief (GTK_BUTTON (toolbutton), GTK_RELIEF_NONE);
Index: gtkshell/command_shell.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/command_shell.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- gtkshell/command_shell.c 25 Aug 2010 20:50:49 -0000 1.8
+++ gtkshell/command_shell.c 26 Aug 2010 18:50:19 -0000 1.9
@@ -77,7 +77,7 @@
{
GtkWidget *scroller;
- GSH_SHOW_CREATE (scroller, scrolled_window, NULL, NULL);
+ GSH_CREATE (scroller, scrolled_window, NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroller),
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
GSHCA (row, scroller);
@@ -90,7 +90,7 @@
{
GtkWidget *output;
- GSH_SHOW_CREATE (this->widgets.output, label, NULL);
+ GSH_CREATE (this->widgets.output, label, NULL);
output = this->widgets.output;
set_output_label_options (output);
setup_output_scroller (this->widgets.row, output);
@@ -99,9 +99,9 @@
static void
setup_command_shell_widgets (GSHCommandShell * this)
{
- GSH_SHOW_CREATE (this->widgets.row, vbox, 0, FALSE);
+ this->widgets.row=gtk_vbox_new(0, FALSE);
setup_output_area (this);
- GSH_SHOW_CREATE (this->widgets.input, entry);
+ this->widgets.input=gtk_entry_new();
GSHCONNECT (this->widgets.input, "activate", run_command_cb, this);
GSHCA_TIGHT (this->widgets.row, this->widgets.input);
}
Index: gtkshell/geometry.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/geometry.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- gtkshell/geometry.c 25 Aug 2010 20:50:50 -0000 1.20
+++ gtkshell/geometry.c 26 Aug 2010 18:50:19 -0000 1.21
@@ -1,6 +1,6 @@
/*
GUIShell
- (c) 2002-2007 Jeffrey Bedard
+ (c) 2002-2010 Jeffrey Bedard
address@hidden
This file is part of GUIShell.
@@ -23,26 +23,23 @@
#include "gtkshell.h"
-static gboolean
+static bool
gsh_check_geometry (struct GSH *gsh)
{
/* Use a default geometry if the application has a scrolling window and
* the geometry has not yet been specified. */
- if (GSH_FLAG (GSH_SCROLL) && !ARPBOOL (gsh->geometry))
+ if (G_UNLIKELY(GSH_FLAG(GSH_SCROLL)) && G_LIKELY(!(gsh->geometry)))
gsh->geometry = g_strdup ("400x267");
/* Result used in test of whether or not to set geometry. */
- return ARPBOOL (gsh->geometry);
+ return (gsh->geometry);
}
/* gsh->geometry is freed after this, so only call once. */
void
gsh_check_and_set_geometry (struct GSH *gsh)
{
-#ifdef DEBUG
- ARPASSERT (gsh);
-#endif /* DEBUG */
- if (gsh_check_geometry (gsh))
+ if (gsh && gsh_check_geometry (gsh))
{
/* Use GTK convenience function to set window geometry. */
gtk_window_parse_geometry (GTK_WINDOW (gsh->widgets.window),
Index: gtkshell/geometry.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/geometry.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- gtkshell/geometry.h 25 Aug 2010 20:50:50 -0000 1.8
+++ gtkshell/geometry.h 26 Aug 2010 18:50:19 -0000 1.9
@@ -1,6 +1,6 @@
/*
GUIShell
- (c) 2002-2006 Jeffrey Bedard
+ (c) 2002-2010 Jeffrey Bedard
address@hidden
This file is part of GUIShell.
@@ -23,8 +23,10 @@
#ifndef GSH_GEOMETRY_H
#define GSH_GEOMETRY_H
-void gsh_set_geometry (struct GSH *gsh);
+void
+gsh_set_geometry (struct GSH *gsh);
-void gsh_check_and_set_geometry (struct GSH *gsh);
+void
+gsh_check_and_set_geometry (struct GSH *gsh);
#endif /* GSH_GEOMETRY_H */
Index: gtkshell/init.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/init.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- gtkshell/init.c 25 Aug 2010 20:50:50 -0000 1.17
+++ gtkshell/init.c 26 Aug 2010 18:50:19 -0000 1.18
@@ -56,9 +56,14 @@
/* Choose the correct parenting of the widget hierarchy based on options
* set. */
gsh_setup_base_container (gsh);
+ /* Show everything when ready. */
+
+// gtk_widget_show_all (gsh->widgets.window);
/* If geometry has been set in command line arguments, use that, else
* use a reasonable default. */
gsh_check_and_set_geometry (gsh);
+ gtk_widget_show(gsh->widgets.window);
+ gtk_widget_show_all(gsh->widgets.window);
/* Show everything when ready. */
- gtk_widget_show (gsh->widgets.window);
+// gtk_widget_show_all (gsh->widgets.window);
}
Index: gtkshell/macros.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/macros.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- gtkshell/macros.h 25 Aug 2010 20:50:50 -0000 1.27
+++ gtkshell/macros.h 26 Aug 2010 18:50:19 -0000 1.28
@@ -67,19 +67,21 @@
#define GSHCA_TIGHT(cont, widget)\
gtk_box_pack_start(GTK_BOX(cont), widget, FALSE, FALSE, 0)
-/* Create and show a widget at the same time. */
+#define GSH_CREATE(var, type, ...)\
+ var=GTK_WIDGET(gtk_##type##_new(__VA_ARGS__))
+
#define GSH_SHOW_CREATE(var, type, ...)\
- gtk_widget_show(var=GTK_WIDGET(gtk_##type##_new(__VA_ARGS__)))
+ gtk_widget_show(GSH_CREATE(var, type, __VA_ARGS__))
#define GSH_ADD_WIDGET(cont, var, type, ...)\
{\
- GSH_SHOW_CREATE(var, type, __VA_ARGS__);\
+ GSH_CREATE(var, type, __VA_ARGS__);\
GSHCA(cont, var);\
}
#define GSH_ADD_MANAGED(gsh, var, type, ...)\
{\
- GSH_SHOW_CREATE(var, type, __VA_ARGS__);\
+ GSH_CREATE(var, type, __VA_ARGS__);\
$(gsh, manage, var);\
}
Index: gtkshell/main.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/main.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -b -r1.39 -r1.40
--- gtkshell/main.c 25 Aug 2010 20:50:50 -0000 1.39
+++ gtkshell/main.c 26 Aug 2010 18:50:19 -0000 1.40
@@ -27,6 +27,9 @@
{
GSH *gsh;
+#ifdef LIBGC
+ GC_INIT();
+#endif /* LIBGC */
gtk_init (&argc, &argv);
gsh = ARNEW(gsh, GSH);
gsh_GSH (gsh);
@@ -35,6 +38,9 @@
//$ (argset, delete);
if (gsh->command_dictionary)
$ (gsh->command_dictionary, delete);
+#ifdef LIBGC
+ GC_gcollect();
+#endif /* LIBGC */
gtk_main (); /* application main loop */
$ (gsh, delete);
Index: gtkshell/menu.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/menu.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- gtkshell/menu.c 25 Aug 2010 20:50:50 -0000 1.35
+++ gtkshell/menu.c 26 Aug 2010 18:50:19 -0000 1.36
@@ -178,7 +178,7 @@
#define GWA gsh->widgets.app
if (!GWA.menubar)
{
- GSH_SHOW_CREATE (GWA.menubar, menu_bar);
+ GSH_CREATE (GWA.menubar, menu_bar);
GSH_FLAG (GSH_APP_MODE) ? gsh_setup_app_mode (gsh)
: $ (gsh, manage, GWA.menubar);
}
@@ -249,7 +249,7 @@
const gchar *label;
label = tokens[0];
- GSH_SHOW_CREATE (menu, menu);
+ GSH_CREATE (menu, menu);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (add_menu_launcher (gsh,
label)), menu);
add_menu_items (gsh, menu, tokens);
Index: gtkshell/module_includes.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/module_includes.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- gtkshell/module_includes.h 25 Aug 2010 20:50:50 -0000 1.18
+++ gtkshell/module_includes.h 26 Aug 2010 18:50:19 -0000 1.19
@@ -59,7 +59,6 @@
#include "tree.h"
#include "form.h"
#include "dialog.h"
-#include "swallow.h"
#include "GSHWidget.h"
#include "color.h"
#include "ptk-app-menu.h"
Index: gtkshell/options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/options.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -b -r1.51 -r1.52
--- gtkshell/options.c 25 Aug 2010 20:50:50 -0000 1.51
+++ gtkshell/options.c 26 Aug 2010 18:50:19 -0000 1.52
@@ -67,7 +67,7 @@
}
-static void
+static inline void
add_to_usage (GSH * gsh, const gchar * key, const gchar * descr)
{
gchar *tmp = gsh->usage;
@@ -109,7 +109,6 @@
ARTDEF ("-at", gsh_add_entry_cb, "add text entry");
ARTDEF ("-aT", gsh_add_text_cb, "add text editor");
ARTDEF ("-aw", gsh_add_window_cb, "add new window");
- ARTDEF ("-aX", gsh_add_embedded_cb, "add embedded");
/* Updating widgets */
ARTDEF ("-aul", gsh_add_updating_label_cb, "add updating label");
Index: gtkshell/ptk-app-menu.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/ptk-app-menu.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- gtkshell/ptk-app-menu.c 25 Aug 2010 20:50:50 -0000 1.12
+++ gtkshell/ptk-app-menu.c 26 Aug 2010 18:50:19 -0000 1.13
@@ -643,6 +643,7 @@
gtk_menu_shell_insert (GTK_MENU_SHELL (menu), menu_item, position);
else
GSHCA (menu, menu_item);
+ g_free(data->icon);
}
gtk_widget_show_all (GTK_WIDGET (menu));
}
@@ -693,7 +694,7 @@
{
GtkWidget *menu_bar;
- GSH_SHOW_CREATE (menu_bar, menu_bar);
+ GSH_CREATE (menu_bar, menu_bar);
GSHCA (menu_bar, menu_button_item);
gtk_container_set_border_width (GTK_CONTAINER (menu_bar), 0);
@@ -705,7 +706,7 @@
{
GtkWidget *menu_button_item;
- GSH_SHOW_CREATE(menu_button_item, image_menu_item);
+ GSH_CREATE(menu_button_item, image_menu_item);
setup_app_menu_icon (gsh, menu_button_item);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_button_item), app_menu);
Index: gtkshell/row.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/row.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- gtkshell/row.c 25 Aug 2010 20:50:50 -0000 1.32
+++ gtkshell/row.c 26 Aug 2010 18:50:19 -0000 1.33
@@ -22,7 +22,8 @@
#include "gtkshell.h"
-#define NEWROW GSH_ADD_WIDGET (this->h, this->v, vbox, FALSE, 2)
+#define NEWROW GSH_ADD_WIDGET (this->h, this->v, vbox, FALSE, 0);\
+ gtk_widget_show(this->v)
static void
GSHRows_new (struct GSHRows *this)
@@ -55,7 +56,7 @@
this = armalloc (sizeof (struct GSHRows));
/* Use an arbitrary, though reasonable, initial number of rows. */
this->total = 8;
- GSH_SHOW_CREATE (this->h, hbox, FALSE, 2);
+ GSH_SHOW_CREATE (this->h, hbox, FALSE, 0);
NEWROW;
/* setup methods */
this->delete = &GSHRows_delete;
Index: gtkshell/terminal.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/terminal.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- gtkshell/terminal.c 25 Aug 2010 20:50:50 -0000 1.42
+++ gtkshell/terminal.c 26 Aug 2010 18:50:20 -0000 1.43
@@ -237,21 +237,21 @@
GSH_SHOW_CREATE(row, toolbar);
#define TAB_BUTTON(stock, cb)\
- ADD_STOCK_BUTTON(row, button, stock);\
+ ADD_STOCK_BUTTON(row, button, GTK_STOCK_##stock);\
gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);\
GSHCONNECT (button, "clicked", cb, term)
/* setup New button */
- TAB_BUTTON(GTK_STOCK_NEW, tab_button_callback);
+ TAB_BUTTON(NEW, tab_button_callback);
/* setup prev button */
- TAB_BUTTON(GTK_STOCK_GO_BACK, tab_prev);
+ TAB_BUTTON(GO_BACK, tab_prev);
/* setup next button */
- TAB_BUTTON(GTK_STOCK_GO_FORWARD, tab_next);
+ TAB_BUTTON(GO_FORWARD, tab_next);
/* setup Close button */
- TAB_BUTTON(GTK_STOCK_CLOSE, tab_button_close_cb);
+ TAB_BUTTON(CLOSE, tab_button_close_cb);
/* add the row to the tab bar */
gtk_notebook_set_action_widget(notebook, row, GTK_PACK_END);
@@ -261,8 +261,7 @@
setup_notebook(GSHTerminal *term)
{
GtkWidget *notebook;
-
- gtk_widget_show (notebook = term->__notebook = gtk_notebook_new ());
+ GSH_CREATE(notebook=term->__notebook, notebook);
setup_action_widgets(term);
GSHCONNECT (notebook, "change-current-page", change_page_cb, term);
GSHCONNECT (notebook, "select-page", change_page_cb, term);
@@ -276,7 +275,7 @@
GtkNotebook *notebook = GTK_NOTEBOOK(term->__notebook);
GtkWidget *term_widget;
- gtk_widget_show (term_widget = term->widget = vte_terminal_new ());
+ term_widget = term->widget = vte_terminal_new ();
gtk_notebook_set_current_page(notebook,
gtk_notebook_append_page (notebook,
term_widget,
Index: gtkshell/text.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/text.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -b -r1.49 -r1.50
--- gtkshell/text.c 25 Aug 2010 20:50:50 -0000 1.49
+++ gtkshell/text.c 26 Aug 2010 18:50:20 -0000 1.50
@@ -93,7 +93,7 @@
{
GtkWidget *text;
- GSH_SHOW_CREATE (text = gsh->editor.widget, text_view);
+ GSH_CREATE (text = gsh->editor.widget, text_view);
set_options (gsh, text);
setup_text_scroller (gsh, text);
setup_undo (gsh);
@@ -122,7 +122,6 @@
? GSH_STOCK_ITEM(tool_button, stock)
: GSH_STOCK_ITEM(button, stock);
GSHCA(destination, button);
- gtk_widget_show(button);
g_signal_connect_swapped (G_OBJECT (button), "clicked",
(GCallback) cb,
gtk_text_view_get_buffer (GTK_TEXT_VIEW
Index: libantiright/Makefile
===================================================================
RCS file: /sources/antiright/antiright/libantiright/Makefile,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- libantiright/Makefile 1 Jun 2007 18:51:31 -0000 1.13
+++ libantiright/Makefile 26 Aug 2010 18:50:20 -0000 1.14
@@ -9,5 +9,5 @@
libantiright.a: ${objects}
ar rcs libantiright.a ${objects}
clean:
- rm -f *.o *.a
+ rm -f *.o *.a *~
Index: libantiright/string.c
===================================================================
RCS file: /sources/antiright/antiright/libantiright/string.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- libantiright/string.c 25 Aug 2010 20:50:51 -0000 1.14
+++ libantiright/string.c 26 Aug 2010 18:50:20 -0000 1.15
@@ -27,20 +27,18 @@
substitute(const gchar *c)
{
gchar *s=strdup(c);
- guint i;
- const size_t l = strlen(s);
+ gchar *i=s;
- for(i=0; i++ < l;)
- switch(s[i])
+ while(*i++)
+ switch(*i)
{
- case '_': s[i]=' '; break;
- case '@': s[i]='_'; break;
+ case '_': *i=' '; break;
+ case '@': *i='_'; break;
}
return s;
}
-
/* Free the returned value! */
gchar *
antiright_beautified_label(const gchar *text)
Index: libantiright/util.h
===================================================================
RCS file: /sources/antiright/antiright/libantiright/util.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- libantiright/util.h 25 Aug 2010 20:50:51 -0000 1.18
+++ libantiright/util.h 26 Aug 2010 18:50:20 -0000 1.19
@@ -41,9 +41,6 @@
#include <sys/mman.h>
#include <unistd.h>
-#define ARMMAP(size) mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_PRIVATE, -1,\
- sysconf(_SC_PAGE_SIZE))
-#define ARMUNMAP(addr, size) munmap(addr, size)
typedef void(*ARActionFunction)(gint *, gchar **);
Index: pygsh/pygui.py
===================================================================
RCS file: /sources/antiright/antiright/pygsh/pygui.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- pygsh/pygui.py 26 Oct 2008 00:36:10 -0000 1.1
+++ pygsh/pygui.py 26 Aug 2010 18:50:20 -0000 1.2
@@ -1,67 +1,139 @@
-from Tkinter import *
+#!/usr/bin/env python
+
+
+# PyGUI (c) 2010 Jeffrey Bedard address@hidden
+
+# This file is part of GUIShell.
+
+# GUIShell 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. GUIShell
+# 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
+# GUIShell; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+import pygtk
+pygtk.require('2.0')
+import gtk
import sys
-#import os
-import copy
-import subprocess
-import fileinput
-
-class PyGUIGrid():
- def __init__(self, max_rows):
- self.max_rows=max_rows
- self.row_counter=1
- self.column_counter=1
- def pack(self, widget):
- row_counter+=1
- if(row_counter > max_rows):
- row_counter=1
- column_counter+=1
- widget.grid(column=column_counter)
-
-class PyGUIButton():
- def __init__(self, parent, command):
- pass
-
-class PyGUIArgument():
- def __init__(self, gui=None, arg=""):
- self.button=Button(gui,
- command=lambda : subprocess.Popen(arg),
- text=arg)
- #self.button.pack({"side": "left"})
- #PyGUIGrid(
-
-class PyGUIFile():
- def __init__(self, gui=None, arg=""):
- for arg in fileinput.input():
- PyGUIArgument(gui, arg)
-
-class PyGUIMenuBar(Frame):
- def __init__(self, master=None):
- pass
-
-class PyGUIMenu():
- def __init__(self, master=None, label="Menu"):
- menu_button=MenuButton(menu, text=label)
- menu_button.pack(side=LEFT, padx="2m")
- menu_button_menu=Menu(menu_button)
- pass
- def add_to(self, menu, label="Button", command=None, args=""):
- pass
-
-
-class PyGUI(Frame):
- def parse_command_line(self):
- first_passed=False
- for arg in sys.argv:
- if(first_passed):
- PyGUIArgument(gui=self, arg=arg)
+import os
+import getopt
+
+class PyGUI(gtk.Window):
+ icon_size=gtk.ICON_SIZE_BUTTON
+ cb_exits=False
+ rows=8
+
+ def __init__(self, parent=None):
+ gtk.Window.__init__(self)
+ try:
+ self.set_screen(parent.get_screen())
+ except AttributeError:
+ self.connect('destroy', lambda *w: gtk.main_quit())
+ self.set_title(self.__class__.__name__)
+ self.set_default_size(0, 0)
+ self.hrow = gtk.HBox()
+ self.add(self.hrow)
+ self.hrow.show()
+ self.add_column()
+ if (self.is_composited()):
+ self.set_opacity(0.9)
+ self.show_all()
+
+ def add_column(self):
+ self.vrow = gtk.VBox()
+ self.hrow.add(self.vrow)
+ self.vrow.show()
+ self.row=1
+
+ def system_cb(self, widget, data=None):
+ if(data==None):
+ data=widget.get_text()
+ os.system(data)
+ if(self.cb_exits):
+ gtk.main_quit()
+
+ def add_button(self, arg):
+ splitarg = arg.split(',', 1)
+ command=splitarg[0]
+ if(len(splitarg)>1):
+ img_id=splitarg[1]
+ else:
+ img_id=None
+
+ button=gtk.Button(command)
+ if(img_id):
+ button.set_label(img_id)
+ button.set_use_stock(True)
+ if(button.get_image()==None):
+ image=gtk.Image()
+ image.set_from_file(img_id)
+ button.set_image(image)
+ button.connect("clicked", self.system_cb, command)
+ self.manage(button)
+
+ def add_label(self, text):
+ label = gtk.Label(text)
+ self.manage(label)
+
+ def add_text_field(self, text=None):
+ field = gtk.Entry()
+ if(text != None):
+ field.set_text(text)
+ field.connect("activate", self.system_cb)
+ self.manage(field)
+
+ def manage(self, widget):
+ if(self.row > self.rows):
+ self.add_column()
+ self.row+=1
+ widget.show()
+ self.vrow.add(widget)
+
+ nextop=None
+ def parse_item(self, arg):
+ if(arg[0]=='-'):
+ if(arg[1]=='a'):
+ if(arg[2]=='l'):
+ self.nextop="add label"
+ return
+ elif(arg[2]=='t'):
+ self.nextop="add text field"
+ return
+ elif(arg[1]=='o'):
+ if(arg[2]=='i'):
+ self.nextop="set icon size"
+ return
+ if(arg[2]=='r'):
+ self.nextop="set rows"
+ return
+ if(arg[2]=='e'):
+ self.cb_exits=True
+ return
+ if(self.nextop!=None):
+ if(self.nextop=="add label"):
+ self.add_label(arg)
+ elif(self.nextop=="add text field"):
+ self.add_text_field(arg)
+ elif(self.nextop=="set icon size"):
+ self.icon_size=arg
+ elif(self.nextop=="set rows"):
+ self.rows=int(arg)
+ self.nextop=None
else:
- first_passed=True
- def __init__(self, master=None):
- Frame.__init__(self, master)
- self.pack()
- self.parse_command_line()
-
-root = Tk()
-app = PyGUI(master=root)
-app.mainloop()
+ self.add_button(arg)
+
+ def main(self):
+ for arg in sys.argv[1:]:
+ self.parse_item(arg)
+ gtk.main()
+
+if (__name__ == "__main__"):
+ app = PyGUI()
+ app.main()
Index: rootcat/Makefile
===================================================================
RCS file: /sources/antiright/antiright/rootcat/Makefile,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- rootcat/Makefile 25 Aug 2010 20:50:51 -0000 1.8
+++ rootcat/Makefile 26 Aug 2010 18:50:20 -0000 1.9
@@ -42,7 +42,7 @@
$(PROG): $(objs)
$(CC) -o $(PROG) $(objs) $(LDFLAGS)
clean:
- rm -f $(objs) $(PROG) *.core
+ rm -f $(objs) $(PROG) *.core *~
install:
$(INSTALL) -sc $(PROG) $(PREFIX)/bin
indent:
Index: rootcat/rootcat.c
===================================================================
RCS file: /sources/antiright/antiright/rootcat/rootcat.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- rootcat/rootcat.c 25 Aug 2010 20:50:51 -0000 1.8
+++ rootcat/rootcat.c 26 Aug 2010 18:50:20 -0000 1.9
@@ -24,38 +24,12 @@
#include "rootcat.h"
-static inline void
-rootcat_end (StringRenderer * rc, int exit_code)
-{
- $ (rc, delete);
- exit (exit_code);
-}
-
-static void
-clear ()
-{
- StringRenderer *rc;
-
- rc = new_StringRenderer_root (NULL, NULL);
- $ (rc, clear);
- $ (rc, delete);
-}
-
-static void
-print_usage (const char *app_name, int exit_code)
-{
- if (exit_code != 0)
- fprintf (stderr, "%s: Invalid argument\n", app_name);
- printf ("USAGE %s [-CFcf] [string] ...\n", app_name);
- exit (exit_code);
-}
-
int
main (int argc, char **argv)
{
StringRenderer *rc = NULL;
- int counter = 0;
- int line = 0;
+ register int counter = 0;
+ unsigned int line = 0;
char *color = NULL;
char *font = NULL;
@@ -70,24 +44,30 @@
case 'C': /* Set color */
counter++;
if (argv[counter])
- color = argv[counter];
+ color = (char*)argv[counter];
else
- print_usage (argv[0], 1);
+ goto print_usage;
break;
case 'c': /* Clean up previous invocations. */
- clear ();
+ rc = new_StringRenderer_root (NULL, NULL);
+ $(rc, clear);
+ $(rc, delete);
+ rc=NULL;
break;
case 'F': /* Set font */
counter++;
if (argv[counter])
- font = argv[counter];
- else
- print_usage (argv[0], 1);
+ {
+ font = (char*)argv[counter];
break;
- case 'h':
- print_usage (argv[0], 0);
+ }
default:
- print_usage (argv[0], 1);
+print_usage:
+ fprintf (stderr,
+ "%s: Invalid argument\n"
+ "USAGE %s [-CFcf] [string] ...\n",
+ argv[0], argv[0]);
+ return 1;
}
}
else
@@ -98,7 +78,7 @@
$ (rc, clear);
}
{
- unsigned int height = $ (rc, get_line_height, string);
+ const unsigned int height = $ (rc, get_line_height, string);
$ (rc, draw, (height / 2),
((++line) * LINE_SPACING * height), string);
Index: xshell/Makefile
===================================================================
RCS file: /sources/antiright/antiright/xshell/Makefile,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- xshell/Makefile 25 Aug 2010 20:50:51 -0000 1.12
+++ xshell/Makefile 26 Aug 2010 18:50:20 -0000 1.13
@@ -55,7 +55,7 @@
$(CC) -o xshell $(OBJECTS) $(LDFLAGS)
clean:
- rm -f *.o xshell xshell.exe*
+ rm -f *.o xshell xshell.exe* *~
install:
cp xshell $(PREFIX)/bin
Index: gtkshell/swallow.c
===================================================================
RCS file: gtkshell/swallow.c
diff -N gtkshell/swallow.c
--- gtkshell/swallow.c 25 Aug 2010 20:50:50 -0000 1.10
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,59 +0,0 @@
-/*
- GUIShell
-
- Swallowing code written by Peter Amstutz <address@hidden>, 2003 GPL,
- as part of gnome-swallow.
- (c) 2007 Jeffrey Bedard
- address@hidden
-
- This file is part of GUIShell.
-
- GUIShell 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.
-
- GUIShell 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 GUIShell; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
-*/
-
-#include "gtkshell.h"
-
-GtkWidget *
-gsh_swallow_app (GSH * gsh, const gchar * window_id)
-{
- GtkWidget *socket, *frame, *toplvl;
- GdkNativeWindow window;
-
- socket = gtk_socket_new ();
- toplvl = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_widget_show (toplvl);
- GSHCA (toplvl, socket);
- gtk_widget_show (socket);
-// gtk_window_present(GTK_WINDOW(toplvl));
- //$(gsh, manage, socket);
- //GSH_SET(GSH_NO_BASE_FRAME);
- //$(gsh, finalize);
-// gtk_widget_show(gsh->widgets.window);
-// gtk_widget_realize(gsh->widgets.window);
-// $(gsh, finalize);
- window = (GdkNativeWindow) g_ascii_strtoll (window_id, NULL, 0);
- assert (window);
-//#if 0
- gtk_socket_add_id (GTK_SOCKET (socket), window);
- frame = gtk_frame_new ("Socket");
- gtk_widget_reparent (socket, frame);
- gtk_widget_show (socket);
- gtk_widget_destroy (toplvl);
-//#endif
- $ (gsh, manage, frame);
-// gtk_socket_steal(GTK_SOCKET(socket), window);
-
- return socket;
-}
Index: gtkshell/swallow.h
===================================================================
RCS file: gtkshell/swallow.h
diff -N gtkshell/swallow.h
--- gtkshell/swallow.h 25 Aug 2010 20:50:50 -0000 1.7
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,31 +0,0 @@
-/*
- GUIShell
- (c) 2002-2007 Jeffrey Bedard
- address@hidden
-
- This file is part of GUIShell.
-
- GUIShell 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.
-
- GUIShell 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 GUIShell; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
-*/
-
-#ifndef GSH_SWALLOW_H
-#define GSH_SWALLOW_H
-
-
-#ifndef WIN32
-GtkWidget *gsh_swallow_app (GSH * gsh, const gchar * window_id);
-#endif /* not WIN32 */
-
-#endif /* GSH_SWALLOW_H */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Antiright-devel] antiright configure gtkshell/add_options.c gtks...,
Jeffrey Bedard <=