Debian Codegraph @

gtk/src/targetlist.ccg

raw
1 /* Copyright (C) 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 <glibmm/vectorutils.h>
18 #include <gtkmm/textbuffer.h>
19
20 namespace Gtk
21 {
22
23 Glib::RefPtr<Gtk::TargetList> TargetList::create(const std::vector<TargetEntry>& targets)
24 {
25 return Glib::wrap(gtk_target_list_new(Glib::ArrayHandler<TargetEntry, TargetEntryTraits>::vector_to_array(targets).data(), targets.size()));
26 }
27
28 void TargetList::add(const std::vector<TargetEntry>& targets)
29 {
30 gtk_target_list_add_table(gobj(), Glib::ArrayHandler<TargetEntry, TargetEntryTraits>::vector_to_array(targets).data(), targets.size());
31 }
32
33 } // namespace Gtk
34
35 namespace Glib
36 {
37
38 GType Value<RefPtr<Gtk::TargetList> >::value_type()
39 {
40 return gtk_target_list_get_type();
41 }
42
43 void Value<RefPtr<Gtk::TargetList> >::set(const CppType& data)
44 {
45 set_boxed(Glib::unwrap(data));
46 }
47
48 Value<RefPtr<Gtk::TargetList> >::CppType Value<RefPtr<Gtk::TargetList> >::get() const
49 {
50 return Glib::wrap(static_cast<CType>(get_boxed()), true);
51 }
52
53 } // namespace Glib