Install ardour as a binary, a script and a set of shared
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / messagedialog.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3 #include <gtkmm/messagedialog.h>
4 #include <gtkmm/private/messagedialog_p.h>
5
6 #include <gtk/gtktypebuiltins.h>
7 // -*- c++ -*-
8 /* $Id$ */
9
10 /* 
11  *
12  * Copyright 2002 The gtkmm Development Team
13  *
14  * This library is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU Library General Public
16  * License as published by the Free Software Foundation; either
17  * version 2 of the License, or (at your option) any later version.
18  *
19  * This library is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22  * Library General Public License for more details.
23  *
24  * You should have received a copy of the GNU Library General Public
25  * License along with this library; if not, write to the Free
26  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27  */
28
29 #include <gtk/gtkmessagedialog.h>
30 #include <gtk/gtklabel.h>
31
32
33 namespace Gtk
34 {
35
36 MessageDialog::MessageDialog(const Glib::ustring& message, bool use_markup,
37                              MessageType type, ButtonsType buttons,
38                              bool modal)
39 :
40   Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
41   Gtk::Dialog(Glib::ConstructParams(messagedialog_class_.init(), "message_type",(GtkMessageType)type,"buttons",(GtkButtonsType)buttons, (char*) 0))
42 {
43   set_modal(modal);
44   set_message(message, use_markup);
45 }
46
47 MessageDialog::MessageDialog(Gtk::Window& parent, const Glib::ustring& message, bool use_markup,
48                              MessageType type, ButtonsType buttons,
49                              bool modal)
50 :
51   Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
52   Gtk::Dialog(Glib::ConstructParams(messagedialog_class_.init(), "message_type",(GtkMessageType)type,"buttons",(GtkButtonsType)buttons, (char*) 0))
53 {
54   set_modal(modal);
55   set_transient_for(parent);
56   set_message(message, use_markup);
57 }
58
59 void MessageDialog::set_message(const Glib::ustring& message, bool use_markup)
60 {
61   // TODO: GTK+ bug: The label widget is really a <private> struct field.
62   // There should really be a message property.
63
64   if(use_markup)
65     gtk_message_dialog_set_markup(gobj(), message.c_str()); 
66   else
67     gtk_label_set_text(GTK_LABEL(gobj()->label), message.c_str());
68 }
69
70 void MessageDialog::set_secondary_text(const Glib::ustring& text, bool use_markup)
71 {
72   if(use_markup)
73     gtk_message_dialog_format_secondary_markup(gobj(), text.c_str());
74   else
75     gtk_message_dialog_format_secondary_text(gobj(), text.c_str());
76 }
77
78 } // namespace Gtk
79
80
81 namespace
82 {
83 } // anonymous namespace
84
85 // static
86 GType Glib::Value<Gtk::MessageType>::value_type()
87 {
88   return gtk_message_type_get_type();
89 }
90
91 // static
92 GType Glib::Value<Gtk::ButtonsType>::value_type()
93 {
94   return gtk_buttons_type_get_type();
95 }
96
97
98 namespace Glib
99 {
100
101 Gtk::MessageDialog* wrap(GtkMessageDialog* object, bool take_copy)
102 {
103   return dynamic_cast<Gtk::MessageDialog *> (Glib::wrap_auto ((GObject*)(object), take_copy));
104 }
105
106 } /* namespace Glib */
107
108 namespace Gtk
109 {
110
111
112 /* The *_Class implementation: */
113
114 const Glib::Class& MessageDialog_Class::init()
115 {
116   if(!gtype_) // create the GType if necessary
117   {
118     // Glib::Class has to know the class init function to clone custom types.
119     class_init_func_ = &MessageDialog_Class::class_init_function;
120
121     // This is actually just optimized away, apparently with no harm.
122     // Make sure that the parent type has been created.
123     //CppClassParent::CppObjectType::get_type();
124
125     // Create the wrapper type, with the same class/instance size as the base type.
126     register_derived_type(gtk_message_dialog_get_type());
127
128     // Add derived versions of interfaces, if the C type implements any interfaces:
129   }
130
131   return *this;
132 }
133
134 void MessageDialog_Class::class_init_function(void* g_class, void* class_data)
135 {
136   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
137   CppClassParent::class_init_function(klass, class_data);
138
139 }
140
141
142 Glib::ObjectBase* MessageDialog_Class::wrap_new(GObject* o)
143 {
144   return new MessageDialog((GtkMessageDialog*)(o)); //top-level windows can not be manage()ed.
145
146 }
147
148
149 /* The implementation: */
150
151 MessageDialog::MessageDialog(const Glib::ConstructParams& construct_params)
152 :
153   Gtk::Dialog(construct_params)
154 {
155   }
156
157 MessageDialog::MessageDialog(GtkMessageDialog* castitem)
158 :
159   Gtk::Dialog((GtkDialog*)(castitem))
160 {
161   }
162
163 MessageDialog::~MessageDialog()
164 {
165   destroy_();
166 }
167
168 MessageDialog::CppClassType MessageDialog::messagedialog_class_; // initialize static member
169
170 GType MessageDialog::get_type()
171 {
172   return messagedialog_class_.init().get_type();
173 }
174
175 GType MessageDialog::get_base_type()
176 {
177   return gtk_message_dialog_get_type();
178 }
179
180
181 void MessageDialog::set_markup(const Glib::ustring& str)
182 {
183   gtk_message_dialog_set_markup(gobj(), str.c_str());
184 }
185
186
187 } // namespace Gtk
188
189