ecore_wl2 wayland_shm: Move surface functions into ecore_wl2
authorDerek Foreman <derekf@osg.samsung.com>
Thu, 30 Nov 2017 18:48:08 +0000 (12:48 -0600)
committerDerek Foreman <derekf@osg.samsung.com>
Fri, 1 Dec 2017 16:58:44 +0000 (10:58 -0600)
Finish pushing these all into ecore_wl2

src/Makefile_Ecore_Wl2.am
src/Makefile_Evas.am
src/lib/ecore_wl2/Ecore_Wl2.h
src/lib/ecore_wl2/ecore_wl2_private.h
src/lib/ecore_wl2/ecore_wl2_surface.c [moved from src/modules/evas/engines/wayland_shm/evas_dmabuf.c with 87% similarity]
src/modules/evas/engines/wayland_shm/evas_engine.h

index 1c5971c..a794d0b 100644 (file)
@@ -17,6 +17,7 @@ lib/ecore_wl2/ecore_wl2_display.c \
 lib/ecore_wl2/ecore_wl2.c \
 lib/ecore_wl2/ecore_wl2_private.h \
 lib/ecore_wl2/ecore_wl2_buffer.c \
+lib/ecore_wl2/ecore_wl2_surface.c \
 static_libs/libdrm/drm_fourcc.h \
 static_libs/libdrm/drm.h \
 static_libs/libdrm/drm_mode.h \
index 48e6440..43ad9f7 100644 (file)
@@ -1320,7 +1320,6 @@ WAYLAND_SHM_SOURCES = \
 modules/evas/engines/wayland_common/Evas_Engine_Wayland.h \
 modules/evas/engines/wayland_shm/evas_engine.c \
 modules/evas/engines/wayland_shm/evas_engine.h \
-modules/evas/engines/wayland_shm/evas_dmabuf.c \
 modules/evas/engines/wayland_shm/evas_outbuf.c
 
 NODIST_WAYLAND_SHM_SOURCES = \
index 88fbeda..b063983 100644 (file)
@@ -44,6 +44,7 @@ typedef struct _Ecore_Wl2_Pointer Ecore_Wl2_Pointer;
 typedef struct _Ecore_Wl2_Keyboard Ecore_Wl2_Keyboard;
 typedef struct _Ecore_Wl2_Touch Ecore_Wl2_Touch;
 typedef struct _Ecore_Wl2_Offer Ecore_Wl2_Offer;
+typedef struct _Ecore_Wl2_Surface Ecore_Wl2_Surface;
 
 /* matches protocol values */
 typedef enum
@@ -2015,6 +2016,13 @@ EAPI void ecore_wl2_buffer_discard(Ecore_Wl2_Buffer *buf);
 EAPI void ecore_wl2_buffer_unlock(Ecore_Wl2_Buffer *b);
 EAPI void ecore_wl2_buffer_destroy(Ecore_Wl2_Buffer *b);
 
+EAPI Ecore_Wl2_Surface *ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha);
+EAPI void ecore_wl2_surface_destroy(Ecore_Wl2_Surface *surface);
+EAPI void ecore_wl2_surface_reconfigure(Ecore_Wl2_Surface *surface, int w, int h, uint32_t flags, Eina_Bool force);
+EAPI void *ecore_wl2_surface_data_get(Ecore_Wl2_Surface *surface, int *w, int *h);
+EAPI int  ecore_wl2_surface_assign(Ecore_Wl2_Surface *surface);
+EAPI void ecore_wl2_surface_post(Ecore_Wl2_Surface *surface, Eina_Rectangle *rects, unsigned int count);
+
 # endif
 
 # undef EAPI
index b1df67f..8b87cff 100644 (file)
@@ -523,6 +523,24 @@ typedef struct Ecore_Wl2_Event_Window_WWW_Drag
    Eina_Bool dragging;
 } Ecore_Wl2_Event_Window_WWW_Drag;
 
+typedef struct _Ecore_Wl2_Surface
+{
+   Ecore_Wl2_Window *wl2_win;
+   Ecore_Wl2_Buffer *current;
+   Eina_List *buffers;
+
+   int w, h;
+   Eina_Bool alpha : 1;
+   struct
+     {
+        void (*destroy)(Ecore_Wl2_Surface *surface);
+        void (*reconfigure)(Ecore_Wl2_Surface *surface, int w, int h, uint32_t flags, Eina_Bool force);
+        void *(*data_get)(Ecore_Wl2_Surface *surface, int *w, int *h);
+        int  (*assign)(Ecore_Wl2_Surface *surface);
+        void (*post)(Ecore_Wl2_Surface *surface, Eina_Rectangle *rects, unsigned int count);
+     } funcs;
+} Ecore_Wl2_Surface;
+
 Ecore_Wl2_Window *_ecore_wl2_display_window_surface_find(Ecore_Wl2_Display *display, struct wl_surface *wl_surface);
 void _display_event_free(void *d, void *event EINA_UNUSED);
 
