Patch from Eric Warmonhoven to get linux-fb compiling with multihead

Tue Sep 10 11:11:09 2002  Owen Taylor  <otaylor@redhat.com>
        * gdk/linux-fb/*: Patch from Eric Warmonhoven to
        get linux-fb compiling with multihead changes.
This commit is contained in:
Owen Taylor 2002-09-10 15:19:13 +00:00 committed by Owen Taylor
parent 44e2b53f83
commit 7ddfec4f80
25 changed files with 375 additions and 114 deletions

View File

@ -1,3 +1,8 @@
Tue Sep 10 11:11:09 2002 Owen Taylor <otaylor@redhat.com>
* gdk/linux-fb/*: Patch from Eric Warmonhoven to
get linux-fb compiling with multihead changes.
Tue Sep 10 09:29:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Take

View File

@ -1,3 +1,8 @@
Tue Sep 10 11:11:09 2002 Owen Taylor <otaylor@redhat.com>
* gdk/linux-fb/*: Patch from Eric Warmonhoven to
get linux-fb compiling with multihead changes.
Tue Sep 10 09:29:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Take

View File

@ -1,3 +1,8 @@
Tue Sep 10 11:11:09 2002 Owen Taylor <otaylor@redhat.com>
* gdk/linux-fb/*: Patch from Eric Warmonhoven to
get linux-fb compiling with multihead changes.
Tue Sep 10 09:29:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Take

View File

@ -1,3 +1,8 @@
Tue Sep 10 11:11:09 2002 Owen Taylor <otaylor@redhat.com>
* gdk/linux-fb/*: Patch from Eric Warmonhoven to
get linux-fb compiling with multihead changes.
Tue Sep 10 09:29:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Take

View File

@ -1,3 +1,8 @@
Tue Sep 10 11:11:09 2002 Owen Taylor <otaylor@redhat.com>
* gdk/linux-fb/*: Patch from Eric Warmonhoven to
get linux-fb compiling with multihead changes.
Tue Sep 10 09:29:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Take

View File

@ -1,3 +1,8 @@
Tue Sep 10 11:11:09 2002 Owen Taylor <otaylor@redhat.com>
* gdk/linux-fb/*: Patch from Eric Warmonhoven to
get linux-fb compiling with multihead changes.
Tue Sep 10 09:29:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Take

View File

@ -28,6 +28,7 @@ libgdk_linux_fb_la_SOURCES = \
gdkcolor-fb.c \
gdkcursor-fb.c \
gdkdnd-fb.c \
gdkdisplay-fb.c \
gdkdrawable-fb2.c \
gdkfont-fb.c \
gdkgc-fb.c \
@ -40,6 +41,7 @@ libgdk_linux_fb_la_SOURCES = \
gdkpixmap-fb.c \
gdkproperty-fb.c \
gdkselection-fb.c \
gdkscreen-fb.c \
gdkvisual-fb.c \
gdkwindow-fb.c \
gdkprivate-fb.h \
@ -73,6 +75,8 @@ libgdk_linux_fb_la_SOURCES = \
gdkfbmanager.h
gdkfbmanager_sources = gdkfbmanager.c
gdkfbmanager_LDFLAGS = $(GLIB_LIBS)
gdkfbswitch_sources = gdkfbswitch.c
gdkfbswitch_LDFLAGS = $(GLIB_LIBS)
EXTRA_DIST=x-cursors.xbm

View File

@ -202,7 +202,7 @@ gdk_colormap_new (GdkVisual *visual,
}
GdkColormap*
gdk_colormap_get_system (void)
gdk_screen_get_system_colormap (GdkScreen *screen)
{
static GdkColormap *colormap = NULL;
@ -854,3 +854,11 @@ gdk_colormap_query_color (GdkColormap *colormap,
break;
}
}
GdkScreen*
gdk_colormap_get_screen (GdkColormap *cmap)
{
g_return_val_if_fail (cmap != NULL, NULL);
return gdk_screen_get_default ();
}

View File

@ -192,7 +192,8 @@ static struct {
};
GdkCursor*
gdk_cursor_new (GdkCursorType cursor_type)
gdk_cursor_new_for_display (GdkDisplay *display,
GdkCursorType cursor_type)
{
GdkCursor *cursor;
@ -528,3 +529,9 @@ gdk_fb_cursor_reset(void)
gdk_fb_mouse_get_info (&x, &y, NULL);
gdk_fb_cursor_move (x, y, win);
}
GdkDisplay *
gdk_cursor_get_display (GdkCursor *cursor)
{
return gdk_display_get_default ();
}

View File

@ -0,0 +1,77 @@
/* 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/.
*/
#include "gdk.h"
#include "gdkprivate-fb.h"
GdkDisplay *
gdk_display_open (const gchar *display_name)
{
if (_gdk_display != NULL)
return NULL; /* single display only */
_gdk_display = g_object_new (GDK_TYPE_DISPLAY, NULL);
_gdk_screen = g_object_new (GDK_TYPE_SCREEN, NULL);
_gdk_visual_init ();
gdk_screen_set_default_colormap (_gdk_screen,
gdk_screen_get_system_colormap (_gdk_screen));
_gdk_windowing_window_init ();
_gdk_windowing_image_init ();
_gdk_events_init ();
_gdk_input_init ();
_gdk_dnd_init ();
g_signal_emit_by_name (gdk_display_manager_get (),
"display_opened", _gdk_display);
return _gdk_display;
}
G_CONST_RETURN gchar *
gdk_display_get_name (GdkDisplay *display)
{
return gdk_get_display_arg_name ();
}
int
gdk_display_get_n_screens (GdkDisplay *display)
{
return 1;
}
GdkScreen *
gdk_display_get_screen (GdkDisplay *display,
gint screen_num)
{
return _gdk_screen;
}
GdkScreen *
gdk_display_get_default_screen (GdkDisplay *display)
{
return _gdk_screen;
}

