Ardour  9.0-pre0-582-g084a23a80d
targetentry.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 #ifndef _GTKMM_TARGETENTRY_H
3 #define _GTKMM_TARGETENTRY_H
4 
5 /* $Id$ */
6 
7 /* targetentry.h
8  *
9  * Copyright (C) 2002 The gtkmm Development Team
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with this library; if not, write to the Free
23  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  */
25 
26 #include <glibmm/utility.h>
27 #include <glibmm/ustring.h>
28 #include <glibmm/arrayhandle.h>
29 #include <gtkmm/enums.h>
30 #include <gtk/gtk.h> //For GtkTargetEntry.
31 
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 extern "C"
34 {
35  typedef struct _GtkTargetEntry GtkTargetEntry;
36 }
37 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
38 
39 namespace Gtk
40 {
41 
43 {
44 public:
46  explicit TargetEntry(const Glib::ustring& target, Gtk::TargetFlags flags = Gtk::TargetFlags(0), guint info = 0);
47  explicit TargetEntry(const GtkTargetEntry& gobject);
48  TargetEntry(const TargetEntry& src);
49  virtual ~TargetEntry();
50 
52 
53  Glib::ustring get_target() const;
54  void set_target(const Glib::ustring& target);
55 
58 
59  guint get_info() const;
60  void set_info(guint info);
61 
62  //Use this when you have to use an array of GdkTargetEntrys
63  //This TargetEntry will still own the string memory.
65  const GtkTargetEntry* gobj() const;
66 
67 protected:
69 };
70 
71 #ifndef DOXYGEN_SHOULD_SKIP_THIS
72 struct TargetEntry_Traits
73 {
74  typedef TargetEntry CppType;
75  typedef GtkTargetEntry CType;
76  typedef GtkTargetEntry CTypeNonConst;
77 
78  static const CType& to_c_type(const CppType& item)
79  { return *item.gobj(); }
80 
81  static const CType& to_c_type(const CType& item)
82  { return item; }
83 
84  static CppType to_cpp_type(const CType& item)
85  { return TargetEntry(item); /* copies string */}
86 
87  static void release_c_type(const CType&) {}
88 };
89 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
90 
91 typedef Glib::ArrayHandle< TargetEntry, TargetEntry_Traits > ArrayHandle_TargetEntry;
92 
93 } /* namespace Gtk */
94 
95 
96 #endif /* _GTKMM_TARGETENTRY_H */
97 
Glib::ustring get_target() const
virtual ~TargetEntry()
TargetEntry(const Glib::ustring &target, Gtk::TargetFlags flags=Gtk::TargetFlags(0), guint info=0)
void set_flags(Gtk::TargetFlags flags)
guint get_info() const
void set_target(const Glib::ustring &target)
const GtkTargetEntry * gobj() const
Gtk::TargetFlags get_flags() const
GtkTargetEntry gobject_
Definition: targetentry.h:68
void set_info(guint info)
GtkTargetEntry * gobj()
TargetEntry(const GtkTargetEntry &gobject)
TargetEntry & operator=(const TargetEntry &src)
TargetEntry(const TargetEntry &src)
Definition: ardour_ui.h:188
Glib::ArrayHandle< TargetEntry, TargetEntry_Traits > ArrayHandle_TargetEntry
Definition: targetentry.h:91
Transmitter info