aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorU. Artie Eoff <ullysses.a.eoff@intel.com>2013-02-05 16:53:31 +0000
committerEduardo de Barros Lima <eblima@gmail.com>2013-02-05 16:53:31 +0000
commita2197ce5035dbbde52978bcb7cd44be26962cc34 (patch)
treeb75961cf61232c801093b0ba992652a40ae8e286
parent0f3d5509bc8b6d437e74483b4a69e91811c737ad (diff)
downloadefl-a2197ce5035dbbde52978bcb7cd44be26962cc34.tar.gz
efl-a2197ce5035dbbde52978bcb7cd44be26962cc34.tar.xz
efl-a2197ce5035dbbde52978bcb7cd44be26962cc34.zip
Export API to C++, add wl_registry and global accessors
Add #ifdef __cpluscplus to Ecore_Wayland.h so the API can be used by C++ programs. Add accessors for the wl_registry and the globals list. Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com> Patch by: "U. Artie Eoff" <ullysses.a.eoff@intel.com> SVN revision: 83642
-rw-r--r--ChangeLog7
-rw-r--r--NEWS7
-rw-r--r--src/lib/ecore_wayland/Ecore_Wayland.h33
-rw-r--r--src/lib/ecore_wayland/ecore_wl.c15
4 files changed, 60 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 1011b6eb3..c3137991a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-02-04 U. Artie Eoff (uartie)
+
+ * ecore_wayland: Add #ifdef __cplusplus to Ecore_Wayland.h so the
+ API can be used by C++ programs.
+ * ecore_wayland: Add ecore_wl_registry_get
+ * ecore_wayland: Add ecore_wl_globals_get
+
2013-02-04 Raphael Kubo da Costa <<raphael.kubo.da.costa@intel.com>
* evas: Stop initializing and shutting Fontconfig down
diff --git a/NEWS b/NEWS
index 8c3ac6124..c2e873d5c 100644
--- a/NEWS
+++ b/NEWS
@@ -28,6 +28,13 @@ Additions:
ecore_x_e_window_profile_change_send()
ecore_x_e_window_profile_change_request_send()
ecore_x_e_window_profile_change_done_send()
+ * ecore_wayland:
+ - Store global wayland interfaces in a globals list so wayland programs
+ can bind to other non-standard wayland protocol extensions.
+ - ecore_wl_globals_get()
+ - ecore_wl_registry_get()
+ - Add #ifdef __cplusplus to Ecore_Wayland.h so C++ programs can link to
+ and use the API.
* ecore_evas:
- ecore_evas_window_profile_supported_get()
- ecore_evas_window_profile_set()
diff --git a/src/lib/ecore_wayland/Ecore_Wayland.h b/src/lib/ecore_wayland/Ecore_Wayland.h
index 74c3f6174..74b481543 100644
--- a/src/lib/ecore_wayland/Ecore_Wayland.h
+++ b/src/lib/ecore_wayland/Ecore_Wayland.h
@@ -26,10 +26,14 @@
# define EAPI
# endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct _Ecore_Wl_Display Ecore_Wl_Display;
typedef struct _Ecore_Wl_Output Ecore_Wl_Output;
typedef struct _Ecore_Wl_Input Ecore_Wl_Input;
-typedef struct _Ecore_Wl_Global Ecore_Wl_Global;
+typedef struct _Ecore_Wl_Global Ecore_Wl_Global; /** @since 1.8 */
# ifndef _ECORE_WAYLAND_WINDOW_PREDEF
typedef struct _Ecore_Wl_Window Ecore_Wl_Window;
@@ -72,6 +76,7 @@ enum _Ecore_Wl_Window_Buffer_Type
typedef enum _Ecore_Wl_Window_Type Ecore_Wl_Window_Type;
typedef enum _Ecore_Wl_Window_Buffer_Type Ecore_Wl_Window_Buffer_Type;
+/** @since 1.8 */
struct _Ecore_Wl_Global
{
unsigned int id;
@@ -101,7 +106,7 @@ struct _Ecore_Wl_Display
struct wl_list inputs;
struct wl_list outputs;
- struct wl_list globals;
+ struct wl_list globals; /** @since 1.8 */
struct
{
@@ -487,6 +492,26 @@ EAPI void ecore_wl_input_cursor_default_restore(Ecore_Wl_Input *input);
EAPI struct wl_list ecore_wl_outputs_get(void);
/**
+ * Retrieves the Wayland Globals Interface list used for the current Wayland connection.
+ *
+ * @return The current wayland globals interface list
+ *
+ * @ingroup Ecore_Wl_Display_Group
+ * @since 1.8
+ */
+EAPI struct wl_list *ecore_wl_globals_get(void);
+
+/**
+ * Retrieves the Wayland Registry used for the current Wayland connection.
+ *
+ * @return The current wayland registry
+ *
+ * @ingroup Ecore_Wl_Display_Group
+ * @since 1.8
+ */
+EAPI struct wl_registry *ecore_wl_registry_get(void);
+
+/**
* @defgroup Ecore_Wl_Window_Group Wayland Window functions.
* @ingroup Ecore_Wl_Group
*
@@ -609,4 +634,8 @@ EAPI Ecore_Wl_Dnd *ecore_wl_dnd_get();
EAPI Eina_Bool ecore_wl_dnd_start_drag();
EAPI Eina_Bool ecore_wl_dnd_selection_has_owner(Ecore_Wl_Dnd *dnd);
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/src/lib/ecore_wayland/ecore_wl.c b/src/lib/ecore_wayland/ecore_wl.c
index ab8543433..f2957b0ee 100644
--- a/src/lib/ecore_wayland/ecore_wl.c
+++ b/src/lib/ecore_wayland/ecore_wl.c
@@ -194,6 +194,18 @@ ecore_wl_display_get(void)
return _ecore_wl_disp->wl.display;
}
+EAPI struct wl_list *
+ecore_wl_globals_get(void)
+{
+ return &(_ecore_wl_disp->globals);
+}
+
+EAPI struct wl_registry *
+ecore_wl_registry_get(void)
+{
+ return _ecore_wl_disp->wl.registry;
+}
+
EAPI void
ecore_wl_screen_size_get(int *w, int *h)
{
@@ -377,6 +389,9 @@ _ecore_wl_cb_handle_global(void *data, struct wl_registry *registry, unsigned in
ewd = data;
global = malloc(sizeof(Ecore_Wl_Global));
+
+ memset(global, 0, sizeof(Ecore_Wl_Global));
+
global->id = id;
global->interface = strdup(interface);
global->version = version;