[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Antiright-devel] antiright/gtkshell Makefile gtkshell.c gtkshell...
From: |
Jeffrey Bedard |
Subject: |
[Antiright-devel] antiright/gtkshell Makefile gtkshell.c gtkshell... |
Date: |
Fri, 06 Apr 2007 15:32:23 +0000 |
CVSROOT: /sources/antiright
Module name: antiright
Changes by: Jeffrey Bedard <jefbed> 07/04/06 15:32:22
Modified files:
gtkshell : Makefile gtkshell.c gtkshell.h main.c
Added files:
gtkshell : init.c init.h
Log message:
Commented initialization routines.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/Makefile?cvsroot=antiright&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/gtkshell.c?cvsroot=antiright&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/gtkshell.h?cvsroot=antiright&r1=1.30&r2=1.31
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/main.c?cvsroot=antiright&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/init.c?cvsroot=antiright&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/init.h?cvsroot=antiright&rev=1.1
Patches:
Index: Makefile
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/Makefile,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- Makefile 6 Apr 2007 15:05:28 -0000 1.20
+++ Makefile 6 Apr 2007 15:32:22 -0000 1.21
@@ -32,12 +32,12 @@
LDFLAGS+=`pkg-config --libs gtk+-2.0` `pkg-config --libs vte`
#LDFLAGS+=-lefence
-objects=y.tab.o lex.yy.o gtkshell.o arguments.o options.o callbacks.o
updated.o\
+objects=y.tab.o lex.yy.o gtkshell.o arguments.o options.o callbacks.o\
label.o button.o text.o updated_label.o updated_progress.o\
updated_options.o add_options.o option_options.o dialog_options.o\
file_dialog.o row.o containers.o geometry.o font.o dragdrop.o\
- image_button.o terminal.o terminal_options.o menu.o\
- guidl_util.o about_dialog.o
+ image_button.o terminal.o terminal_options.o menu.o updated.o\
+ guidl_util.o about_dialog.o init.o
program=main.o
Index: gtkshell.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/gtkshell.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- gtkshell.c 24 Mar 2007 04:17:13 -0000 1.23
+++ gtkshell.c 6 Apr 2007 15:32:22 -0000 1.24
@@ -82,22 +82,18 @@
return gsh;
}
-struct GSH *
-gsh_init(int *argc, char ***argv)
-{
- struct GSH *gsh;
-
- gsh = gsh_new_GSH();
- gsh_stack_init(gsh, argc, argv);
- return gsh;
-}
void
-gsh_stack_init(struct GSH * gsh, int *argc, char ***argv)
+gsh_cleanup(struct GSH * gsh)
{
- gtk_init(argc, argv);
- gsh_GSH(gsh);
- gsh->window = gsh_create_main_window();
+ /* If the terminal was used, it created a temporary command script,
+ * which must be removed on program exit. A better way to do this would
+ * be to install a timer to remove the script. This is necessary as
+ * premature script removal breaks the terminal command fork. */
+ if(gsh->terminal.script != NULL)
+ {
+ unlink(gsh->terminal.script);
+ free(gsh->terminal.script);
+ }
}
-
Index: gtkshell.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/gtkshell.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- gtkshell.h 6 Apr 2007 15:05:28 -0000 1.30
+++ gtkshell.h 6 Apr 2007 15:32:22 -0000 1.31
@@ -94,12 +94,7 @@
#include "guidl_util.h"
#include "about_dialog.h"
#include "menu.h"
-
-void
-gsh_stack_init(struct GSH * gsh, int *argc, char ***argv);
-
-struct GSH *
-gsh_init(int *argc, char ***argv);
+#include "init.h"
GtkWidget *
gsh_create_main_window();
@@ -110,4 +105,7 @@
struct GSH *
gsh_new_GSH();
+void
+gsh_cleanup(struct GSH * gsh);
+
#endif
Index: main.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/main.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- main.c 1 Apr 2007 05:34:56 -0000 1.17
+++ main.c 6 Apr 2007 15:32:22 -0000 1.18
@@ -22,39 +22,6 @@
#include "gtkshell.h"
-static void
-init_GUI(struct GSH * gsh, int * argc, char *** argv)
-{
- gsh_stack_init(gsh, argc, argv);
-
- /* Initialize toplevel child containers, with parenting delayed. */
- gsh_setup_containers(gsh);
- /* Create all application widgets based on command line arguments. */
- gsh_parse_arguments(gsh, *argc, *argv);
- /* 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->window);
-
-}
-
-static void
-cleanup(struct GSH * gsh)
-{
- /* If the terminal was used, it created a temporary command script,
- * which must be removed on program exit. A better way to do this would
- * be to install a timer to remove the script. This is necessary as
- * premature script removal breaks the terminal command fork. */
- if(gsh->terminal.script != NULL)
- {
- unlink(gsh->terminal.script);
- free(gsh->terminal.script);
- }
-}
int
main(int argc, char **argv)
@@ -62,9 +29,9 @@
/* Store application structure on stack. */
struct GSH gsh;
- init_GUI(&gsh, &argc, &argv); /* Setup GUI. */
+ gsh_init_GUI(&gsh, &argc, &argv); /* Setup GUI. */
gtk_main(); /* application main loop */
- cleanup(&gsh); /* Clean temporary files. */
+ gsh_cleanup(&gsh); /* Clean temporary files. */
return (EXIT_SUCCESS);
}
Index: init.c
===================================================================
RCS file: init.c
diff -N init.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ init.c 6 Apr 2007 15:32:22 -0000 1.1
@@ -0,0 +1,66 @@
+/*
+ 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"
+
+/* Allocate and initialize a GSH structure on the heap. */
+struct GSH *
+gsh_init(int *argc, char ***argv)
+{
+ struct GSH *gsh;
+
+ gsh = gsh_new_GSH();
+ gsh_stack_init(gsh, argc, argv);
+
+ return gsh;
+}
+
+/* Initialize a GSH structure stored on the stack. */
+void
+gsh_stack_init(struct GSH * gsh, int *argc, char ***argv)
+{
+ gtk_init(argc, argv);
+ gsh_GSH(gsh);
+ gsh->window = gsh_create_main_window();
+}
+
+/* Combined initialization routine for setup of gtkshell-based application,
+ * using a stack-stored GSH application structure. */
+void
+gsh_init_GUI(struct GSH * gsh, int * argc, char *** argv)
+{
+ gsh_stack_init(gsh, argc, argv);
+
+ /* Initialize toplevel child containers, with parenting delayed. */
+ gsh_setup_containers(gsh);
+ /* Create all application widgets based on command line arguments. */
+ gsh_parse_arguments(gsh, *argc, *argv);
+ /* 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->window);
+}
+
Index: init.h
===================================================================
RCS file: init.h
diff -N init.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ init.h 6 Apr 2007 15:32:22 -0000 1.1
@@ -0,0 +1,35 @@
+/*
+ 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
+
+struct GSH *
+gsh_init(int *argc, char ***argv);
+
+void
+gsh_stack_init(struct GSH * gsh, int *argc, char ***argv);
+
+void
+gsh_init_GUI(struct GSH * gsh, int * argc, char *** argv);
+
+#endif /* GSH_INIT_H */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Antiright-devel] antiright/gtkshell Makefile gtkshell.c gtkshell...,
Jeffrey Bedard <=