1 // $Id: gnome_druid.cc,v 1.7 2003/04/24 08:20:41 christof Exp $
2 /* glade--: C++ frontend for glade (Gtk+ User Interface Builder)
3 * Copyright (C) 2001 Adolf Petig GmbH & Co. KG, written by Christof Petig
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */
19
20 #include "container.hh"
21
22 class Gnome_Druid : public Gtk_Container
23 {public:
24 typedef Gtk_Container Parent;
25 virtual const std::string TypeName(const Widget &w) const;
26 virtual const std::string IncludeName(const Widget &w) const;
27 // virtual Subwidget IsSubwidget(const Widget &parent,const Widget &w2) const;
28 void Configure(const Widget &w, CxxFile &f,const std::string &instance) const;
29 Gnome_Druid();
30 virtual void AddChild(const Widget &w,CxxFile &f,const std::string &instance) const;
NeedExplicitCtor(const Widget & w) const31 virtual bool NeedExplicitCtor(const Widget &w) const
32 { return false; }
ConstructionArgs(Widget const & w,CxxFile & f) const33 virtual void ConstructionArgs(Widget const &w, CxxFile &f) const
34 { f.FunctionArg(); }
35 // virtual const std::string InternalInstance(const Widget &parent,const Widget &w2) const;
36 virtual bool isInternalMethod(const Widget &w,std::string &method,const std::string &args,std::string &scope,bool &is_signal) const;
37 };
38
39 static Gnome_Druid Gnome_Druid;
40
TypeName(const Widget & w) const41 const std::string Gnome_Druid::TypeName(const Widget &w) const
42 { return GnomeUIPrefix()+"Druid";
43 }
44
IncludeName(const Widget & w) const45 const std::string Gnome_Druid::IncludeName(const Widget &w) const
46 { return Configuration.GnomeUImmIncludePath()+"druid.h";
47 }
48
Gnome_Druid()49 Gnome_Druid::Gnome_Druid()
50 { Writer["GnomeDruid"]=this;
51 }
52
Configure(const Widget & w,CxxFile & f,const std::string & instance) const53 void Gnome_Druid::Configure(const Widget &w, CxxFile &f,const std::string &instance) const
54 { Parent::Configure(w,f,instance);
55
56 // set_buttons_sensitive
57 }
58
AddChild(const Widget & w,CxxFile & f,const std::string & instance) const59 void Gnome_Druid::AddChild(const Widget &w,CxxFile &f,const std::string &instance) const
60 { f.Statement() << instance << "pages().push_back(" << Reference(w) << ')';
61 }
62
isInternalMethod(const Widget & w,std::string & method,const std::string & args,std::string & scope,bool & is_signal) const63 bool Gnome_Druid::isInternalMethod(const Widget &w,std::string &method,const std::string &args,std::string &scope,bool &is_signal) const
64 { const char prefix[]="gnome_druid_";
65 const int plen(sizeof(prefix)-1);
66 if (method.substr(0,plen)==prefix) method=method.substr(plen);
67 if (method=="cancel" && args.empty())
68 { scope=Gnome_Druid::TypeName(w);
69 is_signal=true;
70 return true;
71 }
72 return Parent::isInternalMethod(w,method,args,scope,is_signal);
73 }
74
75