antiright-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Antiright-devel] antiright/gtkshell Makefile macros.h options.c ...


From: Jeffrey Bedard
Subject: [Antiright-devel] antiright/gtkshell Makefile macros.h options.c ...
Date: Thu, 20 Dec 2007 15:09:12 +0000

CVSROOT:        /sources/antiright
Module name:    antiright
Changes by:     Jeffrey Bedard <jefbed> 07/12/20 15:09:12

Modified files:
        gtkshell       : Makefile macros.h options.c terminal_options.c 
                         terminal_options.h 

Log message:
        Fixed typo preventing terminal transparency.  Begin to code
        option function definition shortcuts.  Extract terminal options
        from options.c to terminal_options.c.  

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/Makefile?cvsroot=antiright&r1=1.52&r2=1.53
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/macros.h?cvsroot=antiright&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/options.c?cvsroot=antiright&r1=1.39&r2=1.40
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/terminal_options.c?cvsroot=antiright&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/terminal_options.h?cvsroot=antiright&r1=1.4&r2=1.5

Patches:
Index: Makefile
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/Makefile,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -b -r1.52 -r1.53
--- Makefile    20 Dec 2007 00:21:11 -0000      1.52
+++ Makefile    20 Dec 2007 15:09:12 -0000      1.53
@@ -33,8 +33,7 @@
 
 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\
-       dialog_options.o\
-       row.o containers.o geometry.o font.o dragdrop.o\
+       dialog_options.o row.o containers.o geometry.o font.o dragdrop.o\
        image_button.o terminal.o terminal_options.o menu.o updated.o\
        guidl_util.o about_dialog.o init.o guidl_dialog.o guidl_dictionary.o\
        guidl_options.o guidl_widgets.o update_manager.o pane.o\

Index: macros.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/macros.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- macros.h    6 Dec 2007 14:40:50 -0000       1.18
+++ macros.h    20 Dec 2007 15:09:12 -0000      1.19
@@ -73,5 +73,21 @@
 #define GSHCONNECT(widget, signal, cb, cbdata)\
        g_signal_connect(G_OBJECT(widget), signal, G_CALLBACK(cb), cbdata);
 
+#define GSH_OPTION_FUNC_NAME(option, op) gsh_option_##op##_##option
+#define GSH_OPTION_PROTOTYPE(name)\
+       void name(GSH * gsh, gint * counter, const gchar ** argv)
+#define GSH_OPTION_FUNCTION(name, option, operation)\
+       GSH_OPTION_PROTOTYPE(name) { operation(option); }
+#define GSH_OPTION_SET_PROTOTYPE(option)\
+       GSH_OPTION_PROTOTYPE(GSH_OPTION_FUNC_NAME(option, GSH_SET))
+#define GSH_OPTION_SET_FUNCTION(option)\
+       GSH_OPTION_FUNCTION(GSH_OPTION_FUNC_NAME(option, GSH_SET),\
+               option, GSH_SET)
+#define GSH_OPTION_UNSET_PROTOTYPE(option)\
+       GSH_OPTION_PROTOTYPE(GSH_OPTION_FUNC_NAME(option, GSH_UNSET))
+#define GSH_OPTION_UNSET_FUNCTION(option)\
+       GSH_OPTION_FUNCTION(GSH_OPTION_FUNC_NAME(option, GSH_UNSET),\
+               option, GSH_UNSET)
+
 #endif /* not GSH_MACROS_H */
 

Index: options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/options.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -b -r1.39 -r1.40
--- options.c   19 Dec 2007 18:44:46 -0000      1.39
+++ options.c   20 Dec 2007 15:09:12 -0000      1.40
@@ -95,49 +95,6 @@
 {
 }
 
-
-
-static void
-option_terminal_width_cb(GSH * gsh, gint * counter, const gchar ** argv)
-{
-       gsh->terminal->dimensions.width=atoi(argv[++(*counter)]);
-}
-
-static void
-option_terminal_height_cb(GSH * gsh, gint * counter, const gchar ** argv)
-{
-       gsh->terminal->dimensions.height=atoi(argv[++(*counter)]);
-}
-
-static void
-option_terminal_font_cb(GSH * gsh, gint * counter, const gchar ** argv)
-{
-       gsh->terminal->font=(gchar *)argv[++(*counter)];
-}
-
-static void
-option_terminal_transparent_cb(GSH * gsh, gint * counter, const gchar ** argv)
-{
-       GSH_UNSET(GSH_TERM_TRANSPARENT);
-}
-
-static void
-option_terminal_not_transparent_cb(GSH * gsh, gint * counter, 
-       const gchar ** argv)
-{
-       GSH_UNSET(GSH_TERM_TRANSPARENT);
-}
-
-static void
-option_terminal_not_tab_cb(GSH * gsh, gint * counter, const gchar ** argv)
-{
-       gsh->terminal=NULL;
-}
-
-
-
-
-
 static void
 option_app_mode_cb(GSH * gsh, gint * counter, const gchar ** argv)
 {
@@ -163,6 +120,8 @@
        GSH_SET(GSH_GUIDL_NO_DUMMY);
 }
 
