diff --git a/ChangeLog b/ChangeLog index 1011b6eb34..c3137991ab 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 < * 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: 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 74c3f6174b..74b4815430 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 { @@ -486,6 +491,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 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) 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;