Updated libglibmm2 to glibmm-2.12.5
[ardour.git] / libs / glibmm2 / glibmm / optionentry.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3
4 #include <glibmm/optionentry.h>
5 #include <glibmm/private/optionentry_p.h>
6
7 // -*- c++ -*-
8 /* $Id$ */
9
10 /* Copyright (C) 2002 The gtkmm Development Team
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Library General Public
14  * License as published by the Free Software Foundation; either
15  * version 2 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  * Library General Public License for more details.
21  *
22  * You should have received a copy of the GNU Library General Public
23  * License along with this library; if not, write to the Free
24  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25  */
26
27 #include <glibmm/utility.h>
28 #include <glib/goption.h>
29 #include <glib/gmem.h>
30
31 namespace Glib
32 {
33
34 OptionEntry::OptionEntry()
35 {
36   gobject_ = g_new0(GOptionEntry, 1);
37 }
38
39 OptionEntry::~OptionEntry()
40 {
41   g_free(const_cast<char*>(gobject_->long_name));  
42   g_free(const_cast<char*>(gobject_->description));
43   g_free(const_cast<char*>(gobject_->arg_description));
44   g_free(gobject_);  
45 }
46
47 OptionEntry::OptionEntry(const OptionEntry& src)
48 {
49   gobject_ = g_new0(GOptionEntry, 1);
50
51   operator=(src);
52 }
53
54 OptionEntry& OptionEntry::operator=(const OptionEntry& src)
55 {
56   if(this != &src)
57   {
58     if(gobject_->long_name)
59       g_free(const_cast<char*>(gobject_->long_name));
60
61     gobject_->long_name = g_strdup(src.gobject_->long_name);
62
63     gobject_->short_name = src.gobject_->short_name; //It's just one char.
64
65     gobject_->flags = src.gobject_->flags;
66     gobject_->arg = src.gobject_->arg;
67     gobject_->arg_data = src.gobject_->arg_data; //Shared, because it's not owned by any instance of this class anyway.
68
69     if(gobject_->description)
70       g_free(const_cast<char*>(gobject_->description));    
71
72     gobject_->description = g_strdup(src.gobject_->description);
73
74     if(gobject_->arg_description)
75       g_free(const_cast<char*>(gobject_->arg_description));
76
77     gobject_->arg_description = g_strdup(src.gobject_->arg_description);
78   }
79
80   return *this;
81 }
82
83
84 } // namespace Glib
85
86
87 namespace
88 {
89 } // anonymous namespace
90
91
92 namespace Glib
93 {
94
95
96  Glib::ustring OptionEntry::get_long_name() const
97 {
98   return Glib::convert_const_gchar_ptr_to_ustring(gobj()->long_name);
99 }
100  
101  void OptionEntry::set_long_name(const Glib::ustring& value)
102 {
103   gobj()->long_name = g_strdup((value).c_str());
104 }
105  
106  gchar OptionEntry::get_short_name() const
107 {
108   return gobj()->short_name;
109 }
110  
111  void OptionEntry::set_short_name(const gchar& value)
112 {
113   gobj()->short_name = value;
114 }
115  
116  int OptionEntry::get_flags() const
117 {
118   return gobj()->flags;
119 }
120  
121  void OptionEntry::set_flags(const int& value)
122 {
123   gobj()->flags = value;
124 }
125  
126  Glib::ustring OptionEntry::get_description() const
127 {
128   return Glib::convert_const_gchar_ptr_to_ustring(gobj()->description);
129 }
130  
131  void OptionEntry::set_description(const Glib::ustring& value)
132 {
133   gobj()->description = g_strdup((value).c_str());
134 }
135  
136  Glib::ustring OptionEntry::get_arg_description() const
137 {
138   return Glib::convert_const_gchar_ptr_to_ustring(gobj()->arg_description);
139 }
140  
141  void OptionEntry::set_arg_description(const Glib::ustring& value)
142 {
143   gobj()->arg_description = g_strdup((value).c_str());
144 }
145  
146
147 } // namespace Glib
148
149