mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-05 16:20:10 +00:00
[broadway] Make broadway build with new gdk-backend setup
Convert all global functions to vtable calls, etc.
This commit is contained in:
parent
920e8b4343
commit
07db0e38b0
@ -55,11 +55,11 @@ MAINTAINERCLEANFILES = \
|
||||
|
||||
|
||||
## Copy .pc files to target-specific names
|
||||
gtk+-x11-3.0.pc gtk+-win32-3.0.pc gtk+-quartz-3.0.pc: gtk+-3.0.pc
|
||||
gtk+-x11-3.0.pc gtk+-win32-3.0.pc gtk+-quartz-3.0.pc gtk+-broadway-3.0.pc: gtk+-3.0.pc
|
||||
rm -f $@ && \
|
||||
cp gtk+-3.0.pc $@
|
||||
|
||||
gdk-x11-3.0.pc gdk-win32-3.0.pc gdk-quartz-3.0.pc: gdk-3.0.pc
|
||||
gdk-x11-3.0.pc gdk-win32-3.0.pc gdk-quartz-3.0.pc gdk-broadway-3.0.pc: gdk-3.0.pc
|
||||
rm -f $@ && \
|
||||
cp gdk-3.0.pc $@
|
||||
|
||||
|
@ -352,6 +352,7 @@ fi
|
||||
|
||||
if test "x$enable_broadway_backend" == xyes; then
|
||||
GDK_BACKENDS="$GDK_BACKENDS broadway"
|
||||
cairo_backends="$cairo_backends cairo"
|
||||
GDK_WINDOWING="$GDK_WINDOWING
|
||||
#define GDK_WINDOWING_BROADWAY"
|
||||
GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lz"
|
||||
|
@ -37,6 +37,7 @@ broadway_built_sources = \
|
||||
libgdk_broadway_la_SOURCES = \
|
||||
${broadway_built_private_headers}\
|
||||
gdkapplaunchcontext-broadway.c \
|
||||
gdkbroadwaydisplaymanager.h \
|
||||
gdkcursor-broadway.c \
|
||||
gdkdevice-broadway.h \
|
||||
gdkdevice-broadway.c \
|
||||
@ -44,6 +45,7 @@ libgdk_broadway_la_SOURCES = \
|
||||
gdkdevicemanager-broadway.c \
|
||||
gdkdisplay-broadway.c \
|
||||
gdkdisplay-broadway.h \
|
||||
gdkdisplaymanager-broadway.c \
|
||||
gdkdnd-broadway.c \
|
||||
gdkeventsource.c \
|
||||
gdkeventsource.h \
|
||||
@ -56,7 +58,6 @@ libgdk_broadway_la_SOURCES = \
|
||||
gdkscreen-broadway.c \
|
||||
gdkscreen-broadway.h \
|
||||
gdkselection-broadway.c \
|
||||
gdkspawn-broadway.c \
|
||||
gdktestutils-broadway.c \
|
||||
gdkvisual-broadway.c \
|
||||
gdkwindow-broadway.c \
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "gdkintl.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <gio/gdesktopappinfo.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
56
gdk/broadway/gdkbroadwaycursor.h
Normal file
56
gdk/broadway/gdkbroadwaycursor.h
Normal file
@ -0,0 +1,56 @@
|
||||
/* 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 Lesser 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser 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-2000. 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/.
|
||||
*/
|
||||
|
||||
#if !defined (__GDKX_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdkx.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GDK_BROADWAY_CURSOR_H__
|
||||
#define __GDK_BROADWAY_CURSOR_H__
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GDK_TYPE_BROADWAY_CURSOR (gdk_broadway_cursor_get_type ())
|
||||
#define GDK_BROADWAY_CURSOR(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_BROADWAY_CURSOR, GdkBroadwayCursor))
|
||||
#define GDK_BROADWAY_CURSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_BROADWAY_CURSOR, GdkBroadwayCursorClass))
|
||||
#define GDK_IS_BROADWAY_CURSOR(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_BROADWAY_CURSOR))
|
||||
#define GDK_IS_BROADWAY_CURSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_BROADWAY_CURSOR))
|
||||
#define GDK_BROADWAY_CURSOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_BROADWAY_CURSOR, GdkBroadwayCursorClass))
|
||||
|
||||
#ifdef GDK_COMPILATION
|
||||
typedef struct _GdkBroadwayCursor GdkBroadwayCursor;
|
||||
#else
|
||||
typedef GdkCursor GdkBroadwayCursor;
|
||||
#endif
|
||||
typedef struct _GdkBroadwayCursorClass GdkBroadwayCursorClass;
|
||||
|
||||
GType gdk_broadway_cursor_get_type (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_BROADWAY_CURSOR_H__ */
|
47
gdk/broadway/gdkbroadwaydisplaymanager.h
Normal file
47
gdk/broadway/gdkbroadwaydisplaymanager.h
Normal file
@ -0,0 +1,47 @@
|
||||
/* gdkbroadwaydisplaymanager.h
|
||||
*
|
||||
* Copyright (C) 2005-2007 Imendio AB
|
||||
* Copyright 2010 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser 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.
|
||||
*/
|
||||
|
||||
#if !defined(__GDKBROADWAY_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdkbroadway.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GDK_BROADWAY_DISPLAY_MANAGER_H__
|
||||
#define __GDK_BROADWAY_DISPLAY_MANAGER_H__
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GDK_TYPE_BROADWAY_DISPLAY_MANAGER (gdk_broadway_display_manager_get_type ())
|
||||
#define GDK_BROADWAY_DISPLAY_MANAGER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_BROADWAY_DISPLAY_MANAGER, GdkBroadwayDisplayManager))
|
||||
|
||||
#ifdef GDK_COMPILATION
|
||||
typedef struct _GdkBroadwayDisplayManager GdkBroadwayDisplayManager;
|
||||
#else
|
||||
typedef GdkDisplayManager _GdkBroadwayDisplayManager;
|
||||
#endif
|
||||
typedef struct _GdkDisplayManagerClass GdkBroadwayDisplayManagerClass;
|
||||
|
||||
GType gdk_broadway_display_manager_get_type (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_BROADWAY_DISPLAY_MANAGER_H__ */
|
47
gdk/broadway/gdkbroadwayvisual.h
Normal file
47
gdk/broadway/gdkbroadwayvisual.h
Normal file
@ -0,0 +1,47 @@
|
||||
/* gdkbroadwayvisual.h
|
||||
*
|
||||
* Copyright (C) 2011 Alexander Larsson <alexl@redhat.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser 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_BROADWAY_VISUAL_H__
|
||||
#define __GDK_BROADWAY_VISUAL_H__
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GDK_TYPE_BROADWAY_VISUAL (gdk_broadway_visual_get_type ())
|
||||
#define GDK_BROADWAY_VISUAL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_BROADWAY_VISUAL, GdkBroadwayVisual))
|
||||
#define GDK_BROADWAY_VISUAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_BROADWAY_VISUAL, GdkBroadwayVisualClass))
|
||||
#define GDK_IS_BROADWAY_VISUAL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_BROADWAY_VISUAL))
|
||||
#define GDK_IS_BROADWAY_VISUAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_BROADWAY_VISUAL))
|
||||
#define GDK_BROADWAY_VISUAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_BROADWAY_VISUAL, GdkBroadwayVisualClass))
|
||||
|
||||
#ifdef GDK_COMPILATION
|
||||
typedef struct _GdkBroadwayVisual GdkBroadwayVisual;
|
||||
#else
|
||||
typedef GdkVisual GdkBroadwayVisual;
|
||||
#endif
|
||||
typedef struct _GdkBroadwayVisualClass GdkBroadwayVisualClass;
|
||||
|
||||
|
||||
GType gdk_broadway_visual_get_type (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_BROADWAY_VISUAL_H__ */
|
52
gdk/broadway/gdkbroadwaywindow.h
Normal file
52
gdk/broadway/gdkbroadwaywindow.h
Normal file
@ -0,0 +1,52 @@
|
||||
/* 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 Lesser 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser 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-2000. 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_BROADWAY_WINDOW_H__
|
||||
#define __GDK_BROADWAY_WINDOW_H__
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GDK_TYPE_BROADWAY_WINDOW (gdk_broadway_window_get_type ())
|
||||
#define GDK_BROADWAY_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_BROADWAY_WINDOW, GdkBroadwayWindow))
|
||||
#define GDK_BROADWAY_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_BROADWAY_WINDOW, GdkBroadwayWindowClass))
|
||||
#define GDK_IS_BROADWAY_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_BROADWAY_WINDOW))
|
||||
#define GDK_IS_BROADWAY_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_BROADWAY_WINDOW))
|
||||
#define GDK_BROADWAY_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_BROADWAY_WINDOW, GdkBroadwayWindowClass))
|
||||
|
||||
#ifdef GDK_COMPILATION
|
||||
typedef struct _GdkBroadwayWindow GdkBroadwayWindow;
|
||||
#else
|
||||
typedef GdkWindow GdkBroadwayWindow;
|
||||
#endif
|
||||
typedef struct _GdkBroadwayWindowClass GdkBroadwayWindowClass;
|
||||
|
||||
GType gdk_broadway_window_get_type (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_BROADWAY_WINDOW_H__ */
|
@ -31,6 +31,7 @@
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
|
||||
#include "gdkcursor.h"
|
||||
#include "gdkcursorprivate.h"
|
||||
|
||||
#include "gdkprivate-broadway.h"
|
||||
#include "gdkdisplay-broadway.h"
|
||||
@ -38,6 +39,43 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
struct _GdkBroadwayCursor
|
||||
{
|
||||
GdkCursor cursor;
|
||||
};
|
||||
|
||||
struct _GdkBroadwayCursorClass
|
||||
{
|
||||
GdkCursorClass cursor_class;
|
||||
};
|
||||
|
||||
/*** GdkBroadwayCursor ***/
|
||||
|
||||
G_DEFINE_TYPE (GdkBroadwayCursor, gdk_broadway_cursor, GDK_TYPE_CURSOR)
|
||||
|
||||
static GdkPixbuf* gdk_broadway_cursor_get_image (GdkCursor *cursor);
|
||||
|
||||
static void
|
||||
gdk_broadway_cursor_finalize (GObject *object)
|
||||
{
|
||||
G_OBJECT_CLASS (gdk_broadway_cursor_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_cursor_class_init (GdkBroadwayCursorClass *xcursor_class)
|
||||
{
|
||||
GdkCursorClass *cursor_class = GDK_CURSOR_CLASS (xcursor_class);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (xcursor_class);
|
||||
|
||||
object_class->finalize = gdk_broadway_cursor_finalize;
|
||||
|
||||
cursor_class->get_image = gdk_broadway_cursor_get_image;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_cursor_init (GdkBroadwayCursor *cursor)
|
||||
{
|
||||
}
|
||||
|
||||
/* Called by gdk_display_broadway_finalize to flush any cached cursors
|
||||
* for a dead display.
|
||||
@ -48,59 +86,23 @@ _gdk_broadway_cursor_display_finalize (GdkDisplay *display)
|
||||
}
|
||||
|
||||
GdkCursor*
|
||||
gdk_cursor_new_for_display (GdkDisplay *display,
|
||||
GdkCursorType cursor_type)
|
||||
_gdk_broadway_display_get_cursor_for_type (GdkDisplay *display,
|
||||
GdkCursorType cursor_type)
|
||||
{
|
||||
GdkCursorPrivate *private;
|
||||
GdkCursor *cursor;
|
||||
GdkBroadwayCursor *private;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
|
||||
private = g_new (GdkCursorPrivate, 1);
|
||||
private->display = display;
|
||||
private = g_object_new (GDK_TYPE_BROADWAY_CURSOR,
|
||||
"cursor-type", cursor_type,
|
||||
"display", display,
|
||||
NULL);
|
||||
|
||||
cursor = (GdkCursor *) private;
|
||||
cursor->type = cursor_type;
|
||||
cursor->ref_count = 1;
|
||||
|
||||
return cursor;
|
||||
return GDK_CURSOR (private);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_cursor_destroy (GdkCursor *cursor)
|
||||
{
|
||||
GdkCursorPrivate *private;
|
||||
|
||||
g_return_if_fail (cursor != NULL);
|
||||
g_return_if_fail (cursor->ref_count == 0);
|
||||
|
||||
private = (GdkCursorPrivate *) cursor;
|
||||
|
||||
g_free (private);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gdk_cursor_get_display:
|
||||
* @cursor: a #GdkCursor.
|
||||
*
|
||||
* Returns the display on which the #GdkCursor is defined.
|
||||
*
|
||||
* Returns: the #GdkDisplay associated to @cursor
|
||||
*
|
||||
* Since: 2.2
|
||||
*/
|
||||
|
||||
GdkDisplay *
|
||||
gdk_cursor_get_display (GdkCursor *cursor)
|
||||
{
|
||||
g_return_val_if_fail (cursor != NULL, NULL);
|
||||
|
||||
return ((GdkCursorPrivate *)cursor)->display;
|
||||
}
|
||||
|
||||
GdkPixbuf*
|
||||
gdk_cursor_get_image (GdkCursor *cursor)
|
||||
static GdkPixbuf*
|
||||
gdk_broadway_cursor_get_image (GdkCursor *cursor)
|
||||
{
|
||||
g_return_val_if_fail (cursor != NULL, NULL);
|
||||
|
||||
@ -114,48 +116,39 @@ _gdk_broadway_cursor_update_theme (GdkCursor *cursor)
|
||||
}
|
||||
|
||||
GdkCursor *
|
||||
gdk_cursor_new_from_pixbuf (GdkDisplay *display,
|
||||
GdkPixbuf *pixbuf,
|
||||
gint x,
|
||||
gint y)
|
||||
_gdk_broadway_display_get_cursor_for_pixbuf (GdkDisplay *display,
|
||||
GdkPixbuf *pixbuf,
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
GdkCursorPrivate *private;
|
||||
GdkBroadwayCursor *private;
|
||||
GdkCursor *cursor;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
|
||||
|
||||
private = g_new (GdkCursorPrivate, 1);
|
||||
private->display = display;
|
||||
|
||||
private = g_object_new (GDK_TYPE_BROADWAY_CURSOR,
|
||||
"cursor-type", GDK_CURSOR_IS_PIXMAP,
|
||||
"display", display,
|
||||
NULL);
|
||||
cursor = (GdkCursor *) private;
|
||||
cursor->type = GDK_CURSOR_IS_PIXMAP;
|
||||
cursor->ref_count = 1;
|
||||
|
||||
return cursor;
|
||||
}
|
||||
|
||||
GdkCursor*
|
||||
gdk_cursor_new_from_name (GdkDisplay *display,
|
||||
const gchar *name)
|
||||
_gdk_broadway_display_get_cursor_for_name (GdkDisplay *display,
|
||||
const gchar *name)
|
||||
{
|
||||
GdkCursorPrivate *private;
|
||||
GdkCursor *cursor;
|
||||
GdkBroadwayCursor *private;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
private = g_object_new (GDK_TYPE_BROADWAY_CURSOR,
|
||||
"cursor-type", GDK_CURSOR_IS_PIXMAP,
|
||||
"display", display,
|
||||
NULL);
|
||||
|
||||
private = g_new (GdkCursorPrivate, 1);
|
||||
private->display = display;
|
||||
|
||||
cursor = (GdkCursor *) private;
|
||||
cursor->type = GDK_CURSOR_IS_PIXMAP;
|
||||
cursor->ref_count = 1;
|
||||
|
||||
return cursor;
|
||||
return GDK_CURSOR (private);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_display_supports_cursor_alpha (GdkDisplay *display)
|
||||
_gdk_broadway_display_supports_cursor_alpha (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
|
||||
|
||||
@ -163,25 +156,27 @@ gdk_display_supports_cursor_alpha (GdkDisplay *display)
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_display_supports_cursor_color (GdkDisplay *display)
|
||||
_gdk_broadway_display_supports_cursor_color (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
guint
|
||||
gdk_display_get_default_cursor_size (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
|
||||
|
||||
return 20;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_display_get_maximal_cursor_size (GdkDisplay *display,
|
||||
guint *width,
|
||||
guint *height)
|
||||
_gdk_broadway_display_get_default_cursor_size (GdkDisplay *display,
|
||||
guint *width,
|
||||
guint *height)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DISPLAY (display));
|
||||
|
||||
*width = *height = 20;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_display_get_maximal_cursor_size (GdkDisplay *display,
|
||||
guint *width,
|
||||
guint *height)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DISPLAY (display));
|
||||
|
||||
|
@ -24,71 +24,71 @@
|
||||
#include "gdkwindow.h"
|
||||
#include "gdkprivate-broadway.h"
|
||||
|
||||
static gboolean gdk_device_core_get_history (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
guint32 start,
|
||||
guint32 stop,
|
||||
GdkTimeCoord ***events,
|
||||
gint *n_events);
|
||||
static void gdk_device_core_get_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gdouble *axes,
|
||||
GdkModifierType *mask);
|
||||
static void gdk_device_core_set_window_cursor (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkCursor *cursor);
|
||||
static void gdk_device_core_warp (GdkDevice *device,
|
||||
GdkScreen *screen,
|
||||
gint x,
|
||||
gint y);
|
||||
static gboolean gdk_device_core_query_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkWindow **root_window,
|
||||
GdkWindow **child_window,
|
||||
gint *root_x,
|
||||
gint *root_y,
|
||||
gint *win_x,
|
||||
gint *win_y,
|
||||
GdkModifierType *mask);
|
||||
static GdkGrabStatus gdk_device_core_grab (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gboolean owner_events,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindow *confine_to,
|
||||
GdkCursor *cursor,
|
||||
guint32 time_);
|
||||
static void gdk_device_core_ungrab (GdkDevice *device,
|
||||
guint32 time_);
|
||||
static GdkWindow * gdk_device_core_window_at_position (GdkDevice *device,
|
||||
gint *win_x,
|
||||
gint *win_y,
|
||||
GdkModifierType *mask,
|
||||
gboolean get_toplevel);
|
||||
static void gdk_device_core_select_window_events (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkEventMask event_mask);
|
||||
static gboolean gdk_broadway_device_get_history (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
guint32 start,
|
||||
guint32 stop,
|
||||
GdkTimeCoord ***events,
|
||||
gint *n_events);
|
||||
static void gdk_broadway_device_get_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gdouble *axes,
|
||||
GdkModifierType *mask);
|
||||
static void gdk_broadway_device_set_window_cursor (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkCursor *cursor);
|
||||
static void gdk_broadway_device_warp (GdkDevice *device,
|
||||
GdkScreen *screen,
|
||||
gint x,
|
||||
gint y);
|
||||
static gboolean gdk_broadway_device_query_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkWindow **root_window,
|
||||
GdkWindow **child_window,
|
||||
gint *root_x,
|
||||
gint *root_y,
|
||||
gint *win_x,
|
||||
gint *win_y,
|
||||
GdkModifierType *mask);
|
||||
static GdkGrabStatus gdk_broadway_device_grab (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gboolean owner_events,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindow *confine_to,
|
||||
GdkCursor *cursor,
|
||||
guint32 time_);
|
||||
static void gdk_broadway_device_ungrab (GdkDevice *device,
|
||||
guint32 time_);
|
||||
static GdkWindow * gdk_broadway_device_window_at_position (GdkDevice *device,
|
||||
gint *win_x,
|
||||
gint *win_y,
|
||||
GdkModifierType *mask,
|
||||
gboolean get_toplevel);
|
||||
static void gdk_broadway_device_select_window_events (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkEventMask event_mask);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GdkDeviceCore, gdk_device_core, GDK_TYPE_DEVICE)
|
||||
G_DEFINE_TYPE (GdkBroadwayDevice, gdk_broadway_device, GDK_TYPE_DEVICE)
|
||||
|
||||
static void
|
||||
gdk_device_core_class_init (GdkDeviceCoreClass *klass)
|
||||
gdk_broadway_device_class_init (GdkBroadwayDeviceClass *klass)
|
||||
{
|
||||
GdkDeviceClass *device_class = GDK_DEVICE_CLASS (klass);
|
||||
|
||||
device_class->get_history = gdk_device_core_get_history;
|
||||
device_class->get_state = gdk_device_core_get_state;
|
||||
device_class->set_window_cursor = gdk_device_core_set_window_cursor;
|
||||
device_class->warp = gdk_device_core_warp;
|
||||
device_class->query_state = gdk_device_core_query_state;
|
||||
device_class->grab = gdk_device_core_grab;
|
||||
device_class->ungrab = gdk_device_core_ungrab;
|
||||
device_class->window_at_position = gdk_device_core_window_at_position;
|
||||
device_class->select_window_events = gdk_device_core_select_window_events;
|
||||
device_class->get_history = gdk_broadway_device_get_history;
|
||||
device_class->get_state = gdk_broadway_device_get_state;
|
||||
device_class->set_window_cursor = gdk_broadway_device_set_window_cursor;
|
||||
device_class->warp = gdk_broadway_device_warp;
|
||||
device_class->query_state = gdk_broadway_device_query_state;
|
||||
device_class->grab = gdk_broadway_device_grab;
|
||||
device_class->ungrab = gdk_broadway_device_ungrab;
|
||||
device_class->window_at_position = gdk_broadway_device_window_at_position;
|
||||
device_class->select_window_events = gdk_broadway_device_select_window_events;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_core_init (GdkDeviceCore *device_core)
|
||||
gdk_broadway_device_init (GdkBroadwayDevice *device_core)
|
||||
{
|
||||
GdkDevice *device;
|
||||
|
||||
@ -99,21 +99,21 @@ gdk_device_core_init (GdkDeviceCore *device_core)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_device_core_get_history (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
guint32 start,
|
||||
guint32 stop,
|
||||
GdkTimeCoord ***events,
|
||||
gint *n_events)
|
||||
gdk_broadway_device_get_history (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
guint32 start,
|
||||
guint32 stop,
|
||||
GdkTimeCoord ***events,
|
||||
gint *n_events)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_core_get_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gdouble *axes,
|
||||
GdkModifierType *mask)
|
||||
gdk_broadway_device_get_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gdouble *axes,
|
||||
GdkModifierType *mask)
|
||||
{
|
||||
gint x_int, y_int;
|
||||
|
||||
@ -127,65 +127,65 @@ gdk_device_core_get_state (GdkDevice *device,
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_core_set_window_cursor (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkCursor *cursor)
|
||||
gdk_broadway_device_set_window_cursor (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkCursor *cursor)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_core_warp (GdkDevice *device,
|
||||
GdkScreen *screen,
|
||||
gint x,
|
||||
gint y)
|
||||
gdk_broadway_device_warp (GdkDevice *device,
|
||||
GdkScreen *screen,
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_device_core_query_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkWindow **root_window,
|
||||
GdkWindow **child_window,
|
||||
gint *root_x,
|
||||
gint *root_y,
|
||||
gint *win_x,
|
||||
gint *win_y,
|
||||
GdkModifierType *mask)
|
||||
gdk_broadway_device_query_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkWindow **root_window,
|
||||
GdkWindow **child_window,
|
||||
gint *root_x,
|
||||
gint *root_y,
|
||||
gint *win_x,
|
||||
gint *win_y,
|
||||
GdkModifierType *mask)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static GdkGrabStatus
|
||||
gdk_device_core_grab (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gboolean owner_events,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindow *confine_to,
|
||||
GdkCursor *cursor,
|
||||
guint32 time_)
|
||||
gdk_broadway_device_grab (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gboolean owner_events,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindow *confine_to,
|
||||
GdkCursor *cursor,
|
||||
guint32 time_)
|
||||
{
|
||||
return GDK_GRAB_NOT_VIEWABLE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_core_ungrab (GdkDevice *device,
|
||||
guint32 time_)
|
||||
gdk_broadway_device_ungrab (GdkDevice *device,
|
||||
guint32 time_)
|
||||
{
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
gdk_device_core_window_at_position (GdkDevice *device,
|
||||
gint *win_x,
|
||||
gint *win_y,
|
||||
GdkModifierType *mask,
|
||||
gboolean get_toplevel)
|
||||
gdk_broadway_device_window_at_position (GdkDevice *device,
|
||||
gint *win_x,
|
||||
gint *win_y,
|
||||
GdkModifierType *mask,
|
||||
gboolean get_toplevel)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_core_select_window_events (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkEventMask event_mask)
|
||||
gdk_broadway_device_select_window_events (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkEventMask event_mask)
|
||||
{
|
||||
}
|
||||
|
@ -24,28 +24,28 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GDK_TYPE_DEVICE_CORE (gdk_device_core_get_type ())
|
||||
#define GDK_DEVICE_CORE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_CORE, GdkDeviceCore))
|
||||
#define GDK_DEVICE_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_CORE, GdkDeviceCoreClass))
|
||||
#define GDK_IS_DEVICE_CORE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_CORE))
|
||||
#define GDK_IS_DEVICE_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE_CORE))
|
||||
#define GDK_DEVICE_CORE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_CORE, GdkDeviceCoreClass))
|
||||
#define GDK_TYPE_BROADWAY_DEVICE (gdk_broadway_device_get_type ())
|
||||
#define GDK_BROADWAY_DEVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_BROADWAY_DEVICE, GdkBroadwayDevice))
|
||||
#define GDK_BROADWAY_DEVICE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_BROADWAY_DEVICE, GdkBroadwayDeviceClass))
|
||||
#define GDK_IS_BROADWAY_DEVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_BROADWAY_DEVICE))
|
||||
#define GDK_IS_BROADWAY_DEVICE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_BROADWAY_DEVICE))
|
||||
#define GDK_BROADWAY_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_BROADWAY_DEVICE, GdkBroadwayDeviceClass))
|
||||
|
||||
typedef struct _GdkDeviceCore GdkDeviceCore;
|
||||
typedef struct _GdkDeviceCoreClass GdkDeviceCoreClass;
|
||||
typedef struct _GdkBroadwayDevice GdkBroadwayDevice;
|
||||
typedef struct _GdkBroadwayDeviceClass GdkBroadwayDeviceClass;
|
||||
|
||||
struct _GdkDeviceCore
|
||||
struct _GdkBroadwayDevice
|
||||
{
|
||||
GdkDevice parent_instance;
|
||||
};
|
||||
|
||||
struct _GdkDeviceCoreClass
|
||||
struct _GdkBroadwayDeviceClass
|
||||
{
|
||||
GdkDeviceClass parent_class;
|
||||
};
|
||||
|
||||
G_GNUC_INTERNAL
|
||||
GType gdk_device_core_get_type (void) G_GNUC_CONST;
|
||||
GType gdk_broadway_device_get_type (void) G_GNUC_CONST;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -30,32 +30,32 @@
|
||||
#define HAS_FOCUS(toplevel) \
|
||||
((toplevel)->has_focus || (toplevel)->has_pointer_focus)
|
||||
|
||||
static void gdk_device_manager_core_finalize (GObject *object);
|
||||
static void gdk_device_manager_core_constructed (GObject *object);
|
||||
static void gdk_broadway_device_manager_finalize (GObject *object);
|
||||
static void gdk_broadway_device_manager_constructed (GObject *object);
|
||||
|
||||
static GList * gdk_device_manager_core_list_devices (GdkDeviceManager *device_manager,
|
||||
GdkDeviceType type);
|
||||
static GdkDevice * gdk_device_manager_core_get_client_pointer (GdkDeviceManager *device_manager);
|
||||
static GList * gdk_broadway_device_manager_list_devices (GdkDeviceManager *device_manager,
|
||||
GdkDeviceType type);
|
||||
static GdkDevice * gdk_broadway_device_manager_get_client_pointer (GdkDeviceManager *device_manager);
|
||||
|
||||
G_DEFINE_TYPE (GdkDeviceManagerCore, gdk_device_manager_core, GDK_TYPE_DEVICE_MANAGER)
|
||||
G_DEFINE_TYPE (GdkBroadwayDeviceManager, gdk_broadway_device_manager, GDK_TYPE_DEVICE_MANAGER)
|
||||
|
||||
static void
|
||||
gdk_device_manager_core_class_init (GdkDeviceManagerCoreClass *klass)
|
||||
gdk_broadway_device_manager_class_init (GdkBroadwayDeviceManagerClass *klass)
|
||||
{
|
||||
GdkDeviceManagerClass *device_manager_class = GDK_DEVICE_MANAGER_CLASS (klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = gdk_device_manager_core_finalize;
|
||||
object_class->constructed = gdk_device_manager_core_constructed;
|
||||
device_manager_class->list_devices = gdk_device_manager_core_list_devices;
|
||||
device_manager_class->get_client_pointer = gdk_device_manager_core_get_client_pointer;
|
||||
object_class->finalize = gdk_broadway_device_manager_finalize;
|
||||
object_class->constructed = gdk_broadway_device_manager_constructed;
|
||||
device_manager_class->list_devices = gdk_broadway_device_manager_list_devices;
|
||||
device_manager_class->get_client_pointer = gdk_broadway_device_manager_get_client_pointer;
|
||||
}
|
||||
|
||||
static GdkDevice *
|
||||
create_core_pointer (GdkDeviceManager *device_manager,
|
||||
GdkDisplay *display)
|
||||
{
|
||||
return g_object_new (GDK_TYPE_DEVICE_CORE,
|
||||
return g_object_new (GDK_TYPE_BROADWAY_DEVICE,
|
||||
"name", "Core Pointer",
|
||||
"type", GDK_DEVICE_TYPE_MASTER,
|
||||
"input-source", GDK_SOURCE_MOUSE,
|
||||
@ -70,7 +70,7 @@ static GdkDevice *
|
||||
create_core_keyboard (GdkDeviceManager *device_manager,
|
||||
GdkDisplay *display)
|
||||
{
|
||||
return g_object_new (GDK_TYPE_DEVICE_CORE,
|
||||
return g_object_new (GDK_TYPE_BROADWAY_DEVICE,
|
||||
"name", "Core Keyboard",
|
||||
"type", GDK_DEVICE_TYPE_MASTER,
|
||||
"input-source", GDK_SOURCE_KEYBOARD,
|
||||
@ -82,30 +82,30 @@ create_core_keyboard (GdkDeviceManager *device_manager,
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_manager_core_init (GdkDeviceManagerCore *device_manager)
|
||||
gdk_broadway_device_manager_init (GdkBroadwayDeviceManager *device_manager)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_manager_core_finalize (GObject *object)
|
||||
gdk_broadway_device_manager_finalize (GObject *object)
|
||||
{
|
||||
GdkDeviceManagerCore *device_manager_core;
|
||||
GdkBroadwayDeviceManager *device_manager;
|
||||
|
||||
device_manager_core = GDK_DEVICE_MANAGER_CORE (object);
|
||||
device_manager = GDK_BROADWAY_DEVICE_MANAGER (object);
|
||||
|
||||
g_object_unref (device_manager_core->core_pointer);
|
||||
g_object_unref (device_manager_core->core_keyboard);
|
||||
g_object_unref (device_manager->core_pointer);
|
||||
g_object_unref (device_manager->core_keyboard);
|
||||
|
||||
G_OBJECT_CLASS (gdk_device_manager_core_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (gdk_broadway_device_manager_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_manager_core_constructed (GObject *object)
|
||||
gdk_broadway_device_manager_constructed (GObject *object)
|
||||
{
|
||||
GdkDeviceManagerCore *device_manager;
|
||||
GdkBroadwayDeviceManager *device_manager;
|
||||
GdkDisplay *display;
|
||||
|
||||
device_manager = GDK_DEVICE_MANAGER_CORE (object);
|
||||
device_manager = GDK_BROADWAY_DEVICE_MANAGER (object);
|
||||
display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (object));
|
||||
device_manager->core_pointer = create_core_pointer (GDK_DEVICE_MANAGER (device_manager), display);
|
||||
device_manager->core_keyboard = create_core_keyboard (GDK_DEVICE_MANAGER (device_manager), display);
|
||||
@ -116,35 +116,33 @@ gdk_device_manager_core_constructed (GObject *object)
|
||||
|
||||
|
||||
static GList *
|
||||
gdk_device_manager_core_list_devices (GdkDeviceManager *device_manager,
|
||||
GdkDeviceType type)
|
||||
gdk_broadway_device_manager_list_devices (GdkDeviceManager *device_manager,
|
||||
GdkDeviceType type)
|
||||
{
|
||||
GdkDeviceManagerCore *device_manager_core;
|
||||
GdkBroadwayDeviceManager *broadway_device_manager = (GdkBroadwayDeviceManager *) device_manager;
|
||||
GList *devices = NULL;
|
||||
|
||||
if (type == GDK_DEVICE_TYPE_MASTER)
|
||||
{
|
||||
device_manager_core = (GdkDeviceManagerCore *) device_manager;
|
||||
devices = g_list_prepend (devices, device_manager_core->core_keyboard);
|
||||
devices = g_list_prepend (devices, device_manager_core->core_pointer);
|
||||
devices = g_list_prepend (devices, broadway_device_manager->core_keyboard);
|
||||
devices = g_list_prepend (devices, broadway_device_manager->core_pointer);
|
||||
}
|
||||
|
||||
return devices;
|
||||
}
|
||||
|
||||
static GdkDevice *
|
||||
gdk_device_manager_core_get_client_pointer (GdkDeviceManager *device_manager)
|
||||
gdk_broadway_device_manager_get_client_pointer (GdkDeviceManager *device_manager)
|
||||
{
|
||||
GdkDeviceManagerCore *device_manager_core;
|
||||
GdkBroadwayDeviceManager *broadway_device_manager = (GdkBroadwayDeviceManager *) device_manager;
|
||||
|
||||
device_manager_core = (GdkDeviceManagerCore *) device_manager;
|
||||
return device_manager_core->core_pointer;
|
||||
return broadway_device_manager->core_pointer;
|
||||
}
|
||||
|
||||
GdkDeviceManager *
|
||||
_gdk_device_manager_new (GdkDisplay *display)
|
||||
_gdk_broadway_device_manager_new (GdkDisplay *display)
|
||||
{
|
||||
return g_object_new (GDK_TYPE_DEVICE_MANAGER_CORE,
|
||||
return g_object_new (GDK_TYPE_BROADWAY_DEVICE_MANAGER,
|
||||
"display", display,
|
||||
NULL);
|
||||
}
|
||||
|
@ -20,34 +20,34 @@
|
||||
#ifndef __GDK_DEVICE_MANAGER_BROADWAY_H__
|
||||
#define __GDK_DEVICE_MANAGER_BROADWAY_H__
|
||||
|
||||
#include <gdk/gdkdevicemanager.h>
|
||||
#include <gdk/gdkdevicemanagerprivate.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GDK_TYPE_DEVICE_MANAGER_CORE (gdk_device_manager_core_get_type ())
|
||||
#define GDK_DEVICE_MANAGER_CORE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_MANAGER_CORE, GdkDeviceManagerCore))
|
||||
#define GDK_DEVICE_MANAGER_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_MANAGER_CORE, GdkDeviceManagerCoreClass))
|
||||
#define GDK_IS_DEVICE_MANAGER_CORE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_MANAGER_CORE))
|
||||
#define GDK_IS_DEVICE_MANAGER_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE_MANAGER_CORE))
|
||||
#define GDK_DEVICE_MANAGER_CORE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_MANAGER_CORE, GdkDeviceManagerCoreClass))
|
||||
#define GDK_TYPE_BROADWAY_DEVICE_MANAGER (gdk_broadway_device_manager_get_type ())
|
||||
#define GDK_BROADWAY_DEVICE_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_BROADWAY_DEVICE_MANAGER, GdkBroadwayDeviceManager))
|
||||
#define GDK_BROADWAY_DEVICE_MANAGER_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_BROADWAY_DEVICE_MANAGER, GdkBroadwayDeviceManagerClass))
|
||||
#define GDK_IS_BROADWAY_DEVICE_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_BROADWAY_DEVICE_MANAGER))
|
||||
#define GDK_IS_BROADWAY_DEVICE_MANAGER_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_BROADWAY_DEVICE_MANAGER))
|
||||
#define GDK_BROADWAY_DEVICE_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_BROADWAY_DEVICE_MANAGER, GdkBroadwayDeviceManagerClass))
|
||||
|
||||
typedef struct _GdkDeviceManagerCore GdkDeviceManagerCore;
|
||||
typedef struct _GdkDeviceManagerCoreClass GdkDeviceManagerCoreClass;
|
||||
typedef struct _GdkBroadwayDeviceManager GdkBroadwayDeviceManager;
|
||||
typedef struct _GdkBroadwayDeviceManagerClass GdkBroadwayDeviceManagerClass;
|
||||
|
||||
struct _GdkDeviceManagerCore
|
||||
struct _GdkBroadwayDeviceManager
|
||||
{
|
||||
GdkDeviceManager parent_object;
|
||||
GdkDevice *core_pointer;
|
||||
GdkDevice *core_keyboard;
|
||||
};
|
||||
|
||||
struct _GdkDeviceManagerCoreClass
|
||||
struct _GdkBroadwayDeviceManagerClass
|
||||
{
|
||||
GdkDeviceManagerClass parent_class;
|
||||
};
|
||||
|
||||
GType gdk_device_manager_core_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GType gdk_broadway_device_manager_get_type (void) G_GNUC_CONST;
|
||||
GdkDeviceManager *_gdk_broadway_device_manager_new (GdkDisplay *display);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "gdkscreen-broadway.h"
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkdeviceprivate.h"
|
||||
#include "gdkdevicemanager.h"
|
||||
#include "gdkdevicemanager-broadway.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib/gprintf.h>
|
||||
@ -41,45 +41,37 @@
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static void gdk_display_broadway_dispose (GObject *object);
|
||||
static void gdk_display_broadway_finalize (GObject *object);
|
||||
|
||||
G_DEFINE_TYPE (GdkDisplayBroadway, _gdk_display_broadway, GDK_TYPE_DISPLAY)
|
||||
static void gdk_broadway_display_dispose (GObject *object);
|
||||
static void gdk_broadway_display_finalize (GObject *object);
|
||||
|
||||
G_DEFINE_TYPE (GdkBroadwayDisplay, gdk_broadway_display, GDK_TYPE_DISPLAY)
|
||||
|
||||
static void
|
||||
_gdk_display_broadway_class_init (GdkDisplayBroadwayClass * class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
|
||||
object_class->dispose = gdk_display_broadway_dispose;
|
||||
object_class->finalize = gdk_display_broadway_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
_gdk_display_broadway_init (GdkDisplayBroadway *display)
|
||||
gdk_broadway_display_init (GdkBroadwayDisplay *display)
|
||||
{
|
||||
_gdk_broadway_display_manager_add_display (gdk_display_manager_get (),
|
||||
GDK_DISPLAY_OBJECT (display));
|
||||
display->id_ht = g_hash_table_new (NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_gdk_event_init (GdkDisplay *display)
|
||||
gdk_event_init (GdkDisplay *display)
|
||||
{
|
||||
GdkDisplayBroadway *display_broadway;
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
|
||||
display_broadway = GDK_DISPLAY_BROADWAY (display);
|
||||
display_broadway->event_source = gdk_event_source_new (display);
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (display);
|
||||
broadway_display->event_source = _gdk_broadway_event_source_new (display);
|
||||
}
|
||||
|
||||
static void
|
||||
_gdk_input_init (GdkDisplay *display)
|
||||
gdk_broadway_display_init_input (GdkDisplay *display)
|
||||
{
|
||||
GdkDisplayBroadway *display_broadway;
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
GdkDeviceManager *device_manager;
|
||||
GdkDevice *device;
|
||||
GList *list, *l;
|
||||
|
||||
display_broadway = GDK_DISPLAY_BROADWAY (display);
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (display);
|
||||
device_manager = gdk_display_get_device_manager (display);
|
||||
|
||||
/* For backwards compatibility, just add
|
||||
@ -94,7 +86,7 @@ _gdk_input_init (GdkDisplay *display)
|
||||
if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
|
||||
continue;
|
||||
|
||||
display_broadway->input_devices = g_list_prepend (display_broadway->input_devices,
|
||||
broadway_display->input_devices = g_list_prepend (broadway_display->input_devices,
|
||||
g_object_ref (l->data));
|
||||
}
|
||||
|
||||
@ -117,7 +109,7 @@ _gdk_input_init (GdkDisplay *display)
|
||||
}
|
||||
|
||||
/* Add the core pointer to the devices list */
|
||||
display_broadway->input_devices = g_list_prepend (display_broadway->input_devices,
|
||||
broadway_display->input_devices = g_list_prepend (broadway_display->input_devices,
|
||||
g_object_ref (display->core_pointer));
|
||||
|
||||
g_list_free (list);
|
||||
@ -184,13 +176,13 @@ got_input (GInputStream *stream,
|
||||
message = g_data_input_stream_read_upto_finish (G_DATA_INPUT_STREAM (stream), result, &len, &error);
|
||||
if (message == NULL)
|
||||
{
|
||||
GDK_DISPLAY_BROADWAY (request->display)->input = NULL;
|
||||
GDK_BROADWAY_DISPLAY (request->display)->input = NULL;
|
||||
http_request_free (request);
|
||||
return;
|
||||
}
|
||||
|
||||
g_assert (message[0] == 0);
|
||||
_gdk_events_got_input (request->display, message + 1);
|
||||
_gdk_broadway_events_got_input (request->display, message + 1);
|
||||
|
||||
/* Skip past ending 0xff */
|
||||
g_data_input_stream_read_byte (request->data, NULL, NULL);
|
||||
@ -232,11 +224,11 @@ start_input (HttpRequest *request)
|
||||
gsize len;
|
||||
GChecksum *checksum;
|
||||
char *origin, *host;
|
||||
GdkDisplayBroadway *display_broadway;
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
|
||||
display_broadway = GDK_DISPLAY_BROADWAY (request->display);
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (request->display);
|
||||
|
||||
if (display_broadway->input != NULL)
|
||||
if (broadway_display->input != NULL)
|
||||
{
|
||||
send_error (request, 409, "Input already handled");
|
||||
return;
|
||||
@ -337,7 +329,7 @@ start_input (HttpRequest *request)
|
||||
g_output_stream_write_all (g_io_stream_get_output_stream (G_IO_STREAM (request->connection)),
|
||||
challenge, 16, NULL, NULL, NULL);
|
||||
|
||||
display_broadway->input = request;
|
||||
broadway_display->input = request;
|
||||
|
||||
g_data_input_stream_read_upto_async (request->data, "\xff", 1, 0, NULL,
|
||||
(GAsyncReadyCallback)got_input, request);
|
||||
@ -349,16 +341,16 @@ static void
|
||||
start_output (HttpRequest *request)
|
||||
{
|
||||
GSocket *socket;
|
||||
GdkDisplayBroadway *display_broadway;
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
int fd;
|
||||
|
||||
socket = g_socket_connection_get_socket (request->connection);
|
||||
|
||||
display_broadway = GDK_DISPLAY_BROADWAY (request->display);
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (request->display);
|
||||
fd = g_socket_get_fd (socket);
|
||||
set_fd_blocking (fd);
|
||||
/* We dup this because otherwise it'll be closed with the request SocketConnection */
|
||||
display_broadway->output = broadway_output_new (dup(fd));
|
||||
broadway_display->output = broadway_output_new (dup(fd));
|
||||
_gdk_broadway_resync_windows ();
|
||||
http_request_free (request);
|
||||
}
|
||||
@ -488,45 +480,40 @@ handle_incoming_connection (GSocketService *service,
|
||||
}
|
||||
|
||||
GdkDisplay *
|
||||
gdk_display_open (const gchar *display_name)
|
||||
_gdk_broadway_display_open (const gchar *display_name)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GdkDisplayBroadway *display_broadway;
|
||||
const char *sm_client_id;
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
GError *error;
|
||||
|
||||
display = g_object_new (GDK_TYPE_DISPLAY_BROADWAY, NULL);
|
||||
display_broadway = GDK_DISPLAY_BROADWAY (display);
|
||||
display = g_object_new (GDK_TYPE_BROADWAY_DISPLAY, NULL);
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (display);
|
||||
|
||||
display_broadway->output = NULL;
|
||||
broadway_display->output = NULL;
|
||||
|
||||
/* initialize the display's screens */
|
||||
display_broadway->screens = g_new (GdkScreen *, 1);
|
||||
display_broadway->screens[0] = _gdk_broadway_screen_new (display, 0);
|
||||
broadway_display->screens = g_new (GdkScreen *, 1);
|
||||
broadway_display->screens[0] = _gdk_broadway_screen_new (display, 0);
|
||||
|
||||
/* We need to initialize events after we have the screen
|
||||
* structures in places
|
||||
*/
|
||||
_gdk_screen_broadway_events_init (display_broadway->screens[0]);
|
||||
_gdk_broadway_screen_events_init (broadway_display->screens[0]);
|
||||
|
||||
/*set the default screen */
|
||||
display_broadway->default_screen = display_broadway->screens[0];
|
||||
broadway_display->default_screen = broadway_display->screens[0];
|
||||
|
||||
display->device_manager = _gdk_device_manager_new (display);
|
||||
display->device_manager = _gdk_broadway_device_manager_new (display);
|
||||
|
||||
_gdk_event_init (display);
|
||||
gdk_event_init (display);
|
||||
|
||||
sm_client_id = _gdk_get_sm_client_id ();
|
||||
if (sm_client_id)
|
||||
_gdk_windowing_display_set_sm_client_id (display, sm_client_id);
|
||||
gdk_broadway_display_init_input (display);
|
||||
_gdk_broadway_display_init_dnd (display);
|
||||
|
||||
_gdk_input_init (display);
|
||||
_gdk_dnd_init (display);
|
||||
_gdk_broadway_screen_setup (broadway_display->screens[0]);
|
||||
|
||||
_gdk_broadway_screen_setup (display_broadway->screens[0]);
|
||||
|
||||
display_broadway->service = g_socket_service_new ();
|
||||
if (!g_socket_listener_add_inet_port (G_SOCKET_LISTENER (display_broadway->service),
|
||||
broadway_display->service = g_socket_service_new ();
|
||||
if (!g_socket_listener_add_inet_port (G_SOCKET_LISTENER (broadway_display->service),
|
||||
8080,
|
||||
G_OBJECT (display),
|
||||
&error))
|
||||
@ -535,7 +522,7 @@ gdk_display_open (const gchar *display_name)
|
||||
g_error_free (error);
|
||||
return NULL;
|
||||
}
|
||||
g_signal_connect (display_broadway->service, "incoming", G_CALLBACK (handle_incoming_connection), NULL);
|
||||
g_signal_connect (broadway_display->service, "incoming", G_CALLBACK (handle_incoming_connection), NULL);
|
||||
|
||||
g_signal_emit_by_name (display, "opened");
|
||||
g_signal_emit_by_name (gdk_display_manager_get (), "display-opened", display);
|
||||
@ -544,68 +531,68 @@ gdk_display_open (const gchar *display_name)
|
||||
}
|
||||
|
||||
|
||||
G_CONST_RETURN gchar *
|
||||
gdk_display_get_name (GdkDisplay *display)
|
||||
static G_CONST_RETURN gchar *
|
||||
gdk_broadway_display_get_name (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
|
||||
return (gchar *) "Broadway";
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_display_get_n_screens (GdkDisplay *display)
|
||||
static gint
|
||||
gdk_broadway_display_get_n_screens (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), 0);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
GdkScreen *
|
||||
gdk_display_get_screen (GdkDisplay *display,
|
||||
gint screen_num)
|
||||
static GdkScreen *
|
||||
gdk_broadway_display_get_screen (GdkDisplay *display,
|
||||
gint screen_num)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
g_return_val_if_fail (screen_num == 0, NULL);
|
||||
|
||||
return GDK_DISPLAY_BROADWAY (display)->screens[screen_num];
|
||||
return GDK_BROADWAY_DISPLAY (display)->screens[screen_num];
|
||||
}
|
||||
|
||||
GdkScreen *
|
||||
gdk_display_get_default_screen (GdkDisplay *display)
|
||||
static GdkScreen *
|
||||
gdk_broadway_display_get_default_screen (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
|
||||
return GDK_DISPLAY_BROADWAY (display)->default_screen;
|
||||
return GDK_BROADWAY_DISPLAY (display)->default_screen;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_device_ungrab (GdkDevice *device,
|
||||
guint32 time_)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
gdk_display_beep (GdkDisplay *display)
|
||||
static void
|
||||
gdk_broadway_display_beep (GdkDisplay *display)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DISPLAY (display));
|
||||
}
|
||||
|
||||
void
|
||||
gdk_display_sync (GdkDisplay *display)
|
||||
static void
|
||||
gdk_broadway_display_sync (GdkDisplay *display)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DISPLAY (display));
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
gdk_display_flush (GdkDisplay *display)
|
||||
static void
|
||||
gdk_broadway_display_flush (GdkDisplay *display)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DISPLAY (display));
|
||||
|
||||
}
|
||||
|
||||
GdkWindow *
|
||||
gdk_display_get_default_group (GdkDisplay *display)
|
||||
static gboolean
|
||||
gdk_broadway_display_has_pending (GdkDisplay *display)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
gdk_broadway_display_get_default_group (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
|
||||
@ -613,156 +600,208 @@ gdk_display_get_default_group (GdkDisplay *display)
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_display_broadway_dispose (GObject *object)
|
||||
gdk_broadway_display_dispose (GObject *object)
|
||||
{
|
||||
GdkDisplayBroadway *display_broadway = GDK_DISPLAY_BROADWAY (object);
|
||||
GdkBroadwayDisplay *broadway_display = GDK_BROADWAY_DISPLAY (object);
|
||||
|
||||
g_list_foreach (display_broadway->input_devices, (GFunc) g_object_run_dispose, NULL);
|
||||
_gdk_broadway_display_manager_remove_display (gdk_display_manager_get (),
|
||||
GDK_DISPLAY_OBJECT (object));
|
||||
|
||||
_gdk_screen_close (display_broadway->screens[0]);
|
||||
g_list_foreach (broadway_display->input_devices, (GFunc) g_object_run_dispose, NULL);
|
||||
|
||||
if (display_broadway->event_source)
|
||||
_gdk_screen_close (broadway_display->screens[0]);
|
||||
|
||||
if (broadway_display->event_source)
|
||||
{
|
||||
g_source_destroy (display_broadway->event_source);
|
||||
g_source_unref (display_broadway->event_source);
|
||||
display_broadway->event_source = NULL;
|
||||
g_source_destroy (broadway_display->event_source);
|
||||
g_source_unref (broadway_display->event_source);
|
||||
broadway_display->event_source = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (_gdk_display_broadway_parent_class)->dispose (object);
|
||||
G_OBJECT_CLASS (gdk_broadway_display_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_display_broadway_finalize (GObject *object)
|
||||
gdk_broadway_display_finalize (GObject *object)
|
||||
{
|
||||
GdkDisplayBroadway *display_broadway = GDK_DISPLAY_BROADWAY (object);
|
||||
GdkBroadwayDisplay *broadway_display = GDK_BROADWAY_DISPLAY (object);
|
||||
|
||||
/* Keymap */
|
||||
if (display_broadway->keymap)
|
||||
g_object_unref (display_broadway->keymap);
|
||||
if (broadway_display->keymap)
|
||||
g_object_unref (broadway_display->keymap);
|
||||
|
||||
_gdk_broadway_cursor_display_finalize (GDK_DISPLAY_OBJECT(display_broadway));
|
||||
_gdk_broadway_cursor_display_finalize (GDK_DISPLAY_OBJECT(broadway_display));
|
||||
|
||||
/* Atom Hashtable */
|
||||
g_hash_table_destroy (display_broadway->atom_from_virtual);
|
||||
g_hash_table_destroy (display_broadway->atom_to_virtual);
|
||||
g_hash_table_destroy (broadway_display->atom_from_virtual);
|
||||
g_hash_table_destroy (broadway_display->atom_to_virtual);
|
||||
|
||||
/* input GdkDevice list */
|
||||
g_list_foreach (display_broadway->input_devices, (GFunc) g_object_unref, NULL);
|
||||
g_list_free (display_broadway->input_devices);
|
||||
g_list_foreach (broadway_display->input_devices, (GFunc) g_object_unref, NULL);
|
||||
g_list_free (broadway_display->input_devices);
|
||||
/* Free all GdkScreens */
|
||||
g_object_unref (display_broadway->screens[0]);
|
||||
g_free (display_broadway->screens);
|
||||
g_object_unref (broadway_display->screens[0]);
|
||||
g_free (broadway_display->screens);
|
||||
|
||||
G_OBJECT_CLASS (_gdk_display_broadway_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (gdk_broadway_display_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_windowing_set_default_display (GdkDisplay *display)
|
||||
_gdk_broadway_display_make_default (GdkDisplay *display)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
gdk_notify_startup_complete (void)
|
||||
static void
|
||||
gdk_broadway_display_notify_startup_complete (GdkDisplay *display,
|
||||
const gchar *startup_id)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
gdk_notify_startup_complete_with_id (const gchar* startup_id)
|
||||
{
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_display_supports_selection_notification (GdkDisplay *display)
|
||||
static gboolean
|
||||
gdk_broadway_display_supports_selection_notification (GdkDisplay *display)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_display_request_selection_notification (GdkDisplay *display,
|
||||
GdkAtom selection)
|
||||
static gboolean
|
||||
gdk_broadway_display_request_selection_notification (GdkDisplay *display,
|
||||
GdkAtom selection)
|
||||
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_display_supports_clipboard_persistence (GdkDisplay *display)
|
||||
static gboolean
|
||||
gdk_broadway_display_supports_clipboard_persistence (GdkDisplay *display)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_display_store_clipboard (GdkDisplay *display,
|
||||
GdkWindow *clipboard_window,
|
||||
guint32 time_,
|
||||
const GdkAtom *targets,
|
||||
gint n_targets)
|
||||
static void
|
||||
gdk_broadway_display_store_clipboard (GdkDisplay *display,
|
||||
GdkWindow *clipboard_window,
|
||||
guint32 time_,
|
||||
const GdkAtom *targets,
|
||||
gint n_targets)
|
||||
{
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_display_supports_shapes (GdkDisplay *display)
|
||||
static gboolean
|
||||
gdk_broadway_display_supports_shapes (GdkDisplay *display)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_display_supports_input_shapes (GdkDisplay *display)
|
||||
static gboolean
|
||||
gdk_broadway_display_supports_input_shapes (GdkDisplay *display)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_display_supports_composite (GdkDisplay *display)
|
||||
static gboolean
|
||||
gdk_broadway_display_supports_composite (GdkDisplay *display)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
GList *
|
||||
gdk_display_list_devices (GdkDisplay *display)
|
||||
static GList *
|
||||
gdk_broadway_display_list_devices (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
|
||||
return GDK_DISPLAY_BROADWAY (display)->input_devices;
|
||||
return GDK_BROADWAY_DISPLAY (display)->input_devices;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_event_send_client_message_for_display (GdkDisplay *display,
|
||||
GdkEvent *event,
|
||||
GdkNativeWindow winid)
|
||||
static gboolean
|
||||
gdk_broadway_display_send_client_message (GdkDisplay *display,
|
||||
GdkEvent *event,
|
||||
GdkNativeWindow winid)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_display_add_client_message_filter (GdkDisplay *display,
|
||||
GdkAtom message_type,
|
||||
GdkFilterFunc func,
|
||||
gpointer data)
|
||||
static void
|
||||
gdk_broadway_display_add_client_message_filter (GdkDisplay *display,
|
||||
GdkAtom message_type,
|
||||
GdkFilterFunc func,
|
||||
gpointer data)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
gdk_add_client_message_filter (GdkAtom message_type,
|
||||
GdkFilterFunc func,
|
||||
gpointer data)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
gdk_flush (void)
|
||||
{
|
||||
GSList *tmp_list = _gdk_displays;
|
||||
|
||||
while (tmp_list)
|
||||
{
|
||||
gdk_display_flush (GDK_DISPLAY_OBJECT (tmp_list->data));
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
}
|
||||
|
||||
gulong
|
||||
_gdk_windowing_window_get_next_serial (GdkDisplay *display)
|
||||
static gulong
|
||||
gdk_broadway_display_get_next_serial (GdkDisplay *display)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gdk_broadway_display_event_data_copy (GdkDisplay *display,
|
||||
const GdkEvent *src,
|
||||
GdkEvent *dst)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_display_event_data_free (GdkDisplay *display,
|
||||
GdkEvent *event)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_display_class_init (GdkBroadwayDisplayClass * class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
GdkDisplayClass *display_class = GDK_DISPLAY_CLASS (class);
|
||||
|
||||
object_class->dispose = gdk_broadway_display_dispose;
|
||||
object_class->finalize = gdk_broadway_display_finalize;
|
||||
|
||||
display_class->window_type = GDK_TYPE_BROADWAY_WINDOW;
|
||||
|
||||
display_class->get_name = gdk_broadway_display_get_name;
|
||||
display_class->get_n_screens = gdk_broadway_display_get_n_screens;
|
||||
display_class->get_screen = gdk_broadway_display_get_screen;
|
||||
display_class->get_default_screen = gdk_broadway_display_get_default_screen;
|
||||
display_class->beep = gdk_broadway_display_beep;
|
||||
display_class->sync = gdk_broadway_display_sync;
|
||||
display_class->flush = gdk_broadway_display_flush;
|
||||
display_class->has_pending = gdk_broadway_display_has_pending;
|
||||
display_class->queue_events = _gdk_broadway_display_queue_events;
|
||||
display_class->get_default_group = gdk_broadway_display_get_default_group;
|
||||
display_class->supports_selection_notification = gdk_broadway_display_supports_selection_notification;
|
||||
display_class->request_selection_notification = gdk_broadway_display_request_selection_notification;
|
||||
display_class->supports_clipboard_persistence = gdk_broadway_display_supports_clipboard_persistence;
|
||||
display_class->store_clipboard = gdk_broadway_display_store_clipboard;
|
||||
display_class->supports_shapes = gdk_broadway_display_supports_shapes;
|
||||
display_class->supports_input_shapes = gdk_broadway_display_supports_input_shapes;
|
||||
display_class->supports_composite = gdk_broadway_display_supports_composite;
|
||||
display_class->list_devices = gdk_broadway_display_list_devices;
|
||||
display_class->send_client_message = gdk_broadway_display_send_client_message;
|
||||
display_class->add_client_message_filter = gdk_broadway_display_add_client_message_filter;
|
||||
display_class->get_drag_protocol = _gdk_broadway_display_get_drag_protocol;
|
||||
display_class->get_cursor_for_type = _gdk_broadway_display_get_cursor_for_type;
|
||||
display_class->get_cursor_for_name = _gdk_broadway_display_get_cursor_for_name;
|
||||
display_class->get_cursor_for_pixbuf = _gdk_broadway_display_get_cursor_for_pixbuf;
|
||||
display_class->get_default_cursor_size = _gdk_broadway_display_get_default_cursor_size;
|
||||
display_class->get_maximal_cursor_size = _gdk_broadway_display_get_maximal_cursor_size;
|
||||
display_class->supports_cursor_alpha = _gdk_broadway_display_supports_cursor_alpha;
|
||||
display_class->supports_cursor_color = _gdk_broadway_display_supports_cursor_color;
|
||||
|
||||
display_class->before_process_all_updates = _gdk_broadway_display_before_process_all_updates;
|
||||
display_class->after_process_all_updates = _gdk_broadway_display_after_process_all_updates;
|
||||
display_class->get_next_serial = gdk_broadway_display_get_next_serial;
|
||||
display_class->notify_startup_complete = gdk_broadway_display_notify_startup_complete;
|
||||
display_class->event_data_copy = gdk_broadway_display_event_data_copy;
|
||||
display_class->event_data_free = gdk_broadway_display_event_data_free;
|
||||
display_class->create_window_impl = _gdk_broadway_display_create_window_impl;
|
||||
display_class->get_keymap = _gdk_broadway_display_get_keymap;
|
||||
display_class->get_selection_owner = _gdk_broadway_display_get_selection_owner;
|
||||
display_class->set_selection_owner = _gdk_broadway_display_set_selection_owner;
|
||||
display_class->send_selection_notify = _gdk_broadway_display_send_selection_notify;
|
||||
display_class->get_selection_property = _gdk_broadway_display_get_selection_property;
|
||||
display_class->convert_selection = _gdk_broadway_display_convert_selection;
|
||||
display_class->text_property_to_utf8_list = _gdk_broadway_display_text_property_to_utf8_list;
|
||||
display_class->utf8_to_string_target = _gdk_broadway_display_utf8_to_string_target;
|
||||
}
|
||||
|
||||
|
@ -21,31 +21,31 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_DISPLAY_BROADWAY__
|
||||
#define __GDK_DISPLAY_BROADWAY__
|
||||
#ifndef __GDK_BROADWAY_DISPLAY__
|
||||
#define __GDK_BROADWAY_DISPLAY__
|
||||
|
||||
#include <gdk/gdkdisplay.h>
|
||||
#include <gdk/gdkkeys.h>
|
||||
#include <gdk/gdkwindow.h>
|
||||
#include <gdk/gdkinternals.h>
|
||||
#include <gdk/gdkmain.h>
|
||||
#include "gdkdisplayprivate.h"
|
||||
#include "gdkkeys.h"
|
||||
#include "gdkwindow.h"
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkmain.h"
|
||||
#include "broadway.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _GdkDisplayBroadway GdkDisplayBroadway;
|
||||
typedef struct _GdkDisplayBroadwayClass GdkDisplayBroadwayClass;
|
||||
|
||||
#define GDK_TYPE_DISPLAY_BROADWAY (_gdk_display_broadway_get_type())
|
||||
#define GDK_DISPLAY_BROADWAY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DISPLAY_BROADWAY, GdkDisplayBroadway))
|
||||
#define GDK_DISPLAY_BROADWAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DISPLAY_BROADWAY, GdkDisplayBroadwayClass))
|
||||
#define GDK_IS_DISPLAY_BROADWAY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DISPLAY_BROADWAY))
|
||||
#define GDK_IS_DISPLAY_BROADWAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DISPLAY_BROADWAY))
|
||||
#define GDK_DISPLAY_BROADWAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DISPLAY_BROADWAY, GdkDisplayBroadwayClass))
|
||||
typedef struct _GdkBroadwayDisplay GdkBroadwayDisplay;
|
||||
typedef struct _GdkBroadwayDisplayClass GdkBroadwayDisplayClass;
|
||||
|
||||
typedef struct HttpRequest HttpRequest;
|
||||
|
||||
struct _GdkDisplayBroadway
|
||||
#define GDK_TYPE_BROADWAY_DISPLAY (gdk_broadway_display_get_type())
|
||||
#define GDK_BROADWAY_DISPLAY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_BROADWAY_DISPLAY, GdkBroadwayDisplay))
|
||||
#define GDK_BROADWAY_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_BROADWAY_DISPLAY, GdkBroadwayDisplayClass))
|
||||
#define GDK_IS_BROADWAY_DISPLAY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_BROADWAY_DISPLAY))
|
||||
#define GDK_IS_BROADWAY_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_BROADWAY_DISPLAY))
|
||||
#define GDK_BROADWAY_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_BROADWAY_DISPLAY, GdkBroadwayDisplayClass))
|
||||
|
||||
struct _GdkBroadwayDisplay
|
||||
{
|
||||
GdkDisplay parent_instance;
|
||||
GdkScreen *default_screen;
|
||||
@ -86,13 +86,13 @@ struct _GdkDisplayBroadway
|
||||
HttpRequest *input;
|
||||
};
|
||||
|
||||
struct _GdkDisplayBroadwayClass
|
||||
struct _GdkBroadwayDisplayClass
|
||||
{
|
||||
GdkDisplayClass parent_class;
|
||||
};
|
||||
|
||||
GType _gdk_display_broadway_get_type (void);
|
||||
GType gdk_broadway_display_get_type (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_DISPLAY_BROADWAY__ */
|
||||
#endif /* __GDK_BROADWAY_DISPLAY__ */
|
||||
|
161
gdk/broadway/gdkdisplaymanager-broadway.c
Normal file
161
gdk/broadway/gdkdisplaymanager-broadway.c
Normal file
@ -0,0 +1,161 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* gdkdisplaymanager-broadway.c
|
||||
*
|
||||
* Copyright (C) 2005 Imendio AB
|
||||
* Copyright 2010 Red Hat, Inc.
|
||||
*
|
||||
* Author: Matthias clasen
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkdisplay-broadway.h"
|
||||
#include "gdkbroadwaydisplaymanager.h"
|
||||
#include "gdkprivate-broadway.h"
|
||||
|
||||
#include "gdkdisplaymanagerprivate.h"
|
||||
#include "gdkinternals.h"
|
||||
|
||||
struct _GdkBroadwayDisplayManager
|
||||
{
|
||||
GdkDisplayManager parent;
|
||||
|
||||
GdkDisplay *default_display;
|
||||
GSList *displays;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GdkBroadwayDisplayManager, gdk_broadway_display_manager, GDK_TYPE_DISPLAY_MANAGER)
|
||||
|
||||
static GdkDisplay *
|
||||
gdk_broadway_display_manager_open_display (GdkDisplayManager *manager,
|
||||
const gchar *name)
|
||||
{
|
||||
return _gdk_broadway_display_open (name);
|
||||
}
|
||||
|
||||
static GSList *
|
||||
gdk_broadway_display_manager_list_displays (GdkDisplayManager *manager)
|
||||
{
|
||||
GdkBroadwayDisplayManager *manager_broadway = GDK_BROADWAY_DISPLAY_MANAGER (manager);
|
||||
|
||||
return g_slist_copy (manager_broadway->displays);
|
||||
}
|
||||
|
||||
static GdkDisplay *
|
||||
gdk_broadway_display_manager_get_default_display (GdkDisplayManager *manager)
|
||||
{
|
||||
return GDK_BROADWAY_DISPLAY_MANAGER (manager)->default_display;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_display_manager_set_default_display (GdkDisplayManager *manager,
|
||||
GdkDisplay *display)
|
||||
{
|
||||
GdkBroadwayDisplayManager *manager_broadway = GDK_BROADWAY_DISPLAY_MANAGER (manager);
|
||||
|
||||
manager_broadway->default_display = display;
|
||||
}
|
||||
|
||||
#include "../gdkkeynames.c"
|
||||
|
||||
static gchar *
|
||||
gdk_broadway_display_manager_get_keyval_name (GdkDisplayManager *manager,
|
||||
guint keyval)
|
||||
{
|
||||
return _gdk_keyval_name (keyval);
|
||||
}
|
||||
|
||||
static guint
|
||||
gdk_broadway_display_manager_lookup_keyval (GdkDisplayManager *manager,
|
||||
const gchar *name)
|
||||
{
|
||||
return _gdk_keyval_from_name (name);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_display_manager_keyval_convert_case (GdkDisplayManager *manager,
|
||||
guint symbol,
|
||||
guint *lower,
|
||||
guint *upper)
|
||||
{
|
||||
/* FIXME implement this */
|
||||
if (lower)
|
||||
*lower = symbol;
|
||||
if (upper)
|
||||
*upper = symbol;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_display_manager_init (GdkBroadwayDisplayManager *manager)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_display_manager_finalize (GObject *object)
|
||||
{
|
||||
g_error ("A GdkBroadwayDisplayManager object was finalized. This should not happen");
|
||||
G_OBJECT_CLASS (gdk_broadway_display_manager_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_display_manager_class_init (GdkBroadwayDisplayManagerClass *class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
GdkDisplayManagerClass *manager_class = GDK_DISPLAY_MANAGER_CLASS (class);
|
||||
|
||||
object_class->finalize = gdk_broadway_display_manager_finalize;
|
||||
|
||||
manager_class->open_display = gdk_broadway_display_manager_open_display;
|
||||
manager_class->list_displays = gdk_broadway_display_manager_list_displays;
|
||||
manager_class->set_default_display = gdk_broadway_display_manager_set_default_display;
|
||||
manager_class->get_default_display = gdk_broadway_display_manager_get_default_display;
|
||||
manager_class->atom_intern = _gdk_broadway_display_manager_atom_intern;
|
||||
manager_class->get_atom_name = _gdk_broadway_display_manager_get_atom_name;
|
||||
manager_class->lookup_keyval = gdk_broadway_display_manager_lookup_keyval;
|
||||
manager_class->get_keyval_name = gdk_broadway_display_manager_get_keyval_name;
|
||||
manager_class->keyval_convert_case = gdk_broadway_display_manager_keyval_convert_case;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_display_manager_add_display (GdkDisplayManager *manager,
|
||||
GdkDisplay *display)
|
||||
{
|
||||
GdkBroadwayDisplayManager *manager_broadway = GDK_BROADWAY_DISPLAY_MANAGER (manager);
|
||||
|
||||
if (manager_broadway->displays == NULL)
|
||||
gdk_display_manager_set_default_display (manager, display);
|
||||
|
||||
manager_broadway->displays = g_slist_prepend (manager_broadway->displays, display);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_display_manager_remove_display (GdkDisplayManager *manager,
|
||||
GdkDisplay *display)
|
||||
{
|
||||
GdkBroadwayDisplayManager *manager_broadway = GDK_BROADWAY_DISPLAY_MANAGER (manager);
|
||||
|
||||
manager_broadway->displays = g_slist_remove (manager_broadway->displays, display);
|
||||
|
||||
if (manager_broadway->default_display == display)
|
||||
{
|
||||
if (manager_broadway->displays)
|
||||
gdk_display_manager_set_default_display (manager, manager_broadway->displays->data);
|
||||
else
|
||||
gdk_display_manager_set_default_display (manager, NULL);
|
||||
}
|
||||
}
|
@ -26,9 +26,9 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkdnd.h"
|
||||
#include "gdkdndprivate.h"
|
||||
|
||||
#include "gdkmain.h"
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkproperty.h"
|
||||
#include "gdkprivate-broadway.h"
|
||||
#include "gdkinternals.h"
|
||||
@ -37,124 +37,101 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
typedef struct _GdkDragContextPrivateBroadway GdkDragContextPrivateBroadway;
|
||||
#define GDK_TYPE_BROADWAY_DRAG_CONTEXT (gdk_broadway_drag_context_get_type ())
|
||||
#define GDK_BROADWAY_DRAG_CONTEXT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_BROADWAY_DRAG_CONTEXT, GdkBroadwayDragContext))
|
||||
#define GDK_BROADWAY_DRAG_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_BROADWAY_DRAG_CONTEXT, GdkBroadwayDragContextClass))
|
||||
#define GDK_IS_BROADWAY_DRAG_CONTEXT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_BROADWAY_DRAG_CONTEXT))
|
||||
#define GDK_IS_BROADWAY_DRAG_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_BROADWAY_DRAG_CONTEXT))
|
||||
#define GDK_BROADWAY_DRAG_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_BROADWAY_DRAG_CONTEXT, GdkBroadwayDragContextClass))
|
||||
|
||||
/* Structure that holds information about a drag in progress.
|
||||
* this is used on both source and destination sides.
|
||||
*/
|
||||
struct _GdkDragContextPrivateBroadway {
|
||||
#ifdef GDK_COMPILATION
|
||||
typedef struct _GdkBroadwayDragContext GdkBroadwayDragContext;
|
||||
#else
|
||||
typedef GdkDragContext GdkBroadwayDragContext;
|
||||
#endif
|
||||
typedef struct _GdkBroadwayDragContextClass GdkBroadwayDragContextClass;
|
||||
|
||||
GType gdk_broadway_drag_context_get_type (void);
|
||||
|
||||
struct _GdkBroadwayDragContext {
|
||||
GdkDragContext context;
|
||||
};
|
||||
|
||||
#define PRIVATE_DATA(context) ((GdkDragContextPrivateBroadway *) GDK_DRAG_CONTEXT (context)->windowing_data)
|
||||
struct _GdkBroadwayDragContextClass
|
||||
{
|
||||
GdkDragContextClass parent_class;
|
||||
};
|
||||
|
||||
static void gdk_drag_context_finalize (GObject *object);
|
||||
static void gdk_broadway_drag_context_finalize (GObject *object);
|
||||
|
||||
static GList *contexts;
|
||||
|
||||
G_DEFINE_TYPE (GdkDragContext, gdk_drag_context, G_TYPE_OBJECT)
|
||||
G_DEFINE_TYPE (GdkBroadwayDragContext, gdk_broadway_drag_context, GDK_TYPE_DRAG_CONTEXT)
|
||||
|
||||
static void
|
||||
gdk_drag_context_init (GdkDragContext *dragcontext)
|
||||
gdk_broadway_drag_context_init (GdkBroadwayDragContext *dragcontext)
|
||||
{
|
||||
GdkDragContextPrivateBroadway *private;
|
||||
|
||||
private = G_TYPE_INSTANCE_GET_PRIVATE (dragcontext,
|
||||
GDK_TYPE_DRAG_CONTEXT,
|
||||
GdkDragContextPrivateBroadway);
|
||||
|
||||
dragcontext->windowing_data = private;
|
||||
|
||||
contexts = g_list_prepend (contexts, dragcontext);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_drag_context_class_init (GdkDragContextClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = gdk_drag_context_finalize;
|
||||
|
||||
g_type_class_add_private (object_class, sizeof (GdkDragContextPrivateBroadway));
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_drag_context_finalize (GObject *object)
|
||||
gdk_broadway_drag_context_finalize (GObject *object)
|
||||
{
|
||||
GdkDragContext *context = GDK_DRAG_CONTEXT (object);
|
||||
|
||||
contexts = g_list_remove (contexts, context);
|
||||
|
||||
G_OBJECT_CLASS (gdk_drag_context_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (gdk_broadway_drag_context_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
/* Drag Contexts */
|
||||
|
||||
GdkDragContext *
|
||||
gdk_drag_context_new (void)
|
||||
{
|
||||
return g_object_new (GDK_TYPE_DRAG_CONTEXT, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_drag_context_set_device (GdkDragContext *context,
|
||||
GdkDevice *device)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
|
||||
g_return_if_fail (GDK_IS_DEVICE (device));
|
||||
}
|
||||
|
||||
GdkDevice *
|
||||
gdk_drag_context_get_device (GdkDragContext *context)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GdkDragContext *
|
||||
gdk_drag_begin (GdkWindow *window,
|
||||
GList *targets)
|
||||
_gdk_broadway_window_drag_begin (GdkWindow *window,
|
||||
GdkDevice *device,
|
||||
GList *targets)
|
||||
{
|
||||
GdkDragContext *new_context;
|
||||
|
||||
g_return_val_if_fail (window != NULL, NULL);
|
||||
g_return_val_if_fail (GDK_WINDOW_IS_BROADWAY (window), NULL);
|
||||
|
||||
new_context = gdk_drag_context_new ();
|
||||
new_context = g_object_new (GDK_TYPE_BROADWAY_DRAG_CONTEXT,
|
||||
NULL);
|
||||
|
||||
return new_context;
|
||||
}
|
||||
|
||||
GdkNativeWindow
|
||||
gdk_drag_get_protocol_for_display (GdkDisplay *display,
|
||||
GdkNativeWindow xid,
|
||||
GdkDragProtocol *protocol)
|
||||
_gdk_broadway_display_get_drag_protocol (GdkDisplay *display,
|
||||
GdkNativeWindow xid,
|
||||
GdkDragProtocol *protocol,
|
||||
guint *version)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_drag_find_window_for_screen (GdkDragContext *context,
|
||||
GdkWindow *drag_window,
|
||||
GdkScreen *screen,
|
||||
gint x_root,
|
||||
gint y_root,
|
||||
GdkWindow **dest_window,
|
||||
GdkDragProtocol *protocol)
|
||||
static GdkWindow *
|
||||
gdk_broadway_drag_context_find_window (GdkDragContext *context,
|
||||
GdkWindow *drag_window,
|
||||
GdkScreen *screen,
|
||||
gint x_root,
|
||||
gint y_root,
|
||||
GdkDragProtocol *protocol)
|
||||
{
|
||||
g_return_if_fail (context != NULL);
|
||||
g_return_val_if_fail (context != NULL, NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_drag_motion (GdkDragContext *context,
|
||||
GdkWindow *dest_window,
|
||||
GdkDragProtocol protocol,
|
||||
gint x_root,
|
||||
gint y_root,
|
||||
GdkDragAction suggested_action,
|
||||
GdkDragAction possible_actions,
|
||||
guint32 time)
|
||||
static gboolean
|
||||
gdk_broadway_drag_context_drag_motion (GdkDragContext *context,
|
||||
GdkWindow *dest_window,
|
||||
GdkDragProtocol protocol,
|
||||
gint x_root,
|
||||
gint y_root,
|
||||
GdkDragAction suggested_action,
|
||||
GdkDragAction possible_actions,
|
||||
guint32 time)
|
||||
{
|
||||
g_return_val_if_fail (context != NULL, FALSE);
|
||||
g_return_val_if_fail (dest_window == NULL || GDK_WINDOW_IS_BROADWAY (dest_window), FALSE);
|
||||
@ -162,61 +139,61 @@ gdk_drag_motion (GdkDragContext *context,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_drag_drop (GdkDragContext *context,
|
||||
guint32 time)
|
||||
static void
|
||||
gdk_broadway_drag_context_drag_drop (GdkDragContext *context,
|
||||
guint32 time)
|
||||
{
|
||||
g_return_if_fail (context != NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_drag_abort (GdkDragContext *context,
|
||||
guint32 time)
|
||||
static void
|
||||
gdk_broadway_drag_context_drag_abort (GdkDragContext *context,
|
||||
guint32 time)
|
||||
{
|
||||
g_return_if_fail (context != NULL);
|
||||
}
|
||||
|
||||
/* Destination side */
|
||||
|
||||
void
|
||||
gdk_drag_status (GdkDragContext *context,
|
||||
GdkDragAction action,
|
||||
guint32 time)
|
||||
static void
|
||||
gdk_broadway_drag_context_drag_status (GdkDragContext *context,
|
||||
GdkDragAction action,
|
||||
guint32 time)
|
||||
{
|
||||
g_return_if_fail (context != NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_drag_context_drop_reply (GdkDragContext *context,
|
||||
gboolean ok,
|
||||
guint32 time)
|
||||
{
|
||||
g_return_if_fail (context != NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_drag_context_drop_finish (GdkDragContext *context,
|
||||
gboolean success,
|
||||
guint32 time)
|
||||
{
|
||||
g_return_if_fail (context != NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_drop_reply (GdkDragContext *context,
|
||||
gboolean ok,
|
||||
guint32 time)
|
||||
{
|
||||
g_return_if_fail (context != NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_drop_finish (GdkDragContext *context,
|
||||
gboolean success,
|
||||
guint32 time)
|
||||
{
|
||||
g_return_if_fail (context != NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_window_register_dnd (GdkWindow *window)
|
||||
_gdk_broadway_window_register_dnd (GdkWindow *window)
|
||||
{
|
||||
}
|
||||
|
||||
GdkAtom
|
||||
gdk_drag_get_selection (GdkDragContext *context)
|
||||
static GdkAtom
|
||||
gdk_broadway_drag_context_get_selection (GdkDragContext *context)
|
||||
{
|
||||
g_return_val_if_fail (context != NULL, GDK_NONE);
|
||||
|
||||
return GDK_NONE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_drag_drop_succeeded (GdkDragContext *context)
|
||||
static gboolean
|
||||
gdk_broadway_drag_context_drop_status (GdkDragContext *context)
|
||||
{
|
||||
g_return_val_if_fail (context != NULL, FALSE);
|
||||
|
||||
@ -224,6 +201,25 @@ gdk_drag_drop_succeeded (GdkDragContext *context)
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_dnd_init (GdkDisplay *display)
|
||||
_gdk_broadway_display_init_dnd (GdkDisplay *display)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_drag_context_class_init (GdkBroadwayDragContextClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GdkDragContextClass *context_class = GDK_DRAG_CONTEXT_CLASS (klass);
|
||||
|
||||
object_class->finalize = gdk_broadway_drag_context_finalize;
|
||||
|
||||
context_class->find_window = gdk_broadway_drag_context_find_window;
|
||||
context_class->drag_status = gdk_broadway_drag_context_drag_status;
|
||||
context_class->drag_motion = gdk_broadway_drag_context_drag_motion;
|
||||
context_class->drag_abort = gdk_broadway_drag_context_drag_abort;
|
||||
context_class->drag_drop = gdk_broadway_drag_context_drag_drop;
|
||||
context_class->drop_reply = gdk_broadway_drag_context_drop_reply;
|
||||
context_class->drop_finish = gdk_broadway_drag_context_drop_finish;
|
||||
context_class->drop_status = gdk_broadway_drag_context_drop_status;
|
||||
context_class->get_selection = gdk_broadway_drag_context_get_selection;
|
||||
}
|
||||
|
@ -89,10 +89,10 @@ gdk_event_source_check (GSource *source)
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_events_got_input (GdkDisplay *display,
|
||||
const char *message)
|
||||
_gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
const char *message)
|
||||
{
|
||||
GdkDisplayBroadway *display_broadway = GDK_DISPLAY_BROADWAY (display);
|
||||
GdkBroadwayDisplay *display_broadway = GDK_BROADWAY_DISPLAY (display);
|
||||
GdkScreen *screen;
|
||||
GdkWindow *root, *window;
|
||||
char *p;
|
||||
@ -288,7 +288,7 @@ _gdk_events_got_input (GdkDisplay *display,
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_events_queue (GdkDisplay *display)
|
||||
_gdk_broadway_display_queue_events (GdkDisplay *display)
|
||||
{
|
||||
}
|
||||
|
||||
@ -325,7 +325,7 @@ gdk_event_source_finalize (GSource *source)
|
||||
}
|
||||
|
||||
GSource *
|
||||
gdk_event_source_new (GdkDisplay *display)
|
||||
_gdk_broadway_event_source_new (GdkDisplay *display)
|
||||
{
|
||||
GSource *source;
|
||||
GdkEventSource *event_source;
|
||||
@ -347,20 +347,3 @@ gdk_event_source_new (GdkDisplay *display)
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_events_pending (void)
|
||||
{
|
||||
GList *tmp_list;
|
||||
|
||||
for (tmp_list = event_sources; tmp_list; tmp_list = tmp_list->next)
|
||||
{
|
||||
GdkEventSource *tmp_source = tmp_list->data;
|
||||
GdkDisplay *display = tmp_source->display;
|
||||
|
||||
if (_gdk_event_queue_find_first (display))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ G_BEGIN_DECLS
|
||||
typedef struct _GdkEventSource GdkEventSource;
|
||||
|
||||
G_GNUC_INTERNAL
|
||||
GSource * gdk_event_source_new (GdkDisplay *display);
|
||||
GSource * _gdk_broadway_event_source_new (GdkDisplay *display);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "gdkprivate-broadway.h"
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkdisplay-broadway.h"
|
||||
#include "gdkkeysprivate.h"
|
||||
#include "gdkkeysyms.h"
|
||||
|
||||
#include <stdio.h>
|
||||
@ -38,199 +39,152 @@
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
|
||||
typedef struct _GdkKeymapBroadway GdkKeymapBroadway;
|
||||
typedef struct _GdkKeymapClass GdkKeymapBroadwayClass;
|
||||
typedef struct _GdkBroadwayKeymap GdkBroadwayKeymap;
|
||||
typedef struct _GdkKeymapClass GdkBroadwayKeymapClass;
|
||||
|
||||
#define GDK_TYPE_KEYMAP_BROADWAY (gdk_keymap_broadway_get_type ())
|
||||
#define GDK_KEYMAP_BROADWAY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_KEYMAP_BROADWAY, GdkKeymapBroadway))
|
||||
#define GDK_IS_KEYMAP_BROADWAY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_KEYMAP_BROADWAY))
|
||||
#define GDK_TYPE_BROADWAY_KEYMAP (gdk_broadway_keymap_get_type ())
|
||||
#define GDK_BROADWAY_KEYMAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_BROADWAY_KEYMAP, GdkBroadwayKeymap))
|
||||
#define GDK_IS_BROADWAY_KEYMAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_BROADWAY_KEYMAP))
|
||||
|
||||
typedef struct _DirectionCacheEntry DirectionCacheEntry;
|
||||
|
||||
struct _GdkKeymapBroadway
|
||||
struct _GdkBroadwayKeymap
|
||||
{
|
||||
GdkKeymap parent_instance;
|
||||
|
||||
};
|
||||
|
||||
#define KEYMAP_USE_XKB(keymap) GDK_DISPLAY_BROADWAY ((keymap)->display)->use_xkb
|
||||
#define KEYMAP_XDISPLAY(keymap) GDK_DISPLAY_XDISPLAY ((keymap)->display)
|
||||
|
||||
static GType gdk_keymap_broadway_get_type (void);
|
||||
static void gdk_keymap_broadway_class_init (GdkKeymapBroadwayClass *klass);
|
||||
static void gdk_keymap_broadway_init (GdkKeymapBroadway *keymap);
|
||||
static void gdk_keymap_broadway_finalize (GObject *object);
|
||||
|
||||
static GdkKeymapClass *parent_class = NULL;
|
||||
|
||||
static GType
|
||||
gdk_keymap_broadway_get_type (void)
|
||||
struct _GdkBroadwayKeymapClass
|
||||
{
|
||||
static GType object_type = 0;
|
||||
GdkKeymapClass keymap_class;
|
||||
};
|
||||
|
||||
if (!object_type)
|
||||
{
|
||||
const GTypeInfo object_info =
|
||||
{
|
||||
sizeof (GdkKeymapClass),
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) gdk_keymap_broadway_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GdkKeymapBroadway),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gdk_keymap_broadway_init,
|
||||
};
|
||||
|
||||
object_type = g_type_register_static (GDK_TYPE_KEYMAP,
|
||||
g_intern_static_string ("GdkKeymapBroadway"),
|
||||
&object_info, 0);
|
||||
}
|
||||
|
||||
return object_type;
|
||||
}
|
||||
G_DEFINE_TYPE (GdkBroadwayKeymap, gdk_broadway_keymap, GDK_TYPE_KEYMAP)
|
||||
|
||||
static void gdk_broadway_keymap_finalize (GObject *object);
|
||||
|
||||
static void
|
||||
gdk_keymap_broadway_class_init (GdkKeymapBroadwayClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
object_class->finalize = gdk_keymap_broadway_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_keymap_broadway_init (GdkKeymapBroadway *keymap)
|
||||
gdk_broadway_keymap_init (GdkBroadwayKeymap *keymap)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_keymap_broadway_finalize (GObject *object)
|
||||
gdk_broadway_keymap_finalize (GObject *object)
|
||||
{
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (gdk_broadway_keymap_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
GdkKeymap*
|
||||
gdk_keymap_get_for_display (GdkDisplay *display)
|
||||
_gdk_broadway_display_get_keymap (GdkDisplay *display)
|
||||
{
|
||||
GdkDisplayBroadway *display_broadway;
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
display_broadway = GDK_DISPLAY_BROADWAY (display);
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (display);
|
||||
|
||||
if (!display_broadway->keymap)
|
||||
display_broadway->keymap = g_object_new (gdk_keymap_broadway_get_type (), NULL);
|
||||
if (!broadway_display->keymap)
|
||||
broadway_display->keymap = g_object_new (gdk_broadway_keymap_get_type (), NULL);
|
||||
|
||||
display_broadway->keymap->display = display;
|
||||
broadway_display->keymap->display = display;
|
||||
|
||||
return display_broadway->keymap;
|
||||
return broadway_display->keymap;
|
||||
}
|
||||
|
||||
PangoDirection
|
||||
gdk_keymap_get_direction (GdkKeymap *keymap)
|
||||
static PangoDirection
|
||||
gdk_broadway_keymap_get_direction (GdkKeymap *keymap)
|
||||
{
|
||||
return PANGO_DIRECTION_NEUTRAL;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_keymap_have_bidi_layouts (GdkKeymap *keymap)
|
||||
static gboolean
|
||||
gdk_broadway_keymap_have_bidi_layouts (GdkKeymap *keymap)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_keymap_get_caps_lock_state (GdkKeymap *keymap)
|
||||
static gboolean
|
||||
gdk_broadway_keymap_get_caps_lock_state (GdkKeymap *keymap)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_keymap_get_num_lock_state (GdkKeymap *keymap)
|
||||
static gboolean
|
||||
gdk_broadway_keymap_get_num_lock_state (GdkKeymap *keymap)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_keymap_get_entries_for_keyval (GdkKeymap *keymap,
|
||||
guint keyval,
|
||||
GdkKeymapKey **keys,
|
||||
gint *n_keys)
|
||||
static gboolean
|
||||
gdk_broadway_keymap_get_entries_for_keyval (GdkKeymap *keymap,
|
||||
guint keyval,
|
||||
GdkKeymapKey **keys,
|
||||
gint *n_keys)
|
||||
{
|
||||
*n_keys = 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_keymap_get_entries_for_keycode (GdkKeymap *keymap,
|
||||
guint hardware_keycode,
|
||||
GdkKeymapKey **keys,
|
||||
guint **keyvals,
|
||||
gint *n_entries)
|
||||
static gboolean
|
||||
gdk_broadway_keymap_get_entries_for_keycode (GdkKeymap *keymap,
|
||||
guint hardware_keycode,
|
||||
GdkKeymapKey **keys,
|
||||
guint **keyvals,
|
||||
gint *n_entries)
|
||||
{
|
||||
*n_entries = 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
guint
|
||||
gdk_keymap_lookup_key (GdkKeymap *keymap,
|
||||
const GdkKeymapKey *key)
|
||||
static guint
|
||||
gdk_broadway_keymap_lookup_key (GdkKeymap *keymap,
|
||||
const GdkKeymapKey *key)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
gboolean
|
||||
gdk_keymap_translate_keyboard_state (GdkKeymap *keymap,
|
||||
guint hardware_keycode,
|
||||
GdkModifierType state,
|
||||
gint group,
|
||||
guint *keyval,
|
||||
gint *effective_group,
|
||||
gint *level,
|
||||
GdkModifierType *consumed_modifiers)
|
||||
static gboolean
|
||||
gdk_broadway_keymap_translate_keyboard_state (GdkKeymap *keymap,
|
||||
guint hardware_keycode,
|
||||
GdkModifierType state,
|
||||
gint group,
|
||||
guint *keyval,
|
||||
gint *effective_group,
|
||||
gint *level,
|
||||
GdkModifierType *consumed_modifiers)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/* Key handling not part of the keymap */
|
||||
gchar*
|
||||
gdk_keyval_name (guint keyval)
|
||||
{
|
||||
switch (keyval)
|
||||
{
|
||||
case GDK_KEY_Page_Up:
|
||||
return "Page_Up";
|
||||
case GDK_KEY_Page_Down:
|
||||
return "Page_Down";
|
||||
case GDK_KEY_KP_Page_Up:
|
||||
return "KP_Page_Up";
|
||||
case GDK_KEY_KP_Page_Down:
|
||||
return "KP_Page_Down";
|
||||
}
|
||||
|
||||
return "TODO";
|
||||
}
|
||||
|
||||
guint
|
||||
gdk_keyval_from_name (const gchar *keyval_name)
|
||||
{
|
||||
g_return_val_if_fail (keyval_name != NULL, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_keymap_add_virtual_modifiers (GdkKeymap *keymap,
|
||||
GdkModifierType *state)
|
||||
static void
|
||||
gdk_broadway_keymap_add_virtual_modifiers (GdkKeymap *keymap,
|
||||
GdkModifierType *state)
|
||||
{
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_keymap_map_virtual_modifiers (GdkKeymap *keymap,
|
||||
GdkModifierType *state)
|
||||
static gboolean
|
||||
gdk_broadway_keymap_map_virtual_modifiers (GdkKeymap *keymap,
|
||||
GdkModifierType *state)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_keymap_class_init (GdkBroadwayKeymapClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GdkKeymapClass *keymap_class = GDK_KEYMAP_CLASS (klass);
|
||||
|
||||
object_class->finalize = gdk_broadway_keymap_finalize;
|
||||
|
||||
keymap_class->get_direction = gdk_broadway_keymap_get_direction;
|
||||
keymap_class->have_bidi_layouts = gdk_broadway_keymap_have_bidi_layouts;
|
||||
keymap_class->get_caps_lock_state = gdk_broadway_keymap_get_caps_lock_state;
|
||||
keymap_class->get_num_lock_state = gdk_broadway_keymap_get_num_lock_state;
|
||||
keymap_class->get_entries_for_keyval = gdk_broadway_keymap_get_entries_for_keyval;
|
||||
keymap_class->get_entries_for_keycode = gdk_broadway_keymap_get_entries_for_keycode;
|
||||
keymap_class->lookup_key = gdk_broadway_keymap_lookup_key;
|
||||
keymap_class->translate_keyboard_state = gdk_broadway_keymap_translate_keyboard_state;
|
||||
keymap_class->add_virtual_modifiers = gdk_broadway_keymap_add_virtual_modifiers;
|
||||
keymap_class->map_virtual_modifiers = gdk_broadway_keymap_map_virtual_modifiers;
|
||||
}
|
||||
|
||||
|
@ -87,36 +87,3 @@ void
|
||||
_gdk_windowing_exit (void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
gdk_error_trap_push (void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
gdk_error_trap_pop_ignored (void)
|
||||
{
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_error_trap_pop (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_get_display (void)
|
||||
{
|
||||
return g_strdup (gdk_display_get_name (gdk_display_get_default ()));
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_windowing_event_data_copy (const GdkEvent *src,
|
||||
GdkEvent *dst)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_windowing_event_data_free (GdkEvent *event)
|
||||
{
|
||||
}
|
||||
|
@ -37,22 +37,54 @@
|
||||
#include "gdkwindow-broadway.h"
|
||||
#include "gdkdisplay-broadway.h"
|
||||
|
||||
typedef struct _GdkCursorPrivate GdkCursorPrivate;
|
||||
#include "gdkbroadwaycursor.h"
|
||||
#include "gdkbroadwayvisual.h"
|
||||
#include "gdkbroadwaywindow.h"
|
||||
|
||||
void _gdk_broadway_resync_windows (void);
|
||||
|
||||
struct _GdkCursorPrivate
|
||||
{
|
||||
GdkCursor cursor;
|
||||
GdkDisplay *display;
|
||||
};
|
||||
gchar * _gdk_broadway_display_manager_get_atom_name (GdkDisplayManager *manager,
|
||||
GdkAtom atom);
|
||||
void _gdk_broadway_display_manager_add_display (GdkDisplayManager *manager,
|
||||
GdkDisplay *display);
|
||||
void _gdk_broadway_display_manager_remove_display (GdkDisplayManager *manager,
|
||||
GdkDisplay *display);
|
||||
GdkAtom _gdk_broadway_display_manager_atom_intern_static_string (GdkDisplayManager *manager,
|
||||
const gchar *atom_name);
|
||||
GdkAtom _gdk_broadway_display_manager_atom_intern (GdkDisplayManager *manager,
|
||||
const gchar *atom_name,
|
||||
gboolean only_if_exists);
|
||||
|
||||
|
||||
void _gdk_broadway_window_register_dnd (GdkWindow *window);
|
||||
GdkDragContext * _gdk_broadway_window_drag_begin (GdkWindow *window,
|
||||
GdkDevice *device,
|
||||
GList *targets);
|
||||
gboolean _gdk_broadway_window_queue_antiexpose (GdkWindow *window,
|
||||
cairo_region_t *area);
|
||||
void _gdk_broadway_window_translate (GdkWindow *window,
|
||||
cairo_region_t *area,
|
||||
gint dx,
|
||||
gint dy);
|
||||
gboolean _gdk_broadway_window_get_property (GdkWindow *window,
|
||||
GdkAtom property,
|
||||
GdkAtom type,
|
||||
gulong offset,
|
||||
gulong length,
|
||||
gint pdelete,
|
||||
GdkAtom *actual_property_type,
|
||||
gint *actual_format_type,
|
||||
gint *actual_length,
|
||||
guchar **data);
|
||||
void _gdk_broadway_window_change_property (GdkWindow *window,
|
||||
GdkAtom property,
|
||||
GdkAtom type,
|
||||
gint format,
|
||||
GdkPropMode mode,
|
||||
const guchar *data,
|
||||
gint nelements);
|
||||
void _gdk_broadway_window_delete_property (GdkWindow *window,
|
||||
GdkAtom property);
|
||||
|
||||
void _gdk_selection_window_destroyed (GdkWindow *window);
|
||||
|
||||
@ -66,23 +98,118 @@ gboolean _gdk_keymap_key_is_modifier (GdkKeymap *keymap,
|
||||
|
||||
void _gdk_broadway_initialize_locale (void);
|
||||
|
||||
void _gdk_screen_broadway_events_init (GdkScreen *screen);
|
||||
void _gdk_broadway_screen_events_init (GdkScreen *screen);
|
||||
GdkVisual *_gdk_broadway_screen_get_system_visual (GdkScreen * screen);
|
||||
gint _gdk_broadway_screen_visual_get_best_depth (GdkScreen * screen);
|
||||
GdkVisualType _gdk_broadway_screen_visual_get_best_type (GdkScreen * screen);
|
||||
GdkVisual *_gdk_broadway_screen_get_system_visual (GdkScreen * screen);
|
||||
GdkVisual*_gdk_broadway_screen_visual_get_best (GdkScreen * screen);
|
||||
GdkVisual*_gdk_broadway_screen_visual_get_best_with_depth (GdkScreen * screen,
|
||||
gint depth);
|
||||
GdkVisual*_gdk_broadway_screen_visual_get_best_with_type (GdkScreen * screen,
|
||||
GdkVisualType visual_type);
|
||||
GdkVisual*_gdk_broadway_screen_visual_get_best_with_both (GdkScreen * screen,
|
||||
gint depth,
|
||||
GdkVisualType visual_type);
|
||||
void _gdk_broadway_screen_query_depths (GdkScreen * screen,
|
||||
gint **depths,
|
||||
gint *count);
|
||||
void _gdk_broadway_screen_query_visual_types (GdkScreen * screen,
|
||||
GdkVisualType **visual_types,
|
||||
gint *count);
|
||||
GList *_gdk_broadway_screen_list_visuals (GdkScreen *screen);
|
||||
|
||||
void _gdk_events_init (GdkDisplay *display);
|
||||
void _gdk_events_uninit (GdkDisplay *display);
|
||||
void _gdk_events_got_input (GdkDisplay *display,
|
||||
const char *message);
|
||||
void _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
const char *message);
|
||||
|
||||
void _gdk_windowing_window_init (GdkScreen *screen);
|
||||
void _gdk_visual_init (GdkScreen *screen);
|
||||
void _gdk_dnd_init (GdkDisplay *display);
|
||||
void _gdk_broadway_screen_init_root_window (GdkScreen *screen);
|
||||
void _gdk_broadway_screen_init_visuals (GdkScreen *screen);
|
||||
void _gdk_broadway_display_init_dnd (GdkDisplay *display);
|
||||
GdkDisplay * _gdk_broadway_display_open (const gchar *display_name);
|
||||
void _gdk_broadway_display_queue_events (GdkDisplay *display);
|
||||
GdkNativeWindow _gdk_broadway_display_get_drag_protocol (GdkDisplay *display,
|
||||
GdkNativeWindow xid,
|
||||
GdkDragProtocol *protocol,
|
||||
guint *version);
|
||||
GdkCursor*_gdk_broadway_display_get_cursor_for_type (GdkDisplay *display,
|
||||
GdkCursorType cursor_type);
|
||||
GdkCursor*_gdk_broadway_display_get_cursor_for_name (GdkDisplay *display,
|
||||
const gchar *name);
|
||||
GdkCursor *_gdk_broadway_display_get_cursor_for_pixbuf (GdkDisplay *display,
|
||||
GdkPixbuf *pixbuf,
|
||||
gint x,
|
||||
gint y);
|
||||
gboolean _gdk_broadway_display_supports_cursor_alpha (GdkDisplay *display);
|
||||
gboolean _gdk_broadway_display_supports_cursor_color (GdkDisplay *display);
|
||||
void _gdk_broadway_display_get_default_cursor_size (GdkDisplay *display,
|
||||
guint *width,
|
||||
guint *height);
|
||||
void _gdk_broadway_display_get_maximal_cursor_size (GdkDisplay *display,
|
||||
guint *width,
|
||||
guint *height);
|
||||
void _gdk_broadway_display_before_process_all_updates (GdkDisplay *display);
|
||||
void _gdk_broadway_display_after_process_all_updates (GdkDisplay *display);
|
||||
void _gdk_broadway_display_create_window_impl (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
GdkWindow *real_parent,
|
||||
GdkScreen *screen,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask);
|
||||
gboolean _gdk_broadway_display_set_selection_owner (GdkDisplay *display,
|
||||
GdkWindow *owner,
|
||||
GdkAtom selection,
|
||||
guint32 time,
|
||||
gboolean send_event);
|
||||
GdkWindow * _gdk_broadway_display_get_selection_owner (GdkDisplay *display,
|
||||
GdkAtom selection);
|
||||
gint _gdk_broadway_display_get_selection_property (GdkDisplay *display,
|
||||
GdkWindow *requestor,
|
||||
guchar **data,
|
||||
GdkAtom *ret_type,
|
||||
gint *ret_format);
|
||||
void _gdk_broadway_display_send_selection_notify (GdkDisplay *display,
|
||||
GdkNativeWindow requestor,
|
||||
GdkAtom selection,
|
||||
GdkAtom target,
|
||||
GdkAtom property,
|
||||
guint32 time);
|
||||
void _gdk_broadway_display_convert_selection (GdkDisplay *display,
|
||||
GdkWindow *requestor,
|
||||
GdkAtom selection,
|
||||
GdkAtom target,
|
||||
guint32 time);
|
||||
gint _gdk_broadway_display_text_property_to_utf8_list (GdkDisplay *display,
|
||||
GdkAtom encoding,
|
||||
gint format,
|
||||
const guchar *text,
|
||||
gint length,
|
||||
gchar ***list);
|
||||
gchar *_gdk_broadway_display_utf8_to_string_target (GdkDisplay *display,
|
||||
const gchar *str);
|
||||
GdkKeymap* _gdk_broadway_display_get_keymap (GdkDisplay *display);
|
||||
|
||||
/* Window methods - testing */
|
||||
void _gdk_broadway_window_sync_rendering (GdkWindow *window);
|
||||
gboolean _gdk_broadway_window_simulate_key (GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
guint keyval,
|
||||
GdkModifierType modifiers,
|
||||
GdkEventType key_pressrelease);
|
||||
gboolean _gdk_broadway_window_simulate_button (GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
guint button,
|
||||
GdkModifierType modifiers,
|
||||
GdkEventType button_pressrelease);
|
||||
|
||||
void _gdk_broadway_cursor_update_theme (GdkCursor *cursor);
|
||||
void _gdk_broadway_cursor_display_finalize (GdkDisplay *display);
|
||||
|
||||
#define GDK_SCREEN_DISPLAY(screen) (GDK_SCREEN_BROADWAY (screen)->display)
|
||||
#define GDK_SCREEN_DISPLAY(screen) (GDK_BROADWAY_SCREEN (screen)->display)
|
||||
#define GDK_WINDOW_SCREEN(win) (GDK_WINDOW_IMPL_BROADWAY (((GdkWindow *)win)->impl)->screen)
|
||||
#define GDK_WINDOW_DISPLAY(win) (GDK_SCREEN_BROADWAY (GDK_WINDOW_SCREEN (win))->display)
|
||||
#define GDK_WINDOW_DISPLAY(win) (GDK_BROADWAY_SCREEN (GDK_WINDOW_SCREEN (win))->display)
|
||||
#define GDK_WINDOW_IS_BROADWAY(win) (GDK_IS_WINDOW_IMPL_BROADWAY (((GdkWindow *)win)->impl))
|
||||
|
||||
#endif /* __GDK_PRIVATE_BROADWAY_H__ */
|
||||
|
@ -38,14 +38,16 @@
|
||||
#include <string.h>
|
||||
|
||||
GdkAtom
|
||||
gdk_atom_intern (const gchar *atom_name,
|
||||
gboolean only_if_exists)
|
||||
_gdk_broadway_display_manager_atom_intern (GdkDisplayManager *manager,
|
||||
const gchar *atom_name,
|
||||
gboolean only_if_exists)
|
||||
{
|
||||
return _GDK_MAKE_ATOM (g_quark_from_string (atom_name));
|
||||
}
|
||||
|
||||
GdkAtom
|
||||
gdk_atom_intern_static_string (const gchar *atom_name)
|
||||
_gdk_broadway_display_manager_atom_intern_static_string (GdkDisplayManager *manager,
|
||||
const gchar *atom_name)
|
||||
{
|
||||
return _GDK_MAKE_ATOM (g_quark_from_static_string (atom_name));
|
||||
}
|
||||
@ -57,41 +59,42 @@ get_atom_name (GdkAtom atom)
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_atom_name (GdkAtom atom)
|
||||
_gdk_broadway_display_manager_get_atom_name (GdkDisplayManager *manager,
|
||||
GdkAtom atom)
|
||||
{
|
||||
return g_strdup (get_atom_name (atom));
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_property_get (GdkWindow *window,
|
||||
GdkAtom property,
|
||||
GdkAtom type,
|
||||
gulong offset,
|
||||
gulong length,
|
||||
gint pdelete,
|
||||
GdkAtom *actual_property_type,
|
||||
gint *actual_format_type,
|
||||
gint *actual_length,
|
||||
guchar **data)
|
||||
_gdk_broadway_window_get_property (GdkWindow *window,
|
||||
GdkAtom property,
|
||||
GdkAtom type,
|
||||
gulong offset,
|
||||
gulong length,
|
||||
gint pdelete,
|
||||
GdkAtom *actual_property_type,
|
||||
gint *actual_format_type,
|
||||
gint *actual_length,
|
||||
guchar **data)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_property_change (GdkWindow *window,
|
||||
GdkAtom property,
|
||||
GdkAtom type,
|
||||
gint format,
|
||||
GdkPropMode mode,
|
||||
const guchar *data,
|
||||
gint nelements)
|
||||
_gdk_broadway_window_change_property (GdkWindow *window,
|
||||
GdkAtom property,
|
||||
GdkAtom type,
|
||||
gint format,
|
||||
GdkPropMode mode,
|
||||
const guchar *data,
|
||||
gint nelements)
|
||||
{
|
||||
g_return_if_fail (!window || GDK_WINDOW_IS_BROADWAY (window));
|
||||
}
|
||||
|
||||
void
|
||||
gdk_property_delete (GdkWindow *window,
|
||||
GdkAtom property)
|
||||
_gdk_broadway_window_delete_property (GdkWindow *window,
|
||||
GdkAtom property)
|
||||
{
|
||||
g_return_if_fail (!window || GDK_WINDOW_IS_BROADWAY (window));
|
||||
}
|
||||
|
@ -34,130 +34,121 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
static void gdk_screen_broadway_dispose (GObject *object);
|
||||
static void gdk_screen_broadway_finalize (GObject *object);
|
||||
static void gdk_broadway_screen_dispose (GObject *object);
|
||||
static void gdk_broadway_screen_finalize (GObject *object);
|
||||
|
||||
G_DEFINE_TYPE (GdkScreenBroadway, _gdk_screen_broadway, GDK_TYPE_SCREEN)
|
||||
G_DEFINE_TYPE (GdkBroadwayScreen, gdk_broadway_screen, GDK_TYPE_SCREEN)
|
||||
|
||||
static void
|
||||
_gdk_screen_broadway_class_init (GdkScreenBroadwayClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->dispose = gdk_screen_broadway_dispose;
|
||||
object_class->finalize = gdk_screen_broadway_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
_gdk_screen_broadway_init (GdkScreenBroadway *screen)
|
||||
gdk_broadway_screen_init (GdkBroadwayScreen *screen)
|
||||
{
|
||||
screen->width = 1024;
|
||||
screen->height = 768;
|
||||
}
|
||||
|
||||
GdkDisplay *
|
||||
gdk_screen_get_display (GdkScreen *screen)
|
||||
static GdkDisplay *
|
||||
gdk_broadway_screen_get_display (GdkScreen *screen)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
||||
|
||||
return GDK_SCREEN_BROADWAY (screen)->display;
|
||||
return GDK_BROADWAY_SCREEN (screen)->display;
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_screen_get_width (GdkScreen *screen)
|
||||
static gint
|
||||
gdk_broadway_screen_get_width (GdkScreen *screen)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
|
||||
|
||||
return GDK_SCREEN_BROADWAY (screen)->width;
|
||||
return GDK_BROADWAY_SCREEN (screen)->width;
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_screen_get_height (GdkScreen *screen)
|
||||
static gint
|
||||
gdk_broadway_screen_get_height (GdkScreen *screen)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
|
||||
|
||||
return GDK_SCREEN_BROADWAY (screen)->height;
|
||||
return GDK_BROADWAY_SCREEN (screen)->height;
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_screen_get_width_mm (GdkScreen *screen)
|
||||
static gint
|
||||
gdk_broadway_screen_get_width_mm (GdkScreen *screen)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
|
||||
|
||||
return gdk_screen_get_width (screen) * 25.4 / 96;
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_screen_get_height_mm (GdkScreen *screen)
|
||||
static gint
|
||||
gdk_broadway_screen_get_height_mm (GdkScreen *screen)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
|
||||
|
||||
return gdk_screen_get_height (screen) * 25.4 / 96;
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_screen_get_number (GdkScreen *screen)
|
||||
static gint
|
||||
gdk_broadway_screen_get_number (GdkScreen *screen)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GdkWindow *
|
||||
gdk_screen_get_root_window (GdkScreen *screen)
|
||||
static GdkWindow *
|
||||
gdk_broadway_screen_get_root_window (GdkScreen *screen)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
||||
|
||||
return GDK_SCREEN_BROADWAY (screen)->root_window;
|
||||
return GDK_BROADWAY_SCREEN (screen)->root_window;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_screen_broadway_dispose (GObject *object)
|
||||
gdk_broadway_screen_dispose (GObject *object)
|
||||
{
|
||||
GdkScreenBroadway *screen_broadway = GDK_SCREEN_BROADWAY (object);
|
||||
GdkBroadwayScreen *broadway_screen = GDK_BROADWAY_SCREEN (object);
|
||||
|
||||
if (screen_broadway->root_window)
|
||||
_gdk_window_destroy (screen_broadway->root_window, TRUE);
|
||||
if (broadway_screen->root_window)
|
||||
_gdk_window_destroy (broadway_screen->root_window, TRUE);
|
||||
|
||||
G_OBJECT_CLASS (_gdk_screen_broadway_parent_class)->dispose (object);
|
||||
G_OBJECT_CLASS (gdk_broadway_screen_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_screen_broadway_finalize (GObject *object)
|
||||
gdk_broadway_screen_finalize (GObject *object)
|
||||
{
|
||||
GdkScreenBroadway *screen_broadway = GDK_SCREEN_BROADWAY (object);
|
||||
GdkBroadwayScreen *broadway_screen = GDK_BROADWAY_SCREEN (object);
|
||||
gint i;
|
||||
|
||||
if (screen_broadway->root_window)
|
||||
g_object_unref (screen_broadway->root_window);
|
||||
if (broadway_screen->root_window)
|
||||
g_object_unref (broadway_screen->root_window);
|
||||
|
||||
/* Visual Part */
|
||||
for (i = 0; i < screen_broadway->nvisuals; i++)
|
||||
g_object_unref (screen_broadway->visuals[i]);
|
||||
g_free (screen_broadway->visuals);
|
||||
for (i = 0; i < broadway_screen->nvisuals; i++)
|
||||
g_object_unref (broadway_screen->visuals[i]);
|
||||
g_free (broadway_screen->visuals);
|
||||
|
||||
G_OBJECT_CLASS (_gdk_screen_broadway_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (gdk_broadway_screen_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_screen_get_n_monitors (GdkScreen *screen)
|
||||
static gint
|
||||
gdk_broadway_screen_get_n_monitors (GdkScreen *screen)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_screen_get_primary_monitor (GdkScreen *screen)
|
||||
static gint
|
||||
gdk_broadway_screen_get_primary_monitor (GdkScreen *screen)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_screen_get_monitor_width_mm (GdkScreen *screen,
|
||||
gint monitor_num)
|
||||
static gint
|
||||
gdk_broadway_screen_get_monitor_width_mm (GdkScreen *screen,
|
||||
gint monitor_num)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), -1);
|
||||
g_return_val_if_fail (monitor_num == 0, -1);
|
||||
@ -165,9 +156,9 @@ gdk_screen_get_monitor_width_mm (GdkScreen *screen,
|
||||
return gdk_screen_get_width_mm (screen);
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_screen_get_monitor_height_mm (GdkScreen *screen,
|
||||
gint monitor_num)
|
||||
static gint
|
||||
gdk_broadway_screen_get_monitor_height_mm (GdkScreen *screen,
|
||||
gint monitor_num)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), -1);
|
||||
g_return_val_if_fail (monitor_num == 0, -1);
|
||||
@ -175,9 +166,9 @@ gdk_screen_get_monitor_height_mm (GdkScreen *screen,
|
||||
return gdk_screen_get_height_mm (screen);
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_screen_get_monitor_plug_name (GdkScreen *screen,
|
||||
gint monitor_num)
|
||||
static gchar *
|
||||
gdk_broadway_screen_get_monitor_plug_name (GdkScreen *screen,
|
||||
gint monitor_num)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
||||
g_return_val_if_fail (monitor_num == 0, NULL);
|
||||
@ -185,26 +176,12 @@ gdk_screen_get_monitor_plug_name (GdkScreen *screen,
|
||||
return g_strdup ("browser");
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_screen_get_monitor_geometry:
|
||||
* @screen: a #GdkScreen
|
||||
* @monitor_num: the monitor number, between 0 and gdk_screen_get_n_monitors (screen)
|
||||
* @dest: a #GdkRectangle to be filled with the monitor geometry
|
||||
*
|
||||
* Retrieves the #GdkRectangle representing the size and position of
|
||||
* the individual monitor within the entire screen area.
|
||||
*
|
||||
* Note that the size of the entire screen area can be retrieved via
|
||||
* gdk_screen_get_width() and gdk_screen_get_height().
|
||||
*
|
||||
* Since: 2.2
|
||||
*/
|
||||
void
|
||||
gdk_screen_get_monitor_geometry (GdkScreen *screen,
|
||||
gint monitor_num,
|
||||
GdkRectangle *dest)
|
||||
static void
|
||||
gdk_broadway_screen_get_monitor_geometry (GdkScreen *screen,
|
||||
gint monitor_num,
|
||||
GdkRectangle *dest)
|
||||
{
|
||||
GdkScreenBroadway *screen_broadway = GDK_SCREEN_BROADWAY (screen);
|
||||
GdkBroadwayScreen *broadway_screen = GDK_BROADWAY_SCREEN (screen);
|
||||
|
||||
g_return_if_fail (GDK_IS_SCREEN (screen));
|
||||
g_return_if_fail (monitor_num == 0);
|
||||
@ -213,36 +190,36 @@ gdk_screen_get_monitor_geometry (GdkScreen *screen,
|
||||
{
|
||||
dest->x = 0;
|
||||
dest->y = 0;
|
||||
dest->width = screen_broadway->width;
|
||||
dest->height = screen_broadway->height;
|
||||
dest->width = broadway_screen->width;
|
||||
dest->height = broadway_screen->height;
|
||||
}
|
||||
}
|
||||
|
||||
GdkVisual *
|
||||
gdk_screen_get_rgba_visual (GdkScreen *screen)
|
||||
static GdkVisual *
|
||||
gdk_broadway_screen_get_rgba_visual (GdkScreen *screen)
|
||||
{
|
||||
GdkScreenBroadway *screen_broadway;
|
||||
GdkBroadwayScreen *broadway_screen;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
||||
|
||||
screen_broadway = GDK_SCREEN_BROADWAY (screen);
|
||||
broadway_screen = GDK_BROADWAY_SCREEN (screen);
|
||||
|
||||
return screen_broadway->rgba_visual;
|
||||
return broadway_screen->rgba_visual;
|
||||
}
|
||||
|
||||
GdkScreen *
|
||||
_gdk_broadway_screen_new (GdkDisplay *display,
|
||||
gint screen_number)
|
||||
gint screen_number)
|
||||
{
|
||||
GdkScreen *screen;
|
||||
GdkScreenBroadway *screen_broadway;
|
||||
GdkBroadwayScreen *broadway_screen;
|
||||
|
||||
screen = g_object_new (GDK_TYPE_SCREEN_BROADWAY, NULL);
|
||||
screen = g_object_new (GDK_TYPE_BROADWAY_SCREEN, NULL);
|
||||
|
||||
screen_broadway = GDK_SCREEN_BROADWAY (screen);
|
||||
screen_broadway->display = display;
|
||||
_gdk_visual_init (screen);
|
||||
_gdk_windowing_window_init (screen);
|
||||
broadway_screen = GDK_BROADWAY_SCREEN (screen);
|
||||
broadway_screen->display = display;
|
||||
_gdk_broadway_screen_init_visuals (screen);
|
||||
_gdk_broadway_screen_init_root_window (screen);
|
||||
|
||||
return screen;
|
||||
}
|
||||
@ -257,61 +234,55 @@ _gdk_broadway_screen_setup (GdkScreen *screen)
|
||||
{
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_screen_is_composited (GdkScreen *screen)
|
||||
static gboolean
|
||||
gdk_broadway_screen_is_composited (GdkScreen *screen)
|
||||
{
|
||||
GdkScreenBroadway *screen_broadway;
|
||||
GdkBroadwayScreen *broadway_screen;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
|
||||
|
||||
screen_broadway = GDK_SCREEN_BROADWAY (screen);
|
||||
broadway_screen = GDK_BROADWAY_SCREEN (screen);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
gchar *
|
||||
gdk_screen_make_display_name (GdkScreen *screen)
|
||||
static gchar *
|
||||
gdk_broadway_screen_make_display_name (GdkScreen *screen)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
||||
|
||||
return g_strdup ("browser");
|
||||
}
|
||||
|
||||
GdkWindow *
|
||||
gdk_screen_get_active_window (GdkScreen *screen)
|
||||
static GdkWindow *
|
||||
gdk_broadway_screen_get_active_window (GdkScreen *screen)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GList *
|
||||
gdk_screen_get_window_stack (GdkScreen *screen)
|
||||
static GList *
|
||||
gdk_broadway_screen_get_window_stack (GdkScreen *screen)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_screen_broadcast_client_message (GdkScreen *screen,
|
||||
GdkEvent *event)
|
||||
static void
|
||||
gdk_broadway_screen_broadcast_client_message (GdkScreen *screen,
|
||||
GdkEvent *event)
|
||||
{
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_screen_get_setting (GdkScreen *screen,
|
||||
const gchar *name,
|
||||
GValue *value)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_net_wm_supports (GdkAtom property)
|
||||
static gboolean
|
||||
gdk_broadway_screen_get_setting (GdkScreen *screen,
|
||||
const gchar *name,
|
||||
GValue *value)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_screen_broadway_events_init (GdkScreen *screen)
|
||||
_gdk_broadway_screen_events_init (GdkScreen *screen)
|
||||
{
|
||||
}
|
||||
|
||||
@ -322,3 +293,44 @@ _gdk_windowing_substitute_screen_number (const gchar *display_name,
|
||||
return g_strdup ("browser");
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_screen_class_init (GdkBroadwayScreenClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GdkScreenClass *screen_class = GDK_SCREEN_CLASS (klass);
|
||||
|
||||
object_class->dispose = gdk_broadway_screen_dispose;
|
||||
object_class->finalize = gdk_broadway_screen_finalize;
|
||||
|
||||
screen_class->get_display = gdk_broadway_screen_get_display;
|
||||
screen_class->get_width = gdk_broadway_screen_get_width;
|
||||
screen_class->get_height = gdk_broadway_screen_get_height;
|
||||
screen_class->get_width_mm = gdk_broadway_screen_get_width_mm;
|
||||
screen_class->get_height_mm = gdk_broadway_screen_get_height_mm;
|
||||
screen_class->get_number = gdk_broadway_screen_get_number;
|
||||
screen_class->get_root_window = gdk_broadway_screen_get_root_window;
|
||||
screen_class->get_n_monitors = gdk_broadway_screen_get_n_monitors;
|
||||
screen_class->get_primary_monitor = gdk_broadway_screen_get_primary_monitor;
|
||||
screen_class->get_monitor_width_mm = gdk_broadway_screen_get_monitor_width_mm;
|
||||
screen_class->get_monitor_height_mm = gdk_broadway_screen_get_monitor_height_mm;
|
||||
screen_class->get_monitor_plug_name = gdk_broadway_screen_get_monitor_plug_name;
|
||||
screen_class->get_monitor_geometry = gdk_broadway_screen_get_monitor_geometry;
|
||||
screen_class->is_composited = gdk_broadway_screen_is_composited;
|
||||
screen_class->make_display_name = gdk_broadway_screen_make_display_name;
|
||||
screen_class->get_active_window = gdk_broadway_screen_get_active_window;
|
||||
screen_class->get_window_stack = gdk_broadway_screen_get_window_stack;
|
||||
screen_class->broadcast_client_message = gdk_broadway_screen_broadcast_client_message;
|
||||
screen_class->get_setting = gdk_broadway_screen_get_setting;
|
||||
screen_class->get_rgba_visual = gdk_broadway_screen_get_rgba_visual;
|
||||
screen_class->get_system_visual = _gdk_broadway_screen_get_system_visual;
|
||||
screen_class->visual_get_best_depth = _gdk_broadway_screen_visual_get_best_depth;
|
||||
screen_class->visual_get_best_type = _gdk_broadway_screen_visual_get_best_type;
|
||||
screen_class->visual_get_best = _gdk_broadway_screen_visual_get_best;
|
||||
screen_class->visual_get_best_with_depth = _gdk_broadway_screen_visual_get_best_with_depth;
|
||||
screen_class->visual_get_best_with_type = _gdk_broadway_screen_visual_get_best_with_type;
|
||||
screen_class->visual_get_best_with_both = _gdk_broadway_screen_visual_get_best_with_both;
|
||||
screen_class->query_depths = _gdk_broadway_screen_query_depths;
|
||||
screen_class->query_visual_types = _gdk_broadway_screen_query_visual_types;
|
||||
screen_class->list_visuals = _gdk_broadway_screen_list_visuals;
|
||||
}
|
||||
|
||||
|
@ -21,28 +21,28 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_SCREEN_BROADWAY_H__
|
||||
#define __GDK_SCREEN_BROADWAY_H__
|
||||
#ifndef __GDK_BROADWAY_SCREEN_H__
|
||||
#define __GDK_BROADWAY_SCREEN_H__
|
||||
|
||||
#include <gdk/gdkscreen.h>
|
||||
#include <gdk/gdkscreenprivate.h>
|
||||
#include <gdk/gdkvisual.h>
|
||||
#include "gdkprivate-broadway.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _GdkScreenBroadway GdkScreenBroadway;
|
||||
typedef struct _GdkScreenBroadwayClass GdkScreenBroadwayClass;
|
||||
typedef struct _GdkBroadwayScreen GdkBroadwayScreen;
|
||||
typedef struct _GdkBroadwayScreenClass GdkBroadwayScreenClass;
|
||||
|
||||
#define GDK_TYPE_SCREEN_BROADWAY (_gdk_screen_broadway_get_type ())
|
||||
#define GDK_SCREEN_BROADWAY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SCREEN_BROADWAY, GdkScreenBroadway))
|
||||
#define GDK_SCREEN_BROADWAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SCREEN_BROADWAY, GdkScreenBroadwayClass))
|
||||
#define GDK_IS_SCREEN_BROADWAY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SCREEN_BROADWAY))
|
||||
#define GDK_IS_SCREEN_BROADWAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SCREEN_BROADWAY))
|
||||
#define GDK_SCREEN_BROADWAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SCREEN_BROADWAY, GdkScreenBroadwayClass))
|
||||
#define GDK_TYPE_BROADWAY_SCREEN (gdk_broadway_screen_get_type ())
|
||||
#define GDK_BROADWAY_SCREEN(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_BROADWAY_SCREEN, GdkBroadwayScreen))
|
||||
#define GDK_BROADWAY_SCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_BROADWAY_SCREEN, GdkBroadwayScreenClass))
|
||||
#define GDK_IS_BROADWAY_SCREEN(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_BROADWAY_SCREEN))
|
||||
#define GDK_IS_BROADWAY_SCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_BROADWAY_SCREEN))
|
||||
#define GDK_BROADWAY_SCREEN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_BROADWAY_SCREEN, GdkBroadwayScreenClass))
|
||||
|
||||
typedef struct _GdkBroadwayMonitor GdkBroadwayMonitor;
|
||||
|
||||
struct _GdkScreenBroadway
|
||||
struct _GdkBroadwayScreen
|
||||
{
|
||||
GdkScreen parent_instance;
|
||||
|
||||
@ -63,18 +63,18 @@ struct _GdkScreenBroadway
|
||||
gint navailable_types;
|
||||
};
|
||||
|
||||
struct _GdkScreenBroadwayClass
|
||||
struct _GdkBroadwayScreenClass
|
||||
{
|
||||
GdkScreenClass parent_class;
|
||||
|
||||
void (* window_manager_changed) (GdkScreenBroadway *screen_broadway);
|
||||
void (* window_manager_changed) (GdkBroadwayScreen *screen);
|
||||
};
|
||||
|
||||
GType _gdk_screen_broadway_get_type (void);
|
||||
GType gdk_broadway_screen_get_type (void);
|
||||
GdkScreen * _gdk_broadway_screen_new (GdkDisplay *display,
|
||||
gint screen_number);
|
||||
void _gdk_broadway_screen_setup (GdkScreen *screen);
|
||||
void _gdk_broadway_screen_setup (GdkScreen *screen);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_SCREEN_BROADWAY_H__ */
|
||||
#endif /* __GDK_BROADWAY_SCREEN_H__ */
|
||||
|
@ -70,35 +70,37 @@ _gdk_selection_window_destroyed (GdkWindow *window)
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_selection_owner_set_for_display (GdkDisplay *display,
|
||||
GdkWindow *owner,
|
||||
GdkAtom selection,
|
||||
guint32 time,
|
||||
gboolean send_event)
|
||||
_gdk_broadway_display_set_selection_owner (GdkDisplay *display,
|
||||
GdkWindow *owner,
|
||||
GdkAtom selection,
|
||||
guint32 time,
|
||||
gboolean send_event)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
GdkWindow *
|
||||
gdk_selection_owner_get_for_display (GdkDisplay *display,
|
||||
GdkAtom selection)
|
||||
_gdk_broadway_display_get_selection_owner (GdkDisplay *display,
|
||||
GdkAtom selection)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_selection_convert (GdkWindow *requestor,
|
||||
GdkAtom selection,
|
||||
GdkAtom target,
|
||||
guint32 time)
|
||||
_gdk_broadway_display_convert_selection (GdkDisplay *display,
|
||||
GdkWindow *requestor,
|
||||
GdkAtom selection,
|
||||
GdkAtom target,
|
||||
guint32 time)
|
||||
{
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_selection_property_get (GdkWindow *requestor,
|
||||
guchar **data,
|
||||
GdkAtom *ret_type,
|
||||
gint *ret_format)
|
||||
_gdk_broadway_display_get_selection_property (GdkDisplay *display,
|
||||
GdkWindow *requestor,
|
||||
guchar **data,
|
||||
GdkAtom *ret_type,
|
||||
gint *ret_format)
|
||||
{
|
||||
if (ret_type)
|
||||
*ret_type = GDK_NONE;
|
||||
@ -111,42 +113,23 @@ gdk_selection_property_get (GdkWindow *requestor,
|
||||
}
|
||||
|
||||
void
|
||||
gdk_selection_send_notify_for_display (GdkDisplay *display,
|
||||
GdkNativeWindow requestor,
|
||||
GdkAtom selection,
|
||||
GdkAtom target,
|
||||
GdkAtom property,
|
||||
guint32 time)
|
||||
_gdk_broadway_display_send_selection_notify (GdkDisplay *display,
|
||||
GdkNativeWindow requestor,
|
||||
GdkAtom selection,
|
||||
GdkAtom target,
|
||||
GdkAtom property,
|
||||
guint32 time)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DISPLAY (display));
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_text_property_to_text_list_for_display (GdkDisplay *display,
|
||||
GdkAtom encoding,
|
||||
gint format,
|
||||
const guchar *text,
|
||||
gint length,
|
||||
gchar ***list)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_free_text_list (gchar **list)
|
||||
{
|
||||
g_return_if_fail (list != NULL);
|
||||
|
||||
g_strfreev (list);
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_text_property_to_utf8_list_for_display (GdkDisplay *display,
|
||||
GdkAtom encoding,
|
||||
gint format,
|
||||
const guchar *text,
|
||||
gint length,
|
||||
gchar ***list)
|
||||
_gdk_broadway_display_text_property_to_utf8_list (GdkDisplay *display,
|
||||
GdkAtom encoding,
|
||||
gint format,
|
||||
const guchar *text,
|
||||
gint length,
|
||||
gchar ***list)
|
||||
{
|
||||
g_return_val_if_fail (text != NULL, 0);
|
||||
g_return_val_if_fail (length >= 0, 0);
|
||||
@ -155,37 +138,9 @@ gdk_text_property_to_utf8_list_for_display (GdkDisplay *display,
|
||||
return 0;
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_string_to_compound_text_for_display (GdkDisplay *display,
|
||||
const gchar *str,
|
||||
GdkAtom *encoding,
|
||||
gint *format,
|
||||
guchar **ctext,
|
||||
gint *length)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), 0);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_utf8_to_string_target (const gchar *str)
|
||||
_gdk_broadway_display_utf8_to_string_target (GdkDisplay *display,
|
||||
const gchar *str)
|
||||
{
|
||||
return g_strdup (str);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_utf8_to_compound_text_for_display (GdkDisplay *display,
|
||||
const gchar *str,
|
||||
GdkAtom *encoding,
|
||||
gint *format,
|
||||
guchar **ctext,
|
||||
gint *length)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void gdk_free_compound_text (guchar *ctext)
|
||||
{
|
||||
g_free (ctext);
|
||||
}
|
||||
|
@ -1,136 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2003 Sun Microsystems Inc.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Authors: Mark McLoughlin <mark@skynet.ie>
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkspawn.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
typedef struct {
|
||||
char *display;
|
||||
GSpawnChildSetupFunc child_setup;
|
||||
gpointer user_data;
|
||||
} UserChildSetup;
|
||||
|
||||
static void
|
||||
set_environment (gpointer user_data)
|
||||
{
|
||||
UserChildSetup *setup = user_data;
|
||||
|
||||
g_setenv ("DISPLAY", setup->display, TRUE);
|
||||
|
||||
if (setup->child_setup)
|
||||
setup->child_setup (setup->user_data);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_spawn_on_screen (GdkScreen *screen,
|
||||
const gchar *working_directory,
|
||||
gchar **argv,
|
||||
gchar **envp,
|
||||
GSpawnFlags flags,
|
||||
GSpawnChildSetupFunc child_setup,
|
||||
gpointer user_data,
|
||||
GPid *child_pid,
|
||||
GError **error)
|
||||
{
|
||||
UserChildSetup setup_data;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
|
||||
|
||||
setup_data.display = gdk_screen_make_display_name (screen);
|
||||
setup_data.child_setup = child_setup;
|
||||
setup_data.user_data = user_data;
|
||||
|
||||
return g_spawn_async (working_directory,
|
||||
argv,
|
||||
envp,
|
||||
flags,
|
||||
set_environment,
|
||||
&setup_data,
|
||||
child_pid,
|
||||
error);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_spawn_on_screen_with_pipes (GdkScreen *screen,
|
||||
const gchar *working_directory,
|
||||
gchar **argv,
|
||||
gchar **envp,
|
||||
GSpawnFlags flags,
|
||||
GSpawnChildSetupFunc child_setup,
|
||||
gpointer user_data,
|
||||
GPid *child_pid,
|
||||
gint *standard_input,
|
||||
gint *standard_output,
|
||||
gint *standard_error,
|
||||
GError **error)
|
||||
{
|
||||
UserChildSetup setup_data;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
|
||||
|
||||
setup_data.display = gdk_screen_make_display_name (screen);
|
||||
setup_data.child_setup = child_setup;
|
||||
setup_data.user_data = user_data;
|
||||
|
||||
return g_spawn_async_with_pipes (working_directory,
|
||||
argv,
|
||||
envp,
|
||||
flags,
|
||||
set_environment,
|
||||
&setup_data,
|
||||
child_pid,
|
||||
standard_input,
|
||||
standard_output,
|
||||
standard_error,
|
||||
error);
|
||||
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_spawn_command_line_on_screen (GdkScreen *screen,
|
||||
const gchar *command_line,
|
||||
GError **error)
|
||||
{
|
||||
gchar **argv = NULL;
|
||||
gboolean retval;
|
||||
|
||||
g_return_val_if_fail (command_line != NULL, FALSE);
|
||||
|
||||
if (!g_shell_parse_argv (command_line,
|
||||
NULL, &argv,
|
||||
error))
|
||||
return FALSE;
|
||||
|
||||
retval = gdk_spawn_on_screen (screen,
|
||||
NULL, argv, NULL,
|
||||
G_SPAWN_SEARCH_PATH,
|
||||
NULL, NULL, NULL,
|
||||
error);
|
||||
g_strfreev (argv);
|
||||
|
||||
return retval;
|
||||
}
|
@ -17,36 +17,51 @@
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdktestutils.h"
|
||||
|
||||
#include "gdkkeysyms.h"
|
||||
#include <gdk/gdktestutils.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
#include <gdk/gdkinternals.h>
|
||||
|
||||
void
|
||||
gdk_test_render_sync (GdkWindow *window)
|
||||
_gdk_broadway_window_sync_rendering (GdkWindow *window)
|
||||
{
|
||||
/* FIXME: Find out if there is a way to implement this on broadway. */
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_test_simulate_key (GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
guint keyval,
|
||||
GdkModifierType modifiers,
|
||||
GdkEventType key_pressrelease)
|
||||
_gdk_broadway_window_simulate_key (GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
guint keyval,
|
||||
GdkModifierType modifiers,
|
||||
GdkEventType key_pressrelease)
|
||||
{
|
||||
g_return_val_if_fail (key_pressrelease == GDK_KEY_PRESS || key_pressrelease == GDK_KEY_RELEASE, FALSE);
|
||||
g_return_val_if_fail (window != NULL, FALSE);
|
||||
|
||||
if (!GDK_WINDOW_IS_MAPPED (window))
|
||||
return FALSE;
|
||||
|
||||
/* FIXME: Implement. */
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_test_simulate_button (GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
guint button, /*1..3*/
|
||||
GdkModifierType modifiers,
|
||||
GdkEventType button_pressrelease)
|
||||
_gdk_broadway_window_simulate_button (GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
guint button, /*1..3*/
|
||||
GdkModifierType modifiers,
|
||||
GdkEventType button_pressrelease)
|
||||
{
|
||||
g_return_val_if_fail (button_pressrelease == GDK_BUTTON_PRESS || button_pressrelease == GDK_BUTTON_RELEASE, FALSE);
|
||||
g_return_val_if_fail (window != NULL, FALSE);
|
||||
|
||||
if (!GDK_WINDOW_IS_MAPPED (window))
|
||||
return FALSE;
|
||||
|
||||
/* FIXME: Implement. */
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -26,18 +26,18 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkvisual.h"
|
||||
#include "gdkvisualprivate.h"
|
||||
|
||||
#include "gdkprivate-broadway.h"
|
||||
#include "gdkscreen-broadway.h"
|
||||
#include "gdkinternals.h"
|
||||
|
||||
struct _GdkVisualPrivate
|
||||
struct _GdkBroadwayVisual
|
||||
{
|
||||
GdkScreen *screen;
|
||||
GdkVisual visual;
|
||||
};
|
||||
|
||||
struct _GdkVisualClass
|
||||
struct _GdkBroadwayVisualClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
@ -47,48 +47,42 @@ static void gdk_visual_decompose_mask (gulong mask,
|
||||
gint *prec);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GdkVisual, gdk_visual, G_TYPE_OBJECT)
|
||||
G_DEFINE_TYPE (GdkBroadwayVisual, gdk_broadway_visual, GDK_TYPE_VISUAL)
|
||||
|
||||
static void
|
||||
gdk_visual_finalize (GObject *object)
|
||||
gdk_broadway_visual_finalize (GObject *object)
|
||||
{
|
||||
G_OBJECT_CLASS (gdk_visual_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (gdk_broadway_visual_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_visual_class_init (GdkVisualClass *visual_class)
|
||||
gdk_broadway_visual_class_init (GdkBroadwayVisualClass *visual_class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (visual_class);
|
||||
|
||||
g_type_class_add_private (object_class, sizeof (GdkVisualPrivate));
|
||||
|
||||
object_class->finalize = gdk_visual_finalize;
|
||||
object_class->finalize = gdk_broadway_visual_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_visual_init (GdkVisual *visual)
|
||||
gdk_broadway_visual_init (GdkBroadwayVisual *visual)
|
||||
{
|
||||
visual->priv = G_TYPE_INSTANCE_GET_PRIVATE (visual,
|
||||
GDK_TYPE_VISUAL,
|
||||
GdkVisualPrivate);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_visual_init (GdkScreen *screen)
|
||||
_gdk_broadway_screen_init_visuals (GdkScreen *screen)
|
||||
{
|
||||
GdkScreenBroadway *screen_broadway;
|
||||
GdkBroadwayScreen *broadway_screen;
|
||||
GdkVisual **visuals;
|
||||
int nvisuals;
|
||||
|
||||
g_return_if_fail (GDK_IS_SCREEN (screen));
|
||||
screen_broadway = GDK_SCREEN_BROADWAY (screen);
|
||||
broadway_screen = GDK_BROADWAY_SCREEN (screen);
|
||||
|
||||
nvisuals = 2;
|
||||
visuals = g_new (GdkVisual *, nvisuals);
|
||||
|
||||
visuals[0] = g_object_new (GDK_TYPE_VISUAL, NULL);
|
||||
visuals[0]->priv->screen = screen;
|
||||
visuals[0] = g_object_new (GDK_TYPE_BROADWAY_VISUAL, NULL);
|
||||
visuals[0]->screen = screen;
|
||||
visuals[0]->type = GDK_VISUAL_TRUE_COLOR;
|
||||
visuals[0]->depth = 32;
|
||||
visuals[0]->byte_order = (G_BYTE_ORDER == G_LITTLE_ENDIAN) ? GDK_LSB_FIRST : GDK_MSB_FIRST;
|
||||
@ -107,8 +101,8 @@ _gdk_visual_init (GdkScreen *screen)
|
||||
&visuals[0]->blue_shift,
|
||||
&visuals[0]->blue_prec);
|
||||
|
||||
visuals[1] = g_object_new (GDK_TYPE_VISUAL, NULL);
|
||||
visuals[1]->priv->screen = screen;
|
||||
visuals[1] = g_object_new (GDK_TYPE_BROADWAY_VISUAL, NULL);
|
||||
visuals[1]->screen = screen;
|
||||
visuals[1]->type = GDK_VISUAL_TRUE_COLOR;
|
||||
visuals[1]->depth = 24;
|
||||
visuals[1]->byte_order = (G_BYTE_ORDER == G_LITTLE_ENDIAN) ? GDK_LSB_FIRST : GDK_MSB_FIRST;
|
||||
@ -127,64 +121,61 @@ _gdk_visual_init (GdkScreen *screen)
|
||||
&visuals[1]->blue_shift,
|
||||
&visuals[1]->blue_prec);
|
||||
|
||||
screen_broadway->system_visual = visuals[1];
|
||||
screen_broadway->rgba_visual = visuals[0];
|
||||
broadway_screen->system_visual = visuals[1];
|
||||
broadway_screen->rgba_visual = visuals[0];
|
||||
|
||||
screen_broadway->navailable_depths = 2;
|
||||
screen_broadway->available_depths[0] = 32;
|
||||
screen_broadway->available_depths[1] = 24;
|
||||
broadway_screen->navailable_depths = 2;
|
||||
broadway_screen->available_depths[0] = 32;
|
||||
broadway_screen->available_depths[1] = 24;
|
||||
|
||||
screen_broadway->navailable_types = 1;
|
||||
screen_broadway->available_types[0] = GDK_VISUAL_TRUE_COLOR;
|
||||
broadway_screen->navailable_types = 1;
|
||||
broadway_screen->available_types[0] = GDK_VISUAL_TRUE_COLOR;
|
||||
|
||||
screen_broadway->visuals = visuals;
|
||||
screen_broadway->nvisuals = nvisuals;
|
||||
broadway_screen->visuals = visuals;
|
||||
broadway_screen->nvisuals = nvisuals;
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_visual_get_best_depth (void)
|
||||
_gdk_broadway_screen_visual_get_best_depth (GdkScreen * screen)
|
||||
{
|
||||
GdkScreen *screen = gdk_screen_get_default();
|
||||
|
||||
return GDK_SCREEN_BROADWAY (screen)->available_depths[0];
|
||||
return GDK_BROADWAY_SCREEN (screen)->available_depths[0];
|
||||
}
|
||||
|
||||
GdkVisualType
|
||||
gdk_visual_get_best_type (void)
|
||||
_gdk_broadway_screen_visual_get_best_type (GdkScreen * screen)
|
||||
{
|
||||
GdkScreen *screen = gdk_screen_get_default();
|
||||
|
||||
return GDK_SCREEN_BROADWAY (screen)->available_types[0];
|
||||
return GDK_BROADWAY_SCREEN (screen)->available_types[0];
|
||||
}
|
||||
|
||||
GdkVisual *
|
||||
gdk_screen_get_system_visual (GdkScreen * screen)
|
||||
_gdk_broadway_screen_get_system_visual (GdkScreen * screen)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
||||
|
||||
return ((GdkVisual *) GDK_SCREEN_BROADWAY (screen)->system_visual);
|
||||
return ((GdkVisual *) GDK_BROADWAY_SCREEN (screen)->system_visual);
|
||||
}
|
||||
|
||||
GdkVisual*
|
||||
gdk_visual_get_best (void)
|
||||
_gdk_broadway_screen_visual_get_best (GdkScreen * screen)
|
||||
{
|
||||
GdkScreenBroadway *screen_broadway = GDK_SCREEN_BROADWAY (gdk_screen_get_default());
|
||||
GdkBroadwayScreen *broadway_screen = GDK_BROADWAY_SCREEN (screen);
|
||||
|
||||
return (GdkVisual *)screen_broadway->visuals[0];
|
||||
return (GdkVisual *)broadway_screen->visuals[0];
|
||||
}
|
||||
|
||||
GdkVisual*
|
||||
gdk_visual_get_best_with_depth (gint depth)
|
||||
_gdk_broadway_screen_visual_get_best_with_depth (GdkScreen * screen,
|
||||
gint depth)
|
||||
{
|
||||
GdkScreenBroadway *screen_broadway = GDK_SCREEN_BROADWAY (gdk_screen_get_default ());
|
||||
GdkBroadwayScreen *broadway_screen = GDK_BROADWAY_SCREEN (screen);
|
||||
GdkVisual *return_val;
|
||||
int i;
|
||||
|
||||
return_val = NULL;
|
||||
for (i = 0; i < screen_broadway->nvisuals; i++)
|
||||
if (depth == screen_broadway->visuals[i]->depth)
|
||||
for (i = 0; i < broadway_screen->nvisuals; i++)
|
||||
if (depth == broadway_screen->visuals[i]->depth)
|
||||
{
|
||||
return_val = (GdkVisual *) screen_broadway->visuals[i];
|
||||
return_val = (GdkVisual *) broadway_screen->visuals[i];
|
||||
break;
|
||||
}
|
||||
|
||||
@ -192,17 +183,18 @@ gdk_visual_get_best_with_depth (gint depth)
|
||||
}
|
||||
|
||||
GdkVisual*
|
||||
gdk_visual_get_best_with_type (GdkVisualType visual_type)
|
||||
_gdk_broadway_screen_visual_get_best_with_type (GdkScreen * screen,
|
||||
GdkVisualType visual_type)
|
||||
{
|
||||
GdkScreenBroadway *screen_broadway = GDK_SCREEN_BROADWAY (gdk_screen_get_default ());
|
||||
GdkBroadwayScreen *broadway_screen = GDK_BROADWAY_SCREEN (screen);
|
||||
GdkVisual *return_val;
|
||||
int i;
|
||||
|
||||
return_val = NULL;
|
||||
for (i = 0; i < screen_broadway->nvisuals; i++)
|
||||
if (visual_type == screen_broadway->visuals[i]->type)
|
||||
for (i = 0; i < broadway_screen->nvisuals; i++)
|
||||
if (visual_type == broadway_screen->visuals[i]->type)
|
||||
{
|
||||
return_val = (GdkVisual *) screen_broadway->visuals[i];
|
||||
return_val = (GdkVisual *) broadway_screen->visuals[i];
|
||||
break;
|
||||
}
|
||||
|
||||
@ -210,19 +202,20 @@ gdk_visual_get_best_with_type (GdkVisualType visual_type)
|
||||
}
|
||||
|
||||
GdkVisual*
|
||||
gdk_visual_get_best_with_both (gint depth,
|
||||
GdkVisualType visual_type)
|
||||
_gdk_broadway_screen_visual_get_best_with_both (GdkScreen * screen,
|
||||
gint depth,
|
||||
GdkVisualType visual_type)
|
||||
{
|
||||
GdkScreenBroadway *screen_broadway = GDK_SCREEN_BROADWAY (gdk_screen_get_default ());
|
||||
GdkBroadwayScreen *broadway_screen = GDK_BROADWAY_SCREEN (screen);
|
||||
GdkVisual *return_val;
|
||||
int i;
|
||||
|
||||
return_val = NULL;
|
||||
for (i = 0; i < screen_broadway->nvisuals; i++)
|
||||
if ((depth == screen_broadway->visuals[i]->depth) &&
|
||||
(visual_type == screen_broadway->visuals[i]->type))
|
||||
for (i = 0; i < broadway_screen->nvisuals; i++)
|
||||
if ((depth == broadway_screen->visuals[i]->depth) &&
|
||||
(visual_type == broadway_screen->visuals[i]->type))
|
||||
{
|
||||
return_val = (GdkVisual *) screen_broadway->visuals[i];
|
||||
return_val = (GdkVisual *) broadway_screen->visuals[i];
|
||||
break;
|
||||
}
|
||||
|
||||
@ -230,39 +223,41 @@ gdk_visual_get_best_with_both (gint depth,
|
||||
}
|
||||
|
||||
void
|
||||
gdk_query_depths (gint **depths,
|
||||
gint *count)
|
||||
_gdk_broadway_screen_query_depths (GdkScreen * screen,
|
||||
gint **depths,
|
||||
gint *count)
|
||||
{
|
||||
GdkScreenBroadway *screen_broadway = GDK_SCREEN_BROADWAY (gdk_screen_get_default ());
|
||||
GdkBroadwayScreen *broadway_screen = GDK_BROADWAY_SCREEN (screen);
|
||||
|
||||
*count = screen_broadway->navailable_depths;
|
||||
*depths = screen_broadway->available_depths;
|
||||
*count = broadway_screen->navailable_depths;
|
||||
*depths = broadway_screen->available_depths;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_query_visual_types (GdkVisualType **visual_types,
|
||||
gint *count)
|
||||
_gdk_broadway_screen_query_visual_types (GdkScreen * screen,
|
||||
GdkVisualType **visual_types,
|
||||
gint *count)
|
||||
{
|
||||
GdkScreenBroadway *screen_broadway = GDK_SCREEN_BROADWAY (gdk_screen_get_default ());
|
||||
GdkBroadwayScreen *broadway_screen = GDK_BROADWAY_SCREEN (screen);
|
||||
|
||||
*count = screen_broadway->navailable_types;
|
||||
*visual_types = screen_broadway->available_types;
|
||||
*count = broadway_screen->navailable_types;
|
||||
*visual_types = broadway_screen->available_types;
|
||||
}
|
||||
|
||||
GList *
|
||||
gdk_screen_list_visuals (GdkScreen *screen)
|
||||
_gdk_broadway_screen_list_visuals (GdkScreen *screen)
|
||||
{
|
||||
GList *list;
|
||||
GdkScreenBroadway *screen_broadway;
|
||||
GdkBroadwayScreen *broadway_screen;
|
||||
guint i;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
||||
screen_broadway = GDK_SCREEN_BROADWAY (screen);
|
||||
broadway_screen = GDK_BROADWAY_SCREEN (screen);
|
||||
|
||||
list = NULL;
|
||||
|
||||
for (i = 0; i < screen_broadway->nvisuals; ++i)
|
||||
list = g_list_append (list, screen_broadway->visuals[i]);
|
||||
for (i = 0; i < broadway_screen->nvisuals; ++i)
|
||||
list = g_list_append (list, broadway_screen->visuals[i]);
|
||||
|
||||
return list;
|
||||
}
|
||||
@ -293,11 +288,3 @@ gdk_visual_decompose_mask (gulong mask,
|
||||
mask >>= 1;
|
||||
}
|
||||
}
|
||||
|
||||
GdkScreen *
|
||||
gdk_visual_get_screen (GdkVisual *visual)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_VISUAL (visual), NULL);
|
||||
|
||||
return visual->priv->screen;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -44,6 +44,10 @@
|
||||
#include "quartz/gdkquartzdisplaymanager.h"
|
||||
#endif
|
||||
|
||||
#ifdef GDK_WINDOWING_BROADWAY
|
||||
#include "broadway/gdkbroadwaydisplaymanager.h"
|
||||
#endif
|
||||
|
||||
#ifdef GDK_WINDOWING_WIN32
|
||||
#include "win32/gdkwin32.h"
|
||||
#endif
|
||||
@ -202,6 +206,11 @@ gdk_display_manager_get (void)
|
||||
if (backend == NULL || strcmp (backend, "win32") == 0)
|
||||
manager = g_object_new (gdk_win32_display_manager_get_type (), NULL);
|
||||
else
|
||||
#endif
|
||||
#ifdef GDK_WINDOWING_BROADWAY
|
||||
if (backend == NULL || strcmp (backend, "broadway") == 0)
|
||||
manager = g_object_new (gdk_broadway_display_manager_get_type (), NULL);
|
||||
else
|
||||
#endif
|
||||
if (backend != NULL)
|
||||
g_error ("Unsupported GDK backend: %s", backend);
|
||||
|
Loading…
Reference in New Issue
Block a user