[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Antiright-devel] antiright/gtkshell Makefile module_includes.h t...
From: |
Jeffrey Bedard |
Subject: |
[Antiright-devel] antiright/gtkshell Makefile module_includes.h t... |
Date: |
Wed, 31 Oct 2007 13:57:38 +0000 |
CVSROOT: /sources/antiright
Module name: antiright
Changes by: Jeffrey Bedard <jefbed> 07/10/31 13:57:38
Modified files:
gtkshell : Makefile module_includes.h text.c text.h
Added files:
gtkshell : GSHWidget.c GSHWidget.h
Log message:
Began objectifying widget code, starting with text widget.
Added GSHWidget interface class.
Fixed merge conflicts.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/Makefile?cvsroot=antiright&r1=1.45&r2=1.46
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/module_includes.h?cvsroot=antiright&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/text.c?cvsroot=antiright&r1=1.36&r2=1.37
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/text.h?cvsroot=antiright&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/GSHWidget.c?cvsroot=antiright&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/GSHWidget.h?cvsroot=antiright&rev=1.1
Patches:
Index: Makefile
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/Makefile,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- Makefile 25 Oct 2007 01:07:43 -0000 1.45
+++ Makefile 31 Oct 2007 13:57:38 -0000 1.46
@@ -39,7 +39,7 @@
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\
command_shell.o app_mode.o clock.o tree.o form.o dialog.o swallow.o\
- quickstart.o
+ GSHWidget.o quickstart.o
program=main.o
Index: module_includes.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/module_includes.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- module_includes.h 25 Oct 2007 01:07:43 -0000 1.11
+++ module_includes.h 31 Oct 2007 13:57:38 -0000 1.12
@@ -61,6 +61,7 @@
#include "form.h"
#include "dialog.h"
#include "swallow.h"
+#include "GSHWidget.h"
#include "quickstart.h"
#endif /* not GSH_MODULE_INCLUDES_H */
Index: text.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/text.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- text.c 13 Aug 2007 08:24:28 -0000 1.36
+++ text.c 31 Oct 2007 13:57:38 -0000 1.37
@@ -77,16 +77,12 @@
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
+set_options(GtkWidget * text_widget)
+{
+ gtk_text_view_set_wrap_mode(
+ GTK_TEXT_VIEW(text_widget), GTK_WRAP_WORD);
+ gsh_widget_set_font(text_widget, NULL);
}
@@ -98,7 +94,6 @@
GSH_SHOW_CREATE(scroller, scrolled_window, NULL, NULL);
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroller),
text);
- $(gsh, manage, scroller);
}
GtkWidget *
@@ -110,7 +105,7 @@
ARPASSERT(gsh);
#endif /* DEBUG */
gtk_widget_show(text=gsh->editor.widget=gtk_text_view_new());
- SET_OPTIONS(text);
+ set_options(text);
setup_text_scroller(gsh, text);
return text;
Index: text.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/text.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- text.h 11 Jun 2007 21:32:44 -0000 1.12
+++ text.h 31 Oct 2007 13:57:38 -0000 1.13
@@ -23,6 +23,34 @@
#ifndef GSH_TEXT_H
#define GSH_TEXT_H
+#include "GSHWidget.h"
+
+typedef struct GSHText
+{
+ GSHWidget * parent;
+
+ void (*delete)(struct GSHText *);
+ GtkWidget * __text_widget;
+} GSHText;
+
+typedef struct GSHTextArea
+{
+ GSHText * parent;
+
+ void (*delete)(struct GSHTextArea *);
+} GSHTextArea;
+
+typedef struct GSHTextEditor
+{
+ GSHTextArea * parent;
+
+ void (*delete)(struct GSHTextEditor *);
+ GtkWidget * __text_widget;
+} GSHTextEditor;
+
+GSHTextEditor *
+gsh_new_GSHTextEditor();
+
GtkTextBuffer *
gsh_text_area_set_text(GtkWidget * widget, const gchar * text);
Index: GSHWidget.c
===================================================================
RCS file: GSHWidget.c
diff -N GSHWidget.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ GSHWidget.c 31 Oct 2007 13:57:38 -0000 1.1
@@ -0,0 +1,3 @@
+#include "gtkshell.h"
+
+
Index: GSHWidget.h
===================================================================
RCS file: GSHWidget.h
diff -N GSHWidget.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ GSHWidget.h 31 Oct 2007 13:57:38 -0000 1.1
@@ -0,0 +1,40 @@
+/*
+ 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_GSHWIDGET_H
+#define GSH_GSHWIDGET_H
+
+typedef struct GSHWidget
+{
+ /* Public: */
+ void (*delete)(struct GSHWidget *);
+ GtkWidget * (*get_widget)(struct GSHWidget *);
+ void (*set_value)(struct GSHWidget *, gpointer *);
+ /* Private: */
+ GtkWidget * __widget;
+ gpointer __value;
+} GSHWidget;
+
+GSHWidget *
+gsh_new_GSHWidget();
+
+#endif /* GSH_GSHWIDGET_H */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Antiright-devel] antiright/gtkshell Makefile module_includes.h t...,
Jeffrey Bedard <=