]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.h
menus works on some level. add a built-in root menu
[chaz/openbox] / openbox / client.h
index 4df3893e08cc1eb0d11a1f573d7a45459c5f58bb..36e1b23820bab9a382235b624c115dd3c21c5484 100644 (file)
@@ -6,13 +6,16 @@
 #include <glib.h>
 #include <X11/Xlib.h>
 
-struct ClientWrap;
 struct Frame;
+struct Group;
 
+/* The value in client.transient_for indicating it is a transient for its
+   group instead of for a single window */
+#define TRAN_GROUP ((void*)~0l)
 
 /*! Holds an icon in ARGB format */
 typedef struct Icon {
-    unsigned long w, h;
+    unsigned long width, height;
     unsigned long *data;
 } Icon;
      
@@ -101,7 +104,8 @@ typedef enum {
     /*! Display a button to toggle the window's placement on
       all desktops */
     Decor_AllDesktops = 1 << 6,
-    Decor_Close       = 1 << 7  /*!< Display a close button */
+    Decor_Shade       = 1 << 7, /*!< Displays a shade button */
+    Decor_Close       = 1 << 8  /*!< Display a close button */
 } Decoration;
 
 
@@ -114,12 +118,16 @@ typedef struct Client {
     int ignore_unmaps;
 
     /*! The id of the group the window belongs to */
-    Window  group;
+    struct Group *group;
     /*! Whether or not the client is a transient window. This is guaranteed to 
       be TRUE if transient_for != NULL, but not guaranteed to be FALSE if
       transient_for == NULL. */
     gboolean transient;
-    /*! The client which this client is a transient (child) for */
+    /*! The client which this client is a transient (child) for.
+      A value of TRAN_GROUP signifies that the window is a transient for all
+      members of its Group, and is not a valid pointer to be followed in this
+      case.
+     */
     struct Client *transient_for;
     /*! The clients which are transients (children) of this client */
     GSList *transients;
@@ -133,9 +141,9 @@ typedef struct Client {
     gchar *icon_title;
 
     /*! The application that created the window */
-    gchar *res_name;
+    gchar *name;
     /*! The class of the window, can used for grouping */
-    gchar *res_class;
+    gchar *class;
     /*! The specified role of the window, used for identification */
     gchar *role;
 
@@ -218,8 +226,6 @@ typedef struct Client {
     gboolean urgent;
     /*! Notify the window when it receives focus? */
     gboolean focus_notify;
-    /*! Does the client window have the input focus? */
-    gboolean focused;
 
     /*! The window uses shape extension to be non-rectangular? */
     gboolean shaped;
@@ -279,12 +285,9 @@ typedef struct Client {
     Pixmap pixmap_icon;
     /*! The mask for the pixmap_icon, or None if its not masked */
     Pixmap pixmap_icon_mask;
-
-    /* The instance of the wrapper class if one exists */
-    struct ClientWrap *wrap;
 } Client;
 
-extern GSList *client_list;
+extern GList *client_list;
 extern GHashTable *client_map;
 
 void client_startup();
@@ -307,10 +310,6 @@ void client_set_list();
   surroundings (struts, etc). */
 void client_remaximize(Client *self);
 
-/*! Shows the window if it should be shown, or hides it
-  Used when changing desktops, the window's state, etc. */
-void client_showhide(Client *self);
-
 /*! Determines if the client should be shown or hidden currently.
   @return TRUE if it should be visible; otherwise, FALSE.
 */
@@ -321,6 +320,9 @@ gboolean client_should_show(Client *self);
   to them in a number of places regarding focus or user interaction. */
 gboolean client_normal(Client *self);
 
+/* Returns if the window is focused */
+gboolean client_focused(Client *self);
+
 /*! Move and/or resize the window.
   This also maintains things like the client's minsize, and size increments.
   @param anchor The corner to keep in the same position when resizing.
@@ -376,11 +378,16 @@ void client_maximize(Client *self, gboolean max, int dir,
 */
 void client_shade(Client *self, gboolean shade);
 
-/*! Request the client to close its window. */
+/*! Request the client to close its window */
 void client_close(Client *self);
 
-/*! Sends the window to the specified desktop */
-void client_set_desktop(Client *self, unsigned int target);
+/*! Kill the client off violently */
+void client_kill(Client *self);
+
+/*! Sends the window to the specified desktop
+  @param donthide If TRUE, the window will not be shown/hidden after its
+         desktop has been changed. Generally this should be FALSE. */
+void client_set_desktop(Client *self, guint target, gboolean donthide);
 
 /*! Return a modal child of the client window
     @return A modal child of the client window, or 0 if none was found.
@@ -405,6 +412,14 @@ void client_set_wm_state(Client *self, long state);
 */
 void client_set_state(Client *self, Atom action, long data1, long data2);
 
+/* Given a Client, find the client that focus would actually be sent to if
+   you wanted to give focus to the specified Client. Will return the same
+   Client passed to it or another Client if appropriate. */
+Client *client_focus_target(Client *self);
+
+/* Returns if a client can be focused or not */
+gboolean client_focusable(Client *self);
+
 /*! Attempt to focus the client window */
 gboolean client_focus(Client *self);
 
@@ -450,4 +465,6 @@ void client_setup_decor_and_functions(Client *self);
 /*! Retrieves the window's type and sets Client->type */
 void client_get_type(Client *self);
 
+Icon *client_icon(Client *self, int w, int h);
+
 #endif
This page took 0.023586 seconds and 4 git commands to generate.