Wayland Library Display Functions

Functions that deal with creating, connecting, or interacting with Wayland displays. More...

Functions

EAPI Ecore_Wl2_Display * ecore_wl2_display_create (const char *name)
 Create a new Wayland display.
EAPI void ecore_wl2_display_destroy (Ecore_Wl2_Display *display)
 Destroy an existing Wayland display.
EAPI Ecore_Wl2_Display * ecore_wl2_display_connect (const char *name)
 Connect to an existing Wayland display.
EAPI void ecore_wl2_display_disconnect (Ecore_Wl2_Display *display)
 Disconnect an existing Wayland display.
EAPI struct wl_display * ecore_wl2_display_get (Ecore_Wl2_Display *display)
 Retrieve the existing Wayland display.
EAPI struct wl_shm * ecore_wl2_display_shm_get (Ecore_Wl2_Display *display)
 Retrieve the wl_shm from a given Ecore_Wl2_Display.
EAPI void * ecore_wl2_display_dmabuf_get (Ecore_Wl2_Display *display)
 Retrieve the wl_dmabuf from a given Ecore_Wl2_Display.
EAPI Eina_Iterator * ecore_wl2_display_globals_get (Ecore_Wl2_Display *display)
 Return an Eina_Iterator that can be used to iterate through globals.
EAPI void ecore_wl2_display_screen_size_get (Ecore_Wl2_Display *display, int *w, int *h)
 Retrieves the size of the current screen.
EAPI Eina_Iterator * ecore_wl2_display_inputs_get (Ecore_Wl2_Display *display)
 Get all the Ecore_Wl2_Input from the display.
EAPI Ecore_Wl2_Input * ecore_wl2_display_input_find (const Ecore_Wl2_Display *display, unsigned int id)
 Find a seat for a given display object using the seat id.
EAPI Ecore_Wl2_Input * ecore_wl2_display_input_find_by_name (const Ecore_Wl2_Display *display, const char *name)
 Find a seat for a given display object using the seat id.
EAPI struct wl_registry * ecore_wl2_display_registry_get (Ecore_Wl2_Display *display)
 Retrieves the Wayland Registry used for the current Wayland display.
EAPI Eina_Bool ecore_wl2_display_sync_is_done (const Ecore_Wl2_Display *display)
 Check if the display has performed a sync.
EAPI const char * ecore_wl2_display_name_get (const Ecore_Wl2_Display *display)
 Get the name of the display object.
EAPI Ecore_Wl2_Window * ecore_wl2_display_window_find_by_surface (Ecore_Wl2_Display *display, struct wl_surface *surface)
 Finds an Ecore_Wl2_Window based on wl_surface.
EAPI Ecore_Wl2_Display * ecore_wl2_connected_display_get (const char *name)
 Gets the connected display object.
EAPI struct wl_compositor * ecore_wl2_display_compositor_get (Ecore_Wl2_Display *display)
 Gets the wl_compositor which belongs to this display.
EAPI int ecore_wl2_display_compositor_version_get (Ecore_Wl2_Display *disp)
 Return the version of the display's compositor object.
EAPI void ecore_wl2_display_terminate (Ecore_Wl2_Display *display)
 Terminate a Wayland display's main loop.

Detailed Description

Functions that deal with creating, connecting, or interacting with Wayland displays.

Function Documentation

◆ ecore_wl2_display_create()

EAPI Ecore_Wl2_Display * ecore_wl2_display_create ( const char * name)

Create a new Wayland display.

This function is typically used to create a new display for use with compositors, or to create a new display for use in nested compositors.

Parameters
nameThe display target name to create. If NULL, a default display name will be assigned.
Returns
The newly created Ecore_Wl2_Display
Since
1.17

References ECORE_FD_ERROR, ECORE_FD_READ, ecore_main_fd_handler_add(), ecore_main_fd_handler_prepare_callback_set(), ecore_wl2_display_create(), eina_hash_add(), eina_hash_find(), eina_hash_string_superfast_new(), and setenv().

Referenced by ecore_wl2_display_create().

◆ ecore_wl2_display_destroy()

EAPI void ecore_wl2_display_destroy ( Ecore_Wl2_Display * display)

Destroy an existing Wayland display.

This function is typically used by servers to terminate an existing Wayland display.

Parameters
displayThe display to terminate
Since
1.17

References ecore_timer_del(), ecore_wl2_display_destroy(), eina_hash_del_by_key(), and EINA_SAFETY_ON_NULL_RETURN.

Referenced by ecore_wl2_display_destroy().

◆ ecore_wl2_display_connect()

EAPI Ecore_Wl2_Display * ecore_wl2_display_connect ( const char * name)

