* Boston, MA 02111-1307, USA.
*/
-#include <config.h>
+#include "config.h"
#include <glib.h>
#include "gdk.h" /* gdk_event_send_client_message() */
#include "gdkdisplay.h"
LAST_SIGNAL
};
-static void gdk_display_class_init (GdkDisplayClass *class);
-static void gdk_display_init (GdkDisplay *display);
static void gdk_display_dispose (GObject *object);
static void gdk_display_finalize (GObject *object);
static guint signals[LAST_SIGNAL] = { 0 };
-static GObjectClass *parent_class;
static char *gdk_sm_client_id;
static const GdkDisplayPointerHooks default_pointer_hooks = {
static const GdkPointerHooks *singlehead_current_pointer_hooks = &singlehead_default_pointer_hooks;
-GType
-gdk_display_get_type (void)
-{
-
- static GType object_type = 0;
-
- if (!object_type)
- {
- static const GTypeInfo object_info = {
- sizeof (GdkDisplayClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gdk_display_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (GdkDisplay),
- 0, /* n_preallocs */
- (GInstanceInitFunc) gdk_display_init
- };
- object_type = g_type_register_static (G_TYPE_OBJECT,
- g_intern_static_string ("GdkDisplay"), &object_info, 0);
- }
-
- return object_type;
-}
+G_DEFINE_TYPE (GdkDisplay, gdk_display, G_TYPE_OBJECT)
static void
gdk_display_class_init (GdkDisplayClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
- parent_class = g_type_class_peek_parent (class);
-
object_class->finalize = gdk_display_finalize;
object_class->dispose = gdk_display_dispose;
_gdk_displays = g_slist_remove (_gdk_displays, object);
if (gdk_display_get_default() == display)
- gdk_display_manager_set_default_display (gdk_display_manager_get(), NULL);
+ {
+ if (_gdk_displays)
+ gdk_display_manager_set_default_display (gdk_display_manager_get(),
+ _gdk_displays->data);
+ else
+ gdk_display_manager_set_default_display (gdk_display_manager_get(),
+ NULL);
+ }
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ G_OBJECT_CLASS (gdk_display_parent_class)->dispose (object);
}
static void
gdk_display_finalize (GObject *object)
{
- G_OBJECT_CLASS (parent_class)->finalize (object);
+ G_OBJECT_CLASS (gdk_display_parent_class)->finalize (object);
}
/**
* Since: 2.2
**/
void
-gdk_display_put_event (GdkDisplay *display,
- GdkEvent *event)
+gdk_display_put_event (GdkDisplay *display,
+ const GdkEvent *event)
{
g_return_if_fail (GDK_IS_DISPLAY (display));
g_return_if_fail (event != NULL);
* @time_: a timestamp from a #GdkEvent, or %GDK_CURRENT_TIME if no
* timestamp is available.
*
- * Ungrabs the pointer, if it is grabbed by this application.
+ * Ungrabs the pointer on the default display, if it is grabbed by this
+ * application.
**/
void
gdk_pointer_ungrab (guint32 time)
/**
* gdk_pointer_is_grabbed:
*
- * Returns %TRUE if the pointer is currently grabbed by this application.
+ * Returns %TRUE if the pointer on the default display is currently
+ * grabbed by this application.
*
* Note that this does not take the inmplicit pointer grab on button
* presses into account.
* @time_: a timestamp from a #GdkEvent, or %GDK_CURRENT_TIME if no
* timestamp is available.
*
- * Ungrabs the keyboard, if it is grabbed by this application.
+ * Ungrabs the keyboard on the default display, if it is grabbed by this
+ * application.
**/
void
gdk_keyboard_ungrab (guint32 time)
/**
* gdk_beep:
*
- * Emits a short beep.
+ * Emits a short beep on the default display.
**/
void
gdk_beep (void)