Ecore_X: Fix formatting of new xfixes code (someone's editor is not
authordevilhorns <devilhorns@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 8 Aug 2011 18:05:07 +0000 (18:05 +0000)
committerdevilhorns <devilhorns@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 8 Aug 2011 18:05:07 +0000 (18:05 +0000)
indenting correctly) ;)

Fix formatting of some existing code to declare variables at the top
of functions.

Remove some unused variables.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@62209 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore_x/xcb/ecore_xcb_events.c

index c6b2e32..bd99b50 100644 (file)
@@ -186,6 +186,7 @@ _ecore_xcb_events_init(void)
         ECORE_X_EVENT_SELECTION_CLEAR = ecore_event_type_new();
         ECORE_X_EVENT_SELECTION_REQUEST = ecore_event_type_new();
         ECORE_X_EVENT_SELECTION_NOTIFY = ecore_event_type_new();
+        ECORE_X_EVENT_FIXES_SELECTION_NOTIFY = ecore_event_type_new();
         ECORE_X_EVENT_CLIENT_MESSAGE = ecore_event_type_new();
         ECORE_X_EVENT_WINDOW_SHAPE = ecore_event_type_new();
         ECORE_X_EVENT_SCREENSAVER_NOTIFY = ecore_event_type_new();
@@ -368,7 +369,7 @@ _ecore_xcb_events_handle(xcb_generic_event_t *ev)
      _ecore_xcb_event_handle_generic_event(ev);
 #ifdef ECORE_XCB_DAMAGE
    else if ((_ecore_xcb_event_damage >= 0) && 
-            (response == _ecore_xcb_event_damage + XCB_DAMAGE_NOTIFY))
+            (response == (_ecore_xcb_event_damage + XCB_DAMAGE_NOTIFY)))
      _ecore_xcb_event_handle_damage_notify(ev);
 #endif
 #ifdef ECORE_XCB_RANDR
@@ -388,7 +389,7 @@ _ecore_xcb_events_handle(xcb_generic_event_t *ev)
 #endif
 #ifdef ECORE_XCB_SHAPE
    else if ((_ecore_xcb_event_shape >= 0) && 
-            (response == _ecore_xcb_event_shape + XCB_SHAPE_NOTIFY))
+            (response == (_ecore_xcb_event_shape + XCB_SHAPE_NOTIFY)))
      _ecore_xcb_event_handle_shape_change(ev);
 #endif
 #ifdef ECORE_XCB_SYNC
