summaryrefslogtreecommitdiff
path: root/src/xprops.h
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2002-01-04 00:58:39 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-01-04 00:58:39 +0000
commitb9701454b86ff5ed88a0935d9f52cf22d5ac5508 (patch)
tree952a62e9d20e66c18eed7d799abd5ed05dca1e8c /src/xprops.h
parentee1361fb6e874b90a62e6c8c0c47913bf91c3baf (diff)
downloadmetacity-b9701454b86ff5ed88a0935d9f52cf22d5ac5508.tar.gz
metacity-b9701454b86ff5ed88a0935d9f52cf22d5ac5508.tar.bz2
clean up using meta_prop_get_atom_list (update_mwm_hints): clean up using
2002-01-03 Havoc Pennington <hp@pobox.com> * src/window.c (update_net_wm_state): clean up using meta_prop_get_atom_list (update_mwm_hints): clean up using meta_prop_get_motif_hints * src/Makefile.am (metacity_SOURCES): add xprops.[hc] * src/xprops.c: new file with convenience functions for X properties
Diffstat (limited to 'src/xprops.h')
-rw-r--r--src/xprops.h89
1 files changed, 89 insertions, 0 deletions
diff --git a/src/xprops.h b/src/xprops.h
new file mode 100644
index 0000000..28a479b
--- /dev/null
+++ b/src/xprops.h
@@ -0,0 +1,89 @@
+/* Metacity X property convenience routines */
+
+/*
+ * Copyright (C) 2001 Havoc Pennington
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef META_XPROPS_H
+#define META_XPROPS_H
+
+#include "display.h"
+#include <X11/Xutil.h>
+
+/* Copied from Lesstif by way of GTK. Rudimentary docs can be
+ * found in some Motif reference guides online.
+ */
+typedef struct {
+ unsigned long flags;
+ unsigned long functions;
+ unsigned long decorations;
+ long input_mode;
+ unsigned long status;
+} MotifWmHints, MwmHints;
+
+#define MWM_HINTS_FUNCTIONS (1L << 0)
+#define MWM_HINTS_DECORATIONS (1L << 1)
+#define MWM_HINTS_INPUT_MODE (1L << 2)
+#define MWM_HINTS_STATUS (1L << 3)
+
+#define MWM_FUNC_ALL (1L << 0)
+#define MWM_FUNC_RESIZE (1L << 1)
+#define MWM_FUNC_MOVE (1L << 2)
+#define MWM_FUNC_MINIMIZE (1L << 3)
+#define MWM_FUNC_MAXIMIZE (1L << 4)
+#define MWM_FUNC_CLOSE (1L << 5)
+
+#define MWM_DECOR_ALL (1L << 0)
+#define MWM_DECOR_BORDER (1L << 1)
+#define MWM_DECOR_RESIZEH (1L << 2)
+#define MWM_DECOR_TITLE (1L << 3)
+#define MWM_DECOR_MENU (1L << 4)
+#define MWM_DECOR_MINIMIZE (1L << 5)
+#define MWM_DECOR_MAXIMIZE (1L << 6)
+
+#define MWM_INPUT_MODELESS 0
+#define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1
+#define MWM_INPUT_SYSTEM_MODAL 2
+#define MWM_INPUT_FULL_APPLICATION_MODAL 3
+#define MWM_INPUT_APPLICATION_MODAL MWM_INPUT_PRIMARY_APPLICATION_MODAL
+
+#define MWM_TEAROFF_WINDOW (1L<<0)
+
+/* These all return the memory from Xlib, so require an XFree()
+ * when they return TRUE. They return TRUE on success.
+ */
+gboolean meta_prop_get_atom_list (MetaDisplay *display,
+ Window xwindow,
+ Atom xatom,
+ Atom **atoms_p,
+ int *n_atoms_p);
+gboolean meta_prop_get_motif_hints (MetaDisplay *display,
+ Window xwindow,
+ Atom xatom,
+ MotifWmHints **hints_p);
+gboolean meta_prop_get_cardinal_list (MetaDisplay *display,
+ Window xwindow,
+ Atom xatom,
+ gulong **cardinals_p,
+ int *n_cardinals_p);
+
+#endif
+
+
+
+