diff options
Diffstat (limited to 'patches/glademm-2.6.0/gwt-support.diff')
-rw-r--r-- | patches/glademm-2.6.0/gwt-support.diff | 156 |
1 files changed, 156 insertions, 0 deletions
diff --git a/patches/glademm-2.6.0/gwt-support.diff b/patches/glademm-2.6.0/gwt-support.diff new file mode 100644 index 000000000..17a4bcf7d --- /dev/null +++ b/patches/glademm-2.6.0/gwt-support.diff @@ -0,0 +1,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, |