Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_dnd.c ewl_dnd.h ewl_embed.c ewl_embed.h ewl_engines.c 
        ewl_engines.h ewl_entry.c ewl_window.c ewl_window.h 


Log Message:
- move ewl_window_dnd_aware_set to ewl_embed_dnd_aware_set
- change ewl_dnd_provides_* to ewl_dnd_provided_*
- change ewl_dnd_accepts_* to ewl_dnd_accepted_*
- formating and other cleanups

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_dnd.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- ewl_dnd.c   7 Sep 2006 20:44:06 -0000       1.22
+++ ewl_dnd.c   8 Sep 2006 01:05:17 -0000       1.23
@@ -24,8 +24,8 @@
 static Ewl_Widget *ewl_dnd_widget = NULL;
 
 static Ecore_Hash *ewl_dnd_position_hash;
-static Ecore_Hash *ewl_dnd_provides_hash;
-static Ecore_Hash *ewl_dnd_accepts_hash;
+static Ecore_Hash *ewl_dnd_provided_hash;
+static Ecore_Hash *ewl_dnd_accepted_hash;
 static int ewl_dnd_status = 0;
 
 Ecore_Event_Handler *ewl_dnd_mouse_up_handler;
@@ -61,17 +61,17 @@
        if (!ewl_dnd_position_hash)
                DRETURN_INT(FALSE, DLEVEL_STABLE);
 