similarity index 87%
rename from src/modules/evas/engines/wayland_shm/evas_dmabuf.c
rename to src/lib/ecore_wl2/ecore_wl2_surface.c
index bd4eb5e..9a1c8ea 100644 (file)
@@ -1,30 +1,15 @@
-#include "evas_common_private.h"
-#include "evas_private.h"
-#include "evas_engine.h"
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "ecore_wl2_private.h"
 
 #include <sys/types.h>
 #include <sys/stat.h>
 
 #include "linux-dmabuf-unstable-v1-client-protocol.h"
 
-typedef struct _Ecore_Wl2_Surface Ecore_Wl2_Surface;
-struct _Ecore_Wl2_Surface
-{
-   Ecore_Wl2_Window *wl2_win;
-   Ecore_Wl2_Buffer *current;
-   Eina_List *buffers;
-
-   int w, h;
-   Eina_Bool alpha : 1;
-   struct
-     {
-        void (*destroy)(Ecore_Wl2_Surface *surface);
-        void (*reconfigure)(Ecore_Wl2_Surface *surface, int w, int h, uint32_t flags, Eina_Bool force);
-        void *(*data_get)(Ecore_Wl2_Surface *surface, int *w, int *h);
-        int  (*assign)(Ecore_Wl2_Surface *surface);
-        void (*post)(Ecore_Wl2_Surface *surface, Eina_Rectangle *rects, unsigned int count);
-     } funcs;
-};
+#define MAX_BUFFERS 4
 
 static void
 _evas_dmabuf_surface_reconfigure(Ecore_Wl2_Surface *s, int w, int h, uint32_t flags EINA_UNUSED, Eina_Bool force)
@@ -165,7 +150,7 @@ _evas_dmabuf_surface_destroy(Ecore_Wl2_Surface *s)
    free(s);
 }
 
-void
+EAPI void
 ecore_wl2_surface_destroy(Ecore_Wl2_Surface *surface)
 {
    EINA_SAFETY_ON_NULL_RETURN(surface);
@@ -173,7 +158,7 @@ ecore_wl2_surface_destroy(Ecore_Wl2_Surface *surface)
    surface->funcs.destroy(surface);
 }
 
-void
+EAPI void
 ecore_wl2_surface_reconfigure(Ecore_Wl2_Surface *surface, int w, int h, uint32_t flags, Eina_Bool force)
 {
    EINA_SAFETY_ON_NULL_RETURN(surface);
@@ -181,7 +166,7 @@ ecore_wl2_surface_reconfigure(Ecore_Wl2_Surface *surface, int w, int h, uint32_t
    surface->funcs.reconfigure(surface, w, h, flags, force);
 }
 
-void *
+EAPI void *
 ecore_wl2_surface_data_get(Ecore_Wl2_Surface *surface, int *w, int *h)
 {
    EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL);
@@ -189,7 +174,7 @@ ecore_wl2_surface_data_get(Ecore_Wl2_Surface *surface, int *w, int *h)
    return surface->funcs.data_get(surface, w, h);
 }
 
-int
+EAPI int
 ecore_wl2_surface_assign(Ecore_Wl2_Surface *surface)
 {
    EINA_SAFETY_ON_NULL_RETURN_VAL(surface, 0);
@@ -197,7 +182,7 @@ ecore_wl2_surface_assign(Ecore_Wl2_Surface *surface)
    return surface->funcs.assign(surface);
 }
 
-void
+EAPI void
 ecore_wl2_surface_post(Ecore_Wl2_Surface *surface, Eina_Rectangle *rects, unsigned int count)
 {
    EINA_SAFETY_ON_NULL_RETURN(surface);
@@ -205,7 +190,7 @@ ecore_wl2_surface_post(Ecore_Wl2_Surface *surface, Eina_Rectangle *rects, unsign
    surface->funcs.post(surface, rects, count);
 }
 
-Ecore_Wl2_Surface *
+EAPI Ecore_Wl2_Surface *
 ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha)
 {
    Ecore_Wl2_Surface *out;
index 25ce2f3..7291b40 100644 (file)
@@ -69,10 +69,6 @@ extern int _evas_engine_way_shm_log_dom;
 # include "../software_generic/Evas_Engine_Software_Generic.h"
 # include "Evas_Engine_Wayland.h"
 
-# define MAX_BUFFERS 4
-
-typedef struct _Ecore_Wl2_Surface Ecore_Wl2_Surface;
-
 struct _Outbuf
 {
    int w, h;