From 9b8e54d3b19e0cc3b31740b78a61e6affb438e52 Mon Sep 17 00:00:00 2001 From: Brett Nash Date: Fri, 17 Sep 2010 05:39:04 +0000 Subject: [PATCH] Move cnp/dnd -> elm_widget. Officially Experimental for apps. Expect to see changes in the very short term future for the CNP/DND code. It will break etc etc etc. SVN revision: 52359 --- legacy/elementary/src/lib/elm_priv.h | 38 ------------------ legacy/elementary/src/lib/elm_widget.h | 53 ++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 38 deletions(-) diff --git a/legacy/elementary/src/lib/elm_priv.h b/legacy/elementary/src/lib/elm_priv.h index 17d88f1467..cb4d8e59cf 100644 --- a/legacy/elementary/src/lib/elm_priv.h +++ b/legacy/elementary/src/lib/elm_priv.h @@ -28,9 +28,6 @@ typedef struct _Elm_Config Elm_Config; typedef struct _Elm_Module Elm_Module; -typedef struct _Elm_Drop_Data Elm_Drop_Data; - -typedef Eina_Bool (*Elm_Drop_Cb) (void *d, Evas_Object *o, Elm_Drop_Data *data); struct _Elm_Theme { @@ -57,35 +54,7 @@ typedef enum _Elm_Engine ELM_OPENGL_SDL } Elm_Engine; -typedef enum _Elm_Sel_Type -{ - ELM_SEL_PRIMARY, - ELM_SEL_SECONDARY, - ELM_SEL_CLIPBOARD, - ELM_SEL_XDND, - ELM_SEL_MAX, -} Elm_Sel_Type; - -typedef enum _Elm_Sel_Format -{ - /** Plain unformated text: Used for things that don't want rich markup */ - ELM_SEL_FORMAT_TEXT = 0x01, - /** Edje textblock markup, including inline images */ - ELM_SEL_FORMAT_MARKUP = 0x02, - /** Images */ - ELM_SEL_FORMAT_IMAGE = 0x04, - /** Vcards */ - ELM_SEL_FORMAT_VCARD = 0x08, -} Elm_Sel_Format; - -struct _Elm_Drop_Data -{ - int x, y; - Elm_Sel_Format format; - void *data; - int len; -}; /* increment this whenever we change config enough that you need new * defaults for elm to work. @@ -171,13 +140,6 @@ void _elm_config_shutdown(void); void elm_tooltip_theme(Elm_Tooltip *tt); void elm_object_sub_tooltip_content_cb_set(Evas_Object *eventarea, Evas_Object *owner, Elm_Tooltip_Content_Cb func, const void *data, Evas_Smart_Cb del_cb); -Eina_Bool elm_selection_set(Elm_Sel_Type selection, Evas_Object *widget, Elm_Sel_Format format, const char *buf); -Eina_Bool elm_selection_clear(Elm_Sel_Type selection, Evas_Object *widget); -Eina_Bool elm_selection_get(Elm_Sel_Type selection, Elm_Sel_Format format, Evas_Object *widget); -Eina_Bool elm_drop_target_add(Evas_Object *widget, Elm_Sel_Type, Elm_Drop_Cb, void *); -Eina_Bool elm_drop_target_del(Evas_Object *widget); -Eina_Bool elm_drag_start(Evas_Object *, Elm_Sel_Format, const char *, void (*)(void *,Evas_Object*),void*); - Eina_Bool _elm_dangerous_call_check(const char *call); extern char *_elm_appname; diff --git a/legacy/elementary/src/lib/elm_widget.h b/legacy/elementary/src/lib/elm_widget.h index 27b0157088..cd3b25bc53 100644 --- a/legacy/elementary/src/lib/elm_widget.h +++ b/legacy/elementary/src/lib/elm_widget.h @@ -402,4 +402,57 @@ EAPI const char *_elm_widget_item_tooltip_style_get(const Elm_Widget_Item * #define ELM_CHECK_WIDTYPE(obj, widtype) \ if (!elm_widget_type_check((obj), (widtype))) return + +/** + * The drag and drop API. + * Currently experimental, and will change when it does dynamic type + * addition RSN. + * + * Here so applications can start to use it, if they ask elm nicely. + * + * And yes, elm_widget, should probably be elm_experimental... + * Complaints about this code should go to /dev/null, or failing that nash. + */ +typedef struct _Elm_Drop_Data Elm_Drop_Data; + +typedef Eina_Bool (*Elm_Drop_Cb) (void *d, Evas_Object *o, Elm_Drop_Data *data); + +typedef enum _Elm_Sel_Type +{ + ELM_SEL_PRIMARY, + ELM_SEL_SECONDARY, + ELM_SEL_CLIPBOARD, + ELM_SEL_XDND, + + ELM_SEL_MAX, +} Elm_Sel_Type; + +typedef enum _Elm_Sel_Format +{ + /** Plain unformated text: Used for things that don't want rich markup */ + ELM_SEL_FORMAT_TEXT = 0x01, + /** Edje textblock markup, including inline images */ + ELM_SEL_FORMAT_MARKUP = 0x02, + /** Images */ + ELM_SEL_FORMAT_IMAGE = 0x04, + /** Vcards */ + ELM_SEL_FORMAT_VCARD = 0x08, +} Elm_Sel_Format; + +struct _Elm_Drop_Data +{ + int x, y; + Elm_Sel_Format format; + void *data; + int len; +}; + +Eina_Bool elm_selection_set(Elm_Sel_Type selection, Evas_Object *widget, Elm_Sel_Format format, const char *buf); +Eina_Bool elm_selection_clear(Elm_Sel_Type selection, Evas_Object *widget); +Eina_Bool elm_selection_get(Elm_Sel_Type selection, Elm_Sel_Format format, Evas_Object *widget); +Eina_Bool elm_drop_target_add(Evas_Object *widget, Elm_Sel_Type, Elm_Drop_Cb, void *); +Eina_Bool elm_drop_target_del(Evas_Object *widget); +Eina_Bool elm_drag_start(Evas_Object *, Elm_Sel_Format, const char *, void (*)(void *,Evas_Object*),void*); + + #endif