[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Antiright-devel] antiright/gtkshell Makefile about_dialog.c abou...
From: |
Jeffrey Bedard |
Subject: |
[Antiright-devel] antiright/gtkshell Makefile about_dialog.c abou... |
Date: |
Sun, 10 Jun 2007 21:16:55 -0000 |
CVSROOT: /sources/antiright
Module name: antiright
Changes by: Jeffrey Bedard <jefbed> 07/06/10 21:16:44
Removed files:
gtkshell : Makefile about_dialog.c about_dialog.h
add_options.c add_options.h app_mode.c
app_mode.h applets.h arguments.c arguments.h
button.c button.h callbacks.c callbacks.h
clock.c clock.h command_shell.c command_shell.h
containers.c containers.h dialog_options.c
dialog_options.h dragdrop.c dragdrop.h
file_dialog.c file_dialog.h font.c font.h
geometry.c geometry.h gshterm gtkshell.c
gtkshell.h guidl.lex guidl.y guidl_dialog.c
guidl_dialog.h guidl_dictionary.c
guidl_dictionary.h guidl_options.c
guidl_options.h guidl_util.c guidl_util.h
guidl_widgets.c guidl_widgets.h image_button.c
image_button.h init.c init.h label.c label.h
macros.h main.c menu.c menu.h module_includes.h
option_options.c option_options.h options.c
options.h pane.c pane.h row.c row.h
row_struct.h terminal.c terminal.h
terminal_options.c terminal_options.h
terminal_struct.h text.c text.h
update_manager.c update_manager.h
update_manager_struct.h updated.c updated.h
updated_label.c updated_label.h
updated_options.c updated_options.h
updated_progress.c updated_progress.h
Log message:
Removed, moved to libshell.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/Makefile?cvsroot=antiright&r1=1.36&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/about_dialog.c?cvsroot=antiright&r1=1.8&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/about_dialog.h?cvsroot=antiright&r1=1.2&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/add_options.c?cvsroot=antiright&r1=1.41&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/add_options.h?cvsroot=antiright&r1=1.6&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/app_mode.c?cvsroot=antiright&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/app_mode.h?cvsroot=antiright&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/applets.h?cvsroot=antiright&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/arguments.c?cvsroot=antiright&r1=1.28&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/arguments.h?cvsroot=antiright&r1=1.6&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/button.c?cvsroot=antiright&r1=1.49&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/button.h?cvsroot=antiright&r1=1.9&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/callbacks.c?cvsroot=antiright&r1=1.31&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/callbacks.h?cvsroot=antiright&r1=1.11&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/clock.c?cvsroot=antiright&r1=1.2&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/clock.h?cvsroot=antiright&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/command_shell.c?cvsroot=antiright&r1=1.2&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/command_shell.h?cvsroot=antiright&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/containers.c?cvsroot=antiright&r1=1.21&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/containers.h?cvsroot=antiright&r1=1.6&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/dialog_options.c?cvsroot=antiright&r1=1.20&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/dialog_options.h?cvsroot=antiright&r1=1.5&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/dragdrop.c?cvsroot=antiright&r1=1.13&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/dragdrop.h?cvsroot=antiright&r1=1.3&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/file_dialog.c?cvsroot=antiright&r1=1.8&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/file_dialog.h?cvsroot=antiright&r1=1.6&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/font.c?cvsroot=antiright&r1=1.9&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/font.h?cvsroot=antiright&r1=1.4&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/geometry.c?cvsroot=antiright&r1=1.16&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/geometry.h?cvsroot=antiright&r1=1.4&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/gshterm?cvsroot=antiright&r1=1.4&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/gtkshell.c?cvsroot=antiright&r1=1.42&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/gtkshell.h?cvsroot=antiright&r1=1.51&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl.lex?cvsroot=antiright&r1=1.12&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl.y?cvsroot=antiright&r1=1.21&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_dialog.c?cvsroot=antiright&r1=1.9&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_dialog.h?cvsroot=antiright&r1=1.2&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_dictionary.c?cvsroot=antiright&r1=1.6&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_dictionary.h?cvsroot=antiright&r1=1.3&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_options.c?cvsroot=antiright&r1=1.8&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_options.h?cvsroot=antiright&r1=1.2&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_util.c?cvsroot=antiright&r1=1.20&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_util.h?cvsroot=antiright&r1=1.9&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_widgets.c?cvsroot=antiright&r1=1.10&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_widgets.h?cvsroot=antiright&r1=1.2&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/image_button.c?cvsroot=antiright&r1=1.19&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/image_button.h?cvsroot=antiright&r1=1.6&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/init.c?cvsroot=antiright&r1=1.11&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/init.h?cvsroot=antiright&r1=1.4&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/label.c?cvsroot=antiright&r1=1.21&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/label.h?cvsroot=antiright&r1=1.7&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/macros.h?cvsroot=antiright&r1=1.12&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/main.c?cvsroot=antiright&r1=1.24&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/menu.c?cvsroot=antiright&r1=1.22&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/menu.h?cvsroot=antiright&r1=1.2&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/module_includes.h?cvsroot=antiright&r1=1.5&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/option_options.c?cvsroot=antiright&r1=1.30&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/option_options.h?cvsroot=antiright&r1=1.7&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/options.c?cvsroot=antiright&r1=1.27&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/options.h?cvsroot=antiright&r1=1.7&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/pane.c?cvsroot=antiright&r1=1.4&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/pane.h?cvsroot=antiright&r1=1.2&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/row.c?cvsroot=antiright&r1=1.22&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/row.h?cvsroot=antiright&r1=1.9&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/row_struct.h?cvsroot=antiright&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/terminal.c?cvsroot=antiright&r1=1.24&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/terminal.h?cvsroot=antiright&r1=1.4&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/terminal_options.c?cvsroot=antiright&r1=1.4&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/terminal_options.h?cvsroot=antiright&r1=1.2&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/terminal_struct.h?cvsroot=antiright&r1=1.8&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/text.c?cvsroot=antiright&r1=1.33&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/text.h?cvsroot=antiright&r1=1.10&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/update_manager.c?cvsroot=antiright&r1=1.7&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/update_manager.h?cvsroot=antiright&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/update_manager_struct.h?cvsroot=antiright&r1=1.3&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/updated.c?cvsroot=antiright&r1=1.17&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/updated.h?cvsroot=antiright&r1=1.9&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/updated_label.c?cvsroot=antiright&r1=1.21&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/updated_label.h?cvsroot=antiright&r1=1.6&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/updated_options.c?cvsroot=antiright&r1=1.20&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/updated_options.h?cvsroot=antiright&r1=1.5&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/updated_progress.c?cvsroot=antiright&r1=1.15&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/updated_progress.h?cvsroot=antiright&r1=1.6&r2=0
Patches:
Index: Makefile
===================================================================
RCS file: Makefile
diff -N Makefile
--- Makefile 10 Jun 2007 20:53:54 -0000 1.36
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,53 +0,0 @@
-###############################################################################
-#
-# AntiRight
-# (c) 2004-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 ../config.mk
-
-CFLAGS+=$(DEFS) $(INCLUDE)
-GTKFLAGS=$(LDFLAGS)
-ARFLAGS=-L../libantiright -L../libshell -lshell -lantiright
-
-#LDFLAGS+=-lefence
-
-objects=main.o
-
-all: gtkshell
-
-gtkshell: $(objects)
- $(CC) -o gtkshell $(objects) $(ARFLAGS) $(LDFLAGS)
-
-clean:
- rm -f gtkshell *.o libgtkshell.a
-
-install:
- install gtkshell $(PREFIX)/bin
- install gshterm $(PREFIX)/bin
-
-test:
- ./gtkshell -oh -or 4 test_button\
- test_menubutton::item::item,gtk-execute\
- -at echo -aT -aul date -aup 'echo 0.5' -al test_label\
- -otf 'Mono 8' -otw 48 -oth 16 -as ksh
-
Index: about_dialog.c
===================================================================
RCS file: about_dialog.c
diff -N about_dialog.c
--- about_dialog.c 24 May 2007 21:29:48 -0000 1.8
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,90 +0,0 @@
-/*
- 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"
-
-static void
-setup_about_license(GtkWidget * dialog)
-{
- gchar * text;
-
- gtk_about_dialog_set_license(GTK_ABOUT_DIALOG(dialog),
- text=antiright_read_named_file(GSH_LICENSE_FILE));
- g_free(text);
-}
-
-static void
-setup_authors_field(GtkWidget * dialog)
-{
- const gchar *authors[] = GSH_AUTHORS;
-
- gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(dialog),
- authors);
-}
-
-#define SET_WEBSITE(dialog)\
- gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(dialog), GSH_WEBSITE);
-
-#define SET_COMMENTS(dialog)\
- gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(dialog), GSH_COMMENTS);
-
-#define SET_COPYRIGHT(dialog)\
- gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(dialog),\
- GSH_COPYRIGHT);
-
-#define SET_VERSION(dialog)\
- gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(dialog), PACKAGE_STRING);
-
-static void
-setup_logo(GtkAboutDialog * dialog)
-{
- GtkWidget * image;
-
-#define ARICONDIR "/share/ACE-desktop/icons/"
- image=gtk_image_new_from_file(PREFIX ARICONDIR "ACE.png");
- gtk_widget_show(image);
- gtk_about_dialog_set_logo(dialog,
- gtk_image_get_pixbuf(GTK_IMAGE(image)));
-}
-
-static GtkWidget *
-setup_about_fields(GtkWidget * dialog)
-{
- setup_authors_field(dialog);
- setup_about_license(dialog);
- setup_logo(GTK_ABOUT_DIALOG(dialog));
- SET_WEBSITE(dialog);
- SET_COMMENTS(dialog);
- SET_COPYRIGHT(dialog);
- SET_VERSION(dialog);
-
- return dialog;
-}
-
-void
-gsh_about_dialog()
-{
- gtk_dialog_run(GTK_DIALOG(setup_about_fields(gtk_about_dialog_new())));
- exit(0);
-}
-
-
Index: about_dialog.h
===================================================================
RCS file: about_dialog.h
diff -N about_dialog.h
--- about_dialog.h 4 May 2007 00:59:58 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,41 +0,0 @@
-/*
- 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_ABOUT_DIALOG_H
-#define GSH_ABOUT_DIALOG_H
-
-#define GSH_LICENSE_FILE PREFIX "/share/doc/antiright/COPYING"
-
-#define GSH_AUTHORS \
-{\
- "Jeffrey E. Bedard <address@hidden>",\
- NULL\
-}
-
-#define GSH_COPYRIGHT "Copyright 2002-2007, Jeffrey E. Bedard"
-#define GSH_WEBSITE "http://www.nongnu.org/antiright"
-#define GSH_COMMENTS "This is the desktop scripting environment."
-
-void
-gsh_about_dialog() __attribute__((noreturn));
-
-#endif /* GSH_ABOUT_DIALOG_H */
Index: add_options.c
===================================================================
RCS file: add_options.c
diff -N add_options.c
--- add_options.c 26 May 2007 21:24:06 -0000 1.41
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,219 +0,0 @@
-/*
- AntiRight
- (c) 2002-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"
-
-static void
-add_piped_label(GSH * gsh, const gchar * output)
-{
- $(gsh, add.label, output);
-}
-
-static void
-add_piped_text(GSH * gsh, const gchar * output)
-{
- GtkWidget * text_area;
-
- text_area=gsh_text_area(gsh);
- (void)gsh_text_area_set_text(text_area, output);
-}
-
-#define GENERIC_FILE_CONTENTS(gsh, add, input)\
-{\
- add(gsh, input);\
- g_free(input);\
-}
-
-#define ADD_PIPED_GENERIC(gsh, add)\
- GENERIC_FILE_CONTENTS(gsh, add, antiright_read_file(stdin))
-
-#define GENERIC_COMMANDED_ADD(gsh, command, add)\
- GENERIC_FILE_CONTENTS(gsh, add, antiright_pipe_read(command))
-
-static void
-add_new_window(GSH * gsh)
-{
- $(gsh, add.window);
- gsh->rows->current=1;
- $(gsh, init);
-}
-
-static void
-add_separator(GSH * gsh)
-{
- GtkWidget * separator;
-
- /* Create a separator widget. If GSH has one row per column,
- use a vertical separator, else use a horizontal separator.
- This allows the separator to be used for ACE's Deskbar. */
- separator = (gsh->rows->total == 1) ?
- gtk_vseparator_new() : gtk_hseparator_new();
- /* Show and manage the separator. */
- $(gsh, manage, separator);
-}
-
-#define GCA_WIDGET(func) \
- GENERIC_COMMANDED_ADD(gsh, argv[*counter], func)
-
-static void
-handle_commanded_add_arguments(GSH * gsh, const gint argc, const gchar **argv,
- gint *counter)
-{
-#ifndef DEBUG
- UNUSED(argc);
-#endif /* DEBUG */
- if(!argv[*counter] || !argv[(*counter)+1])
- return;
- GSH_COUNT(argc, counter);
- switch(argv[(*counter)-1][3])
- {
- case 'b':
- GCA_WIDGET(gsh->add.button);
- break;
- case 'l':
- GCA_WIDGET(gsh->add.label);
- break;
- }
-}
-
-#ifdef HAVE_VTE
-static void
-add_shell(GSH * gsh, const gchar * command)
-{
- /* Create a terminal widget that is running COMMAND. */
- const GtkWidget * terminal = $(gsh->terminal, add, command);
-
- /* Let GSH manage the terminal widget. */
- $(gsh, manage, (GtkWidget *)terminal);
-}
-#endif /* HAVE_VTE */
-
-static void
-add_command_shell(GSH * gsh, const gchar * command)
-{
- GSHCommandShell * shell;
-
- shell = ARNEW(gsh, GSHCommandShell);
- $(gsh, manage, $(shell, get));
- if(command)
- $(shell, run, command);
- /* The command instance is not freed here,
- * 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. */
- $(gsh, manage, gsh_clock_new(gsh));
- break;
- default:
- ARWARN("invalid applet argument");
- }
-}
-
-void
-gsh_handle_add_arguments(GSH * gsh, const gint argc, const gchar **argv,
- gint *counter)
-{
- 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]);
- break;
-
- case 'C':
- add_command_shell(gsh, NULL);
- break;
-
- case 'c':
- handle_commanded_add_arguments(gsh, argc, argv, counter);
- break;
-
- case 'e':
- GSH_COUNT(argc, counter);
- gsh_text_editor(gsh, argv[*counter]);
- break;
-
- case 'l':
- GSH_COUNT(argc, counter);
- $(gsh, add.label, argv[(*counter)]);
- break;
-
- case 'P':
- ADD_PIPED_GENERIC(gsh, add_piped_text);
- break;
-
- case 'p':
- ADD_PIPED_GENERIC(gsh, add_piped_label);
- break;
-
- case 'r': /* Force creation of a new row. */
- $(gsh->rows, new);
- break;
-
- case 'S': /* Add a separator. */
- add_separator(gsh);
- break;
-
- case 's': /* Add a shell. */
- GSH_COUNT(argc, counter);
-#ifdef HAVE_VTE
- add_shell(gsh, argv[*counter]);
-#else /* not HAVE_VTE */
- add_command_shell(gsh, argv[*counter]);
-#endif /* HAVE_VTE */
- break;
-
- case 't':
- if (argc != *counter)
- GSH_COUNT(argc, counter);
-
- gsh_setup_command_entry(gsh, argv[(*counter)]);
-
- break;
- case 'T':
- gsh_text_area(gsh);
- break;
-
- case 'u':
- gsh_handle_updated_arguments(gsh, argc, argv, counter);
- break;
-
- case 'w':
- add_new_window(gsh);
- break;
-
- default:
- ARWARN("invalid add option");
- }
-}
Index: add_options.h
===================================================================
RCS file: add_options.h
diff -N add_options.h
--- add_options.h 14 May 2007 18:06:34 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,32 +0,0 @@
-/*
- AntiRight
- (c) 2002-2006 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_ADD_OPTIONS_H
-#define GSH_ADD_OPTIONS_H
-
-#include "gtkshell.h"
-
-void
-gsh_handle_add_arguments(GSH * gsh, const gint argc, const gchar **argv,
- gint *counter);
-
-#endif
Index: app_mode.c
===================================================================
RCS file: app_mode.c
diff -N app_mode.c
--- app_mode.c 19 May 2007 05:07:19 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,62 +0,0 @@
-/*
- AntiRight
- (c) 2006-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"
-
-#define GW gsh->widgets
-#define GWA GW.app
-
-static void
-setup_app_mode_status_bar(struct GSH * gsh)
-{
- GSH_SHOW_CREATE(GWA.status, statusbar);
- GSHCA_TIGHT(GWA.row, GWA.status);
-}
-
-static void
-setup_app_mode_toolbar(GSH * gsh)
-{
- GSH_SHOW_CREATE(GWA.toolbar, toolbar);
- GSHCA_TIGHT(GWA.row, GWA.toolbar);
-}
-
-static void
-setup_app_mode_frame(GSH * gsh)
-{
- GSH_SHOW_CREATE(GWA.frame, frame, NULL);
- GSHCA(GWA.row, GWA.frame);
-}
-
-void
-gsh_setup_app_mode(struct GSH * gsh)
-{
- GSH_SHOW_CREATE(GWA.row, vbox, FALSE, 1);
- /* Add menu bar to application column. */
- GSHCA_TIGHT(GWA.row, GWA.menubar);
- setup_app_mode_toolbar(gsh);
- setup_app_mode_frame(gsh);
- setup_app_mode_status_bar(gsh);
-}
-
-
-
Index: app_mode.h
===================================================================
RCS file: app_mode.h
diff -N app_mode.h
--- app_mode.h 19 May 2007 05:07:19 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,30 +0,0 @@
-/*
- AntiRight
- (c) 2006-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_APP_MODE_H
-#define GSH_APP_MODE_H
-
-void
-gsh_setup_app_mode(struct GSH * gsh);
-
-#endif /* not GSH_APP_MODE_H */
Index: applets.h
===================================================================
RCS file: applets.h
diff -N applets.h
--- applets.h 20 May 2007 18:29:57 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,3 +0,0 @@
-
-#include "clock.h"
-
Index: arguments.c
===================================================================
RCS file: arguments.c
diff -N arguments.c
--- arguments.c 20 May 2007 18:29:57 -0000 1.28
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,94 +0,0 @@
-/*
- AntiRight
- (c) 2002-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"
-
-#define SPLIT_ALL -1
-
-static void
-menubar_parse(GSH * gsh, const gchar * string)
-{
- gchar **tokens;
-
-#ifdef DEBUG
- ARPASSERT(gsh);
- ARPASSERT(string);
-#endif /* DEBUG */
- tokens=g_strsplit(string, "::", SPLIT_ALL);
- /* Determine if the button is a regular button or a menu button. */
- tokens[1] ? gsh_menubutton_parse(gsh, tokens)
- : $(gsh, add.button, string);
- g_strfreev(tokens);
-}
-
-static void
-add_each_menu(GSH * gsh, gchar ** menubar_tokens)
-{
- guint i;
-
-#ifdef DEBUG
- ARPASSERT(gsh);
- ARPASSERT(menubar_tokens);
-#endif /* DEBUG */
-
- for(i=0; menubar_tokens[i]; i++)
- menubar_parse(gsh, menubar_tokens[i]);
-}
-
-/* Decide whether to use a regular button or a menu button. */
-static void
-button_parse(GSH * gsh, const gchar * string)
-{
- gchar **menubar_tokens;
-
-#ifdef DEBUG
- ARPASSERT(gsh);
- ARPASSERT(string);
-#endif /* DEBUG */
-
- /*
- This allows a group of buttons and menu buttons to be specified
- as one argument. This is particularly useful in eliminating the
- need for the ADD BUTTONS tokens in GUIDL, though that feature
- will remain as it improves readability of an interface definition.
- */
- menubar_tokens=g_strsplit(string, ":::", SPLIT_ALL);
- /* If ":::" is not found, STRING will be contained in
- menubar_tokens[0]. */
- add_each_menu(gsh, menubar_tokens);
- g_strfreev(menubar_tokens);
-}
-
-void
-gsh_parse_arguments(GSH * gsh, const gint argc, const gchar **argv)
-{
- gint counter;
-
- for (counter = 1; counter < argc; counter++)
- (argv[counter][0] == '-') ?
- gsh_handle_switch_arguments(gsh, argc, argv, &counter)
- : button_parse(gsh, argv[counter]);
-#ifdef LIBGC
- GC_gcollect();
-#endif /* LIBGC */
-}
Index: arguments.h
===================================================================
RCS file: arguments.h
diff -N arguments.h
--- arguments.h 14 May 2007 18:06:34 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,34 +0,0 @@
-/*
- AntiRight
- (c) 2002-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_ARGUMENTS_H
-#define GSH_ARGUMENTS_H
-
-#include "gtkshell.h"
-
-void
-gsh_parse_arguments(GSH * gsh, const gint argc, const gchar **argv);
-
-void
-gsh_check_row(GSH * gsh);
-
-#endif
Index: button.c
===================================================================
RCS file: button.c
diff -N button.c
--- button.c 24 May 2007 21:29:48 -0000 1.49
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,215 +0,0 @@
-/*
- AntiRight
- (c) 2002-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"
-
-static void
-create_label_in_menu_item(GtkWidget * widget, const gchar * formatted)
-{
- GtkWidget * label;
-
- gtk_container_add(GTK_CONTAINER(widget),
- label = gtk_label_new(formatted));
- gtk_widget_show(label);
-}
-
-static void
-setup_label(GtkWidget *widget, const gchar *command)
-{
- gchar *formatted;
-
- formatted = antiright_beautified_label(command);
- GTK_IS_MENU_ITEM(widget) ? create_label_in_menu_item(widget, formatted)
- : gtk_button_set_label(GTK_BUTTON(widget), formatted);
- g_free(formatted);
-}
-
-static void
-setup_callback(struct GSH * gsh, GtkWidget * button, const gchar * command)
-{
- if(!GSH_FLAG(GSH_MENU_BUTTON))
- {
- struct GSHCBData * cb;
-
- cb=ARNEW(gsh, GSHCBData, gsh, g_strdup(command));
- (void)g_signal_connect(G_OBJECT(button),
- GTK_IS_MENU_ITEM(button)
- ? "activate" : "clicked",
- G_CALLBACK(cb->system), cb);
- }
- else
- GSH_UNSET(GSH_MENU_BUTTON);
-}
-
-static void
-create_button(struct GSH * gsh)
-{
- if(!GTK_IS_MENU(gsh->rows->v) && !GTK_IS_MENU_BAR(gsh->rows->v))
- gsh->widgets.button=gtk_button_new();
- else
- gtk_widget_show(gsh->widgets.button=gtk_menu_item_new());
-}
-
-static void
-common_button_setup(GSH * gsh, GtkWidget * button, const gchar * command)
-{
- gsh_setup_drag_drop(gsh, button);
- setup_callback(gsh, button, command);
-}
-
-static GtkWidget *
-label_to_icon_translation(const gchar * label)
-{
- GtkWidget * image;
- gchar * cut_label;
-
- cut_label=(gchar *)label;
- g_strstrip(cut_label);
-#define MATCHES(text) !strcmp(text, cut_label)
-#define ICON(id)\
- gtk_widget_show(image=gtk_image_new_from_stock(GTK_STOCK_##id, \
- GTK_ICON_SIZE_SMALL_TOOLBAR))
-
- if(MATCHES("Exit"))
- ICON(QUIT);
- else if(MATCHES("About"))
- ICON(ABOUT);
- else if(MATCHES("Open..."))
- ICON(OPEN);
- else if(MATCHES("Save"))
- ICON(SAVE);
- else if(MATCHES("Save As..."))
- ICON(SAVE_AS);
- else if(MATCHES("Cut"))
- ICON(CUT);
- else if(MATCHES("Copy"))
- ICON(COPY);
- else if(MATCHES("Paste"))
- ICON(PASTE);
- else if(MATCHES("Close"))
- ICON(CLOSE);
- else
- ICON(EXECUTE);
-
- return image;
-}
-
-static void
-setup_icon_for_toolbutton(GtkWidget * toolbutton, gchar * label_text)
-{
- GtkWidget * icon;
-
- icon = label_to_icon_translation(label_text);
- if(icon)
- gtk_button_set_image(GTK_BUTTON(toolbutton), icon);
-}
-
-static void
-setup_label_for_toolbutton(GtkWidget * toolbutton, const gchar * command)
-{
- gchar * label_text;
-
- label_text=antiright_beautified_label(command);
- gtk_button_set_label(GTK_BUTTON(toolbutton), label_text);
- setup_icon_for_toolbutton(toolbutton, label_text);
- g_free(label_text);
-}
-
-static void
-setup_toolbutton_from_command_button(GSH * gsh, const gchar * command)
-{
- 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);
- setup_label_for_toolbutton(toolbutton, command);
- gtk_button_set_relief(GTK_BUTTON(toolbutton), GTK_RELIEF_NONE);
- gtk_widget_show(toolbutton);
-}
-
-static void
-test_create_toolbutton(GSH * gsh, const gchar * command)
-{
- if( GSH_FLAG(GSH_APP_MODE)
- && gsh->widgets.app.toolbar
- && GTK_IS_MENU_ITEM(gsh->widgets.button)
- && strcmp(command, "File")
- && strcmp(command, "Edit")
- && strcmp(command, "View")
- && strcmp(command, "Help")
- && strcmp(command, "Tools"))
- {
- setup_toolbutton_from_command_button(gsh, command);
- }
-}
-
-static void
-setup_command_button(struct GSH * gsh, const gchar * command)
-{
- GtkWidget * button;
-
- setup_label(button=gsh->widgets.button, command);
- common_button_setup(gsh, button, command);
- test_create_toolbutton(gsh, command);
- if(GTK_IS_BUTTON(button))
- gtk_button_set_alignment(GTK_BUTTON(button), 0.0, 0.5);
-}
-
-static gboolean
-test_image_button(struct GSH * gsh, const gchar * string)
-{
- gchar **pair;
- gboolean return_value;
-
- pair=g_strsplit(string, ",", 2);
-#ifdef DEBUG
- ARPASSERT(pair);
- ARPASSERT(pair[0]);
-#endif /* DEBUG */
- if((return_value=(pair[1] != NULL)))
- gsh_image_button(gsh, pair[0], pair[1]);
- g_strfreev(pair);
-
- return return_value;
-}
-
-static void
-gsh_command_button(GSH * gsh, const gchar * command)
-{
- create_button(gsh);
- setup_command_button(gsh, command);
- gsh_manage(gsh, gsh->widgets.button);
-}
-
-/* This is just a wrapper around gsh_new_button(), to
- follow the convention of returning a created widget. */
-GtkWidget *
-gsh_add_button(struct GSH * gsh, const gchar * string)
-{
- if(!test_image_button(gsh, string))
- gsh_command_button(gsh, string);
-
- return gsh->widgets.button;
-}
-
Index: button.h
===================================================================
RCS file: button.h
diff -N button.h
--- button.h 14 May 2007 20:23:22 -0000 1.9
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,29 +0,0 @@
-/*
- AntiRight
- (c) 2002-2006 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_BUTTON_H
-#define GSH_BUTTON_H
-
-GtkWidget *
-gsh_add_button(struct GSH * gsh, const gchar * string);
-
-#endif
Index: callbacks.c
===================================================================
RCS file: callbacks.c
diff -N callbacks.c
--- callbacks.c 26 May 2007 21:24:06 -0000 1.31
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,214 +0,0 @@
-/*
- AntiRight
- (c) 2002-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"
-
-void
-gsh_send_signal(GtkWidget * widget, const gchar * signal_name)
-{
- g_signal_emit_by_name(widget, signal_name);
-}
-
-static void
-gsh_delete_GSHCBData(struct GSHCBData * cb)
-{
- g_free(cb->data);
- g_free(cb);
-}
-
-static void
-terminal_feed(gchar * command, GtkWidget * terminal)
-{
- gchar ** split_command;
- gchar * feed_command;
-
- if(!terminal)
- {
- ARWARN("terminal command requires a terminal"
- "to have been created");
- return;
- }
-
- command+=6;
- split_command=g_strsplit(command, "#", 2);
- ar_asprintf(&feed_command, "%s\n", split_command[0]);
- g_strfreev(split_command);
-#ifdef HAVE_VTE
- vte_terminal_feed_child(VTE_TERMINAL(terminal),
- feed_command, strlen(feed_command));
-#endif /* HAVE_VTE */
- g_free(feed_command);
-}
-
-
-#define MATCH(str) !strncmp(command, str, strlen(str))
-
-static gboolean
-test_special_text_editor_command(struct GSH * gsh, const gchar * command)
-{
- if(MATCH("Save_As...___"))
- gsh_editor_save_as(gsh);
- else if(MATCH("Save___"))
- gsh_editor_save(gsh);
- else if(MATCH("Open...___"))
- gsh_editor_open(gsh);
- else if(MATCH("Cut___"))
- gsh_send_signal(gsh->editor.widget, "cut-clipboard");
- else if(MATCH("Copy___"))
- gsh_send_signal(gsh->editor.widget, "copy-clipboard");
- else if(MATCH("Paste___"))
- gsh_send_signal(gsh->editor.widget, "paste-clipboard");
- else
- return FALSE;
-
- /* A special command match was found. */
- return TRUE;
-}
-
-static gboolean
-test_special_command(struct GSHCBData * cb)
-{
- const gchar * command = cb->data;
- struct GSH * gsh = cb->gsh;
-
-
- if(MATCH("Exit__"))
- {
- /* GSH is cleaned up when this causes
- * a return back to main(). */
- gtk_main_quit();
- }
- else if(MATCH("TERM__"))
- {
- terminal_feed((gchar *)command, gsh->terminal->widget);
- }
- else
- {
- /* Test other special command(s). */
- if(!test_special_text_editor_command(gsh, command))
- {
- /* No special command found. */
- return FALSE;
- }
- }
-
- /* Special command handled. */
- return TRUE;
-}
-
-static void
-gsh_system_cb(GtkWidget *widget, gpointer data)
-{
-#ifdef DEBUG
- ARBUG("system_cb");
-#endif /* DEBUG */
- UNUSED(widget);
-
- ARWIFNP(data)
- {
- struct GSHCBData *cb = data;
- if(!test_special_command(cb))
- (void) antiright_system(cb->data);
- GSH_TEST_EXIT(cb->gsh);
- }
-#ifdef LIBGC
- GC_gcollect();
-#endif /* LIBGC */
-}
-
-static void
-exec_and_test_print(struct GSHCBData * cb, const gchar * input)
-{
- struct GSH * gsh;
-
- gsh=cb->gsh;
-
- if(GSH_FLAG(GSH_PROMPT_ECHOES))
- g_print("%s\n", input);
- else
- sysprintf("%s %s", (char *) cb->data,
- (char *) input);
-}
-
-static void
-gsh_entry_cb(GtkWidget *widget, gpointer data)
-{
- struct GSHCBData *cb;
-
-#ifdef DEBUG
- ARPASSERT(widget);
- ARPASSERT(data);
-#endif /* DEBUG */
-
- /* Convert to dereferencable form. */
- cb = (struct GSHCBData *) data;
-
- {
- GtkWidget * combo_box;
- /* INPUT must not be freed, as
- it is internal to the widget. */
- const gchar *input;
- /* Get widget from which to retrieve text. */
- combo_box=gtk_widget_get_ancestor(widget, GTK_TYPE_COMBO_BOX);
- /* Get the text from the widget. */
- input = gtk_combo_box_get_active_text(
- GTK_COMBO_BOX(combo_box));
-#ifdef DEBUG
- /* Check return value INPUT. */
- ARPASSERT(input);
-#endif /* DEBUG */
- exec_and_test_print(cb, input);
- /* Determine whether or not to exit
- because of this callback. */
- GSH_TEST_EXIT(cb->gsh);
- /* Add retrieved text to combo box popup list. */
- gtk_combo_box_prepend_text(GTK_COMBO_BOX(combo_box),
- (gchar *)input);
- }
-}
-
-/* Assign the function pointers for GSHCBData's methods. */
-static void
-assign_GSHCBData_methods(struct GSHCBData * cb)
-{
- cb->delete=&gsh_delete_GSHCBData;
- cb->entry=&gsh_entry_cb;
- cb->system=&gsh_system_cb;
-}
-
-/* GSHCBData Constructor */
-struct GSHCBData *
-gsh_new_GSHCBData(struct GSH * gsh, gpointer data)
-{
- struct GSHCBData * cb;
-
- /* Allocate. */
- cb = xmalloc(sizeof(struct GSHCBData));
- /* Store constructor arguments. */
- cb->gsh=gsh;
- cb->data=data;
- /* Set up methods. */
- assign_GSHCBData_methods(cb);
-
- return cb;
-}
-
Index: callbacks.h
===================================================================
RCS file: callbacks.h
diff -N callbacks.h
--- callbacks.h 26 May 2007 21:24:07 -0000 1.11
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,48 +0,0 @@
-/*
- AntiRight
- (c) 2002-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_CALLBACKS_H
-#define GSH_CALLBACKS_H
-
-struct GSHCBData
-{
- struct GSH *gsh;
- gpointer data;
- void (*delete)(struct GSHCBData *);
- void (*system)(GtkWidget *, gpointer);
- void (*entry)(GtkWidget *, gpointer);
-};
-
-struct GSHCBData *
-gsh_new_GSHCBData(struct GSH * gsh, gpointer data);
-
-#define GSH_TEST_EXIT(gsh_arg)\
-{\
- struct GSH * gsh = gsh_arg;\
- if (GSH_FLAG(GSH_CBEXIT))\
- gtk_main_quit();\
-}
-
-void
-gsh_send_signal(GtkWidget * widget, const gchar * signal_name);
-
-#endif /* not GSH_CALLBACKS_H */
Index: clock.c
===================================================================
RCS file: clock.c
diff -N clock.c
--- clock.c 21 May 2007 00:11:38 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,73 +0,0 @@
-/*
- 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;
- struct tm split_time;
- time_t time_value;
-
- (void)time(&time_value);
- (void)localtime_r(&time_value, &split_time);
- asprintf(&time_string, "%.2d/%.2d/%.2d\n%.2d:%.2d:%.2d",
- split_time.tm_mon+1,
- split_time.tm_mday,
- split_time.tm_year%100,
- split_time.tm_hour,
- split_time.tm_min,
- split_time.tm_sec);
-
- return time_string;
-}
-
-static void
-update_clock(const gchar * command, gpointer clock_pointer)
-{
- GtkWidget * clock;
- gchar * time_string;
-
- UNUSED(command);
- clock=(GtkWidget *)clock_pointer;
- time_string=get_time_string();
- gtk_label_set_text(GTK_LABEL(clock), time_string);
- g_free(time_string);
-}
-
-GtkWidget *
-gsh_clock_new(GSH * gsh)
-{
- GtkWidget * clock;
- struct GSHUpdatedWidget * updated_widget;
-
- clock=gtk_label_new(NULL);
- gsh_widget_set_font(clock, NULL);
- updated_widget=ARNEW(gsh, GSHUpdatedWidget,
- &update_clock, NULL, clock);
- $(gsh->update, add, updated_widget);
-
- return clock;
-}
-
Index: clock.h
===================================================================
RCS file: clock.h
diff -N clock.h
--- clock.h 20 May 2007 18:29:58 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,30 +0,0 @@
-/*
- 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 */
-
Index: command_shell.c
===================================================================
RCS file: command_shell.c
diff -N command_shell.c
--- command_shell.c 17 May 2007 04:32:20 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,126 +0,0 @@
-/*
- AntiRight
- (c) 2002-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"
-
-static void
-gsh_delete_GSHCommandShell(GSHCommandShell * this)
-{
- g_free(this);
-}
-
-static GtkWidget *
-get_command_shell(GSHCommandShell * this)
-{
- return this->widgets.row;
-}
-
-static void
-run_command(GSHCommandShell * this, const gchar * command)
-{
- gchar * result;
-
- result=antiright_pipe_read(command);
- gtk_label_set_text(GTK_LABEL(this->widgets.output), result);
- g_free(result);
-}
-
-static void
-run_command_cb(GtkWidget * widget, gpointer data)
-{
- GSHCommandShell * this;
- GtkEntry * entry;
-
- this=(GSHCommandShell *)data;
- entry=GTK_ENTRY(this->widgets.input);
- run_command(this, gtk_entry_get_text(entry));
- gtk_entry_set_text(entry, "");
-}
-
-static void
-setup_command_shell_methods(GSHCommandShell * this)
-{
- this->delete=&gsh_delete_GSHCommandShell;
- this->get=&get_command_shell;
- this->run=&run_command;
-}
-
-static void
-set_output_label_options(GtkWidget * output)
-{
- gtk_label_set_justify(GTK_LABEL(output), GTK_JUSTIFY_LEFT);
- gsh_widget_set_font(output, NULL);
- gtk_label_set_selectable(GTK_LABEL(output), TRUE);
-}
-
-static void
-setup_output_scroller(GtkWidget * row, GtkWidget * output)
-{
- GtkWidget * scroller;
-
- GSH_SHOW_CREATE(scroller, scrolled_window, NULL, NULL);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroller),
- GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
- GSHCA(row, scroller);
- gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroller),
- output);
-}
-
-static void
-setup_output_area(GSHCommandShell * this)
-{
- GtkWidget * output;
-
- GSH_SHOW_CREATE(this->widgets.output, label, NULL);
- output=this->widgets.output;
- set_output_label_options(output);
- setup_output_scroller(this->widgets.row, output);
-}
-
-static void
-setup_command_shell_widgets(GSHCommandShell * this)
-{
- GSH_SHOW_CREATE(this->widgets.row, vbox, 0, FALSE);
- setup_output_area(this);
- GSH_SHOW_CREATE(this->widgets.input, entry);
- GSHCONNECT(this->widgets.input, "activate", run_command_cb, this);
- GSHCA_TIGHT(this->widgets.row, this->widgets.input);
-}
-
-static void
-setup_command_shell(GSHCommandShell * this)
-{
- setup_command_shell_methods(this);
- setup_command_shell_widgets(this);
-}
-
-GSHCommandShell *
-gsh_new_GSHCommandShell()
-{
- GSHCommandShell * shell;
-
- shell=xmalloc(sizeof(GSHCommandShell));
- setup_command_shell(shell);
-
- return shell;
-}
-
Index: command_shell.h
===================================================================
RCS file: command_shell.h
diff -N command_shell.h
--- command_shell.h 16 May 2007 20:39:44 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,44 +0,0 @@
-/*
- AntiRight
- (c) 2002-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_CMDSHELL_H
-#define GSH_CMDSHELL_H
-
-struct GSHCommandShell
-{
- struct
- {
- GtkWidget * input;
- GtkWidget * output;
- GtkWidget * row;
- } widgets;
- void (*delete)(struct GSHCommandShell *);
- void (*run)(struct GSHCommandShell *, const gchar *);
- GtkWidget * (*get)(struct GSHCommandShell *);
-};
-
-typedef struct GSHCommandShell GSHCommandShell;
-
-GSHCommandShell *
-gsh_new_GSHCommandShell();
-
-#endif /* GSH_CMDSHELL_H */
Index: containers.c
===================================================================
RCS file: containers.c
diff -N containers.c
--- containers.c 14 May 2007 20:23:22 -0000 1.21
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,110 +0,0 @@
-/*
- AntiRight
- (c) 2002-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"
-
-/* GTK Scrolled Window Set */
-#define GSWS(item, window, ...)\
- gtk_scrolled_window_set_##item(GTK_SCROLLED_WINDOW(window),\
- __VA_ARGS__)
-
-static void
-set_scrolled_window_options(GtkWidget * win)
-{
-#define GSWSW(item, ...) GSWS(item, win, __VA_ARGS__)
- GSWSW(shadow_type, GTK_SHADOW_OUT);
-/* Shortened name. */
-#define GTKPA GTK_POLICY_AUTOMATIC
- GSWSW(policy, GTKPA, GTKPA);
-}
-
-static void
-setup_scrolled_window_containers(GtkWidget * scrolled_window,
- GtkWidget * window, GtkWidget * hrow)
-{
- GSHCA(window, scrolled_window);
- /* Add the main row manager to the scrolled window. */
- gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(
- scrolled_window), hrow);
-}
-
-static void
-gsh_setup_scrolled_window(struct GSH * gsh)
-{
- GtkWidget * scrolled_window;
-
- scrolled_window=gsh->widgets.scrolled_window
- =gtk_scrolled_window_new(NULL, NULL);
- set_scrolled_window_options(gsh->widgets.scrolled_window);
- setup_scrolled_window_containers(scrolled_window, gsh->widgets.window,
- gsh->rows->h);
- gtk_widget_show(scrolled_window);
-}
-
-static void
-setup_framed_containers(GtkWidget * frame, GtkWidget * window,
- GtkWidget * hrow)
-{
- GSHCA(window, frame);
- GSHCA(frame, hrow);
-}
-
-static void
-setup_framed(struct GSH * gsh)
-{
- GtkWidget * frame;
-
- frame = gtk_frame_new(NULL);
- setup_framed_containers(frame, gsh->widgets.window, gsh->rows->h);
- gtk_widget_show(frame);
-}
-
-void
-gsh_setup_containers(struct GSH * gsh)
-{
- gtk_widget_show(gsh->rows->h = gtk_hbox_new(FALSE, 2));
- $(gsh->rows, new);
-}
-
-#define GWA gsh->widgets.app
-
-static void
-setup_app_mode_frame(struct GSH * gsh)
-{
- gtk_container_add(GTK_CONTAINER(GWA.frame),
- gsh->rows->h);
- gsh->rows->h=GWA.row;
-}
-
-void
-gsh_setup_base_container(struct GSH * gsh)
-{
- if(GWA.frame)
- setup_app_mode_frame(gsh);
- if (GSH_FLAG(GSH_SCROLL))
- gsh_setup_scrolled_window(gsh);
- else if (!GSH_FLAG(GSH_NO_BASE_FRAME))
- setup_framed(gsh);
- else
- GSHCA(gsh->widgets.window, gsh->rows->h);
-}
-
Index: containers.h
===================================================================
RCS file: containers.h
diff -N containers.h
--- containers.h 5 May 2007 22:33:06 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,32 +0,0 @@
-/*
- AntiRight
- (c) 2002-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_CONTAINERS_H
-#define GSH_CONTAINERS_H
-
-void
-gsh_setup_containers(struct GSH * gsh);
-
-void
-gsh_setup_base_container(struct GSH * gsh);
-
-#endif /* GSH_CONTAINERS_H */
Index: dialog_options.c
===================================================================
RCS file: dialog_options.c
diff -N dialog_options.c
--- dialog_options.c 14 May 2007 18:06:34 -0000 1.20
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,151 +0,0 @@
-/*
- AntiRight
- (c) 2002-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"
-
-static void
-gsh_message_dialog(GSH * gsh, GtkMessageType type, const gchar *text)
- __attribute__((noreturn));
-
-static void
-gsh_font_dialog() __attribute__((noreturn));
-
-static void
-gsh_color_dialog() __attribute__((noreturn));
-
-static void
-gsh_message_dialog(GSH * gsh, GtkMessageType type, const gchar *text)
-{
- gtk_dialog_run(GTK_DIALOG(gtk_message_dialog_new(GTK_WINDOW(
- gsh->widgets.window), GTK_DIALOG_DESTROY_WITH_PARENT, type,
- GTK_BUTTONS_CLOSE, (gchar *) text)));
-
- exit(0);
-}
-
-#define GMD gsh_message_dialog
-
-#define ERROR_DIALOG(gsh, message) \
- GMD(gsh, GTK_MESSAGE_ERROR, message)
-#define INFO_DIALOG(gsh, message) \
- GMD(gsh, GTK_MESSAGE_INFO, message)
-#define WARNING_DIALOG(gsh, message) \
- GMD(gsh, GTK_MESSAGE_WARNING, message)
-
-static void
-select_font(GtkWidget * dialog)
-{
- gchar *font;
-
- font = gtk_font_selection_dialog_get_font_name(
- GTK_FONT_SELECTION_DIALOG(dialog));
- g_print("%s\n", font);
- g_free(font);
-}
-
-static void
-gsh_font_dialog()
-{
- GtkWidget *dialog;
-
- dialog = gtk_font_selection_dialog_new("Font Selector");
- if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK)
- select_font(dialog);
-
- exit(0);
-}
-
-static void
-color_select(GtkWidget * dialog)
-{
- GdkColor color;
-
- gtk_color_selection_get_current_color( GTK_COLOR_SELECTION(
- GTK_COLOR_SELECTION_DIALOG(dialog)->colorsel), &color);
- g_print("#%x%x%x\n", color.red, color.green, color.blue);
-}
-
-static void
-gsh_color_dialog()
-{
- GtkWidget *dialog;
-
- dialog = gtk_color_selection_dialog_new("Color Selector");
-
- if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK)
- color_select(dialog);
-
- exit(0);
-}
-
-void
-gsh_handle_dialog_arguments(GSH * gsh, const gint argc, const gchar **argv,
- gint *counter)
-{
-#ifndef DEBUG
- UNUSED(argc);
-#endif /* DEBUG */
- g_assert(strlen(argv[(*counter)]) > 2);
-#ifdef DEBUG
- ARPASSERT(gsh);
-#endif /* DEBUG */
- switch (argv[(*counter)][2])
- {
- case 'a':
- gsh_about_dialog();
- break;
- case 'c': /* Color Selection */
- gsh_color_dialog();
- break;
- case 'D': /* Folder Creation Selector */
- GSH_FOLDER_CREATE_DIALOG(gsh);
- break;
- case 'd': /* Folder Selector */
- GSH_FOLDER_OPEN_DIALOG(gsh);
- break;
- case 'e': /* Error Message */
- GSH_COUNT(argc, counter);
- ERROR_DIALOG(gsh, argv[*counter]);
- break;
- case 'F': /* Font Selection */
- gsh_font_dialog();
- break;
- case 'f':
- /* File Selection */
- GSH_FILE_OPEN_DIALOG(gsh);
- break;
- case 'i': /* Information */
- GSH_COUNT(argc, counter);
- INFO_DIALOG(gsh, argv[*counter]);
- break;
- case 's': /* Filename Selection for Saving */
-
- GSH_FILE_SAVE_DIALOG(gsh);
- break;
- case 'w': /* Warning */
- GSH_COUNT(argc, counter);
- WARNING_DIALOG(gsh, argv[*counter]);
- break;
- default:
- ARWARN("invalid dialog option");
- }
-}
Index: dialog_options.h
===================================================================
RCS file: dialog_options.h
diff -N dialog_options.h
--- dialog_options.h 14 May 2007 18:06:34 -0000 1.5
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,30 +0,0 @@
-/*
- AntiRight
- (c) 2002-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_DIALOG_OPTIONS
-#define GSH_DIALOG_OPTIONS
-
-void
-gsh_handle_dialog_arguments(GSH * gsh, const gint argc, const gchar **argv,
- gint *counter);
-
-#endif
Index: dragdrop.c
===================================================================
RCS file: dragdrop.c
diff -N dragdrop.c
--- dragdrop.c 14 May 2007 18:06:34 -0000 1.13
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,160 +0,0 @@
-/*
- 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"
-
-/*
- * Portions Copyright 2005 Ryan McDougall, GNU GPL terms. Based on drag
- * and drop tutorial: http://live.gnome.org/GnomeLove/DragNDropTutorial
- */
-
-enum
-{
- TARGET_STRING
-};
-
-static GtkTargetEntry target_list[] =
-{
- {(gchar *)"text/plain", 0, TARGET_STRING}
-};
-
-static guint n_targets = G_N_ELEMENTS(target_list);
-
-static void
-drag_received(GtkWidget *widget, GdkDragContext * context, gint x,
- gint y, GtkSelectionData * selection, guint target_type,
- guint time, gpointer data);
-
-static gboolean
-drag_drop(GtkWidget *widget, GdkDragContext * context, gint x,
- gint y, guint time, gpointer data);
-
-static void
-drag_data_get(GtkWidget *widget, GdkDragContext * context,
- GtkSelectionData * selection, guint target_type,
- guint time, gpointer data);
-
-/*static void
- drag_begin(GtkWidget *widget, GdkDragContext * context, gpointer data);
-
-static void
- drag_end(GtkWidget *widget, GdkDragContext * context, gpointer data);*/
-
-#define DND_SIGNAL(sig, func) \
- (void) g_signal_connect(widget, sig, G_CALLBACK(func), NULL)
-
-#define SETUP_DRAG_DROP_SIGNALS(widget)\
-{\
- DND_SIGNAL("drag-data-received", drag_received);\
- DND_SIGNAL("drag-drop", drag_drop);\
- DND_SIGNAL("drag-data-get", drag_data_get);\
-}
-
-void
-gsh_setup_drag_drop(struct GSH * gsh, GtkWidget *widget)
-{
- gtk_drag_dest_set(widget, GTK_DEST_DEFAULT_MOTION
- | GTK_DEST_DEFAULT_HIGHLIGHT, target_list, n_targets,
- GDK_ACTION_COPY);
-
- gtk_drag_source_set(widget, GDK_BUTTON1_MASK, target_list, n_targets,
- GDK_ACTION_COPY);
-
- SETUP_DRAG_DROP_SIGNALS(widget);
-
- if (GSH_FLAG(GSH_CBEXIT))
- DND_SIGNAL("drag-end", gtk_main_quit);
-}
-
-static void
-drag_received(GtkWidget *widget, GdkDragContext * context, gint x,
- gint y, GtkSelectionData * selection, guint target_type,
- guint time, gpointer data)
-{
- gboolean drag_status;
-
- UNUSED(x);
- UNUSED(y);
- UNUSED(data);
- switch (target_type)
- {
- case TARGET_STRING:
- sysprintf("%s %s",
- (const gchar *)gtk_button_get_label(
- GTK_BUTTON(widget)),
- (gchar *) selection->data);
- drag_status = TRUE;
- break;
- default:
- drag_status = FALSE;
- ARWARN("invalid data dropped");
- }
-
- gtk_drag_finish(context, drag_status, FALSE, time);
-}
-
-static gboolean
-drag_drop(GtkWidget *widget, GdkDragContext * context, gint x,
- gint y, guint time, gpointer data)
-{
- GdkAtom target_type;
-
- UNUSED(x);
- UNUSED(y);
- UNUSED(data);
- target_type =
- GDK_POINTER_TO_ATOM(g_list_nth_data(context->targets,
- TARGET_STRING));
-
- ARIFP(context->targets)
- {
- gtk_drag_get_data(widget, context, target_type, time);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static void
-drag_data_get(GtkWidget *widget, GdkDragContext * context,
- GtkSelectionData * selection, guint target_type,
- guint time, gpointer data)
-{
- const gchar *source_data;
-
- UNUSED(context);
- UNUSED(target_type);
- UNUSED(time);
- UNUSED(data);
- source_data = gtk_button_get_label(GTK_BUTTON(widget));
- gtk_selection_data_set(selection, selection->target, sizeof(gchar),
- (guchar *) source_data, strlen(source_data));
-}
-
-/* Use to set icon. */
-/*static void
-drag_begin(GtkWidget *widget, GdkDragContext * context, gpointer data)
-{
-}
-
-static void
-drag_end(GtkWidget *widget, GdkDragContext * context, gpointer data)
-{
-}*/
Index: dragdrop.h
===================================================================
RCS file: dragdrop.h
diff -N dragdrop.h
--- dragdrop.h 28 Feb 2007 03:53:51 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,29 +0,0 @@
-/*
- AntiRight
- (c) 2002-2006 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_DRAGDROP_H
-#define GSH_DRAGDROP_H
-
-void
- gsh_setup_drag_drop(struct GSH * gsh, GtkWidget *widget);
-
-#endif /* GSH_DRAGDROP_H */
Index: file_dialog.c
===================================================================
RCS file: file_dialog.c
diff -N file_dialog.c
--- file_dialog.c 10 May 2007 00:08:28 -0000 1.8
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,50 +0,0 @@
-/*
- AntiRight
- (c) 2002-2006 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"
-
-static void
-file_dialog_submit(GtkWidget * dialog)
-{
- gchar *name;
-
- name = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
- g_print("%s\n", name);
- g_free(name);
-}
-
-/* Taken from the GTK+ Reference Manual */
-void
-gsh_file_dialog(struct GSH * gsh, GtkFileChooserAction action)
-{
- GtkWidget *dialog;
-
- dialog=gtk_file_chooser_dialog_new("File Chooser",
- GTK_WINDOW(gsh->widgets.window), action, GTK_STOCK_CANCEL,
- GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL);
-
- if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT)
- file_dialog_submit(dialog);
-
- exit(0);
-}
-
-
Index: file_dialog.h
===================================================================
RCS file: file_dialog.h
diff -N file_dialog.h
--- file_dialog.h 9 May 2007 20:00:56 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,42 +0,0 @@
-/*
- AntiRight
- (c) 2002-2006 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_FILE_DIALOG
-#define GSH_FILE_DIALOG
-
-void
-gsh_file_dialog(struct GSH * gsh,
- GtkFileChooserAction action) __attribute__((noreturn));
-
-#define GSH_FILE_OPEN_DIALOG(gsh)\
- gsh_file_dialog(gsh, GTK_FILE_CHOOSER_ACTION_OPEN)
-
-#define GSH_FILE_SAVE_DIALOG(gsh)\
- gsh_file_dialog(gsh, GTK_FILE_CHOOSER_ACTION_SAVE)
-
-#define GSH_FOLDER_CREATE_DIALOG(gsh)\
- gsh_file_dialog(gsh, GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
-
-#define GSH_FOLDER_OPEN_DIALOG(gsh)\
- gsh_file_dialog(gsh, GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
-
-#endif /* !GSH_FILE_DIALOG */
Index: font.c
===================================================================
RCS file: font.c
diff -N font.c
--- font.c 17 May 2007 16:19:46 -0000 1.9
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,50 +0,0 @@
-/*
- AntiRight
- (c) 2002-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"
-
-static void
-set_font(GtkWidget * widget, const gchar * font)
-{
- PangoFontDescription *font_desc;
-#define PFD(op, arg) pango_font_description_##op(arg)
- font_desc = PFD(from_string, font);
- gtk_widget_modify_font(widget, font_desc);
- PFD(free, font_desc);
-}
-
-void
-gsh_widget_set_font(GtkWidget *widget, const gchar *font)
-{
-#ifdef DEBUG
- ARPASSERT(widget);
-#endif /* DEBUG */
- if(!font) /* Allowed assignmet for uninitialized const var. */
- font="Mono 12";
-#ifdef HAVE_VTE
- if(VTE_IS_TERMINAL(widget))
- vte_terminal_set_font_from_string(VTE_TERMINAL(widget), font);
-#endif /* HAVE_VTE */
- else /* Not a terminal. */
- set_font(widget, font);
-}
-
Index: font.h
===================================================================
RCS file: font.h
diff -N font.h
--- font.h 3 May 2007 03:42:31 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,29 +0,0 @@
-/*
- AntiRight
- (c) 2002-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 GTKSHELL_FONT_H
-#define GTKSHELL_FONT_H
-
-void
-gsh_widget_set_font(GtkWidget *widget, const gchar *font);
-
-#endif /* GTKSHELL_FONT_H */
Index: geometry.c
===================================================================
RCS file: geometry.c
diff -N geometry.c
--- geometry.c 9 May 2007 20:00:56 -0000 1.16
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,57 +0,0 @@
-/*
- AntiRight
- (c) 2002-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"
-
-
-static gboolean
-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))
- gsh->geometry=g_strdup("400x267");
-
- /* Result used in test of whether or not to set geometry. */
- return ARPBOOL(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))
- {
- /* Use GTK convenience function to set window geometry. */
- gtk_window_parse_geometry(GTK_WINDOW(gsh->widgets.window),
- gsh->geometry);
- /* Free the geometry string pointer after use, so this function,
- * if called twice, will use a default geometry, not the user
- * specified one. */
- g_free(gsh->geometry);
- /* Mark as unallocated. */
- gsh->geometry=NULL;
- }
-}
Index: geometry.h
===================================================================
RCS file: geometry.h
diff -N geometry.h
--- geometry.h 28 Feb 2007 03:53:51 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,32 +0,0 @@
-/*
- AntiRight
- (c) 2002-2006 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_GEOMETRY_H
-#define GSH_GEOMETRY_H
-
-void
- gsh_set_geometry(struct GSH * gsh);
-
-void
- gsh_check_and_set_geometry(struct GSH * gsh);
-
-#endif /* GSH_GEOMETRY_H */
Index: gshterm
===================================================================
RCS file: gshterm
diff -N gshterm
--- gshterm 10 Jun 2007 20:53:54 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,74 +0,0 @@
-#!/bin/sh
-
-gshterm_usage()
-{
- echo 'gshterm [e command][f font][s size][h]'
-}
-
-FONT=""
-GEOMETRY=""
-COMMAND=""
-DEBUG="FALSE"
-APP_MODE=""
-TRANSPARENT=""
-
-while [ $# -gt 0 ]; do
- case "$1" in
- -a)
- APP_MODE="-oa File::Exit___ 'Help::gtkshell -da & # About'"
- break
- ;;
- -e)
- shift
- COMMAND="\"$*\""
- break
- ;;
- -g)
- GEOMETRY="$2"
- shift
- ;;
- -f)
- FONT="$2"
- shift
- ;;
- -h)
- gshterm_usage
- ;;
- -s)
- FONT="$FONT $2"
- shift
- ;;
- -t)
- TRANSPARENT="-ott"
- break
- ;;
- esac
- shift
-done
-
-ARGS=""
-
-if [ "$GEOMETRY" != "" ]; then
- ARGS="$ARGS -og $GEOMETRY"
-fi
-if [ "$FONT" != "" ]; then
- ARGS="$ARGS -otf \"$FONT\""
-else
- ARGS="$ARGS -otf 'Mono 12'"
-fi
-
-#echo $*
-
-if [ "$COMMAND" = "" ]; then
- COMMAND=$SHELL
-fi
-
-
-COMMAND="gtkshell $APP_MODE -oF $ARGS -oT $COMMAND -as $COMMAND"
-
-if [ "$DEBUG" = "TRUE" ]; then
- echo $COMMAND
-fi
-
-exec sh -c "$COMMAND"
-
Index: gtkshell.c
===================================================================
RCS file: gtkshell.c
diff -N gtkshell.c
--- gtkshell.c 23 May 2007 14:57:46 -0000 1.42
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,141 +0,0 @@
-/*
- AntiRight
- (c) 2002-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"
-
-static void
-delete_child_classes(GSH * gsh)
-{
- ARDELETE(gsh->rows);
- ARDELETE(gsh->terminal);
- ARDELETE(gsh->update);
-}
-
-static void
-gsh_delete_GSH(struct GSH * gsh)
-{
- delete_child_classes(gsh);
- GSH_FREE_IF(gsh->geometry);
-}
-
-static void
-setup_add_methods(GSH * gsh)
-{
-#define GSHA gsh->add
- GSHA.window=&gsh_GSH_add_window;
- GSHA.button=&gsh_add_button;
- GSHA.label=&gsh_add_label;
-}
-
-static void
-setup_methods(GSH * gsh)
-{
- gsh->delete = &gsh_delete_GSH;
- gsh->parse = &gsh_parse_arguments;
- gsh->finalize = &gsh_GSH_finalize;
- gsh->init = &gsh_setup_containers;
- gsh->manage=&gsh_manage;
- setup_add_methods(gsh);
-}
-
-static void
-setup_child_classes(GSH * gsh)
-{
- gsh->update = ARNEW(gsh, GSHUpdateManager);
- gsh->rows = ARNEW(gsh, GSHRows);
- gsh->terminal = ARNEW(gsh, GSH_Terminal, gsh);
-}
-
-#define GWA gsh->widgets.app
-
-static void
-setup_app_menus(GSH * gsh)
-{
-#define GWAM GWA.menus
- GWAM.file=NULL;
- GWAM.edit=NULL;
- GWAM.view=NULL;
- GWAM.tools=NULL;
- GWAM.help=NULL;
-}
-
-static void
-setup_widget_app_member_fields(GSH * gsh)
-{
- GWA.menubar=NULL;
- setup_app_menus(gsh);
- GWA.frame=NULL;
- GWA.status=NULL;
-}
-
-static void
-setup_widget_member_fields(GSH * gsh)
-{
- gsh->widgets.last_managed=NULL;
- setup_widget_app_member_fields(gsh);
-}
-
-static void
-setup_editor_member_fields(GSH * gsh)
-{
- gsh->editor.widget=NULL;
- gsh->editor.filename=NULL;
-}
-
-static void
-setup_main_member_fields(GSH * gsh)
-{
- gsh->geometry = (gchar *)NULL;
- gsh->bflags = 0;
- gsh->icon_size=GTK_ICON_SIZE_DND;
-}
-
-static void
-setup_member_fields(GSH * gsh)
-{
- setup_widget_member_fields(gsh);
- setup_editor_member_fields(gsh);
- setup_main_member_fields(gsh);
-}
-
-static void
-setup_gsh(GSH * gsh)
-{
- setup_child_classes(gsh);
- setup_methods(gsh);
- setup_member_fields(gsh);
- /* Add initial window. */
- $(gsh, add.window);
-}
-
-struct GSH *
-gsh_new_GSH()
-{
- struct GSH *gsh;
-
- gsh = (struct GSH *) xmalloc(sizeof(struct GSH));
- setup_gsh(gsh);
-
- return gsh;
-}
-
Index: gtkshell.h
===================================================================
RCS file: gtkshell.h
diff -N gtkshell.h
--- gtkshell.h 23 May 2007 14:57:46 -0000 1.51
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,122 +0,0 @@
-/*
- AntiRight
- (c) 2002-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_GTKSHELL_H
-#define GSH_GTKSHELL_H
-
-#include <gtk/gtk.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#ifdef HAVE_VTE
-#include <vte/vte.h>
-#endif /* HAVE_VTE */
-#include <unistd.h>
-#include <signal.h>
-
-#ifdef LIBGC
-#include <gc.h>
-#endif /* LIBGC */
-
-#include "../libantiright/library.h"
-
-#ifndef YYFILE
-#include "y.tab.h"
-#endif /* not YYFILE */
-
-#include "macros.h"
-
-#include "row_struct.h"
-#include "terminal_struct.h"
-#include "updated.h"
-#include "update_manager_struct.h"
-
-
-struct GSH
-{
- /* member data */
- /address@hidden@*/ gchar *geometry;
- Bitmask bflags;
- GtkIconSize icon_size;
-
- /* member data categories */
- struct /* widgets */
- {
- GtkWidget * window;
- GtkWidget * scrolled_window;
- GtkWidget * button;
- GtkWidget * last_managed;
- struct /* app mode */
- {
- struct
- {
- GtkWidget * file;
- GtkWidget * edit;
- GtkWidget * tools;
- GtkWidget * view;
- GtkWidget * help;
- } menus;
- GtkWidget * menubar;
- GtkWidget * toolbar;
- GtkWidget * status;
- GtkWidget * frame;
- GtkWidget * row;
- } app;
- } widgets;
- struct /* text editor */
- {
- gchar * filename;
- GtkWidget * widget;
- } editor;
-
- /* member classes */
- struct GSHRows * rows;
- struct GSHUpdateManager * update;
- struct GSH_Terminal * terminal;
-
- /* methods */
- void (*delete)(struct GSH *);
- void (*parse)(struct GSH *, const gint, const gchar **);
- void (*init)(struct GSH *);
- void (*finalize)(struct GSH *);
- void (*manage)(struct GSH *, GtkWidget *);
-
- /* method categories */
- struct
- {
- GtkWidget * (*window)(struct GSH *);
- GtkWidget * (*button)(struct GSH *, const gchar *);
- GtkWidget * (*label)(struct GSH *, const gchar *);
- } add;
-
-};
-
-typedef struct GSH GSH;
-
-#include "module_includes.h"
-
-struct GSH *
-gsh_new_GSH();
-
-#endif
Index: guidl.lex
===================================================================
RCS file: guidl.lex
diff -N guidl.lex
--- guidl.lex 27 Apr 2007 21:33:27 -0000 1.12
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-%{
-
-#include "gtkshell.h"
-
-%}
-%%
-\"[^\"]*\" {
- /* Remove quotes. */
- yylval.string=g_strdup(yytext+1);
- yylval.string[yyleng-2]='\0';
- return STRING;
- }
-[0-9]+ yylval.number=atoi(yytext); return NUM;
-, return COMMA;
-; return END;
-option return OPTION;
-add return ADD;
-buttons return BUTTONS;
-button return BUTTON;
-echo return TOKEN_ECHO;
-dialog return DIALOG;
-[ \t\n] /* ignore */;
-"//".*$ /* comment */;
-%%
Index: guidl.y
===================================================================
RCS file: guidl.y
diff -N guidl.y
--- guidl.y 14 May 2007 18:06:34 -0000 1.21
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,146 +0,0 @@
-%{
-
-/*
- 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 <stdio.h>
-#define YYFILE
-#include "gtkshell.h"
-
-void
-yyerror(const char *string);
-
-int
-yywrap();
-
-void
-yyunput();
-
-void
-yyerror(const char *string)
-{
- g_error("error: %s\n", string);
-}
-
-int
-yywrap()
-{
- return 1;
-}
-
-struct GDLEnvironment * gsh_guidl_env;
-
-%}
-%union
-{
- gchar * string;
- gint number;
-}
-%token IFS SC COMMA OPTION DIALOG
-%token END ADD BUTTONS BUTTON TOKEN_ECHO
-%token <string> STRING
-%token <number> NUM
-%%
-commands:
-/* empty */
-|
-commands command END
-;
-
-command:
-option
-|
-add
-|
-dialog
-|
-TOKEN_ECHO STRING
-{
- g_print("%s", $2);
- g_free($2);
-}
-;
-
-dialog:
-DIALOG STRING
-{
- gsh_guidl_dialog($2, NULL);
-}
-|
-DIALOG STRING STRING
-{
- gsh_guidl_dialog($2, $3);
-}
-;
-
-option:
-OPTION STRING
-{
- gsh_guidl_option($2, NULL);
-}
-|
-OPTION STRING STRING
-{
- gsh_guidl_option($2, $3);
-}
-|
-OPTION STRING NUM
-{
- gchar * num_string;
- ar_asprintf(&num_string, "%d", $3);
- gsh_guidl_option($2, num_string);
- /* num_string is freed in above call. */
-}
-;
-
-add:
-ADD STRING STRING
-{
- gsh_guidl_widget($2, $3);
-}
-|
-ADD STRING
-{
- gsh_guidl_widget($2, NULL);
-}
-|
-ADD BUTTONS buttons
-|
-ADD BUTTON button
-;
-
-buttons:
-/* empty */
-|
-buttons button COMMA
-|
-buttons button
-;
-
-button:
-STRING
-{
- $(gsh_guidl_env->args, add, $1);
- g_free($1);
-}
-;
-
Index: guidl_dialog.c
===================================================================
RCS file: guidl_dialog.c
diff -N guidl_dialog.c
--- guidl_dialog.c 14 May 2007 18:06:34 -0000 1.9
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,50 +0,0 @@
-/*
- 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
-*/
-
-/* Set the dictionary to use for this definition file. */
-#define DICT gsh_guidl_env->dictionaries->dialog
-#include "gtkshell.h"
-
-extern struct GDLEnvironment * gsh_guidl_env;
-
-#define DEF(a, b) GSH_GUIDL_DEFINE(DICT, a, b)
-
-static void
-setup_dictionary()
-{
- DICT=ARNEW(ar, ARTupleVector);
- /* Begin adding mappings between keys and values. */
- DEF("file", "-df");
- DEF("font", "-dF");
- DEF("about", "-da");
- DEF("folder", "-dd");
- DEF( "create folder", "-dD");
- DEF("save", "-ds");
- DEF("color", "-dc");
- DEF("info", "-di");
- DEF("warning", "-dw");
- DEF("error", "-de");
-}
-
-/* Generate public function to access these definitions. */
-GSH_GUIDL_ITEM_FUNC(dialog, DICT);
-
Index: guidl_dialog.h
===================================================================
RCS file: guidl_dialog.h
diff -N guidl_dialog.h
--- guidl_dialog.h 6 May 2007 05:00:11 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,28 +0,0 @@
-/*
- 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_GUIDL_DIALOG_H
-#define GSH_GUIDL_DIALOG_H
-
-GSH_GUIDL_ITEM_HEAD(dialog);
-
-#endif /* GSH_GUIDL_DIALOG_H */
Index: guidl_dictionary.c
===================================================================
RCS file: guidl_dictionary.c
diff -N guidl_dictionary.c
--- guidl_dictionary.c 14 May 2007 20:23:22 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,85 +0,0 @@
-/*
- 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"
-
-extern struct GDLEnvironment * gsh_guidl_env;
-
-static void
-delete_dictionary(struct ARTupleVector * dict)
-{
- if(dict)
- $(dict, delete);
-}
-
-static void
-delete_contents(struct GDLDictionaries * dictionaries)
-{
- delete_dictionary(dictionaries->widget);
- delete_dictionary(dictionaries->option);
- delete_dictionary(dictionaries->dialog);
-}
-
-static void
-gsh_delete_GDLDictionaries(struct GDLDictionaries * dictionaries)
-{
- delete_contents(dictionaries);
- g_free(dictionaries);
-}
-
-
-static void
-initialize_member_fields(struct GDLDictionaries * dictionaries)
-{
-#define NULLIFY(dict) dictionaries->dict=NULL
- NULLIFY(widget);
- NULLIFY(dialog);
- NULLIFY(option);
-}
-
-static void
-setup_GDLDictionaries(struct GDLDictionaries * dictionaries)
-{
- initialize_member_fields(dictionaries);
- /* Set up methods. */
- dictionaries->delete=&gsh_delete_GDLDictionaries;
-}
-
-struct GDLDictionaries *
-gsh_new_GDLDictionaries()
-{
- struct GDLDictionaries * dictionaries;
-
- dictionaries=g_malloc(sizeof(struct GDLDictionaries));
- setup_GDLDictionaries(dictionaries);
-
- return dictionaries;
-}
-
-void
-gsh_guidl_generic_item(gchar * item, gchar * argument,
- struct ARTupleVector * dict)
-{
- $(gsh_guidl_env, add, $(dict, find, item), argument);
- g_free(item);
-}
-
Index: guidl_dictionary.h
===================================================================
RCS file: guidl_dictionary.h
diff -N guidl_dictionary.h
--- guidl_dictionary.h 6 May 2007 05:00:11 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,65 +0,0 @@
-/*
- 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_GUIDL_DICTIONARY_H
-#define GSH_GUIDL_DICTIONARY_H
-
-struct GDLDictionaries
-{
- struct ARTupleVector * widget;
- struct ARTupleVector * dialog;
- struct ARTupleVector * option;
- void (*delete)(struct GDLDictionaries *);
-};
-
-#define GSH_GUIDL_CHECK_DICTIONARY(dict, setup)\
-{\
- if(!dict)\
- setup();\
-}
-
-#define GSH_GUIDL_DEFINE(dict, a, b)\
- $(dict, add, (gchar *)a, (gchar *)b)
-
-#define GSH_GUIDL_ITEM(item, arg, dict, setup)\
-{\
- GSH_GUIDL_CHECK_DICTIONARY(dict, setup);\
- gsh_guidl_generic_item(item, arg, dict);\
-}
-
-#define GSH_GUIDL_ITEM_FUNC(type, dict)\
-void gsh_guidl_ ##type (gchar * item, gchar * arg)\
-{\
- GSH_GUIDL_ITEM(item, arg, dict, setup_dictionary);\
-}
-
-#define GSH_GUIDL_ITEM_HEAD(type)\
-void gsh_guidl_ ##type (gchar * item, gchar * arg);
-
-struct GDLDictionaries *
-gsh_new_GDLDictionaries();
-
-void
-gsh_guidl_generic_item(gchar * item, gchar * argument,
- struct ARTupleVector * dict);
-
-#endif /* GSH_GUIDL_DICTIONARY_H */
Index: guidl_options.c
===================================================================
RCS file: guidl_options.c
diff -N guidl_options.c
--- guidl_options.c 11 May 2007 23:28:52 -0000 1.8
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,54 +0,0 @@
-/*
- 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
-*/
-
-#define DICT gsh_guidl_env->dictionaries->option
-#include "gtkshell.h"
-
-extern struct GDLEnvironment * gsh_guidl_env;
-
-#define DEF(a, b) GSH_GUIDL_DEFINE(DICT, a, b);
-
-static void
-setup_dictionary()
-{
- DICT=ARNEW(ar, ARTupleVector);
- DEF("framed labels", "-of");
- DEF("undecorated", "-on");
- DEF("exit on activate", "-oe");
- DEF("horizontal labels", "-oh");
- DEF("scrolled", "-os");
- DEF("no fill", "-ol");
- DEF("fill", "-oL");
- DEF("geometry", "-og");
- DEF("title", "-oT");
- DEF("terminal font", "-otf");
- DEF("terminal width", "-otw");
- DEF("terminal height", "-oth");
- DEF("rows", "-or");
- DEF("update frequency", "-ou");
- DEF("application", "-oa");
- DEF("icon size", "-oi");
- DEF("pane next", "-op");
-}
-
-GSH_GUIDL_ITEM_FUNC(option, DICT);
-
Index: guidl_options.h
===================================================================
RCS file: guidl_options.h
diff -N guidl_options.h
--- guidl_options.h 6 May 2007 05:00:11 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,28 +0,0 @@
-/*
- 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_GUIDL_OPTIONS_H
-#define GSH_GUIDL_OPTIONS_H
-
-GSH_GUIDL_ITEM_HEAD(option);
-
-#endif /* GSH_GUIDL_OPTIONS_H */
Index: guidl_util.c
===================================================================
RCS file: guidl_util.c
diff -N guidl_util.c
--- guidl_util.c 11 May 2007 23:28:52 -0000 1.20
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,86 +0,0 @@
-/*
- 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"
-
-struct GDLEnvironment * gsh_guidl_env=NULL;
-
-#define EDEL(member) ARDELETE(env->member)
-
-static void
-gsh_delete_GDLEnvironment(struct GDLEnvironment * env)
-{
- EDEL(dictionaries);
- EDEL(args);
-}
-
-#define APPEND_ARG(env, arg) $(env->args, add, arg)
-
-static void
-gsh_GDLEnvironment_add(struct GDLEnvironment * env,
- const gchar * switches, gchar * argument)
-{
- /* A command base argument (for command line
- switch translation) is required. */
- if(switches)
- {
-#ifdef DEBUG
- ARPASSERT(env);
-#endif /* DEBUG */
- APPEND_ARG(env, switches);
- if(argument)
- {
- APPEND_ARG(env, argument);
- g_free(argument);
- }
- }
-}
-
-#define CONSTRUCT_MEMBER_CLASSES(env)\
-{\
- env->args=ARNEW(ar, ARArguments);\
- env->dictionaries=ARNEW(gsh, GDLDictionaries);\
-}
-
-#define ASSIGN_METHODS(env)\
-{\
- env->delete=&gsh_delete_GDLEnvironment;\
- env->add=&gsh_GDLEnvironment_add;\
-}
-
-#define SETUP_GDLENVIRONMENT(env)\
-{\
- CONSTRUCT_MEMBER_CLASSES(env);\
- ASSIGN_METHODS(env);\
-}
-
-struct GDLEnvironment *
-gsh_new_GDLEnvironment()
-{
- struct GDLEnvironment * env;
-
- env = xmalloc(sizeof(struct GDLEnvironment));
- SETUP_GDLENVIRONMENT(env);
-
- return env;
-}
-
Index: guidl_util.h
===================================================================
RCS file: guidl_util.h
diff -N guidl_util.h
--- guidl_util.h 3 May 2007 03:42:31 -0000 1.9
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,46 +0,0 @@
-/*
- 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_GUIDL_UTIL_H
-#define GSH_GUIDL_UTIL_H
-
-struct GDLEnvironment
-{
- struct GDLDictionaries * dictionaries;
- struct ARArguments * args;
- /* destructor */
- void (*delete)(struct GDLEnvironment *);
- /* First argument to ADD is not freed. If dynamically allocated,
- you must free. */
- void (*add)(struct GDLEnvironment *, const gchar *, gchar *);
-};
-
-struct GDLEnvironment *
-gsh_new_GDLEnvironment();
-
-int
-yylex();
-
-int
-yyparse();
-
-#endif /* not GSH_GUIDL_UTIL_H */
Index: guidl_widgets.c
===================================================================
RCS file: guidl_widgets.c
diff -N guidl_widgets.c
--- guidl_widgets.c 20 May 2007 18:29:58 -0000 1.10
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,54 +0,0 @@
-/*
- 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
-*/
-
-#define DICT gsh_guidl_env->dictionaries->widget
-#include "gtkshell.h"
-
-extern struct GDLEnvironment * gsh_guidl_env;
-
-
-#define DEF(a, b)\
- GSH_GUIDL_DEFINE(DICT, a, b)
-
-static void
-setup_dictionary()
-{
- DICT=ARNEW(ar, ARTupleVector);
- DEF("label", "-al");
- DEF("prompt", "-at");
- DEF("terminal", "-as");
- DEF("window", "-aw");
- DEF("separator", "-aS");
- DEF("updating label", "-aul");
- DEF("updating progress", "-aup");
- DEF("row", "-ar");
- DEF("viewer", "-ae");
- DEF("text", "-aT");
- DEF("system label", "-acl");
- DEF("system button", "-acb");
- DEF("vertical pane", "-ab");
- DEF("command shell", "-aC");
- DEF("clock applet", "-aAc");
-}
-
-GSH_GUIDL_ITEM_FUNC(widget, DICT);
-
Index: guidl_widgets.h
===================================================================
RCS file: guidl_widgets.h
diff -N guidl_widgets.h
--- guidl_widgets.h 6 May 2007 05:00:11 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,28 +0,0 @@
-/*
- 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_GUIDL_WIDGETS_H
-#define GSH_GUIDL_WIDGETS_H
-
-GSH_GUIDL_ITEM_HEAD(widget);
-
-#endif /* GSH_GUIDL_WIDGETS_H */
Index: image_button.c
===================================================================
RCS file: image_button.c
diff -N image_button.c
--- image_button.c 1 Jun 2007 04:04:19 -0000 1.19
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,119 +0,0 @@
-/*
- AntiRight
- (c) 2002-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"
-
-static void
-set_up_containers_for_menu_item_row(GtkWidget * button, GtkWidget * hrow,
- GtkWidget * label, GtkWidget * image)
-{
- GSHCA(button, hrow);
- GSHCA_TIGHT(hrow, image);
- GSHCA(hrow, label);
-}
-
-static void
-setup_row_for_menu_item_image(struct GSH * gsh, GtkWidget * label,
- GtkWidget * image)
-{
- GtkWidget * hrow;
-
- hrow=gtk_hbox_new(FALSE, 2);
- set_up_containers_for_menu_item_row(gsh->widgets.button, hrow,
- label, image);
- gtk_widget_show(hrow);
-}
-
-static void
-set_menu_item_image(struct GSH * gsh, GtkWidget * image)
-{
- GtkWidget * label;
-
- label=gtk_bin_get_child(GTK_BIN(gsh->widgets.button));
- gtk_widget_ref(label);
- gtk_container_remove(GTK_CONTAINER(gsh->widgets.button), label);
- setup_row_for_menu_item_image(gsh, label, image);
- gtk_widget_show(image);
- gtk_widget_show(label);
-}
-
-static void
-set_button_image(GtkWidget * button, GtkWidget * image)
-{
- gtk_button_set_image(GTK_BUTTON(button), image);
- gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
-}
-
-/* Get an image from the antiright icon distribution or the GTK stock
- icon set. */
-static GtkWidget *
-get_default_image(struct GSH * gsh, const gchar * name)
-{
- gchar * prefixed_name;
- GtkWidget * image;
-
- ar_asprintf(&prefixed_name, PREFIX "/share/ACE-desktop/icons/%s",
- name);
- /* Determine whether to use the file name constructed in prefixed_name
- * or to use a stock icon (tried if the file does not exit). */
- image = g_file_test(prefixed_name, G_FILE_TEST_EXISTS)
- ? gtk_image_new_from_file(prefixed_name)
- : gtk_image_new_from_stock(name, gsh->icon_size);
- g_free(prefixed_name);
-
- if(!image)
- image=gtk_image_new_from_stock("gtk-execute", gsh->icon_size);
-
- return image;
-}
-
-GtkWidget *
-gsh_get_image(GSH * gsh, const gchar * name)
-{
- return g_file_test(name, G_FILE_TEST_EXISTS)
- ? gtk_image_new_from_file(name)
- : get_default_image(gsh, name);
-}
-
-void
-gsh_image_button(struct GSH * gsh, char *command, char *name)
-{
- GtkWidget * image;
-
- image = gsh_get_image(gsh, name);
- $(gsh, add.button, command);
- ARIFP(image)
- {
- gtk_widget_show(image);
- if(!GTK_IS_MENU_BAR(gsh->rows->v)
- && !GTK_IS_MENU_ITEM(gsh->rows->v)
- && !GTK_IS_MENU(gsh->rows->v))
- {
- set_button_image(gsh->widgets.button, image);
- }
- else
- {
- set_menu_item_image(gsh, image);
- }
- }
-}
-
Index: image_button.h
===================================================================
RCS file: image_button.h
diff -N image_button.h
--- image_button.h 20 May 2007 01:04:43 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,33 +0,0 @@
-/*
- AntiRight
- (c) 2002-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_IMAGE_BUTTON_H
-#define GSH_IMAGE_BUTTON_H
-
-GtkWidget *
-gsh_get_image(GSH * gsh, const gchar * name);
-
-void
-gsh_image_button(struct GSH * gsh, char *command, char *name);
-
-#endif /* GSH_IMAGE_BUTTON_H */
-
Index: init.c
===================================================================
RCS file: init.c
diff -N init.c
--- init.c 15 May 2007 17:59:34 -0000 1.11
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,62 +0,0 @@
-/*
- 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"
-
-static void
-setup_quit_signal(GtkWindow * window, const gchar * signal)
-{
- g_signal_connect(window, signal, G_CALLBACK(gtk_main_quit), NULL);
-}
-
-static void
-setup_quit_signals(GtkWindow * window)
-{
- setup_quit_signal(window, "delete-event");
- setup_quit_signal(window, "destroy");
-}
-
-
-GtkWidget *
-gsh_GSH_add_window(struct GSH * gsh)
-{
- GtkWidget *window;
-
- window = gsh->widgets.window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- setup_quit_signals(GTK_WINDOW(window));
-
- return window;
-}
-
-void
-gsh_GSH_finalize(struct GSH * gsh)
-{
- /* Choose the correct parenting of the widget hierarchy based on options
- * set. */
- gsh_setup_base_container(gsh);
- /* If geometry has been set in command line arguments, use that, else
- * use a reasonable default. */
- gsh_check_and_set_geometry(gsh);
- /* Show everything when ready. */
- gtk_widget_show(gsh->widgets.window);
-}
-
Index: init.h
===================================================================
RCS file: init.h
diff -N init.h
--- init.h 10 May 2007 00:08:28 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,33 +0,0 @@
-/*
- AntiRight
- (c) 2002-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_INIT_H
-#define GSH_INIT_H
-
-GtkWidget *
-gsh_GSH_add_window(struct GSH * gsh);
-
-void
-gsh_GSH_finalize(struct GSH * gsh);
-
-
-#endif /* GSH_INIT_H */
Index: label.c
===================================================================
RCS file: label.c
diff -N label.c
--- label.c 14 May 2007 20:23:22 -0000 1.21
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,60 +0,0 @@
-/*
- AntiRight
- (c) 2002-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"
-
-
-static void
-set_options(struct GSH * gsh, GtkWidget *label)
-{
-#define GLS(attr, ...) gtk_label_set_##attr(GTK_LABEL(label), __VA_ARGS__)
- GLS(single_line_mode, FALSE);
- GSH_FLAG(GSH_HORIZONTAL_LABELS) ?
- GLS(angle, 90.0) : GLS(line_wrap, TRUE);
- gsh_widget_set_font(label, NULL);
-}
-
-static GtkWidget *
-make_framed_label(GtkWidget * label)
-{
- GtkWidget *frame;
-
- frame=gtk_frame_new(NULL);
- GSHCA(frame, label);
- gtk_widget_show(label);
-
- return frame;
-}
-
-GtkWidget *
-gsh_add_label(struct GSH * gsh, const gchar *text)
-{
- GtkWidget *label;
-
- label = gtk_label_new(text);
- set_options(gsh, label);
- gsh_manage(gsh, GSH_FLAG(GSH_FRAMED_LABELS)
- ? make_framed_label(label) : label);
-
- return label;
-}
-
Index: label.h
===================================================================
RCS file: label.h
diff -N label.h
--- label.h 30 Apr 2007 18:15:22 -0000 1.7
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,35 +0,0 @@
-/*
- AntiRight
- (c) 2002-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_LABEL_H
-#define GSH_LABEL_H
-
-GtkWidget *
-gsh_add_label(struct GSH * gsh, const gchar *text);
-
-void
-gsh_new_label(struct GSH * gsh, const gchar *text);
-
-void
-gsh_set_label(GtkWidget *label, const gchar *text);
-
-#endif
Index: macros.h
===================================================================
RCS file: macros.h
diff -N macros.h
--- macros.h 17 May 2007 04:32:20 -0000 1.12
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,71 +0,0 @@
-/*
- AntiRight
- (c) 2002-2006 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_MACROS_H
-#define GSH_MACROS_H
-
-#define GSHBIT(n) 1 << (n-1)
-
-#define GSH_NONE 0
-#define GSH_SCROLL GSHBIT(1)
-#define GSH_CBEXIT GSHBIT(2)
-#define GSH_UPDATING GSHBIT(3)
-#define GSH_HORIZONTAL_LABELS GSHBIT(4)
-#define GSH_PROMPT_ECHOES GSHBIT(5)
-#define GSH_FRAMED_LABELS GSHBIT(6)
-#define GSH_MENU_BUTTON GSHBIT(7)
-#define GSH_NO_BASE_FRAME GSHBIT(8)
-#define GSH_NO_EXPAND GSHBIT(9)
-#define GSH_GUIDL_NO_DUMMY GSHBIT(10)
-#define GSH_APP_MODE GSHBIT(11)
-#define GSH_PANE_NEXT GSHBIT(12)
-#define GSH_FIRST_TERMINAL GSHBIT(13)
-typedef guint Bitmask;
-
-#define GSH_FLAG(flag) ((gsh->bflags & flag) == flag)
-#define GSH_SET(flag) gsh->bflags |= flag
-#define GSH_UNSET(flag) gsh->bflags &= ~flag
-
-#define GSH_ACTION_IF(action, arg) if(arg) action(arg)
-#define GSH_DESTROY_IF(widget) GSH_ACTION_IF(gtk_widget_destroy, widget)
-#define GSH_FREE_IF(var) GSH_ACTION_IF(g_free, var)
-
-#define GSH_FIXME() \
- sysprintf("gtkshell -dw '%s:%d: FIXME'",\
- __FILE__, __LINE__)
-
-/* GSH Container Add */
-#define GSHCA(container, widget)\
- gtk_container_add(GTK_CONTAINER(container), widget)
-/* Add without expansion. */
-#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_SHOW_CREATE(var, type, ...)\
- gtk_widget_show(var=gtk_##type##_new(__VA_ARGS__))
-
-#define GSHCONNECT(widget, signal, cb, cbdata)\
- g_signal_connect(G_OBJECT(widget), signal, G_CALLBACK(cb), cbdata);
-
-#endif /* not GSH_MACROS_H */
-
Index: main.c
===================================================================
RCS file: main.c
diff -N main.c
--- main.c 10 Jun 2007 20:53:54 -0000 1.24
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,58 +0,0 @@
-/*
- AntiRight
- (c) 2002-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 "../libshell/gtkshell.h"
-
-#ifdef LIBGC
-#include <gc.h>
-#endif /* LIBGC */
-
-static void
-setup_gui(struct GSH * gsh, const gint argc, const gchar ** argv)
-{
- $(gsh, init);
- $(gsh, parse, argc, argv); /* Setup GUI. */
- $(gsh, finalize);
-}
-
-int
-main(int argc, char **argv)
-{
- struct GSH * gsh;
-
-#ifdef LIBGC
- GC_INIT();
-#endif /* LIBGC */
- 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: menu.c
===================================================================
RCS file: menu.c
diff -N menu.c
--- menu.c 1 Jun 2007 18:51:30 -0000 1.22
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,231 +0,0 @@
-/*
- AntiRight
- (c) 2006-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"
-
-#define SPLIT_ALL -1
-
-static void
-setup_separator_menu_item(GSH * gsh)
-{
- GtkWidget * separator;
-
- GSH_SHOW_CREATE(separator, separator_menu_item);
- gtk_menu_shell_append(GTK_MENU_SHELL(gsh->rows->v), separator);
-}
-
-static void
-parse_special_and_noicon_items(GSH * gsh, gchar ** pair)
-{
- /* Test if a separator should be created. */
- if(!strncmp(pair[0], "---", 3))
- setup_separator_menu_item(gsh);
- /* String does not contain \n. */
- else if(strncmp(pair[0], "\\n", 2))
- { /* Support continuation lines for menu specification. */
- /* Create a button. */
- $(gsh, add.button, pair[0]);
- }
-}
-
-static void
-menuitem_parse(struct GSH * gsh, gchar * string)
-{
- gchar **pair;
-
- pair=g_strsplit(string, ",", 2);
-#ifdef DEBUG
- ARPASSERT(pair[0]);
-#endif /* DEBUG */
- if(pair[1])
- gsh_image_button(gsh, pair[0], pair[1]);
- else
- parse_special_and_noicon_items(gsh, pair);
- g_strfreev(pair);
-}
-
-static void
-set_submenu_label(gpointer widget, gpointer user_data)
-{
- if(GTK_IS_LABEL((GtkWidget *)widget))
- gtk_label_set_text(GTK_LABEL((GtkWidget *)widget),
- (const gchar *)user_data);
-}
-
-static void
-find_and_set_compound_label_widget(GtkWidget * label, const gchar * label_text)
-{
- GList * children;
-
- children=gtk_container_get_children(GTK_CONTAINER(label));
- g_list_foreach(children, set_submenu_label, (gchar *)label_text);
- g_list_free(children);
-}
-
-static void
-find_and_set_label_widget(GtkWidget * label, const gchar * command)
-{
- gchar * label_text;
-
- label_text = antiright_beautified_label(command);
- if(GTK_IS_LABEL(label))
- set_submenu_label(label, label_text);
- else
- find_and_set_compound_label_widget(label, label_text);
- g_free(label_text);
-}
-
-static void
-begin_submenu(GSH * gsh, GtkWidget ** submenus,
- guint *submenu_count, guint * i, gchar ** tokens)
-{
- GtkWidget * label;
-
- GSH_UNSET(GSH_MENU_BUTTON);
- submenus[(*submenu_count)++]=gsh->rows->v;
- gtk_widget_show(gsh->rows->v = gtk_menu_new());
- gtk_menu_item_set_submenu(GTK_MENU_ITEM(
- gsh->widgets.button), gsh->rows->v);
- label=gtk_bin_get_child(GTK_BIN(gsh->widgets.button));
- find_and_set_label_widget(label, tokens[++(*i)]);
-}
-
-static void
-perform_addition_for_each_item(struct GSH * gsh, gchar ** tokens)
-{
- guint i;
- const guint max_menus = 6;
- /* Any more is not practical. */
- GtkWidget *submenus[max_menus];
- guint submenu_count = 0;
-
- for(i=1; ARPBOOL(tokens[i]); i++)
- {
- const gchar * submenu_close = "<--";
-
- if(!strncmp(tokens[i], submenu_close, 3))
- {
- if(submenu_count!=0)
- gsh->rows->v=submenus[--submenu_count];
- }
- else
- {
- const gchar * submenu_open = "-->";
- const gboolean start_submenu = (!strncmp(tokens[i],
- submenu_open, 3) && submenu_count < max_menus);
-
- if(start_submenu)
- GSH_SET(GSH_MENU_BUTTON);
- /* Create the menu item. */
- menuitem_parse(gsh, tokens[i]);
- if(start_submenu)
- begin_submenu(gsh, submenus, &submenu_count,
- &i, tokens);
- }
- }
-}
-
-
-static void
-add_menu_items(struct GSH * gsh, GtkWidget * menu, gchar **tokens)
-{
-#define GSHR gsh->rows
- /* Set gsh->rows->v to a row within a menu.
- * Create the menu before overwriting, then
- * set back at end. */
- const GtkWidget * old_row = gsh->rows->v;
-
- GSHR->v=menu;
- perform_addition_for_each_item(gsh, tokens);
- GSHR->v=(GtkWidget *)old_row;
-}
-
-#define GW gsh->widgets
-#define GWA GW.app
-
-static void
-manage_menu_bar(GSH * gsh)
-{
- GSH_FLAG(GSH_APP_MODE) ? gsh_setup_app_mode(gsh)
- : $(gsh, manage, GWA.menubar);
-}
-
-static GtkWidget *
-add_menu_bar(struct GSH * gsh)
-{
- if(!GWA.menubar)
- {
- GSH_SHOW_CREATE(GWA.menubar, menu_bar);
- manage_menu_bar(gsh);
- }
-
- return GWA.menubar;
-}
-
-static void
-test_for_main_app_menus(GSH * gsh, GtkWidget * menu, const gchar * label)
-{
-#define GSHMENUS GWA.menus
-
- if(!strcmp(label, "File"))
- GSHMENUS.file=menu;
- else if(!strcmp(label, "Edit"))
- GSHMENUS.edit=menu;
- else if(!strcmp(label, "Tools"))
- GSHMENUS.tools=menu;
- else if(!strcmp(label, "View"))
- GSHMENUS.view=menu;
- else if(!strcmp(label, "Help"))
- GSHMENUS.help=menu;
-}
-
-static GtkWidget *
-add_menu_launcher(struct GSH * gsh, const gchar * label)
-{
- const GtkWidget * old_row = gsh->rows->v;
- GtkWidget * menu_item;
-
- gsh->rows->v=add_menu_bar(gsh);
- GSH_SET(GSH_MENU_BUTTON);
- menu_item = $(gsh, add.button, label);
- gtk_widget_show(menu_item);
- gsh->rows->v=(GtkWidget *)old_row;
-
- return menu_item;
-}
-
-void
-gsh_menubutton_parse(struct GSH * gsh, gchar **tokens)
-{
- GtkWidget * menu;
- const gchar * label;
-
- label=tokens[0];
- GSH_SHOW_CREATE(menu, menu);
- gtk_menu_item_set_submenu(GTK_MENU_ITEM(add_menu_launcher(gsh,
- label)), menu);
- add_menu_items(gsh, menu, tokens);
- test_for_main_app_menus(gsh, menu, label);
-}
-
-
Index: menu.h
===================================================================
RCS file: menu.h
diff -N menu.h
--- menu.h 10 May 2007 00:08:28 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,30 +0,0 @@
-/*
- AntiRight
- (c) 2006-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_MENU_H
-#define GSH_MENU_H
-
-void
-gsh_menubutton_parse(struct GSH * gsh, gchar **tokens);
-
-#endif /* GSH_MENU_H */
Index: module_includes.h
===================================================================
RCS file: module_includes.h
diff -N module_includes.h
--- module_includes.h 20 May 2007 18:29:58 -0000 1.5
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,61 +0,0 @@
-/*
- AntiRight
- (c) 2002-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_MODULE_INCLUDES_H
-#define GSH_MODULE_INCLUDES_H
-
-#include "arguments.h"
-#include "options.h"
-#include "callbacks.h"
-#include "label.h"
-#include "button.h"
-#include "text.h"
-#include "updated_label.h"
-#include "updated_progress.h"
-#include "option_options.h"
-#include "updated_options.h"
-#include "add_options.h"
-#include "dialog_options.h"
-#include "file_dialog.h"
-#include "row.h"
-#include "containers.h"
-#include "geometry.h"
-#include "font.h"
-#include "dragdrop.h"
-#include "image_button.h"
-#include "terminal_options.h"
-#include "terminal.h"
-#include "guidl_dictionary.h"
-#include "guidl_util.h"
-#include "about_dialog.h"
-#include "menu.h"
-#include "init.h"
-#include "guidl_dialog.h"
-#include "guidl_options.h"
-#include "guidl_widgets.h"
-#include "update_manager.h"
-#include "pane.h"
-#include "command_shell.h"
-#include "app_mode.h"
-#include "applets.h"
-
-#endif /* not GSH_MODULE_INCLUDES_H */
Index: option_options.c
===================================================================
RCS file: option_options.c
diff -N option_options.c
--- option_options.c 14 May 2007 20:23:23 -0000 1.30
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,174 +0,0 @@
-/*
- AntiRight
- (c) 2002-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"
-
-/* This is for windows that should not be touched by the window manager,
- such as the ACE Deskbar panel. */
-static void
-set_no_decorations(GSH * gsh)
-{
- /* Alias to minimize dereferences through GSH. */
- GtkWindow * window;
-
- /* Recreate main window as popup type. This is not recommended, but is
- necessary when using window managers that do not decorate according
- to hints, such as evilwm. */
- gsh->widgets.window=gtk_window_new(GTK_WINDOW_POPUP);
- window=GTK_WINDOW(gsh->widgets.window);
-
- /* GTK WINDOW SET */
-#define GWS(attr, ...) gtk_window_set_##attr(window, __VA_ARGS__)
- GWS(type_hint, GDK_WINDOW_TYPE_HINT_DESKTOP);
- GWS(decorated, FALSE);
- GWS(skip_taskbar_hint, TRUE);
- /* Show window on all desktops. */
- gtk_window_stick(window);
- /* Window does not seem to really accept focus when this is set, most
- likely because of the POPUP option's side effect of overriding
- window manager redirection. */
- GWS(accept_focus, TRUE);
-}
-
-static void
-set_icon_size(GSH * gsh, const gchar * arg)
-{
- /* Define some shortcuts. */
-#define GIS gsh->icon_size
- /* GTK_ICON_SIZE_ */
-#define GTKIS(size) GTK_ICON_SIZE_##size
- /* Test for gsh->icon_size equality. */
-#define GISCMP(text) !strcmp(text, arg)
-
- if(GISCMP("menu"))
- gsh->icon_size=GTKIS(MENU);
- else if(GISCMP("small toolbar"))
- GIS=GTKIS(SMALL_TOOLBAR);
- else if(GISCMP("large toolbar") || GISCMP("toolbar"))
- GIS=GTKIS(LARGE_TOOLBAR);
- else if(GISCMP("button"))
- GIS=GTKIS(BUTTON);
- else if(GISCMP("dialog"))
- GIS=GTKIS(DIALOG);
- else /* default */
- GIS=GTKIS(DND);
-}
-
-void
-gsh_handle_option_arguments(GSH * gsh, const gint argc, const gchar **argv,
- gint *counter)
-{
- switch (argv[(*counter)][2])
- {
- case 'a':
- /* Run in application mode. Here, a menu bar and status
- bar encloses the application. This option may also affect
- other gtkshell properties in the future. */
- GSH_SET(GSH_APP_MODE);
- break;
- case 'D':
- /* Do not insert the dummy "guidl" string before the
- arguments passed by means of a guidl definition.
- It is not necessary to include this as an option
- within the guidl description itself, as the dummy
- option is inserted prior to parsing. */
- GSH_SET(GSH_GUIDL_NO_DUMMY);
- break;
-
- case 'E': /* Make a text entry simply print the
- * text. */
- GSH_SET(GSH_PROMPT_ECHOES);
- break;
-
- case 'e':
- GSH_SET(GSH_CBEXIT);
- break;
-
- case 'F':
- GSH_SET(GSH_NO_BASE_FRAME);
- break;
-
- case 'f':
- GSH_SET(GSH_FRAMED_LABELS);
- break;
-
- case 'g':
- GSH_COUNT(argc, counter);
-
- ARIFP(gsh->geometry)
- free(gsh->geometry);
-
- ar_asprintf(&gsh->geometry, "%s", argv[(*counter)]);
-
- break;
-
- case 'h':
- GSH_SET(GSH_HORIZONTAL_LABELS);
- break;
- case 'i':
- GSH_COUNT(argc, counter);
- set_icon_size(gsh, argv[*counter]);
- break;
- case 'l':
- GSH_SET(GSH_NO_EXPAND);
- break;
-
- case 'L':
- GSH_UNSET(GSH_NO_EXPAND);
- break;
-
- case 'n': /* no decorations, desktop panel not to be touched by the
- * window manager. */
- set_no_decorations(gsh);
- break;
-
- case 'p': /* Pane next widget with previous. */
- GSH_SET(GSH_PANE_NEXT);
- break;
-
- case 'r': /* Set number of rows per column. */
- GSH_COUNT(argc, counter);
- gsh->rows->total=(unsigned int)atoi(argv[(*counter)]);
- break;
-
- case 's': /* Use scrolling parent container. */
- GSH_SET(GSH_SCROLL);
- break;
-
- case 'T': /* Set the window title. */
- GSH_COUNT(argc, counter);
- gtk_window_set_title(GTK_WINDOW(gsh->widgets.window),
- argv[*counter]);
- break;
-
- case 't':
- gsh_handle_terminal_options(gsh, argc, argv, counter);
- break;
-
- case 'u': /* Set time for updating widgets' timer, in miliseconds. */
- GSH_COUNT(argc, counter);
- gsh->update->period = atoi(argv[*counter]);
- break;
- }
-}
-
Index: option_options.h
===================================================================
RCS file: option_options.h
diff -N option_options.h
--- option_options.h 14 May 2007 18:06:35 -0000 1.7
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,30 +0,0 @@
-/*
- AntiRight
- (c) 2002-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_OPTION_OPTIONS_H
-#define GSH_OPTION_OPTIONS_H
-
-void
-gsh_handle_option_arguments(GSH * gsh, const gint argc, const gchar **argv,
- gint *counter);
-
-#endif
Index: options.c
===================================================================
RCS file: options.c
diff -N options.c
--- options.c 20 May 2007 18:29:58 -0000 1.27
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,119 +0,0 @@
-/*
- AntiRight
- (c) 2002-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"
-
-extern FILE *yyin, *yyout;
-extern struct GDLEnvironment * gsh_guidl_env;
-
-#ifdef DEBUG
-static void
-print_arguments(const gint argc, const gchar ** argv)
-{
- gint i;
- for(i=0; i<argc; i++)
- printf("'%s' ", argv[i]);
- putchar('\n');
-}
-#endif /* DEBUG */
-
-
-/* Determine whether or not to include an initial
- dummy argument. Needed as argv[0] is skipped
- by the command line handling code. */
-static void
-check_for_dummy_argument(GSH * gsh)
-{
- if(!GSH_FLAG(GSH_GUIDL_NO_DUMMY))
- $(gsh_guidl_env->args, add, (const gchar *)"guidl");
-}
-
-static void
-check_gsh_guidl_env()
-{
- if(!gsh_guidl_env)
- gsh_guidl_env=ARNEW(gsh, GDLEnvironment);
-}
-
-static void
-common_guidl_handler(GSH * gsh)
-{
- check_gsh_guidl_env();
- check_for_dummy_argument(gsh);
- yyparse();
- /* Shortcut for specification of arguments. */
-#define GGEA gsh_guidl_env->args
-#ifdef DEBUG
- print_arguments(GGEA->argc, GGEA->argv);
-#endif /* DEBUG */
- $(gsh, parse, GGEA->argc, (const gchar **)GGEA->argv);
- $(gsh_guidl_env, delete);
- gsh_guidl_env=NULL;
-}
-
-static void
-guidl_handler_for_file(GSH * gsh, const gchar * filename)
-{
- /* If the argument is "-", use stdin for yyin. */
- /* Otherwise, use FILENAME. */
- if(strcmp("-", filename))
- yyin=fopen(filename, "r");
- common_guidl_handler(gsh);
-}
-
-void
-gsh_invalid_option(const gchar ** argv, const gint option)
-{
- g_warning("%s: %s undefined\n", argv[0], argv[option]);
-}
-
-#define HANDLE(type)\
- gsh_handle_##type##_arguments(gsh, argc, argv, counter)
-
-void
-gsh_handle_switch_arguments(GSH * gsh, const gint argc, const gchar **argv,
- gint *counter)
-{
- $(gsh->rows, check);
- switch (argv[*counter][1])
- {
- case 'a':
- HANDLE(add);
- break;
- case 'd':
- HANDLE(dialog);
- break;
- case 'f':
- GSH_COUNT(argc, counter);
- guidl_handler_for_file(gsh, argv[*counter]);
- break;
- case 'o':
- HANDLE(option);
- break;
- case 't': /* test area. */
- {
- }
- break;
- default:
- gsh_invalid_option(argv, *counter);
- }
-}
Index: options.h
===================================================================
RCS file: options.h
diff -N options.h
--- options.h 14 May 2007 18:06:35 -0000 1.7
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,45 +0,0 @@
-/*
- AntiRight
- (c) 2002-2006 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_OPTIONS_H
-#define GSH_OPTIONS_H
-
-#include "gtkshell.h"
-
-#ifdef DEBUG
-#define GSH_COUNT(argc, counter) \
-{\
- (*counter)++;\
- g_assert((*counter) <= argc);\
-}
-#else /* not DEBUG */
-#define GSH_COUNT(argc, counter) \
-{\
- (*counter)++;\
-}
-#endif /* DEBUG */
-
-void
-gsh_handle_switch_arguments(GSH * gsh, const gint argc, const gchar **argv,
- gint *counter);
-
-#endif /* not GSH_OPTIONS_H */
Index: pane.c
===================================================================
RCS file: pane.c
diff -N pane.c
--- pane.c 14 May 2007 18:06:35 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,122 +0,0 @@
-/*
- AntiRight
- (c) 2002-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"
-
-static void
-reparent(GtkWidget * widget, GtkWidget * old, GtkWidget * new)
-{
- gtk_widget_ref(widget);
- gtk_container_remove(GTK_CONTAINER(old), widget);
- gtk_container_add(GTK_CONTAINER(new), widget);
- gtk_widget_unref(widget);
-}
-
-#define REPARENT_TO(new) reparent(gsh->rows->v, gsh->rows->h, new)
-
-static void
-split_columns_for_pane(struct GSH * gsh, GtkWidget * pane)
-{
- struct GSHRows * rows;
-
- rows=gsh->rows;
- $(rows, new);
- $(gsh, manage, pane);
- $(rows, new);
-}
-
-static GtkWidget *
-setup_first_pane_half(struct GSH * gsh, const gchar ** pair)
-{
- GtkWidget * first;
-
- gtk_widget_show(first=gtk_frame_new(pair[0]));
- REPARENT_TO(first);
-
- return first;
-}
-
-static GtkWidget *
-setup_second_pane_half(struct GSH * gsh, gchar ** pair)
-{
- GtkWidget * second;
-
- gtk_widget_show(second=gtk_frame_new(pair[1]));
- g_strfreev(pair);
- REPARENT_TO(second);
-
- return second;
-}
-
-static void
-assign_pane_sections(GtkWidget * pane, GtkWidget * first, GtkWidget * second)
-{
- gtk_paned_add1(GTK_PANED(pane), first);
- gtk_paned_add2(GTK_PANED(pane), second);
-}
-
-void
-gsh_setup_hpaned(struct GSH * gsh, const gchar * label_pair)
-{
- GtkWidget * pane;
- pane=gtk_hpaned_new();
- {
- gchar **pair;
-
- pair=g_strsplit(label_pair, ",", 2);
- {
- GtkWidget * first;
-
- first=setup_first_pane_half(gsh, (const gchar **)pair);
- split_columns_for_pane(gsh, pane);
- {
- GtkWidget * second;
-
- /* PAIR freed here. */
- second=setup_second_pane_half(gsh, pair);
- assign_pane_sections(pane, first, second);
- }
- }
- }
-}
-
-
-void
-gsh_pane_previous(struct GSH * gsh, GtkWidget * target)
-{
- GtkWidget * pane;
- GtkWidget * prev_frame;
-
- pane=gtk_vpaned_new();
- prev_frame = gtk_frame_new(NULL);
-#ifdef DEBUG
- ARPASSERT(gsh->widgets.last_managed);
-#endif /* DEBUG */
- reparent(gsh->widgets.last_managed, gsh->rows->v, prev_frame);
- assign_pane_sections(pane, prev_frame, target);
- gtk_widget_show(prev_frame);
- gtk_widget_show(target);
- GSH_UNSET(GSH_PANE_NEXT);
- $(gsh, manage, pane);
-}
Index: pane.h
===================================================================
RCS file: pane.h
diff -N pane.h
--- pane.h 11 May 2007 23:28:52 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,34 +0,0 @@
-/*
- AntiRight
- (c) 2002-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_PANE_H
-#define GSH_PANE_H
-
-void
-gsh_setup_hpaned(struct GSH * gsh, const gchar * label_pair);
-
-void
-gsh_pane_previous(struct GSH * gsh, GtkWidget * target);
-
-#endif /* not GSH_PANE_H */
Index: row.c
===================================================================
RCS file: row.c
diff -N row.c
--- row.c 11 May 2007 23:28:52 -0000 1.22
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,136 +0,0 @@
-/*
- 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"
-
-static void
-gsh_GSHRows_new(struct GSHRows * this)
-{
- gtk_container_add(GTK_CONTAINER(this->h),
- this->v=gtk_vbox_new(FALSE, 2));
- gtk_widget_show(this->v);
- this->current = 1;
-}
-
-static void
-gsh_GSHRows_check(struct GSHRows * this)
-{
- if(this->current > this->total)
- $(this, new);
-}
-
-static void
-gsh_delete_GSHRows(struct GSHRows * rows)
-{
- g_free(rows);
-}
-
-#define SETUP_METHODS(rows)\
-{\
- rows->delete=&gsh_delete_GSHRows;\
- rows->new=&gsh_GSHRows_new;\
- rows->check=&gsh_GSHRows_check;\
-}
-
-/* Use an arbitrary, though reasonable, initial number of rows. */
-#define SETUP_MEMBER_FIELDS(rows)\
-{\
- rows->current=1;\
- rows->total=8;\
-}
-
-#define SETUP_GSHROWS(rows)\
-{\
- SETUP_MEMBER_FIELDS(rows);\
- SETUP_METHODS(rows);\
-}
-
-struct GSHRows *
-gsh_new_GSHRows()
-{
- struct GSHRows * rows;
-
- rows = xmalloc(sizeof(struct GSHRows));
- SETUP_GSHROWS(rows);
-
- return rows;
-}
-
-static void
-gsh_manage_generic(struct GSH * gsh, GtkWidget *widget)
-{
- gtk_widget_show(widget);
- gsh->rows->current++;
- gsh->widgets.last_managed=widget;
-}
-
-static gboolean
-test_manage_menu_item(GtkWidget * container, GtkWidget * widget)
-{
- if(GTK_IS_MENU(container) || GTK_IS_MENU_BAR(container)
- || GTK_IS_MENU_ITEM(container))
- {
- gtk_menu_shell_append(GTK_MENU_SHELL(container), widget);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static void
-manage_normal(struct GSH * gsh, GtkWidget * widget)
-{
- if(test_manage_menu_item(gsh->rows->v, widget))
- return;
- $(gsh->rows, check);
- gtk_container_add(GTK_CONTAINER(gsh->rows->v), widget);
- gsh_manage_generic(gsh, widget);
-}
-
-#define GR gsh->rows
-#define CONTAINER GR->v
-#define TEST_MANAGE_UNEXPANDED(gsh)\
- (GSH_FLAG(GSH_NO_EXPAND) &&(GR->total != 1)\
- && !GTK_IS_MENU(CONTAINER) && !GTK_IS_MENU_BAR(CONTAINER)\
- && !GTK_IS_MENU_ITEM(CONTAINER))
-
-
-static void
-manage_unexpanded(struct GSH * gsh, GtkWidget * widget)
-{
- $(gsh->rows, check);
- gtk_box_pack_start(GTK_BOX(gsh->rows->v), widget,
- FALSE, FALSE, 0);
- gsh_manage_generic(gsh, widget);
-}
-
-void
-gsh_manage(struct GSH * gsh, GtkWidget *widget)
-{
- if(GSH_FLAG(GSH_PANE_NEXT))
- gsh_pane_previous(gsh, widget);
- else if(TEST_MANAGE_UNEXPANDED(gsh))
- manage_unexpanded(gsh, widget);
- else
- manage_normal(gsh, widget);
-}
-
Index: row.h
===================================================================
RCS file: row.h
diff -N row.h
--- row.h 3 May 2007 21:23:07 -0000 1.9
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,35 +0,0 @@
-/*
- 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_ROW_H
-#define GSH_ROW_H
-
-void
-gsh_manage(struct GSH * gsh, GtkWidget *widget);
-
-void
-gsh_check_row(struct GSH * gsh);
-
-struct GSHRows *
-gsh_new_GSHRows();
-
-#endif /* GSH_ROW_H */
Index: row_struct.h
===================================================================
RCS file: row_struct.h
diff -N row_struct.h
--- row_struct.h 3 May 2007 21:23:07 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,37 +0,0 @@
-/*
- AntiRight
- (c) 2002-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_ROW_STRUCT_H
-#define GSH_ROW_STRUCT_H
-
-struct GSHRows
-{
- GtkWidget *h;
- GtkWidget *v;
- unsigned int current;
- unsigned int total;
- void (*delete)(struct GSHRows *);
- void (*new)(struct GSHRows *);
- void (*check)(struct GSHRows *);
-};
-
-#endif /* GSH_ROW_STRUCT */
Index: terminal.c
===================================================================
RCS file: terminal.c
diff -N terminal.c
--- terminal.c 23 May 2007 14:57:46 -0000 1.24
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,231 +0,0 @@
-/*
- AntiRight
- (c) 2002-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"
-
-#ifdef HAVE_VTE
-#define VSET(element, widget, ...)\
- vte_terminal_set_##element(VTE_TERMINAL(widget), __VA_ARGS__)
-#endif /* HAVE_VTE */
-
-#define GT term
-
-#ifdef HAVE_VTE
-#define VSETW(element, ...)\
- VSET(element, term->widget, __VA_ARGS__)
-#endif /* HAVE_VTE */
-
-#ifdef HAVE_VTE
-static void
-set_vte_specific_terminal_options(struct GSH_Terminal * term)
-{
- VSETW(size, term->dimensions.width, term->dimensions.height);
- VSETW(allow_bold, TRUE);
- VSETW(backspace_binding, VTE_ERASE_ASCII_BACKSPACE);
- if(term->transparent)
- {
- /* Only the first terminal should be transparent,
- to save memory. */
- VSETW(background_transparent, TRUE);
- term->transparent=FALSE;
- }
-}
-#endif /* HAVE_VTE */
-
-static void
-set_terminal_options(struct GSH_Terminal * term)
-{
-#ifdef HAVE_VTE
- set_vte_specific_terminal_options(term);
-#endif /* HAVE_VTE */
- if(term->widget)
- gsh_widget_set_font(term->widget, term->font);
-}
-
-static const gchar *
-get_shell()
-{
- /* This fixes the failure of environment inheritance
- under cygwin. */
- const gchar * shell = getenv("SHELL");
- if(shell)
- return shell;
- else
- return (const gchar *)"/bin/sh";
-}
-
-static void
-gsh_terminal_run(struct GSH_Terminal * term, const gchar * command)
-{
- /* Set up line and column counts so that VI has correct display
- in IDE terminal. */
- gchar * height;
- gchar * width;
- /* Use format of a shell export statement. */
- ar_asprintf(&height, "LINES=%d", term->dimensions.height);
- ar_asprintf(&width, "COLUMNS=%d", term->dimensions.width);
- {
- /* Null terminated list of environment elements. */
- const gchar *envv[] = {height, width, NULL};
- /* Determine which shell to use. */
- const gchar * shell = get_shell();
- /* Null terminated list of program arguments. Use
- the shell as a command processor, such to avoid
- handling argument separation here. */
- const gchar *argv[] = { shell, "-c", command, NULL };
- /* Start the command in the terminal. */
-#ifdef HAVE_VTE
- vte_terminal_fork_command(VTE_TERMINAL(term->widget), shell,
- (char **)argv, (char **)envv, NULL, TRUE, TRUE, TRUE);
-#endif /* HAVE_VTE */
- }
- /* Free after use. */
- g_free(height);
- g_free(width);
-}
-
-static void
-gsh_delete_GSH_Terminal(struct GSH_Terminal * term)
-{
- g_free(term);
- /* Freeing the terminal font causes a segmentation fault under
- * linux, so likely a double free. */
- /* The terminal widget itself is freed by gobject system
- * reference counting. */
-}
-
-static void
-title_change_cb(GtkWidget * widget, gpointer data)
-{
- struct GSHCBData * cb;
- GSH * gsh;
- GtkWindow * window;
-
- cb=(struct GSHCBData *)data;
- gsh=cb->gsh;
- window=GTK_WINDOW(gsh->widgets.window);
- gtk_window_set_title(window,
-#ifdef HAVE_VTE
- vte_terminal_get_window_title(VTE_TERMINAL(widget))
-#else /* not HAVE_VTE */
- "Terminal"
-#endif /* HAVE_VTE */
- );
-}
-
-static void
-status_changed_cb(GtkWidget * widget, gpointer data)
-{
- struct GSHCBData * cb;
- GSH * gsh;
- GtkWidget * status;
-
- cb=(struct GSHCBData *)data;
- gsh=cb->gsh;
- if((status=gsh->widgets.app.status))
- gtk_statusbar_push(GTK_STATUSBAR(status),
- gtk_statusbar_get_context_id(GTK_STATUSBAR(status),
- "terminal"),
-#ifdef HAVE_VTE
- vte_terminal_get_status_line(VTE_TERMINAL(widget))
-#else /* not HAVE_VTE */
- "terminal"
-#endif /* HAVE_VTE */
- );
-}
-
-static void
-setup_terminal_signals(struct GSH_Terminal * term)
-{
- GSH * gsh;
- GtkWidget * widget;
-
- gsh=(GSH *)term->gsh;
- widget=term->widget;
- /* Return if no widget was created. */
- if(!widget)
- return;
- /* Exit from the application if the terminal process dies. */
- GSHCONNECT(widget, "child-exited", gtk_main_quit, NULL);
- {
- struct GSHCBData * cb;
-
- cb=ARNEW(gsh, GSHCBData, gsh, NULL);
- GSHCONNECT(widget, "status-line-changed",
- status_changed_cb, cb);
- GSHCONNECT(widget, "window-title-changed",
- title_change_cb, cb);
- }
-}
-
-static GtkWidget *
-gsh_GSH_Terminal_add(struct GSH_Terminal * term, const gchar * command)
-{
- /* Create and set properties of the VTE-based terminal. */
-#ifdef HAVE_VTE
- term->widget = vte_terminal_new();
-#else /* not HAVE_VTE */
- term->widget = NULL;
-#endif /* HAVE_VTE */
- setup_terminal_signals(term);
- set_terminal_options(term);
- gsh_terminal_run(term, command);
-
- return term->widget;
-}
-
-static void
-assign_methods(struct GSH_Terminal * term)
-{
- term->delete=&gsh_delete_GSH_Terminal;
- term->add=&gsh_GSH_Terminal_add;
-}
-
-static void
-initialize_fields(struct GSH_Terminal * term)
-{
- term->widget=NULL;
- term->font=NULL;
- term->dimensions.width=80;
- term->dimensions.height=24;
- term->transparent=TRUE;
-}
-
-static void
-setup_GSH_Terminal(struct GSH_Terminal * term)
-{
- initialize_fields(term);
- assign_methods(term);
-}
-
-struct GSH_Terminal *
-gsh_new_GSH_Terminal(GSH * gsh)
-{
- struct GSH_Terminal * term;
-
- term=xmalloc(sizeof(struct GSH_Terminal));
- setup_GSH_Terminal(term);
- term->gsh = (gpointer)gsh;
-
- return term;
-}
-
Index: terminal.h
===================================================================
RCS file: terminal.h
diff -N terminal.h
--- terminal.h 3 May 2007 03:42:31 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,29 +0,0 @@
-/*
- 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_TERMINAL_H
-#define GSH_TERMINAL_H
-
-struct GSH_Terminal *
-gsh_new_GSH_Terminal();
-
-#endif
Index: terminal_options.c
===================================================================
RCS file: terminal_options.c
diff -N terminal_options.c
--- terminal_options.c 14 May 2007 18:06:35 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,53 +0,0 @@
-/*
- AntiRight
- (c) 2002-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"
-
-void
-gsh_handle_terminal_options(GSH * gsh, const gint argc,
- const gchar ** argv, gint *counter)
-{
-#ifndef DEBUG
- UNUSED(argc);
-#endif /* DEBUG */
- /* Handle -ot tertiary options. */
- switch(argv[(*counter)][3])
- {
-#define GSHT gsh->terminal
-#define GSHTD GSHT->dimensions
- case 'f': /* Set font for terminal widget. */
- GSH_COUNT(argc, counter);
- GSHT->font=(gchar *)argv[*counter];
- break;
- case 'h': /* Set terminal widget height. */
- GSH_COUNT(argc, counter);
- GSHTD.height=atoi(argv[*counter]);
- break;
- case 'w': /* Set terminal widget width. */
- GSH_COUNT(argc, counter);
- GSHTD.width=atoi(argv[*counter]);
- break;
- default: /* Error message. */
- ARWARN("invalid tertiary terminal option");
- }
-}
Index: terminal_options.h
===================================================================
RCS file: terminal_options.h
diff -N terminal_options.h
--- terminal_options.h 14 May 2007 18:06:35 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,32 +0,0 @@
-/*
- AntiRight
- (c) 2002-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_TERMINAL_OPTIONS_H
-#define GSH_TERMINAL_OPTIONS_H
-
-void
-gsh_handle_terminal_options(GSH * gsh, const gint argc,
- const gchar ** argv, gint *counter);
-
-#endif /* not GSH_TERMINAL_OPTIONS_H */
-
Index: terminal_struct.h
===================================================================
RCS file: terminal_struct.h
diff -N terminal_struct.h
--- terminal_struct.h 17 May 2007 04:32:20 -0000 1.8
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,42 +0,0 @@
-/*
- 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_TERMINAL_STRUCT_H
-#define GSH_TERMINAL_STRUCT_H
-
-struct GSH_Terminal
-{
- GtkWidget * widget;
- gchar * font;
- struct ARArguments * scripts;
- ARDimensions dimensions;
- gboolean transparent;
- void (*delete)(struct GSH_Terminal *);
- GtkWidget * (*add)(struct GSH_Terminal *, const gchar *);
- gpointer gsh;
-};
-
-struct GSH_Terminal *
-gsh_new_GSH_Terminal();
-
-#endif /* not GSH_TERMINAL_STRUCT_H */
-
Index: text.c
===================================================================
RCS file: text.c
diff -N text.c
--- text.c 26 May 2007 21:24:07 -0000 1.33
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,270 +0,0 @@
-/*
- AntiRight
- (c) 2002-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"
-
-#define ADD_ENTRY(widget, str)\
- gtk_combo_box_prepend_text(GTK_COMBO_BOX(widget), str)
-
-/* Some sample entries to use when history is not useful, such as a
- * dialog presentation of this field, where the window displaying the
- * field closes on the first activation. */
-static void
-append_sample_entries(GtkWidget * widget)
-{
- ADD_ENTRY(widget, "ACE -A Terminal");
- ADD_ENTRY(widget, "ACE -A Settings");
- ADD_ENTRY(widget, "ACE -A IDE");
- ADD_ENTRY(widget, "ACE");
-}
-
-#ifdef DEBUG
-#define VALIDATE_ENTRY_PARAMETERS(gsh, entry, command)\
-{\
- ARPASSERT(gsh);\
- ARPASSERT(entry);\
- ARPASSERT(command);\
-}
-#else /* not DEBUG */
-#define VALIDATE_ENTRY_PARAMETERS(gsh, entry, command) /* undefined */
-#endif /* DEBUG */
-
-static void
-setup_entry_cb(struct GSH * gsh, GtkWidget * entry, const gchar * command)
-{
-
- struct GSHCBData * cb;
-
- VALIDATE_ENTRY_PARAMETERS(gsh, entry, command);
- cb=ARNEW(gsh, GSHCBData, gsh, (gpointer)(command ? command : "echo"));
- g_signal_connect(G_OBJECT(gtk_bin_get_child(GTK_BIN(entry))),
- "activate", G_CALLBACK(cb->entry), (gpointer)cb);
-}
-
-GtkWidget *
-gsh_setup_command_entry(struct GSH * gsh, const gchar *command)
-{
- GtkWidget *entry;
-
-#ifdef DEBUG
- ARPASSERT(gsh);
-#endif /* DEBUG */
-
- /* Create widget and assign callback. */
- setup_entry_cb(gsh, entry=gtk_combo_box_entry_new_text(), command);
- append_sample_entries(entry);
- gsh_manage(gsh, entry);
-
- return entry;
-}
-
-#define SET_WRAP_MODE(text)\
- gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD)
-
-#define SET_MONOSPACED_FONT(text)\
- gsh_widget_set_font(text, NULL)
-
-#define SET_OPTIONS(text)\
-{\
- SET_WRAP_MODE(text);\
- SET_MONOSPACED_FONT(text);\
-}
-
-
-static void
-setup_text_scroller(GSH * gsh, GtkWidget * text)
-{
- GtkWidget * scroller;
-
- GSH_SHOW_CREATE(scroller, scrolled_window, NULL, NULL);
- gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroller),
- text);
- $(gsh, manage, scroller);
-}
-
-GtkWidget *
-gsh_text_area(struct GSH * gsh)
-{
- GtkWidget *text;
-
-#ifdef DEBUG
- ARPASSERT(gsh);
-#endif /* DEBUG */
- gtk_widget_show(text=gsh->editor.widget=gtk_text_view_new());
- SET_OPTIONS(text);
- setup_text_scroller(gsh, text);
-
- return text;
-}
-
-#define CHECK_GEOMETRY(gsh)\
-{\
- ARIFNP(gsh->geometry)\
- gsh->geometry=g_strdup("775x700");\
-}
-
-#ifdef DEBUG
-#define VALIDATE_TEXT_EDITOR_PARAMETERS(gsh, filename)\
-{\
- ARPASSERT(gsh);\
- ARPASSERT(filename);\
-}
-#else /* not DEBUG */
-#define VALIDATE_TEXT_EDITOR_PARAMETERS(gsh, filename) /* undefined */
-#endif /* DEBUG */
-
-GtkTextBuffer *
-gsh_text_area_set_text(GtkWidget * widget, const gchar * text)
-{
- GtkTextBuffer * buffer;
-
- buffer=gtk_text_view_get_buffer(GTK_TEXT_VIEW(widget));
- gtk_text_buffer_set_text(buffer, text, strlen(text));
-
- return buffer;
-}
-
-/* This is currently just a text file viewer. */
-void
-gsh_text_editor(struct GSH * gsh, const gchar *filename)
-{
- gchar * text;
-
- VALIDATE_TEXT_EDITOR_PARAMETERS(gsh, filename);
- text=antiright_read_named_file(filename);
- (void)gsh_text_area_set_text(gsh_text_area(gsh), text);
- g_free(text);
- CHECK_GEOMETRY(gsh);
-}
-
-/* Check that the editor widget has been initialized. */
-#define TEST_EDITOR_EXISTS(gsh)\
- if(!gsh->editor.widget)\
- return;
-/* Text editor does not exist, so return. */
-
-static gchar *
-get_text(GtkWidget * editor)
-{
- GtkTextBuffer * buffer;
- GtkTextIter start, end;
-
- buffer=gtk_text_view_get_buffer(GTK_TEXT_VIEW(editor));
- gtk_text_buffer_get_start_iter(buffer, &start);
- gtk_text_buffer_get_end_iter(buffer, &end);
- return gtk_text_buffer_get_text(buffer, &start, &end, TRUE);
-}
-
-void
-gsh_editor_save(struct GSH * gsh)
-{
- TEST_EDITOR_EXISTS(gsh);
- /* Choose action based on whether or not file has been chosen.*/
- if(gsh->editor.filename)
- {
- gchar * text;
-
- text=get_text(gsh->editor.widget);
- AR_TEXT_TO_FILE(gsh->editor.filename, text);
- g_free(text);
- }
- else
- gsh_editor_save_as(gsh);
-}
-
-#define PROMPT_FILENAME() antiright_pipe_read("gtkshell -df")
-
-static void
-get_filename(struct GSH * gsh)
-{
- /* Make sure that FILENAME is freed if previously used. */
- if(gsh->editor.filename)
- g_free(gsh->editor.filename);
- /* Get the filename. */
- gsh->editor.filename=PROMPT_FILENAME();
-}
-
-#define FILENAME_NOT_EMPTY strcmp(gsh->editor.filename, "")
-
-void
-gsh_editor_save_as(struct GSH * gsh)
-{
- TEST_EDITOR_EXISTS(gsh);
- get_filename(gsh);
- /* Make sure filename is not empty. */
- if(FILENAME_NOT_EMPTY)
- gsh_editor_save(gsh);
-}
-
-static void
-open_gsh_file_in_editor(GSH * gsh)
-{
- gchar * text;
-
- text=antiright_read_named_file(gsh->editor.filename);
- gsh_text_area_set_text(gsh->editor.widget, text);
- g_free(text);
-}
-
-static void
-recent_file_cb(GtkWidget * widget, gpointer data)
-{
- GSH * gsh;
-
- gsh=(GSH *)data;
- if(gsh->editor.filename)
- g_free(gsh->editor.filename);
- gsh->editor.filename=g_strdup(
- (gchar *)gtk_label_get_text(
- GTK_LABEL(gtk_bin_get_child(GTK_BIN(widget)))));
- gsh_editor_save(gsh);
- open_gsh_file_in_editor(gsh);
-}
-
-static void
-add_to_recent_files(GSH * gsh, const gchar * filename)
-{
- GtkWidget * menu;
-
- if((menu=gsh->widgets.app.menus.view))
- {
- GtkWidget * button;
-
- button=gtk_menu_item_new_with_label(filename);
- GSHCONNECT(button, "activate", recent_file_cb, gsh);
- gtk_widget_show(button);
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), button);
- }
-}
-
-void
-gsh_editor_open(struct GSH * gsh)
-{
- TEST_EDITOR_EXISTS(gsh);
- get_filename(gsh);
- if(FILENAME_NOT_EMPTY)
- {
- open_gsh_file_in_editor(gsh);
- add_to_recent_files(gsh, gsh->editor.filename);
- }
-}
-
Index: text.h
===================================================================
RCS file: text.h
diff -N text.h
--- text.h 26 May 2007 21:24:07 -0000 1.10
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,50 +0,0 @@
-/*
- AntiRight
- (c) 2002-2006 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_TEXT_H
-#define GSH_TEXT_H
-
-GtkTextBuffer *
-gsh_text_area_set_text(GtkWidget * widget, const gchar * text);
-
-GtkWidget *
-gsh_setup_command_entry(struct GSH * gsh, const gchar *command);
-
-void
-gsh_setup_prompt_command_entry(struct GSH * gsh, const gchar *command);
-
-GtkWidget *
-gsh_text_area(struct GSH * gsh);
-
-void
-gsh_text_editor(struct GSH * gsh, const gchar *filename);
-
-void
-gsh_editor_save_as(struct GSH * gsh);
-
-void
-gsh_editor_save(struct GSH * gsh);
-
-void
-gsh_editor_open(struct GSH * gsh);
-
-#endif
Index: update_manager.c
===================================================================
RCS file: update_manager.c
diff -N update_manager.c
--- update_manager.c 21 May 2007 00:11:38 -0000 1.7
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,174 +0,0 @@
-/*
- AntiRight
- (c) 2002-2006 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"
-
-static void
-gsh_update_each(gpointer data, gpointer user_data)
-{
- UNUSED(user_data);
- /*
- * Ensure that the argument containing the structure is not
- * empty.
- */
-#ifdef DEBUG
- ARWIFNP(data)
- {
-#endif /* DEBUG */
- struct GSHUpdatedWidget *item;
-
- /*
- * Assign data to structure and call function pointer
- * with parameters.
- */
- item = (struct GSHUpdatedWidget *) data;
-#ifdef DEBUG
- ARPASSERT(item->update);
-#endif /* DEBUG */
- $(item, update);
-#ifdef DEBUG
- }
-#endif /* DEBUG */
-}
-
-static gint
-gsh_perform_updates(gpointer data)
-{
- struct GSHUpdateManager * updaters;
-
-#ifdef DEBUG
- ARBUG("gsh_perform_updates()");
-#endif /* DEBUG */
-
- updaters = (struct GSHUpdateManager *) data;
-
-
-#ifdef DEBUG
- if (updaters && updaters->list)
-#endif /* DEBUG */
- g_slist_foreach(updaters->list, gsh_update_each, NULL);
-#ifdef DEBUG
- else
- {
- ARWARN("data invalid, operation not performed.");
- return FALSE;
- }
-#endif /* DEBUG */
-
- return TRUE;
-}
-
-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)
- {
-#endif /* DEBUG */
- (void) gsh_perform_updates(updaters);
- (void) g_timeout_add(updaters->period, gsh_perform_updates,
- updaters);
-#ifdef DEBUG
- }
-#endif /* DEBUG */
-}
-
-static void
-gsh_GSHUpdateManager_add(struct GSHUpdateManager * updaters,
- struct GSHUpdatedWidget * item)
-{
-
-#ifdef DEBUG
- ARBUG("gsh_append_updater()");
-
- if (ARPBOOL(updaters) && ARPBOOL(item))
-#endif /* DEBUG */
- updaters->list = g_slist_prepend(updaters->list, item);
- /* Begin updating, if necessary. */
- gsh_GSHUpdateManager_start(updaters);
-#ifdef DEBUG
- ARBUG("end gsh_append_updater()");
-#endif /* DEBUG */
-}
-
-
-static void
-gsh_delete_each_updater(gpointer data, gpointer user_data)
-{
- struct GSHUpdatedWidget * item;
-
- UNUSED(user_data);
- item=(struct GSHUpdatedWidget *)data;
- $(item, delete);
-}
-
-static void
-gsh_delete_GSHUpdateManager(struct GSHUpdateManager * updaters)
-{
- g_slist_foreach(updaters->list, gsh_delete_each_updater, NULL);
- g_slist_free(updaters->list);
- g_free(updaters);
-}
-
-/* Setup method function pointer assignments. */
-static void
-assign_methods(struct GSHUpdateManager * update)
-{
- update->delete=&gsh_delete_GSHUpdateManager;
- update->add=&gsh_GSHUpdateManager_add;
-}
-
-/* Setup member data fields. */
-static void
-initialize_fields(struct GSHUpdateManager * update)
-{
- update->period = 1000;
- update->list = (GSList *) NULL;
- update->updating=FALSE;
-}
-
-static void
-setup(struct GSHUpdateManager * update)
-{
- assign_methods(update);
- initialize_fields(update);
-}
-
-struct GSHUpdateManager *
-gsh_new_GSHUpdateManager()
-{
- struct GSHUpdateManager * updater;
-
- updater=xmalloc(sizeof(struct GSHUpdateManager));
- setup(updater);
-
- return updater;
-}
-
-
Index: update_manager.h
===================================================================
RCS file: update_manager.h
diff -N update_manager.h
--- update_manager.h 3 May 2007 04:36:18 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,30 +0,0 @@
-/*
- AntiRight
- (c) 2002-2006 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_UPD_MAN_H
-#define GSH_UPD_MAN_H
-
-struct GSHUpdateManager *
-gsh_new_GSHUpdateManager();
-
-#endif /* GSH_UPD_MAN_H */
-
Index: update_manager_struct.h
===================================================================
RCS file: update_manager_struct.h
diff -N update_manager_struct.h
--- update_manager_struct.h 21 May 2007 00:11:38 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,36 +0,0 @@
-/*
- AntiRight
- (c) 2002-2006 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_UMS_H
-#define GSH_UMS_H
-
-struct GSHUpdateManager
-{
- unsigned int period;
- /address@hidden@*/ GSList *list;
- gboolean updating;
- void (*delete)(struct GSHUpdateManager *);
- void (*add)(struct GSHUpdateManager * , struct GSHUpdatedWidget *);
-};
-
-#endif /* GSH_UMS_H */
-
Index: updated.c
===================================================================
RCS file: updated.c
diff -N updated.c
--- updated.c 10 May 2007 00:08:28 -0000 1.17
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,63 +0,0 @@
-/*
- AntiRight
- (c) 2002-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"
-
-static void
-gsh_delete_GSHUpdatedWidget(struct GSHUpdatedWidget * item)
-{
- GSH_FREE_IF(item->command);
- g_free(item);
-}
-
-static void
-gsh_GSHUpdatedWidget_update(struct GSHUpdatedWidget * item)
-{
- item->function(item->command, item->widget);
-}
-
-/* Assign GSHUpdatedWidget class methods. */
-#define ASSIGN_METHODS(updater)\
-{\
- updater->update=&gsh_GSHUpdatedWidget_update;\
- updater->delete=&gsh_delete_GSHUpdatedWidget;\
-}
-
-struct GSHUpdatedWidget *
-gsh_new_GSHUpdatedWidget(void (*function)(const gchar *, gpointer),
- const gchar * command, GtkWidget * widget)
-{
- struct GSHUpdatedWidget * updater;
-
- updater=xmalloc(sizeof(struct GSHUpdatedWidget));
- ASSIGN_METHODS(updater);
- /* Assign widget-specific update information, specifically
- * the widget command, a pointer to the widget, and the widget's
- * updater function. */
- updater->command=g_strdup(command);
- updater->widget=widget;
- updater->function=function;
-
- return updater;
-}
-
-
Index: updated.h
===================================================================
RCS file: updated.h
diff -N updated.h
--- updated.h 3 May 2007 04:36:18 -0000 1.9
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,39 +0,0 @@
-/*
- AntiRight
- (c) 2002-2006 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_UPDATED_H
-#define GSH_UPDATED_H
-
-struct GSHUpdatedWidget
-{
- GtkWidget * widget;
- gchar * command;
- void (*function)(const gchar *, gpointer);
- void (*update)(struct GSHUpdatedWidget *);
- void (*delete)(struct GSHUpdatedWidget *);
-};
-
-struct GSHUpdatedWidget *
-gsh_new_GSHUpdatedWidget(void (*function)(const gchar *, gpointer),
- const gchar * command, GtkWidget * widget);
-
-#endif
Index: updated_label.c
===================================================================
RCS file: updated_label.c
diff -N updated_label.c
--- updated_label.c 16 May 2007 20:39:45 -0000 1.21
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,77 +0,0 @@
-/*
- AntiRight
- (c) 2002-2006 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"
-
-/* This ensures that the result string is not empty, avoiding
- * certain formatting problems.
- * Otherwise, a GTK warning and termination occurs. */
-
-#define CHECK_RESULTS(results) \
-{\
- if (results[0] == '\0')\
- {\
- g_free(results);\
- results=g_strdup("(empty)");\
- }\
-}
-
-static void
-gsh_update_label(const gchar *command, gpointer widget)
-{
- gchar *results;
-
-#ifdef DEBUG
- ARBUG("gsh_update_label()");
-
- ARPASSERT(command);
- ARPASSERT(widget);
-#endif /* DEBUG */
- results=antiright_pipe_read(command);
- CHECK_RESULTS(results);
- if(GTK_IS_LABEL(widget))
- gtk_label_set_text(GTK_LABEL(widget), results);
- else if(GTK_IS_STATUSBAR(widget))
- gtk_statusbar_push(GTK_STATUSBAR(widget),
- gtk_statusbar_get_context_id(GTK_STATUSBAR(widget),
- "updater"), results);
- g_free(results);
-}
-
-void
-gsh_add_updated_label(struct GSH * gsh, const gchar *command)
-{
-#define GWA gsh->widgets.app
- GtkWidget * status = GWA.status;
-#ifdef DEBUG
- g_message("gsh_add_updated_label()");
- ARPASSERT(gsh);
- ARPASSERT(command);
-#endif /* DEBUG */
- $(gsh->update, add, ARNEW(gsh, GSHUpdatedWidget, &gsh_update_label,
- command, (GSH_FLAG(GSH_APP_MODE) && status)
- ? status : gsh_add_label(gsh, (char *)command)));
- GSH_UNSET(GSH_APP_MODE);
- /* Prevent two updaters from being
- assigned to the status bar label. */
- GWA.status=NULL;
-}
Index: updated_label.h
===================================================================
RCS file: updated_label.h
diff -N updated_label.h
--- updated_label.h 2 Mar 2007 16:41:43 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,29 +0,0 @@
-/*
- AntiRight
- (c) 2002-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_UPDATED_LABEL_H
-#define GSH_UPDATED_LABEL_H
-
-void
-gsh_add_updated_label(struct GSH * gsh, const gchar *command);
-
-#endif /* GSH_UPDATED_LABEL_H */
Index: updated_options.c
===================================================================
RCS file: updated_options.c
diff -N updated_options.c
--- updated_options.c 21 May 2007 00:11:38 -0000 1.20
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,54 +0,0 @@
-/*
- AntiRight
- (c) 2002-2006 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"
-
-static void
-add_updater(GSH * gsh, const gint argc, gint * counter,
- const gchar ** argv, void (*add_func)(GSH *, const gchar *))
-{
- GSH_COUNT(argc, counter);
- add_func(gsh, argv[*counter]);
-}
-
-#define UADD(type) \
- add_updater(gsh, argc, counter, argv, &gsh_add_updated_##type)
-
-void
-gsh_handle_updated_arguments(GSH * gsh, const gint argc,
- const gchar **argv, gint *counter)
-{
-#ifdef DEBUG
- ARPASSERT(gsh);
-#endif /* DEBUG */
-
- g_assert(strlen(argv[(*counter)]) > 2);
- switch (argv[(*counter)][3])
- {
- case 'l':
- UADD(label);
- break;
- case 'p':
- UADD(progress);
- break;
- }
-}
Index: updated_options.h
===================================================================
RCS file: updated_options.h
diff -N updated_options.h
--- updated_options.h 14 May 2007 18:06:35 -0000 1.5
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,30 +0,0 @@
-/*
- AntiRight
- (c) 2002-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_UPDATED_OPTIONS_H
-#define GSH_UPDATED_OPTIONS_H
-
-void
-gsh_handle_updated_arguments(GSH * gsh, const gint argc,
- const gchar **argv, gint *counter);
-
-#endif
Index: updated_progress.c
===================================================================
RCS file: updated_progress.c
diff -N updated_progress.c
--- updated_progress.c 14 May 2007 12:16:12 -0000 1.15
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,53 +0,0 @@
-/*
- AntiRight
- (c) 2002-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"
-
-static void
-gsh_update_progress(const gchar *command, gpointer widget)
-{
- gchar *results;
-
-#ifdef DEBUG
- ARPASSERT(command);
- ARPASSERT(widget);
-#endif /* DEBUG */
-
- gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR((GtkWidget *) widget),
- strtod(results=antiright_pipe_read((char*)command), NULL));
- g_free(results);
-}
-
-void
-gsh_add_updated_progress(struct GSH * gsh, const gchar *command)
-{
- GtkWidget *progress;
-
-#ifdef DEBUG
- ARPASSERT(gsh);
- ARPASSERT(command);
-#endif /* DEBUG */
- progress=gtk_progress_bar_new();
- $(gsh, manage, progress);
- $(gsh->update, add, ARNEW(gsh, GSHUpdatedWidget,
- &gsh_update_progress, command, progress));
-}
Index: updated_progress.h
===================================================================
RCS file: updated_progress.h
diff -N updated_progress.h
--- updated_progress.h 2 Mar 2007 16:41:43 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,29 +0,0 @@
-/*
- AntiRight
- (c) 2002-2006 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_UPDATED_PROGRESS_H
-#define GSH_UPDATED_PROGRESS_H
-
-void
-gsh_add_updated_progress(struct GSH * gsh, const gchar *command);
-
-#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Antiright-devel] antiright/gtkshell Makefile about_dialog.c abou...,
Jeffrey Bedard <=