*
* Here is a simple example
*
- * dpy = tpl_display_get(NULL);
+ * dpy = tpl_display_create(...);
* sfc = tpl_surface_create(dpy, ...);
*
* while (1)
* TPL provides platform independent APIs by implementing platform dependent
* things in a backend. These types represent types of such backends. One of
* these types should be specified when creating a TPL display object when
- * calling tpl_display_get().
+ * calling tpl_display_create().
*
- * @see tpl_display_get()
- * @see tpl_display_get_backend_type()
+ * @see tpl_display_create()
*/
typedef enum
{
void * tpl_object_get_user_data(tpl_object_t *object);
/**
- * Create or get TPL display object for the given native display.
+ * Create TPL display object for the given native display.
*
* Create a TPL display if there's no already existing TPL display for the
* given native display. If given NULL for native_dpy, this function will
* @param native_dpy handle to the native display.
* @return pointer to the display on success, NULL on failure.
*/
-tpl_display_t * tpl_display_get(tpl_backend_type_t type,
- tpl_handle_t native_dpy);
+tpl_display_t * tpl_display_create(tpl_backend_type_t type,
+ tpl_handle_t native_dpy);
+
+/**
+ * Get TPL display object for the given native display.
+ *
+ * If there's already existing TPL display for the given native display,
+ * then return the TPL display.
+ *
+ * @param native_dpy handle to the native display.
+ * @return pointer to the display on success, NULL on failure.
+ */
+tpl_display_t * tpl_display_get(tpl_handle_t native_dpy);
/**
* Bind a client connection(display handle) to the existed TPL display.
}
tpl_display_t *
-tpl_display_get(tpl_backend_type_t type, tpl_handle_t native_dpy)
+tpl_display_create(tpl_backend_type_t type, tpl_handle_t native_dpy)
{
tpl_display_t *display;
tpl_bool_t ret;
/* Search for an already connected display for the given native display. */
display = __tpl_runtime_find_display(type, native_dpy);
- /* exact match found, can return immediately */
- if (NULL != display)
- return display;
+ /* If tpl_display already exists, then return NULL */
+ if (display) return NULL;
/* if backend is unknown, try to find the best match from the list of supported types */
if (TPL_BACKEND_UNKNOWN == type)
return display;
}
+tpl_display_t *
+tpl_display_get(tpl_handle_t native_dpy)
+{
+ tpl_display_t *display;
+
+ /* Search for an already connected display for the given native display. */
+ display = __tpl_runtime_find_display(TPL_BACKEND_UNKNOWN, native_dpy);
+
+ return display;
+}
+
tpl_bool_t
tpl_display_bind_client_display_handle(tpl_display_t *display, tpl_handle_t native_dpy)
{