Connect to an existing Wayland display.

This function is typically used by clients to connect to an existing Wayland display.

Parameters
nameThe display target name to connect to. If NULL, the default display is assumed.
Returns
The Ecore_Wl2_Display which was connected to
Since
1.17

References ecore_wl2_display_connect(), eina_hash_add(), eina_hash_find(), eina_hash_free(), eina_hash_int32_new(), and eina_hash_string_superfast_new().

Referenced by ecore_wl2_display_connect().

◆ ecore_wl2_display_disconnect()

EAPI void ecore_wl2_display_disconnect ( Ecore_Wl2_Display * display)

Disconnect an existing Wayland display.

This function is typically used by clients to disconnect from an existing Wayland display.

Parameters
displayThe display to disconnect from
Since
1.17

References ecore_wl2_display_disconnect(), eina_hash_del_by_key(), and EINA_SAFETY_ON_NULL_RETURN.

Referenced by ecore_wl2_display_disconnect(), and ecore_wl2_window_free().

◆ ecore_wl2_display_get()

EAPI struct wl_display * ecore_wl2_display_get ( Ecore_Wl2_Display * display)

Retrieve the existing Wayland display.

Parameters
displayThe Ecore_Wl2_Display for which to retrieve the existing Wayland display from
Returns
The wl_display which this Ecore_Wl2_Display is using
Since
1.17

References ecore_wl2_display_get(), and EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ecore_wl2_display_get().

◆ ecore_wl2_display_shm_get()

EAPI struct wl_shm * ecore_wl2_display_shm_get ( Ecore_Wl2_Display * display)

Retrieve the wl_shm from a given Ecore_Wl2_Display.

Parameters
displayThe Ecore_Wl2_Display for which to retrieve the existing Wayland shm interface from
Returns
The wl_shm which this Ecore_Wl2_Display is using
Since
1.17

References ecore_wl2_display_shm_get(), and EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ecore_wl2_display_shm_get().

◆ ecore_wl2_display_dmabuf_get()

EAPI void * ecore_wl2_display_dmabuf_get ( Ecore_Wl2_Display * display)

Retrieve the wl_dmabuf from a given Ecore_Wl2_Display.

Parameters
displayThe Ecore_Wl2_Display for which to retrieve the existing Wayland dmabuf interface from
Returns
The wl_dmabuf which this Ecore_Wl2_Display is using
Note
This is intended for client use only and should be used only after ecore_wl2_display_connect(). Also, the return type is void * instead of zpw_linux_dmabuf_v1 * since we don't want to change our public API every time the version changes in wayland-protocols.
Since
1.18

References ecore_wl2_display_dmabuf_get(), and EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ecore_wl2_display_dmabuf_get().

◆ ecore_wl2_display_globals_get()

EAPI Eina_Iterator * ecore_wl2_display_globals_get ( Ecore_Wl2_Display * display)

Return an Eina_Iterator that can be used to iterate through globals.

Parameters
displayThe Ecore_Wl2_Display for which to return a global iterator
Note
The caller of this function should free the returned Eina_Iterator when finished with it.
Since
1.17

References ecore_wl2_display_globals_get(), eina_hash_iterator_data_new(), and EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ecore_wl2_display_globals_get().

◆ ecore_wl2_display_screen_size_get()

EAPI void ecore_wl2_display_screen_size_get ( Ecore_Wl2_Display * display,
int * w,
int * h )

Retrieves the size of the current screen.

Parameters
displayThe display to get the screen size of
wwhere to return the width. May be NULL. Returns 0 on error.
hwhere to return the height. May be NULL. Returns 0 on error.
Since
1.17

References ecore_wl2_display_screen_size_get(), EINA_INLIST_FOREACH, and EINA_SAFETY_ON_NULL_RETURN.

Referenced by ecore_wl2_display_screen_size_get().

◆ ecore_wl2_display_inputs_get()

EAPI Eina_Iterator * ecore_wl2_display_inputs_get ( Ecore_Wl2_Display * display)

Get all the Ecore_Wl2_Input from the display.

Parameters
displayThe display
Returns
A Eina_Iterator of Ecore_Wl2_Input or NULL on error
Since
1.19

References ecore_wl2_display_inputs_get(), eina_inlist_iterator_new(), EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_SAFETY_ON_TRUE_RETURN_VAL.

Referenced by ecore_wl2_display_inputs_get().

◆ ecore_wl2_display_input_find()

EAPI Ecore_Wl2_Input * ecore_wl2_display_input_find ( const Ecore_Wl2_Display * display,
unsigned int id )

Find a seat for a given display object using the seat id.

