File: entry.ccg

package info (click to toggle)
gtkmm3.0 3.24.0-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 22,680 kB
  • sloc: xml: 121,333; cpp: 8,531; sh: 4,250; makefile: 262; perl: 236
file content (80 lines) | stat: -rw-r--r-- 2,968 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
 * Copyright 1998-2002 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include <gtk/gtk.h>

namespace Gtk
{


void Entry::set_icon_from_pixbuf(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf, EntryIconPosition icon_pos)
{
  gtk_entry_set_icon_from_pixbuf(gobj(), ((GtkEntryIconPosition)(icon_pos)), Glib::unwrap(pixbuf));
}

void Entry::set_icon_from_icon_name(const Glib::ustring& icon_name, EntryIconPosition icon_pos)
{
  gtk_entry_set_icon_from_icon_name(gobj(), ((GtkEntryIconPosition)(icon_pos)), icon_name.c_str());
}

void Entry::set_icon_from_gicon(const Glib::RefPtr<Gio::Icon>& icon, EntryIconPosition icon_pos)
{
  gtk_entry_set_icon_from_gicon(gobj(), ((GtkEntryIconPosition)(icon_pos)), const_cast<GIcon*>(Glib::unwrap<Gio::Icon>(icon)));
}

void Entry::unset_icon(EntryIconPosition icon_pos)
{
  //We could use any one of these set_icon_from_* functions:
  gtk_entry_set_icon_from_pixbuf(gobj(), ((GtkEntryIconPosition)(icon_pos)), nullptr);
}

void Entry::set_icon_activatable(bool activatable, EntryIconPosition icon_pos)
{
  gtk_entry_set_icon_activatable(gobj(), ((GtkEntryIconPosition)(icon_pos)), static_cast<int>(activatable));
}

void Entry::set_icon_tooltip_text(const Glib::ustring& tooltip, EntryIconPosition icon_pos)
{
  gtk_entry_set_icon_tooltip_text(gobj(), ((GtkEntryIconPosition)(icon_pos)), tooltip.c_str());
}

void Entry::set_icon_tooltip_markup(const Glib::ustring& tooltip, EntryIconPosition icon_pos)
{
  gtk_entry_set_icon_tooltip_markup(gobj(), ((GtkEntryIconPosition)(icon_pos)), tooltip.c_str());
}

void Entry::set_icon_drag_source(const Glib::RefPtr<TargetList>& target_list, Gdk::DragAction actions, EntryIconPosition icon_pos)
{
  gtk_entry_set_icon_drag_source(gobj(), ((GtkEntryIconPosition)(icon_pos)), const_cast<GtkTargetList*>(Glib::unwrap(target_list)), ((GdkDragAction)(actions)));
}

Gdk::Rectangle Entry::get_text_area() const
{
  Gdk::Rectangle result;
  gtk_entry_get_text_area(const_cast<GtkEntry*>(gobj()), result.gobj());
  return result;
}

Gdk::Rectangle Entry::get_icon_area(EntryIconPosition icon_pos) const
{
  Gdk::Rectangle result;
  gtk_entry_get_icon_area(const_cast<GtkEntry*>(gobj()), (GtkEntryIconPosition)icon_pos, result.gobj());
  return result;
}

} //namespace Gtk