~ubuntu-branches/ubuntu/precise/gtkmm3.0/precise

« back to all changes in this revision

Viewing changes to gtk/gtkmm/textattributes.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2011-06-17 00:12:44 UTC
  • Revision ID: james.westby@ubuntu.com-20110617001244-9hl5an15hiaaahi6
Tags: upstream-3.0.1
ImportĀ upstreamĀ versionĀ 3.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Generated by gtkmmproc -- DO NOT MODIFY!
 
2
 
 
3
 
 
4
#include <gtkmm/textattributes.h>
 
5
#include <gtkmm/private/textattributes_p.h>
 
6
 
 
7
// -*- c++ -*-
 
8
/* $Id: textattributes.ccg,v 1.1 2003/01/21 13:40:41 murrayc Exp $ */
 
9
 
 
10
/*
 
11
 *
 
12
 * Copyright 1998-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 Lesser General Public
 
16
 * License as published by the Free Software Foundation; either
 
17
 * version 2.1 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
 * Lesser General Public License for more details.
 
23
 *
 
24
 * You should have received a copy of the GNU Lesser 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/gtk.h>
 
30
 
 
31
 
 
32
namespace
 
33
{
 
34
} // anonymous namespace
 
35
 
 
36
 
 
37
namespace Glib
 
38
{
 
39
 
 
40
Gtk::TextAttributes wrap(GtkTextAttributes* object, bool take_copy)
 
41
{
 
42
  return Gtk::TextAttributes(object, take_copy);
 
43
}
 
44
 
 
45
} // namespace Glib
 
46
 
 
47
 
 
48
namespace Gtk
 
49
{
 
50
 
 
51
 
 
52
// static
 
53
GType TextAttributes::get_type()
 
54
{
 
55
  return gtk_text_attributes_get_type();
 
56
}
 
57
 
 
58
TextAttributes::TextAttributes()
 
59
:
 
60
  gobject_ (gtk_text_attributes_new())
 
61
{}
 
62
 
 
63
TextAttributes::TextAttributes(const TextAttributes& other)
 
64
:
 
65
  gobject_ ((other.gobject_) ? gtk_text_attributes_copy(other.gobject_) : 0)
 
66
{}
 
67
 
 
68
TextAttributes::TextAttributes(GtkTextAttributes* gobject, bool make_a_copy)
 
69
:
 
70
  // For BoxedType wrappers, make_a_copy is true by default.  The static
 
71
  // BoxedType wrappers must always take a copy, thus make_a_copy = true
 
72
  // ensures identical behaviour if the default argument is used.
 
73
  gobject_ ((make_a_copy && gobject) ? gtk_text_attributes_copy(gobject) : gobject)
 
74
{}
 
75
 
 
76
TextAttributes& TextAttributes::operator=(const TextAttributes& other)
 
77
{
 
78
  TextAttributes temp (other);
 
79
  swap(temp);
 
80
  return *this;
 
81
}
 
82
 
 
83
TextAttributes::~TextAttributes()
 
84
{
 
85
  if(gobject_)
 
86
    gtk_text_attributes_unref(gobject_);
 
87
}
 
88
 
 
89
void TextAttributes::swap(TextAttributes& other)
 
90
{
 
91
  GtkTextAttributes *const temp = gobject_;
 
92
  gobject_ = other.gobject_;
 
93
  other.gobject_ = temp;
 
94
}
 
95
 
 
96
GtkTextAttributes* TextAttributes::gobj_copy() const
 
97
{
 
98
  return gtk_text_attributes_copy(gobject_);
 
99
}
 
100
 
 
101
 
 
102
} // namespace Gtk
 
103
 
 
104