Parameters
displayThe display
idThe seat id
Returns
The corresponding Ecore_Wl2_Input object or NULL if no match is found
Since
1.20

References ecore_wl2_display_input_find(), EINA_INLIST_FOREACH, EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_SAFETY_ON_TRUE_RETURN_VAL.

Referenced by ecore_wl2_display_input_find().

◆ ecore_wl2_display_input_find_by_name()

EAPI Ecore_Wl2_Input * ecore_wl2_display_input_find_by_name ( const Ecore_Wl2_Display * display,
const char * name )

Find a seat for a given display object using the seat id.

Parameters
displayThe display
nameThe seat name
Returns
The corresponding Ecore_Wl2_Input object or NULL if no match is found
Since
1.20

References ecore_wl2_display_input_find_by_name(), EINA_INLIST_FOREACH, EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_SAFETY_ON_TRUE_RETURN_VAL.

Referenced by ecore_wl2_display_input_find_by_name(), and ecore_wl2_input_default_input_get().

◆ ecore_wl2_display_registry_get()

EAPI struct wl_registry * ecore_wl2_display_registry_get ( Ecore_Wl2_Display * display)

Retrieves the Wayland Registry used for the current Wayland display.

Parameters
displayThe display to get the registry of
Returns
The current wayland registry, or NULL on error
Since
1.17

References ecore_wl2_display_registry_get(), and EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ecore_wl2_display_registry_get().

◆ ecore_wl2_display_sync_is_done()

EAPI Eina_Bool ecore_wl2_display_sync_is_done ( const Ecore_Wl2_Display * display)

Check if the display has performed a sync.

Parameters
displayThe display
Returns
True if the display sync has occurred
See also
ECORE_WL2_EVENT_SYNC_DONE
Since
1.20

References ecore_wl2_display_sync_is_done(), EINA_FALSE, and EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ecore_wl2_display_sync_is_done().

◆ ecore_wl2_display_name_get()

EAPI const char * ecore_wl2_display_name_get ( const Ecore_Wl2_Display * display)

Get the name of the display object.

Parameters
displayThe display
Returns
The name of the display object
Since
1.20

References ecore_wl2_display_name_get(), and EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ecore_wl2_display_name_get().

◆ ecore_wl2_display_window_find_by_surface()

EAPI Ecore_Wl2_Window * ecore_wl2_display_window_find_by_surface ( Ecore_Wl2_Display * display,
struct wl_surface * surface )

Finds an Ecore_Wl2_Window based on wl_surface.

Parameters
displayThe display to search for the window
surfaceThe wl_surface of the window to find
Returns
The Ecore_Wl2_Window if found, or NULL if no such window exists
Since
1.24

References ecore_wl2_display_window_find_by_surface().

Referenced by ecore_wl2_display_window_find_by_surface(), and ecore_wl2_window_surface_find().

◆ ecore_wl2_connected_display_get()

EAPI Ecore_Wl2_Display * ecore_wl2_connected_display_get ( const char * name)

Gets the connected display object.

This function is typically used by clients to get an existing Wayland display.

Parameters
nameThe display target name. If NULL, the default display is assumed.
Returns
The Ecore_Wl2_Display which was connected to
Since
1.24

References ecore_wl2_connected_display_get(), eina_hash_find(), and EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ecore_wl2_connected_display_get(), and ecore_wl2_window_surface_find().

◆ ecore_wl2_display_compositor_get()

EAPI struct wl_compositor * ecore_wl2_display_compositor_get ( Ecore_Wl2_Display * display)

Gets the wl_compositor which belongs to this display.

Parameters
displayThe Ecore_Wl2_Display to get the compositor of
Returns
The wl_compositor associated with this display
Since
1.24

References ecore_wl2_display_compositor_get(), and EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ecore_wl2_display_compositor_get().

◆ ecore_wl2_display_compositor_version_get()

EAPI int ecore_wl2_display_compositor_version_get ( Ecore_Wl2_Display * disp)

Return the version of the display's compositor object.

Parameters
dispthe display to get the compositor object version from
Returns
the version of the display's compositor object
Since
1.17

References ecore_wl2_display_compositor_version_get(), and EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ecore_wl2_display_compositor_version_get().

◆ ecore_wl2_display_terminate()

EAPI void ecore_wl2_display_terminate ( Ecore_Wl2_Display * display)

Terminate a Wayland display's main loop.

This function is typically used by servers to terminate the Wayland display main loop. This is usually only called when a server encounters an error.

Parameters
displayThe Ecore_Wl2_Display to terminate
Since
1.17

References ecore_wl2_display_terminate(), and EINA_SAFETY_ON_NULL_RETURN.

Referenced by ecore_wl2_display_terminate().