summaryrefslogtreecommitdiffstats
path: root/patches/glademm-2.6.0/generic/gwt-support.diff
blob: 17a4bcf7d4ca1d2a041e8cfc84c3801f0988e7ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
Subject: Add support for gwt
From: Michael Olbrich <m.olbrich@pengutronix.de>
  Produce code for all gwt widgets.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
 src/writers/Makefile.am   |    1 
 src/writers/WriterBase.cc |    9 +++--
 src/writers/WriterBase.hh |    3 +
 src/writers/gwt.cc        |   80 ++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 89 insertions(+), 4 deletions(-)

Index: b/src/writers/gwt.cc
===================================================================
--- /dev/null
+++ b/src/writers/gwt.cc
@@ -0,0 +1,80 @@
+// $Id: gwt.cc,v 1.14 2002/05/14 08:25:44 christof Exp $
+/*  glade--: C++ frontend for glade (Gtk+ User Interface Builder)
+ *  Copyright (C) 1998  Christof Petig
+ *  Copyright (C) 1999-2000  Adolf Petig GmbH & Co. KG, written by Christof Petig
+ *
+ *  This program 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.
+ *
+ *  This program 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 this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "drawingarea.hh"
+
+class Gwt_PlotCanvas : public Gtk_DrawingArea
+{public:
+	typedef Gtk_DrawingArea Parent;
+	virtual const std::string TypeName(const Widget &w) const;
+	virtual const std::string IncludeName(const Widget &w) const;
+	Gwt_PlotCanvas();
+	virtual bool NeedExplicitCtor(const Widget &w) const
+	{  return false; }
+	virtual void ConstructionArgs(Widget const &w, CxxFile &f) const
+	{  f.FunctionArg(); }
+};
+
+static Gwt_PlotCanvas Gwt_PlotCanvas;
+
+const std::string Gwt_PlotCanvas::TypeName(const Widget &w) const
+{  return "Gwt::PlotCanvas";
+}
+
+const std::string Gwt_PlotCanvas::IncludeName(const Widget &w) const
+{  return "gwtmm/gwtmm.h";
+}
+
+Gwt_PlotCanvas::Gwt_PlotCanvas()
+{  Writer["GwtPlotCanvas"]=this;
+}
+
+class Gwt_PlotScale : public Gtk_DrawingArea
+{public:
+	typedef Gtk_DrawingArea Parent;
+	virtual const std::string TypeName(const Widget &w) const;
+	virtual const std::string IncludeName(const Widget &w) const;
+	Gwt_PlotScale();
+	virtual void Configure(const Widget &w, CxxFile &f,const std::string &instance) const;
+	virtual bool NeedExplicitCtor(const Widget &w) const
+	{  return false; }
+	virtual void ConstructionArgs(Widget const &w, CxxFile &f) const
+	{  f.FunctionArg(); }
+};
+
+static Gwt_PlotScale Gwt_PlotScale;
+
+const std::string Gwt_PlotScale::TypeName(const Widget &w) const
+{  return "Gwt::PlotScale";
+}
+
+const std::string Gwt_PlotScale::IncludeName(const Widget &w) const
+{  return "gwtmm/gwtmm.h";
+}
+
+Gwt_PlotScale::Gwt_PlotScale()
+{  Writer["GwtPlotScale"]=this;
+}
+
+void Gwt_PlotScale::Configure(const Widget &w, CxxFile &f,const std::string &instance) const
+{  Parent::Configure(w,f,instance);
+   WriteEnumPropertyNS(w,f,instance, "scale_type", false, "type");
+}
+
Index: b/src/writers/Makefile.am
===================================================================
--- a/src/writers/Makefile.am
+++ b/src/writers/Makefile.am
@@ -25,6 +25,7 @@ noinst_HEADERS = WriterBase.hh adjustmen
 	togglebutton.hh toolitem.hh widget.hh window.hh safemap.hh 
 
 libwriters_a_SOURCES = WriterBase.cc WriterBase_matches.cc Class.cc \
+	gwt.cc \
 	accellabel.cc \
 	accelgroup.cc adjustment.cc alignment.cc arrow.cc \
 	aspectframe.cc bbox.cc bonobo_dock.cc bonobo_dockitem.cc \
Index: b/src/writers/WriterBase.cc
===================================================================
--- a/src/writers/WriterBase.cc
+++ b/src/writers/WriterBase.cc
@@ -322,15 +322,17 @@ void WriterBase::WriteTranslatableProper
    }
 }
 
-void WriterBase::WriteEnumPropertyNS(const Widget &w, CxxFile &f, const std::string &instance, const std::string &property, bool only_new)
-{  if (w.hasProperty(property))
+void WriterBase::WriteEnumPropertyNS(const Widget &w, CxxFile &f, const std::string &instance, const std::string &property,
+	bool only_new, std::string functname)
+{  if (functname.empty()) functname=property;
+   if (w.hasProperty(property))
    {  f.Statement() << instance;
       std::string val=Gtkmm2Namespace(w.getProperty(property));
       if (only_new && GTKMM2)
       	 f << "property_" << property << "().set_value(" 
       	 	<< val << ')';
       else
-         f << "set_" << property << '(' 
+         f << "set_" << functname << '(' 
          	<< val << ')';
    }
 }
@@ -436,6 +438,7 @@ std::string WriterBase::Gtkmm2Namespace(
    std::string res=s;
    replace_all(res,"GTK_","Gtk::");
    replace_all(res,"GDK_","Gdk::");
+   replace_all(res,"GWT_","Gwt::");
    return res;
 }
 
Index: b/src/writers/WriterBase.hh
===================================================================
--- a/src/writers/WriterBase.hh
+++ b/src/writers/WriterBase.hh
@@ -186,7 +186,8 @@ public: // for new property based code
 	static void WriteTranslatableProperty(const Widget &w, CxxFile &f, const std::string &instance, const std::string &property, bool only_new=false);
 	static void WriteBoolProperty(const Widget &w, CxxFile &f, const std::string &instance, const std::string &property, 
 		bool only_new=false, std::string functname="");
-	static void WriteEnumPropertyNS(const Widget &w, CxxFile &f, const std::string &instance, const std::string &property, bool only_new=false);
+	static void WriteEnumPropertyNS(const Widget &w, CxxFile &f, const std::string &instance, const std::string &property,
+		bool only_new=false, std::string functname="");
 	static void WriteIntProperty(const Widget &w, CxxFile &f, const std::string &instance, const std::string &property, 
 		bool only_new=false, std::string functname="");
 	static void WriteIntIntProperty(const Widget &w, CxxFile &f, const std::string &instance,