@@ -1792,14 +1793,15 @@ _ecore_xcb_event_handle_mapping_notify(xcb_generic_event_t *event)
 static void 
 _ecore_xcb_event_handle_damage_notify(xcb_generic_event_t *event) 
 {
-   LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
-   _ecore_xcb_event_last_mouse_move = EINA_FALSE;
-
 #ifdef ECORE_XCB_DAMAGE
    xcb_damage_notify_event_t *ev;
    Ecore_X_Event_Damage *e;
+#endif
 
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+   _ecore_xcb_event_last_mouse_move = EINA_FALSE;
+#ifdef ECORE_XCB_DAMAGE
    ev = (xcb_damage_notify_event_t *)event;
    if (!(e = calloc(1, sizeof(Ecore_X_Event_Damage)))) return;
 
@@ -1823,14 +1825,15 @@ _ecore_xcb_event_handle_damage_notify(xcb_generic_event_t *event)
 static void 
 _ecore_xcb_event_handle_randr_change(xcb_generic_event_t *event) 
 {
-   LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
-   _ecore_xcb_event_last_mouse_move = EINA_FALSE;
-
 #ifdef ECORE_XCB_RANDR
    xcb_randr_screen_change_notify_event_t *ev;
    Ecore_X_Event_Screen_Change *e;
+#endif
+
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
+   _ecore_xcb_event_last_mouse_move = EINA_FALSE;
+#ifdef ECORE_XCB_RANDR
    ev = (xcb_randr_screen_change_notify_event_t *)event;
    if (!(e = calloc(1, sizeof(Ecore_X_Event_Screen_Change)))) return;
 
@@ -1852,13 +1855,14 @@ _ecore_xcb_event_handle_randr_change(xcb_generic_event_t *event)
 static void 
 _ecore_xcb_event_handle_randr_notify(xcb_generic_event_t *event) 
 {
+#ifdef ECORE_XCB_RANDR
+   xcb_randr_notify_event_t *ev;
+#endif
+
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
    _ecore_xcb_event_last_mouse_move = EINA_FALSE;
-
 #ifdef ECORE_XCB_RANDR
-   xcb_randr_notify_event_t *ev;
-
    ev = (xcb_randr_notify_event_t *)event;
    switch (ev->subCode) 
      {
@@ -1880,12 +1884,14 @@ _ecore_xcb_event_handle_randr_notify(xcb_generic_event_t *event)
 static void 
 _ecore_xcb_event_handle_randr_crtc_change(xcb_generic_event_t *event) 
 {
-   LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
 #ifdef ECORE_XCB_RANDR
    xcb_randr_notify_event_t *ev;
    Ecore_X_Event_Randr_Crtc_Change *e;
+#endif
+
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
+#ifdef ECORE_XCB_RANDR
    ev = (xcb_randr_notify_event_t *)event;
    if (!(e = calloc(1, sizeof(Ecore_X_Event_Randr_Crtc_Change))))
      return;
@@ -1906,12 +1912,14 @@ _ecore_xcb_event_handle_randr_crtc_change(xcb_generic_event_t *event)
 static void 
 _ecore_xcb_event_handle_randr_output_change(xcb_generic_event_t *event) 
 {
-   LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
 #ifdef ECORE_XCB_RANDR
    xcb_randr_notify_event_t *ev;
    Ecore_X_Event_Randr_Output_Change *e;
+#endif
 
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+#ifdef ECORE_XCB_RANDR
    ev = (xcb_randr_notify_event_t *)event;
    if (!(e = calloc(1, sizeof(Ecore_X_Event_Randr_Crtc_Change))))
      return;
@@ -1931,12 +1939,14 @@ _ecore_xcb_event_handle_randr_output_change(xcb_generic_event_t *event)
 static void 
 _ecore_xcb_event_handle_randr_output_property_change(xcb_generic_event_t *event) 
 {
-   LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
 #ifdef ECORE_XCB_RANDR
    xcb_randr_notify_event_t *ev;
    Ecore_X_Event_Randr_Output_Property_Notify *e;
+#endif
+
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
+#ifdef ECORE_XCB_RANDR
    ev = (xcb_randr_notify_event_t *)event;
    if (!(e = calloc(1, sizeof(Ecore_X_Event_Randr_Output_Property_Notify))))
      return;
@@ -1957,14 +1967,15 @@ _ecore_xcb_event_handle_randr_output_property_change(xcb_generic_event_t *event)
 static void 
 _ecore_xcb_event_handle_screensaver_notify(xcb_generic_event_t *event) 
 {
-   LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
-   _ecore_xcb_event_last_mouse_move = EINA_FALSE;
-
 #ifdef ECORE_XCB_SCREENSAVER
    xcb_screensaver_notify_event_t *ev;
    Ecore_X_Event_Screensaver_Notify *e;
+#endif
+
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
+   _ecore_xcb_event_last_mouse_move = EINA_FALSE;
+#ifdef ECORE_XCB_SCREENSAVER
    ev = (xcb_screensaver_notify_event_t *)event;
    if (!(e = calloc(1, sizeof(Ecore_X_Event_Screensaver_Notify)))) return;
 
@@ -2019,14 +2030,16 @@ _ecore_xcb_event_handle_shape_change(xcb_generic_event_t *event)
 static void 
 _ecore_xcb_event_handle_sync_counter(xcb_generic_event_t *event) 
 {
+#ifdef ECORE_XCB_SYNC
+   xcb_sync_counter_notify_event_t *ev;
+   Ecore_X_Event_Sync_Counter *e;
+#endif
+
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
    _ecore_xcb_event_last_mouse_move = EINA_FALSE;
 
 #ifdef ECORE_XCB_SYNC
-   xcb_sync_counter_notify_event_t *ev;
-   Ecore_X_Event_Sync_Counter *e;
-
    ev = (xcb_sync_counter_notify_event_t *)event;
    if (!(e = calloc(1, sizeof(Ecore_X_Event_Sync_Counter)))) return;
 
@@ -2039,14 +2052,15 @@ _ecore_xcb_event_handle_sync_counter(xcb_generic_event_t *event)
 static void 
 _ecore_xcb_event_handle_sync_alarm(xcb_generic_event_t *event) 
 {
-   LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
-   _ecore_xcb_event_last_mouse_move = EINA_FALSE;
-
 #ifdef ECORE_XCB_SYNC
    xcb_sync_alarm_notify_event_t *ev;
    Ecore_X_Event_Sync_Alarm *e;
+#endif
+
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
+   _ecore_xcb_event_last_mouse_move = EINA_FALSE;
+#ifdef ECORE_XCB_SYNC
    ev = (xcb_sync_alarm_notify_event_t *)event;
    if (!(e = calloc(1, sizeof(Ecore_X_Event_Sync_Alarm)))) return;
 
@@ -2058,20 +2072,21 @@ _ecore_xcb_event_handle_sync_alarm(xcb_generic_event_t *event)
 }
 
 static void 
-_ecore_xcb_event_handle_xfixes_selection_notify(xcb_generic_event_t *event __UNUSED__
+_ecore_xcb_event_handle_xfixes_selection_notify(xcb_generic_event_t *event) 
 {
+#ifdef ECORE_XCB_XFIXES
    Ecore_X_Event_Fixes_Selection_Notify *e;
    Ecore_X_Atom sel;
    xcb_xfixes_selection_notify_event_t *ev;
+#endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
    _ecore_xcb_event_last_mouse_move = EINA_FALSE;
+#ifdef ECORE_XCB_XFIXES
    ev = (xcb_xfixes_selection_notify_event_t *)event;
 
-   e = calloc(1, sizeof(*e));
-   if (!e)
-      return;
+   if (!(e = calloc(1, sizeof(*e)))) return;
 
    e->win = ev->window;
    e->owner = ev->owner;
@@ -2079,18 +2094,17 @@ _ecore_xcb_event_handle_xfixes_selection_notify(xcb_generic_event_t *event __UNU
    e->selection_time = ev->selection_timestamp;
    e->atom = sel = ev->selection;
    if (sel == ECORE_X_ATOM_SELECTION_PRIMARY)
-      e->selection = ECORE_X_SELECTION_PRIMARY;
+     e->selection = ECORE_X_SELECTION_PRIMARY;
    else if (sel == ECORE_X_ATOM_SELECTION_SECONDARY)
-      e->selection = ECORE_X_SELECTION_SECONDARY;
+     e->selection = ECORE_X_SELECTION_SECONDARY;
    else if (sel == ECORE_X_ATOM_SELECTION_CLIPBOARD)
-      e->selection = ECORE_X_SELECTION_CLIPBOARD;
+     e->selection = ECORE_X_SELECTION_CLIPBOARD;
    else
-      e->selection = ECORE_X_SELECTION_OTHER;
+     e->selection = ECORE_X_SELECTION_OTHER;
    e->reason = ev->subtype;
 
    ecore_event_add(ECORE_X_EVENT_FIXES_SELECTION_NOTIFY, e, NULL, NULL);
-} /* _ecore_x_event_handle_fixes_selection_notify */
-
+#endif
 }
 
 static void 
@@ -2147,7 +2161,7 @@ _ecore_xcb_event_key_press(xcb_generic_event_t *event)
    xcb_keycode_t keycode = 0;
    xcb_key_press_event_t *xevent;
    char *keyname = NULL, *key = NULL;
-   char *compose = NULL, *tmp = NULL;
+   char *compose = NULL;
    char compose_buffer[256];
    int val = 0;
 
@@ -2176,7 +2190,7 @@ _ecore_xcb_event_key_press(xcb_generic_event_t *event)
         compose_buffer[val] = 0;
         compose = 
           eina_str_convert(nl_langinfo(CODESET), "UTF-8", compose_buffer);
-        tmp = compose;
+//        tmp = compose;
      }
 
    key = _ecore_xcb_keymap_keysym_to_string(sym);
@@ -2217,7 +2231,7 @@ _ecore_xcb_event_key_release(xcb_generic_event_t *event)
    xcb_keycode_t keycode = 0;
    xcb_key_release_event_t *xevent;
    char *keyname = NULL, *key = NULL;
-   char *compose = NULL, *tmp = NULL;
+   char *compose = NULL;
    char compose_buffer[256];
    int val = 0;
 
@@ -2246,7 +2260,7 @@ _ecore_xcb_event_key_release(xcb_generic_event_t *event)
         compose_buffer[val] = 0;
         compose = 
           eina_str_convert(nl_langinfo(CODESET), "UTF-8", compose_buffer);
-        tmp = compose;
+//        tmp = compose;
      }
 
    key = _ecore_xcb_keymap_keysym_to_string(sym);