summaryrefslogtreecommitdiff
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)
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 1011b6eb34..c3137991ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
12013-02-04 U. Artie Eoff (uartie)
2
3 * ecore_wayland: Add #ifdef __cplusplus to Ecore_Wayland.h so the
4 API can be used by C++ programs.
5 * ecore_wayland: Add ecore_wl_registry_get
6 * ecore_wayland: Add ecore_wl_globals_get
7
12013-02-04 Raphael Kubo da Costa <<raphael.kubo.da.costa@intel.com> 82013-02-04 Raphael Kubo da Costa <<raphael.kubo.da.costa@intel.com>
2 9
3 * evas: Stop initializing and shutting Fontconfig down 10 * evas: Stop initializing and shutting Fontconfig down
diff --git a/NEWS b/NEWS
index 8c3ac61249..c2e873d5c0 100644
--- a/NEWS
+++ b/NEWS
@@ -28,6 +28,13 @@ Additions:
28 ecore_x_e_window_profile_change_send() 28 ecore_x_e_window_profile_change_send()
29 ecore_x_e_window_profile_change_request_send() 29 ecore_x_e_window_profile_change_request_send()
30 ecore_x_e_window_profile_change_done_send() 30 ecore_x_e_window_profile_change_done_send()
31 * ecore_wayland:
32 - Store global wayland interfaces in a globals list so wayland programs
33 can bind to other non-standard wayland protocol extensions.
34 - ecore_wl_globals_get()
35 - ecore_wl_registry_get()
36 - Add #ifdef __cplusplus to Ecore_Wayland.h so C++ programs can link to
37 and use the API.
31 * ecore_evas: 38 * ecore_evas:
32 - ecore_evas_window_profile_supported_get() 39 - ecore_evas_window_profile_supported_get()
33 - ecore_evas_window_profile_set() 40 - ecore_evas_window_profile_set()
diff --git a/src/lib/ecore_wayland/Ecore_Wayland.h b/src/lib/ecore_wayland/Ecore_Wayland.h
index 74c3f6174b..74b4815430 100644
--- a/src/lib/ecore_wayland/Ecore_Wayland.h
+++ b/src/lib/ecore_wayland/Ecore_Wayland.h
@@ -26,10 +26,14 @@
26# define EAPI 26# define EAPI
27# endif 27# endif
28 28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
29typedef struct _Ecore_Wl_Display Ecore_Wl_Display; 33typedef struct _Ecore_Wl_Display Ecore_Wl_Display;
30typedef struct _Ecore_Wl_Output Ecore_Wl_Output; 34typedef struct _Ecore_Wl_Output Ecore_Wl_Output;
31typedef struct _Ecore_Wl_Input Ecore_Wl_Input; 35typedef struct _Ecore_Wl_Input Ecore_Wl_Input;
32typedef struct _Ecore_Wl_Global Ecore_Wl_Global; 36typedef struct _Ecore_Wl_Global Ecore_Wl_Global; /** @since 1.8 */
33 37
34# ifndef _ECORE_WAYLAND_WINDOW_PREDEF 38# ifndef _ECORE_WAYLAND_WINDOW_PREDEF
35typedef struct _Ecore_Wl_Window Ecore_Wl_Window; 39typedef struct _Ecore_Wl_Window Ecore_Wl_Window;
@@ -72,6 +76,7 @@ enum _Ecore_Wl_Window_Buffer_Type
72typedef enum _Ecore_Wl_Window_Type Ecore_Wl_Window_Type; 76typedef enum _Ecore_Wl_Window_Type Ecore_Wl_Window_Type;
73typedef enum _Ecore_Wl_Window_Buffer_Type Ecore_Wl_Window_Buffer_Type; 77typedef enum _Ecore_Wl_Window_Buffer_Type Ecore_Wl_Window_Buffer_Type;
74 78
79/** @since 1.8 */
75struct _Ecore_Wl_Global 80struct _Ecore_Wl_Global
76{ 81{
77 unsigned int id; 82 unsigned int id;
@@ -101,7 +106,7 @@ struct _Ecore_Wl_Display
101 106
102 struct wl_list inputs; 107 struct wl_list inputs;
103 struct wl_list outputs; 108 struct wl_list outputs;
104 struct wl_list globals; 109 struct wl_list globals; /** @since 1.8 */
105 110
106 struct 111 struct
107 { 112 {
@@ -487,6 +492,26 @@ EAPI void ecore_wl_input_cursor_default_restore(Ecore_Wl_Input *input);
487EAPI struct wl_list ecore_wl_outputs_get(void); 492EAPI struct wl_list ecore_wl_outputs_get(void);
488 493
489/** 494/**
495 * Retrieves the Wayland Globals Interface list used for the current Wayland connection.
496 *
497 * @return The current wayland globals interface list
498 *
499 * @ingroup Ecore_Wl_Display_Group
500 * @since 1.8
501 */
502EAPI struct wl_list *ecore_wl_globals_get(void);
503
504/**
505 * Retrieves the Wayland Registry used for the current Wayland connection.
506 *
507 * @return The current wayland registry
508 *
509 * @ingroup Ecore_Wl_Display_Group
510 * @since 1.8
511 */
512EAPI struct wl_registry *ecore_wl_registry_get(void);
513
514/**
490 * @defgroup Ecore_Wl_Window_Group Wayland Window functions. 515 * @defgroup Ecore_Wl_Window_Group Wayland Window functions.
491 * @ingroup Ecore_Wl_Group 516 * @ingroup Ecore_Wl_Group
492 * 517 *
@@ -609,4 +634,8 @@ EAPI Ecore_Wl_Dnd *ecore_wl_dnd_get();
609EAPI Eina_Bool ecore_wl_dnd_start_drag(); 634EAPI Eina_Bool ecore_wl_dnd_start_drag();
610EAPI Eina_Bool ecore_wl_dnd_selection_has_owner(Ecore_Wl_Dnd *dnd); 635EAPI Eina_Bool ecore_wl_dnd_selection_has_owner(Ecore_Wl_Dnd *dnd);
611 636
637#ifdef __cplusplus
638}
639#endif
640
612#endif 641#endif
diff --git a/src/lib/ecore_wayland/ecore_wl.c b/src/lib/ecore_wayland/ecore_wl.c
index ab85434330..f2957b0ee6 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)
194 return _ecore_wl_disp->wl.display; 194 return _ecore_wl_disp->wl.display;
195} 195}
196 196
197EAPI struct wl_list *
198ecore_wl_globals_get(void)
199{
200 return &(_ecore_wl_disp->globals);
201}
202
203EAPI struct wl_registry *
204ecore_wl_registry_get(void)
205{
206 return _ecore_wl_disp->wl.registry;
207}
208
197EAPI void 209EAPI void
198ecore_wl_screen_size_get(int *w, int *h) 210ecore_wl_screen_size_get(int *w, int *h)
199{ 211{
@@ -377,6 +389,9 @@ _ecore_wl_cb_handle_global(void *data, struct wl_registry *registry, unsigned in
377 ewd = data; 389 ewd = data;
378 390
379 global = malloc(sizeof(Ecore_Wl_Global)); 391 global = malloc(sizeof(Ecore_Wl_Global));
392
393 memset(global, 0, sizeof(Ecore_Wl_Global));
394
380 global->id = id; 395 global->id = id;
381 global->interface = strdup(interface); 396 global->interface = strdup(interface);
382 global->version = version; 397 global->version = version;