[gtk+/wip/william/deprecations: 5/10] mir: change events from surface to window



commit 278a7f06cf4b4dd07afdeb1b8fb4d3102ad9799e
Author: William Hua <william hua canonical com>
Date:   Thu Feb 23 14:54:29 2017 -0500

    mir: change events from surface to window

 gdk/mir/gdkmireventsource.c |   41 +++++++++++++++++++++--------------------
 1 files changed, 21 insertions(+), 20 deletions(-)
---
diff --git a/gdk/mir/gdkmireventsource.c b/gdk/mir/gdkmireventsource.c
index 30b78a4..0fe43cc 100644
--- a/gdk/mir/gdkmireventsource.c
+++ b/gdk/mir/gdkmireventsource.c
@@ -22,7 +22,7 @@
 #include "gdkmir.h"
 #include "gdkmir-private.h"
 
-#include <mir_toolkit/events/surface_placement.h>
+#include <mir_toolkit/events/window_placement.h>
 
 #define NANO_TO_MILLI(x) ((x) / 1000000)
 
@@ -444,18 +444,19 @@ handle_motion_event (GdkWindow *window, const MirInputEvent *event)
 }
 
 static void
-handle_surface_event (GdkWindow *window, const MirSurfaceEvent *event)
+handle_window_event (GdkWindow            *window,
+                     const MirWindowEvent *event)
 {
   GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
-  MirSurfaceState state;
+  MirWindowState state;
 
-  switch (mir_surface_event_get_attribute (event))
+  switch (mir_window_event_get_attribute (event))
     {
     case mir_surface_attrib_type:
-      _gdk_mir_window_impl_set_surface_type (impl, mir_surface_event_get_attribute_value (event));
+      _gdk_mir_window_impl_set_surface_type (impl, mir_window_event_get_attribute_value (event));
       break;
     case mir_surface_attrib_state:
-      state = mir_surface_event_get_attribute_value (event);
+      state = mir_window_event_get_attribute_value (event);
       _gdk_mir_window_impl_set_surface_state (impl, state);
 
       switch (state)
@@ -496,7 +497,7 @@ handle_surface_event (GdkWindow *window, const MirSurfaceEvent *event)
     case mir_surface_attrib_swapinterval:
       break;
     case mir_surface_attrib_focus:
-      generate_focus_event (window, mir_surface_event_get_attribute_value (event) != 0);
+      generate_focus_event (window, mir_window_event_get_attribute_value (event) != 0);
       break;
     default:
       break;
@@ -537,17 +538,17 @@ handle_close_event (GdkWindow *window)
 }
 
 static void
-handle_surface_output_event (GdkWindow                  *window,
-                             const MirSurfaceOutputEvent *event)
+handle_window_output_event (GdkWindow                  *window,
+                            const MirWindowOutputEvent *event)
 {
-  _gdk_mir_window_set_surface_output (window, mir_surface_output_event_get_scale (event));
+  _gdk_mir_window_set_surface_output (window, mir_window_output_event_get_scale (event));
 }
 
 static void
-handle_surface_placement_event (GdkWindow                      *window,
-                                const MirSurfacePlacementEvent *event)
+handle_window_placement_event (GdkWindow                     *window,
+                               const MirWindowPlacementEvent *event)
 {
-  _gdk_mir_window_set_final_rect (window, mir_surface_placement_get_relative_position (event));
+  _gdk_mir_window_set_final_rect (window, mir_window_placement_get_relative_position (event));
 }
 
 typedef struct
@@ -591,8 +592,8 @@ gdk_mir_event_source_queue_event (GdkDisplay     *display,
     case mir_event_type_motion:
       handle_motion_event (window, mir_event_get_input_event (event));
       break;
-    case mir_event_type_surface:
-      handle_surface_event (window, mir_event_get_surface_event (event));
+    case mir_event_type_window:
+      handle_window_event (window, mir_event_get_window_event (event));
       break;
     case mir_event_type_resize:
       handle_resize_event (window, mir_event_get_resize_event (event));
@@ -603,14 +604,14 @@ gdk_mir_event_source_queue_event (GdkDisplay     *display,
     case mir_event_type_orientation:
       // FIXME?
       break;
-    case mir_event_type_close_surface:
+    case mir_event_type_close_window:
       handle_close_event (window);
       break;
-    case mir_event_type_surface_output:
-      handle_surface_output_event (window, mir_event_get_surface_output_event (event));
+    case mir_event_type_window_output:
+      handle_window_output_event (window, mir_event_get_window_output_event (event));
       break;
-    case mir_event_type_surface_placement:
-      handle_surface_placement_event (window, mir_event_get_surface_placement_event (event));
+    case mir_event_type_window_placement:
+      handle_window_placement_event (window, mir_event_get_window_placement_event (event));
       break;
     default:
       g_warning ("Ignoring unknown Mir event %d", mir_event_get_type (event));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]