[gtkmm] Update for the latest gtk+4 (Gdk::Clipboard)
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Update for the latest gtk+4 (Gdk::Clipboard)
- Date: Mon, 4 Dec 2017 10:12:20 +0000 (UTC)
commit 1b76efc5872376420bb9481e43c545eb43b54dff
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Mon Dec 4 11:08:39 2017 +0100
Update for the latest gtk+4 (Gdk::Clipboard)
Remove Gdk::DeviceManager.
Replace Gtk::Clipboard by Gdk::Clipboard.
Remove enum Gdk::OwnerChange and class Gdk::EventOwnerChange.
Remove enum Gdk::DragProtocol.
.gitignore | 6 +-
demos/gtk-demo/example_iconbrowser.cc | 4 +-
demos/gtk-demo/example_textview.cc | 14 +-
gdk/gdkmm.h | 2 +-
gdk/src/{devicemanager.ccg => clipboard.ccg} | 6 +-
gdk/src/clipboard.hg | 54 +++++
gdk/src/contentformats.hg | 22 +--
gdk/src/cursor.hg | 2 -
gdk/src/device.hg | 5 +-
gdk/src/devicemanager.hg | 136 -----------
gdk/src/display.ccg | 2 +-
gdk/src/display.hg | 9 +-
gdk/src/dragcontext.ccg | 10 -
gdk/src/dragcontext.hg | 9 -
gdk/src/enums.hg | 1 -
gdk/src/events.ccg | 14 --
gdk/src/events.hg | 46 ----
gdk/src/filelist.am | 2 +-
gdk/src/window.ccg | 18 --
gdk/src/window.hg | 16 --
gtk/src/application.hg | 1 -
gtk/src/cellrendererpixbuf.hg | 2 +-
gtk/src/cellview.ccg | 4 +-
gtk/src/cellview.hg | 10 +-
gtk/src/clipboard.ccg | 320 --------------------------
gtk/src/clipboard.hg | 319 -------------------------
gtk/src/filelist.am | 1 -
gtk/src/gesturemultipress.hg | 2 +
gtk/src/selectiondata.ccg | 3 -
gtk/src/selectiondata.hg | 10 +-
gtk/src/snapshot.hg | 2 -
gtk/src/stylecontext.hg | 2 +-
gtk/src/textbuffer.ccg | 129 +----------
gtk/src/textbuffer.hg | 117 ++--------
gtk/src/textiter.ccg | 2 +-
gtk/src/textiter.hg | 6 +-
gtk/src/tooltip.hg | 4 +-
gtk/src/widget.hg | 16 +-
tools/extra_defs_gen/generate_defs_gdk.cc | 3 +-
tools/extra_defs_gen/generate_defs_gtk.cc | 1 -
tools/m4/convert_gdk.m4 | 10 +-
tools/m4/convert_gtk.m4 | 7 +-
42 files changed, 144 insertions(+), 1205 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 1f94b0f..3266ff8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -51,6 +51,8 @@ demos/pixbuf-demo
gdk/gdkmm-*.pc
gdk/gdkmm/applaunchcontext.cc
gdk/gdkmm/applaunchcontext.h
+gdk/gdkmm/clipboard.cc
+gdk/gdkmm/clipboard.h
gdk/gdkmm/contentformats.cc
gdk/gdkmm/contentformats.h
gdk/gdkmm/contentformatsbuilder.cc
@@ -59,8 +61,6 @@ gdk/gdkmm/cursor.cc
gdk/gdkmm/cursor.h
gdk/gdkmm/device.cc
gdk/gdkmm/device.h
-gdk/gdkmm/devicemanager.cc
-gdk/gdkmm/devicemanager.h
gdk/gdkmm/display.cc
gdk/gdkmm/display.h
gdk/gdkmm/displaymanager.cc
@@ -191,8 +191,6 @@ gtk/gtkmm/checkbutton.cc
gtk/gtkmm/checkbutton.h
gtk/gtkmm/checkmenuitem.cc
gtk/gtkmm/checkmenuitem.h
-gtk/gtkmm/clipboard.cc
-gtk/gtkmm/clipboard.h
gtk/gtkmm/colorbutton.cc
gtk/gtkmm/colorbutton.h
gtk/gtkmm/colorchooser.cc
diff --git a/demos/gtk-demo/example_iconbrowser.cc b/demos/gtk-demo/example_iconbrowser.cc
index 57f19ef..f76d53b 100644
--- a/demos/gtk-demo/example_iconbrowser.cc
+++ b/demos/gtk-demo/example_iconbrowser.cc
@@ -230,7 +230,7 @@ Example_IconBrowser::Example_IconBrowser()
m_icon_view.pack_start(m_icon_cell);
m_icon_view.pack_start(m_text_cell);
m_icon_cell.set_padding(10, 10);
- m_icon_cell.property_stock_size() = static_cast<guint>(Gtk::IconSize::LARGE);
+ m_icon_cell.property_icon_size() = Gtk::IconSize::LARGE;
m_text_cell.set_padding(10, 10);
m_text_cell.set_alignment(0.5, 0.5);
@@ -940,7 +940,7 @@ void DetailDialog::set_image(
{
m_image[i].set_from_icon_name(icon_name);
m_image[i].set_pixel_size(m_icon_size[i]);
- m_image[i].drag_source_set_icon(get_icon(i));
+ m_image[i].drag_source_set_icon(icon_name);
}
if (description.empty())
m_description.hide();
diff --git a/demos/gtk-demo/example_textview.cc b/demos/gtk-demo/example_textview.cc
index 3159e31..1ef7585 100644
--- a/demos/gtk-demo/example_textview.cc
+++ b/demos/gtk-demo/example_textview.cc
@@ -168,12 +168,12 @@ void Example_TextView::create_tags(Glib::RefPtr<Gtk::TextBuffer>& refBuffer)
void Example_TextView::insert_text(Glib::RefPtr<Gtk::TextBuffer>& refBuffer)
{
- Glib::RefPtr<Gdk::Pixbuf> refPixbuf;
+ Glib::RefPtr<Gdk::Texture> refTexture;
try
{
- refPixbuf = Gdk::Pixbuf::create_from_resource("/textview/gtk-logo-rgb.gif");
+ auto refPixbuf = Gdk::Pixbuf::create_from_resource("/textview/gtk-logo-rgb.gif");
auto refScaled = refPixbuf->scale_simple(32, 32, Gdk::InterpType::BILINEAR);
- refPixbuf = refScaled;
+ refTexture = Gdk::Texture::create_for_pixbuf(refScaled);
}
catch (const Glib::Error& error)
{
@@ -238,11 +238,11 @@ void Example_TextView::insert_text(Glib::RefPtr<Gtk::TextBuffer>& refBuffer)
iter = refBuffer->insert_with_tag(iter, "Images. ", "heading");
iter = refBuffer->insert(iter, "The buffer can have images in it: ");
- if (refPixbuf)
+ if (refTexture)
{
- iter = refBuffer->insert_pixbuf(iter, refPixbuf);
- iter = refBuffer->insert_pixbuf(iter, refPixbuf);
- iter = refBuffer->insert_pixbuf(iter, refPixbuf);
+ iter = refBuffer->insert_texture(iter, refTexture);
+ iter = refBuffer->insert_texture(iter, refTexture);
+ iter = refBuffer->insert_texture(iter, refTexture);
}
iter = refBuffer->insert(iter, " for example.\n\n");
diff --git a/gdk/gdkmm.h b/gdk/gdkmm.h
index db3ea2a..7373527 100644
--- a/gdk/gdkmm.h
+++ b/gdk/gdkmm.h
@@ -28,6 +28,7 @@
#include <gdkmm/pixbufformat.h>
#include <gdkmm/pixbufloader.h>
#include <gdkmm/applaunchcontext.h>
+#include <gdkmm/clipboard.h>
#include <gdkmm/cursor.h>
#include <gdkmm/drawingcontext.h>
#include <gdkmm/events.h>
@@ -35,7 +36,6 @@
#include <gdkmm/rectangle.h>
#include <gdkmm/display.h>
#include <gdkmm/displaymanager.h>
-#include <gdkmm/devicemanager.h>
#include <gdkmm/seat.h>
#include <gdkmm/texture.h>
#include <gdkmm/monitor.h>
diff --git a/gdk/src/devicemanager.ccg b/gdk/src/clipboard.ccg
similarity index 71%
rename from gdk/src/devicemanager.ccg
rename to gdk/src/clipboard.ccg
index f06b3d5..0586bd2 100644
--- a/gdk/src/devicemanager.ccg
+++ b/gdk/src/clipboard.ccg
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010 The gtkmm Development Team
+/* Copyright (C) 2017 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
@@ -11,8 +11,6 @@
* 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
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <glibmm/vectorutils.h>
diff --git a/gdk/src/clipboard.hg b/gdk/src/clipboard.hg
new file mode 100644
index 0000000..0c7fc1b
--- /dev/null
+++ b/gdk/src/clipboard.hg
@@ -0,0 +1,54 @@
+/* Copyright (C) 2017 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 <http://www.gnu.org/licenses/>.
+ */
+
+#include <glibmm/object.h>
+#include <gdkmm/contentformats.h>
+#include <gdkmm/display.h>
+#include <gdkmm/texture.h>
+
+_DEFS(gdkmm,gdk)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Gdk
+{
+/** The %Clipboard object represents a clipboard of data shared between different processes
+ * or between different widgets in the same process.
+ *
+ * @newin{3,94}
+ */
+class Clipboard : public Glib::Object
+{
+ _CLASS_GOBJECT(Clipboard, GdkClipboard, GDK_CLIPBOARD, Glib::Object, GObject)
+
+public:
+ _WRAP_METHOD(Glib::RefPtr<Display> get_display(), gdk_clipboard_get_display, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const Display> get_display() const, gdk_clipboard_get_display, refreturn,
constversion)
+ _WRAP_METHOD(Glib::RefPtr<ContentFormats> get_formats(), gdk_clipboard_get_formats, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const ContentFormats> get_formats() const, gdk_clipboard_get_formats, refreturn,
constversion)
+ _WRAP_METHOD(bool is_local() const, gdk_clipboard_is_local)
+ //TODO: Add many more methods
+ _WRAP_METHOD(void set_text(const Glib::ustring& text), gdk_clipboard_set_text)
+ _WRAP_METHOD(void set_texture(const Glib::RefPtr<const Texture>& texture), gdk_clipboard_set_texture)
+
+ _WRAP_PROPERTY("display", Glib::RefPtr<Display>)
+ _WRAP_PROPERTY("formats", Glib::RefPtr<ContentFormats>)
+ _WRAP_PROPERTY("local", bool)
+ //TODO: _WRAP_PROPERTY("content", Glib::RefPtr<ContentProvider>)
+
+ // There are no public signals or vfuncs.
+};
+
+} // namespace Gdk
diff --git a/gdk/src/contentformats.hg b/gdk/src/contentformats.hg
index 871705a..6ca0391 100644
--- a/gdk/src/contentformats.hg
+++ b/gdk/src/contentformats.hg
@@ -129,23 +129,15 @@ public:
Glib::RefPtr<ContentFormats> join(const Glib::RefPtr<const ContentFormats>& second) const;
_IGNORE(gdk_content_formats_union)
-#m4 _INITIALIZATION(`GType&', `GType', `$3 = $4')
-#m4 _INITIALIZATION(`Glib::ustring&', `const char*', `$3 = Glib::convert_const_gchar_ptr_to_ustring($4)')
- /** Finds the first element from <tt>*this</tt> that is also contained
- * in @a second. If no matching format is found, <tt>false</tt> is returned
- * and @a out_gtype and @a out_mime_type are set to G_TYPE_INVALID and
- * an empty string respectively.
+ _WRAP_METHOD(bool match(const Glib::RefPtr<const ContentFormats>& second) const, gdk_content_formats_match)
+ _WRAP_METHOD(GType match_gtype(const Glib::RefPtr<const ContentFormats>& second) const,
gdk_content_formats_match_gtype)
+ /** Finds the first mime type from <tt>*this</tt> that is also contained in @a second.
+ * If no matching mime type is found, an empty string is returned.
*
- * @param second The %ContentFormats to intersect with.
- * @param[out] out_gtype Where to store the matching type,
- * or G_TYPE_INVALID if @a out_mime_type is set.
- * @param[out] out_mime_type The matching
- * mime type, or an empty string if @a out_gtype is set.
- * @return <tt>true</tt> if a matching format was found.
+ * @param second The Gdk::ContentFormats to intersect with.
+ * @return The first common mime type, or an empty string if none.
*/
- _WRAP_METHOD(bool match(const Glib::RefPtr<const ContentFormats>& second,
- GType& out_gtype{>>}, Glib::ustring& out_mime_type{>>}) const,
- gdk_content_formats_match)
+ _WRAP_METHOD(Glib::ustring match_mime_type(const Glib::RefPtr<const ContentFormats>& second) const,
gdk_content_formats_match_mime_type)
};
} // namespace Gdk
diff --git a/gdk/src/cursor.hg b/gdk/src/cursor.hg
index 6387860..b5e0b14 100644
--- a/gdk/src/cursor.hg
+++ b/gdk/src/cursor.hg
@@ -16,7 +16,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <gdkmm/pixbuf.h>
#include <gdkmm/texture.h>
_DEFS(gdkmm,gdk)
@@ -40,7 +39,6 @@ public:
//but constructors assume that they own the instance.
//And we would have to have to use the gdk_cursor_new_*() functions in the constructors anyway,
//because they do more than just call g_object_new().
- _WRAP_METHOD(static Glib::RefPtr<Cursor> create(const Glib::RefPtr<Pixbuf>& pixbuf, int x, int y, const
Glib::RefPtr<Cursor>& fallback = {}), gdk_cursor_new_from_pixbuf)
_WRAP_METHOD(static Glib::RefPtr<Cursor> create(const Glib::RefPtr<const Texture>& texture, int hotspot_x,
int hotspot_y, const Glib::RefPtr<Cursor>& fallback = {}), gdk_cursor_new_from_texture)
_WRAP_METHOD(static Glib::RefPtr<Cursor> create(const Glib::ustring& name, const Glib::RefPtr<Cursor>&
fallback = {}), gdk_cursor_new_from_name)
diff --git a/gdk/src/device.hg b/gdk/src/device.hg
index a4dabfd..9b7bd59 100644
--- a/gdk/src/device.hg
+++ b/gdk/src/device.hg
@@ -17,10 +17,10 @@
#include <vector>
-//#include <gdkmm/window.h>
#include <gdkmm/cursor.h>
#include <gdkmm/enums.h>
#include <gdkmm/timecoord.h>
+#include <gdkmm/types.h>
#include <gdk/gdk.h>
@@ -181,8 +181,7 @@ public:
// We use no_default_handler because _GdkDeviceClass is private.
_WRAP_SIGNAL(void changed(), "changed", no_default_handler, newin "3,22")
- //TODO: Wrap or ignore the "device-manager" and "tool" properties and the
- // "tool-changed" signal. GdkDeviceManager is not recommended for use in new code.
+ //TODO: Wrap or ignore the "tool" property and the "tool-changed" signal.
// GdkDeviceTool is not fully documented. It's not clear if it's meant to
// be used outside gtk+.
_WRAP_PROPERTY("display", Glib::RefPtr<Display>, newin "3,22")
diff --git a/gdk/src/display.ccg b/gdk/src/display.ccg
index 9a990ce..4d91882 100644
--- a/gdk/src/display.ccg
+++ b/gdk/src/display.ccg
@@ -19,7 +19,7 @@
#include <vector>
#include <gdkmm/applaunchcontext.h>
-#include <gdkmm/devicemanager.h>
+#include <gdkmm/clipboard.h>
#include <gdkmm/seat.h>
#include <gdkmm/monitor.h>
#include <gdkmm/window.h>
diff --git a/gdk/src/display.hg b/gdk/src/display.hg
index 6a0e5be..5731d53 100644
--- a/gdk/src/display.hg
+++ b/gdk/src/display.hg
@@ -30,8 +30,8 @@ namespace Gdk
_CC_INCLUDE(gdk/gdk.h)
+class Clipboard;
class Device;
-class DeviceManager;
class Seat;
class Monitor;
class Window;
@@ -104,6 +104,11 @@ public:
_WRAP_METHOD(bool supports_selection_notification() const, gdk_display_supports_selection_notification)
_WRAP_METHOD(bool request_selection_notification(const Glib::ustring& selection),
gdk_display_request_selection_notification)
+ _WRAP_METHOD(Glib::RefPtr<Clipboard> get_clipboard(), gdk_display_get_clipboard, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const Clipboard> get_clipboard() const, gdk_display_get_clipboard, refreturn,
constversion)
+ _WRAP_METHOD(Glib::RefPtr<Clipboard> get_primary_clipboard(), gdk_display_get_primary_clipboard, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const Clipboard> get_primary_clipboard() const,
gdk_display_get_primary_clipboard, refreturn, constversion)
+
_WRAP_METHOD(bool supports_clipboard_persistence() const, gdk_display_supports_clipboard_persistence)
/** Issues a request to the clipboard manager to store the clipboard data,
@@ -124,8 +129,6 @@ public:
_WRAP_METHOD(bool supports_input_shapes() const, gdk_display_supports_input_shapes)
_WRAP_METHOD(void notify_startup_complete(const Glib::ustring& startup_id),
gdk_display_notify_startup_complete)
- _IGNORE(gdk_display_get_device_manager)dnl//deprecated
-
#m4 _CONVERSION(`GdkAppLaunchContext*',`Glib::RefPtr<AppLaunchContext>', `Glib::wrap($3)')
#m4 _CONVERSION(`GdkAppLaunchContext*',`Glib::RefPtr<const AppLaunchContext>', `Glib::wrap($3)')
_WRAP_METHOD(Glib::RefPtr<AppLaunchContext> get_app_launch_context(), gdk_display_get_app_launch_context,
refreturn)
diff --git a/gdk/src/dragcontext.ccg b/gdk/src/dragcontext.ccg
index d540978..f33273c 100644
--- a/gdk/src/dragcontext.ccg
+++ b/gdk/src/dragcontext.ccg
@@ -27,16 +27,6 @@
namespace Gdk
{
-void DragContext::find_window(const Glib::RefPtr<Window>& drag_window,
- int x_root, int y_root, Glib::RefPtr<Window>& dest_window, DragProtocol& protocol) const
-{
- GdkWindow* cWindow = nullptr;
- GdkDragProtocol cprotocol = GDK_DRAG_PROTO_NONE; //arbitrary default.
- gdk_drag_find_window(const_cast<GdkDragContext*>(gobj()), drag_window->gobj(), x_root, y_root, &cWindow,
&cprotocol);
- dest_window = Glib::wrap(cWindow);
- protocol = (DragProtocol)cprotocol;
-}
-
void DragContext::drag_refuse(guint32 time)
{
gdk_drag_status(gobj(), ((GdkDragAction)(0)) /* see GDK docs */, time);
diff --git a/gdk/src/dragcontext.hg b/gdk/src/dragcontext.hg
index 34b3d2e..f71ac67 100644
--- a/gdk/src/dragcontext.hg
+++ b/gdk/src/dragcontext.hg
@@ -31,7 +31,6 @@ namespace Gdk
class ContentFormats;
_WRAP_ENUM(DragAction, GdkDragAction)
-_WRAP_ENUM(DragProtocol, GdkDragProtocol)
/** A Gdk::DragContext holds information about a drag in progress. It is used on both source and destination
sides.
*/
@@ -52,8 +51,6 @@ public:
*/
void drag_refuse(guint32 time);
- _IGNORE(gdk_drag_motion) //gdk_drag_motion is only used in GDK internally.
-
_WRAP_METHOD(void drop_reply(bool accepted, guint32 time), gdk_drop_reply)
_WRAP_METHOD(void drop_finish(bool success, guint32 time), gdk_drop_finish)
_WRAP_METHOD(Glib::ustring get_selection() const, gdk_drag_get_selection)
@@ -78,8 +75,6 @@ public:
_WRAP_METHOD(Glib::RefPtr<const Window> get_source_window() const, gdk_drag_context_get_source_window,
refreturn, constversion)
_WRAP_METHOD(Glib::RefPtr<Window> get_dest_window(), gdk_drag_context_get_dest_window, refreturn)
_WRAP_METHOD(Glib::RefPtr<const Window> get_dest_window() const, gdk_drag_context_get_dest_window,
refreturn, constversion)
- _WRAP_METHOD(DragProtocol get_protocol() const, gdk_drag_context_get_protocol)
-
_WRAP_METHOD(void set_device(const Glib::RefPtr<Device>& device), gdk_drag_context_set_device)
_WRAP_METHOD(Glib::RefPtr<Device> get_device(), gdk_drag_context_get_device, refreturn)
@@ -91,10 +86,6 @@ public:
_WRAP_METHOD(DragAction get_actions() const, gdk_drag_context_get_actions)
_WRAP_METHOD(DragAction get_suggested_action() const, gdk_drag_context_get_suggested_action)
_WRAP_METHOD(DragAction get_selected_action() const, gdk_drag_context_get_selected_action)
-
- _WRAP_METHOD_DOCS_ONLY(gdk_drag_find_window)
- void find_window(const Glib::RefPtr<Window>& drag_window, int x_root, int y_root, Glib::RefPtr<Window>&
dest_window, DragProtocol& protocol) const;
- _IGNORE(gdk_drag_find_window)
};
} // namespace Gdk
diff --git a/gdk/src/enums.hg b/gdk/src/enums.hg
index 3a489b4..38e5271 100644
--- a/gdk/src/enums.hg
+++ b/gdk/src/enums.hg
@@ -37,7 +37,6 @@ _WRAP_ENUM(AxisUse, GdkAxisUse)
_WRAP_ENUM(CrossingMode, GdkCrossingMode)
//_WRAP_ENUM(FilterReturn, GdkFilterReturn)
_WRAP_ENUM(NotifyType, GdkNotifyType)
-_WRAP_ENUM(OwnerChange, GdkOwnerChange)
_WRAP_ENUM(PropertyState, GdkPropertyState)
_WRAP_ENUM(ScrollDirection, GdkScrollDirection)
// GdkEventVisibility is deprecated and not wrapped in gtkmm.
diff --git a/gdk/src/events.ccg b/gdk/src/events.ccg
index cc7f181..1660ab2 100644
--- a/gdk/src/events.ccg
+++ b/gdk/src/events.ccg
@@ -368,20 +368,6 @@ Glib::RefPtr<const Gdk::Window> EventSelection::get_selection_property(GdkAtom&
return const_cast<EventSelection*>(this)->get_selection_property(property, target);
}
-// *** EventOwnerChange ***
-
-guint32 EventOwnerChange::get_time() const
-{
- return gdk_event_get_time(Event::gobj());
-}
-
-GdkAtom EventOwnerChange::get_selection() const
-{
- GdkAtom selection = nullptr;
- gdk_event_get_selection(Event::gobj(), &selection);
- return selection;
-}
-
// *** EventDND ***
guint32 EventDND::get_time() const
diff --git a/gdk/src/events.hg b/gdk/src/events.hg
index 851bb99..bbd6c8a 100644
--- a/gdk/src/events.hg
+++ b/gdk/src/events.hg
@@ -553,52 +553,6 @@ public:
_IGNORE(gdk_event_get_selection_property)
};
-/** Rarely used event. Generated when the owner of a selection changes. On X11,
- * this information is only available if the X server supports the XFIXES
- * extension.
- *
- * get_event_type() will return Gdk::Event::Type::OWNER_CHANGE.
- *
- * @newin{3,90}
- */
-class EventOwnerChange : public Event
-{
- _CLASS_GDKEVENT(EventOwnerChange, GdkEventOwnerChange, Event, GdkEvent)
-
-public:
-
- /**
- * Returns the timestamp of the event in milliseconds.
- */
- guint32 get_time() const;
-
- /*
- * Returns the time at which the ownership changed.
- */
- //guint32 get_selection_time() const; //TODO: Remove? There is no corresponding gtk+ function.
-
- /**
- * Returns the atom identifying the selection.
- */
- GdkAtom get_selection() const;
-
- /*
- * Returns the reason of the ownership change.
- */
- //OwnerChange get_reason() const; //TODO: Remove? There is no corresponding gtk+ function.
-
- /*
- * @returns The window which is the new owner of the selection, or
- * Glib::RefPtr<Gdk::Window>(nullptr) if there is none.
- */
- //Glib::RefPtr<Gdk::Window> get_owner(); //TODO: Remove? There is no corresponding gtk+ function.
- /*
- * @returns The window which is the new owner of the selection, or
- * Glib::RefPtr<const Gdk::Window>(nullptr) if there is none.
- */
- //Glib::RefPtr<const Gdk::Window> get_owner() const; //TODO: Remove? There is no corresponding gtk+
function.
-};
-
/** Generated during Drag-and-Drop (DND) operations.
*
* get_event_type() will return one of Gdk::Event::Type::DRAG_ENTER,
diff --git a/gdk/src/filelist.am b/gdk/src/filelist.am
index e4a092b..4b406ea 100644
--- a/gdk/src/filelist.am
+++ b/gdk/src/filelist.am
@@ -14,11 +14,11 @@ gdkmm_files_defs = \
gdkmm_files_any_hg = \
applaunchcontext.hg \
+ clipboard.hg \
contentformats.hg \
contentformatsbuilder.hg \
cursor.hg \
device.hg \
- devicemanager.hg \
display.hg \
displaymanager.hg \
dragcontext.hg \
diff --git a/gdk/src/window.ccg b/gdk/src/window.ccg
index 2fa5f51..a4a593c 100644
--- a/gdk/src/window.ccg
+++ b/gdk/src/window.ccg
@@ -57,22 +57,4 @@ void Window::restack(bool above)
gdk_window_restack(gobj(), nullptr, above);
}
-DragProtocol Window::get_drag_protocol(Glib::RefPtr<Window>& target) const
-{
- GdkWindow* window = nullptr;
- auto result = gdk_window_get_drag_protocol(
- const_cast<GdkWindow*>(gobj()),
- &window);
-
- target = Glib::wrap(window, true /* take ref */);
- return (DragProtocol)result;
-}
-
-DragProtocol Window::get_drag_protocol() const
-{
- return (DragProtocol)gdk_window_get_drag_protocol(
- const_cast<GdkWindow*>(gobj()),
- nullptr);
-}
-
} // namespace Gdk
diff --git a/gdk/src/window.hg b/gdk/src/window.hg
index a666e81..696d4a3 100644
--- a/gdk/src/window.hg
+++ b/gdk/src/window.hg
@@ -205,9 +205,6 @@ public:
_WRAP_METHOD(EventMask get_device_events(const Glib::RefPtr<const Device>& device) const,
gdk_window_get_device_events)
_WRAP_METHOD(void set_device_events(const Glib::RefPtr<Device>& device, EventMask event_mask),
gdk_window_set_device_events)
- _WRAP_METHOD(EventMask get_source_events(InputSource source) const, gdk_window_get_source_events)
- _WRAP_METHOD(void set_source_events(InputSource source, EventMask event_mask),
gdk_window_set_source_events)
-
#m4 _CONVERSION(`const
std::vector<Glib::RefPtr<Texture>>&',`GList*',`Glib::ListHandler<Glib::RefPtr<Texture>>::vector_to_list($3).data()')
_WRAP_METHOD(void set_icon_list(const std::vector<Glib::RefPtr<Texture>>& textures),
gdk_window_set_icon_list)
void unset_icon();
@@ -237,19 +234,6 @@ public:
_WRAP_METHOD(void unmaximize(), gdk_window_unmaximize)
_WRAP_METHOD(void register_dnd(), gdk_window_register_dnd)
- _WRAP_METHOD_DOCS_ONLY(gdk_window_get_drag_protocol)
- DragProtocol get_drag_protocol(Glib::RefPtr<Window>& target) const;
-
- /** Finds out the DND protocol supported by a window.
- *
- * @newin{3,0}
- *
- * @return The supported DND protocol.
- */
- DragProtocol get_drag_protocol() const;
-
- _IGNORE(gdk_window_get_drag_protocol)
-
_WRAP_METHOD(void begin_resize_drag(WindowEdge edge, int button, int root_x, int root_y, guint32
timestamp), gdk_window_begin_resize_drag)
_WRAP_METHOD(void resize_drag(WindowEdge edge, const Glib::RefPtr<Device>& device, int button, int root_x,
int root_y, guint32 timestamp), gdk_window_begin_resize_drag_for_device)
diff --git a/gtk/src/application.hg b/gtk/src/application.hg
index b275051..46bc884 100644
--- a/gtk/src/application.hg
+++ b/gtk/src/application.hg
@@ -250,7 +250,6 @@ public:
_WRAP_METHOD(guint inhibit(Window& window, InhibitFlags flags, const Glib::ustring& reason),
gtk_application_inhibit)
_WRAP_METHOD(void uninhibit(guint cookie), gtk_application_uninhibit)
- _WRAP_METHOD(bool is_inhibited(InhibitFlags flags) const, gtk_application_is_inhibited)
_WRAP_METHOD(Window* get_window_by_id(guint id), gtk_application_get_window_by_id, refreturn)
_WRAP_METHOD(const Window* get_window_by_id(guint id) const, gtk_application_get_window_by_id, refreturn,
constversion)
diff --git a/gtk/src/cellrendererpixbuf.hg b/gtk/src/cellrendererpixbuf.hg
index 631a46f..e589573 100644
--- a/gtk/src/cellrendererpixbuf.hg
+++ b/gtk/src/cellrendererpixbuf.hg
@@ -48,7 +48,7 @@ public:
_WRAP_PROPERTY("pixbuf", Glib::RefPtr<Gdk::Pixbuf>)
_WRAP_PROPERTY("pixbuf_expander_open", Glib::RefPtr<Gdk::Pixbuf>)
_WRAP_PROPERTY("pixbuf_expander_closed", Glib::RefPtr<Gdk::Pixbuf>)
- _WRAP_PROPERTY("stock_size", guint)
+ _WRAP_PROPERTY("icon_size", Gtk::IconSize)
_WRAP_PROPERTY("icon-name", Glib::ustring)
_WRAP_PROPERTY("gicon", Glib::RefPtr<Gio::Icon>)
_WRAP_PROPERTY("surface", Cairo::RefPtr<Cairo::Surface>)
diff --git a/gtk/src/cellview.ccg b/gtk/src/cellview.ccg
index 46655c4..6107f91 100644
--- a/gtk/src/cellview.ccg
+++ b/gtk/src/cellview.ccg
@@ -41,13 +41,13 @@ CellView::CellView(const Glib::ustring& text, bool use_markup)
pack_start(*cell);
}
-CellView::CellView(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)
+CellView::CellView(const Glib::RefPtr<Gdk::Texture>& texture)
:
_CONSTRUCT()
{
auto cell = Gtk::manage(new Gtk::CellRendererPixbuf());
- cell->property_pixbuf() = pixbuf;
+ cell->property_texture() = texture;
pack_start(*cell);
}
diff --git a/gtk/src/cellview.hg b/gtk/src/cellview.hg
index c227074..f82bb4e 100644
--- a/gtk/src/cellview.hg
+++ b/gtk/src/cellview.hg
@@ -26,7 +26,7 @@ _CONFIGINCLUDE(gtkmmconfig.h)
#include <gtkmm/cellarea.h>
#include <gtkmm/cellareacontext.h>
#include <gtkmm/orientable.h>
-#include <gdkmm/pixbuf.h>
+#include <gdkmm/texture.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/widget_p.h)
@@ -61,12 +61,12 @@ public:
explicit CellView(const Glib::ustring& text, bool use_markup = false);
_IGNORE(gtk_cell_view_new_with_text, gtk_cell_view_new_with_markup)
- /** Creates a new CellView widget, adds a CellRendererPixbuf to it, and makes it show the pixbuf.
+ /** Creates a new %CellView widget, adds a CellRendererPixbuf to it, and makes it show the texure.
*
- * @param pixbuf The image to display in the cell view
+ * @param texture The image to display in the cell view.
*/
- explicit CellView(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf);
- _IGNORE(gtk_cell_view_new_with_pixbuf)
+ explicit CellView(const Glib::RefPtr<Gdk::Texture>& texture);
+ _IGNORE(gtk_cell_view_new_with_texture)
_WRAP_METHOD(void set_model(const Glib::RefPtr<TreeModel>& model), gtk_cell_view_set_model)
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index 8b0f899..264ea18 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -51,7 +51,6 @@ gtkmm_files_any_hg = \
centerbox.hg \
checkbutton.hg \
checkmenuitem.hg \
- clipboard.hg \
colorbutton.hg \
colorchooser.hg \
colorchooserdialog.hg \
diff --git a/gtk/src/gesturemultipress.hg b/gtk/src/gesturemultipress.hg
index ce7213d..56264dd 100644
--- a/gtk/src/gesturemultipress.hg
+++ b/gtk/src/gesturemultipress.hg
@@ -76,6 +76,8 @@ public:
_WRAP_SIGNAL(void pressed(int n_press, double x, double y), "pressed", no_default_handler)
_WRAP_SIGNAL(void released(int n_press, double x, double y), "released", no_default_handler)
_WRAP_SIGNAL(void stopped(), "stopped", no_default_handler)
+ _WRAP_SIGNAL(void unpaired_release(double x, double y, guint button, Gdk::EventSequence* sequence),
+ "unpaired-release", no_default_handler)
// GestureMultiPress has no properties
};
diff --git a/gtk/src/selectiondata.ccg b/gtk/src/selectiondata.ccg
index 47d36e8..4acefc8 100644
--- a/gtk/src/selectiondata.ccg
+++ b/gtk/src/selectiondata.ccg
@@ -17,10 +17,7 @@
#include <glibmm/vectorutils.h>
-#include <gtkmm/textbuffer.h>
#include <gdkmm/cairoutils.h>
-#include <gdkmm/pixbuf.h>
-#include <glibmm/utility.h> //For make_unique_ptr_gfree<>.
#include <gtk/gtk.h>
namespace Gtk
diff --git a/gtk/src/selectiondata.hg b/gtk/src/selectiondata.hg
index ddd7878..8844ac1 100644
--- a/gtk/src/selectiondata.hg
+++ b/gtk/src/selectiondata.hg
@@ -21,14 +21,11 @@ _DEFS(gtkmm,gtk)
#include <gdkmm/display.h>
#include <gdkmm/pixbuf.h>
+#include <gdkmm/texture.h>
namespace Gtk
{
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-class TextBuffer;
-#endif //DOXYGEN_SHOULD_SKIP_THIS
-
class SelectionData
{
_CLASS_BOXEDTYPE(SelectionData, GtkSelectionData, NONE, gtk_selection_data_copy, gtk_selection_data_free)
@@ -90,6 +87,10 @@ public:
// get_surface() is const because it returns a newly allocated cairo surface.
_WRAP_METHOD(Cairo::RefPtr<Cairo::Surface> get_surface() const, gtk_selection_data_get_surface)
+ _WRAP_METHOD(bool set_texture(const Glib::RefPtr<Gdk::Texture>& texture), gtk_selection_data_set_texture)
+ // get_texture() is const because it returns a newly allocated texture.
+ _WRAP_METHOD(Glib::RefPtr<Gdk::Texture> get_texture() const, gtk_selection_data_get_texture)
+
dnl The constness of gtk_selection_data_set_uris() is not quite right:
#m4 _CONVERSION(`const
std::vector<Glib::ustring>&',`gchar**',`const_cast<char**>(Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data())')
_WRAP_METHOD(bool set_uris(const std::vector<Glib::ustring>& uris), gtk_selection_data_set_uris)
@@ -131,7 +132,6 @@ dnl The constness of gtk_selection_data_set_uris() is not quite right:
_WRAP_METHOD(bool targets_include_uri() const, gtk_selection_data_targets_include_uri)
_WRAP_METHOD(bool targets_include_text() const, gtk_selection_data_targets_include_text)
- _WRAP_METHOD(bool targets_include_rich_text(const Glib::RefPtr<TextBuffer>& buffer) const,
gtk_selection_data_targets_include_rich_text)
_WRAP_METHOD(bool targets_include_image(bool writable = true) const,
gtk_selection_data_targets_include_image)
};
diff --git a/gtk/src/snapshot.hg b/gtk/src/snapshot.hg
index 0ea6ef1..28b27ff 100644
--- a/gtk/src/snapshot.hg
+++ b/gtk/src/snapshot.hg
@@ -139,8 +139,6 @@ public:
_WRAP_METHOD(void render_insertion_cursor(const Glib::RefPtr<StyleContext>& context,
double x, double y, const Glib::RefPtr<Pango::Layout>& layout, int index,
Pango::Direction direction), gtk_snapshot_render_insertion_cursor)
- _WRAP_METHOD(void render_icon(const Glib::RefPtr<StyleContext>& context,
- const Glib::RefPtr<Gdk::Pixbuf>& pixbuf, double x, double y), gtk_snapshot_render_icon)
///Provides access to the underlying C instance.
GtkSnapshot* gobj();
diff --git a/gtk/src/stylecontext.hg b/gtk/src/stylecontext.hg
index dbb1df5..a95b3c4 100644
--- a/gtk/src/stylecontext.hg
+++ b/gtk/src/stylecontext.hg
@@ -196,7 +196,7 @@ public:
_WRAP_METHOD(void render_frame_gap(const Cairo::RefPtr<Cairo::Context>& cr, double x, double y, double
width, double height, PositionType gap_side, double xy0_gap, double xy1_gap), gtk_render_frame_gap)
_WRAP_METHOD(void render_handle(const Cairo::RefPtr<Cairo::Context>& cr, double x, double y, double width,
double height), gtk_render_handle)
_WRAP_METHOD(void render_activity(const Cairo::RefPtr<Cairo::Context>& cr, double x, double y, double
width, double height), gtk_render_activity)
- _WRAP_METHOD(void render_icon(const Cairo::RefPtr<Cairo::Context>& cr, const Glib::RefPtr<Gdk::Pixbuf>&
pixbuf, double x, double y), gtk_render_icon)
+ _WRAP_METHOD(void render_icon(const Cairo::RefPtr<Cairo::Context>& cr, const Glib::RefPtr<Gdk::Texture>&
texture, double x, double y), gtk_render_icon)
_WRAP_METHOD(void render_insertion_cursor(const Cairo::RefPtr<Cairo::Context>& cr, double x, double y,
const Glib::RefPtr<Pango::Layout>& layout, int index, Pango::Direction direction),
gtk_render_insertion_cursor)
_WRAP_SIGNAL(void changed(), "changed")
diff --git a/gtk/src/textbuffer.ccg b/gtk/src/textbuffer.ccg
index c7d2aa0..3913ece 100644
--- a/gtk/src/textbuffer.ccg
+++ b/gtk/src/textbuffer.ccg
@@ -22,69 +22,6 @@
#include <gtkmm/textmark.h>
#include <gtkmm/textiter.h>
-namespace // anonymous
-{
-extern "C"
-{
-
-static guint8* SignalProxy_Serialize(GtkTextBuffer* /* register_buffer */,
- GtkTextBuffer* content_buffer,
- const GtkTextIter* start, const GtkTextIter* end,
- gsize* length,
- gpointer user_data)
-{
- auto the_slot = static_cast<Gtk::TextBuffer::SlotSerialize*>(user_data);
-
- try
- {
- return (*the_slot)(Glib::wrap(content_buffer, true),
- Glib::wrap_const_iter(start), Glib::wrap_const_iter(end), *length);
- }
- catch (...)
- {
- Glib::exception_handlers_invoke();
- }
- return nullptr;
-}
-
-static void SignalProxy_Serialize_gtk_callback_destroy(void* user_data)
-{
- delete static_cast<Gtk::TextBuffer::SlotSerialize*>(user_data);
-}
-
-static gboolean SignalProxy_Deserialize(GtkTextBuffer* /* register_buffer */,
- GtkTextBuffer* content_buffer,
- GtkTextIter* iter, const guint8* data,
- gsize length, gboolean create_tags,
- gpointer user_data,
- GError** error)
-{
- auto the_slot = static_cast<Gtk::TextBuffer::SlotDeserialize*>(user_data);
-
- try
- {
- return (*the_slot)(Glib::wrap(content_buffer, true),
- Glib::wrap_iter(iter), data, length, create_tags);
- }
- catch (Glib::Error& err)
- {
- err.propagate(error);
- }
- catch (...)
- {
- Glib::exception_handlers_invoke();
- }
- return false;
-}
-
-static void SignalProxy_Deserialize_gtk_callback_destroy(void* user_data)
-{
- delete static_cast<Gtk::TextBuffer::SlotDeserialize*>(user_data);
-}
-
-} // extern "C"
-} // anonymous namespace
-
namespace Gtk
{
@@ -254,10 +191,10 @@ TextBuffer::iterator TextBuffer::insert(const iterator& pos, const char* text_be
return iterCopy;
}
-TextBuffer::iterator TextBuffer::insert_pixbuf(const iterator& pos, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)
+TextBuffer::iterator TextBuffer::insert_texture(const iterator& pos, const Glib::RefPtr<Gdk::Texture>&
texture)
{
iterator iterCopy (pos);
- gtk_text_buffer_insert_pixbuf(gobj(), iterCopy.gobj(), pixbuf->gobj());
+ gtk_text_buffer_insert_texture(gobj(), iterCopy.gobj(), texture->gobj());
return iterCopy;
}
@@ -546,18 +483,6 @@ TextBuffer::erase_interactive(const iterator& range_begin, const iterator& range
return pair_iter_success;
}
-void TextBuffer::paste_clipboard(const Glib::RefPtr<Clipboard>& clipboard, const iterator& override_location,
- bool default_editable)
-{
- gtk_text_buffer_paste_clipboard(gobj(), clipboard->gobj(),
- const_cast<GtkTextIter*>(override_location.gobj()), default_editable);
-}
-
-void TextBuffer::paste_clipboard(const Glib::RefPtr<Clipboard>& clipboard, bool default_editable)
-{
- gtk_text_buffer_paste_clipboard(gobj(), clipboard->gobj(), nullptr, default_editable);
-}
-
TextBuffer::iterator TextBuffer::get_iter_at_child_anchor(const Glib::RefPtr<ChildAnchor>& anchor)
{
iterator iter;
@@ -581,54 +506,4 @@ Glib::ustring TextBuffer::get_text(bool include_hidden_chars) const
return get_text(unconst->begin(), unconst->end(), include_hidden_chars);
}
-std::vector<Glib::ustring> TextBuffer::get_serialize_formats() const
-{
- int n_atoms = 0;
- auto atoms = gtk_text_buffer_get_serialize_formats(const_cast<GtkTextBuffer*>(gobj()), &n_atoms);
- return Glib::ArrayHandler<Glib::ustring, Gdk::AtomUstringTraits>::array_to_vector(atoms, n_atoms,
Glib::OWNERSHIP_SHALLOW);
-}
-
-std::vector<Glib::ustring> TextBuffer::get_deserialize_formats() const
-{
- int n_atoms = 0;
- auto atoms = gtk_text_buffer_get_deserialize_formats(const_cast<GtkTextBuffer*>(gobj()), &n_atoms);
- return Glib::ArrayHandler<Glib::ustring, Gdk::AtomUstringTraits>::array_to_vector(atoms, n_atoms,
Glib::OWNERSHIP_SHALLOW);
-}
-
-Glib::ustring TextBuffer::register_serialize_format(const Glib::ustring& mime_type, const SlotSerialize&
slot)
-{
- auto slot_copy = new SlotSerialize(slot);
- auto atom = gtk_text_buffer_register_serialize_format(gobj(), mime_type.c_str(),
- &SignalProxy_Serialize, slot_copy, &SignalProxy_Serialize_gtk_callback_destroy);
-
- //Convert the atom to a string:
- Glib::ustring atom_as_string;
- char* atom_name = gdk_atom_name(atom);
- if (atom_name)
- {
- atom_as_string = atom_name;
- g_free(atom_name);
- }
-
- return atom_as_string;
-}
-
-Glib::ustring TextBuffer::register_deserialize_format(const Glib::ustring& mime_type, const SlotDeserialize&
slot)
-{
- auto slot_copy = new SlotDeserialize(slot);
- auto atom = gtk_text_buffer_register_deserialize_format(gobj(), mime_type.c_str(),
- &SignalProxy_Deserialize, slot_copy, &SignalProxy_Deserialize_gtk_callback_destroy);
-
- //Convert the atom to a string:
- Glib::ustring atom_as_string;
- char* atom_name = gdk_atom_name(atom);
- if (atom_name)
- {
- atom_as_string = atom_name;
- g_free(atom_name);
- }
-
- return atom_as_string;
-}
-
} // namespace Gtk
diff --git a/gtk/src/textbuffer.hg b/gtk/src/textbuffer.hg
index 48a6118..1a76a16 100644
--- a/gtk/src/textbuffer.hg
+++ b/gtk/src/textbuffer.hg
@@ -25,8 +25,8 @@ _CONFIGINCLUDE(gtkmmconfig.h)
#include <gtkmm/textchildanchor.h>
#include <gtkmm/textmark.h>
#include <gtkmm/textiter.h>
-#include <gtkmm/clipboard.h>
-#include <gdkmm/pixbuf.h>
+#include <gdkmm/clipboard.h>
+#include <gdkmm/texture.h>
#include <gtkmmconfig.h>
#include <utility>
@@ -204,7 +204,7 @@ public:
bool insert_interactive_at_cursor(const char* text_begin, const char* text_end,
bool default_editable = true);
- /** Copies text, tags, and pixbufs between @a range_begin and @a range_end (the order of range_begin and
range_begin doesn't
+ /** Copies text, tags, and texture between @a range_begin and @a range_end (the order of range_begin and
range_begin doesn't
* matter) and inserts the copy at @a pos. Used instead of simply getting/inserting text because it
preserves images and tags.
* If range_begin and range_end are in a different buffer, the two buffers must share the same tag table.
*
@@ -369,8 +369,8 @@ public:
_WRAP_METHOD(Glib::ustring get_slice(const const_iterator& range_start, const const_iterator& range_end,
bool include_hidden_chars = true) const, gtk_text_buffer_get_slice)
- iterator insert_pixbuf(const iterator& pos, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf);
- _IGNORE(gtk_text_buffer_insert_pixbuf)
+ iterator insert_texture(const iterator& pos, const Glib::RefPtr<Gdk::Texture>& texture);
+ _IGNORE(gtk_text_buffer_insert_texture)
iterator insert_child_anchor(const iterator& pos, const Glib::RefPtr<ChildAnchor>& anchor);
_IGNORE(gtk_text_buffer_insert_child_anchor)
@@ -481,13 +481,12 @@ public:
_WRAP_METHOD(bool get_has_selection() const, gtk_text_buffer_get_has_selection)
- _WRAP_METHOD(void add_selection_clipboard(const Glib::RefPtr<Clipboard>& clipboard),
gtk_text_buffer_add_selection_clipboard)
- _WRAP_METHOD(void remove_selection_clipboard(const Glib::RefPtr<Clipboard>& clipboard),
gtk_text_buffer_remove_selection_clipboard)
- _WRAP_METHOD(void cut_clipboard(const Glib::RefPtr<Clipboard>& clipboard, bool default_editable = true),
gtk_text_buffer_cut_clipboard)
- _WRAP_METHOD(void copy_clipboard(const Glib::RefPtr<Clipboard>& clipboard), gtk_text_buffer_copy_clipboard)
- void paste_clipboard(const Glib::RefPtr<Clipboard>& clipboard, const iterator& override_location, bool
default_editable = true);
- void paste_clipboard(const Glib::RefPtr<Clipboard>& clipboard, bool default_editable = true);
- _IGNORE(gtk_text_buffer_paste_clipboard)
+ _WRAP_METHOD(void add_selection_clipboard(const Glib::RefPtr<Gdk::Clipboard>& clipboard),
gtk_text_buffer_add_selection_clipboard)
+ _WRAP_METHOD(void remove_selection_clipboard(const Glib::RefPtr<Gdk::Clipboard>& clipboard),
gtk_text_buffer_remove_selection_clipboard)
+ _WRAP_METHOD(void cut_clipboard(const Glib::RefPtr<Gdk::Clipboard>& clipboard, bool default_editable =
true), gtk_text_buffer_cut_clipboard)
+ _WRAP_METHOD(void copy_clipboard(const Glib::RefPtr<Gdk::Clipboard>& clipboard),
gtk_text_buffer_copy_clipboard)
+ _WRAP_METHOD(void paste_clipboard(const Glib::RefPtr<Gdk::Clipboard>& clipboard, const iterator&
override_location{?},
+ bool default_editable = true), gtk_text_buffer_paste_clipboard)
_WRAP_METHOD(bool get_selection_bounds(iterator& range_start, iterator& range_end),
gtk_text_buffer_get_selection_bounds)
_WRAP_METHOD(bool get_selection_bounds(const_iterator& range_start, const_iterator& range_end) const,
gtk_text_buffer_get_selection_bounds)
@@ -499,90 +498,6 @@ public:
_WRAP_METHOD(void begin_user_action(), gtk_text_buffer_begin_user_action)
_WRAP_METHOD(void end_user_action(), gtk_text_buffer_end_user_action)
- _WRAP_METHOD(Glib::RefPtr<Gdk::ContentFormats> get_copy_target_list(),
gtk_text_buffer_get_copy_target_list, refreturn)
- _WRAP_METHOD(Glib::RefPtr<const Gdk::ContentFormats> get_copy_target_list() const,
gtk_text_buffer_get_copy_target_list, refreturn, constversion)
- _WRAP_METHOD(Glib::RefPtr<Gdk::ContentFormats> get_paste_target_list(),
gtk_text_buffer_get_paste_target_list, refreturn)
- _WRAP_METHOD(Glib::RefPtr<const Gdk::ContentFormats> get_paste_target_list() const,
gtk_text_buffer_get_paste_target_list, refreturn, constversion)
-
- /** For instance,<br>
- * guint8* on_serialize(const Glib::RefPtr<TextBuffer>& content_buffer, const const_iterator& range_start,
const const_iterator& range_end, gsize& length);
- *
- * @param content_buffer The TextBuffer to serialize. It may be different from
- * the TextBuffer where the serialize format is registered.
- * @param range_start Start of the block of text to serialize.
- * @param range_end End of the block of text to serialize.
- * @param[out] length The length of the serialized data.
- * @return A newly-allocated array of guint8 which contains the serialized data, or <tt>nullptr</tt> if an
error occurred.
- */
- typedef sigc::slot<guint8*(const Glib::RefPtr<TextBuffer>&, const const_iterator&, const const_iterator&,
gsize&)> SlotSerialize;
-
- /** For instance,<br>
- * bool on_deserialize(const Glib::RefPtr<TextBuffer>& content_buffer, iterator& iter, const guint8* data,
gsize length, bool create_tags);
- *
- * @param content_buffer The TextBuffer to deserialize into. It may be different
- * from the TextBuffer where the deserialize format is registered.
- * @param iter Insertion point for the deserialized text.
- * @param data Data to deserialize.
- * @param length Length of data.
- * @param create_tags <tt>true</tt> if deserializing may create tags.
- * @return <tt>true</tt> on success, <tt>false</tt> otherwise.
- * @throw Glib::Error If the deserialize slot throws a Glib::Error or an object
- * derived from Glib::Error, the exception will be propagated out from
- * the calling deserialize() method.
- */
- typedef sigc::slot<bool(const Glib::RefPtr<TextBuffer>&, iterator&, const guint8*, gsize, bool)>
SlotDeserialize;
-
- /** This function registers a rich text serialization @a slot along with
- * its @a mime_type with this TextBuffer.
- *
- * @newin{3,16}
- *
- * @param mime_type The format’s mime-type.
- * @param slot The serialize slot to register.
- * @return The newly registered format’s mime-type.
- */
- Glib::ustring register_serialize_format(const Glib::ustring& mime_type, const SlotSerialize& slot);
- _IGNORE(gtk_text_buffer_register_serialize_format)
-
- _WRAP_METHOD(Glib::ustring register_serialize_tagset(const Glib::ustring& tagset_name),
gtk_text_buffer_register_serialize_tagset)
-
- /** This function registers a rich text deserialization @a slot along with
- * its @a mime_type with this TextBuffer.
- *
- * @newin{3,16}
- *
- * @param mime_type The format’s mime-type.
- * @param slot The deserialize slot to register.
- * @return The newly registered format’s mime-type.
- */
- Glib::ustring register_deserialize_format(const Glib::ustring& mime_type, const SlotDeserialize& slot);
- _IGNORE(gtk_text_buffer_register_deserialize_format)
-
- _WRAP_METHOD(Glib::ustring register_deserialize_tagset(const Glib::ustring& tagset_name),
gtk_text_buffer_register_deserialize_tagset)
-
- _WRAP_METHOD(void unregister_serialize_format(const Glib::ustring& format),
gtk_text_buffer_unregister_serialize_format)
- _WRAP_METHOD(void unregister_deserialize_format(const Glib::ustring& format),
gtk_text_buffer_unregister_deserialize_format)
-
- _WRAP_METHOD(void set_can_create_tags(const Glib::ustring& format, bool can_create_tags = true),
gtk_text_buffer_deserialize_set_can_create_tags)
- _WRAP_METHOD(bool get_can_create_tags(const Glib::ustring& format) const,
gtk_text_buffer_deserialize_get_can_create_tags)
-
-
- std::vector<Glib::ustring> get_serialize_formats() const;
- _IGNORE(gtk_text_buffer_get_serialize_formats)
- std::vector<Glib::ustring> get_deserialize_formats() const;
- _IGNORE(gtk_text_buffer_get_deserialize_formats)
-
- _WRAP_METHOD(guint8* serialize(const Glib::RefPtr<TextBuffer>& content_buffer,
- const Glib::ustring& format,
- const const_iterator& range_start,
- const const_iterator& range_end,
- gsize& length) const, gtk_text_buffer_serialize)
-
- _WRAP_METHOD(bool deserialize(const Glib::RefPtr<TextBuffer>& content_buffer,
- const Glib::ustring& format,
- iterator& iter, const guint8* data,
- gsize length), gtk_text_buffer_deserialize, errthrow)
-
#m4begin
dnl // HACK: Override the default conversion to deal correctly
dnl // with non-0-terminated strings in insert_text_callback().
@@ -591,8 +506,8 @@ _CONVERSION(`GtkTextIter*',`TextBuffer::iterator&',Glib::wrap_iter($3))
#m4end
_WRAP_SIGNAL(void insert(TextBuffer::iterator& pos, const Glib::ustring& text, int bytes), "insert_text")
-#m4 _CONVERSION(`GdkPixbuf*',`const Glib::RefPtr<Gdk::Pixbuf>&', Glib::wrap($3, true))
- _WRAP_SIGNAL(void insert_pixbuf(TextBuffer::iterator& pos, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf),
"insert_pixbuf")
+#m4 _CONVERSION(`GdkTexture*',`const Glib::RefPtr<Gdk::Texture>&', Glib::wrap($3, true))
+ _WRAP_SIGNAL(void insert_texture(TextBuffer::iterator& pos, const Glib::RefPtr<Gdk::Texture>& texture),
"insert_texture")
#m4 _CONVERSION(`GtkTextChildAnchor*',`const Glib::RefPtr<ChildAnchor>&',`Glib::wrap($3, true)')
_WRAP_SIGNAL(void insert_child_anchor(TextBuffer::iterator& pos, const Glib::RefPtr<ChildAnchor>& anchor),
"insert_child_anchor")
@@ -612,9 +527,9 @@ _CONVERSION(`GtkTextIter*',`TextBuffer::iterator&',Glib::wrap_iter($3))
_WRAP_SIGNAL(void begin_user_action(), "begin_user_action")
_WRAP_SIGNAL(void end_user_action(), "end_user_action")
-#m4 _CONVERSION(`GtkClipboard*',`const Glib::RefPtr<Gtk::Clipboard>&', Glib::wrap($3, true))
-#m4 _CONVERSION(`const Glib::RefPtr<Gtk::Clipboard>&', `GtkClipboard*', Glib::unwrap($3))
- _WRAP_SIGNAL(void paste_done(const Glib::RefPtr<Gtk::Clipboard>& clipboard), "paste_done")
+#m4 _CONVERSION(`GdkClipboard*',`const Glib::RefPtr<Gdk::Clipboard>&', Glib::wrap($3, true))
+#m4 _CONVERSION(`const Glib::RefPtr<Gdk::Clipboard>&', `GdkClipboard*', Glib::unwrap($3))
+ _WRAP_SIGNAL(void paste_done(const Glib::RefPtr<Gdk::Clipboard>& clipboard), "paste_done")
_WRAP_PROPERTY("tag-table", Glib::RefPtr<TextBuffer::TagTable>)
_WRAP_PROPERTY("text", Glib::ustring)
diff --git a/gtk/src/textiter.ccg b/gtk/src/textiter.ccg
index 6cecaf6..82ba81a 100644
--- a/gtk/src/textiter.ccg
+++ b/gtk/src/textiter.ccg
@@ -16,7 +16,7 @@
*/
#include <glibmm/vectorutils.h>
-#include <gdkmm/pixbuf.h>
+#include <gdkmm/texture.h>
#include <gtkmm/textbuffer.h>
#include <gtkmm/textmark.h>
#include <gtkmm/textchildanchor.h>
diff --git a/gtk/src/textiter.hg b/gtk/src/textiter.hg
index 5b6f301..f08b0a9 100644
--- a/gtk/src/textiter.hg
+++ b/gtk/src/textiter.hg
@@ -24,7 +24,7 @@ _DEFS(gtkmm,gtk)
namespace Gdk
{
-class Pixbuf;
+class Texture;
}
namespace Gtk
@@ -267,7 +267,7 @@ public:
_WRAP_METHOD(Glib::RefPtr<TextBuffer> get_buffer() const, gtk_text_iter_get_buffer, refreturn)
- _WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> get_pixbuf() const, gtk_text_iter_get_pixbuf, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<Gdk::Texture> get_texture() const, gtk_text_iter_get_texture, refreturn)
#m4 _CONVERSION(`GSList*',`std::vector<Glib::RefPtr<TextMark>>',`Glib::SListHandler<Glib::RefPtr<TextMark>
::slist_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
_WRAP_METHOD(std::vector<Glib::RefPtr<TextMark>> get_marks() const, gtk_text_iter_get_marks)
@@ -325,7 +325,7 @@ public:
_WRAP_METHOD(Glib::RefPtr<const TextBuffer> get_buffer() const, gtk_text_iter_get_buffer, refreturn)
- _WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> get_pixbuf() const, gtk_text_iter_get_pixbuf, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const Gdk::Texture> get_texture() const, gtk_text_iter_get_texture, refreturn)
#m4 _CONVERSION(`GSList*',`std::vector<Glib::RefPtr<const TextMark>>',`Glib::SListHandler<Glib::RefPtr<const
TextMark> >::slist_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
_WRAP_METHOD(std::vector<Glib::RefPtr<const TextMark>> get_marks() const, gtk_text_iter_get_marks)
diff --git a/gtk/src/tooltip.hg b/gtk/src/tooltip.hg
index 55abe83..fd6a08f 100644
--- a/gtk/src/tooltip.hg
+++ b/gtk/src/tooltip.hg
@@ -17,7 +17,7 @@
#include <glibmm/object.h>
#include <giomm/icon.h>
-#include <gdkmm/pixbuf.h>
+#include <gdkmm/texture.h>
#include <gtkmm/enums.h>
#include <gtkmm/widget.h>
@@ -89,7 +89,7 @@ public:
*/
void unset_text();
- _WRAP_METHOD(void set_icon(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf), gtk_tooltip_set_icon)
+ _WRAP_METHOD(void set_icon(const Glib::RefPtr<Gdk::Texture>& texture), gtk_tooltip_set_icon)
_WRAP_METHOD(void set_icon(const Glib::RefPtr<Gio::Icon>& gicon), gtk_tooltip_set_icon_from_gicon)
//TODO: Remove the _from_*() suffixes?
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index 9c77e01..3542556 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -33,11 +33,11 @@ _CONFIGINCLUDE(gtkmmconfig.h)
#include <gdkmm/types.h>
#include <gdkmm/window.h>
#include <gdkmm/dragcontext.h>
-#include <gdkmm/pixbuf.h>
#include <gtkmm/enums.h>
#include <gdkmm/display.h>
-#include <gtkmm/clipboard.h>
+#include <gdkmm/clipboard.h>
#include <gtkmm/requisition.h>
+#include <gtkmm/selectiondata.h>
#include <gtkmm/stylecontext.h>
#include <gtkmm/widgetpath.h>
#include <giomm/actiongroup.h>
@@ -296,8 +296,10 @@ public:
_WRAP_METHOD(Glib::RefPtr<Settings> get_settings(), gtk_widget_get_settings, refreturn)
- _WRAP_METHOD(Glib::RefPtr<Clipboard> get_clipboard(const Glib::ustring& selection),
gtk_widget_get_clipboard, refreturn)
- _WRAP_METHOD(Glib::RefPtr<const Clipboard> get_clipboard(const Glib::ustring& selection) const,
gtk_widget_get_clipboard, refreturn, constversion)
+ _WRAP_METHOD(Glib::RefPtr<Gdk::Clipboard> get_clipboard(), gtk_widget_get_clipboard, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const Gdk::Clipboard> get_clipboard() const, gtk_widget_get_clipboard,
refreturn, constversion)
+ _WRAP_METHOD(Glib::RefPtr<Gdk::Clipboard> get_primary_clipboard(), gtk_widget_get_primary_clipboard,
refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const Gdk::Clipboard> get_primary_clipboard() const,
gtk_widget_get_primary_clipboard, refreturn, constversion)
_WRAP_METHOD(bool get_hexpand() const, gtk_widget_get_hexpand)
_WRAP_METHOD(void set_hexpand(bool expand = true), gtk_widget_set_hexpand)
@@ -410,7 +412,7 @@ public:
// I've used Gdk::DragAction::COPY as the default, because Gdk::DragAction::DEFAULT means that
// it's never a drag destination, so it would seem like this method didn't work. murrayc.
- _WRAP_METHOD(void drag_dest_set(const Glib::RefPtr<Gdk::ContentFormats>& formats{.},
+ _WRAP_METHOD(void drag_dest_set(const Glib::RefPtr<Gdk::ContentFormats>& targets{.},
DestDefaults flags{.} = DestDefaults::ALL,
Gdk::DragAction actions{.} = Gdk::DragAction::COPY), gtk_drag_dest_set)
@@ -429,13 +431,13 @@ public:
// I've used Gdk::ModifierType::MODIFIER_MASK as the default, because it seems
// to mean 'whatever is possible in the context'. murrayc.
- _WRAP_METHOD(void drag_source_set(const Glib::RefPtr<Gdk::ContentFormats>& formats{.},
+ _WRAP_METHOD(void drag_source_set(const Glib::RefPtr<Gdk::ContentFormats>& targets{.},
Gdk::ModifierType start_button_mask{.} = Gdk::ModifierType::MODIFIER_MASK,
Gdk::DragAction actions{.} = Gdk::DragAction::COPY), gtk_drag_source_set)
_WRAP_METHOD(void drag_source_unset(), gtk_drag_source_unset)
- _WRAP_METHOD(void drag_source_set_icon(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf),
gtk_drag_source_set_icon_pixbuf)
+ _WRAP_METHOD(void drag_source_set_icon(const Cairo::RefPtr<Cairo::Surface>& surface),
gtk_drag_source_set_icon_surface)
_WRAP_METHOD(void drag_source_set_icon(const Glib::ustring& icon_name), gtk_drag_source_set_icon_name)
_WRAP_METHOD(void drag_source_add_text_targets(), gtk_drag_source_add_text_targets)
diff --git a/tools/extra_defs_gen/generate_defs_gdk.cc b/tools/extra_defs_gen/generate_defs_gdk.cc
index 5a48b7c..401027e 100644
--- a/tools/extra_defs_gen/generate_defs_gdk.cc
+++ b/tools/extra_defs_gen/generate_defs_gdk.cc
@@ -36,10 +36,11 @@ int main(int /* argc */, char** /* argv */)
gtk_init();
std::cout << get_defs( GDK_TYPE_APP_LAUNCH_CONTEXT )
+ << get_defs( GDK_TYPE_CLIPBOARD )
+ << get_defs( GDK_TYPE_CONTENT_PROVIDER )
<< get_defs( GDK_TYPE_DRAG_CONTEXT )
<< get_defs( GDK_TYPE_CURSOR )
<< get_defs( GDK_TYPE_DEVICE )
- << get_defs( GDK_TYPE_DEVICE_MANAGER )
<< get_defs( GDK_TYPE_DISPLAY )
#if !defined(G_OS_WIN32)
<< get_defs( GDK_TYPE_DISPLAY_MANAGER )
diff --git a/tools/extra_defs_gen/generate_defs_gtk.cc b/tools/extra_defs_gen/generate_defs_gtk.cc
index d9c6091..7b7ffb2 100644
--- a/tools/extra_defs_gen/generate_defs_gtk.cc
+++ b/tools/extra_defs_gen/generate_defs_gtk.cc
@@ -81,7 +81,6 @@ int main(int /* argc */, char** /* argv */)
<< get_defs( GTK_TYPE_CELL_RENDERER_SPIN )
<< get_defs( GTK_TYPE_CELL_RENDERER_SPINNER )
<< get_defs( GTK_TYPE_CENTER_BOX )
- << get_defs( GTK_TYPE_CLIPBOARD )
<< get_defs( GTK_TYPE_COLOR_BUTTON )
<< get_defs( GTK_TYPE_COLOR_CHOOSER )
<< get_defs( GTK_TYPE_COLOR_CHOOSER_DIALOG )
diff --git a/tools/m4/convert_gdk.m4 b/tools/m4/convert_gdk.m4
index 26388cf..d73f7b2 100644
--- a/tools/m4/convert_gdk.m4
+++ b/tools/m4/convert_gdk.m4
@@ -220,11 +220,15 @@ _CONVERSION(`GdkTexture*',`Glib::RefPtr<const Gdk::Texture>', `Glib::wrap($3)')
_CONVERSION(`GdkMonitor*',`Glib::RefPtr<Monitor>', `Glib::wrap($3)')
_CONVERSION(`GdkMonitor*',`Glib::RefPtr<const Monitor>', `Glib::wrap($3)')
-_CONVERSION(`GdkDeviceManager*',`Glib::RefPtr<DeviceManager>', `Glib::wrap($3)')
-_CONVERSION(`GdkDeviceManager*',`Glib::RefPtr<const DeviceManager>', `Glib::wrap($3)')
-
_CONVERSION(`gpointer',`const void*', `static_cast<$2>($3)')
+# Clipboard
+_CONVERSION(`const Glib::RefPtr<Gdk::Clipboard>&',`GdkClipboard*',__CONVERT_REFPTR_TO_P($3))
+_CONVERSION(`GdkClipboard*',`Glib::RefPtr<Clipboard>',`Glib::wrap($3)')
+_CONVERSION(`GdkClipboard*',`Glib::RefPtr<const Clipboard>',`Glib::wrap($3)')
+_CONVERSION(`GdkClipboard*',`Glib::RefPtr<Gdk::Clipboard>',`Glib::wrap($3)')
+_CONVERSION(`GdkClipboard*',`Glib::RefPtr<const Gdk::Clipboard>',`Glib::wrap($3)')
+
# ContentFormats
_CONVERSION(`const Glib::RefPtr<ContentFormats>&',`GdkContentFormats*',__CONVERT_REFPTR_TO_P)
_CONVERSION(`const Glib::RefPtr<const ContentFormats>&',`GdkContentFormats*',__CONVERT_CONST_REFPTR_TO_P)
diff --git a/tools/m4/convert_gtk.m4 b/tools/m4/convert_gtk.m4
index 38adfa9..17dc6f9 100644
--- a/tools/m4/convert_gtk.m4
+++ b/tools/m4/convert_gtk.m4
@@ -323,6 +323,7 @@ _CONVERSION(`const_iterator&',`GtkTextIter*',__FR2P)
_CONVERSION(`const TextBuffer::iterator&',`const GtkTextIter*',__FR2P)
_CONVERSION(`const TextBuffer::const_iterator&',`const GtkTextIter*',__FR2P)
_CONVERSION(`const iterator&',`const GtkTextIter*',__FR2P)
+_CONVERSION(`const iterator&',`GtkTextIter*',__FCR2P)
_CONVERSION(`const const_iterator&',`const GtkTextIter*',__FR2P)
_CONVERSION(`const Glib::RefPtr<TextTagTable>&',`GtkTextTagTable*',__CONVERT_REFPTR_TO_P)
_CONVERSION(`const Glib::RefPtr<TextBuffer>&',`GtkTextBuffer*',__CONVERT_REFPTR_TO_P)
@@ -369,12 +370,6 @@ _CONVERSION(`GtkTreePath*',`TreeModel::Path', `Gtk::TreePath($3, false)')
_CONVERSION(`GtkCellEditable*',`CellEditable*',`dynamic_cast<$2>(Glib::wrap_auto((GObject*)($3), false))')
_CONVERSION(`CellEditable*',`GtkCellEditable*',`Glib::unwrap($3)')
-
-#_CONVERSION(`Clipboard&',`GtkClipboard*',`($3).gobj()')
-_CONVERSION(`GtkClipboard*',`Glib::RefPtr<Clipboard>',`Glib::wrap($3)')
-_CONVERSION(`GtkClipboard*',`Glib::RefPtr<const Clipboard>',`Glib::wrap($3)')
-_CONVERSION(`const Glib::RefPtr<Clipboard>&',`GtkClipboard*',__CONVERT_REFPTR_TO_P($3))
-
_CONVERSION(`SelectionData',`GtkSelectionData*', `($3).gobj()')
_CONVERSION(`const SelectionData&',`const GtkSelectionData*', __FR2P)
_CONVERSION(`const SelectionData&',`GtkSelectionData*', __FCR2P)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]