1 // $Id: gnome_druidpagestart.cc,v 1.6 2002/11/04 11:31:03 christof Exp $
2 /* glade--: C++ frontend for glade (Gtk+ User Interface Builder)
3 * Copyright (C) 1998 Christof Petig
4 * Copyright (C) 1999-2000 Adolf Petig GmbH & Co. KG, written by Christof Petig
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
20
21 #include "gnome_druidpage.hh"
22
23 class Gnome_DruidPageStart : public Gnome_DruidPage
24 {public:
25 typedef Gnome_DruidPage Parent;
26 virtual const std::string TypeName(const Widget &w) const;
27 virtual const std::string IncludeName(const Widget &w) const;
28 Gnome_DruidPageStart();
29 virtual bool NeedExplicitCtor(const Widget &w) const;
push_stmt_list(void)30 virtual void ConstructionArgs(const Widget &w, CxxFile &f) const;
31 virtual void Configure(const Widget &w, CxxFile &f,const std::string &instance) const;
32 };
33
34 static Gnome_DruidPageStart Gnome_DruidPageStart;
35
36 const std::string Gnome_DruidPageStart::TypeName(const Widget &w) const
37 { return GnomeUIPrefix()+"DruidPageStart";
38 }
39
40 const std::string Gnome_DruidPageStart::IncludeName(const Widget &w) const
only_debug_stmts_after_p(tree_stmt_iterator i)41 { return Configuration.GnomeUImmIncludePath()+"druid-page-start.h";
42 }
43
44 Gnome_DruidPageStart::Gnome_DruidPageStart()
45 { Writer["GnomeDruidPageStart"]=this;
46 }
47
48 void Gnome_DruidPageStart::ConstructionArgs(const Widget &w, CxxFile &f) const
49 { f.FunctionArg();
50 }
51
pop_stmt_list(tree t)52 bool Gnome_DruidPageStart::NeedExplicitCtor(const Widget &w) const
53 { return false; }
54
55 void Gnome_DruidPageStart::Configure(const Widget &w, CxxFile &f,const std::string &instance) const
56 { Parent::Configure(w,f,instance);
57 const std::string text_color(w.getProperty("text_color"));
58 const std::string textbox_color(w.getProperty("textbox_color"));
59 const std::string watermark_image(w.getProperty("watermark_image"));
60 const std::string text(w.getProperty("text"));
61
62 if (!text_color.empty())
63 f.Statement() << instance << "set_text_color(" << PushColor(text_color) << ')';
64 if (!textbox_color.empty())
65 f.Statement() << instance << "set_textbox_color(" << PushColor(textbox_color) << ')';
66 if (!watermark_image.empty())
67 f.Statement() << instance << "set_watermark(Gdk_Imlib::Image(" << Configuration.CString_WithQuotes(watermark_image) << "))";
68 if (!text.empty())
69 f.Statement() << instance << "set_text(" << Configuration.Translatable(text) << ')';
70 }
71