/* Copyright (C) 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, see .
*/
_DEFS(gtkmm,gtk)
#include
#include
#include
//#include
#include
_CC_INCLUDE(gtk/gtk.h)
namespace Gtk
{
class GTKMM_API TextBuffer;
class GTKMM_API TargetList final
{
//GtkTargetList is actually registered as a boxed type, but it has custom
//reference-counting instead of copy/free functions, so we use it via RefPtr.
_CLASS_OPAQUE_REFCOUNTED(TargetList, GtkTargetList, NONE, gtk_target_list_ref, gtk_target_list_unref, GTKMM_API)
_IGNORE(gtk_target_list_ref, gtk_target_list_unref)
public:
static Glib::RefPtr create(const std::vector& targets);
#m4 _CONVERSION(`TargetFlags', `guint', `($2)($3)')
_WRAP_METHOD(void add(const Glib::ustring& target, TargetFlags flags = TargetFlags(0), guint info = 0), gtk_target_list_add)
void add(const std::vector& targets);
_IGNORE(gtk_target_list_add_table)
_WRAP_METHOD(void add_text_targets(guint info), gtk_target_list_add_text_targets)
_WRAP_METHOD(void add_rich_text_targets(guint info, bool deserializable, const Glib::RefPtr& buffer), gtk_target_list_add_rich_text_targets)
_WRAP_METHOD(void add_image_targets(guint info, bool writable), gtk_target_list_add_image_targets)
_WRAP_METHOD(void add_uri_targets(guint info), gtk_target_list_add_uri_targets)
_WRAP_METHOD(void remove(const Glib::ustring& target), gtk_target_list_remove)
_WRAP_METHOD(bool find(const Glib::ustring& target, guint* info) const, gtk_target_list_find)
};
} // namespace Gtk
namespace Glib
{
// This is needed so Glib::RefPtr can be used with
// Glib::Value and _WRAP_PROPERTY in TextBuffer.
template <>
class GTKMM_API Value< Glib::RefPtr > : public ValueBase_Boxed
{
public:
typedef Glib::RefPtr CppType;
typedef GtkTargetList* CType;
static GType value_type();
void set(const CppType& data);
CppType get() const;
};
} // namespace Glib