summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2015-02-12 22:16:32 +0100
committerDave Davenport <qball@gmpclient.org>2015-02-12 22:16:32 +0100
commit605fe4911cb1683624b48d895afe6b2630e0e529 (patch)
treeb2ff5ff26872d66eb5ab15b659e60c7d7c62c03d /include
parent9240a636d484c7f7988b212ee56f1aa2dfc12f49 (diff)
Refactor code, split out window switcher code.
Diffstat (limited to 'include')
-rw-r--r--include/window-dialog.h6
-rw-r--r--include/x11-helper.h106
2 files changed, 8 insertions, 104 deletions
diff --git a/include/window-dialog.h b/include/window-dialog.h
new file mode 100644
index 00000000..e6b6f727
--- /dev/null
+++ b/include/window-dialog.h
@@ -0,0 +1,6 @@
+#ifndef __WINDOW_DIALOG_H__
+#define __WINDOW_DIALOG_H__
+
+SwitcherMode run_switcher_window ( char **input, G_GNUC_UNUSED void *data );
+
+#endif // __WINDOW_DIALOG_H__
diff --git a/include/x11-helper.h b/include/x11-helper.h
index c34d907b..d0361a7a 100644
--- a/include/x11-helper.h
+++ b/include/x11-helper.h
@@ -1,69 +1,6 @@
#ifndef __X11_HELPER_H__
#define __X11_HELPER_H__
-// window lists
-typedef struct
-{
- Window *array;
- void **data;
- int len;
-} winlist;
-
-
-/**
- * Create a window list, pre-seeded with WINLIST entries.
- *
- * @returns A new window list.
- */
-winlist* winlist_new ();
-
-
-/**
- * @param l The winlist.
- * @param w The window to find.
- *
- * Find the window in the list, and return the array entry.
- *
- * @returns -1 if failed, index is successful.
- */
-int winlist_find ( winlist *l, Window w );
-
-/**
- * @param l The winlist entry
- *
- * Free the winlist.
- */
-void winlist_free ( winlist *l );
-
-/**
- * @param l The winlist entry
- *
- * Empty winlist without free-ing
- */
-void winlist_empty ( winlist *l );
-
-/**
- * @param l The winlist.
- * @param w The window to add.
- * @param d Data pointer.
- *
- * Add one entry. If Full, extend with WINLIST entries.
- *
- * @returns 0 if failed, 1 is successful.
- */
-int winlist_append ( winlist *l, Window w, void *d );
-
-/**
- * @param d Display connection to X server
- * @param w window
- *
- * Get window attributes.
- * This functions uses caching.
- *
- * @returns a XWindowAttributes
- */
-XWindowAttributes* window_get_attributes ( Display *display, Window w );
-
int window_get_prop ( Display *display, Window w, Atom prop,
Atom *type, int *items,
@@ -85,22 +22,6 @@ int window_get_atom_prop ( Display *display, Window w, Atom atom, Atom *list, in
void window_set_atom_prop ( Display *display, Window w, Atom prop, Atom *atoms, int count );
int window_get_cardinal_prop ( Display *display, Window w, Atom atom, unsigned long *list, int count );
-/**
- * Create empty X11 cache for windows and windows attributes.
- */
-void x11_cache_create ( void );
-
-/**
- * Empty the X11 cache.
- * (does not free it.)
- */
-void x11_cache_empty ( void );
-
-/**
- * Free the cache.
- */
-void x11_cache_free ( void );
-
/**
* Window info.
@@ -134,37 +55,14 @@ typedef struct
int l, r, t, b;
} workarea;
-#define CLIENTTITLE 100
-#define CLIENTCLASS 50
-#define CLIENTNAME 50
-#define CLIENTSTATE 10
-#define CLIENTROLE 50
-
-// a managable window
-typedef struct
-{
- Window window, trans;
- XWindowAttributes xattr;
- char title[CLIENTTITLE];
- char class[CLIENTCLASS];
- char name[CLIENTNAME];
- char role[CLIENTROLE];
- int states;
- Atom state[CLIENTSTATE];
- workarea monitor;
- int active;
-} client;
-// collect info on any window
-// doesn't have to be a window we'll end up managing
-client* window_client ( Display *display, Window win );
-int client_has_state ( client *c, Atom state );
-
void monitor_active ( Display *display, workarea *mon );
int window_send_message ( Display *display, Window target, Window subject,
Atom atom, unsigned long protocol,
unsigned long mask, Time time );
+// find the dimensions of the monitor displaying point x,y
+void monitor_dimensions ( Display *display, Screen *screen, int x, int y, workarea *mon );
/**
* @param display The display.