commit 787e0ff

Michael Forney  ·  2013-09-11 23:48:04 +0000 UTC
parent 4fa7c60
surface: Add resize event
2 files changed,  +29, -0
+13, -0
 1@@ -115,8 +115,21 @@ static void set_size(struct swc_surface * surface,
 2     /* Check if the surface was resized. */
 3     if (width != surface->geometry.width || height != surface->geometry.height)
 4     {
 5+        struct swc_surface_event_data data = {
 6+            .surface = surface,
 7+            .resize = {
 8+                .old_width = surface->geometry.width,
 9+                .old_height = surface->geometry.height,
10+                .new_width = width,
11+                .new_height = height
12+            }
13+        };
14+
15         surface->geometry.width = width;
16         surface->geometry.height = height;
17+
18+        swc_send_event(&surface->event_signal,
19+                       SWC_SURFACE_EVENT_TYPE_RESIZE, &data);
20     }
21 }
22 
+16, -0
 1@@ -30,6 +30,22 @@
 2 
 3 struct swc_surface;
 4 
 5+enum swc_surface_event_type
 6+{
 7+    SWC_SURFACE_EVENT_TYPE_RESIZE
 8+};
 9+
10+struct swc_surface_event_data
11+{
12+    struct swc_surface * surface;
13+
14+    struct
15+    {
16+        uint32_t old_width, old_height;
17+        uint32_t new_width, new_height;
18+    } resize;
19+};
20+
21 enum swc_surface_commit_info
22 {
23     SWC_SURFACE_COMMIT_ATTACH = (1 << 0),