Change to the linux kernel coding style
[wmaker-crm.git] / wmlib / event.c
index 1df2c67..6caeb75 100644 (file)
 #include "app.h"
 #include "menu.h"
 
-
-static Atom _XA_WINDOWMAKER_MENU=0;
+static Atom _XA_WINDOWMAKER_MENU = 0;
 
 enum {
-    wmSelectItem = 1
+       wmSelectItem = 1
 };
 
-
-static wmMenuEntry*
-findEntry(WMMenu *menu, int tag)
+static wmMenuEntry *findEntry(WMMenu * menu, int tag)
 {
-    wmMenuEntry *entry=menu->first;
+       wmMenuEntry *entry = menu->first;
 
-    while (entry) {
-        if (entry->tag == tag) {
-            return entry;
-        }
-        if (entry->cascade) {
-            wmMenuEntry *tmp;
-            tmp = findEntry(entry->cascade, tag);
-            if (tmp)
-                return tmp;
-        }
-        entry = entry->next;
-    }
-    return NULL;
+       while (entry) {
+               if (entry->tag == tag) {
+                       return entry;
+               }
+               if (entry->cascade) {
+                       wmMenuEntry *tmp;
+                       tmp = findEntry(entry->cascade, tag);
+                       if (tmp)
+                               return tmp;
+               }
+               entry = entry->next;
+       }
+       return NULL;
 }
 
-
-static void
-wmHandleMenuEvents(WMAppContext *app, XEvent *event)
+static void wmHandleMenuEvents(WMAppContext * app, XEvent * event)
 {
-    wmMenuEntry *entry;
+       wmMenuEntry *entry;
 
-    switch (event->xclient.data.l[1]) {
-    case wmSelectItem:
-        entry = findEntry(app->main_menu, event->xclient.data.l[2]);
-        if (entry && entry->callback) {
-            (*entry->callback)(entry->clientData, event->xclient.data.l[2],
-                               event->xclient.data.l[0]);
-        }
-        break;
-    }
+       switch (event->xclient.data.l[1]) {
+       case wmSelectItem:
+               entry = findEntry(app->main_menu, event->xclient.data.l[2]);
+               if (entry && entry->callback) {
+                       (*entry->callback) (entry->clientData, event->xclient.data.l[2], event->xclient.data.l[0]);
+               }
+               break;
+       }
 }
 
-
-int
-WMProcessEvent(WMAppContext *app, XEvent *event)
+int WMProcessEvent(WMAppContext * app, XEvent * event)
 {
-    int proc=False;
-    if (!_XA_WINDOWMAKER_MENU) {
-        _XA_WINDOWMAKER_MENU = XInternAtom(app->dpy, "_WINDOWMAKER_MENU",
-                                           False);
-    }
-    switch (event->type) {
-    case ClientMessage:
-        if (event->xclient.format == 32
-            && event->xclient.message_type == _XA_WINDOWMAKER_MENU
-            && event->xclient.window == app->main_window) {
-            wmHandleMenuEvents(app, event);
-            proc = True;
-        }
-    }
-    return proc;
+       int proc = False;
+       if (!_XA_WINDOWMAKER_MENU) {
+               _XA_WINDOWMAKER_MENU = XInternAtom(app->dpy, "_WINDOWMAKER_MENU", False);
+       }
+       switch (event->type) {
+       case ClientMessage:
+               if (event->xclient.format == 32
+                   && event->xclient.message_type == _XA_WINDOWMAKER_MENU
+                   && event->xclient.window == app->main_window) {
+                       wmHandleMenuEvents(app, event);
+                       proc = True;
+               }
+       }
+       return proc;
 }
-