summaryrefslogtreecommitdiff
path: root/src/devices.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices.h')
-rw-r--r--src/devices.h85
1 files changed, 63 insertions, 22 deletions
diff --git a/src/devices.h b/src/devices.h
index 73adff4d..9dce947b 100644
--- a/src/devices.h
+++ b/src/devices.h
@@ -29,52 +29,93 @@
#include <X11/extensions/XInput.h>
#include "common.h"
-/* #include "display.h" XXX ? */
+#include "boxes.h"
-/* By default, the MetaDevInfo lists have size 8. Almost no client has more
- * than 8 mice or keyboards... */
-/* FIXME setting this define to 1 or 2 causes memory corruption!!!! */
-#define DEFAULT_INPUT_ARRAY_SIZE 8
+/* By default, the MetaDevInfo lists have size 4. Almost no client has more
+ * than 4 mice or keyboards... */
+#define DEFAULT_INPUT_ARRAY_SIZE 4
typedef struct _MetaDevices MetaDevices;
/* typedef struct _MetaDevInfo MetaDevInfo; This guy was declared at common.h */
+typedef struct _MetaGrabOpInfo MetaGrabOpInfo;
+
/* TODO: create MetaPtrInfo and MetaKbdInfo, so that you can differentiate it
* and force correct type using in function prototypes */
+#if 0
+--> To be used soon!! (next commit)
+struct _MetaGrabOpInfo
+{
+ /* current window operation */
+ MetaGrabOp op;
+ MetaScreen *screen;
+ MetaWindow *window;
+ Window xwindow;
+ int button;
+ int anchor_root_x;
+ int anchor_root_y;
+ MetaRectangle anchor_window_pos;
+ int latest_motion_x;
+ int latest_motion_y;
+ gulong mask;
+ guint have_pointer : 1;
+ guint grabbed_pointer : 1;
+ guint have_keyboard : 1;
+ guint wireframe_active : 1;
+ guint was_cancelled : 1; /* Only used in wireframe mode */
+ guint frame_action : 1;
+ MetaRectangle wireframe_rect;
+ MetaRectangle wireframe_last_xor_rect;
+ MetaRectangle initial_window_pos;
+ int initial_x, grab_initial_y; /* These are only relevant for */
+ gboolean threshold_movement_reached; /* raise_on_click == FALSE. */
+ MetaResizePopup *resize_popup;
+ GTimeVal last_moveresize_time;
+ guint32 motion_notify_time;
+ int wireframe_last_display_width;
+ int wireframe_last_display_height;
+ GList* old_window_stacking;
+ MetaEdgeResistanceData *edge_resistance_data;
+ unsigned int last_user_action_was_snap;
+};
+#endif
+
struct _MetaDevInfo
{
- XDevice *xdev;
- gchar *name;
+ XDevice *xdev;
+ gchar *name;
+ MetaGrabOpInfo *grab_op;
};
struct _MetaDevices
{
MetaDevInfo *mice;
- int miceUsed;
- int miceSize;
+ int miceUsed;
+ int miceSize;
MetaDevInfo *keyboards;
- int keybsUsed; /* XXX :%s/keybsUsed/kbdsUsed/g or something else? */
- int keybsSize; /* I don't like "keybs" */
- MetaDevInfo *pairedPointers;
+ int keybsUsed; /* XXX :%s/keybsUsed/kbdsUsed/g or something else? */
+ int keybsSize; /* I don't like "keybs" */
+ XID *pairedPointers; /* indexed by the keyboards! */
+ /* TODO: consider creating a structure to store the pairs!! */
};
-MetaDevInfo* meta_devices_find_mouse_by_name (MetaDisplay *display,
- gchar *name);
+MetaDevInfo* meta_devices_find_mouse_by_name (MetaDisplay *display,
+ gchar *name);
-MetaDevInfo* meta_devices_find_mouse_by_id (MetaDisplay *display,
- XID id);
+MetaDevInfo* meta_devices_find_mouse_by_id (MetaDisplay *display,
+ XID id);
-MetaDevInfo* meta_devices_find_keyboard_by_id (MetaDisplay *display,
- XID id);
+MetaDevInfo* meta_devices_find_keyboard_by_id (MetaDisplay *display,
+ XID id);
-MetaDevInfo* meta_devices_find_paired_mouse (MetaDisplay *display,
- XID id);
+MetaDevInfo* meta_devices_find_paired_mouse (MetaDisplay *display,
+ XID id);
-MetaDevInfo* meta_devices_find_paired_keyboard (MetaDisplay *display,
- XID id);
+MetaDevInfo* meta_devices_find_paired_keyboard (MetaDisplay *display,
+ XID id);
#else
#error "This branch will ONLY compile if you enable --enable-mpx!"