Enlightenment CVS committal Author : ningerso Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/bin/tests/dnd_snoop Modified Files: ewl_dnd_snoop.c Log Message: Remove trailing whitespace. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/dnd_snoop/ewl_dnd_snoop.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- ewl_dnd_snoop.c 4 Jun 2007 18:46:32 -0000 1.12 +++ ewl_dnd_snoop.c 23 Aug 2007 05:26:44 -0000 1.13 @@ -25,37 +25,37 @@ * limited dragging of widgets. Getting started is fairly simple, even for some * rather complicated widgets. As an example, I'll run through the DND support * added to the entry widget. - * + * * The first step to setup DND support on a widget is to decide which MIME types * are allowed and understood by the widget. The entry displays text, so * accepting the type "text/plain" is a safe choice. A NULL terminated list of * type strings is passed to the ewl_dnd_accepted_types_set, which enables DND * responses for the widget and helps to negotiate whether a drop will be * accepted at a given position. - * + * * @code * const char *text_types[] = { "text/plain", NULL }; - * + * * ewl_dnd_accepted_types_set(EWL_WIDGET(e), text_types); * @endcode - * + * * One key feature for DND support in the entry widget was to allow dragging * text to arbitrary positions within the visible text area. This is * accomplished by registering a callback for the EWL_CALLBACK_DND_POSITION * event on the entry widget. - * + * * @code * ewl_callback_append(w, EWL_CALLBACK_DND_POSITION, ewl_entry_cb_dnd_position, NULL); * @endcode - * + * * When the mouse moves during a DND event over the specified entry w the * ewl_entry_cb_dnd_position function will be called. This function prototype * looks like all other EWL callback prototypes: - * + * * @code * void ewl_entry_cb_dnd_position(Ewl_Widget *w, void *ev, void *data); * @endcode - * + * * In this case, the void *ev parameter points to a Ewl_Event_Dnd_Position * struct, which contains more detailed information about the event. We can use * the coordinates from the event to position the cursor within our entry to @@ -63,61 +63,61 @@ * widget, the text calls are used directly on the widget to alter the entry * contents. The code to accomplish this is rather small when the extra * debugging information is removed: - * + * * @code * void * ewl_entry_cb_dnd_position(Ewl_Widget *w, void *ev, void *data) * { * Ewl_Event_Dnd_Position *event; * Ewl_Text *txt; - * + * * event = ev; * txt = EWL_TEXT(w); - * + * * if (EWL_ENTRY(w)->editable && !DISABLED(w)) { * ewl_widget_focus_send(w); * ewl_text_cursor_position_set(txt, ewl_text_coord_index_map(txt, event->x, event->y)); * } * } * @endcode - * + * * Once the cursor has been positioned, the only event we care about is * receiving the data from the drop. This is accomplished by using the * EWL_CALLBACK_DND_DATA callback which should also be placed on the entry * widget. - * + * * @code * ewl_callback_append(w, EWL_CALLBACK_DND_DATA, ewl_entry_cb_dnd_data, NULL); * @endcode - * + * * The function prototype for ewl_entry_cb_dnd_data is identical to * ewl_entry_cb_dnd_position, but the void *ev parameter is of type * Ewl_Event_Dnd_Data. Since we only registered to receive plain text data * dropped on the entry, we can insert the event data directly into the entry at * the current cursor position. - * + * * @code * void * ewl_entry_cb_dnd_data(Ewl_Widget *w, void *ev, void *data) * { * Ewl_Event_Dnd_Data *event; * Ewl_Text *txt; - * + * * event = ev; * txt = EWL_TEXT(w); - * + * * if (EWL_ENTRY(w)->editable && !DISABLED(w)) { * ewl_text_text_insert(txt, event->data, * ewl_text_cursor_position_get(txt)); * } * } * @endcode - * + * * Considering the complicated nature of the Xdnd protocol, we are able to * accomplish a considerable amount of work in very few lines of code. While * some flexibility is sacrificed to achieve this, almost all of the protocol * events are available for widgets to override as they please. - * + * * Check back for followup information to handle drag events on widgets. */ @@ -156,7 +156,7 @@ static Ewl_Widget *text = NULL; -void +void test_info(Ewl_Test *test) { test->name = "DND Snoop"; @@ -176,22 +176,22 @@ /* Register DND handlers */ #ifdef ENABLE_EWL_SOFTWARE_X11 ewl_dnd_enter_handler = ecore_event_handler_add( - ECORE_X_EVENT_XDND_ENTER, + ECORE_X_EVENT_XDND_ENTER, ewl_dnd_snoop_cb_enter, NULL); ewl_dnd_position_handler = ecore_event_handler_add( - ECORE_X_EVENT_XDND_POSITION, + ECORE_X_EVENT_XDND_POSITION, ewl_dnd_snoop_cb_position, NULL); ewl_dnd_status_handler = ecore_event_handler_add( - ECORE_X_EVENT_XDND_STATUS, + ECORE_X_EVENT_XDND_STATUS, ewl_dnd_snoop_cb_status, NULL); ewl_dnd_leave_handler = ecore_event_handler_add( - ECORE_X_EVENT_XDND_LEAVE, + ECORE_X_EVENT_XDND_LEAVE, ewl_dnd_snoop_cb_leave, NULL); ewl_dnd_drop_handler = ecore_event_handler_add( - ECORE_X_EVENT_XDND_DROP, + ECORE_X_EVENT_XDND_DROP, ewl_dnd_snoop_cb_drop, NULL); ewl_dnd_finished_handler = ecore_event_handler_add( - ECORE_X_EVENT_XDND_FINISHED, + ECORE_X_EVENT_XDND_FINISHED, ewl_dnd_snoop_cb_finished, NULL); ewl_dnd_selection_clear_handler = ecore_event_handler_add( ECORE_X_EVENT_SELECTION_CLEAR, @@ -226,7 +226,7 @@ ewl_text_strikethrough_color_set(EWL_TEXT(o), 0, 0, 0, 255); ewl_text_glow_color_set(EWL_TEXT(o), 0, 255, 0, 128); - ewl_object_fill_policy_set(EWL_OBJECT(o), + ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK); ewl_widget_show(o); @@ -248,7 +248,7 @@ o = ewl_button_new(); ewl_button_label_set(EWL_BUTTON(o), "Clear"); ewl_container_child_append(EWL_CONTAINER(box), o); - ewl_callback_append(o, EWL_CALLBACK_CLICKED, + ewl_callback_append(o, EWL_CALLBACK_CLICKED, ewl_dnd_snoop_cb_clear, NULL); ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_SHRINK); ewl_widget_show(o); @@ -272,7 +272,7 @@ } static void -ewl_dnd_snoop_cb_dnd_position(Ewl_Widget *w, void *event, +ewl_dnd_snoop_cb_dnd_position(Ewl_Widget *w, void *event, void *data __UNUSED__) { char buf[PATH_MAX]; @@ -282,7 +282,7 @@ } static void -ewl_dnd_snoop_cb_dnd_drop(Ewl_Widget *w, void *event, +ewl_dnd_snoop_cb_dnd_drop(Ewl_Widget *w, void *event, void *data __UNUSED__) { char buf[PATH_MAX]; @@ -292,7 +292,7 @@ } static void -ewl_dnd_snoop_cb_dnd_data(Ewl_Widget *w, void *event, +ewl_dnd_snoop_cb_dnd_data(Ewl_Widget *w, void *event, void *data __UNUSED__) { char buf[PATH_MAX]; @@ -302,7 +302,7 @@ } static void -ewl_dnd_snoop_cb_dnd_data_request(Ewl_Widget *w, void *event, +ewl_dnd_snoop_cb_dnd_data_request(Ewl_Widget *w, void *event, void *data __UNUSED__) { char buf[PATH_MAX]; @@ -332,7 +332,7 @@ snprintf(buf, sizeof(buf), "\nXdnd Enter\n"); ewl_dnd_snoop_output(buf); - snprintf(buf, sizeof(buf), "\tWindow: %d\n\tSource: %d\n", + snprintf(buf, sizeof(buf), "\tWindow: %d\n\tSource: %d\n", event->win, event->source); ewl_dnd_snoop_output(buf); @@ -353,11 +353,11 @@ snprintf(buf, sizeof(buf), "\nXdnd Position\n"); ewl_dnd_snoop_output(buf); - snprintf(buf, sizeof(buf), "\tWindow: %d\n\tSource: %d\n", event->win, + snprintf(buf, sizeof(buf), "\tWindow: %d\n\tSource: %d\n", event->win, event->source); ewl_dnd_snoop_output(buf); - snprintf(buf, sizeof(buf), "\tPosition: %d,%d\n", event->position.x, + snprintf(buf, sizeof(buf), "\tPosition: %d,%d\n", event->position.x, event->position.y); ewl_dnd_snoop_output(buf); @@ -379,17 +379,17 @@ snprintf(buf, sizeof(buf), "\nXdnd Status\n"); ewl_dnd_snoop_output(buf); - snprintf(buf, sizeof(buf), "\tWindow: %d\n\tTarget: %d\n", + snprintf(buf, sizeof(buf), "\tWindow: %d\n\tTarget: %d\n", event->win, event->target); ewl_dnd_snoop_output(buf); snprintf(buf, sizeof(buf), "\tAccepts: %d\n", event->will_accept); ewl_dnd_snoop_output(buf); - snprintf(buf, sizeof(buf), "\tRegion: %d,%d %dx%d\n", + snprintf(buf, sizeof(buf), "\tRegion: %d,%d %dx%d\n", event->rectangle.x, event->rectangle.y, - event->rectangle.width, + event->rectangle.width, event->rectangle.height); ewl_dnd_snoop_output(buf); @@ -410,7 +410,7 @@ snprintf(buf, sizeof(buf), "\nXdnd Leave\n"); ewl_dnd_snoop_output(buf); - snprintf(buf, sizeof(buf), "\tWindow: %d\n\tSource: %d\n", + snprintf(buf, sizeof(buf), "\tWindow: %d\n\tSource: %d\n", event->win, event->source); ewl_dnd_snoop_output(buf); @@ -427,7 +427,7 @@ snprintf(buf, sizeof(buf), "\nXdnd Drop\n"); ewl_dnd_snoop_output(buf); - snprintf(buf, sizeof(buf), "\tWindow: %d\n\tSource: %d\n", + snprintf(buf, sizeof(buf), "\tWindow: %d\n\tSource: %d\n", event->win, event->source); ewl_dnd_snoop_output(buf); @@ -436,7 +436,7 @@ XFree(name); ewl_dnd_snoop_output(buf); - snprintf(buf, sizeof(buf), "\tPosition: %d,%d\n", + snprintf(buf, sizeof(buf), "\tPosition: %d,%d\n", event->position.x, event->position.y); ewl_dnd_snoop_output(buf); @@ -453,7 +453,7 @@ snprintf(buf, sizeof(buf), "\nXdnd Finished\n"); ewl_dnd_snoop_output(buf); - snprintf(buf, sizeof(buf), "\tWindow: %d\n\tTarget: %d\n", + snprintf(buf, sizeof(buf), "\tWindow: %d\n\tTarget: %d\n", event->win, event->target); ewl_dnd_snoop_output(buf); @@ -469,7 +469,7 @@ } static int -ewl_dnd_snoop_cb_selection_clear(void *data __UNUSED__, int type __UNUSED__, +ewl_dnd_snoop_cb_selection_clear(void *data __UNUSED__, int type __UNUSED__, void *ev) { char buf[1024]; @@ -478,7 +478,7 @@ snprintf(buf, sizeof(buf), "\nSelection Clear\n"); ewl_dnd_snoop_output(buf); - snprintf(buf, sizeof(buf), "\tWindow: %d\n\tSelection%d\n", + snprintf(buf, sizeof(buf), "\tWindow: %d\n\tSelection%d\n", event->win, event->selection); ewl_dnd_snoop_output(buf); @@ -490,7 +490,7 @@ } static int -ewl_dnd_snoop_cb_selection_request(void *data __UNUSED__, int type __UNUSED__, +ewl_dnd_snoop_cb_selection_request(void *data __UNUSED__, int type __UNUSED__, void *ev) { char buf[1024]; @@ -529,7 +529,7 @@ } static int -ewl_dnd_snoop_cb_selection_notify(void *data __UNUSED__, int type __UNUSED__, +ewl_dnd_snoop_cb_selection_notify(void *data __UNUSED__, int type __UNUSED__, void *ev) { char buf[1024]; @@ -538,7 +538,7 @@ snprintf(buf, sizeof(buf), "\nSelection Notify\n"); ewl_dnd_snoop_output(buf); - snprintf(buf, sizeof(buf), "\tWindow: %d\n\tSelection%d\n", + snprintf(buf, sizeof(buf), "\tWindow: %d\n\tSelection%d\n", event->win, event->selection); ewl_dnd_snoop_output(buf); @@ -556,7 +556,7 @@ } static int -ewl_dnd_snoop_cb_client_message(void *data __UNUSED__, int type __UNUSED__, +ewl_dnd_snoop_cb_client_message(void *data __UNUSED__, int type __UNUSED__, void *ev) { char buf[1024]; @@ -567,7 +567,7 @@ ewl_dnd_snoop_output(buf); name = XGetAtomName(ecore_x_display_get(), event->message_type); - snprintf(buf, sizeof(buf), "\tWindow: %d\n\tType: %s\n", + snprintf(buf, sizeof(buf), "\tWindow: %d\n\tType: %s\n", event->win, name); XFree(name); @@ -582,7 +582,7 @@ #endif static void -ewl_dnd_snoop_cb_clear(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__, +ewl_dnd_snoop_cb_clear(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__, void *data __UNUSED__) { ewl_text_clear(EWL_TEXT(text)); ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs