summaryrefslogtreecommitdiff
path: root/gdk/x11
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>1999-10-01 23:18:30 +0000
committerOwen Taylor <otaylor@src.gnome.org>1999-10-01 23:18:30 +0000
commit637a466d5ca1fbda2acbf5d52779dd5097b5a9e2 (patch)
tree781d1f31b75758b3b9a3d19ce4a7c55349b2ba82 /gdk/x11
parent74d88d870aea60625b8f1ed522e86faa223ca487 (diff)
downloadgtk+-637a466d5ca1fbda2acbf5d52779dd5097b5a9e2.tar.gz
Started
Fri Oct 1 18:03:36 1999 Owen Taylor <otaylor@redhat.com> * docs/Changes-1.4.txt: Started * gtk/Makefile.am (gdk_headers): Include all the new headers. * gdk/*.h gdk/*.c: Split gdk.h into lots of itty-bitty little pieces. * gdk/gdkprivate.h gdk/gdkcc.c: Moved GdkColorContext private into C file. * gdkinput.h gdkinputprivate.h - renamed the internal gdkinput header to gdkinputprivate.h. * gdk/gdk.h gdk/gdk.c: Removed gdk_time* functions which have been unused since before 1.2.
Diffstat (limited to 'gdk/x11')
-rw-r--r--gdk/x11/gdkcc-x11.c14
-rw-r--r--gdk/x11/gdkcolor-x11.c4
-rw-r--r--gdk/x11/gdkcursor-x11.c3
-rw-r--r--gdk/x11/gdkdnd-x11.c7
-rw-r--r--gdk/x11/gdkevents-x11.c5
-rw-r--r--gdk/x11/gdkfont-x11.c2
-rw-r--r--gdk/x11/gdkim-x11.c5
-rw-r--r--gdk/x11/gdkimage-x11.c3
-rw-r--r--gdk/x11/gdkinput.c7
-rw-r--r--gdk/x11/gdkinputprivate.h162
-rw-r--r--gdk/x11/gdkmain-x11.c141
-rw-r--r--gdk/x11/gdkpixmap-x11.c2
-rw-r--r--gdk/x11/gdkproperty-x11.c3
-rw-r--r--gdk/x11/gdkselection-x11.c4
-rw-r--r--gdk/x11/gdkvisual-x11.c5
-rw-r--r--gdk/x11/gdkwindow-x11.c4
16 files changed, 209 insertions, 162 deletions
diff --git a/gdk/x11/gdkcc-x11.c b/gdk/x11/gdkcc-x11.c
index d1d1e754f7..f592fa8e54 100644
--- a/gdk/x11/gdkcc-x11.c
+++ b/gdk/x11/gdkcc-x11.c
@@ -63,13 +63,21 @@
#include <X11/Xlib.h>
#include <stdlib.h>
#include <string.h>
-#include "gdk.h"
-#include "gdkprivate.h"
-#include "gdkx.h"
+#include "gdkcc.h"
+#include "gdkcolor.h"
+#include "gdkx.h"
#define MAX_IMAGE_COLORS 256
+typedef struct _GdkColorContextPrivate GdkColorContextPrivate;
+
+struct _GdkColorContextPrivate
+{
+ GdkColorContext color_context;
+ Display *xdisplay;
+ XStandardColormap std_cmap;
+};
static guint
hash_color (gconstpointer key)
diff --git a/gdk/x11/gdkcolor-x11.c b/gdk/x11/gdkcolor-x11.c
index 2baa200ee0..03222cc3d6 100644
--- a/gdk/x11/gdkcolor-x11.c
+++ b/gdk/x11/gdkcolor-x11.c
@@ -26,9 +26,9 @@
#include <time.h>
#include <X11/Xlib.h>
-#include "gdk.h"
+
+#include "gdkcolor.h"
#include "gdkprivate.h"
-#include "gdkx.h"
static gint gdk_colormap_match_color (GdkColormap *cmap,
diff --git a/gdk/x11/gdkcursor-x11.c b/gdk/x11/gdkcursor-x11.c
index 568c489dd5..6431c780ad 100644
--- a/gdk/x11/gdkcursor-x11.c
+++ b/gdk/x11/gdkcursor-x11.c
@@ -26,7 +26,8 @@
#include <X11/Xlib.h>
#include <X11/cursorfont.h>
-#include "gdk.h"
+
+#include "gdkcursor.h"
#include "gdkprivate.h"
diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c
index a2be5e160c..3788229245 100644
--- a/gdk/x11/gdkdnd-x11.c
+++ b/gdk/x11/gdkdnd-x11.c
@@ -27,9 +27,12 @@
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <string.h>
+
+#include "gdk.h" /* For gdk_flush() */
+#include "gdkdnd.h"
+#include "gdkproperty.h"
+#include "gdkprivate.h"
#include "gdkx.h"
-#include "gdk/gdkprivate.h"
-#include "gdk.h"
typedef struct _GdkDragContextPrivate GdkDragContextPrivate;
diff --git a/gdk/x11/gdkevents-x11.c b/gdk/x11/gdkevents-x11.c
index 4f6f577f29..2adc09cb45 100644
--- a/gdk/x11/gdkevents-x11.c
+++ b/gdk/x11/gdkevents-x11.c
@@ -25,8 +25,9 @@
*/
#include "gdk.h"
-#include "gdkx.h"
#include "gdkprivate.h"
+#include "gdkx.h"
+
#include "gdkkeysyms.h"
#if HAVE_CONFIG_H
@@ -36,7 +37,7 @@
# endif
#endif
-#include "gdkinput.h"
+#include "gdkinputprivate.h"
typedef struct _GdkIOClosure GdkIOClosure;
typedef struct _GdkEventPrivate GdkEventPrivate;
diff --git a/gdk/x11/gdkfont-x11.c b/gdk/x11/gdkfont-x11.c
index 096cf8a537..a3a3502fba 100644
--- a/gdk/x11/gdkfont-x11.c
+++ b/gdk/x11/gdkfont-x11.c
@@ -26,7 +26,7 @@
#include <X11/Xlib.h>
#include <X11/Xos.h>
-#include "gdk.h"
+#include "gdkfont.h"
#include "gdkprivate.h"
static GHashTable *font_name_hash = NULL;
diff --git a/gdk/x11/gdkim-x11.c b/gdk/x11/gdkim-x11.c
index e453925093..020460f329 100644
--- a/gdk/x11/gdkim-x11.c
+++ b/gdk/x11/gdkim-x11.c
@@ -25,7 +25,10 @@
*/
#include <X11/Xlocale.h>
-#include "gdk.h"
+
+#include "gdk.h" /* For gdk_flush() */
+#include "gdkim.h"
+#include "gdkpixmap.h"
#include "gdkprivate.h"
#include "gdki18n.h"
#include "gdkx.h"
diff --git a/gdk/x11/gdkimage-x11.c b/gdk/x11/gdkimage-x11.c
index 7dae0d92ee..769727a4b6 100644
--- a/gdk/x11/gdkimage-x11.c
+++ b/gdk/x11/gdkimage-x11.c
@@ -53,7 +53,8 @@
#include <X11/extensions/XShm.h>
#endif /* USE_SHM */
-#include "gdk.h"
+#include "gdk.h" /* For gdk_error_trap_* / gdk_flush_* */
+#include "gdkimage.h"
#include "gdkprivate.h"
diff --git a/gdk/x11/gdkinput.c b/gdk/x11/gdkinput.c
index b09821ff6e..8f75330067 100644
--- a/gdk/x11/gdkinput.c
+++ b/gdk/x11/gdkinput.c
@@ -28,11 +28,10 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "config.h"
-#include "gdk.h"
-#include "gdkx.h"
-#include "gdkprivate.h"
-#include "gdkinput.h"
+#include "gdkinput.h"
+#include "gdkprivate.h"
+#include "gdkinputprivate.h"
/* Forward declarations */
diff --git a/gdk/x11/gdkinputprivate.h b/gdk/x11/gdkinputprivate.h
new file mode 100644
index 0000000000..0f41c462b4
--- /dev/null
+++ b/gdk/x11/gdkinputprivate.h
@@ -0,0 +1,162 @@
+/* GDK - The GIMP Drawing Kit
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
+ * file for a list of people on the GTK+ Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __GDK_INPUTPRIVATE_H__
+#define __GDK_INPUTPRIVATE_H__
+
+#ifndef XINPUT_NONE
+#include <X11/extensions/XInput.h>
+#endif
+
+typedef struct _GdkAxisInfo GdkAxisInfo;
+typedef struct _GdkInputVTable GdkInputVTable;
+typedef struct _GdkDevicePrivate GdkDevicePrivate;
+typedef struct _GdkInputWindow GdkInputWindow;
+
+struct _GdkInputVTable {
+ gint (*set_mode) (guint32 deviceid, GdkInputMode mode);
+ void (*set_axes) (guint32 deviceid, GdkAxisUse *axes);
+ void (*set_key) (guint32 deviceid,
+ guint index,
+ guint keyval,
+ GdkModifierType modifiers);
+
+ GdkTimeCoord* (*motion_events) (GdkWindow *window,
+ guint32 deviceid,
+ guint32 start,
+ guint32 stop,
+ gint *nevents_return);
+ void (*get_pointer) (GdkWindow *window,
+ guint32 deviceid,
+ gdouble *x,
+ gdouble *y,
+ gdouble *pressure,
+ gdouble *xtilt,
+ gdouble *ytilt,
+ GdkModifierType *mask);
+ gint (*grab_pointer) (GdkWindow * window,
+ gint owner_events,
+ GdkEventMask event_mask,
+ GdkWindow * confine_to,
+ guint32 time);
+ void (*ungrab_pointer) (guint32 time);
+
+ void (*configure_event) (XConfigureEvent *xevent, GdkWindow *window);
+ void (*enter_event) (XCrossingEvent *xevent, GdkWindow *window);
+ gint (*other_event) (GdkEvent *event, XEvent *xevent, GdkWindow *window);
+ /* Handle an unidentified event. Returns TRUE if handled, FALSE
+ otherwise */
+ gint (*window_none_event) (GdkEvent *event, XEvent *xevent);
+ gint (*enable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev);
+ gint (*disable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev);
+};
+
+/* information about a device axis */
+struct _GdkAxisInfo
+{
+ /* reported x resolution */
+ gint xresolution;
+
+ /* reported x minimum/maximum values */
+ gint xmin_value, xmax_value;
+
+ /* calibrated resolution (for aspect ration) - only relative values
+ between axes used */
+ gint resolution;
+
+ /* calibrated minimum/maximum values */
+ gint min_value, max_value;
+};
+
+#define GDK_INPUT_NUM_EVENTC 6
+
+struct _GdkDevicePrivate {
+ GdkDeviceInfo info;
+
+#ifndef XINPUT_NONE
+ /* information about the axes */
+ GdkAxisInfo *axes;
+
+ /* reverse lookup on axis use type */
+ gint axis_for_use[GDK_AXIS_LAST];
+
+ /* Information about XInput device */
+ XDevice *xdevice;
+
+ /* minimum key code for device */
+ gint min_keycode;
+
+ int buttonpress_type, buttonrelease_type, keypress_type,
+ keyrelease_type, motionnotify_type, proximityin_type,
+ proximityout_type, changenotify_type;
+
+ /* true if we need to select a different set of events, but
+ can't because this is the core pointer */
+ gint needs_update;
+
+ /* Mask of buttons (used for button grabs) */
+ gint button_state;
+
+ /* true if we've claimed the device as active. (used only for XINPUT_GXI) */
+ gint claimed;
+#endif /* !XINPUT_NONE */
+};
+
+struct _GdkInputWindow
+{
+ /* gdk window */
+ GdkWindow *window;
+
+ /* Extension mode (GDK_EXTENSION_EVENTS_ALL/CURSOR) */
+ GdkExtensionMode mode;
+
+ /* position relative to root window */
+ gint16 root_x;
+ gint16 root_y;
+
+ /* rectangles relative to window of windows obscuring this one */
+ GdkRectangle *obscuring;
+ gint num_obscuring;
+
+ /* Is there a pointer grab for this window ? */
+ gint grabbed;
+};
+
+/* Global data */
+
+extern GdkInputVTable gdk_input_vtable;
+/* information about network port and host for gxid daemon */
+extern gchar *gdk_input_gxid_host;
+extern gint gdk_input_gxid_port;
+extern gint gdk_input_ignore_core;
+
+/* Function declarations */
+
+void gdk_input_window_destroy (GdkWindow *window);
+void gdk_input_init (void);
+void gdk_input_exit (void);
+
+#endif /* __GDK_INPUTPRIVATE_H__ */
diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c
index de1d55ea8c..96e342f62c 100644
--- a/gdk/x11/gdkmain-x11.c
+++ b/gdk/x11/gdkmain-x11.c
@@ -44,17 +44,11 @@
#include <X11/Xutil.h>
#include <X11/Xmu/WinUtil.h>
#include <X11/cursorfont.h>
-#include "gdk.h"
-#include "gdkprivate.h"
-#include "gdkinput.h"
-#include "gdkx.h"
-#include "gdki18n.h"
-#include "gdkkeysyms.h"
-#ifndef X_GETTIMEOFDAY
-#define X_GETTIMEOFDAY(tv) gettimeofday (tv, NULL)
-#endif /* X_GETTIMEOFDAY */
+#include "gdk.h"
+#include "gdkprivate.h"
+#include "gdkinputprivate.h"
typedef struct _GdkPredicate GdkPredicate;
typedef struct _GdkErrorTrap GdkErrorTrap;
@@ -97,23 +91,6 @@ static int gdk_initialized = 0; /* 1 if the library is initialized,
* 0 otherwise.
*/
-static struct timeval start; /* The time at which the library was
- * last initialized.
- */
-static struct timeval timer; /* Timeout interval to use in the call
- * to "select". This is used in
- * conjunction with "timerp" to create
- * a maximum time to wait for an event
- * to arrive.
- */
-static struct timeval *timerp; /* The actual timer passed to "select"
- * This may be NULL, in which case
- * "select" will block until an event
- * arrives.
- */
-static guint32 timer_val; /* The timeout length as specified by
- * the user in milliseconds.
- */
static gint autorepeat;
static GSList *gdk_error_traps = NULL; /* List of error traps */
@@ -181,8 +158,6 @@ gdk_init_check (int *argc,
argv_orig[argc_orig] = NULL;
}
- X_GETTIMEOFDAY (&start);
-
gdk_display_name = NULL;
XSetErrorHandler (gdk_x_error);
@@ -420,10 +395,6 @@ gdk_init_check (int *argc,
XGetKeyboardControl (gdk_display, &keyboard_state);
autorepeat = keyboard_state.global_auto_repeat;
- timer.tv_sec = 0;
- timer.tv_usec = 0;
- timerp = NULL;
-
g_atexit (gdk_exit_func);
gdk_events_init ();
@@ -493,112 +464,6 @@ gdk_get_use_xshm (void)
/*
*--------------------------------------------------------------
- * gdk_time_get
- *
- * Get the number of milliseconds since the library was
- * initialized.
- *
- * Arguments:
- *
- * Results:
- * The time since the library was initialized is returned.
- * This time value is accurate to milliseconds even though
- * a more accurate time down to the microsecond could be
- * returned.
- *
- * Side effects:
- *
- *--------------------------------------------------------------
- */
-
-guint32
-gdk_time_get (void)
-{
- struct timeval end;
- struct timeval elapsed;
- guint32 milliseconds;
-
- X_GETTIMEOFDAY (&end);
-
- if (start.tv_usec > end.tv_usec)
- {
- end.tv_usec += 1000000;
- end.tv_sec--;
- }
- elapsed.tv_sec = end.tv_sec - start.tv_sec;
- elapsed.tv_usec = end.tv_usec - start.tv_usec;
-
- milliseconds = (elapsed.tv_sec * 1000) + (elapsed.tv_usec / 1000);
-
- return milliseconds;
-}
-
-/*
- *--------------------------------------------------------------
- * gdk_timer_get
- *
- * Returns the current timer.
- *
- * Arguments:
- *
- * Results:
- * Returns the current timer interval. This interval is
- * in units of milliseconds.
- *
- * Side effects:
- *
- *--------------------------------------------------------------
- */
-
-guint32
-gdk_timer_get (void)
-{
- return timer_val;
-}
-
-/*
- *--------------------------------------------------------------
- * gdk_timer_set
- *
- * Sets the timer interval.
- *
- * Arguments:
- * "milliseconds" is the new value for the timer.
- *
- * Results:
- *
- * Side effects:
- * Calls to "gdk_event_get" will last for a maximum
- * of time of "milliseconds". However, a value of 0
- * milliseconds will cause "gdk_event_get" to block
- * indefinately until an event is received.
- *
- *--------------------------------------------------------------
- */
-
-void
-gdk_timer_set (guint32 milliseconds)
-{
- timer_val = milliseconds;
- timer.tv_sec = milliseconds / 1000;
- timer.tv_usec = (milliseconds % 1000) * 1000;
-
-}
-
-void
-gdk_timer_enable (void)
-{
- timerp = &timer;
-}
-
-void
-gdk_timer_disable (void)
-{
- timerp = NULL;
-}
-
-/*
- *--------------------------------------------------------------
* gdk_pointer_grab
*
* Grabs the pointer to a specific window
diff --git a/gdk/x11/gdkpixmap-x11.c b/gdk/x11/gdkpixmap-x11.c
index 6fc47e316e..5656b18a93 100644
--- a/gdk/x11/gdkpixmap-x11.c
+++ b/gdk/x11/gdkpixmap-x11.c
@@ -32,7 +32,7 @@
#include <unistd.h>
#include <X11/Xlib.h>
-#include "gdk.h"
+#include "gdkpixmap.h"
#include "gdkprivate.h"
typedef struct
diff --git a/gdk/x11/gdkproperty-x11.c b/gdk/x11/gdkproperty-x11.c
index 7973d8fc7e..5a17abd769 100644
--- a/gdk/x11/gdkproperty-x11.c
+++ b/gdk/x11/gdkproperty-x11.c
@@ -27,7 +27,8 @@
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <string.h>
-#include "gdk.h"
+
+#include "gdkproperty.h"
#include "gdkprivate.h"
GdkAtom
diff --git a/gdk/x11/gdkselection-x11.c b/gdk/x11/gdkselection-x11.c
index 3ee2e43b3d..ebffc3579c 100644
--- a/gdk/x11/gdkselection-x11.c
+++ b/gdk/x11/gdkselection-x11.c
@@ -27,7 +27,9 @@
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <string.h>
-#include "gdk.h"
+
+#include "gdkproperty.h"
+#include "gdkselection.h"
#include "gdkprivate.h"
#include "gdkx.h"
diff --git a/gdk/x11/gdkvisual-x11.c b/gdk/x11/gdkvisual-x11.c
index a63ba55c6c..072ff456e5 100644
--- a/gdk/x11/gdkvisual-x11.c
+++ b/gdk/x11/gdkvisual-x11.c
@@ -26,10 +26,9 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
-#include "gdk.h"
-#include "gdkprivate.h"
-#include "gdkx.h"
+#include "gdkvisual.h"
+#include "gdkprivate.h"
static void gdk_visual_add (GdkVisual *visual);
static void gdk_visual_decompose_mask (gulong mask,
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 47b200c3e4..ddd5267eac 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -30,7 +30,9 @@
#include <netinet/in.h>
#include "gdk.h"
#include "config.h"
-#include "gdkinput.h"
+
+#include "gdkwindow.h"
+#include "gdkinputprivate.h"
#include "gdkprivate.h"
#include "MwmUtil.h"