View File

@ -86,6 +86,7 @@ static GdkColormap* gdk_fb_get_colormap (GdkDrawable *drawable);
static void gdk_fb_set_colormap (GdkDrawable *drawable,
GdkColormap *colormap);
static gint gdk_fb_get_depth (GdkDrawable *drawable);
static GdkScreen* gdk_fb_get_screen (GdkDrawable *drawable);
static GdkVisual* gdk_fb_get_visual (GdkDrawable *drawable);
static void gdk_fb_drawable_finalize (GObject *object);
@ -219,6 +220,7 @@ gdk_drawable_impl_fb_class_init (GdkDrawableFBClass *klass)
drawable_class->get_size = gdk_fb_get_size;
drawable_class->get_depth = gdk_fb_get_depth;
drawable_class->get_screen = gdk_fb_get_screen;
drawable_class->get_visual = gdk_fb_get_visual;
drawable_class->_copy_to_image = _gdk_fb_copy_to_image;
@ -1305,6 +1307,12 @@ gdk_fb_get_depth (GdkDrawable *drawable)
return GDK_DRAWABLE_FBDATA (drawable)->depth;
}
static GdkScreen*
gdk_fb_get_screen (GdkDrawable *drawable)
{
return gdk_screen_get_default();
}
static GdkVisual*
gdk_fb_get_visual (GdkDrawable *drawable)
{

View File

@ -87,16 +87,17 @@ _gdk_events_init (void)
gboolean
gdk_events_pending (void)
{
return _gdk_event_queue_find_first () ? TRUE : FALSE;
return fb_events_check (NULL);
}
GdkEvent*
gdk_event_get_graphics_expose (GdkWindow *window)
{
GdkDisplay *display = gdk_display_get_default ();
GList *ltmp;
g_return_val_if_fail (window != NULL, NULL);
for (ltmp = _gdk_queued_events; ltmp; ltmp = ltmp->next)
for (ltmp = display->queued_events; ltmp; ltmp = ltmp->next)
{
GdkEvent *event = ltmp->data;
if (event->type == GDK_EXPOSE &&
@ -108,7 +109,7 @@ gdk_event_get_graphics_expose (GdkWindow *window)
{
GdkEvent *retval = ltmp->data;
_gdk_event_queue_remove_link (ltmp);
_gdk_event_queue_remove_link (display, ltmp);
g_list_free_1 (ltmp);
return retval;
@ -118,7 +119,7 @@ gdk_event_get_graphics_expose (GdkWindow *window)
}
void
_gdk_events_queue (void)
_gdk_events_queue (GdkDisplay *display)
{
}
@ -138,7 +139,7 @@ fb_events_check (GSource *source)
GDK_THREADS_ENTER ();
retval = (_gdk_event_queue_find_first () != NULL);
retval = (_gdk_event_queue_find_first (gdk_display_get_default ()) != NULL);
GDK_THREADS_LEAVE ();
@ -154,7 +155,7 @@ fb_events_dispatch (GSource *source,
GDK_THREADS_ENTER ();
while ((event = _gdk_event_unqueue ()))
while ((event = _gdk_event_unqueue (gdk_display_get_default ())))
{
if (event->type == GDK_EXPOSE &&
event->expose.window == _gdk_parent_root)
@ -199,19 +200,28 @@ gdk_flush (void)
}
gboolean
gdk_event_send_client_message (GdkEvent *event, guint32 xid)
gdk_event_send_client_message_for_display (GdkDisplay *display,
GdkEvent *event,
guint32 xid)
{
return FALSE;
}
void
gdk_event_send_clientmessage_toall (GdkEvent *sev)
gdk_screen_broadcast_client_message (GdkScreen *screen,
GdkEvent *sev)
{
}
gboolean
gdk_setting_get (const gchar *name,
GValue *value)
gdk_screen_get_setting (GdkScreen *screen,
const gchar *name,
GValue *value)
{
return FALSE;
}
void
gdk_display_sync (GdkDisplay *display)
{
}

View File

@ -87,7 +87,8 @@ gdk_font_hash_lookup (GdkFontType type, const gchar *font_name)
}
GdkFont*
gdk_font_from_description (PangoFontDescription *desc)
gdk_font_from_description_for_display (GdkDisplay *display,
PangoFontDescription *desc)
{
GdkFont *font;
GdkFontPrivateFB *private;
@ -154,7 +155,8 @@ gdk_font_from_description (PangoFontDescription *desc)
GdkFont*
gdk_font_load (const gchar *font_name)
gdk_font_load_for_display (GdkDisplay *display,
const gchar *font_name)
{
GdkFont *font;
GdkFontPrivateFB *private;

View File

@ -35,6 +35,10 @@ gboolean _gdk_fb_pointer_grab_owner_events;
gboolean _gdk_fb_keyboard_grab_owner_events;
GdkEventMask _gdk_fb_pointer_grab_events, _gdk_fb_keyboard_grab_events;
GdkDisplay *_gdk_display = NULL;
GdkScreen *_gdk_screen = NULL;
GdkWindow *_gdk_parent_root = NULL;
GdkFBWindow *gdk_root_window = NULL;
GdkFBDisplay *gdk_display = NULL;
GdkCursor *_gdk_fb_pointer_grab_cursor;

View File

@ -105,7 +105,8 @@ gdk_image_get_type (void)
GdkImage*
_gdk_image_new_for_depth (GdkImageType type,
_gdk_image_new_for_depth (GdkScreen *screen,
GdkImageType type,
GdkVisual *visual,
gint width,
gint height,
@ -170,15 +171,6 @@ gdk_image_new_bitmap(GdkVisual *visual,
return image;
}
GdkImage*
gdk_image_new (GdkImageType type,
GdkVisual *visual,
gint width,
gint height)
{
return _gdk_image_new_for_depth (type, visual, width, height, -1);
}
GdkImage*
_gdk_fb_copy_to_image (GdkDrawable *drawable,
GdkImage *image,
@ -343,7 +335,8 @@ _gdk_image_exit(void)
/* copy/pasted from gdkimage-win32.c */
gint
_gdk_windowing_get_bits_for_depth (gint depth)
_gdk_windowing_get_bits_for_depth (GdkDisplay *display,
gint depth)
{
if ((1 == depth) || (8 == depth) || (16 == depth) ||
(24 == depth) || (32 == depth))

View File

@ -126,6 +126,7 @@ struct _GdkInputWindow
/* Global data */
extern const GdkDevice gdk_input_core_info;
extern GdkDevice *_gdk_core_pointer;
extern GList *_gdk_input_devices;
extern GList *_gdk_input_windows;

View File

@ -147,7 +147,7 @@ static GdkFBKeyboardDevice keyb_devs[] =
};
GdkKeymap*
gdk_keymap_get_default (void)
gdk_keymap_get_default_for_display (GdkDisplay *display)
{
if (default_keymap == NULL)
default_keymap = g_object_new (gdk_keymap_get_type (), NULL);
@ -155,6 +155,12 @@ gdk_keymap_get_default (void)
return default_keymap;
}
GdkKeymap*
gdk_keymap_get_for_display (GdkDisplay *display)
{
return gdk_keymap_get_default_for_display (display);
}
PangoDirection
gdk_keymap_get_direction (GdkKeymap *keymap)
{
@ -873,8 +879,8 @@ xlate_io (GIOChannel *gioc,
}
static gboolean
write_string (gint fd,
gchar *str)
write_string (gint fd,
const gchar *str)
{
gsize to_write = strlen (str);
@ -972,8 +978,8 @@ xlate_get_for_keyval (GdkFBKeyboard *kb,
gint *n_keys)
{
g_warning ("xlate_get_for_keyval() NIY");
*keys=NULL;
*n_keys=0;
if (keys) *keys=NULL;
if (n_keys) *n_keys=0;
return FALSE;
}
@ -985,8 +991,8 @@ xlate_get_for_keycode (GdkFBKeyboard *kb,
gint *n_entries)
{
g_warning ("xlate_get_for_keycode() NIY");
*keys=NULL;
*n_entries=0;
if (keys) *keys=NULL;
if (n_entries) *n_entries=0;
return FALSE;
}
@ -1487,8 +1493,8 @@ raw_get_for_keyval (GdkFBKeyboard *kb,
gint *n_keys)
{
g_warning ("raw_get_for_keyval() NIY");
*keys=NULL;
*n_keys=0;
if (keys) *keys=NULL;
if (n_keys) *n_keys=0;
return FALSE;
}
@ -1500,7 +1506,7 @@ raw_get_for_keycode (GdkFBKeyboard *kb,
gint *n_entries)
{
g_warning ("raw_get_for_keycode() NIY");
*keys=NULL;
*n_entries=0;
if (keys) *keys=NULL;
if (n_entries) *n_entries=0;
return FALSE;
}

View File

@ -799,11 +799,11 @@ gdk_fb_display_destroy (GdkFBDisplay *display)
g_free (display);
}
gboolean
_gdk_windowing_init_check (int argc, char **argv)
void
_gdk_windowing_init (int *argc, char ***argv)
{
if (gdk_initialized)
return TRUE;
return;
/* Create new session and become session leader */
setsid();
@ -811,7 +811,7 @@ _gdk_windowing_init_check (int argc, char **argv)
gdk_display = gdk_fb_display_new ();
if (!gdk_display)
return FALSE;
return;
gdk_shadow_fb_init ();
@ -822,7 +822,7 @@ _gdk_windowing_init_check (int argc, char **argv)
g_warning ("Failed to initialize keyboard");
gdk_fb_display_destroy (gdk_display);
gdk_display = NULL;
return FALSE;
return;
}
if (!gdk_fb_mouse_init (!gdk_display->manager_blocked))
@ -831,15 +831,18 @@ _gdk_windowing_init_check (int argc, char **argv)
gdk_fb_keyboard_close ();
gdk_fb_display_destroy (gdk_display);
gdk_display = NULL;
return FALSE;
return;
}
gdk_initialized = TRUE;
_gdk_selection_property = gdk_atom_intern ("GDK_SELECTION", FALSE);
return TRUE;
}
void
_gdk_windowing_set_default_display (GdkDisplay *display)
{
}
/*
@ -933,7 +936,7 @@ gdk_fb_pointer_grab (GdkWindow * window,
/*
*--------------------------------------------------------------
* gdk_pointer_ungrab
* gdk_display_pointer_ungrab
*
* Releases any pointer grab
*
@ -947,7 +950,8 @@ gdk_fb_pointer_grab (GdkWindow * window,
*/
void
gdk_pointer_ungrab (guint32 time)
gdk_display_pointer_ungrab (GdkDisplay *display,
guint32 time)
{
gdk_fb_pointer_ungrab (time, FALSE);
}
@ -993,7 +997,7 @@ gdk_fb_pointer_ungrab (guint32 time, gboolean implicit_grab)
/*
*--------------------------------------------------------------
* gdk_pointer_is_grabbed
* gdk_display_pointer_is_grabbed
*
* Tell wether there is an active x pointer grab in effect
*
@ -1007,7 +1011,7 @@ gdk_fb_pointer_ungrab (guint32 time, gboolean implicit_grab)
*/
gint
gdk_pointer_is_grabbed (void)
gdk_display_pointer_is_grabbed (GdkDisplay *display)
{
return _gdk_fb_pointer_grab_window != NULL;
}
@ -1033,9 +1037,9 @@ gdk_pointer_is_grabbed (void)
*/
GdkGrabStatus
gdk_keyboard_grab (GdkWindow * window,
gint owner_events,
guint32 time)
gdk_keyboard_grab (GdkWindow *window,
gint owner_events,
guint32 time)
{
g_return_val_if_fail (window != NULL, 0);
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
@ -1051,7 +1055,7 @@ gdk_keyboard_grab (GdkWindow * window,
/*
*--------------------------------------------------------------
* gdk_keyboard_ungrab
* gdk_display_keyboard_ungrab
*
* Releases any keyboard grab
*
@ -1065,7 +1069,8 @@ gdk_keyboard_grab (GdkWindow * window,
*/
void
gdk_keyboard_ungrab (guint32 time)
gdk_display_keyboard_ungrab (GdkDisplay *display,
guint32 time)
{
if (_gdk_fb_keyboard_grab_window)
gdk_window_unref (_gdk_fb_keyboard_grab_window);
@ -1073,7 +1078,8 @@ gdk_keyboard_ungrab (guint32 time)
}
gboolean
gdk_pointer_grab_info_libgtk_only (GdkWindow **grab_window,
gdk_pointer_grab_info_libgtk_only (GdkDisplay *display,
GdkWindow **grab_window,
gboolean *owner_events)
{
if (_gdk_fb_pointer_grab_window)
@ -1090,8 +1096,9 @@ gdk_pointer_grab_info_libgtk_only (GdkWindow **grab_window,
}
gboolean
gdk_keyboard_grab_info_libgtk_only (GdkWindow **grab_window,
gboolean *owner_events)
gdk_keyboard_grab_info_libgtk_only (GdkDisplay *display,
GdkWindow **grab_window,
gboolean *owner_events)
{
if (_gdk_fb_keyboard_grab_window)
{
@ -1109,7 +1116,7 @@ gdk_keyboard_grab_info_libgtk_only (GdkWindow **grab_window,
/*
*--------------------------------------------------------------
* gdk_screen_width
* gdk_screen_get_width
*
* Return the width of the screen.
*
@ -1123,14 +1130,14 @@ gdk_keyboard_grab_info_libgtk_only (GdkWindow **grab_window,
*/
gint
gdk_screen_width (void)
gdk_screen_get_width (GdkScreen *screen)
{
return gdk_display->fb_width;
}
/*
*--------------------------------------------------------------
* gdk_screen_height
* gdk_screen_get_height
*
* Return the height of the screen.
*
@ -1144,14 +1151,14 @@ gdk_screen_width (void)
*/
gint
gdk_screen_height (void)
gdk_screen_get_height (GdkScreen *screen)
{
return gdk_display->fb_height;
}
/*
*--------------------------------------------------------------
* gdk_screen_width_mm
* gdk_screen_get_width_mm
*
* Return the width of the screen in millimeters.
*
@ -1165,14 +1172,14 @@ gdk_screen_height (void)
*/
gint
gdk_screen_width_mm (void)
gdk_screen_get_width_mm (GdkScreen *screen)
{
return 0.5 + gdk_screen_width () * (25.4 / 72.);
}
/*
*--------------------------------------------------------------
* gdk_screen_height
* gdk_screen_get_height_mm
*
* Return the height of the screen in millimeters.
*
@ -1186,14 +1193,14 @@ gdk_screen_width_mm (void)
*/
gint
gdk_screen_height_mm (void)
gdk_screen_get_height_mm (GdkScreen *screen)
{
return 0.5 + gdk_screen_height () * (25.4 / 72.);
}
/*
*--------------------------------------------------------------
* gdk_set_sm_client_id
* gdk_display_set_sm_client_id
*
* Set the SM_CLIENT_ID property on the WM_CLIENT_LEADER window
* so that the window manager can save our state using the
@ -1214,11 +1221,11 @@ gdk_screen_height_mm (void)
*/
void
gdk_set_sm_client_id (const gchar* sm_client_id)
gdk_display_set_sm_client_id (GdkDisplay* display,
const gchar* sm_client_id)
{
}
extern void keyboard_shutdown(void);
void
@ -1260,9 +1267,8 @@ gdk_get_display(void)
return g_strdup (s);
}
void
gdk_beep (void)
gdk_display_beep (GdkDisplay *display)
{
static int pitch = 600, duration = 100;
gulong arg;
@ -1326,7 +1332,7 @@ gdk_fb_other_event_window (GdkWindow *window,
(g_object_get_data (G_OBJECT (w), "gdk-window-child-handler")))
break;
evmask = GDK_WINDOW_IMPL_FBDATA(window)->event_mask;
evmask = GDK_WINDOW_OBJECT(window)->event_mask;
if (evmask & type_masks[type])
return w;
@ -1375,7 +1381,7 @@ gdk_fb_pointer_event_window (GdkWindow *window,
(g_object_get_data (G_OBJECT (w), "gdk-window-child-handler")))
break;
evmask = GDK_WINDOW_IMPL_FBDATA(window)->event_mask;
evmask = GDK_WINDOW_OBJECT(window)->event_mask;
if (evmask & (GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK | GDK_BUTTON3_MOTION_MASK))
{
@ -1433,7 +1439,7 @@ gdk_fb_keyboard_event_window (GdkWindow *window,
(g_object_get_data (G_OBJECT (w), "gdk-window-child-handler")))
break;
evmask = GDK_WINDOW_IMPL_FBDATA(window)->event_mask;
evmask = GDK_WINDOW_OBJECT(window)->event_mask;
if (evmask & type_masks[type])
return w;
@ -1523,7 +1529,7 @@ gdk_event_make (GdkWindow *window,
}
if (append_to_queue)
_gdk_event_queue_append (event);
_gdk_event_queue_append (gdk_display_get_default (), event);
return event;
}

View File

@ -20,6 +20,7 @@
#include <gdk/gdk.h>
#include <gdk/gdkinternals.h>
#include "gdkprivate-fb.h"
#include "gdkinputprivate.h"
#include <stdlib.h>
#include <sys/types.h>
#include <fcntl.h>
@ -183,11 +184,11 @@ send_button_event (GdkFBMouse *mouse,
event->button.x_root = mouse->x;
event->button.y_root = mouse->y;
_gdk_event_queue_append (event);
_gdk_event_queue_append (gdk_display_get_default (), event);
/* For double-clicks */
if (press_event)
_gdk_event_button_generate (event);
_gdk_event_button_generate (gdk_display_get_default (), event);
}
nbuttons = 0;

View File

@ -5,7 +5,7 @@
#include <pango/pangoft2.h>
PangoContext *
gdk_pango_context_get (void)
gdk_pango_context_get_for_screen (GdkScreen *screen)
{
return pango_ft2_get_context (75.0, 75.0);
}

View File

@ -119,7 +119,6 @@ struct _GdkWindowFBData
GdkRegion *shape; /* Can also be GDK_FB_USE_CHILD_SHAPE */
GdkEventMask event_mask;
gboolean realized : 1;
};
@ -426,6 +425,8 @@ extern GdkEventMask _gdk_fb_keyboard_grab_events;
extern gboolean _gdk_fb_keyboard_grab_owner_events;
extern GdkFBDisplay *gdk_display;
extern GdkDisplay *_gdk_display;
extern GdkScreen *_gdk_screen;
extern FILE *debug_out;
GdkEvent *gdk_event_make(GdkWindow *window,
GdkEventType type,

View File

@ -0,0 +1,80 @@
/* 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/.
*/
#include "gdk.h"
#include "gdkprivate-fb.h"
static GdkColormap *default_colormap = NULL;
GdkDisplay *
gdk_screen_get_display (GdkScreen *screen)
{
return _gdk_display;
}
GdkWindow *
gdk_screen_get_root_window (GdkScreen *screen)
{
return _gdk_parent_root;
}
GdkColormap*
gdk_screen_get_default_colormap (GdkScreen *screen)
{
return default_colormap;
}
void
gdk_screen_set_default_colormap (GdkScreen *screen,
GdkColormap *colormap)
{
default_colormap = colormap;
}
int
gdk_screen_get_n_monitors (GdkScreen *screen)
{
return 1;
}
void
gdk_screen_get_monitor_geometry (GdkScreen *screen,
gint num_monitor,
GdkRectangle *dest)
{
dest->x = 0;
dest->y = 0;
dest->width = gdk_screen_width ();
dest->height = gdk_screen_height ();
}
gint
gdk_screen_get_number (GdkScreen *screen)
{
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
return 0;
}

View File

@ -65,10 +65,11 @@ _gdk_selection_window_destroyed (GdkWindow *window)
}
gint
gdk_selection_owner_set (GdkWindow *owner,
GdkAtom selection,
guint32 time,
gint send_event)
gdk_selection_owner_set_for_display (GdkDisplay *display,
GdkWindow *owner,
GdkAtom selection,
guint32 time,
gint send_event)
{
GSList *tmp_list;
OwnerInfo *info;
@ -99,7 +100,8 @@ gdk_selection_owner_set (GdkWindow *owner,
}
GdkWindow*
gdk_selection_owner_get (GdkAtom selection)
gdk_selection_owner_get_for_display (GdkDisplay *display,
GdkAtom selection)
{
OwnerInfo *info;
GSList *tmp_list;
@ -204,11 +206,12 @@ gdk_selection_property_get (GdkWindow *requestor,
void
gdk_selection_send_notify (guint32 requestor,
GdkAtom selection,
GdkAtom target,
GdkAtom property,
guint32 time)
gdk_selection_send_notify_for_display (GdkDisplay *display,
guint32 requestor,
GdkAtom selection,
GdkAtom target,
GdkAtom property,
guint32 time)
{
GdkEvent *event;
GdkWindow *event_window;
@ -225,9 +228,12 @@ gdk_selection_send_notify (guint32 requestor,
}
gint
gdk_text_property_to_text_list (GdkAtom encoding, gint format,
const guchar *text, gint length,
gchar ***list)
gdk_text_property_to_text_list_for_display (GdkDisplay *display,
GdkAtom encoding,
gint format,
const guchar *text,
gint length,
gchar ***list)
{
g_warning ("gdk_text_property_to_text_list() not implemented\n");
return 0;
@ -241,9 +247,12 @@ gdk_free_text_list (gchar **list)
}
gint
gdk_string_to_compound_text (const gchar *str,
GdkAtom *encoding, gint *format,
guchar **ctext, gint *length)
gdk_string_to_compound_text_for_display (GdkDisplay *display,
const gchar *str,
GdkAtom *encoding,
gint *format,
guchar **ctext,
gint *length)
{
g_warning ("gdk_string_to_compound_text() not implemented\n");
return 0;
@ -275,7 +284,7 @@ gdk_utf8_to_string_target (const gchar *str)
}
/**
* gdk_utf8_to_compound_text:
* gdk_utf8_to_compound_text_for_display:
* @str: a UTF-8 string
* @encoding: location to store resulting encoding
* @format: location to store format of the result
@ -289,11 +298,12 @@ gdk_utf8_to_string_target (const gchar *str)
* false.
**/
gboolean
gdk_utf8_to_compound_text (const gchar *str,
GdkAtom *encoding,
gint *format,
guchar **ctext,
gint *length)
gdk_utf8_to_compound_text_for_display (GdkDisplay *display,
const gchar *str,
GdkAtom *encoding,
gint *format,
guchar **ctext,
gint *length)
{
g_warning ("gdk_utf8_to_compound_text() not implemented\n");
return 0;
@ -370,7 +380,7 @@ make_list (const gchar *text,
/**
* gdk_text_property_to_utf8_list:
* gdk_text_property_to_utf8_list_for_display:
* @encoding: an atom representing the encoding of the text
* @format: the format of the property
* @text: the text to convert
@ -385,11 +395,12 @@ make_list (const gchar *text,
* list.
**/
gint
gdk_text_property_to_utf8_list (GdkAtom encoding,
gint format,
const guchar *text,
gint length,
gchar ***list)
gdk_text_property_to_utf8_list_for_display (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);

View File

@ -155,7 +155,7 @@ gdk_visual_get_best_type (void)
}
GdkVisual*
gdk_visual_get_system (void)
gdk_screen_get_system_visual (GdkScreen *screen)
{
return system_visual;
}
@ -214,7 +214,15 @@ gdk_query_visual_types (GdkVisualType **visual_types,
}
GList*
gdk_list_visuals (void)
gdk_screen_list_visuals (GdkScreen *screen)
{
return g_list_append (NULL, gdk_visual_get_system ());
}
GdkScreen *
gdk_visual_get_screen (GdkVisual *visual)
{
g_return_val_if_fail (GDK_IS_VISUAL (visual), NULL);
return gdk_screen_get_default ();
}

View File

@ -96,7 +96,6 @@ gdk_window_impl_fb_init (GdkWindowFBData *impl)
{
impl->drawable_data.depth = gdk_display->modeinfo.bits_per_pixel;
impl->drawable_data.colormap = gdk_colormap_get_system ();
impl->event_mask = GDK_STRUCTURE_MASK;
impl->shape = NULL;
}
@ -1734,7 +1733,7 @@ gdk_window_get_events (GdkWindow *window)
if (GDK_WINDOW_DESTROYED (window))
return 0;
else
return GDK_WINDOW_IMPL_FBDATA (window)->event_mask;
return GDK_WINDOW_OBJECT (window)->event_mask;
}
void
@ -1750,10 +1749,7 @@ gdk_window_set_events (GdkWindow *window,
GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK |
GDK_BUTTON3_MOTION_MASK;
if (!GDK_WINDOW_DESTROYED (window))
GDK_WINDOW_IMPL_FBDATA (window)->event_mask = event_mask;
GDK_WINDOW_OBJECT (window)->event_mask = event_mask;
GDK_WINDOW_OBJECT (window)->event_mask = GDK_STRUCTURE_MASK | event_mask;
}
void
@ -2252,7 +2248,8 @@ gdk_window_get_frame_extents (GdkWindow *window,
}
GdkWindow*
gdk_window_foreign_new (GdkNativeWindow anid)
gdk_window_foreign_new_for_display (GdkDisplay *display,
GdkNativeWindow anid)
{
return (GdkWindow*) gdk_drawable_ref (anid);
}
@ -2263,3 +2260,10 @@ gdk_window_lookup (GdkNativeWindow anid)
return (GdkWindow*) (anid);
}
GdkWindow *
gdk_window_lookup_for_display (GdkDisplay *display, GdkNativeWindow anid)
{
g_return_val_if_fail (display == gdk_display_get_default(), NULL);
return (GdkWindow*) (anid);
}