-       ewl_dnd_provides_hash = ecore_hash_new(ecore_direct_hash, 
+       ewl_dnd_provided_hash = ecore_hash_new(ecore_direct_hash, 
                                                ecore_direct_compare);
-       if (!ewl_dnd_provides_hash) {
+       if (!ewl_dnd_provided_hash) {
                ecore_hash_destroy(ewl_dnd_position_hash);
                DRETURN_INT(FALSE, DLEVEL_STABLE);
        }
 
-       ewl_dnd_accepts_hash = ecore_hash_new(ecore_direct_hash, 
+       ewl_dnd_accepted_hash = ecore_hash_new(ecore_direct_hash, 
                                                ecore_direct_compare);
-       if (!ewl_dnd_accepts_hash) {
-               ecore_hash_destroy(ewl_dnd_provides_hash);
+       if (!ewl_dnd_accepted_hash) {
+               ecore_hash_destroy(ewl_dnd_provided_hash);
                ecore_hash_destroy(ewl_dnd_position_hash);
                DRETURN_INT(FALSE, DLEVEL_STABLE);
        }
@@ -93,8 +93,8 @@
        DENTER_FUNCTION(DLEVEL_STABLE);
 
        ecore_hash_destroy(ewl_dnd_position_hash);
-       ecore_hash_destroy(ewl_dnd_provides_hash);
-       ecore_hash_destroy(ewl_dnd_accepts_hash);
+       ecore_hash_destroy(ewl_dnd_provided_hash);
+       ecore_hash_destroy(ewl_dnd_accepted_hash);
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
@@ -123,7 +123,7 @@
  * @brief: Sets the mimetypes the designated widget can provide for DND
  */
 void
-ewl_dnd_provides_types_set(Ewl_Widget *w, const char **types)
+ewl_dnd_provided_types_set(Ewl_Widget *w, const char **types)
 {
        char *type;
 
@@ -131,10 +131,10 @@
        DCHECK_PARAM_PTR("w", w);
        DCHECK_TYPE("w", w, EWL_WIDGET_TYPE);
 
-       type = ecore_hash_get(ewl_dnd_provides_hash, w);
+       type = ecore_hash_get(ewl_dnd_provided_hash, w);
        IF_FREE(type);
 
-       ecore_hash_set(ewl_dnd_provides_hash, w, ewl_dnd_types_encode(types));
+       ecore_hash_set(ewl_dnd_provided_hash, w, ewl_dnd_types_encode(types));
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
@@ -145,21 +145,19 @@
  * @brief: Verifies the specified widget provides the given mimetype
  */
 int
-ewl_dnd_provides_types_contains(Ewl_Widget *w, char *type)
+ewl_dnd_provided_types_contains(Ewl_Widget *w, char *type)
 {
        char *types;
+       int ret = FALSE;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET("w", w, FALSE);
        DCHECK_TYPE_RET("w", w, EWL_WIDGET_TYPE, FALSE);
 
-       types = ecore_hash_get(ewl_dnd_provides_hash, w);
-       if (types) {
-               DRETURN_INT(ewl_dnd_types_encoded_contains(types, type), 
DLEVEL_STABLE);
-       }
-       else {
-               DRETURN_INT(FALSE, DLEVEL_STABLE);
-       }
+       types = ecore_hash_get(ewl_dnd_provided_hash, w);
+       if (types) ret = ewl_dnd_types_encoded_contains(types, type);
+
+       DRETURN_INT(ret, DLEVEL_STABLE);
 }
 
 
@@ -169,7 +167,7 @@
  * @brief: Gets the mimetypes the designated widget can provide for DND
  */
 const char **
-ewl_dnd_provides_types_get(Ewl_Widget *w)
+ewl_dnd_provided_types_get(Ewl_Widget *w)
 {
        const char **types;
 
@@ -177,7 +175,7 @@
        DCHECK_PARAM_PTR_RET("w", w, NULL);
        DCHECK_TYPE_RET("w", w, EWL_WIDGET_TYPE, NULL);
 
-       types = ecore_hash_get(ewl_dnd_provides_hash, w);
+       types = ecore_hash_get(ewl_dnd_provided_hash, w);
 
        DRETURN_PTR(types, DLEVEL_STABLE);
 }
@@ -189,7 +187,7 @@
  * @brief: Sets the mimetypes the designated widget can accept for DND
  */
 void
-ewl_dnd_accepts_types_set(Ewl_Widget *w, const char **types)
+ewl_dnd_accepted_types_set(Ewl_Widget *w, const char **types)
 {
        char *type;
 
@@ -197,10 +195,10 @@
        DCHECK_PARAM_PTR("w", w);
        DCHECK_TYPE("w", w, EWL_WIDGET_TYPE);
 
-       type = ecore_hash_get(ewl_dnd_accepts_hash, w);
+       type = ecore_hash_get(ewl_dnd_accepted_hash, w);
        IF_FREE(type);
 
-       ecore_hash_set(ewl_dnd_accepts_hash, w, ewl_dnd_types_encode(types));
+       ecore_hash_set(ewl_dnd_accepted_hash, w, ewl_dnd_types_encode(types));
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
@@ -211,22 +209,19 @@
  * @brief: Verifies the specified widget accepts the given mimetype
  */
 int
-ewl_dnd_accepts_types_contains(Ewl_Widget *w, char *type)
+ewl_dnd_accepted_types_contains(Ewl_Widget *w, char *type)
 {
        char *types;
+       int ret = FALSE;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET("w", w, FALSE);
        DCHECK_TYPE_RET("w", w, EWL_WIDGET_TYPE, FALSE);
 
-       types = ecore_hash_get(ewl_dnd_accepts_hash, w);
+       types = ecore_hash_get(ewl_dnd_accepted_hash, w);
+       if (types) ret = ewl_dnd_types_encoded_contains(types, type);
 
-       if (types) {
-               DRETURN_INT(ewl_dnd_types_encoded_contains(types, type), 
DLEVEL_STABLE);
-       }
-       else {
-               DRETURN_INT(FALSE, DLEVEL_STABLE);
-       }
+       DRETURN_INT(ret, DLEVEL_STABLE);
 }
 
 /**
@@ -235,7 +230,7 @@
  * @brief: Gets the mimetypes the designated widget can accept for DND
  */
 const char **
-ewl_dnd_accepts_types_get(Ewl_Widget *w)
+ewl_dnd_accepted_types_get(Ewl_Widget *w)
 {
        const char **types;
 
@@ -243,7 +238,7 @@
        DCHECK_PARAM_PTR_RET("w", w, NULL);
        DCHECK_TYPE_RET("w", w, EWL_WIDGET_TYPE, NULL);
 
-       types = ecore_hash_get(ewl_dnd_provides_hash, w);
+       types = ecore_hash_get(ewl_dnd_provided_hash, w);
 
        DRETURN_PTR(types, DLEVEL_STABLE);
 }
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_dnd.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- ewl_dnd.h   5 Sep 2006 06:10:22 -0000       1.15
+++ ewl_dnd.h   8 Sep 2006 01:05:17 -0000       1.16
@@ -26,13 +26,13 @@
 Ewl_Dnd_Types  *ewl_dnd_types_for_widget_get(Ewl_Widget *widget);
 int              ewl_dnd_type_supported(char *type);
 
-void            ewl_dnd_provides_types_set(Ewl_Widget *w, const char **types);
-int             ewl_dnd_provides_types_contains(Ewl_Widget *w, char *type);
-const char     **ewl_dnd_provides_types_get(Ewl_Widget *w);
+void            ewl_dnd_provided_types_set(Ewl_Widget *w, const char **types);
+int             ewl_dnd_provided_types_contains(Ewl_Widget *w, char *type);
+const char     **ewl_dnd_provided_types_get(Ewl_Widget *w);
 
-void            ewl_dnd_accepts_types_set(Ewl_Widget *w, const char **types);
-int             ewl_dnd_accepts_types_contains(Ewl_Widget *w, char *type);
-const char     **ewl_dnd_accepts_types_get(Ewl_Widget *w);
+void            ewl_dnd_accepted_types_set(Ewl_Widget *w, const char **types);
+int             ewl_dnd_accepted_types_contains(Ewl_Widget *w, char *type);
+const char     **ewl_dnd_accepted_types_get(Ewl_Widget *w);
 
 void            ewl_dnd_disable(void);
 void            ewl_dnd_enable(void);
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_embed.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -3 -r1.77 -r1.78
--- ewl_embed.c 7 Sep 2006 18:53:09 -0000       1.77
+++ ewl_embed.c 8 Sep 2006 01:05:17 -0000       1.78
@@ -922,7 +922,7 @@
         * If a widget is expecting DND data, send the data to the widget
         */
        if (embed->dnd_widget) {
-               if (ewl_dnd_accepts_types_contains(embed->dnd_widget, type)) {
+               if (ewl_dnd_accepted_types_contains(embed->dnd_widget, type)) {
                        /* 
                         * setup the event struct 
                         */
@@ -1817,6 +1817,23 @@
 
        if (emb == ewl_embed_active_embed)
                ewl_embed_active_embed = NULL;
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
+ * @param embed: the embed to set dnd aware
+ * @return Returns no value.
+ * @brief Set an embed as being DND aware
+ */
+void
+ewl_embed_dnd_aware_set(Ewl_Embed *embed)
+{
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("embed", embed);
+       DCHECK_TYPE("embed", embed, EWL_EMBED_TYPE);
+
+       ewl_engine_embed_dnd_aware_set(embed);
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_embed.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- ewl_embed.h 7 Sep 2006 18:53:09 -0000       1.23
+++ ewl_embed.h 8 Sep 2006 01:05:17 -0000       1.24
@@ -141,6 +141,8 @@
 void            ewl_embed_freeze(Ewl_Embed *e);
 void            ewl_embed_thaw(Ewl_Embed *e);
 
+void            ewl_embed_dnd_aware_set(Ewl_Embed *embed);
+
 /*
  * Internally used callbacks, override at your own risk.
  */
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_engines.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- ewl_engines.c       1 Aug 2006 23:33:15 -0000       1.11
+++ ewl_engines.c       8 Sep 2006 01:05:17 -0000       1.12
@@ -806,26 +806,26 @@
 }
 
 /**
- * @param win: the window to work with
+ * @param embed: the embed to work with
  * @return Returns no value
  * @brief Sets the dnd awareness
  */
 void
-ewl_engine_window_dnd_aware_set(Ewl_Window *win)
+ewl_engine_embed_dnd_aware_set(Ewl_Embed *embed)
 {
-       Ewl_Engine_Cb_Window_Dnd_Aware_Set window_dnd_aware_set;
+       Ewl_Engine_Cb_Embed_Dnd_Aware_Set embed_dnd_aware_set;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
-       DCHECK_PARAM_PTR("win", win);
-       DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
+       DCHECK_PARAM_PTR("embed", embed);
+       DCHECK_TYPE("embed", embed, EWL_EMBED_TYPE);
 
-       if (!(win->window))
+       if (!(embed->evas_window))
                DRETURN(DLEVEL_STABLE);
 
-       window_dnd_aware_set = ewl_engine_hook_get(EWL_EMBED(win),
-                                       EWL_ENGINE_WINDOW_DND_AWARE_SET);
-       if (window_dnd_aware_set)
-               window_dnd_aware_set(win);
+       embed_dnd_aware_set = ewl_engine_hook_get(EWL_EMBED(embed),
+                                       EWL_ENGINE_EMBED_DND_AWARE_SET);
+       if (embed_dnd_aware_set)
+               embed_dnd_aware_set(embed);
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_engines.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- ewl_engines.h       1 Aug 2006 23:35:58 -0000       1.9
+++ ewl_engines.h       8 Sep 2006 01:05:17 -0000       1.10
@@ -40,7 +40,7 @@
 
        EWL_ENGINE_WINDOW_SELECTION_TEXT_SET, /**< Set the selection text */
        EWL_ENGINE_WINDOW_GEOMETRY_GET, /**< Get the window geometry */
-       EWL_ENGINE_WINDOW_DND_AWARE_SET,         /**< Set the window 
+       EWL_ENGINE_EMBED_DND_AWARE_SET,  /**< Set the window 
                                                                dnd aware */
        EWL_ENGINE_CANVAS_SETUP, /**< Setup the render canvas */
 
@@ -147,7 +147,7 @@
                                                        const char *txt);
 void            ewl_engine_window_geometry_get(Ewl_Window *win, int root,
                                                int *width, int *height);
-void            ewl_engine_window_dnd_aware_set(Ewl_Window *win);
+void            ewl_engine_embed_dnd_aware_set(Ewl_Embed *embed);
 
 void            ewl_engine_canvas_setup(Ewl_Window *win, int debug);
 void            ewl_engine_canvas_render(Ewl_Embed *embed);
@@ -195,7 +195,7 @@
 typedef void (*Ewl_Engine_Cb_Window_Geometry_Get)(Ewl_Window *win, 
                                                int *width, int *height); /**< 
Get the window 
                                                                geometry */
-typedef void (*Ewl_Engine_Cb_Window_Dnd_Aware_Set)(Ewl_Window *win);    /**< 
Set the window 
+typedef void (*Ewl_Engine_Cb_Embed_Dnd_Aware_Set)(Ewl_Embed *embed);    /**< 
Set the embed 
                                                                dnd aware */
 typedef void (*Ewl_Engine_Cb_Canvas_Setup)(Ewl_Window *win, int debug); /**< 
Setup the 
                                                         render canvas */
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_entry.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -3 -r1.64 -r1.65
--- ewl_entry.c 7 Sep 2006 18:58:16 -0000       1.64
+++ ewl_entry.c 8 Sep 2006 01:05:17 -0000       1.65
@@ -71,7 +71,7 @@
         * to show the cursor */
        ewl_entry_editable_set(e, TRUE);
        ewl_text_selectable_set(EWL_TEXT(e), TRUE);
-       ewl_dnd_accepts_types_set(e, text_types);
+       ewl_dnd_accepted_types_set(e, text_types);
 
        /* setup callbacks */
        ewl_callback_append(w, EWL_CALLBACK_FOCUS_IN,
@@ -523,7 +523,7 @@
 /**
  * @internal
  * @param w: The widget to work with
- * @param ev: DND positioin event
+ * @param ev: DND position event
  * @param data: UNUSED
  * @return Returns no value
  * @brief The dnd mouse move callback
@@ -531,15 +531,20 @@
 void
 ewl_entry_cb_dnd_position(Ewl_Widget *w, void *ev, void *data __UNUSED__)
 {
-       Ewl_Event_Dnd_Position *event = ev;
-       Ewl_Text *txt = EWL_TEXT(w);
+       Ewl_Event_Dnd_Position *event;
+       Ewl_Text *txt;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("w", w);
+       DCHECK_PARAM_PTR("ev", ev);
        DCHECK_TYPE("w", w, EWL_WIDGET_TYPE);
 
+       event = ev;
+       txt = EWL_TEXT(w);
+
        ewl_widget_focus_send(w);
-       ewl_text_cursor_position_set(txt, ewl_text_coord_index_map(txt, 
event->x, event->y));
+       ewl_text_cursor_position_set(txt, 
+                       ewl_text_coord_index_map(txt, event->x, event->y));
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
@@ -547,7 +552,7 @@
 /**
  * @internal
  * @param w: The widget to work with
- * @param ev: DND positioin event
+ * @param ev: DND data event
  * @param data: UNUSED
  * @return Returns no value
  * @brief The dnd mouse move callback
@@ -555,14 +560,18 @@
 void
 ewl_entry_cb_dnd_data(Ewl_Widget *w, void *ev, void *data __UNUSED__)
 {
-       Ewl_Event_Dnd_Data *event = ev;
-       Ewl_Text *txt = EWL_TEXT(w);
+       Ewl_Event_Dnd_Data *event;
+       Ewl_Text *txt;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("w", w);
+       DCHECK_PARAM_PTR("ev", ev);
        DCHECK_TYPE("w", w, EWL_WIDGET_TYPE);
 
-       ewl_text_text_insert(txt, event->data, 
ewl_text_cursor_position_get(txt));
+       event = ev;
+       txt = EWL_TEXT(w);
+       ewl_text_text_insert(txt, event->data, 
+                               ewl_text_cursor_position_get(txt));
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_window.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -3 -r1.58 -r1.59
--- ewl_window.c        7 Jul 2006 21:06:26 -0000       1.58
+++ ewl_window.c        8 Sep 2006 01:05:17 -0000       1.59
@@ -596,26 +596,6 @@
 }
 
 /**
- * @param win: the window to remove the border
- * @return Returns no value.
- * @brief Set a window as being DND aware
- *
- * Inform ecore_x that this window is capable of receiving DND events
- */
-void
-ewl_window_dnd_aware_set(Ewl_Window *win)
-{
-       DENTER_FUNCTION(DLEVEL_STABLE);
-       DCHECK_PARAM_PTR("win", win);
-       DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
-
-       win->flags |= EWL_FLAG_PROPERTY_DND_AWARE;
-       ewl_engine_window_dnd_aware_set(win);
-
-       DLEAVE_FUNCTION(DLEVEL_STABLE);
-}
-
-/**
  * @param win: The window to set the selection on
  * @param txt: The text to set into the selection
  * @return Returns no value.
@@ -671,7 +651,7 @@
                ewl_engine_window_geometry_get(window, TRUE, &width, &height);
                ewl_object_maximum_size_set(EWL_OBJECT(window), width, height);
        }
-       ewl_engine_window_dnd_aware_set(window);
+       ewl_engine_embed_dnd_aware_set(EWL_EMBED(window));
 
        ewl_engine_canvas_setup(window, ewl_config.evas.render_debug);
 
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_window.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- ewl_window.h        7 Jul 2006 21:06:26 -0000       1.20
+++ ewl_window.h        8 Sep 2006 01:05:17 -0000       1.21
@@ -79,7 +79,6 @@
 int             ewl_window_pointer_grab_get(Ewl_Window *win);
 void            ewl_window_override_set(Ewl_Window *win, int override);
 int             ewl_window_override_get(Ewl_Window *win);
-void            ewl_window_dnd_aware_set(Ewl_Window *win);
 void            ewl_window_selection_text_set(Ewl_Window *win, const char 
*txt);
 
 /*



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to