2002-04-25 22:29:14 +00:00
|
|
|
/*
|
|
|
|
* gdkdisplay.h
|
|
|
|
*
|
|
|
|
* Copyright 2001 Sun Microsystems Inc.
|
|
|
|
*
|
|
|
|
* Erwann Chenede <erwann.chenede@sun.com>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GDK_DISPLAY_H__
|
|
|
|
#define __GDK_DISPLAY_H__
|
|
|
|
|
|
|
|
#include <gdk/gdktypes.h>
|
|
|
|
#include <gdk/gdkevents.h>
|
|
|
|
#include <glib-object.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
typedef struct _GdkDisplayClass GdkDisplayClass;
|
2002-10-07 19:42:49 +00:00
|
|
|
typedef struct _GdkDisplayPointerHooks GdkDisplayPointerHooks;
|
2002-04-25 22:29:14 +00:00
|
|
|
|
|
|
|
#define GDK_TYPE_DISPLAY (gdk_display_get_type ())
|
|
|
|
#define GDK_DISPLAY_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DISPLAY, GdkDisplay))
|
|
|
|
#define GDK_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DISPLAY, GdkDisplayClass))
|
|
|
|
#define GDK_IS_DISPLAY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DISPLAY))
|
|
|
|
#define GDK_IS_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DISPLAY))
|
|
|
|
#define GDK_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DISPLAY, GdkDisplayClass))
|
|
|
|
|
|
|
|
|
|
|
|
struct _GdkDisplay
|
|
|
|
{
|
|
|
|
GObject parent_instance;
|
|
|
|
|
|
|
|
/*< private >*/
|
|
|
|
GList *queued_events;
|
|
|
|
GList *queued_tail;
|
|
|
|
|
|
|
|
/* Information for determining if the latest button click
|
|
|
|
* is part of a double-click or triple-click
|
|
|
|
*/
|
|
|
|
guint32 button_click_time[2]; /* The last 2 button click times. */
|
|
|
|
GdkWindow *button_window[2]; /* The last 2 windows to receive button presses. */
|
2002-08-05 19:07:14 +00:00
|
|
|
gint button_number[2]; /* The last 2 buttons to be pressed. */
|
2002-04-25 22:29:14 +00:00
|
|
|
|
Start implementing display/screen closing scheme; keep a flag for whether
Thu Aug 1 11:26:03 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdkinternals.h:
Start implementing display/screen closing scheme; keep a
flag for whether displays and screens are closed,
call g_object_run_dispose(). Remove public gdk_screen_close().
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkscreen-x11.c: Add
dispose() methods; move appropriate parts of the finalize
there.
* gdk/x11/gdkcolor-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkmain-x11.c gdk/x11/gdkpango-x11.c
gdk/x11/gdkpixmap-x11.c gdk/x11/gdkproperty-x11.c
gdk/x11/gdkselection-x11.c gdk/x11/gdkwindow-x11.c:
Start of making everything correctly ignore operations
when a display has been closed.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_decorations):
Handle decorations == NULL.
* gdk/x11/gdkcolor-x11.c (gdk_colormap_remove):
Remove unnecessary hash table creation.
* gdk/x11/gdkinput.c gdk/x11/gdkinput-x11.c gdk/win32/gdkinput.c
Fix up gdk_device_get_history - handle events, n_events == NULL,
etc.
* gdk/x11/gdkproperty-x11.c (gdk_property_get):
Handle failure better.
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
Handle failure better, handle data == NULL, move docs
here, remove an excess round trip by asking for
all selection data at once.
* gdk/gdkselection.c gdk/win32/{x11,win32}/gdkselection-{x11,win32}.c
gdk/{x11,win32}/gdkmain-{x11,win32}.c gdk/gdkdisplay.c: Move
gdk_text_property_to_text_list(), gdk_string_to_compound_text(),
gdk_display_set_sm_client_id() to display-independent part of GDK.
* gdk/Makefile.am (gdk_c_sources): Sort gdkdisplay/screen.[ch]
into the right place.
2002-08-01 15:28:40 +00:00
|
|
|
guint double_click_time; /* Maximum time between clicks in msecs */
|
2002-06-18 23:23:30 +00:00
|
|
|
GdkDevice *core_pointer; /* Core pointer device */
|
|
|
|
|
2002-10-07 19:42:49 +00:00
|
|
|
const GdkDisplayPointerHooks *pointer_hooks; /* Current hooks for querying pointer */
|
|
|
|
|
Start implementing display/screen closing scheme; keep a flag for whether
Thu Aug 1 11:26:03 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdkinternals.h:
Start implementing display/screen closing scheme; keep a
flag for whether displays and screens are closed,
call g_object_run_dispose(). Remove public gdk_screen_close().
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkscreen-x11.c: Add
dispose() methods; move appropriate parts of the finalize
there.
* gdk/x11/gdkcolor-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkmain-x11.c gdk/x11/gdkpango-x11.c
gdk/x11/gdkpixmap-x11.c gdk/x11/gdkproperty-x11.c
gdk/x11/gdkselection-x11.c gdk/x11/gdkwindow-x11.c:
Start of making everything correctly ignore operations
when a display has been closed.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_decorations):
Handle decorations == NULL.
* gdk/x11/gdkcolor-x11.c (gdk_colormap_remove):
Remove unnecessary hash table creation.
* gdk/x11/gdkinput.c gdk/x11/gdkinput-x11.c gdk/win32/gdkinput.c
Fix up gdk_device_get_history - handle events, n_events == NULL,
etc.
* gdk/x11/gdkproperty-x11.c (gdk_property_get):
Handle failure better.
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
Handle failure better, handle data == NULL, move docs
here, remove an excess round trip by asking for
all selection data at once.
* gdk/gdkselection.c gdk/win32/{x11,win32}/gdkselection-{x11,win32}.c
gdk/{x11,win32}/gdkmain-{x11,win32}.c gdk/gdkdisplay.c: Move
gdk_text_property_to_text_list(), gdk_string_to_compound_text(),
gdk_display_set_sm_client_id() to display-independent part of GDK.
* gdk/Makefile.am (gdk_c_sources): Sort gdkdisplay/screen.[ch]
into the right place.
2002-08-01 15:28:40 +00:00
|
|
|
guint closed : 1; /* Whether this display has been closed */
|
2002-04-25 22:29:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GdkDisplayClass
|
|
|
|
{
|
|
|
|
GObjectClass parent_class;
|
|
|
|
|
|
|
|
G_CONST_RETURN gchar * (*get_display_name) (GdkDisplay *display);
|
|
|
|
gint (*get_n_screens) (GdkDisplay *display);
|
|
|
|
GdkScreen * (*get_screen) (GdkDisplay *display,
|
|
|
|
gint screen_num);
|
|
|
|
GdkScreen * (*get_default_screen) (GdkDisplay *display);
|
2002-08-01 23:43:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Signals */
|
2002-08-09 12:06:14 +00:00
|
|
|
void (*closed) (GdkDisplay *display,
|
2002-08-01 23:43:13 +00:00
|
|
|
gboolean is_error);
|
2002-04-25 22:29:14 +00:00
|
|
|
};
|
|
|
|
|
2002-10-07 19:42:49 +00:00
|
|
|
struct _GdkDisplayPointerHooks
|
|
|
|
{
|
|
|
|
void (*get_pointer) (GdkDisplay *display,
|
|
|
|
GdkScreen **screen,
|
|
|
|
gint *x,
|
|
|
|
gint *y,
|
|
|
|
GdkModifierType *mask);
|
|
|
|
GdkWindow* (*window_get_pointer) (GdkDisplay *display,
|
|
|
|
GdkWindow *window,
|
|
|
|
gint *x,
|
|
|
|
gint *y,
|
|
|
|
GdkModifierType *mask);
|
|
|
|
GdkWindow* (*window_at_pointer) (GdkDisplay *display,
|
|
|
|
gint *win_x,
|
|
|
|
gint *win_y);
|
|
|
|
};
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
GType gdk_display_get_type (void);
|
2002-06-20 23:59:27 +00:00
|
|
|
GdkDisplay *gdk_display_open (const gchar *display_name);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
|
|
|
G_CONST_RETURN gchar * gdk_display_get_name (GdkDisplay *display);
|
|
|
|
|
|
|
|
gint gdk_display_get_n_screens (GdkDisplay *display);
|
|
|
|
GdkScreen * gdk_display_get_screen (GdkDisplay *display,
|
|
|
|
gint screen_num);
|
|
|
|
GdkScreen * gdk_display_get_default_screen (GdkDisplay *display);
|
|
|
|
void gdk_display_pointer_ungrab (GdkDisplay *display,
|
|
|
|
guint32 time);
|
|
|
|
void gdk_display_keyboard_ungrab (GdkDisplay *display,
|
|
|
|
guint32 time);
|
|
|
|
gboolean gdk_display_pointer_is_grabbed (GdkDisplay *display);
|
|
|
|
void gdk_display_beep (GdkDisplay *display);
|
|
|
|
void gdk_display_sync (GdkDisplay *display);
|
|
|
|
void gdk_display_close (GdkDisplay *display);
|
|
|
|
|
|
|
|
GList * gdk_display_list_devices (GdkDisplay *display);
|
|
|
|
|
|
|
|
GdkEvent* gdk_display_get_event (GdkDisplay *display);
|
|
|
|
GdkEvent* gdk_display_peek_event (GdkDisplay *display);
|
|
|
|
void gdk_display_put_event (GdkDisplay *display,
|
|
|
|
GdkEvent *event);
|
|
|
|
|
|
|
|
void gdk_display_add_client_message_filter (GdkDisplay *display,
|
|
|
|
GdkAtom message_type,
|
|
|
|
GdkFilterFunc func,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
void gdk_display_set_double_click_time (GdkDisplay *display,
|
|
|
|
guint msec);
|
|
|
|
|
2002-06-20 23:59:27 +00:00
|
|
|
GdkDisplay *gdk_display_get_default (void);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2002-06-18 23:23:30 +00:00
|
|
|
GdkDevice *gdk_display_get_core_pointer (GdkDisplay *display);
|
|
|
|
|
2002-10-07 19:42:49 +00:00
|
|
|
void gdk_display_get_pointer (GdkDisplay *display,
|
|
|
|
GdkScreen **screen,
|
|
|
|
gint *x,
|
|
|
|
gint *y,
|
|
|
|
GdkModifierType *mask);
|
|
|
|
GdkWindow * gdk_display_get_window_at_pointer (GdkDisplay *display,
|
|
|
|
gint *win_x,
|
|
|
|
gint *win_y);
|
|
|
|
|
|
|
|
GdkDisplayPointerHooks *gdk_display_set_pointer_hooks (GdkDisplay *display,
|
|
|
|
const GdkDisplayPointerHooks *new_hooks);
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GDK_DISPLAY_H__ */
|