| 1 |
/* Copyright (C) 1998-2002 The gtkmm Development Team |
| 2 |
* |
| 3 |
* This library is free software; you can redistribute it and/or |
| 4 |
* modify it under the terms of the GNU Lesser General Public |
| 5 |
* License as published by the Free Software Foundation; either |
| 6 |
* version 2.1 of the License, or (at your option) any later version. |
| 7 |
* |
| 8 |
* This library is distributed in the hope that it will be useful, |
| 9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 |
* Lesser General Public License for more details. |
| 12 |
* |
| 13 |
* You should have received a copy of the GNU Lesser General Public |
| 14 |
* License along with this library; if not, see <https://www.gnu.org/licenses/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
#include <gtk/gtk.h> |
| 18 |
|
| 19 |
namespace Gtk |
| 20 |
{ |
| 21 |
|
| 22 |
|
| 23 |
void Entry::set_icon_from_pixbuf(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf, EntryIconPosition icon_pos) |
| 24 |
{ |
| 25 |
gtk_entry_set_icon_from_pixbuf(gobj(), ((GtkEntryIconPosition)(icon_pos)), Glib::unwrap(pixbuf)); |
| 26 |
} |
| 27 |
|
| 28 |
void Entry::set_icon_from_icon_name(const Glib::ustring& icon_name, EntryIconPosition icon_pos) |
| 29 |
{ |
| 30 |
gtk_entry_set_icon_from_icon_name(gobj(), ((GtkEntryIconPosition)(icon_pos)), icon_name.c_str()); |
| 31 |
} |
| 32 |
|
| 33 |
void Entry::set_icon_from_gicon(const Glib::RefPtr<Gio::Icon>& icon, EntryIconPosition icon_pos) |
| 34 |
{ |
| 35 |
gtk_entry_set_icon_from_gicon(gobj(), ((GtkEntryIconPosition)(icon_pos)), const_cast<GIcon*>(Glib::unwrap<Gio::Icon>(icon))); |
| 36 |
} |
| 37 |
|
| 38 |
void Entry::unset_icon(EntryIconPosition icon_pos) |
| 39 |
{ |
| 40 |
//We could use any one of these set_icon_from_* functions: |
| 41 |
gtk_entry_set_icon_from_pixbuf(gobj(), ((GtkEntryIconPosition)(icon_pos)), nullptr); |
| 42 |
} |
| 43 |
|
| 44 |
void Entry::set_icon_activatable(bool activatable, EntryIconPosition icon_pos) |
| 45 |
{ |
| 46 |
gtk_entry_set_icon_activatable(gobj(), ((GtkEntryIconPosition)(icon_pos)), static_cast<int>(activatable)); |
| 47 |
} |
| 48 |
|
| 49 |
void Entry::set_icon_tooltip_text(const Glib::ustring& tooltip, EntryIconPosition icon_pos) |
| 50 |
{ |
| 51 |
gtk_entry_set_icon_tooltip_text(gobj(), ((GtkEntryIconPosition)(icon_pos)), tooltip.c_str()); |
| 52 |
} |
| 53 |
|
| 54 |
void Entry::set_icon_tooltip_markup(const Glib::ustring& tooltip, EntryIconPosition icon_pos) |
| 55 |
{ |
| 56 |
gtk_entry_set_icon_tooltip_markup(gobj(), ((GtkEntryIconPosition)(icon_pos)), tooltip.c_str()); |
| 57 |
} |
| 58 |
|
| 59 |
void Entry::set_icon_drag_source(const Glib::RefPtr<TargetList>& target_list, Gdk::DragAction actions, EntryIconPosition icon_pos) |
| 60 |
{ |
| 61 |
gtk_entry_set_icon_drag_source(gobj(), ((GtkEntryIconPosition)(icon_pos)), const_cast<GtkTargetList*>(Glib::unwrap(target_list)), ((GdkDragAction)(actions))); |
| 62 |
} |
| 63 |
|
| 64 |
Gdk::Rectangle Entry::get_text_area() const |
| 65 |
{ |
| 66 |
Gdk::Rectangle result; |
| 67 |
gtk_entry_get_text_area(const_cast<GtkEntry*>(gobj()), result.gobj()); |
| 68 |
return result; |
| 69 |
} |
| 70 |
|
| 71 |
Gdk::Rectangle Entry::get_icon_area(EntryIconPosition icon_pos) const |
| 72 |
{ |
| 73 |
Gdk::Rectangle result; |
| 74 |
gtk_entry_get_icon_area(const_cast<GtkEntry*>(gobj()), (GtkEntryIconPosition)icon_pos, result.gobj()); |
| 75 |
return result; |
| 76 |
} |
| 77 |
|
| 78 |
} //namespace Gtk |