[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Antiright-devel] antiright/gtkshell guidl_dictionary.c guidl_dic...
From: |
Jeffrey Bedard |
Subject: |
[Antiright-devel] antiright/gtkshell guidl_dictionary.c guidl_dic... |
Date: |
Tue, 24 Apr 2007 00:17:02 +0000 |
CVSROOT: /sources/antiright
Module name: antiright
Changes by: Jeffrey Bedard <jefbed> 07/04/24 00:17:02
Added files:
gtkshell : guidl_dictionary.c guidl_dictionary.h
guidl_options.c guidl_options.h guidltest
Log message:
Added missing files.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_dictionary.c?cvsroot=antiright&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_dictionary.h?cvsroot=antiright&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_options.c?cvsroot=antiright&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_options.h?cvsroot=antiright&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidltest?cvsroot=antiright&rev=1.1
Patches:
Index: guidl_dictionary.c
===================================================================
RCS file: guidl_dictionary.c
diff -N guidl_dictionary.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ guidl_dictionary.c 24 Apr 2007 00:17:01 -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"
+
+const gchar *
+gsh_guidl_lookup(struct ARTupleVector * dict, gchar * term)
+{
+#ifdef DEBUG
+ ARPASSERT(dict);
+ ARPASSERT(term);
+#endif /* DEBUG */
+
+ {
+ const gchar * result;
+
+ if((result = dict->find(dict, term)) == NULL)
+ ARWARN("item not found in dictionary");
+
+ return result;
+ }
+}
+
+#define GSH_DELETE_DICTIONARY(base, dict)\
+{\
+ if(base->dict != NULL)\
+ {\
+ ar_delete_ARTupleVector(base->dict);\
+ base->dict=NULL;\
+ }\
+}
+
+void
+gsh_delete_GDLDictionaries_contents(struct GDLDictionaries * dictionaries)
+{
+ GSH_DELETE_DICTIONARY(dictionaries, widgets);
+ GSH_DELETE_DICTIONARY(dictionaries, options);
+ GSH_DELETE_DICTIONARY(dictionaries, dialogs);
+}
+
+void
+gsh_delete_GDLDictionaries(struct GDLDictionaries * dictionaries)
+{
+ gsh_delete_GDLDictionaries_contents(dictionaries);
+ g_free(dictionaries);
+}
+
Index: guidl_dictionary.h
===================================================================
RCS file: guidl_dictionary.h
diff -N guidl_dictionary.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ guidl_dictionary.h 24 Apr 2007 00:17:02 -0000 1.1
@@ -0,0 +1,54 @@
+/*
+ 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 * widgets;
+ struct ARTupleVector * dialogs;
+ struct ARTupleVector * options;
+};
+
+#define GSH_GUIDL_CHECK_DICTIONARY(dict)\
+{\
+ if(gsh_guidl_env->dictionaries.dict==NULL)\
+ setup_dictionary();\
+}
+
+#define GSH_GUIDL_DEFINE(dict, a, b)\
+ dict->add(dict, (gchar *)a, (gchar *)b)
+
+const gchar *
+gsh_guidl_lookup(struct ARTupleVector * dict, gchar * term);
+
+void
+gsh_delete_GDLDictionaries_contents(struct GDLDictionaries * dictionaries);
+
+void
+gsh_delete_GDLDictionaries(struct GDLDictionaries * dictionaries);
+
+struct GDLDictionaries *
+gsh_new_GDLDictionaries();
+
+#endif /* GSH_GUIDL_DICTIONARY_H */
Index: guidl_options.c
===================================================================
RCS file: guidl_options.c
diff -N guidl_options.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ guidl_options.c 24 Apr 2007 00:17:02 -0000 1.1
@@ -0,0 +1,70 @@
+/*
+ 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;
+
+#define DEF(a, b) GSH_GUIDL_DEFINE(options, a, b);
+
+static void
+setup_definitions(struct ARTupleVector * options)
+{
+ DEF("framed labels", "-of");
+ DEF("undecorated", "-on");
+ DEF("exit on activate", "-oe");
+ DEF("horizontal labels", "-oh");
+ DEF("scrolled", "-os");
+ DEF("no label fill", "-ol");
+ DEF("label 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");
+}
+
+static void
+setup_dictionary()
+{
+ gsh_guidl_env->dictionaries.options=ar_new_ARTupleVector();
+ setup_definitions(gsh_guidl_env->dictionaries.options);
+}
+
+void
+gsh_guidl_option(gchar * option, gchar * argument)
+{
+ const gchar * result;
+
+ GSH_GUIDL_CHECK_DICTIONARY(options);
+#ifdef DEBUG
+ ARPASSERT(gsh_guidl_env->dictionaries.options);
+#endif /* DEBUG */
+ result=gsh_guidl_lookup(gsh_guidl_env->dictionaries.options,
+ option);
+ g_free(option);
+ if(result != NULL)
+ gsh_guidl_add(result, argument);
+}
+
Index: guidl_options.h
===================================================================
RCS file: guidl_options.h
diff -N guidl_options.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ guidl_options.h 24 Apr 2007 00:17:02 -0000 1.1
@@ -0,0 +1,29 @@
+/*
+ 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
+
+void
+gsh_guidl_option(gchar * option, gchar * argument);
+
+#endif /* GSH_GUIDL_OPTIONS_H */
Index: guidltest
===================================================================
RCS file: guidltest
diff -N guidltest
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ guidltest 24 Apr 2007 00:17:02 -0000 1.1
@@ -0,0 +1,7 @@
+option "rows" 5;
+option "horizontal_labels";
+
+add button "test_button";
+add label "test label";
+add updating label "date";
+
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Antiright-devel] antiright/gtkshell guidl_dictionary.c guidl_dic...,
Jeffrey Bedard <=