+/*GSH_OPTION_SET_FUNCTION(GSH_PROMPT_ECHOES); */
+
 static void
 option_echoes_cb(GSH * gsh, gint * counter, const gchar ** argv)
 {
@@ -355,12 +314,12 @@
        ARTDEF("-ou", option_update_cb);
 
        /* Terminal options */
-       ARTDEF("-otf", option_terminal_font_cb);
-       ARTDEF("-oth", option_terminal_height_cb);
-       ARTDEF("-otN", option_terminal_not_tab_cb);
-       ARTDEF("-otT", option_terminal_not_transparent_cb);
-       ARTDEF("-otT", option_terminal_transparent_cb);
-       ARTDEF("-otw", option_terminal_width_cb);
+       ARTDEF("-otf", gsh_option_terminal_font_cb);
+       ARTDEF("-oth", gsh_option_terminal_height_cb);
+       ARTDEF("-otN", gsh_option_terminal_not_tab_cb);
+       ARTDEF("-otT", gsh_option_terminal_not_transparent_cb);
+       ARTDEF("-ott", gsh_option_terminal_transparent_cb);
+       ARTDEF("-otw", gsh_option_terminal_width_cb);
 
        /* Dialog options */
        ARTDEF("-da", gsh_dialog_about_cb);

Index: terminal_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/terminal_options.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- terminal_options.c  24 Nov 2007 10:53:41 -0000      1.9
+++ terminal_options.c  20 Dec 2007 15:09:12 -0000      1.10
@@ -24,40 +24,44 @@
 #include "gtkshell.h"
 
 void
-gsh_handle_terminal_options(GSH * gsh, const gint argc, 
-                           const gchar ** argv, gint *counter)
+gsh_option_terminal_width_cb(GSH * gsh, 
+       gint * counter, const gchar ** argv)
+{
+       gsh->terminal->dimensions.width=atoi(argv[++(*counter)]);
+}
+
+void
+gsh_option_terminal_height_cb(GSH * gsh, 
+       gint * counter, const gchar ** argv)
+{
+       gsh->terminal->dimensions.height=atoi(argv[++(*counter)]);
+}
+
+void
+gsh_option_terminal_font_cb(GSH * gsh, 
+       gint * counter, const gchar ** argv)
+{
+       gsh->terminal->font=(gchar *)argv[++(*counter)];
+}
+
+void
+gsh_option_terminal_transparent_cb(GSH * gsh, 
+       gint * counter, const gchar ** argv)
 {
-#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 'N': /* Make a new terminal instead of 
-                            a new tab for next terminal.  */
-                       gsh->terminal=NULL;
-                       break;
-               case 'T': /* Set not transparent.  (Default) */
-                       GSH_UNSET(GSH_TERM_TRANSPARENT);
-                       break;
-               case 't': /* Set transparent.  */
                        GSH_SET(GSH_TERM_TRANSPARENT);
-                       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");
-               }
 }
+
+void
+gsh_option_terminal_not_transparent_cb(GSH * gsh, 
+       gint * counter, const gchar ** argv)
+{
+       GSH_UNSET(GSH_TERM_TRANSPARENT);
+}
+
+void
+gsh_option_terminal_not_tab_cb(GSH * gsh, 
+       gint * counter, const gchar ** argv)
+{
+       gsh->terminal=NULL;
+}
+

Index: terminal_options.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/terminal_options.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- terminal_options.h  11 Jun 2007 21:32:44 -0000      1.4
+++ terminal_options.h  20 Dec 2007 15:09:12 -0000      1.5
@@ -25,8 +25,28 @@
 #define GSH_TERMINAL_OPTIONS_H
 
 void
-gsh_handle_terminal_options(GSH * gsh, const gint argc, 
-                           const gchar ** argv, gint *counter);
+gsh_option_terminal_width_cb(GSH * gsh, 
+       gint * counter, const gchar ** argv);
+
+void
+gsh_option_terminal_height_cb(GSH * gsh, 
+       gint * counter, const gchar ** argv);
+
+void
+gsh_option_terminal_font_cb(GSH * gsh, 
+       gint * counter, const gchar ** argv);
+
+void
+gsh_option_terminal_transparent_cb(GSH * gsh, 
+       gint * counter, const gchar ** argv);
+
+void
+gsh_option_terminal_not_transparent_cb(GSH * gsh, 
+       gint * counter, const gchar ** argv);
+
+void
+gsh_option_terminal_not_tab_cb(GSH * gsh, 
+       gint * counter, const gchar ** argv);
 
 #endif /* not GSH_TERMINAL_OPTIONS_H */
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]