From bca8082d6d09a16a116c70001469a576b93157ce Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 5 Apr 2003 17:22:01 +0000 Subject: use a context enum instead of quarks --- openbox/frame.c | 35 +++++++++++++++++++++++++++++++++++ openbox/frame.h | 22 ++++++++++++++++++++++ 2 files changed, 57 insertions(+) (limited to 'openbox') diff --git a/openbox/frame.c b/openbox/frame.c index 2976ca2f..2064f304 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -1,5 +1,40 @@ #include "frame.h" +Context frame_context_from_string(char *name) +{ + if (!g_ascii_strcasecmp("root", name)) + return Context_Root; + else if (!g_ascii_strcasecmp("client", name)) + return Context_Client; + else if (!g_ascii_strcasecmp("titlebar", name)) + return Context_Titlebar; + else if (!g_ascii_strcasecmp("handle", name)) + return Context_Handle; + else if (!g_ascii_strcasecmp("frame", name)) + return Context_Frame; + else if (!g_ascii_strcasecmp("blcorner", name)) + return Context_BLCorner; + else if (!g_ascii_strcasecmp("tlcorner", name)) + return Context_TLCorner; + else if (!g_ascii_strcasecmp("brcorner", name)) + return Context_BRCorner; + else if (!g_ascii_strcasecmp("trcorner", name)) + return Context_TRCorner; + else if (!g_ascii_strcasecmp("maximize", name)) + return Context_Maximize; + else if (!g_ascii_strcasecmp("alldesktops", name)) + return Context_AllDesktops; + else if (!g_ascii_strcasecmp("shade", name)) + return Context_Shade; + else if (!g_ascii_strcasecmp("iconify", name)) + return Context_Iconify; + else if (!g_ascii_strcasecmp("icon", name)) + return Context_Icon; + else if (!g_ascii_strcasecmp("close", name)) + return Context_Close; + return Context_None; +} + void frame_client_gravity(Frame *self, int *x, int *y) { /* horizontal */ diff --git a/openbox/frame.h b/openbox/frame.h index ec530934..fb492d8c 100644 --- a/openbox/frame.h +++ b/openbox/frame.h @@ -4,6 +4,28 @@ #include "geom.h" #include "client.h" +typedef enum { + Context_None, + Context_Root, + Context_Client, + Context_Titlebar, + Context_Handle, + Context_Frame, + Context_BLCorner, + Context_BRCorner, + Context_TLCorner, + Context_TRCorner, + Context_Maximize, + Context_AllDesktops, + Context_Shade, + Context_Iconify, + Context_Icon, + Context_Close, + NUM_CONTEXTS +} Context; + +Context frame_context_from_string(char *name); + typedef struct Frame { Client *client; -- cgit v1.2.3