[gtk+/wip/attachment-parameters] gdkwindow-quartz: implement gdk_quartz_window_set_attachment_parameters ()
- From: William Hua <williamhua src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/attachment-parameters] gdkwindow-quartz: implement gdk_quartz_window_set_attachment_parameters ()
- Date: Thu, 1 Oct 2015 13:48:12 +0000 (UTC)
commit 8bd6ba0bed50f511ec322243e721bb1fa5966eae
Author: William Hua <william hua canonical com>
Date: Thu Oct 1 09:47:38 2015 -0400
gdkwindow-quartz: implement gdk_quartz_window_set_attachment_parameters ()
gdk/quartz/gdkwindow-quartz.c | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index 62710a2..c3aae88 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -2873,6 +2873,38 @@ gdk_quartz_window_get_scale_factor (GdkWindow *window)
}
static void
+gdk_quartz_window_set_attachment_parameters (GdkWindow *window,
+ const GdkAttachmentParameters *parameters)
+{
+ GdkPoint position;
+ GdkPoint offset;
+ GdkAttachmentOption primary_option;
+ GdkAttachmentOption secondary_option;
+
+ if (!parameters || !parameters->has_attachment_rectangle)
+ return;
+
+ if (gdk_attachment_parameters_choose_position_for_window (parameters,
+ window,
+ &position,
+ &offset,
+ &primary_option,
+ &secondary_option))
+ {
+ gdk_window_move (window, position.x, position.y);
+
+ if (parameters->position_callback)
+ parameters->position_callback (window,
+ parameters,
+ &position,
+ &offset,
+ primary_option,
+ secondary_option,
+ parameters->position_callback_user_data);
+ }
+}
+
+static void
gdk_window_impl_quartz_class_init (GdkWindowImplQuartzClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -2958,6 +2990,7 @@ gdk_window_impl_quartz_class_init (GdkWindowImplQuartzClass *klass)
impl_class->delete_property = _gdk_quartz_window_delete_property;
impl_class->create_gl_context = gdk_quartz_window_create_gl_context;
+ impl_class->set_attachment_parameters = gdk_quartz_window_set_attachment_parameters;
impl_quartz_class->get_context = gdk_window_impl_quartz_get_context;
impl_quartz_class->release_context = gdk_window_impl_quartz_release_context;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]