2008-07-01 22:57:50 +00:00
|
|
|
|
/* GDK - The GIMP Drawing Kit
|
2007-07-19 23:50:39 +00:00
|
|
|
|
* Copyright (C) 1995-2007 Peter Mattis, Spencer Kimball,
|
|
|
|
|
* Josh MacDonald, Ryan Lortie
|
1997-11-24 22:37:52 +00:00
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1997-11-24 22:37:52 +00:00
|
|
|
|
* 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
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* Lesser General Public License for more details.
|
1997-11-24 22:37:52 +00:00
|
|
|
|
*
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
1997-11-24 22:37:52 +00:00
|
|
|
|
*/
|
1998-03-17 07:54:57 +00:00
|
|
|
|
|
1999-02-24 07:37:18 +00:00
|
|
|
|
/*
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
1999-02-24 07:37:18 +00:00
|
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
|
* files for a list of changes. These files are distributed with
|
2009-06-01 10:04:36 +00:00
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
1999-02-24 07:37:18 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2010-05-14 15:23:33 +00:00
|
|
|
|
#include "config.h"
|
|
|
|
|
|
2010-10-14 11:25:23 +00:00
|
|
|
|
#include <cairo-gobject.h>
|
|
|
|
|
|
2018-03-20 10:46:11 +00:00
|
|
|
|
#include "gdksurface.h"
|
2010-05-14 15:23:33 +00:00
|
|
|
|
|
2010-10-15 02:05:51 +00:00
|
|
|
|
#include "gdkrectangle.h"
|
2010-05-14 15:23:33 +00:00
|
|
|
|
#include "gdkinternals.h"
|
|
|
|
|
#include "gdkintl.h"
|
2010-12-16 03:09:35 +00:00
|
|
|
|
#include "gdkdisplayprivate.h"
|
2010-05-25 22:38:44 +00:00
|
|
|
|
#include "gdkdeviceprivate.h"
|
2018-03-28 22:07:52 +00:00
|
|
|
|
#include "gdkframeclockidleprivate.h"
|
2010-05-14 15:23:33 +00:00
|
|
|
|
#include "gdkmarshalers.h"
|
2018-03-20 10:46:11 +00:00
|
|
|
|
#include "gdksurfaceimpl.h"
|
2014-10-09 08:45:44 +00:00
|
|
|
|
#include "gdkglcontextprivate.h"
|
2014-11-07 14:27:56 +00:00
|
|
|
|
#include "gdk-private.h"
|
2010-05-14 15:23:33 +00:00
|
|
|
|
|
2010-10-15 02:05:51 +00:00
|
|
|
|
#include <math.h>
|
|
|
|
|
|
2014-10-09 08:45:44 +00:00
|
|
|
|
#include <epoxy/gl.h>
|
|
|
|
|
|
2013-02-21 07:54:18 +00:00
|
|
|
|
/* for the use of round() */
|
|
|
|
|
#include "fallback-c89.c"
|
|
|
|
|
|
2014-08-21 15:26:18 +00:00
|
|
|
|
#ifdef GDK_WINDOWING_WAYLAND
|
|
|
|
|
#include "wayland/gdkwayland.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
#undef DEBUG_SURFACE_PRINTING
|
2010-05-14 15:23:33 +00:00
|
|
|
|
|
|
|
|
|
|
2010-05-13 02:51:37 +00:00
|
|
|
|
/**
|
2018-04-28 20:23:32 +00:00
|
|
|
|
* SECTION:gdksurface
|
2010-05-13 02:51:37 +00:00
|
|
|
|
* @Short_description: Onscreen display areas in the target window system
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @Title: Surfaces
|
2010-05-13 02:51:37 +00:00
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* A #GdkSurface is a (usually) rectangular region on the screen.
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* It’s a low-level object, used to implement high-level objects such as
|
2011-02-09 07:43:07 +00:00
|
|
|
|
* #GtkWidget and #GtkWindow on the GTK+ level. A #GtkWindow is a toplevel
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* surface, the thing a user might think of as a “window” with a titlebar
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* and so on; a #GtkWindow may contain many sub-GdkSurfaces.
|
2010-05-13 02:51:37 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2017-12-26 19:39:24 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* GdkSurface:
|
2017-12-26 19:39:24 +00:00
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* The GdkSurface struct contains only private fields and
|
2017-12-26 19:39:24 +00:00
|
|
|
|
* should not be accessed directly.
|
|
|
|
|
*/
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
/* Historically a GdkSurface always matches a platform native window,
|
2009-06-01 11:38:04 +00:00
|
|
|
|
* be it a toplevel window or a child window. In this setup the
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* GdkSurface (and other GdkDrawables) were platform independent classes,
|
2009-06-01 11:38:04 +00:00
|
|
|
|
* and the actual platform specific implementation was in a delegate
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* object available as “impl” in the surface object.
|
2008-07-18 13:03:42 +00:00
|
|
|
|
*
|
2016-10-25 07:54:37 +00:00
|
|
|
|
* With the addition of client side windows this changes a bit. The
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* application-visible GdkSurface object behaves as it did before, but
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* such surfaces now don't a corresponding native window. Instead subwindows
|
|
|
|
|
* surfaces are “client side”, i.e. emulated by the gdk code such
|
2016-12-15 16:53:08 +00:00
|
|
|
|
* that clipping, drawing, moving, events etc work as expected.
|
2009-06-01 11:38:04 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* GdkSurfaces have a pointer to the “impl surface” they are in, i.e.
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* the topmost GdkSurface which have the same “impl” value. This is stored
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* in impl_surface, which is different from the surface itself only for client
|
|
|
|
|
* side surfaces.
|
|
|
|
|
* All GdkSurfaces (native or not) track the position of the surface in the parent
|
|
|
|
|
* (x, y), the size of the surface (width, height), the position of the surface
|
|
|
|
|
* with respect to the impl surface (abs_x, abs_y). We also track the clip
|
|
|
|
|
* region of the surface wrt parent surfaces, in surface-relative coordinates (clip_region).
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*/
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
|
|
2009-06-04 18:15:29 +00:00
|
|
|
|
enum {
|
2016-06-15 15:00:38 +00:00
|
|
|
|
MOVED_TO_RECT,
|
2009-06-04 18:15:29 +00:00
|
|
|
|
LAST_SIGNAL
|
|
|
|
|
};
|
|
|
|
|
|
2009-07-16 06:16:01 +00:00
|
|
|
|
enum {
|
|
|
|
|
PROP_0,
|
2015-09-06 19:02:34 +00:00
|
|
|
|
PROP_CURSOR,
|
2016-10-27 13:38:41 +00:00
|
|
|
|
PROP_DISPLAY,
|
2017-12-14 23:51:38 +00:00
|
|
|
|
PROP_STATE,
|
2015-09-06 19:02:34 +00:00
|
|
|
|
LAST_PROP
|
2009-07-16 06:16:01 +00:00
|
|
|
|
};
|
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
|
/* Global info */
|
Bug 318807 – Offscreen windows and window redirection.
2008-03-18 10:49:20 Tim Janik <timj@imendio.com>
* Applied pixmap redirection patch by Alexander Larsson with
various updates from:
Bug 318807 – Offscreen windows and window redirection.
Updates:
* updated docs to mention "Since 2.16".
* tests/testgtk.c: fixed snapshooting pixmap leak.
convert pixmap to pixbuf after snapshooting, to compensate for different
bit depths (occurs when snapshooting ARGB visuals and displaying the
pixmap in an RGB visual).
* gdk/gdkwindow.[hc]: made GdkWindowRedirect private.
* gdk/gdkwindow.c: removed damage idle handler, there's no aparent
need for it. enqueue damage notification as GDK_DAMAGE events
for each painting redirection at the start of the event queue.
consider windows with a redirection fully visible when invalidating,
and when updating from backing store. cleaned up stale variables.
* gdk/gdkevents.c: added _gdk_event_queue_prepend().
* gtk/gtkwidget.c: fixed coordinates for !NO_WINDOW widgets in
gtk_widget_get_snapshot; this fixes garbage snap offsets for gammacurve,
tree, drawingarea, text, handlebox, etc.
clip the redirected window hierarchy to window sizes, the visible
rectangles don't need to be taken into account here.
extended snapshooting docs to recommend gdk_pixbuf_get_from_drawable()
in case pixmap visuals could mismatch.
* gdk/x11/gdkwindow-x11.c: removed _gdk_windowing_window_get_visible_rect().
Base patch:
* tests/testgtk.c: add a "Snapshot" test to demonstrate snapshooting
of possibly obscured widgets into an offscreen pixmap.
* gtk/gtkwidget.[hc]: add GtkWidget::damage-event signal, add
gtk_widget_get_snapshot() to render a widget's contents to a GdkPixmap.
* gtk/gtkmain.c: dispatch GDK_DAMAGE events.
* gdk/gdkwindow.c: moved outer gdk_window_new() and gdk_window_reparent()
implementations here, adapted them to propagate redirects to child windows.
gdk_window_end_paint(): copy repainted window contents to redirection pixmap,
clipped to visible region. queue GDK_DAMAGE event delivery.
gdk_window_redirect_to_drawable(): install window painting redirection.
gdk_window_remove_redirection(): remove previously installed redirection.
* gdk/x11/gdkwindow-x11.c: added _gdk_windowing_window_get_visible_rect(),
renamed _gdk_window_new() and _gdk_window_reparent().
* gdk/gdkwindow.h: added GdkWindowRedirect* to GdkWindowObject, export
gdk_window_redirect_to_drawable() and gdk_window_remove_redirection().
* gdk/gdkevents.h: added GDK_DAMAGE event type.
* gdk/gdkevents.c: extract time and state from GDK_DAMAGE events.
* gdk/gdkinternals.h: added internal prototypes.
svn path=/trunk/; revision=20122
2008-05-21 19:04:24 +00:00
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
static void gdk_surface_finalize (GObject *object);
|
2009-07-16 06:16:01 +00:00
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
static void gdk_surface_set_property (GObject *object,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
guint prop_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
2018-03-20 10:40:08 +00:00
|
|
|
|
static void gdk_surface_get_property (GObject *object,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
guint prop_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
2009-07-16 06:16:01 +00:00
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
static void recompute_visible_regions (GdkSurface *private,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gboolean recalculate_children);
|
2018-03-20 10:40:08 +00:00
|
|
|
|
static void gdk_surface_invalidate_in_parent (GdkSurface *private);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
static void update_cursor (GdkDisplay *display,
|
|
|
|
|
GdkDevice *device);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
static void gdk_surface_set_frame_clock (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkFrameClock *clock);
|
2012-10-03 22:34:01 +00:00
|
|
|
|
|
2014-10-09 08:45:44 +00:00
|
|
|
|
|
2009-06-04 18:15:29 +00:00
|
|
|
|
static guint signals[LAST_SIGNAL] = { 0 };
|
2015-09-06 19:02:34 +00:00
|
|
|
|
static GParamSpec *properties[LAST_PROP] = { NULL, };
|
2006-05-31 03:34:04 +00:00
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
G_DEFINE_ABSTRACT_TYPE (GdkSurface, gdk_surface, G_TYPE_OBJECT)
|
1999-10-03 22:12:41 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
#ifdef DEBUG_SURFACE_PRINTING
|
2012-08-23 09:59:00 +00:00
|
|
|
|
char *
|
|
|
|
|
print_region (cairo_region_t *region)
|
|
|
|
|
{
|
|
|
|
|
GString *s = g_string_new ("{");
|
|
|
|
|
if (cairo_region_is_empty (region))
|
|
|
|
|
{
|
|
|
|
|
g_string_append (s, "empty");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
int num = cairo_region_num_rectangles (region);
|
|
|
|
|
cairo_rectangle_int_t r;
|
|
|
|
|
|
|
|
|
|
if (num == 1)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
{
|
|
|
|
|
cairo_region_get_rectangle (region, 0, &r);
|
|
|
|
|
g_string_append_printf (s, "%dx%d @%d,%d", r.width, r.height, r.x, r.y);
|
|
|
|
|
}
|
2012-08-23 09:59:00 +00:00
|
|
|
|
else
|
2018-03-21 08:06:31 +00:00
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
cairo_region_get_extents (region, &r);
|
|
|
|
|
g_string_append_printf (s, "extent: %dx%d @%d,%d, details: ", r.width, r.height, r.x, r.y);
|
|
|
|
|
for (i = 0; i < num; i++)
|
|
|
|
|
{
|
2013-05-15 08:55:14 +00:00
|
|
|
|
cairo_region_get_rectangle (region, i, &r);
|
2018-03-21 08:06:31 +00:00
|
|
|
|
g_string_append_printf (s, "[%dx%d @%d,%d]", r.width, r.height, r.x, r.y);
|
|
|
|
|
if (i != num -1)
|
|
|
|
|
g_string_append (s, ", ");
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-08-23 09:59:00 +00:00
|
|
|
|
}
|
|
|
|
|
g_string_append (s, "}");
|
|
|
|
|
return g_string_free (s, FALSE);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2015-09-10 10:57:16 +00:00
|
|
|
|
static GList *
|
|
|
|
|
list_insert_link_before (GList *list,
|
|
|
|
|
GList *sibling,
|
|
|
|
|
GList *link)
|
|
|
|
|
{
|
|
|
|
|
if (list == NULL || sibling == list)
|
|
|
|
|
{
|
|
|
|
|
link->prev = NULL;
|
|
|
|
|
link->next = list;
|
|
|
|
|
if (list)
|
|
|
|
|
list->prev = link;
|
|
|
|
|
return link;
|
|
|
|
|
}
|
|
|
|
|
else if (sibling == NULL)
|
|
|
|
|
{
|
|
|
|
|
GList *last = g_list_last (list);
|
|
|
|
|
|
|
|
|
|
last->next = link;
|
|
|
|
|
link->prev = last;
|
|
|
|
|
link->next = NULL;
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
link->next = sibling;
|
|
|
|
|
link->prev = sibling->prev;
|
|
|
|
|
sibling->prev = link;
|
|
|
|
|
|
2015-09-21 14:58:41 +00:00
|
|
|
|
if (link->prev)
|
|
|
|
|
link->prev->next = link;
|
|
|
|
|
|
2015-09-10 10:57:16 +00:00
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
static void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_init (GdkSurface *surface)
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
{
|
|
|
|
|
/* 0-initialization is good for all other fields. */
|
1998-03-07 18:38:18 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->surface_type = GDK_SURFACE_CHILD;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->state = GDK_SURFACE_STATE_WITHDRAWN;
|
|
|
|
|
surface->fullscreen_mode = GDK_FULLSCREEN_ON_CURRENT_MONITOR;
|
|
|
|
|
surface->width = 1;
|
|
|
|
|
surface->height = 1;
|
|
|
|
|
surface->children_list_node.data = surface;
|
2011-05-03 22:01:10 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->device_cursor = g_hash_table_new_full (NULL, NULL,
|
2011-05-03 22:01:10 +00:00
|
|
|
|
NULL, g_object_unref);
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
}
|
1999-01-17 22:58:59 +00:00
|
|
|
|
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
static void
|
2018-03-20 10:40:08 +00:00
|
|
|
|
gdk_surface_class_init (GdkSurfaceClass *klass)
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
{
|
|
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
object_class->finalize = gdk_surface_finalize;
|
|
|
|
|
object_class->set_property = gdk_surface_set_property;
|
|
|
|
|
object_class->get_property = gdk_surface_get_property;
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
|
2009-07-16 06:16:01 +00:00
|
|
|
|
/* Properties */
|
2009-12-20 20:39:42 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* GdkSurface:cursor:
|
2009-12-20 20:39:42 +00:00
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* The mouse pointer for a #GdkSurface. See gdk_surface_set_cursor() and
|
|
|
|
|
* gdk_surface_get_cursor() for details.
|
2009-12-20 20:39:42 +00:00
|
|
|
|
*/
|
2015-09-06 19:02:34 +00:00
|
|
|
|
properties[PROP_CURSOR] =
|
|
|
|
|
g_param_spec_object ("cursor",
|
|
|
|
|
P_("Cursor"),
|
|
|
|
|
P_("Cursor"),
|
|
|
|
|
GDK_TYPE_CURSOR,
|
2017-11-18 02:38:08 +00:00
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
2016-10-27 13:38:41 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* GdkSurface:display:
|
2016-10-27 13:38:41 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* The #GdkDisplay connection of the surface. See gdk_surface_get_display()
|
2016-10-27 13:38:41 +00:00
|
|
|
|
* for details.
|
|
|
|
|
*/
|
|
|
|
|
properties[PROP_DISPLAY] =
|
|
|
|
|
g_param_spec_object ("display",
|
|
|
|
|
P_("Display"),
|
|
|
|
|
P_("Display"),
|
|
|
|
|
GDK_TYPE_DISPLAY,
|
2017-11-18 02:38:08 +00:00
|
|
|
|
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
|
2016-10-27 13:38:41 +00:00
|
|
|
|
|
2017-12-14 23:51:38 +00:00
|
|
|
|
properties[PROP_STATE] =
|
|
|
|
|
g_param_spec_flags ("state",
|
|
|
|
|
P_("State"),
|
|
|
|
|
P_("State"),
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GDK_TYPE_SURFACE_STATE, GDK_SURFACE_STATE_WITHDRAWN,
|
2017-12-14 23:51:38 +00:00
|
|
|
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
|
|
|
|
|
2015-09-06 19:02:34 +00:00
|
|
|
|
g_object_class_install_properties (object_class, LAST_PROP, properties);
|
2009-07-16 06:16:01 +00:00
|
|
|
|
|
2016-06-15 15:00:38 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* GdkSurface::moved-to-rect:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: the #GdkSurface that moved
|
|
|
|
|
* @flipped_rect: (nullable): the position of @surface after any possible
|
2016-06-15 15:00:38 +00:00
|
|
|
|
* flipping or %NULL if the backend can't obtain it
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @final_rect: (nullable): the final position of @surface or %NULL if the
|
2016-06-15 15:00:38 +00:00
|
|
|
|
* backend can't obtain it
|
|
|
|
|
* @flipped_x: %TRUE if the anchors were flipped horizontally
|
|
|
|
|
* @flipped_y: %TRUE if the anchors were flipped vertically
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Emitted when the position of @surface is finalized after being moved to a
|
2016-06-15 15:00:38 +00:00
|
|
|
|
* destination rectangle.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface might be flipped over the destination rectangle in order to keep
|
2016-06-15 15:00:38 +00:00
|
|
|
|
* it on-screen, in which case @flipped_x and @flipped_y will be set to %TRUE
|
|
|
|
|
* accordingly.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @flipped_rect is the ideal position of @surface after any possible
|
2016-06-15 15:00:38 +00:00
|
|
|
|
* flipping, but before any possible sliding. @final_rect is @flipped_rect,
|
|
|
|
|
* but possibly translated in the case that flipping is still ineffective in
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* keeping @surface on-screen.
|
2016-06-15 15:00:38 +00:00
|
|
|
|
* Stability: Private
|
|
|
|
|
*/
|
|
|
|
|
signals[MOVED_TO_RECT] =
|
|
|
|
|
g_signal_new (g_intern_static_string ("moved-to-rect"),
|
|
|
|
|
G_OBJECT_CLASS_TYPE (object_class),
|
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
|
0,
|
|
|
|
|
NULL,
|
|
|
|
|
NULL,
|
|
|
|
|
_gdk_marshal_VOID__POINTER_POINTER_BOOLEAN_BOOLEAN,
|
|
|
|
|
G_TYPE_NONE,
|
|
|
|
|
4,
|
|
|
|
|
G_TYPE_POINTER,
|
|
|
|
|
G_TYPE_POINTER,
|
|
|
|
|
G_TYPE_BOOLEAN,
|
|
|
|
|
G_TYPE_BOOLEAN);
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
}
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
|
static void
|
2015-12-15 22:22:00 +00:00
|
|
|
|
seat_removed_cb (GdkDisplay *display,
|
|
|
|
|
GdkSeat *seat,
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GdkSurface *surface)
|
2010-05-25 22:38:44 +00:00
|
|
|
|
{
|
2015-12-15 22:22:00 +00:00
|
|
|
|
GdkDevice *device = gdk_seat_get_pointer (seat);
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->devices_inside = g_list_remove (surface->devices_inside, device);
|
|
|
|
|
g_hash_table_remove (surface->device_cursor, device);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->device_events)
|
|
|
|
|
g_hash_table_remove (surface->device_events, device);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
static void
|
2018-03-20 10:40:08 +00:00
|
|
|
|
gdk_surface_finalize (GObject *object)
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GdkSurface *surface = GDK_SURFACE (object);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_signal_handlers_disconnect_by_func (gdk_surface_get_display (surface),
|
|
|
|
|
seat_removed_cb, surface);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (!GDK_SURFACE_DESTROYED (surface))
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (GDK_SURFACE_TYPE (surface) != GDK_SURFACE_FOREIGN)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
{
|
|
|
|
|
g_warning ("losing last reference to undestroyed surface");
|
|
|
|
|
_gdk_surface_destroy (surface, FALSE);
|
|
|
|
|
}
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
else
|
2018-03-21 08:06:31 +00:00
|
|
|
|
/* We use TRUE here, to keep us from actually calling
|
|
|
|
|
* XDestroyWindow() on the window
|
|
|
|
|
*/
|
|
|
|
|
_gdk_surface_destroy (surface, TRUE);
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
}
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->impl)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_object_unref (surface->impl);
|
|
|
|
|
surface->impl = NULL;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->impl_surface != surface)
|
2009-01-23 19:08:39 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_object_unref (surface->impl_surface);
|
|
|
|
|
surface->impl_surface = NULL;
|
2009-01-23 19:08:39 +00:00
|
|
|
|
}
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->input_shape)
|
|
|
|
|
cairo_region_destroy (surface->input_shape);
|
2008-12-17 10:24:46 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->cursor)
|
|
|
|
|
g_object_unref (surface->cursor);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->device_cursor)
|
|
|
|
|
g_hash_table_destroy (surface->device_cursor);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->device_events)
|
|
|
|
|
g_hash_table_destroy (surface->device_events);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->devices_inside)
|
|
|
|
|
g_list_free (surface->devices_inside);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_clear_object (&surface->display);
|
2016-10-27 13:38:41 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->opaque_region)
|
|
|
|
|
cairo_region_destroy (surface->opaque_region);
|
2017-08-18 10:01:54 +00:00
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
G_OBJECT_CLASS (gdk_surface_parent_class)->finalize (object);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-07-16 06:16:01 +00:00
|
|
|
|
static void
|
2018-03-20 10:40:08 +00:00
|
|
|
|
gdk_surface_set_property (GObject *object,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
guint prop_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
2009-07-16 06:16:01 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GdkSurface *surface = GDK_SURFACE (object);
|
2009-07-16 06:16:01 +00:00
|
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
|
{
|
|
|
|
|
case PROP_CURSOR:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_cursor (surface, g_value_get_object (value));
|
2009-07-16 06:16:01 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2016-10-27 13:38:41 +00:00
|
|
|
|
case PROP_DISPLAY:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->display = g_value_dup_object (value);
|
|
|
|
|
g_assert (surface->display != NULL);
|
2016-10-27 13:38:41 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2009-07-16 06:16:01 +00:00
|
|
|
|
default:
|
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2018-03-20 10:40:08 +00:00
|
|
|
|
gdk_surface_get_property (GObject *object,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
guint prop_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
2009-07-16 06:16:01 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GdkSurface *surface = GDK_SURFACE (object);
|
2009-07-16 06:16:01 +00:00
|
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
|
{
|
|
|
|
|
case PROP_CURSOR:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_value_set_object (value, gdk_surface_get_cursor (surface));
|
2009-07-16 06:16:01 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2016-10-27 13:38:41 +00:00
|
|
|
|
case PROP_DISPLAY:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_value_set_object (value, surface->display);
|
2016-10-27 13:38:41 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2017-12-14 23:51:38 +00:00
|
|
|
|
case PROP_STATE:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_value_set_flags (value, surface->state);
|
2017-12-14 23:51:38 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2009-07-16 06:16:01 +00:00
|
|
|
|
default:
|
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-02-01 14:09:52 +00:00
|
|
|
|
static gboolean
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_is_subsurface (GdkSurface *surface)
|
2017-02-01 14:09:52 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface->surface_type == GDK_SURFACE_SUBSURFACE;
|
2017-02-01 14:09:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
static GdkSurface *
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_impl_surface (GdkSurface *surface)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface->impl_surface;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *
|
2018-03-20 14:14:10 +00:00
|
|
|
|
_gdk_surface_get_impl_surface (GdkSurface *surface)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return gdk_surface_get_impl_surface (surface);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_has_impl (GdkSurface *surface)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface->impl_surface == surface;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-08-31 08:59:21 +00:00
|
|
|
|
static gboolean
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_is_toplevel (GdkSurface *surface)
|
2009-08-31 08:59:21 +00:00
|
|
|
|
{
|
2018-03-20 23:55:59 +00:00
|
|
|
|
return surface->parent == NULL;
|
2009-08-31 08:59:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
|
gboolean
|
2018-03-20 14:14:10 +00:00
|
|
|
|
_gdk_surface_has_impl (GdkSurface *surface)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return gdk_surface_has_impl (surface);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-12-05 11:16:55 +00:00
|
|
|
|
static void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
remove_child_area (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gboolean for_input,
|
|
|
|
|
cairo_region_t *region)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *child;
|
2010-06-28 12:54:37 +00:00
|
|
|
|
cairo_region_t *child_region;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
GdkRectangle r;
|
|
|
|
|
GList *l;
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
for (l = surface->children; l; l = l->next)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
|
|
|
|
child = l->data;
|
|
|
|
|
|
2009-07-19 20:36:43 +00:00
|
|
|
|
/* If region is empty already, no need to do
|
2018-03-21 08:06:31 +00:00
|
|
|
|
anything potentially costly */
|
2010-06-28 12:44:12 +00:00
|
|
|
|
if (cairo_region_is_empty (region))
|
2018-03-21 08:06:31 +00:00
|
|
|
|
break;
|
2009-07-19 20:36:43 +00:00
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
if (!GDK_SURFACE_IS_MAPPED (child) || child->input_only)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
continue;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
|
|
|
|
r.x = child->x;
|
|
|
|
|
r.y = child->y;
|
|
|
|
|
r.width = child->width;
|
|
|
|
|
r.height = child->height;
|
2008-12-16 19:09:20 +00:00
|
|
|
|
|
2009-07-19 20:35:25 +00:00
|
|
|
|
/* Bail early if child totally outside region */
|
2010-06-28 12:44:12 +00:00
|
|
|
|
if (cairo_region_contains_rectangle (region, &r) == CAIRO_REGION_OVERLAP_OUT)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
continue;
|
2009-07-19 20:35:25 +00:00
|
|
|
|
|
2010-06-28 12:44:12 +00:00
|
|
|
|
child_region = cairo_region_create_rectangle (&r);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2008-12-17 10:24:46 +00:00
|
|
|
|
if (for_input)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
{
|
|
|
|
|
if (child->input_shape)
|
|
|
|
|
cairo_region_intersect (child_region, child->input_shape);
|
|
|
|
|
}
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2013-04-17 14:36:52 +00:00
|
|
|
|
cairo_region_subtract (region, child_region);
|
2010-06-28 12:44:12 +00:00
|
|
|
|
cairo_region_destroy (child_region);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2018-03-20 10:40:08 +00:00
|
|
|
|
recompute_visible_regions_internal (GdkSurface *private,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gboolean recalculate_clip,
|
|
|
|
|
gboolean recalculate_children)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
|
|
|
|
GList *l;
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *child;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
gboolean abs_pos_changed;
|
|
|
|
|
int old_abs_x, old_abs_y;
|
|
|
|
|
|
|
|
|
|
old_abs_x = private->abs_x;
|
|
|
|
|
old_abs_y = private->abs_y;
|
2009-05-26 18:53:48 +00:00
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
|
/* Update absolute position */
|
2018-03-20 10:40:08 +00:00
|
|
|
|
if ((gdk_surface_has_impl (private) &&
|
2018-03-20 11:05:26 +00:00
|
|
|
|
private->surface_type != GDK_SURFACE_SUBSURFACE) ||
|
2018-03-20 10:40:08 +00:00
|
|
|
|
(gdk_surface_is_toplevel (private) &&
|
2018-03-20 11:05:26 +00:00
|
|
|
|
private->surface_type == GDK_SURFACE_SUBSURFACE))
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* Native surfaces and toplevel subsurfaces start here */
|
2008-07-18 13:03:42 +00:00
|
|
|
|
private->abs_x = 0;
|
|
|
|
|
private->abs_y = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
private->abs_x = private->parent->abs_x + private->x;
|
|
|
|
|
private->abs_y = private->parent->abs_y + private->y;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
abs_pos_changed =
|
|
|
|
|
private->abs_x != old_abs_x ||
|
|
|
|
|
private->abs_y != old_abs_y;
|
|
|
|
|
|
2018-03-20 23:55:59 +00:00
|
|
|
|
/* Update all children, recursively */
|
2018-03-21 02:51:29 +00:00
|
|
|
|
if ((abs_pos_changed || recalculate_children))
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
|
|
|
|
for (l = private->children; l; l = l->next)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
{
|
|
|
|
|
child = l->data;
|
|
|
|
|
/* Only recalculate clip if the the clip region changed, otherwise
|
|
|
|
|
* there is no way the child clip region could change (its has not e.g. moved)
|
|
|
|
|
* Except if recalculate_children is set to force child updates
|
|
|
|
|
*/
|
|
|
|
|
recompute_visible_regions_internal (child,
|
|
|
|
|
recalculate_clip && recalculate_children,
|
|
|
|
|
FALSE);
|
|
|
|
|
}
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Call this when private has changed in one or more of these ways:
|
|
|
|
|
* size changed
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* surface moved
|
|
|
|
|
* new surface added
|
|
|
|
|
* stacking order of surface changed
|
2008-07-18 13:03:42 +00:00
|
|
|
|
* child deleted
|
|
|
|
|
*
|
|
|
|
|
* It will recalculate abs_x/y and the clip regions
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Unless the surface didn’t change stacking order or size/pos, pass in TRUE
|
2008-07-18 13:03:42 +00:00
|
|
|
|
* for recalculate_siblings. (Mostly used internally for the recursion)
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* If a child surface was removed (and you can’t use that child for
|
2008-07-18 13:03:42 +00:00
|
|
|
|
* recompute_visible_regions), pass in TRUE for recalculate_children on the parent
|
|
|
|
|
*/
|
|
|
|
|
static void
|
2018-03-20 10:40:08 +00:00
|
|
|
|
recompute_visible_regions (GdkSurface *private,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gboolean recalculate_children)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
|
|
|
|
recompute_visible_regions_internal (private,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
TRUE,
|
|
|
|
|
recalculate_children);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
_gdk_surface_update_size (GdkSurface *surface)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-04-08 22:35:32 +00:00
|
|
|
|
GSList *l;
|
|
|
|
|
|
|
|
|
|
for (l = surface->draw_contexts; l; l = l->next)
|
|
|
|
|
gdk_draw_context_surface_resized (l->data);
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
recompute_visible_regions (surface, FALSE);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-12-04 09:32:08 +00:00
|
|
|
|
static GdkEventMask
|
2018-03-20 10:40:08 +00:00
|
|
|
|
get_native_device_event_mask (GdkSurface *private,
|
2010-11-22 23:55:39 +00:00
|
|
|
|
GdkDevice *device)
|
2008-12-04 09:32:08 +00:00
|
|
|
|
{
|
2010-05-25 22:38:44 +00:00
|
|
|
|
GdkEventMask event_mask;
|
|
|
|
|
|
|
|
|
|
if (device)
|
|
|
|
|
event_mask = GPOINTER_TO_INT (g_hash_table_lookup (private->device_events, device));
|
|
|
|
|
else
|
|
|
|
|
event_mask = private->event_mask;
|
|
|
|
|
|
2018-03-20 23:55:59 +00:00
|
|
|
|
if (private->surface_type == GDK_SURFACE_FOREIGN)
|
2010-05-25 22:38:44 +00:00
|
|
|
|
return event_mask;
|
2009-08-24 13:18:10 +00:00
|
|
|
|
else
|
2009-02-04 10:22:54 +00:00
|
|
|
|
{
|
2009-09-29 10:56:57 +00:00
|
|
|
|
GdkEventMask mask;
|
|
|
|
|
|
2017-09-15 16:58:50 +00:00
|
|
|
|
mask = private->event_mask;
|
2009-09-29 10:56:57 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* We need thse for all native surfaces so we can
|
2018-03-21 08:06:31 +00:00
|
|
|
|
emulate events on children: */
|
2009-09-29 10:56:57 +00:00
|
|
|
|
mask |=
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GDK_EXPOSURE_MASK |
|
|
|
|
|
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
|
2016-12-15 16:53:08 +00:00
|
|
|
|
GDK_TOUCH_MASK |
|
|
|
|
|
GDK_POINTER_MOTION_MASK |
|
|
|
|
|
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
|
|
|
|
|
GDK_SCROLL_MASK;
|
2009-09-29 10:56:57 +00:00
|
|
|
|
|
|
|
|
|
return mask;
|
2009-02-04 10:22:54 +00:00
|
|
|
|
}
|
2008-12-04 09:32:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
|
static GdkEventMask
|
2018-03-20 10:40:08 +00:00
|
|
|
|
get_native_event_mask (GdkSurface *private)
|
2010-05-25 22:38:44 +00:00
|
|
|
|
{
|
|
|
|
|
return get_native_device_event_mask (private, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface*
|
|
|
|
|
gdk_surface_new (GdkDisplay *display,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkSurface *parent,
|
|
|
|
|
GdkSurfaceAttr *attributes)
|
Bug 318807 – Offscreen windows and window redirection.
2008-03-18 10:49:20 Tim Janik <timj@imendio.com>
* Applied pixmap redirection patch by Alexander Larsson with
various updates from:
Bug 318807 – Offscreen windows and window redirection.
Updates:
* updated docs to mention "Since 2.16".
* tests/testgtk.c: fixed snapshooting pixmap leak.
convert pixmap to pixbuf after snapshooting, to compensate for different
bit depths (occurs when snapshooting ARGB visuals and displaying the
pixmap in an RGB visual).
* gdk/gdkwindow.[hc]: made GdkWindowRedirect private.
* gdk/gdkwindow.c: removed damage idle handler, there's no aparent
need for it. enqueue damage notification as GDK_DAMAGE events
for each painting redirection at the start of the event queue.
consider windows with a redirection fully visible when invalidating,
and when updating from backing store. cleaned up stale variables.
* gdk/gdkevents.c: added _gdk_event_queue_prepend().
* gtk/gtkwidget.c: fixed coordinates for !NO_WINDOW widgets in
gtk_widget_get_snapshot; this fixes garbage snap offsets for gammacurve,
tree, drawingarea, text, handlebox, etc.
clip the redirected window hierarchy to window sizes, the visible
rectangles don't need to be taken into account here.
extended snapshooting docs to recommend gdk_pixbuf_get_from_drawable()
in case pixmap visuals could mismatch.
* gdk/x11/gdkwindow-x11.c: removed _gdk_windowing_window_get_visible_rect().
Base patch:
* tests/testgtk.c: add a "Snapshot" test to demonstrate snapshooting
of possibly obscured widgets into an offscreen pixmap.
* gtk/gtkwidget.[hc]: add GtkWidget::damage-event signal, add
gtk_widget_get_snapshot() to render a widget's contents to a GdkPixmap.
* gtk/gtkmain.c: dispatch GDK_DAMAGE events.
* gdk/gdkwindow.c: moved outer gdk_window_new() and gdk_window_reparent()
implementations here, adapted them to propagate redirects to child windows.
gdk_window_end_paint(): copy repainted window contents to redirection pixmap,
clipped to visible region. queue GDK_DAMAGE event delivery.
gdk_window_redirect_to_drawable(): install window painting redirection.
gdk_window_remove_redirection(): remove previously installed redirection.
* gdk/x11/gdkwindow-x11.c: added _gdk_windowing_window_get_visible_rect(),
renamed _gdk_window_new() and _gdk_window_reparent().
* gdk/gdkwindow.h: added GdkWindowRedirect* to GdkWindowObject, export
gdk_window_redirect_to_drawable() and gdk_window_remove_redirection().
* gdk/gdkevents.h: added GDK_DAMAGE event type.
* gdk/gdkevents.c: extract time and state from GDK_DAMAGE events.
* gdk/gdkinternals.h: added internal prototypes.
svn path=/trunk/; revision=20122
2008-05-21 19:04:24 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GdkSurface *surface;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
gboolean native;
|
|
|
|
|
GdkEventMask event_mask;
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
Bug 318807 – Offscreen windows and window redirection.
2008-03-18 10:49:20 Tim Janik <timj@imendio.com>
* Applied pixmap redirection patch by Alexander Larsson with
various updates from:
Bug 318807 – Offscreen windows and window redirection.
Updates:
* updated docs to mention "Since 2.16".
* tests/testgtk.c: fixed snapshooting pixmap leak.
convert pixmap to pixbuf after snapshooting, to compensate for different
bit depths (occurs when snapshooting ARGB visuals and displaying the
pixmap in an RGB visual).
* gdk/gdkwindow.[hc]: made GdkWindowRedirect private.
* gdk/gdkwindow.c: removed damage idle handler, there's no aparent
need for it. enqueue damage notification as GDK_DAMAGE events
for each painting redirection at the start of the event queue.
consider windows with a redirection fully visible when invalidating,
and when updating from backing store. cleaned up stale variables.
* gdk/gdkevents.c: added _gdk_event_queue_prepend().
* gtk/gtkwidget.c: fixed coordinates for !NO_WINDOW widgets in
gtk_widget_get_snapshot; this fixes garbage snap offsets for gammacurve,
tree, drawingarea, text, handlebox, etc.
clip the redirected window hierarchy to window sizes, the visible
rectangles don't need to be taken into account here.
extended snapshooting docs to recommend gdk_pixbuf_get_from_drawable()
in case pixmap visuals could mismatch.
* gdk/x11/gdkwindow-x11.c: removed _gdk_windowing_window_get_visible_rect().
Base patch:
* tests/testgtk.c: add a "Snapshot" test to demonstrate snapshooting
of possibly obscured widgets into an offscreen pixmap.
* gtk/gtkwidget.[hc]: add GtkWidget::damage-event signal, add
gtk_widget_get_snapshot() to render a widget's contents to a GdkPixmap.
* gtk/gtkmain.c: dispatch GDK_DAMAGE events.
* gdk/gdkwindow.c: moved outer gdk_window_new() and gdk_window_reparent()
implementations here, adapted them to propagate redirects to child windows.
gdk_window_end_paint(): copy repainted window contents to redirection pixmap,
clipped to visible region. queue GDK_DAMAGE event delivery.
gdk_window_redirect_to_drawable(): install window painting redirection.
gdk_window_remove_redirection(): remove previously installed redirection.
* gdk/x11/gdkwindow-x11.c: added _gdk_windowing_window_get_visible_rect(),
renamed _gdk_window_new() and _gdk_window_reparent().
* gdk/gdkwindow.h: added GdkWindowRedirect* to GdkWindowObject, export
gdk_window_redirect_to_drawable() and gdk_window_remove_redirection().
* gdk/gdkevents.h: added GDK_DAMAGE event type.
* gdk/gdkevents.c: extract time and state from GDK_DAMAGE events.
* gdk/gdkinternals.h: added internal prototypes.
svn path=/trunk/; revision=20122
2008-05-21 19:04:24 +00:00
|
|
|
|
g_return_val_if_fail (attributes != NULL, NULL);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
if (parent != NULL && GDK_SURFACE_DESTROYED (parent))
|
2009-08-30 15:14:40 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
g_warning ("gdk_surface_new(): parent is destroyed");
|
2009-08-30 15:14:40 +00:00
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface = _gdk_display_create_surface (display);
|
Bug 318807 – Offscreen windows and window redirection.
2008-03-18 10:49:20 Tim Janik <timj@imendio.com>
* Applied pixmap redirection patch by Alexander Larsson with
various updates from:
Bug 318807 – Offscreen windows and window redirection.
Updates:
* updated docs to mention "Since 2.16".
* tests/testgtk.c: fixed snapshooting pixmap leak.
convert pixmap to pixbuf after snapshooting, to compensate for different
bit depths (occurs when snapshooting ARGB visuals and displaying the
pixmap in an RGB visual).
* gdk/gdkwindow.[hc]: made GdkWindowRedirect private.
* gdk/gdkwindow.c: removed damage idle handler, there's no aparent
need for it. enqueue damage notification as GDK_DAMAGE events
for each painting redirection at the start of the event queue.
consider windows with a redirection fully visible when invalidating,
and when updating from backing store. cleaned up stale variables.
* gdk/gdkevents.c: added _gdk_event_queue_prepend().
* gtk/gtkwidget.c: fixed coordinates for !NO_WINDOW widgets in
gtk_widget_get_snapshot; this fixes garbage snap offsets for gammacurve,
tree, drawingarea, text, handlebox, etc.
clip the redirected window hierarchy to window sizes, the visible
rectangles don't need to be taken into account here.
extended snapshooting docs to recommend gdk_pixbuf_get_from_drawable()
in case pixmap visuals could mismatch.
* gdk/x11/gdkwindow-x11.c: removed _gdk_windowing_window_get_visible_rect().
Base patch:
* tests/testgtk.c: add a "Snapshot" test to demonstrate snapshooting
of possibly obscured widgets into an offscreen pixmap.
* gtk/gtkwidget.[hc]: add GtkWidget::damage-event signal, add
gtk_widget_get_snapshot() to render a widget's contents to a GdkPixmap.
* gtk/gtkmain.c: dispatch GDK_DAMAGE events.
* gdk/gdkwindow.c: moved outer gdk_window_new() and gdk_window_reparent()
implementations here, adapted them to propagate redirects to child windows.
gdk_window_end_paint(): copy repainted window contents to redirection pixmap,
clipped to visible region. queue GDK_DAMAGE event delivery.
gdk_window_redirect_to_drawable(): install window painting redirection.
gdk_window_remove_redirection(): remove previously installed redirection.
* gdk/x11/gdkwindow-x11.c: added _gdk_windowing_window_get_visible_rect(),
renamed _gdk_window_new() and _gdk_window_reparent().
* gdk/gdkwindow.h: added GdkWindowRedirect* to GdkWindowObject, export
gdk_window_redirect_to_drawable() and gdk_window_remove_redirection().
* gdk/gdkevents.h: added GDK_DAMAGE event type.
* gdk/gdkevents.c: extract time and state from GDK_DAMAGE events.
* gdk/gdkinternals.h: added internal prototypes.
svn path=/trunk/; revision=20122
2008-05-21 19:04:24 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->parent = parent;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->accept_focus = TRUE;
|
|
|
|
|
surface->focus_on_map = TRUE;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->x = attributes->x;
|
|
|
|
|
surface->y = attributes->y;
|
|
|
|
|
surface->width = (attributes->width > 1) ? (attributes->width) : (1);
|
|
|
|
|
surface->height = (attributes->height > 1) ? (attributes->height) : (1);
|
|
|
|
|
surface->alpha = 255;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
|
|
|
|
if (attributes->wclass == GDK_INPUT_ONLY)
|
|
|
|
|
{
|
|
|
|
|
/* Backwards compatiblity - we've always ignored
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* attributes->surface_type for input-only surfaces
|
2008-07-18 13:03:42 +00:00
|
|
|
|
* before
|
|
|
|
|
*/
|
2017-11-06 00:28:37 +00:00
|
|
|
|
if (parent == NULL)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
surface->surface_type = GDK_SURFACE_TEMP;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
else
|
2018-03-21 08:06:31 +00:00
|
|
|
|
surface->surface_type = GDK_SURFACE_CHILD;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->surface_type = attributes->surface_type;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
|
|
|
|
/* Sanity checks */
|
2018-03-20 14:14:10 +00:00
|
|
|
|
switch (surface->surface_type)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
case GDK_SURFACE_TOPLEVEL:
|
|
|
|
|
case GDK_SURFACE_TEMP:
|
2018-03-20 23:55:59 +00:00
|
|
|
|
if (parent != NULL)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
g_warning (G_STRLOC "Toplevel surfaces must be created without a parent");
|
2009-02-18 11:57:12 +00:00
|
|
|
|
break;
|
2018-03-20 10:40:08 +00:00
|
|
|
|
case GDK_SURFACE_SUBSURFACE:
|
2014-08-21 15:26:18 +00:00
|
|
|
|
#ifdef GDK_WINDOWING_WAYLAND
|
|
|
|
|
if (!GDK_IS_WAYLAND_DISPLAY (display))
|
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_warning (G_STRLOC "Subsurface surfaces can only be used on Wayland");
|
2014-08-21 15:26:18 +00:00
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
break;
|
2018-03-20 10:40:08 +00:00
|
|
|
|
case GDK_SURFACE_CHILD:
|
2018-03-20 23:55:59 +00:00
|
|
|
|
if (GDK_SURFACE_TYPE (parent) == GDK_SURFACE_FOREIGN)
|
2016-12-15 16:53:08 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_warning (G_STRLOC "Child surfaces must not be created as children of\n"
|
2018-03-20 23:55:59 +00:00
|
|
|
|
"a surface of type GDK_SURFACE_FOREIGN");
|
2016-12-15 16:53:08 +00:00
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2008-07-18 13:03:42 +00:00
|
|
|
|
break;
|
|
|
|
|
default:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_warning (G_STRLOC "cannot make surfaces of type %d", surface->surface_type);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->event_mask = GDK_ALL_EVENTS_MASK;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
|
|
|
|
if (attributes->wclass == GDK_INPUT_OUTPUT)
|
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->input_only = FALSE;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->input_only = TRUE;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-11-06 00:28:37 +00:00
|
|
|
|
native = FALSE;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->parent != NULL)
|
|
|
|
|
surface->parent->children = g_list_concat (&surface->children_list_node, surface->parent->children);
|
2017-11-06 00:28:37 +00:00
|
|
|
|
else
|
2013-01-30 20:09:44 +00:00
|
|
|
|
{
|
|
|
|
|
GdkFrameClock *frame_clock = g_object_new (GDK_TYPE_FRAME_CLOCK_IDLE, NULL);
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_frame_clock (surface, frame_clock);
|
2013-02-18 20:14:53 +00:00
|
|
|
|
g_object_unref (frame_clock);
|
2013-01-30 20:09:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
native = TRUE; /* Always use native surfaces for toplevels */
|
2017-11-06 00:28:37 +00:00
|
|
|
|
}
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2016-11-15 13:49:03 +00:00
|
|
|
|
#ifdef GDK_WINDOWING_WAYLAND
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->surface_type == GDK_SURFACE_SUBSURFACE)
|
2016-11-15 13:49:03 +00:00
|
|
|
|
native = TRUE; /* Always use native windows for subsurfaces as well */
|
|
|
|
|
#endif
|
|
|
|
|
|
2016-10-25 07:54:37 +00:00
|
|
|
|
if (native)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
event_mask = get_native_event_mask (surface);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
|
/* Create the impl */
|
2018-03-20 14:14:10 +00:00
|
|
|
|
_gdk_display_create_surface_impl (display, surface, parent, event_mask, attributes);
|
|
|
|
|
surface->impl_surface = surface;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
Bug 318807 – Offscreen windows and window redirection.
2008-03-18 10:49:20 Tim Janik <timj@imendio.com>
* Applied pixmap redirection patch by Alexander Larsson with
various updates from:
Bug 318807 – Offscreen windows and window redirection.
Updates:
* updated docs to mention "Since 2.16".
* tests/testgtk.c: fixed snapshooting pixmap leak.
convert pixmap to pixbuf after snapshooting, to compensate for different
bit depths (occurs when snapshooting ARGB visuals and displaying the
pixmap in an RGB visual).
* gdk/gdkwindow.[hc]: made GdkWindowRedirect private.
* gdk/gdkwindow.c: removed damage idle handler, there's no aparent
need for it. enqueue damage notification as GDK_DAMAGE events
for each painting redirection at the start of the event queue.
consider windows with a redirection fully visible when invalidating,
and when updating from backing store. cleaned up stale variables.
* gdk/gdkevents.c: added _gdk_event_queue_prepend().
* gtk/gtkwidget.c: fixed coordinates for !NO_WINDOW widgets in
gtk_widget_get_snapshot; this fixes garbage snap offsets for gammacurve,
tree, drawingarea, text, handlebox, etc.
clip the redirected window hierarchy to window sizes, the visible
rectangles don't need to be taken into account here.
extended snapshooting docs to recommend gdk_pixbuf_get_from_drawable()
in case pixmap visuals could mismatch.
* gdk/x11/gdkwindow-x11.c: removed _gdk_windowing_window_get_visible_rect().
Base patch:
* tests/testgtk.c: add a "Snapshot" test to demonstrate snapshooting
of possibly obscured widgets into an offscreen pixmap.
* gtk/gtkwidget.[hc]: add GtkWidget::damage-event signal, add
gtk_widget_get_snapshot() to render a widget's contents to a GdkPixmap.
* gtk/gtkmain.c: dispatch GDK_DAMAGE events.
* gdk/gdkwindow.c: moved outer gdk_window_new() and gdk_window_reparent()
implementations here, adapted them to propagate redirects to child windows.
gdk_window_end_paint(): copy repainted window contents to redirection pixmap,
clipped to visible region. queue GDK_DAMAGE event delivery.
gdk_window_redirect_to_drawable(): install window painting redirection.
gdk_window_remove_redirection(): remove previously installed redirection.
* gdk/x11/gdkwindow-x11.c: added _gdk_windowing_window_get_visible_rect(),
renamed _gdk_window_new() and _gdk_window_reparent().
* gdk/gdkwindow.h: added GdkWindowRedirect* to GdkWindowObject, export
gdk_window_redirect_to_drawable() and gdk_window_remove_redirection().
* gdk/gdkevents.h: added GDK_DAMAGE event type.
* gdk/gdkevents.c: extract time and state from GDK_DAMAGE events.
* gdk/gdkinternals.h: added internal prototypes.
svn path=/trunk/; revision=20122
2008-05-21 19:04:24 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->impl_surface = g_object_ref (surface->parent->impl_surface);
|
|
|
|
|
surface->impl = g_object_ref (surface->impl_surface->impl);
|
Bug 318807 – Offscreen windows and window redirection.
2008-03-18 10:49:20 Tim Janik <timj@imendio.com>
* Applied pixmap redirection patch by Alexander Larsson with
various updates from:
Bug 318807 – Offscreen windows and window redirection.
Updates:
* updated docs to mention "Since 2.16".
* tests/testgtk.c: fixed snapshooting pixmap leak.
convert pixmap to pixbuf after snapshooting, to compensate for different
bit depths (occurs when snapshooting ARGB visuals and displaying the
pixmap in an RGB visual).
* gdk/gdkwindow.[hc]: made GdkWindowRedirect private.
* gdk/gdkwindow.c: removed damage idle handler, there's no aparent
need for it. enqueue damage notification as GDK_DAMAGE events
for each painting redirection at the start of the event queue.
consider windows with a redirection fully visible when invalidating,
and when updating from backing store. cleaned up stale variables.
* gdk/gdkevents.c: added _gdk_event_queue_prepend().
* gtk/gtkwidget.c: fixed coordinates for !NO_WINDOW widgets in
gtk_widget_get_snapshot; this fixes garbage snap offsets for gammacurve,
tree, drawingarea, text, handlebox, etc.
clip the redirected window hierarchy to window sizes, the visible
rectangles don't need to be taken into account here.
extended snapshooting docs to recommend gdk_pixbuf_get_from_drawable()
in case pixmap visuals could mismatch.
* gdk/x11/gdkwindow-x11.c: removed _gdk_windowing_window_get_visible_rect().
Base patch:
* tests/testgtk.c: add a "Snapshot" test to demonstrate snapshooting
of possibly obscured widgets into an offscreen pixmap.
* gtk/gtkwidget.[hc]: add GtkWidget::damage-event signal, add
gtk_widget_get_snapshot() to render a widget's contents to a GdkPixmap.
* gtk/gtkmain.c: dispatch GDK_DAMAGE events.
* gdk/gdkwindow.c: moved outer gdk_window_new() and gdk_window_reparent()
implementations here, adapted them to propagate redirects to child windows.
gdk_window_end_paint(): copy repainted window contents to redirection pixmap,
clipped to visible region. queue GDK_DAMAGE event delivery.
gdk_window_redirect_to_drawable(): install window painting redirection.
gdk_window_remove_redirection(): remove previously installed redirection.
* gdk/x11/gdkwindow-x11.c: added _gdk_windowing_window_get_visible_rect(),
renamed _gdk_window_new() and _gdk_window_reparent().
* gdk/gdkwindow.h: added GdkWindowRedirect* to GdkWindowObject, export
gdk_window_redirect_to_drawable() and gdk_window_remove_redirection().
* gdk/gdkevents.h: added GDK_DAMAGE event type.
* gdk/gdkevents.c: extract time and state from GDK_DAMAGE events.
* gdk/gdkinternals.h: added internal prototypes.
svn path=/trunk/; revision=20122
2008-05-21 19:04:24 +00:00
|
|
|
|
}
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
recompute_visible_regions (surface, FALSE);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_signal_connect (display, "seat-removed", G_CALLBACK (seat_removed_cb), surface);
|
2014-10-09 09:03:47 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface;
|
Bug 318807 – Offscreen windows and window redirection.
2008-03-18 10:49:20 Tim Janik <timj@imendio.com>
* Applied pixmap redirection patch by Alexander Larsson with
various updates from:
Bug 318807 – Offscreen windows and window redirection.
Updates:
* updated docs to mention "Since 2.16".
* tests/testgtk.c: fixed snapshooting pixmap leak.
convert pixmap to pixbuf after snapshooting, to compensate for different
bit depths (occurs when snapshooting ARGB visuals and displaying the
pixmap in an RGB visual).
* gdk/gdkwindow.[hc]: made GdkWindowRedirect private.
* gdk/gdkwindow.c: removed damage idle handler, there's no aparent
need for it. enqueue damage notification as GDK_DAMAGE events
for each painting redirection at the start of the event queue.
consider windows with a redirection fully visible when invalidating,
and when updating from backing store. cleaned up stale variables.
* gdk/gdkevents.c: added _gdk_event_queue_prepend().
* gtk/gtkwidget.c: fixed coordinates for !NO_WINDOW widgets in
gtk_widget_get_snapshot; this fixes garbage snap offsets for gammacurve,
tree, drawingarea, text, handlebox, etc.
clip the redirected window hierarchy to window sizes, the visible
rectangles don't need to be taken into account here.
extended snapshooting docs to recommend gdk_pixbuf_get_from_drawable()
in case pixmap visuals could mismatch.
* gdk/x11/gdkwindow-x11.c: removed _gdk_windowing_window_get_visible_rect().
Base patch:
* tests/testgtk.c: add a "Snapshot" test to demonstrate snapshooting
of possibly obscured widgets into an offscreen pixmap.
* gtk/gtkwidget.[hc]: add GtkWidget::damage-event signal, add
gtk_widget_get_snapshot() to render a widget's contents to a GdkPixmap.
* gtk/gtkmain.c: dispatch GDK_DAMAGE events.
* gdk/gdkwindow.c: moved outer gdk_window_new() and gdk_window_reparent()
implementations here, adapted them to propagate redirects to child windows.
gdk_window_end_paint(): copy repainted window contents to redirection pixmap,
clipped to visible region. queue GDK_DAMAGE event delivery.
gdk_window_redirect_to_drawable(): install window painting redirection.
gdk_window_remove_redirection(): remove previously installed redirection.
* gdk/x11/gdkwindow-x11.c: added _gdk_windowing_window_get_visible_rect(),
renamed _gdk_window_new() and _gdk_window_reparent().
* gdk/gdkwindow.h: added GdkWindowRedirect* to GdkWindowObject, export
gdk_window_redirect_to_drawable() and gdk_window_remove_redirection().
* gdk/gdkevents.h: added GDK_DAMAGE event type.
* gdk/gdkevents.c: extract time and state from GDK_DAMAGE events.
* gdk/gdkinternals.h: added internal prototypes.
svn path=/trunk/; revision=20122
2008-05-21 19:04:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-11-06 16:40:59 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_new_toplevel: (constructor)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @display: the display to create the surface on
|
|
|
|
|
* @width: width of new surface
|
|
|
|
|
* @height: height of new surface
|
2016-11-06 16:40:59 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Creates a new toplevel surface. The surface will be managed by the surface
|
2016-11-06 16:40:59 +00:00
|
|
|
|
* manager.
|
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* Returns: (transfer full): the new #GdkSurface
|
2016-11-06 16:40:59 +00:00
|
|
|
|
**/
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *
|
|
|
|
|
gdk_surface_new_toplevel (GdkDisplay *display,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gint width,
|
|
|
|
|
gint height)
|
2016-11-06 16:40:59 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceAttr attr;
|
2016-11-06 16:40:59 +00:00
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
|
|
|
|
|
|
|
|
|
attr.wclass = GDK_INPUT_OUTPUT;
|
2016-11-07 00:33:43 +00:00
|
|
|
|
attr.x = 0;
|
|
|
|
|
attr.y = 0;
|
2016-11-06 16:40:59 +00:00
|
|
|
|
attr.width = width;
|
|
|
|
|
attr.height = height;
|
2018-03-20 11:05:26 +00:00
|
|
|
|
attr.surface_type = GDK_SURFACE_TOPLEVEL;
|
2016-11-06 16:40:59 +00:00
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
return gdk_surface_new (display, NULL, &attr);
|
2016-11-06 16:40:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-11-06 22:47:56 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_new_popup: (constructor)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @display: the display to create the surface on
|
|
|
|
|
* @position: position of the surface on screen
|
2016-11-06 22:47:56 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Creates a new toplevel popup surface. The surface will bypass surface
|
2016-11-06 22:47:56 +00:00
|
|
|
|
* management.
|
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* Returns: (transfer full): the new #GdkSurface
|
2016-11-06 22:47:56 +00:00
|
|
|
|
**/
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *
|
|
|
|
|
gdk_surface_new_popup (GdkDisplay *display,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
const GdkRectangle *position)
|
2016-11-06 22:47:56 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceAttr attr;
|
2016-11-06 22:47:56 +00:00
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
|
|
|
|
g_return_val_if_fail (position != NULL, NULL);
|
|
|
|
|
|
|
|
|
|
attr.wclass = GDK_INPUT_OUTPUT;
|
|
|
|
|
attr.x = position->x;
|
|
|
|
|
attr.y = position->y;
|
|
|
|
|
attr.width = position->width;
|
|
|
|
|
attr.height = position->height;
|
2018-03-20 11:05:26 +00:00
|
|
|
|
attr.surface_type = GDK_SURFACE_TEMP;
|
2016-11-06 22:47:56 +00:00
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
return gdk_surface_new (display, NULL, &attr);
|
2016-11-06 22:47:56 +00:00
|
|
|
|
}
|
2016-11-07 00:03:17 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_new_temp: (constructor)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @display: the display to create the surface on
|
2016-11-07 00:03:17 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Creates a new toplevel temporary surface. The surface will be
|
2016-11-07 00:03:17 +00:00
|
|
|
|
* situated off-screen and not handle output.
|
|
|
|
|
*
|
|
|
|
|
* You most likely do not want to use this function.
|
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* Returns: (transfer full): the new #GdkSurface
|
2016-11-07 00:03:17 +00:00
|
|
|
|
**/
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *
|
|
|
|
|
gdk_surface_new_temp (GdkDisplay *display)
|
2016-11-07 00:03:17 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceAttr attr;
|
2016-11-07 00:03:17 +00:00
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
|
|
|
|
|
|
|
|
|
attr.wclass = GDK_INPUT_ONLY;
|
|
|
|
|
attr.x = -100;
|
|
|
|
|
attr.y = -100;
|
|
|
|
|
attr.width = 10;
|
|
|
|
|
attr.height = 10;
|
2018-03-20 11:05:26 +00:00
|
|
|
|
attr.surface_type = GDK_SURFACE_TEMP;
|
2016-11-07 00:03:17 +00:00
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
return gdk_surface_new (display, NULL, &attr);
|
2016-11-07 00:03:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-17 18:11:23 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_new_child: (constructor)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @parent: the parent surface
|
|
|
|
|
* @position: placement of the surface inside @parent
|
2016-10-17 18:11:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Creates a new client-side child surface.
|
2016-10-17 18:11:23 +00:00
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* Returns: (transfer full): the new #GdkSurface
|
2016-10-17 18:11:23 +00:00
|
|
|
|
**/
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *
|
|
|
|
|
gdk_surface_new_child (GdkSurface *parent,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
const GdkRectangle *position)
|
2016-10-17 18:11:23 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceAttr attr;
|
2016-10-17 18:11:23 +00:00
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (parent), NULL);
|
2016-10-17 18:11:23 +00:00
|
|
|
|
|
|
|
|
|
attr.wclass = GDK_INPUT_OUTPUT;
|
|
|
|
|
attr.x = position->x;
|
|
|
|
|
attr.y = position->y;
|
|
|
|
|
attr.width = position->width;
|
|
|
|
|
attr.height = position->height;
|
2018-03-20 11:05:26 +00:00
|
|
|
|
attr.surface_type = GDK_SURFACE_CHILD;
|
2016-10-17 18:11:23 +00:00
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
return gdk_surface_new (gdk_surface_get_display (parent), parent, &attr);
|
2016-10-17 18:11:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
|
static void
|
|
|
|
|
update_pointer_info_foreach (GdkDisplay *display,
|
|
|
|
|
GdkDevice *device,
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkPointerSurfaceInfo *pointer_info,
|
2010-05-25 22:38:44 +00:00
|
|
|
|
gpointer user_data)
|
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GdkSurface *surface = user_data;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (pointer_info->surface_under_pointer == surface)
|
2010-05-25 22:38:44 +00:00
|
|
|
|
{
|
2018-03-20 11:05:26 +00:00
|
|
|
|
g_object_unref (pointer_info->surface_under_pointer);
|
|
|
|
|
pointer_info->surface_under_pointer = NULL;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface_remove_from_pointer_info (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkDisplay *display)
|
2010-05-25 22:38:44 +00:00
|
|
|
|
{
|
|
|
|
|
_gdk_display_pointer_info_foreach (display,
|
|
|
|
|
update_pointer_info_foreach,
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* _gdk_surface_destroy_hierarchy:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2014-05-17 03:12:51 +00:00
|
|
|
|
* @recursing: If %TRUE, then this is being called because a parent
|
2009-06-01 10:04:36 +00:00
|
|
|
|
* was destroyed.
|
2014-05-17 03:12:51 +00:00
|
|
|
|
* @recursing_native: If %TRUE, then this is being called because a native parent
|
2009-06-01 10:04:36 +00:00
|
|
|
|
* was destroyed. This generally means that the call to the
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* windowing system to destroy the surface can be omitted, since
|
2002-01-13 20:13:34 +00:00
|
|
|
|
* it will be destroyed as a result of the parent being destroyed.
|
2009-06-01 10:04:36 +00:00
|
|
|
|
* Unless @foreign_destroy.
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @foreign_destroy: If %TRUE, the surface or a parent was destroyed by some
|
|
|
|
|
* external agency. The surface has already been destroyed and no
|
2002-01-13 20:13:34 +00:00
|
|
|
|
* windowing system calls should be made. (This may never happen
|
|
|
|
|
* for some windowing systems.)
|
2000-05-15 16:09:53 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Internal function to destroy a surface. Like gdk_surface_destroy(),
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* but does not drop the reference count created by gdk_surface_new().
|
2000-05-15 16:09:53 +00:00
|
|
|
|
**/
|
|
|
|
|
static void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
_gdk_surface_destroy_hierarchy (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gboolean recursing,
|
|
|
|
|
gboolean recursing_native,
|
|
|
|
|
gboolean foreign_destroy)
|
2000-05-15 16:09:53 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceImplClass *impl_class;
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GdkSurface *temp_surface;
|
2008-12-15 09:24:54 +00:00
|
|
|
|
GdkDisplay *display;
|
2000-05-15 16:09:53 +00:00
|
|
|
|
GList *tmp;
|
2008-10-21 21:42:39 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2008-10-21 21:42:39 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (GDK_SURFACE_DESTROYED (surface))
|
2004-03-13 18:27:56 +00:00
|
|
|
|
return;
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
display = gdk_surface_get_display (surface);
|
2009-02-28 05:24:07 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
switch (surface->surface_type)
|
2000-05-15 16:09:53 +00:00
|
|
|
|
{
|
2017-10-06 19:19:42 +00:00
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
|
|
|
|
break;
|
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
case GDK_SURFACE_TOPLEVEL:
|
|
|
|
|
case GDK_SURFACE_CHILD:
|
|
|
|
|
case GDK_SURFACE_TEMP:
|
|
|
|
|
case GDK_SURFACE_FOREIGN:
|
|
|
|
|
case GDK_SURFACE_SUBSURFACE:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->surface_type == GDK_SURFACE_FOREIGN && !foreign_destroy)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
2004-03-13 18:27:56 +00:00
|
|
|
|
else
|
2018-03-21 08:06:31 +00:00
|
|
|
|
{
|
|
|
|
|
if (surface->parent)
|
|
|
|
|
{
|
|
|
|
|
if (surface->parent->children)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->parent->children = g_list_remove_link (surface->parent->children, &surface->children_list_node);
|
2008-12-18 13:29:28 +00:00
|
|
|
|
|
2018-03-21 08:06:31 +00:00
|
|
|
|
if (!recursing &&
|
|
|
|
|
GDK_SURFACE_IS_MAPPED (surface))
|
|
|
|
|
{
|
|
|
|
|
recompute_visible_regions (surface, FALSE);
|
|
|
|
|
gdk_surface_invalidate_in_parent (surface);
|
|
|
|
|
}
|
|
|
|
|
}
|
2000-05-15 16:09:53 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->gl_paint_context)
|
2014-10-30 11:07:39 +00:00
|
|
|
|
{
|
|
|
|
|
/* Make sure to destroy if current */
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_object_run_dispose (G_OBJECT (surface->gl_paint_context));
|
|
|
|
|
g_object_unref (surface->gl_paint_context);
|
|
|
|
|
surface->gl_paint_context = NULL;
|
2014-10-30 11:07:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->frame_clock)
|
2013-01-30 20:09:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_object_run_dispose (G_OBJECT (surface->frame_clock));
|
|
|
|
|
gdk_surface_set_frame_clock (surface, NULL);
|
2013-01-30 20:09:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-21 08:06:31 +00:00
|
|
|
|
if (surface->surface_type == GDK_SURFACE_FOREIGN)
|
|
|
|
|
g_assert (surface->children == NULL);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
tmp = surface->children;
|
|
|
|
|
surface->children = NULL;
|
|
|
|
|
/* No need to free children list, its all made up of in-struct nodes */
|
|
|
|
|
|
|
|
|
|
while (tmp)
|
|
|
|
|
{
|
|
|
|
|
temp_surface = tmp->data;
|
|
|
|
|
tmp = tmp->next;
|
|
|
|
|
|
|
|
|
|
if (temp_surface)
|
|
|
|
|
_gdk_surface_destroy_hierarchy (temp_surface,
|
|
|
|
|
TRUE,
|
|
|
|
|
recursing_native || gdk_surface_has_impl (surface),
|
|
|
|
|
foreign_destroy);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_gdk_surface_clear_update_area (surface);
|
|
|
|
|
|
|
|
|
|
impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
|
|
|
|
|
|
|
|
|
|
if (gdk_surface_has_impl (surface))
|
|
|
|
|
impl_class->destroy (surface, recursing_native, foreign_destroy);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* hide to make sure we repaint and break grabs */
|
|
|
|
|
gdk_surface_hide (surface);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
surface->state |= GDK_SURFACE_STATE_WITHDRAWN;
|
|
|
|
|
surface->parent = NULL;
|
|
|
|
|
surface->destroyed = TRUE;
|
|
|
|
|
|
|
|
|
|
surface_remove_from_pointer_info (surface, display);
|
2009-08-13 14:48:07 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (surface), properties[PROP_STATE]);
|
2018-03-21 08:06:31 +00:00
|
|
|
|
}
|
2000-05-15 16:09:53 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* _gdk_surface_destroy:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
* @foreign_destroy: If %TRUE, the surface or a parent was destroyed by some
|
|
|
|
|
* external agency. The surface has already been destroyed and no
|
2002-01-13 20:13:34 +00:00
|
|
|
|
* windowing system calls should be made. (This may never happen
|
|
|
|
|
* for some windowing systems.)
|
2000-05-15 16:09:53 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Internal function to destroy a surface. Like gdk_surface_destroy(),
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* but does not drop the reference count created by gdk_surface_new().
|
2000-05-15 16:09:53 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
_gdk_surface_destroy (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gboolean foreign_destroy)
|
2000-05-15 16:09:53 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
_gdk_surface_destroy_hierarchy (surface, FALSE, FALSE, foreign_destroy);
|
2000-05-15 16:09:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-10-03 18:19:48 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_destroy:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2001-10-03 18:19:48 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Destroys the window system resources associated with @surface and decrements @surface's
|
|
|
|
|
* reference count. The window system resources for all children of @surface are also
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* destroyed, but the children’s reference counts are not decremented.
|
Documentation fixes.
Sun Oct 13 18:50:14 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtkmenu.c, gtkmenu.sgml, gtkitemfactory.c, gdkwindow.c,
gtkwindow.c, gtkpaned.sgml, gtkdialog.c, gtkbox.h, gtkbutton.sgml,
gtktreemodel.sgml,gtktable.sgml, gtktable.c:
Documentation fixes.
#85719, #90759, #95169, Owen Taylor;
#89221, Yao Zhang, Matthias Clasen;
#95592, Joost Faassen;
#92637, Vitaly Tishkov;
#94616, Ben Martin;
#94772, sbaillie@bigpond.net.au;
2002-10-13 17:17:14 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Note that a surface will not be destroyed automatically when its reference count
|
Documentation fixes.
Sun Oct 13 18:50:14 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtkmenu.c, gtkmenu.sgml, gtkitemfactory.c, gdkwindow.c,
gtkwindow.c, gtkpaned.sgml, gtkdialog.c, gtkbox.h, gtkbutton.sgml,
gtktreemodel.sgml,gtktable.sgml, gtktable.c:
Documentation fixes.
#85719, #90759, #95169, Owen Taylor;
#89221, Yao Zhang, Matthias Clasen;
#95592, Joost Faassen;
#92637, Vitaly Tishkov;
#94616, Ben Martin;
#94772, sbaillie@bigpond.net.au;
2002-10-13 17:17:14 +00:00
|
|
|
|
* reaches zero. You must call this function yourself before that happens.
|
2001-10-03 18:19:48 +00:00
|
|
|
|
*
|
|
|
|
|
**/
|
2000-05-15 16:09:53 +00:00
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_destroy (GdkSurface *surface)
|
2000-05-15 16:09:53 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
_gdk_surface_destroy_hierarchy (surface, FALSE, FALSE, FALSE);
|
|
|
|
|
g_object_unref (surface);
|
2000-05-15 16:09:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-10-03 18:19:48 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_user_data:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2011-08-14 12:05:28 +00:00
|
|
|
|
* @user_data: (allow-none) (type GObject.Object): user data
|
2001-10-03 18:19:48 +00:00
|
|
|
|
*
|
|
|
|
|
* For most purposes this function is deprecated in favor of
|
|
|
|
|
* g_object_set_data(). However, for historical reasons GTK+ stores
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* the #GtkWidget that owns a #GdkSurface as user data on the
|
|
|
|
|
* #GdkSurface. So, custom widget implementations should use
|
|
|
|
|
* this function for that. If GTK+ receives an event for a #GdkSurface,
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* and the user data for the surface is non-%NULL, GTK+ will assume the
|
2001-10-03 18:19:48 +00:00
|
|
|
|
* user data is a #GtkWidget, and forward the event to that widget.
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2001-10-03 18:19:48 +00:00
|
|
|
|
**/
|
1997-11-24 22:37:52 +00:00
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_user_data (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gpointer user_data)
|
1998-01-01 20:38:21 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2008-10-21 21:42:39 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->user_data = user_data;
|
1998-01-01 20:38:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-10-03 18:19:48 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_user_data:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2011-01-18 09:10:30 +00:00
|
|
|
|
* @data: (out): return location for user data
|
2001-10-03 18:19:48 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Retrieves the user data for @surface, which is normally the widget
|
|
|
|
|
* that @surface belongs to. See gdk_surface_set_user_data().
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2001-10-03 18:19:48 +00:00
|
|
|
|
**/
|
1997-11-24 22:37:52 +00:00
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_user_data (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gpointer *data)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
*data = surface->user_data;
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-10-03 18:19:48 +00:00
|
|
|
|
/**
|
2018-03-20 11:05:26 +00:00
|
|
|
|
* gdk_surface_get_surface_type:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Gets the type of the surface. See #GdkSurfaceType.
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: type of surface
|
2001-10-03 18:19:48 +00:00
|
|
|
|
**/
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceType
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_surface_type (GdkSurface *surface)
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), (GdkSurfaceType) -1);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return GDK_SURFACE_TYPE (surface);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-08-29 00:03:19 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_display:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2010-08-29 00:03:19 +00:00
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* Gets the #GdkDisplay associated with a #GdkSurface.
|
2010-08-29 00:03:19 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: (transfer none): the #GdkDisplay associated with @surface
|
2010-08-29 00:03:19 +00:00
|
|
|
|
**/
|
|
|
|
|
GdkDisplay *
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_display (GdkSurface *surface)
|
2010-08-29 00:03:19 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
|
2010-08-29 00:03:19 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface->display;
|
2010-08-29 00:03:19 +00:00
|
|
|
|
}
|
2009-09-04 15:49:57 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_is_destroyed:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2009-09-04 15:49:57 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Check to see if a surface is destroyed..
|
2009-09-04 15:49:57 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: %TRUE if the surface is destroyed
|
2009-09-04 15:49:57 +00:00
|
|
|
|
**/
|
|
|
|
|
gboolean
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_is_destroyed (GdkSurface *surface)
|
2009-09-04 15:49:57 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return GDK_SURFACE_DESTROYED (surface);
|
2009-09-04 15:49:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-06-28 22:31:39 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_has_native:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2010-06-28 22:31:39 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Checks whether the surface has a native surface or not.
|
2010-06-28 22:31:39 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: %TRUE if the @surface has a native surface, %FALSE otherwise.
|
2010-06-28 22:31:39 +00:00
|
|
|
|
*/
|
|
|
|
|
gboolean
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_has_native (GdkSurface *surface)
|
2010-06-28 22:31:39 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
|
2010-06-28 22:31:39 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface->parent == NULL || surface->parent->impl != surface->impl;
|
2010-06-28 22:31:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-10-03 18:19:48 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_position:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
* @x: (out) (allow-none): X coordinate of surface
|
|
|
|
|
* @y: (out) (allow-none): Y coordinate of surface
|
2001-10-03 18:19:48 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Obtains the position of the surface as reported in the
|
2002-01-13 20:13:34 +00:00
|
|
|
|
* most-recently-processed #GdkEventConfigure. Contrast with
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_geometry() which queries the X server for the
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* current surface position, regardless of which events have been
|
2002-01-13 20:13:34 +00:00
|
|
|
|
* received or processed.
|
2001-10-03 18:19:48 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* The position coordinates are relative to the surface’s parent surface.
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2001-10-03 18:19:48 +00:00
|
|
|
|
**/
|
1997-11-24 22:37:52 +00:00
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_position (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gint *x,
|
|
|
|
|
gint *y)
|
1999-11-08 20:14:59 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
1999-11-08 20:14:59 +00:00
|
|
|
|
if (x)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
*x = surface->x;
|
1999-11-08 20:14:59 +00:00
|
|
|
|
if (y)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
*y = surface->y;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-10-03 18:19:48 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_parent:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Obtains the parent of @surface, as known to GDK. Does not query the
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* X server; thus this returns the parent as passed to gdk_surface_new(),
|
2014-02-07 18:37:09 +00:00
|
|
|
|
* not the actual parent. This should never matter unless you’re using
|
2001-10-03 18:19:48 +00:00
|
|
|
|
* Xlib calls mixed with GDK calls on the X11 platform. It may also
|
|
|
|
|
* matter for toplevel windows, because the window manager may choose
|
|
|
|
|
* to reparent them.
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: (transfer none): parent of @surface
|
2001-10-03 18:19:48 +00:00
|
|
|
|
**/
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_parent (GdkSurface *surface)
|
1998-11-06 22:05:02 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (gdk_surface_is_subsurface (surface))
|
|
|
|
|
return surface->transient_for;
|
2017-02-01 14:09:52 +00:00
|
|
|
|
else
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface->parent;
|
1998-11-06 22:05:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-10-03 18:19:48 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_toplevel:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Gets the toplevel surface that’s an ancestor of @surface.
|
2009-01-28 15:37:56 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Any surface type but %GDK_SURFACE_CHILD is considered a
|
|
|
|
|
* toplevel surface, as is a %GDK_SURFACE_CHILD surface that
|
|
|
|
|
* has a root surface as parent.
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: (transfer none): the toplevel surface containing @surface
|
2001-10-03 18:19:48 +00:00
|
|
|
|
**/
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_toplevel (GdkSurface *surface)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
|
1999-11-08 20:14:59 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
while (surface->surface_type == GDK_SURFACE_CHILD ||
|
|
|
|
|
surface->surface_type == GDK_SURFACE_SUBSURFACE)
|
2009-01-28 15:37:56 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (gdk_surface_is_toplevel (surface))
|
2018-03-21 08:06:31 +00:00
|
|
|
|
break;
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface = surface->parent;
|
2009-01-28 15:37:56 +00:00
|
|
|
|
}
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface;
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-10-03 18:19:48 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_children:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Gets the list of children of @surface known to GDK.
|
2001-10-03 18:19:48 +00:00
|
|
|
|
* This function only returns children created via GDK,
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* so for example it’s useless when used with the root window;
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* it only returns surfaces an application created itself.
|
2001-10-03 18:19:48 +00:00
|
|
|
|
*
|
|
|
|
|
* The returned list must be freed, but the elements in the
|
|
|
|
|
* list need not be.
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* Returns: (transfer container) (element-type GdkSurface):
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* list of child surfaces inside @surface
|
2001-10-03 18:19:48 +00:00
|
|
|
|
**/
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
GList*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_children (GdkSurface *surface)
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (GDK_SURFACE_DESTROYED (surface))
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
return NULL;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return g_list_copy (surface->children);
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-10-03 18:19:48 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_peek_children:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* Like gdk_surface_get_children(), but does not copy the list of
|
2001-10-03 18:19:48 +00:00
|
|
|
|
* children, so the list does not need to be freed.
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* Returns: (transfer none) (element-type GdkSurface):
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* a reference to the list of child surfaces in @surface
|
2001-10-03 18:19:48 +00:00
|
|
|
|
**/
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
GList *
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_peek_children (GdkSurface *surface)
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (GDK_SURFACE_DESTROYED (surface))
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
return NULL;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface->children;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-05-03 08:39:24 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_children_with_user_data:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2013-09-17 05:13:03 +00:00
|
|
|
|
* @user_data: user data to look for
|
2013-05-03 08:39:24 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Gets the list of children of @surface known to GDK with a
|
2013-09-17 05:13:03 +00:00
|
|
|
|
* particular @user_data set on it.
|
2013-05-03 08:39:24 +00:00
|
|
|
|
*
|
|
|
|
|
* The returned list must be freed, but the elements in the
|
|
|
|
|
* list need not be.
|
|
|
|
|
*
|
|
|
|
|
* The list is returned in (relative) stacking order, i.e. the
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* lowest surface is first.
|
2013-05-03 08:39:24 +00:00
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* Returns: (transfer container) (element-type GdkSurface):
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* list of child surfaces inside @surface
|
2013-05-03 08:39:24 +00:00
|
|
|
|
**/
|
|
|
|
|
GList *
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_children_with_user_data (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gpointer user_data)
|
2013-05-03 08:39:24 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *child;
|
2013-05-03 08:39:24 +00:00
|
|
|
|
GList *res, *l;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
|
2013-05-03 08:39:24 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (GDK_SURFACE_DESTROYED (surface))
|
2013-05-03 08:39:24 +00:00
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
res = NULL;
|
2018-03-20 14:14:10 +00:00
|
|
|
|
for (l = surface->children; l != NULL; l = l->next)
|
2013-05-03 08:39:24 +00:00
|
|
|
|
{
|
|
|
|
|
child = l->data;
|
|
|
|
|
|
|
|
|
|
if (child->user_data == user_data)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
res = g_list_prepend (res, child);
|
2013-05-03 08:39:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-10-03 18:19:48 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_is_visible:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Checks whether the surface has been mapped (with gdk_surface_show() or
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_show_unraised()).
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: %TRUE if the surface is mapped
|
2001-10-03 18:19:48 +00:00
|
|
|
|
**/
|
2009-06-01 10:04:36 +00:00
|
|
|
|
gboolean
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_is_visible (GdkSurface *surface)
|
1999-01-15 16:00:39 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return GDK_SURFACE_IS_MAPPED (surface);
|
1999-01-15 16:00:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-10-03 18:19:48 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_is_viewable:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Check if the surface and all ancestors of the surface are
|
2001-10-03 18:19:48 +00:00
|
|
|
|
* mapped. (This is not necessarily "viewable" in the X sense, since
|
2018-03-20 11:05:26 +00:00
|
|
|
|
* we only check as far as we have GDK surface parents, not to the root
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* surface.)
|
2002-01-13 20:13:34 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: %TRUE if the surface is viewable
|
2001-10-03 18:19:48 +00:00
|
|
|
|
**/
|
2009-06-01 10:04:36 +00:00
|
|
|
|
gboolean
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_is_viewable (GdkSurface *surface)
|
1999-01-15 16:00:39 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
|
2003-06-09 01:55:01 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->destroyed)
|
2009-07-18 18:29:50 +00:00
|
|
|
|
return FALSE;
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface->viewable;
|
1999-01-15 16:00:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-02-27 20:40:15 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_state:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Gets the bitwise OR of the currently active surface state flags,
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* from the #GdkSurfaceState enumeration.
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: surface state bitfield
|
2001-02-27 20:40:15 +00:00
|
|
|
|
**/
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceState
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_state (GdkSurface *surface)
|
2001-02-27 20:40:15 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface->state;
|
2001-02-27 20:40:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-10-09 08:45:44 +00:00
|
|
|
|
GdkGLContext *
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_paint_gl_context (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GError **error)
|
2014-10-09 08:45:44 +00:00
|
|
|
|
{
|
GL: Split GL context creation in two phases
One of the major requests by OpenGL users has been the ability to
specify settings when creating a GL context, like the version to use
or whether the debug support should be enabled.
We have a couple of requirements in terms of API:
• avoid, if at all possible, the "C arrays of integers with
attribute, value pairs", which are hard to write and hard
to bind in non-C languages.
• allow failing in a recoverable way.
• do not make the GL context creation API a mess of arguments.
Looking at prior art, it seems that a common pattern is to split the
construction phase in two:
• a first phase that creates a GL context wrapper object and
does preliminary checks on the environment.
• a second phase that creates the backend-specific GL object.
We adopted a similar pattern:
• gdk_window_create_gl_context() creates a GdkGLContext
• gdk_gl_context_realize() creates the underlying resources
Calling gdk_gl_context_make_current() also realizes the context, so
simple GL users do not need to care. Advanced users will want to
call gdk_window_create_gl_context(), set up the optional requirements,
and then call gdk_gl_context_realize(). If either of these two steps
fails, it's possible to recover by changing the requirements, or simply
creating a new GdkGLContext instance.
https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-01-27 21:23:23 +00:00
|
|
|
|
GError *internal_error = NULL;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (GDK_DISPLAY_DEBUG_CHECK (surface->display, GL_DISABLE))
|
2014-10-16 01:13:45 +00:00
|
|
|
|
{
|
|
|
|
|
g_set_error_literal (error, GDK_GL_ERROR,
|
|
|
|
|
GDK_GL_ERROR_NOT_AVAILABLE,
|
|
|
|
|
_("GL support disabled via GDK_DEBUG"));
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->impl_surface->gl_paint_context == NULL)
|
2014-11-06 08:15:03 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GdkSurfaceImplClass *impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
|
2016-05-23 07:34:39 +00:00
|
|
|
|
|
|
|
|
|
if (impl_class->create_gl_context == NULL)
|
|
|
|
|
{
|
|
|
|
|
g_set_error_literal (error, GDK_GL_ERROR, GDK_GL_ERROR_NOT_AVAILABLE,
|
|
|
|
|
_("The current backend does not support OpenGL"));
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->impl_surface->gl_paint_context =
|
|
|
|
|
impl_class->create_gl_context (surface->impl_surface,
|
2016-05-23 07:34:39 +00:00
|
|
|
|
TRUE,
|
|
|
|
|
NULL,
|
|
|
|
|
&internal_error);
|
2014-11-06 08:15:03 +00:00
|
|
|
|
}
|
2014-10-09 08:45:44 +00:00
|
|
|
|
|
GL: Split GL context creation in two phases
One of the major requests by OpenGL users has been the ability to
specify settings when creating a GL context, like the version to use
or whether the debug support should be enabled.
We have a couple of requirements in terms of API:
• avoid, if at all possible, the "C arrays of integers with
attribute, value pairs", which are hard to write and hard
to bind in non-C languages.
• allow failing in a recoverable way.
• do not make the GL context creation API a mess of arguments.
Looking at prior art, it seems that a common pattern is to split the
construction phase in two:
• a first phase that creates a GL context wrapper object and
does preliminary checks on the environment.
• a second phase that creates the backend-specific GL object.
We adopted a similar pattern:
• gdk_window_create_gl_context() creates a GdkGLContext
• gdk_gl_context_realize() creates the underlying resources
Calling gdk_gl_context_make_current() also realizes the context, so
simple GL users do not need to care. Advanced users will want to
call gdk_window_create_gl_context(), set up the optional requirements,
and then call gdk_gl_context_realize(). If either of these two steps
fails, it's possible to recover by changing the requirements, or simply
creating a new GdkGLContext instance.
https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-01-27 21:23:23 +00:00
|
|
|
|
if (internal_error != NULL)
|
|
|
|
|
{
|
|
|
|
|
g_propagate_error (error, internal_error);
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_clear_object (&(surface->impl_surface->gl_paint_context));
|
GL: Split GL context creation in two phases
One of the major requests by OpenGL users has been the ability to
specify settings when creating a GL context, like the version to use
or whether the debug support should be enabled.
We have a couple of requirements in terms of API:
• avoid, if at all possible, the "C arrays of integers with
attribute, value pairs", which are hard to write and hard
to bind in non-C languages.
• allow failing in a recoverable way.
• do not make the GL context creation API a mess of arguments.
Looking at prior art, it seems that a common pattern is to split the
construction phase in two:
• a first phase that creates a GL context wrapper object and
does preliminary checks on the environment.
• a second phase that creates the backend-specific GL object.
We adopted a similar pattern:
• gdk_window_create_gl_context() creates a GdkGLContext
• gdk_gl_context_realize() creates the underlying resources
Calling gdk_gl_context_make_current() also realizes the context, so
simple GL users do not need to care. Advanced users will want to
call gdk_window_create_gl_context(), set up the optional requirements,
and then call gdk_gl_context_realize(). If either of these two steps
fails, it's possible to recover by changing the requirements, or simply
creating a new GdkGLContext instance.
https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-01-27 21:23:23 +00:00
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_gl_context_realize (surface->impl_surface->gl_paint_context, &internal_error);
|
GL: Split GL context creation in two phases
One of the major requests by OpenGL users has been the ability to
specify settings when creating a GL context, like the version to use
or whether the debug support should be enabled.
We have a couple of requirements in terms of API:
• avoid, if at all possible, the "C arrays of integers with
attribute, value pairs", which are hard to write and hard
to bind in non-C languages.
• allow failing in a recoverable way.
• do not make the GL context creation API a mess of arguments.
Looking at prior art, it seems that a common pattern is to split the
construction phase in two:
• a first phase that creates a GL context wrapper object and
does preliminary checks on the environment.
• a second phase that creates the backend-specific GL object.
We adopted a similar pattern:
• gdk_window_create_gl_context() creates a GdkGLContext
• gdk_gl_context_realize() creates the underlying resources
Calling gdk_gl_context_make_current() also realizes the context, so
simple GL users do not need to care. Advanced users will want to
call gdk_window_create_gl_context(), set up the optional requirements,
and then call gdk_gl_context_realize(). If either of these two steps
fails, it's possible to recover by changing the requirements, or simply
creating a new GdkGLContext instance.
https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-01-27 21:23:23 +00:00
|
|
|
|
if (internal_error != NULL)
|
|
|
|
|
{
|
|
|
|
|
g_propagate_error (error, internal_error);
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_clear_object (&(surface->impl_surface->gl_paint_context));
|
GL: Split GL context creation in two phases
One of the major requests by OpenGL users has been the ability to
specify settings when creating a GL context, like the version to use
or whether the debug support should be enabled.
We have a couple of requirements in terms of API:
• avoid, if at all possible, the "C arrays of integers with
attribute, value pairs", which are hard to write and hard
to bind in non-C languages.
• allow failing in a recoverable way.
• do not make the GL context creation API a mess of arguments.
Looking at prior art, it seems that a common pattern is to split the
construction phase in two:
• a first phase that creates a GL context wrapper object and
does preliminary checks on the environment.
• a second phase that creates the backend-specific GL object.
We adopted a similar pattern:
• gdk_window_create_gl_context() creates a GdkGLContext
• gdk_gl_context_realize() creates the underlying resources
Calling gdk_gl_context_make_current() also realizes the context, so
simple GL users do not need to care. Advanced users will want to
call gdk_window_create_gl_context(), set up the optional requirements,
and then call gdk_gl_context_realize(). If either of these two steps
fails, it's possible to recover by changing the requirements, or simply
creating a new GdkGLContext instance.
https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-01-27 21:23:23 +00:00
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface->impl_surface->gl_paint_context;
|
2014-10-09 08:45:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_create_gl_context:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2014-10-09 08:45:44 +00:00
|
|
|
|
* @error: return location for an error
|
|
|
|
|
*
|
2014-10-09 14:09:05 +00:00
|
|
|
|
* Creates a new #GdkGLContext matching the
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* framebuffer format to the visual of the #GdkSurface. The context
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* is disconnected from any particular surface or surface.
|
2014-10-09 08:45:44 +00:00
|
|
|
|
*
|
|
|
|
|
* If the creation of the #GdkGLContext failed, @error will be set.
|
|
|
|
|
*
|
GL: Split GL context creation in two phases
One of the major requests by OpenGL users has been the ability to
specify settings when creating a GL context, like the version to use
or whether the debug support should be enabled.
We have a couple of requirements in terms of API:
• avoid, if at all possible, the "C arrays of integers with
attribute, value pairs", which are hard to write and hard
to bind in non-C languages.
• allow failing in a recoverable way.
• do not make the GL context creation API a mess of arguments.
Looking at prior art, it seems that a common pattern is to split the
construction phase in two:
• a first phase that creates a GL context wrapper object and
does preliminary checks on the environment.
• a second phase that creates the backend-specific GL object.
We adopted a similar pattern:
• gdk_window_create_gl_context() creates a GdkGLContext
• gdk_gl_context_realize() creates the underlying resources
Calling gdk_gl_context_make_current() also realizes the context, so
simple GL users do not need to care. Advanced users will want to
call gdk_window_create_gl_context(), set up the optional requirements,
and then call gdk_gl_context_realize(). If either of these two steps
fails, it's possible to recover by changing the requirements, or simply
creating a new GdkGLContext instance.
https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-01-27 21:23:23 +00:00
|
|
|
|
* Before using the returned #GdkGLContext, you will need to
|
2015-02-12 12:34:28 +00:00
|
|
|
|
* call gdk_gl_context_make_current() or gdk_gl_context_realize().
|
GL: Split GL context creation in two phases
One of the major requests by OpenGL users has been the ability to
specify settings when creating a GL context, like the version to use
or whether the debug support should be enabled.
We have a couple of requirements in terms of API:
• avoid, if at all possible, the "C arrays of integers with
attribute, value pairs", which are hard to write and hard
to bind in non-C languages.
• allow failing in a recoverable way.
• do not make the GL context creation API a mess of arguments.
Looking at prior art, it seems that a common pattern is to split the
construction phase in two:
• a first phase that creates a GL context wrapper object and
does preliminary checks on the environment.
• a second phase that creates the backend-specific GL object.
We adopted a similar pattern:
• gdk_window_create_gl_context() creates a GdkGLContext
• gdk_gl_context_realize() creates the underlying resources
Calling gdk_gl_context_make_current() also realizes the context, so
simple GL users do not need to care. Advanced users will want to
call gdk_window_create_gl_context(), set up the optional requirements,
and then call gdk_gl_context_realize(). If either of these two steps
fails, it's possible to recover by changing the requirements, or simply
creating a new GdkGLContext instance.
https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-01-27 21:23:23 +00:00
|
|
|
|
*
|
2014-10-09 08:45:44 +00:00
|
|
|
|
* Returns: (transfer full): the newly created #GdkGLContext, or
|
|
|
|
|
* %NULL on error
|
|
|
|
|
**/
|
|
|
|
|
GdkGLContext *
|
2018-04-11 22:16:43 +00:00
|
|
|
|
gdk_surface_create_gl_context (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GError **error)
|
2014-10-09 08:45:44 +00:00
|
|
|
|
{
|
|
|
|
|
GdkGLContext *paint_context;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
|
2014-10-09 08:45:44 +00:00
|
|
|
|
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
paint_context = gdk_surface_get_paint_gl_context (surface, error);
|
2014-10-09 08:45:44 +00:00
|
|
|
|
if (paint_context == NULL)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->create_gl_context (surface->impl_surface,
|
2018-04-11 22:16:43 +00:00
|
|
|
|
FALSE,
|
|
|
|
|
paint_context,
|
|
|
|
|
error);
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-12 14:48:31 +00:00
|
|
|
|
/**
|
|
|
|
|
* gdk_surface_create_cairo_context:
|
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
*
|
|
|
|
|
* Creates a new #GdkCairoContext for rendering on @surface.
|
|
|
|
|
*
|
|
|
|
|
* Returns: (transfer full): the newly created #GdkCairoContext
|
|
|
|
|
**/
|
2018-04-11 22:16:43 +00:00
|
|
|
|
GdkCairoContext *
|
|
|
|
|
gdk_surface_create_cairo_context (GdkSurface *surface)
|
|
|
|
|
{
|
2018-04-12 14:48:31 +00:00
|
|
|
|
GdkDisplay *display;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
|
|
|
|
|
|
|
|
|
|
display = gdk_surface_get_display (surface);
|
|
|
|
|
|
|
|
|
|
return g_object_new (GDK_DISPLAY_GET_CLASS (display)->cairo_context_type,
|
2018-04-11 22:16:43 +00:00
|
|
|
|
"surface", surface,
|
|
|
|
|
NULL);
|
2014-10-09 08:45:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-11-28 15:34:01 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_create_vulkan_context:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2016-11-28 15:34:01 +00:00
|
|
|
|
* @error: return location for an error
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Creates a new #GdkVulkanContext for rendering on @surface.
|
2016-11-28 15:34:01 +00:00
|
|
|
|
*
|
|
|
|
|
* If the creation of the #GdkVulkanContext failed, @error will be set.
|
|
|
|
|
*
|
|
|
|
|
* Returns: (transfer full): the newly created #GdkVulkanContext, or
|
|
|
|
|
* %NULL on error
|
|
|
|
|
**/
|
|
|
|
|
GdkVulkanContext *
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_create_vulkan_context (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GError **error)
|
2016-11-28 15:34:01 +00:00
|
|
|
|
{
|
|
|
|
|
GdkDisplay *display;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
|
2016-11-28 15:34:01 +00:00
|
|
|
|
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (GDK_DISPLAY_DEBUG_CHECK (surface->display, VULKAN_DISABLE))
|
2016-11-29 14:35:04 +00:00
|
|
|
|
{
|
|
|
|
|
g_set_error_literal (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_NOT_AVAILABLE,
|
|
|
|
|
_("Vulkan support disabled via GDK_DEBUG"));
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
display = gdk_surface_get_display (surface);
|
2016-11-28 15:34:01 +00:00
|
|
|
|
|
|
|
|
|
if (GDK_DISPLAY_GET_CLASS (display)->vk_extension_name == NULL)
|
|
|
|
|
{
|
|
|
|
|
g_set_error (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_UNSUPPORTED,
|
|
|
|
|
"The %s backend has no Vulkan support.", G_OBJECT_TYPE_NAME (display));
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return g_initable_new (GDK_DISPLAY_GET_CLASS (display)->vk_context_type,
|
|
|
|
|
NULL,
|
|
|
|
|
error,
|
2018-03-20 14:14:10 +00:00
|
|
|
|
"surface", surface,
|
2016-11-28 15:34:01 +00:00
|
|
|
|
NULL);
|
|
|
|
|
}
|
|
|
|
|
|
2000-03-28 01:24:44 +00:00
|
|
|
|
/* Code for dirty-region queueing
|
|
|
|
|
*/
|
2018-03-20 14:14:10 +00:00
|
|
|
|
static GSList *update_surfaces = NULL;
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
|
static inline gboolean
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_is_ancestor (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkSurface *ancestor)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
while (surface)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GdkSurface *parent = surface->parent;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
|
|
|
|
if (parent == ancestor)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
return TRUE;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface = parent;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_add_update_surface (GdkSurface *surface)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
|
|
|
|
GSList *tmp;
|
|
|
|
|
GSList *prev = NULL;
|
|
|
|
|
gboolean has_ancestor_in_list = FALSE;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* Check whether "surface" is already in "update_surfaces" list.
|
2013-12-18 11:23:28 +00:00
|
|
|
|
* It could be added during execution of gtk_widget_destroy() when
|
|
|
|
|
* setting focus widget to NULL and redrawing old focus widget.
|
|
|
|
|
* See bug 711552.
|
|
|
|
|
*/
|
2018-03-20 14:14:10 +00:00
|
|
|
|
tmp = g_slist_find (update_surfaces, surface);
|
2013-12-18 11:23:28 +00:00
|
|
|
|
if (tmp != NULL)
|
|
|
|
|
return;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
for (tmp = update_surfaces; tmp; tmp = tmp->next)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GdkSurface *parent = surface->parent;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* check if tmp is an ancestor of "surface"; if it is, set a
|
|
|
|
|
* flag indicating that all following surfaces are either
|
|
|
|
|
* children of "surface" or from a differen hierarchy
|
2008-07-18 13:03:42 +00:00
|
|
|
|
*/
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (!has_ancestor_in_list && gdk_surface_is_ancestor (surface, tmp->data))
|
2018-03-21 08:06:31 +00:00
|
|
|
|
has_ancestor_in_list = TRUE;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
|
|
|
|
/* insert in reverse stacking order when adding around siblings,
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* so processing updates properly paints over lower stacked surfaces
|
2008-07-18 13:03:42 +00:00
|
|
|
|
*/
|
2018-03-20 10:40:08 +00:00
|
|
|
|
if (parent == GDK_SURFACE (tmp->data)->parent)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
{
|
2017-11-06 00:28:37 +00:00
|
|
|
|
if (parent != NULL)
|
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gint index = g_list_index (parent->children, surface);
|
2018-03-20 10:40:08 +00:00
|
|
|
|
for (; tmp && parent == GDK_SURFACE (tmp->data)->parent; tmp = tmp->next)
|
2017-11-06 00:28:37 +00:00
|
|
|
|
{
|
|
|
|
|
gint sibling_index = g_list_index (parent->children, tmp->data);
|
|
|
|
|
if (index > sibling_index)
|
|
|
|
|
break;
|
|
|
|
|
prev = tmp;
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-03-21 08:06:31 +00:00
|
|
|
|
/* here, tmp got advanced past all lower stacked siblings */
|
|
|
|
|
tmp = g_slist_prepend (tmp, g_object_ref (surface));
|
|
|
|
|
if (prev)
|
|
|
|
|
prev->next = tmp;
|
|
|
|
|
else
|
|
|
|
|
update_surfaces = tmp;
|
|
|
|
|
return;
|
|
|
|
|
}
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* if "surface" has an ancestor in the list and tmp is one of
|
|
|
|
|
* "surface's" children, insert "surface" before tmp
|
2008-07-18 13:03:42 +00:00
|
|
|
|
*/
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (has_ancestor_in_list && gdk_surface_is_ancestor (tmp->data, surface))
|
2018-03-21 08:06:31 +00:00
|
|
|
|
{
|
|
|
|
|
tmp = g_slist_prepend (tmp, g_object_ref (surface));
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2018-03-21 08:06:31 +00:00
|
|
|
|
if (prev)
|
|
|
|
|
prev->next = tmp;
|
|
|
|
|
else
|
|
|
|
|
update_surfaces = tmp;
|
|
|
|
|
return;
|
|
|
|
|
}
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
|
|
|
|
/* if we're at the end of the list and had an ancestor it it,
|
|
|
|
|
* append to the list
|
|
|
|
|
*/
|
|
|
|
|
if (! tmp->next && has_ancestor_in_list)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
{
|
|
|
|
|
tmp = g_slist_append (tmp, g_object_ref (surface));
|
|
|
|
|
return;
|
|
|
|
|
}
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
|
|
|
|
prev = tmp;
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* if all above checks failed ("surface" is from a different
|
2008-07-18 13:03:42 +00:00
|
|
|
|
* hierarchy than what is already in the list) or the list is
|
|
|
|
|
* empty, prepend
|
|
|
|
|
*/
|
2018-03-20 14:14:10 +00:00
|
|
|
|
update_surfaces = g_slist_prepend (update_surfaces, g_object_ref (surface));
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_remove_update_surface (GdkSurface *surface)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2013-12-12 14:02:19 +00:00
|
|
|
|
GSList *link;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
link = g_slist_find (update_surfaces, surface);
|
2013-12-12 14:02:19 +00:00
|
|
|
|
if (link != NULL)
|
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
update_surfaces = g_slist_delete_link (update_surfaces, link);
|
|
|
|
|
g_object_unref (surface);
|
2013-12-12 14:02:19 +00:00
|
|
|
|
}
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-09-12 17:13:24 +00:00
|
|
|
|
static gboolean
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_is_toplevel_frozen (GdkSurface *surface)
|
2007-09-12 17:13:24 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *toplevel;
|
2007-09-12 17:13:24 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
toplevel = gdk_surface_get_toplevel (surface);
|
2007-09-12 17:13:24 +00:00
|
|
|
|
|
|
|
|
|
return toplevel->update_and_descendants_freeze_count > 0;
|
|
|
|
|
}
|
|
|
|
|
|
2004-08-26 14:09:08 +00:00
|
|
|
|
static void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_schedule_update (GdkSurface *surface)
|
2004-08-26 14:09:08 +00:00
|
|
|
|
{
|
2013-01-30 20:09:44 +00:00
|
|
|
|
GdkFrameClock *frame_clock;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface &&
|
|
|
|
|
(surface->update_freeze_count ||
|
|
|
|
|
gdk_surface_is_toplevel_frozen (surface)))
|
2004-08-26 14:09:08 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* If there's no frame clock (a foreign surface), then the invalid
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* region will just stick around unless gdk_surface_process_updates()
|
2013-01-30 20:09:44 +00:00
|
|
|
|
* is called. */
|
2018-03-20 14:14:10 +00:00
|
|
|
|
frame_clock = gdk_surface_get_frame_clock (surface);
|
2013-01-30 20:09:44 +00:00
|
|
|
|
if (frame_clock)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_frame_clock_request_phase (gdk_surface_get_frame_clock (surface),
|
2013-01-30 20:09:44 +00:00
|
|
|
|
GDK_FRAME_CLOCK_PHASE_PAINT);
|
2004-08-26 14:09:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-21 20:58:08 +00:00
|
|
|
|
static void
|
|
|
|
|
gdk_surface_process_updates_recurse (GdkSurface *surface,
|
|
|
|
|
cairo_region_t *expose_region)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2017-10-25 10:29:43 +00:00
|
|
|
|
GdkEvent *event;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->destroyed)
|
2014-06-23 20:12:45 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* Paint the surface before the children, clipped to the surface region */
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2017-10-25 10:29:43 +00:00
|
|
|
|
event = gdk_event_new (GDK_EXPOSE);
|
2018-03-20 14:14:10 +00:00
|
|
|
|
event->any.surface = g_object_ref (surface);
|
2017-10-25 10:29:43 +00:00
|
|
|
|
event->any.send_event = FALSE;
|
2018-03-21 02:51:29 +00:00
|
|
|
|
event->expose.region = cairo_region_reference (expose_region);
|
2011-12-01 12:42:09 +00:00
|
|
|
|
|
2017-10-25 10:29:43 +00:00
|
|
|
|
_gdk_event_emit (event);
|
2018-05-29 19:53:44 +00:00
|
|
|
|
g_object_unref (event);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* Process and remove any invalid area on the native surface by creating
|
|
|
|
|
* expose events for the surface and all non-native descendants.
|
2009-08-14 10:09:02 +00:00
|
|
|
|
*/
|
2000-03-28 01:24:44 +00:00
|
|
|
|
static void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_process_updates_internal (GdkSurface *surface)
|
2000-03-28 01:24:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* Ensure the surface lives while updating it */
|
|
|
|
|
g_object_ref (surface);
|
2009-08-20 15:09:08 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->in_update = TRUE;
|
2013-04-17 21:06:07 +00:00
|
|
|
|
|
2000-05-05 15:57:48 +00:00
|
|
|
|
/* If an update got queued during update processing, we can get a
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* surface in the update queue that has an empty update_area.
|
2000-05-05 15:57:48 +00:00
|
|
|
|
* just ignore it.
|
|
|
|
|
*/
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->update_area)
|
2000-05-05 15:57:48 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_assert (surface->active_update_area == NULL); /* No reentrancy */
|
2014-10-09 08:09:51 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->active_update_area = surface->update_area;
|
|
|
|
|
surface->update_area = NULL;
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (gdk_surface_is_viewable (surface))
|
2018-03-21 08:06:31 +00:00
|
|
|
|
{
|
|
|
|
|
cairo_region_t *expose_region;
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
|
2018-03-21 08:06:31 +00:00
|
|
|
|
expose_region = cairo_region_copy (surface->active_update_area);
|
2014-10-09 08:09:51 +00:00
|
|
|
|
|
2018-03-21 20:58:08 +00:00
|
|
|
|
gdk_surface_process_updates_recurse (surface, expose_region);
|
2014-06-21 22:03:56 +00:00
|
|
|
|
|
2014-10-15 02:46:26 +00:00
|
|
|
|
cairo_region_destroy (expose_region);
|
2014-10-09 08:09:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
cairo_region_destroy (surface->active_update_area);
|
|
|
|
|
surface->active_update_area = NULL;
|
2000-03-28 01:24:44 +00:00
|
|
|
|
}
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->in_update = FALSE;
|
2013-04-17 21:06:07 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_object_unref (surface);
|
2000-03-28 01:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-04-30 16:46:22 +00:00
|
|
|
|
static void
|
2018-03-20 10:40:08 +00:00
|
|
|
|
gdk_surface_paint_on_clock (GdkFrameClock *clock,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
void *data)
|
2013-06-26 08:03:51 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GdkSurface *surface;
|
2013-06-26 08:03:51 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface = GDK_SURFACE (data);
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
|
|
|
|
g_return_if_fail (surface->impl_surface == surface);
|
2008-10-21 21:42:39 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (GDK_SURFACE_DESTROYED (surface))
|
2009-08-20 15:09:08 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_object_ref (surface);
|
2009-09-14 11:24:55 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->update_area &&
|
|
|
|
|
!surface->update_freeze_count &&
|
|
|
|
|
!gdk_surface_is_toplevel_frozen (surface) &&
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2016-11-23 18:32:27 +00:00
|
|
|
|
/* Don't recurse into process_updates_internal, we'll
|
|
|
|
|
* do the update later when idle instead. */
|
2018-03-20 14:14:10 +00:00
|
|
|
|
!surface->in_update)
|
2000-03-28 01:24:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_process_updates_internal (surface);
|
|
|
|
|
gdk_surface_remove_update_surface (surface);
|
2000-03-28 01:24:44 +00:00
|
|
|
|
}
|
2009-08-20 15:09:08 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_object_unref (surface);
|
2000-03-28 01:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-21 03:07:37 +00:00
|
|
|
|
/**
|
|
|
|
|
* gdk_surface_invalidate_rect:
|
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
* @rect: (allow-none): rectangle to invalidate or %NULL to invalidate the whole
|
|
|
|
|
* surface
|
|
|
|
|
*
|
|
|
|
|
* A convenience wrapper around gdk_surface_invalidate_region() which
|
|
|
|
|
* invalidates a rectangular region. See
|
|
|
|
|
* gdk_surface_invalidate_region() for details.
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gdk_surface_invalidate_rect (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
const GdkRectangle *rect)
|
2000-03-28 01:24:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GdkRectangle surface_rect;
|
2010-06-28 12:54:37 +00:00
|
|
|
|
cairo_region_t *region;
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (GDK_SURFACE_DESTROYED (surface))
|
2000-05-15 16:09:53 +00:00
|
|
|
|
return;
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->input_only || !surface->viewable)
|
2000-07-31 17:18:36 +00:00
|
|
|
|
return;
|
|
|
|
|
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
if (!rect)
|
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface_rect.x = 0;
|
|
|
|
|
surface_rect.y = 0;
|
|
|
|
|
surface_rect.width = surface->width;
|
|
|
|
|
surface_rect.height = surface->height;
|
|
|
|
|
rect = &surface_rect;
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
}
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
|
|
2010-06-28 12:44:12 +00:00
|
|
|
|
region = cairo_region_create_rectangle (rect);
|
2018-03-21 03:07:37 +00:00
|
|
|
|
gdk_surface_invalidate_region (surface, region);
|
2010-06-28 12:44:12 +00:00
|
|
|
|
cairo_region_destroy (region);
|
2000-03-28 01:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-09-14 11:28:38 +00:00
|
|
|
|
static void
|
2018-03-28 14:42:26 +00:00
|
|
|
|
impl_surface_add_update_area (GdkSurface *impl_surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
cairo_region_t *region)
|
2009-09-14 11:28:38 +00:00
|
|
|
|
{
|
2018-03-20 11:05:26 +00:00
|
|
|
|
if (impl_surface->update_area)
|
|
|
|
|
cairo_region_union (impl_surface->update_area, region);
|
2009-09-14 11:28:38 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_add_update_surface (impl_surface);
|
2018-03-20 11:05:26 +00:00
|
|
|
|
impl_surface->update_area = cairo_region_copy (region);
|
|
|
|
|
gdk_surface_schedule_update (impl_surface);
|
2009-09-14 11:28:38 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-28 14:42:26 +00:00
|
|
|
|
/**
|
|
|
|
|
* gdk_surface_queue_expose:
|
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
*
|
|
|
|
|
* Forces an expose event for @surface to be scheduled.
|
|
|
|
|
*
|
|
|
|
|
* If the invalid area of @surface is empty, an expose event will
|
|
|
|
|
* still be emitted. Its invalid region will be empty.
|
|
|
|
|
*
|
|
|
|
|
* This function is useful for implementations that track invalid
|
|
|
|
|
* regions on their own.
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gdk_surface_queue_expose (GdkSurface *surface)
|
|
|
|
|
{
|
|
|
|
|
cairo_region_t *region;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
|
|
|
|
|
|
|
|
|
while (!gdk_surface_has_impl (surface))
|
|
|
|
|
surface = surface->parent;
|
|
|
|
|
|
|
|
|
|
region = cairo_region_create ();
|
|
|
|
|
impl_surface_add_update_area (surface, region);
|
|
|
|
|
cairo_region_destroy (region);
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-21 03:07:37 +00:00
|
|
|
|
/**
|
|
|
|
|
* gdk_surface_invalidate_region:
|
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
* @region: a #cairo_region_t
|
|
|
|
|
*
|
|
|
|
|
* Adds @region to the update area for @surface. The update area is the
|
|
|
|
|
* region that needs to be redrawn, or “dirty region.”
|
|
|
|
|
*
|
|
|
|
|
* GDK will process all updates whenever the frame clock schedules a redraw,
|
|
|
|
|
* so there’s no need to do forces redraws manually, you just need to
|
|
|
|
|
* invalidate regions that you know should be redrawn.
|
|
|
|
|
*
|
|
|
|
|
* The @invalidate_children parameter controls whether the region of
|
|
|
|
|
* each child surface that intersects @region will also be invalidated.
|
|
|
|
|
* If %FALSE, then the update area for child surfaces will remain
|
|
|
|
|
* unaffected.
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gdk_surface_invalidate_region (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
const cairo_region_t *region)
|
2000-03-28 01:24:44 +00:00
|
|
|
|
{
|
2010-06-28 12:54:37 +00:00
|
|
|
|
cairo_region_t *visible_region;
|
2013-04-20 23:27:07 +00:00
|
|
|
|
cairo_rectangle_int_t r;
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (GDK_SURFACE_DESTROYED (surface))
|
2000-05-15 16:09:53 +00:00
|
|
|
|
return;
|
2009-05-27 15:08:09 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->input_only ||
|
|
|
|
|
!surface->viewable ||
|
2018-03-20 23:55:59 +00:00
|
|
|
|
cairo_region_is_empty (region))
|
2000-03-28 01:24:44 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2013-04-20 23:27:07 +00:00
|
|
|
|
r.x = 0;
|
|
|
|
|
r.y = 0;
|
|
|
|
|
|
|
|
|
|
visible_region = cairo_region_copy (region);
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2018-03-21 08:06:31 +00:00
|
|
|
|
while (surface != NULL &&
|
|
|
|
|
!cairo_region_is_empty (visible_region))
|
2000-03-28 01:24:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
r.width = surface->width;
|
|
|
|
|
r.height = surface->height;
|
2013-04-20 23:27:07 +00:00
|
|
|
|
cairo_region_intersect_rectangle (visible_region, &r);
|
2009-11-04 13:03:04 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (gdk_surface_has_impl (surface))
|
2018-03-21 08:06:31 +00:00
|
|
|
|
{
|
|
|
|
|
impl_surface_add_update_area (surface, visible_region);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2013-04-20 23:27:07 +00:00
|
|
|
|
else
|
2018-03-21 08:06:31 +00:00
|
|
|
|
{
|
|
|
|
|
cairo_region_translate (visible_region,
|
|
|
|
|
surface->x, surface->y);
|
|
|
|
|
surface = surface->parent;
|
|
|
|
|
}
|
2000-03-28 01:24:44 +00:00
|
|
|
|
}
|
2009-05-27 15:08:09 +00:00
|
|
|
|
|
2010-06-28 12:44:12 +00:00
|
|
|
|
cairo_region_destroy (visible_region);
|
2000-03-28 01:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-05-15 16:09:53 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* _gdk_surface_clear_update_area:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface.
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Internal function to clear the update area for a surface. This
|
|
|
|
|
* is called when the surface is hidden or destroyed.
|
2000-05-15 16:09:53 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
_gdk_surface_clear_update_area (GdkSurface *surface)
|
2000-05-15 16:09:53 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2000-05-15 16:09:53 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->update_area)
|
2000-05-15 16:09:53 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_remove_update_surface (surface);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
cairo_region_destroy (surface->update_area);
|
|
|
|
|
surface->update_area = NULL;
|
2000-05-15 16:09:53 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2001-10-03 18:19:48 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_freeze_updates:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Temporarily freezes a surface such that it won’t receive expose
|
|
|
|
|
* events. The surface will begin receiving expose events again when
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_thaw_updates() is called. If gdk_surface_freeze_updates()
|
|
|
|
|
* has been called more than once, gdk_surface_thaw_updates() must be called
|
2001-10-03 18:19:48 +00:00
|
|
|
|
* an equal number of times to begin processing exposes.
|
|
|
|
|
**/
|
2000-03-28 01:24:44 +00:00
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_freeze_updates (GdkSurface *surface)
|
2000-03-28 01:24:44 +00:00
|
|
|
|
{
|
2018-03-20 11:05:26 +00:00
|
|
|
|
GdkSurface *impl_surface;
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_surface = gdk_surface_get_impl_surface (surface);
|
2018-03-20 11:05:26 +00:00
|
|
|
|
impl_surface->update_freeze_count++;
|
2000-03-28 01:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-10-03 18:19:48 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_thaw_updates:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Thaws a surface frozen with gdk_surface_freeze_updates().
|
2001-10-03 18:19:48 +00:00
|
|
|
|
**/
|
2000-03-28 01:24:44 +00:00
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_thaw_updates (GdkSurface *surface)
|
2000-03-28 01:24:44 +00:00
|
|
|
|
{
|
2018-03-20 11:05:26 +00:00
|
|
|
|
GdkSurface *impl_surface;
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_surface = gdk_surface_get_impl_surface (surface);
|
2009-02-04 15:36:33 +00:00
|
|
|
|
|
2018-03-20 11:05:26 +00:00
|
|
|
|
g_return_if_fail (impl_surface->update_freeze_count > 0);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 11:05:26 +00:00
|
|
|
|
if (--impl_surface->update_freeze_count == 0)
|
|
|
|
|
gdk_surface_schedule_update (GDK_SURFACE (impl_surface));
|
2000-03-28 01:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-11-07 14:33:53 +00:00
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_freeze_toplevel_updates (GdkSurface *surface)
|
2007-09-12 17:13:24 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
|
|
|
|
g_return_if_fail (surface->surface_type != GDK_SURFACE_CHILD);
|
2007-09-12 17:13:24 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->update_and_descendants_freeze_count++;
|
|
|
|
|
_gdk_frame_clock_freeze (gdk_surface_get_frame_clock (surface));
|
2007-09-12 17:13:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-11-07 14:33:53 +00:00
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_thaw_toplevel_updates (GdkSurface *surface)
|
2007-09-12 17:13:24 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
|
|
|
|
g_return_if_fail (surface->surface_type != GDK_SURFACE_CHILD);
|
|
|
|
|
g_return_if_fail (surface->update_and_descendants_freeze_count > 0);
|
2007-09-12 17:13:24 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->update_and_descendants_freeze_count--;
|
|
|
|
|
_gdk_frame_clock_thaw (gdk_surface_get_frame_clock (surface));
|
2007-09-12 17:13:24 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_schedule_update (surface);
|
2007-09-12 17:13:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-03-29 21:17:45 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_constrain_size:
|
2001-03-29 21:17:45 +00:00
|
|
|
|
* @geometry: a #GdkGeometry structure
|
|
|
|
|
* @flags: a mask indicating what portions of @geometry are set
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @width: desired width of surface
|
|
|
|
|
* @height: desired height of the surface
|
2011-01-18 09:10:30 +00:00
|
|
|
|
* @new_width: (out): location to store resulting width
|
|
|
|
|
* @new_height: (out): location to store resulting height
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
|
|
|
|
* Constrains a desired width and height according to a
|
2001-03-29 21:17:45 +00:00
|
|
|
|
* set of geometry hints (such as minimum and maximum size).
|
|
|
|
|
*/
|
|
|
|
|
void
|
2018-03-20 10:40:08 +00:00
|
|
|
|
gdk_surface_constrain_size (GdkGeometry *geometry,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkSurfaceHints flags,
|
|
|
|
|
gint width,
|
|
|
|
|
gint height,
|
|
|
|
|
gint *new_width,
|
|
|
|
|
gint *new_height)
|
2001-03-29 21:17:45 +00:00
|
|
|
|
{
|
|
|
|
|
/* This routine is partially borrowed from fvwm.
|
|
|
|
|
*
|
|
|
|
|
* Copyright 1993, Robert Nation
|
|
|
|
|
* You may use this code for any purpose, as long as the original
|
|
|
|
|
* copyright remains in the source code and all documentation
|
|
|
|
|
*
|
|
|
|
|
* which in turn borrows parts of the algorithm from uwm
|
|
|
|
|
*/
|
|
|
|
|
gint min_width = 0;
|
|
|
|
|
gint min_height = 0;
|
|
|
|
|
gint base_width = 0;
|
|
|
|
|
gint base_height = 0;
|
|
|
|
|
gint xinc = 1;
|
|
|
|
|
gint yinc = 1;
|
|
|
|
|
gint max_width = G_MAXINT;
|
|
|
|
|
gint max_height = G_MAXINT;
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-21 08:06:31 +00:00
|
|
|
|
#define FLOOR(value, base) ( ((gint) ((value) / (base))) * (base) )
|
2001-03-29 21:17:45 +00:00
|
|
|
|
|
|
|
|
|
if ((flags & GDK_HINT_BASE_SIZE) && (flags & GDK_HINT_MIN_SIZE))
|
|
|
|
|
{
|
|
|
|
|
base_width = geometry->base_width;
|
|
|
|
|
base_height = geometry->base_height;
|
|
|
|
|
min_width = geometry->min_width;
|
|
|
|
|
min_height = geometry->min_height;
|
|
|
|
|
}
|
|
|
|
|
else if (flags & GDK_HINT_BASE_SIZE)
|
|
|
|
|
{
|
|
|
|
|
base_width = geometry->base_width;
|
|
|
|
|
base_height = geometry->base_height;
|
|
|
|
|
min_width = geometry->base_width;
|
|
|
|
|
min_height = geometry->base_height;
|
|
|
|
|
}
|
|
|
|
|
else if (flags & GDK_HINT_MIN_SIZE)
|
|
|
|
|
{
|
|
|
|
|
base_width = geometry->min_width;
|
|
|
|
|
base_height = geometry->min_height;
|
|
|
|
|
min_width = geometry->min_width;
|
|
|
|
|
min_height = geometry->min_height;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (flags & GDK_HINT_MAX_SIZE)
|
|
|
|
|
{
|
|
|
|
|
max_width = geometry->max_width ;
|
|
|
|
|
max_height = geometry->max_height;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (flags & GDK_HINT_RESIZE_INC)
|
|
|
|
|
{
|
|
|
|
|
xinc = MAX (xinc, geometry->width_inc);
|
|
|
|
|
yinc = MAX (yinc, geometry->height_inc);
|
|
|
|
|
}
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2001-03-29 21:17:45 +00:00
|
|
|
|
/* clamp width and height to min and max values
|
|
|
|
|
*/
|
|
|
|
|
width = CLAMP (width, min_width, max_width);
|
|
|
|
|
height = CLAMP (height, min_height, max_height);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2001-03-29 21:17:45 +00:00
|
|
|
|
/* shrink to base + N * inc
|
|
|
|
|
*/
|
|
|
|
|
width = base_width + FLOOR (width - base_width, xinc);
|
|
|
|
|
height = base_height + FLOOR (height - base_height, yinc);
|
|
|
|
|
|
|
|
|
|
/* constrain aspect ratio, according to:
|
|
|
|
|
*
|
2009-06-01 10:04:36 +00:00
|
|
|
|
* width
|
2001-03-29 21:17:45 +00:00
|
|
|
|
* min_aspect <= -------- <= max_aspect
|
2009-06-01 10:04:36 +00:00
|
|
|
|
* height
|
2001-03-29 21:17:45 +00:00
|
|
|
|
*/
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2001-03-29 21:17:45 +00:00
|
|
|
|
if (flags & GDK_HINT_ASPECT &&
|
|
|
|
|
geometry->min_aspect > 0 &&
|
|
|
|
|
geometry->max_aspect > 0)
|
|
|
|
|
{
|
|
|
|
|
gint delta;
|
|
|
|
|
|
|
|
|
|
if (geometry->min_aspect * height > width)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
{
|
|
|
|
|
delta = FLOOR (height - width / geometry->min_aspect, yinc);
|
|
|
|
|
if (height - delta >= min_height)
|
|
|
|
|
height -= delta;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
delta = FLOOR (height * geometry->min_aspect - width, xinc);
|
|
|
|
|
if (width + delta <= max_width)
|
|
|
|
|
width += delta;
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2001-03-29 21:17:45 +00:00
|
|
|
|
if (geometry->max_aspect * height < width)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
{
|
|
|
|
|
delta = FLOOR (width - height * geometry->max_aspect, xinc);
|
|
|
|
|
if (width - delta >= min_width)
|
|
|
|
|
width -= delta;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
delta = FLOOR (width / geometry->max_aspect - height, yinc);
|
|
|
|
|
if (height + delta <= max_height)
|
|
|
|
|
height += delta;
|
|
|
|
|
}
|
|
|
|
|
}
|
2001-03-29 21:17:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#undef FLOOR
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2001-03-29 21:17:45 +00:00
|
|
|
|
*new_width = width;
|
|
|
|
|
*new_height = height;
|
|
|
|
|
}
|
2001-07-05 13:41:34 +00:00
|
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_device_position_double:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface.
|
2010-12-20 22:04:44 +00:00
|
|
|
|
* @device: pointer #GdkDevice to query to.
|
2010-09-07 17:58:36 +00:00
|
|
|
|
* @x: (out) (allow-none): return location for the X coordinate of @device, or %NULL.
|
|
|
|
|
* @y: (out) (allow-none): return location for the Y coordinate of @device, or %NULL.
|
|
|
|
|
* @mask: (out) (allow-none): return location for the modifier mask, or %NULL.
|
2010-05-25 22:38:44 +00:00
|
|
|
|
*
|
2013-07-03 09:52:58 +00:00
|
|
|
|
* Obtains the current device position in doubles and modifier state.
|
2010-05-25 22:38:44 +00:00
|
|
|
|
* The position is given in coordinates relative to the upper left
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* corner of @surface.
|
2010-05-25 22:38:44 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: (nullable) (transfer none): The surface underneath @device
|
2018-03-20 11:05:26 +00:00
|
|
|
|
* (as with gdk_device_get_surface_at_position()), or %NULL if the
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* surface is not known to GDK.
|
2010-05-25 22:38:44 +00:00
|
|
|
|
**/
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_device_position_double (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkDevice *device,
|
|
|
|
|
double *x,
|
|
|
|
|
double *y,
|
|
|
|
|
GdkModifierType *mask)
|
2010-05-25 22:38:44 +00:00
|
|
|
|
{
|
2013-07-03 09:52:58 +00:00
|
|
|
|
gdouble tmp_x, tmp_y;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
GdkModifierType tmp_mask;
|
2011-01-03 16:01:36 +00:00
|
|
|
|
gboolean normal_child;
|
2002-10-07 19:42:49 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
|
2010-12-20 22:04:44 +00:00
|
|
|
|
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2015-01-24 21:45:04 +00:00
|
|
|
|
tmp_x = tmp_y = 0;
|
|
|
|
|
tmp_mask = 0;
|
2018-03-20 14:14:10 +00:00
|
|
|
|
normal_child = GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->get_device_state (surface,
|
2011-01-03 16:01:36 +00:00
|
|
|
|
device,
|
|
|
|
|
&tmp_x, &tmp_y,
|
|
|
|
|
&tmp_mask);
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* We got the coords on the impl, convert to the surface */
|
|
|
|
|
tmp_x -= surface->abs_x;
|
|
|
|
|
tmp_y -= surface->abs_y;
|
2002-10-07 19:42:49 +00:00
|
|
|
|
|
|
|
|
|
if (x)
|
|
|
|
|
*x = tmp_x;
|
|
|
|
|
if (y)
|
|
|
|
|
*y = tmp_y;
|
|
|
|
|
if (mask)
|
|
|
|
|
*mask = tmp_mask;
|
|
|
|
|
|
2011-01-03 16:01:36 +00:00
|
|
|
|
if (normal_child)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return _gdk_surface_find_child_at (surface, tmp_x, tmp_y);
|
2011-01-03 16:01:36 +00:00
|
|
|
|
return NULL;
|
2001-07-05 13:41:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-07-03 09:52:58 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_device_position:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface.
|
2013-07-03 09:52:58 +00:00
|
|
|
|
* @device: pointer #GdkDevice to query to.
|
|
|
|
|
* @x: (out) (allow-none): return location for the X coordinate of @device, or %NULL.
|
|
|
|
|
* @y: (out) (allow-none): return location for the Y coordinate of @device, or %NULL.
|
|
|
|
|
* @mask: (out) (allow-none): return location for the modifier mask, or %NULL.
|
|
|
|
|
*
|
|
|
|
|
* Obtains the current device position and modifier state.
|
|
|
|
|
* The position is given in coordinates relative to the upper left
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* corner of @surface.
|
2013-07-03 09:52:58 +00:00
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* Use gdk_surface_get_device_position_double() if you need subpixel precision.
|
2013-07-03 09:52:58 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: (nullable) (transfer none): The surface underneath @device
|
2018-03-20 11:05:26 +00:00
|
|
|
|
* (as with gdk_device_get_surface_at_position()), or %NULL if the
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* surface is not known to GDK.
|
2013-07-03 09:52:58 +00:00
|
|
|
|
**/
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_device_position (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkDevice *device,
|
|
|
|
|
gint *x,
|
|
|
|
|
gint *y,
|
|
|
|
|
GdkModifierType *mask)
|
2013-07-03 09:52:58 +00:00
|
|
|
|
{
|
|
|
|
|
gdouble tmp_x, tmp_y;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface = gdk_surface_get_device_position_double (surface, device,
|
2013-07-03 09:52:58 +00:00
|
|
|
|
&tmp_x, &tmp_y, mask);
|
|
|
|
|
if (x)
|
|
|
|
|
*x = round (tmp_x);
|
|
|
|
|
if (y)
|
|
|
|
|
*y = round (tmp_y);
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface;
|
2013-07-03 09:52:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-07-03 15:48:28 +00:00
|
|
|
|
static gboolean
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_raise_internal (GdkSurface *surface)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GdkSurface *parent = surface->parent;
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceImplClass *impl_class;
|
2014-07-03 15:48:28 +00:00
|
|
|
|
gboolean did_raise = FALSE;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (parent && parent->children->data != surface)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
parent->children = g_list_remove_link (parent->children, &surface->children_list_node);
|
|
|
|
|
parent->children = g_list_concat (&surface->children_list_node, parent->children);
|
2014-07-03 15:48:28 +00:00
|
|
|
|
did_raise = TRUE;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
2009-01-19 09:40:13 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
|
2016-12-15 16:53:08 +00:00
|
|
|
|
|
2009-01-19 12:07:02 +00:00
|
|
|
|
/* Just do native raise for toplevels */
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (gdk_surface_has_impl (surface))
|
|
|
|
|
impl_class->raise (surface);
|
2014-07-03 15:48:28 +00:00
|
|
|
|
|
|
|
|
|
return did_raise;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* Returns TRUE If the native surface was mapped or unmapped */
|
2009-08-11 09:30:55 +00:00
|
|
|
|
static gboolean
|
2018-03-20 10:40:08 +00:00
|
|
|
|
set_viewable (GdkSurface *w,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gboolean val)
|
2009-07-18 18:29:50 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *child;
|
2009-07-18 18:29:50 +00:00
|
|
|
|
GList *l;
|
|
|
|
|
|
2009-08-11 09:30:55 +00:00
|
|
|
|
if (w->viewable == val)
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
2009-07-18 18:29:50 +00:00
|
|
|
|
w->viewable = val;
|
|
|
|
|
|
2009-07-20 20:19:35 +00:00
|
|
|
|
if (val)
|
2013-04-17 15:05:49 +00:00
|
|
|
|
recompute_visible_regions (w, FALSE);
|
2009-07-20 20:19:35 +00:00
|
|
|
|
|
2009-07-18 18:29:50 +00:00
|
|
|
|
for (l = w->children; l != NULL; l = l->next)
|
|
|
|
|
{
|
|
|
|
|
child = l->data;
|
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
if (GDK_SURFACE_IS_MAPPED (child))
|
2018-03-21 08:06:31 +00:00
|
|
|
|
set_viewable (child, val);
|
2009-07-18 18:29:50 +00:00
|
|
|
|
}
|
2009-08-11 09:30:55 +00:00
|
|
|
|
|
|
|
|
|
return FALSE;
|
2009-07-18 18:29:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* Returns TRUE If the native surface was mapped or unmapped */
|
2009-08-11 09:30:55 +00:00
|
|
|
|
gboolean
|
2018-03-20 14:14:10 +00:00
|
|
|
|
_gdk_surface_update_viewable (GdkSurface *surface)
|
2009-07-18 18:29:50 +00:00
|
|
|
|
{
|
|
|
|
|
gboolean viewable;
|
|
|
|
|
|
2018-03-20 23:55:59 +00:00
|
|
|
|
if (surface->surface_type == GDK_SURFACE_FOREIGN)
|
2009-07-18 18:29:50 +00:00
|
|
|
|
viewable = TRUE;
|
2018-03-20 14:14:10 +00:00
|
|
|
|
else if (gdk_surface_is_toplevel (surface) ||
|
2018-03-21 08:06:31 +00:00
|
|
|
|
surface->parent->viewable)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
viewable = GDK_SURFACE_IS_MAPPED (surface);
|
2009-07-18 18:29:50 +00:00
|
|
|
|
else
|
|
|
|
|
viewable = FALSE;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return set_viewable (surface, viewable);
|
2009-07-18 18:29:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
|
static void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_show_internal (GdkSurface *surface, gboolean raise)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceImplClass *impl_class;
|
2009-08-11 09:30:55 +00:00
|
|
|
|
gboolean was_mapped, was_viewable;
|
2014-07-03 15:48:28 +00:00
|
|
|
|
gboolean did_show, did_raise = FALSE;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->destroyed)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
was_mapped = GDK_SURFACE_IS_MAPPED (surface);
|
|
|
|
|
was_viewable = surface->viewable;
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
|
if (raise)
|
2014-07-03 15:48:28 +00:00
|
|
|
|
{
|
|
|
|
|
/* Keep children in (reverse) stacking order */
|
2018-03-20 14:14:10 +00:00
|
|
|
|
did_raise = gdk_surface_raise_internal (surface);
|
2014-07-03 15:48:28 +00:00
|
|
|
|
}
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (gdk_surface_has_impl (surface))
|
2008-12-18 10:30:10 +00:00
|
|
|
|
{
|
2008-12-18 13:29:28 +00:00
|
|
|
|
if (!was_mapped)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_synthesize_surface_state (surface,
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GDK_SURFACE_STATE_WITHDRAWN,
|
2017-07-18 10:36:35 +00:00
|
|
|
|
0);
|
2008-12-18 10:30:10 +00:00
|
|
|
|
}
|
2008-07-18 13:03:42 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->state = 0;
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (surface), properties[PROP_STATE]);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
did_show = _gdk_surface_update_viewable (surface);
|
2009-07-18 18:29:50 +00:00
|
|
|
|
|
2009-08-11 09:30:55 +00:00
|
|
|
|
/* If it was already viewable the backend show op won't be called, call it
|
|
|
|
|
again to ensure things happen right if the mapped tracking was not right
|
2018-03-20 14:14:10 +00:00
|
|
|
|
for e.g. a foreign surface.
|
2009-08-11 09:30:55 +00:00
|
|
|
|
Dunno if this is strictly needed but its what happened pre-csw.
|
2018-03-20 10:40:08 +00:00
|
|
|
|
Also show if not done by gdk_surface_update_viewable. */
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (gdk_surface_has_impl (surface) && (was_viewable || !did_show))
|
2009-08-31 08:44:11 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
|
|
|
|
|
impl_class->show (surface, !did_show ? was_mapped : TRUE);
|
2009-08-31 08:44:11 +00:00
|
|
|
|
}
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (!was_mapped && !gdk_surface_has_impl (surface))
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->event_mask & GDK_STRUCTURE_MASK)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
_gdk_make_event (surface, GDK_MAP, NULL, FALSE);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->parent && surface->parent->event_mask & GDK_SUBSTRUCTURE_MASK)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
_gdk_make_event (surface, GDK_MAP, NULL, FALSE);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
2009-05-26 18:53:48 +00:00
|
|
|
|
|
2014-07-03 15:48:28 +00:00
|
|
|
|
if (!was_mapped || did_raise)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
recompute_visible_regions (surface, FALSE);
|
2009-05-26 18:53:48 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (gdk_surface_is_viewable (surface))
|
2018-03-21 03:07:37 +00:00
|
|
|
|
gdk_surface_invalidate_rect (surface, NULL);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2009-05-26 18:53:48 +00:00
|
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_show_unraised:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* Shows a #GdkSurface onscreen, but does not modify its stacking
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* order. In contrast, gdk_surface_show() will raise the surface
|
|
|
|
|
* to the top of the surface stack.
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*
|
|
|
|
|
* On the X11 platform, in Xlib terms, this function calls
|
|
|
|
|
* XMapWindow() (it also updates some internal GDK state, which means
|
2018-03-20 11:05:26 +00:00
|
|
|
|
* that you can’t really use XMapWindow() directly on a GDK surface).
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_show_unraised (GdkSurface *surface)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_show_internal (surface, FALSE);
|
2008-06-27 14:27:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_raise:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Raises @surface to the top of the Z-order (stacking order), so that
|
|
|
|
|
* other surfaces with the same parent surface appear below @surface.
|
|
|
|
|
* This is true whether or not the surfaces are visible.
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* If @surface is a toplevel, the surface manager may choose to deny the
|
|
|
|
|
* request to move the surface in the Z-order, gdk_surface_raise() only
|
2008-06-27 14:27:44 +00:00
|
|
|
|
* requests the restack, does not guarantee it.
|
|
|
|
|
*/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_raise (GdkSurface *surface)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
{
|
2014-07-03 15:48:28 +00:00
|
|
|
|
gboolean did_raise;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2008-06-27 14:27:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->destroyed)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* Keep children in (reverse) stacking order */
|
2018-03-20 14:14:10 +00:00
|
|
|
|
did_raise = gdk_surface_raise_internal (surface);
|
2008-06-27 14:27:44 +00:00
|
|
|
|
|
2014-07-03 15:48:28 +00:00
|
|
|
|
if (did_raise &&
|
2018-03-20 14:14:10 +00:00
|
|
|
|
!gdk_surface_is_toplevel (surface) &&
|
|
|
|
|
gdk_surface_is_viewable (surface) &&
|
|
|
|
|
!surface->input_only)
|
2018-03-21 03:07:37 +00:00
|
|
|
|
gdk_surface_invalidate_rect (surface, NULL);
|
2008-06-27 14:27:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_lower_internal (GdkSurface *surface)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GdkSurface *parent = surface->parent;
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceImplClass *impl_class;
|
2008-06-27 14:27:44 +00:00
|
|
|
|
|
|
|
|
|
if (parent)
|
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
parent->children = g_list_remove_link (parent->children, &surface->children_list_node);
|
|
|
|
|
parent->children = g_list_concat (parent->children, &surface->children_list_node);
|
2008-06-27 14:27:44 +00:00
|
|
|
|
}
|
2009-01-19 09:40:13 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2016-12-15 16:53:08 +00:00
|
|
|
|
/* Just do native lower for toplevels */
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (gdk_surface_has_impl (surface))
|
|
|
|
|
impl_class->lower (surface);
|
2008-06-27 14:27:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
|
static void
|
2018-03-20 10:40:08 +00:00
|
|
|
|
gdk_surface_invalidate_in_parent (GdkSurface *private)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
|
|
|
|
GdkRectangle r, child;
|
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
if (gdk_surface_is_toplevel (private))
|
2008-07-18 13:03:42 +00:00
|
|
|
|
return;
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
|
/* get the visible rectangle of the parent */
|
|
|
|
|
r.x = r.y = 0;
|
|
|
|
|
r.width = private->parent->width;
|
|
|
|
|
r.height = private->parent->height;
|
|
|
|
|
|
|
|
|
|
child.x = private->x;
|
|
|
|
|
child.y = private->y;
|
|
|
|
|
child.width = private->width;
|
|
|
|
|
child.height = private->height;
|
|
|
|
|
gdk_rectangle_intersect (&r, &child, &r);
|
|
|
|
|
|
2018-03-21 03:07:37 +00:00
|
|
|
|
gdk_surface_invalidate_rect (private->parent, &r);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_lower:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Lowers @surface to the bottom of the Z-order (stacking order), so that
|
|
|
|
|
* other surfaces with the same parent surface appear above @surface.
|
|
|
|
|
* This is true whether or not the other surfaces are visible.
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* If @surface is a toplevel, the window manager may choose to deny the
|
|
|
|
|
* request to move the surface in the Z-order, gdk_surface_lower() only
|
2008-06-27 14:27:44 +00:00
|
|
|
|
* requests the restack, does not guarantee it.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Note that gdk_surface_show() raises the surface again, so don’t call this
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* function before gdk_surface_show(). (Try gdk_surface_show_unraised().)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_lower (GdkSurface *surface)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2008-06-27 14:27:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->destroyed)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* Keep children in (reverse) stacking order */
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_lower_internal (surface);
|
2008-06-27 14:27:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_invalidate_in_parent (surface);
|
2008-06-27 14:27:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-09-02 21:38:55 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_restack:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
* @sibling: (allow-none): a #GdkSurface that is a sibling of @surface, or %NULL
|
2009-09-02 21:38:55 +00:00
|
|
|
|
* @above: a boolean
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Changes the position of @surface in the Z-order (stacking order), so that
|
2009-09-02 21:38:55 +00:00
|
|
|
|
* it is above @sibling (if @above is %TRUE) or below @sibling (if @above is
|
|
|
|
|
* %FALSE).
|
|
|
|
|
*
|
|
|
|
|
* If @sibling is %NULL, then this either raises (if @above is %TRUE) or
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* lowers the surface.
|
2009-09-02 21:38:55 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* If @surface is a toplevel, the window manager may choose to deny the
|
|
|
|
|
* request to move the surface in the Z-order, gdk_surface_restack() only
|
2009-09-02 21:38:55 +00:00
|
|
|
|
* requests the restack, does not guarantee it.
|
|
|
|
|
*/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_restack (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkSurface *sibling,
|
|
|
|
|
gboolean above)
|
2009-09-02 21:38:55 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceImplClass *impl_class;
|
|
|
|
|
GdkSurface *parent;
|
2009-09-02 21:38:55 +00:00
|
|
|
|
GList *sibling_link;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2018-03-20 10:40:08 +00:00
|
|
|
|
g_return_if_fail (sibling == NULL || GDK_IS_SURFACE (sibling));
|
2009-09-02 21:38:55 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->destroyed)
|
2009-09-02 21:38:55 +00:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (sibling == NULL)
|
|
|
|
|
{
|
|
|
|
|
if (above)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gdk_surface_raise (surface);
|
2009-09-02 21:38:55 +00:00
|
|
|
|
else
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gdk_surface_lower (surface);
|
2009-09-02 21:38:55 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (gdk_surface_is_toplevel (surface))
|
2009-09-02 21:38:55 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
g_return_if_fail (gdk_surface_is_toplevel (sibling));
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
|
|
|
|
|
impl_class->restack_toplevel (surface, sibling, above);
|
2009-09-02 21:38:55 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
parent = surface->parent;
|
2009-09-02 21:38:55 +00:00
|
|
|
|
if (parent)
|
|
|
|
|
{
|
|
|
|
|
sibling_link = g_list_find (parent->children, sibling);
|
|
|
|
|
g_return_if_fail (sibling_link != NULL);
|
|
|
|
|
if (sibling_link == NULL)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
return;
|
2009-09-02 21:38:55 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
parent->children = g_list_remove_link (parent->children, &surface->children_list_node);
|
2009-09-02 21:38:55 +00:00
|
|
|
|
if (above)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
parent->children = list_insert_link_before (parent->children,
|
2015-09-10 10:57:16 +00:00
|
|
|
|
sibling_link,
|
2018-03-20 14:14:10 +00:00
|
|
|
|
&surface->children_list_node);
|
2009-09-02 21:38:55 +00:00
|
|
|
|
else
|
2018-03-21 08:06:31 +00:00
|
|
|
|
parent->children = list_insert_link_before (parent->children,
|
2015-09-10 10:57:16 +00:00
|
|
|
|
sibling_link->next,
|
2018-03-20 14:14:10 +00:00
|
|
|
|
&surface->children_list_node);
|
2009-09-02 21:38:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_invalidate_in_parent (surface);
|
2009-09-02 21:38:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_show:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Like gdk_surface_show_unraised(), but also raises the surface to the
|
|
|
|
|
* top of the surface stack (moves the surface to the front of the
|
2008-06-27 14:27:44 +00:00
|
|
|
|
* Z-order).
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* This function maps a surface so it’s visible onscreen. Its opposite
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* is gdk_surface_hide().
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*
|
|
|
|
|
* When implementing a #GtkWidget, you should call this function on the widget's
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* #GdkSurface as part of the “map” method.
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_show (GdkSurface *surface)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_show_internal (surface, TRUE);
|
2008-06-27 14:27:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_hide:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* For toplevel surfaces, withdraws them, so they will no longer be
|
|
|
|
|
* known to the window manager; for all surfaces, unmaps them, so
|
2014-02-07 18:32:47 +00:00
|
|
|
|
* they won’t be displayed. Normally done automatically as
|
2008-06-27 14:27:44 +00:00
|
|
|
|
* part of gtk_widget_hide().
|
|
|
|
|
*/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_hide (GdkSurface *surface)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceImplClass *impl_class;
|
2009-08-11 09:30:55 +00:00
|
|
|
|
gboolean was_mapped, did_hide;
|
2008-06-27 14:27:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2008-06-27 14:27:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->destroyed)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
was_mapped = GDK_SURFACE_IS_MAPPED (surface);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (gdk_surface_has_impl (surface))
|
2008-12-18 10:30:10 +00:00
|
|
|
|
{
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (GDK_SURFACE_IS_MAPPED (surface))
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gdk_synthesize_surface_state (surface,
|
|
|
|
|
0,
|
|
|
|
|
GDK_SURFACE_STATE_WITHDRAWN);
|
2008-12-18 10:30:10 +00:00
|
|
|
|
}
|
2008-07-18 13:03:42 +00:00
|
|
|
|
else if (was_mapped)
|
2017-12-14 23:51:38 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->state = GDK_SURFACE_STATE_WITHDRAWN;
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (surface), properties[PROP_STATE]);
|
2017-12-14 23:51:38 +00:00
|
|
|
|
}
|
2017-05-14 19:30:16 +00:00
|
|
|
|
|
|
|
|
|
if (was_mapped)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
|
|
|
|
GdkDisplay *display;
|
2016-10-26 10:21:39 +00:00
|
|
|
|
GdkSeat *seat;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
GList *devices, *d;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
|
|
|
|
/* May need to break grabs on children */
|
2018-03-20 14:14:10 +00:00
|
|
|
|
display = gdk_surface_get_display (surface);
|
2016-10-26 10:21:39 +00:00
|
|
|
|
seat = gdk_display_get_default_seat (display);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2016-10-26 14:45:04 +00:00
|
|
|
|
devices = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_ALL);
|
2016-10-26 10:21:39 +00:00
|
|
|
|
devices = g_list_prepend (devices, gdk_seat_get_keyboard (seat));
|
|
|
|
|
devices = g_list_prepend (devices, gdk_seat_get_pointer (seat));
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
|
for (d = devices; d; d = d->next)
|
|
|
|
|
{
|
|
|
|
|
GdkDevice *device = d->data;
|
|
|
|
|
|
2010-12-13 19:05:59 +00:00
|
|
|
|
if (_gdk_display_end_device_grab (display,
|
|
|
|
|
device,
|
|
|
|
|
_gdk_display_get_next_serial (display),
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface,
|
2010-05-25 22:38:44 +00:00
|
|
|
|
TRUE))
|
2016-10-26 22:06:36 +00:00
|
|
|
|
{
|
|
|
|
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
|
|
|
|
gdk_device_ungrab (device, GDK_CURRENT_TIME);
|
|
|
|
|
G_GNUC_END_IGNORE_DEPRECATIONS
|
|
|
|
|
}
|
2010-05-25 22:38:44 +00:00
|
|
|
|
}
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
|
g_list_free (devices);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
did_hide = _gdk_surface_update_viewable (surface);
|
2009-07-18 18:29:50 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* Hide foreign surface as those are not handled by update_viewable. */
|
|
|
|
|
if (gdk_surface_has_impl (surface) && (!did_hide))
|
2009-08-31 08:44:11 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
|
|
|
|
|
impl_class->hide (surface);
|
2009-08-31 08:44:11 +00:00
|
|
|
|
}
|
2009-05-26 18:53:48 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
recompute_visible_regions (surface, FALSE);
|
2009-05-26 18:53:48 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (was_mapped && !gdk_surface_has_impl (surface))
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->event_mask & GDK_STRUCTURE_MASK)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
_gdk_make_event (surface, GDK_UNMAP, NULL, FALSE);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->parent && surface->parent->event_mask & GDK_SUBSTRUCTURE_MASK)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
_gdk_make_event (surface, GDK_UNMAP, NULL, FALSE);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2008-12-18 13:29:28 +00:00
|
|
|
|
/* Invalidate the rect */
|
2009-11-03 13:41:36 +00:00
|
|
|
|
if (was_mapped)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_invalidate_in_parent (surface);
|
2008-06-27 14:27:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_withdraw:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Withdraws a surface (unmaps it and asks the surface manager to forget about it).
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* This function is not really useful as gdk_surface_hide() automatically
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* withdraws toplevel surfaces before hiding them.
|
2008-06-27 14:27:44 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_withdraw (GdkSurface *surface)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceImplClass *impl_class;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
gboolean was_mapped;
|
2017-10-25 13:37:36 +00:00
|
|
|
|
GdkGLContext *current_context;
|
2008-06-27 14:27:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2008-06-27 14:27:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->destroyed)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
was_mapped = GDK_SURFACE_IS_MAPPED (surface);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (gdk_surface_has_impl (surface))
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
|
|
|
|
|
impl_class->withdraw (surface);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
|
if (was_mapped)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
{
|
|
|
|
|
if (surface->event_mask & GDK_STRUCTURE_MASK)
|
|
|
|
|
_gdk_make_event (surface, GDK_UNMAP, NULL, FALSE);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-21 08:06:31 +00:00
|
|
|
|
if (surface->parent && surface->parent->event_mask & GDK_SUBSTRUCTURE_MASK)
|
|
|
|
|
_gdk_make_event (surface, GDK_UNMAP, NULL, FALSE);
|
|
|
|
|
}
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2017-10-25 13:37:36 +00:00
|
|
|
|
current_context = gdk_gl_context_get_current ();
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (current_context != NULL && gdk_gl_context_get_surface (current_context) == surface)
|
2017-10-25 13:37:36 +00:00
|
|
|
|
gdk_gl_context_clear_current ();
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
recompute_visible_regions (surface, FALSE);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
2008-06-27 14:27:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_events:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
* @event_mask: event mask for @surface
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* The event mask for a surface determines which events will be reported
|
|
|
|
|
* for that surface from all master input devices. For example, an event mask
|
|
|
|
|
* including #GDK_BUTTON_PRESS_MASK means the surface should report button
|
2010-05-25 22:38:44 +00:00
|
|
|
|
* press events. The event mask is the bitwise OR of values from the
|
|
|
|
|
* #GdkEventMask enumeration.
|
2015-02-18 11:13:28 +00:00
|
|
|
|
*
|
|
|
|
|
* See the [input handling overview][event-masks] for details.
|
2008-06-27 14:27:44 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_events (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkEventMask event_mask)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceImplClass *impl_class;
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2008-06-27 14:27:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->destroyed)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->event_mask = event_mask;
|
2009-02-04 10:22:54 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (gdk_surface_has_impl (surface))
|
2009-08-31 08:44:11 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
|
|
|
|
|
impl_class->set_events (surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
get_native_event_mask (surface));
|
2009-08-31 08:44:11 +00:00
|
|
|
|
}
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_events:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Gets the event mask for @surface for all master input devices. See
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_events().
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: event mask for @surface
|
2008-06-27 14:27:44 +00:00
|
|
|
|
**/
|
|
|
|
|
GdkEventMask
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_events (GdkSurface *surface)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), 0);
|
2008-06-27 14:27:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->destroyed)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
return 0;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface->event_mask;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_device_events:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2010-05-25 22:38:44 +00:00
|
|
|
|
* @device: #GdkDevice to enable events for.
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @event_mask: event mask for @surface
|
2010-05-25 22:38:44 +00:00
|
|
|
|
*
|
|
|
|
|
* Sets the event mask for a given device (Normally a floating device, not
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* attached to any visible pointer) to @surface. For example, an event mask
|
|
|
|
|
* including #GDK_BUTTON_PRESS_MASK means the surface should report button
|
2010-05-25 22:38:44 +00:00
|
|
|
|
* press events. The event mask is the bitwise OR of values from the
|
|
|
|
|
* #GdkEventMask enumeration.
|
|
|
|
|
*
|
2015-02-18 11:13:28 +00:00
|
|
|
|
* See the [input handling overview][event-masks] for details.
|
2010-05-25 22:38:44 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_device_events (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkDevice *device,
|
|
|
|
|
GdkEventMask event_mask)
|
2010-05-25 22:38:44 +00:00
|
|
|
|
{
|
|
|
|
|
GdkEventMask device_mask;
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *native;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2010-05-25 22:38:44 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_DEVICE (device));
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (GDK_SURFACE_DESTROYED (surface))
|
2010-05-25 22:38:44 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (G_UNLIKELY (!surface->device_events))
|
|
|
|
|
surface->device_events = g_hash_table_new (NULL, NULL);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
|
|
|
|
if (event_mask == 0)
|
|
|
|
|
{
|
|
|
|
|
/* FIXME: unsetting events on a master device
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* would restore surface->event_mask
|
2010-05-25 22:38:44 +00:00
|
|
|
|
*/
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_hash_table_remove (surface->device_events, device);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_hash_table_insert (surface->device_events, device,
|
2010-05-25 22:38:44 +00:00
|
|
|
|
GINT_TO_POINTER (event_mask));
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
native = gdk_surface_get_toplevel (surface);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
device_mask = get_native_device_event_mask (surface, device);
|
2018-03-20 11:05:26 +00:00
|
|
|
|
GDK_DEVICE_GET_CLASS (device)->select_surface_events (device, native, device_mask);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_device_events:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface.
|
2010-05-25 22:38:44 +00:00
|
|
|
|
* @device: a #GdkDevice.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns the event mask for @surface corresponding to an specific device.
|
2010-05-25 22:38:44 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: device event mask for @surface
|
2010-05-25 22:38:44 +00:00
|
|
|
|
**/
|
|
|
|
|
GdkEventMask
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_device_events (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkDevice *device)
|
2010-05-25 22:38:44 +00:00
|
|
|
|
{
|
|
|
|
|
GdkEventMask mask;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), 0);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_DEVICE (device), 0);
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (GDK_SURFACE_DESTROYED (surface))
|
2010-05-25 22:38:44 +00:00
|
|
|
|
return 0;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (!surface->device_events)
|
2010-05-25 22:38:44 +00:00
|
|
|
|
return 0;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
mask = GPOINTER_TO_INT (g_hash_table_lookup (surface->device_events, device));
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* FIXME: device could be controlled by surface->event_mask */
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
|
|
|
|
return mask;
|
|
|
|
|
}
|
|
|
|
|
|
2009-01-20 22:03:16 +00:00
|
|
|
|
static void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_move_resize_toplevel (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gboolean with_move,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y,
|
|
|
|
|
gint width,
|
|
|
|
|
gint height)
|
2009-01-20 22:03:16 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceImplClass *impl_class;
|
2009-01-20 22:03:16 +00:00
|
|
|
|
gboolean is_resize;
|
|
|
|
|
|
|
|
|
|
is_resize = (width != -1) || (height != -1);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
|
|
|
|
|
impl_class->move_resize (surface, with_move, x, y, width, height);
|
2009-01-20 22:03:16 +00:00
|
|
|
|
|
|
|
|
|
/* Avoid recomputing for pure toplevel moves, for performance reasons */
|
|
|
|
|
if (is_resize)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
recompute_visible_regions (surface, FALSE);
|
2009-01-20 22:03:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
|
static void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_move_resize_internal (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gboolean with_move,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y,
|
|
|
|
|
gint width,
|
|
|
|
|
gint height)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2013-04-17 11:13:46 +00:00
|
|
|
|
cairo_region_t *old_region, *new_region;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
gboolean expose;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->destroyed)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (gdk_surface_is_toplevel (surface))
|
2009-01-20 22:03:16 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_move_resize_toplevel (surface, with_move, x, y, width, height);
|
2009-01-20 22:03:16 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-03 15:48:24 +00:00
|
|
|
|
if (width == 0)
|
|
|
|
|
width = 1;
|
|
|
|
|
if (height == 0)
|
|
|
|
|
height = 1;
|
|
|
|
|
|
2009-09-14 11:09:07 +00:00
|
|
|
|
/* Bail early if no change */
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->width == width &&
|
|
|
|
|
surface->height == height &&
|
2009-09-14 11:09:07 +00:00
|
|
|
|
(!with_move ||
|
2018-03-20 14:14:10 +00:00
|
|
|
|
(surface->x == x &&
|
2018-03-21 08:06:31 +00:00
|
|
|
|
surface->y == y)))
|
2009-09-14 11:09:07 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* Handle child surfaces */
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
|
expose = FALSE;
|
|
|
|
|
old_region = NULL;
|
2009-01-19 14:44:09 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (gdk_surface_is_viewable (surface) &&
|
|
|
|
|
!surface->input_only)
|
2009-01-19 14:44:09 +00:00
|
|
|
|
{
|
2015-11-09 14:14:57 +00:00
|
|
|
|
GdkRectangle r;
|
|
|
|
|
|
2009-01-19 14:44:09 +00:00
|
|
|
|
expose = TRUE;
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
r.x = surface->x;
|
|
|
|
|
r.y = surface->y;
|
|
|
|
|
r.width = surface->width;
|
|
|
|
|
r.height = surface->height;
|
2015-11-09 14:14:57 +00:00
|
|
|
|
|
|
|
|
|
old_region = cairo_region_create_rectangle (&r);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2009-01-20 22:03:16 +00:00
|
|
|
|
/* Set the new position and size */
|
|
|
|
|
if (with_move)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->x = x;
|
|
|
|
|
surface->y = y;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
2009-01-20 22:03:16 +00:00
|
|
|
|
if (!(width < 0 && height < 0))
|
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->width = width;
|
|
|
|
|
surface->height = height;
|
2009-01-20 22:03:16 +00:00
|
|
|
|
}
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
recompute_visible_regions (surface, FALSE);
|
2009-01-20 22:03:16 +00:00
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
|
if (expose)
|
|
|
|
|
{
|
2015-11-09 14:14:57 +00:00
|
|
|
|
GdkRectangle r;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
r.x = surface->x;
|
|
|
|
|
r.y = surface->y;
|
|
|
|
|
r.width = surface->width;
|
|
|
|
|
r.height = surface->height;
|
2015-11-09 14:14:57 +00:00
|
|
|
|
|
|
|
|
|
new_region = cairo_region_create_rectangle (&r);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2010-06-28 12:44:12 +00:00
|
|
|
|
cairo_region_union (new_region, old_region);
|
2009-01-20 22:03:16 +00:00
|
|
|
|
|
2018-03-21 03:07:37 +00:00
|
|
|
|
gdk_surface_invalidate_region (surface->parent, new_region);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2010-06-28 12:44:12 +00:00
|
|
|
|
cairo_region_destroy (old_region);
|
|
|
|
|
cairo_region_destroy (new_region);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
2008-06-27 14:27:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
|
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_move:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
* @x: X coordinate relative to surface’s parent
|
|
|
|
|
* @y: Y coordinate relative to surface’s parent
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Repositions a surface relative to its parent surface.
|
|
|
|
|
* For toplevel surfaces, window managers may ignore or modify the move;
|
2008-06-27 14:27:44 +00:00
|
|
|
|
* you should probably use gtk_window_move() on a #GtkWindow widget
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* anyway, instead of using GDK functions. For child surfaces,
|
2008-06-27 14:27:44 +00:00
|
|
|
|
* the move will reliably succeed.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* If you’re also planning to resize the surface, use gdk_surface_move_resize()
|
2008-06-27 14:27:44 +00:00
|
|
|
|
* to both move and resize simultaneously, for a nicer visual effect.
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_move (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gint x,
|
|
|
|
|
gint y)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_move_resize_internal (surface, TRUE, x, y, -1, -1);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
2008-06-27 14:27:44 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_resize:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
* @width: new width of the surface
|
|
|
|
|
* @height: new height of the surface
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Resizes @surface; for toplevel surfaces, asks the window manager to resize
|
|
|
|
|
* the surface. The window manager may not allow the resize. When using GTK+,
|
2008-06-27 14:27:44 +00:00
|
|
|
|
* use gtk_window_resize() instead of this low-level GDK function.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Surfaces may not be resized below 1x1.
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* If you’re also planning to move the surface, use gdk_surface_move_resize()
|
2008-06-27 14:27:44 +00:00
|
|
|
|
* to both move and resize simultaneously, for a nicer visual effect.
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_resize (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gint width,
|
|
|
|
|
gint height)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_move_resize_internal (surface, FALSE, 0, 0, width, height);
|
2008-06-27 14:27:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_move_resize:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
* @x: new X position relative to surface’s parent
|
|
|
|
|
* @y: new Y position relative to surface’s parent
|
2008-06-27 14:27:44 +00:00
|
|
|
|
* @width: new width
|
|
|
|
|
* @height: new height
|
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* Equivalent to calling gdk_surface_move() and gdk_surface_resize(),
|
2008-06-27 14:27:44 +00:00
|
|
|
|
* except that both operations are performed at once, avoiding strange
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* visual effects. (i.e. the user may be able to see the surface first
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* move, then resize, if you don’t use gdk_surface_move_resize().)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_move_resize (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gint x,
|
|
|
|
|
gint y,
|
|
|
|
|
gint width,
|
|
|
|
|
gint height)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_move_resize_internal (surface, TRUE, x, y, width, height);
|
2008-06-27 14:27:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 15:00:38 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_move_to_rect:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: the #GdkSurface to move
|
|
|
|
|
* @rect: (not nullable): the destination #GdkRectangle to align @surface with
|
|
|
|
|
* @rect_anchor: the point on @rect to align with @surface's anchor point
|
|
|
|
|
* @surface_anchor: the point on @surface to align with @rect's anchor point
|
2016-06-15 15:00:38 +00:00
|
|
|
|
* @anchor_hints: positioning hints to use when limited on space
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @rect_anchor_dx: horizontal offset to shift @surface, i.e. @rect's anchor
|
2016-06-15 15:00:38 +00:00
|
|
|
|
* point
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @rect_anchor_dy: vertical offset to shift @surface, i.e. @rect's anchor point
|
2016-06-15 15:00:38 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Moves @surface to @rect, aligning their anchor points.
|
2016-06-15 15:00:38 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @rect is relative to the top-left corner of the surface that @surface is
|
2018-03-20 11:05:26 +00:00
|
|
|
|
* transient for. @rect_anchor and @surface_anchor determine anchor points on
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @rect and @surface to pin together. @rect's anchor point can optionally be
|
2016-06-15 15:00:38 +00:00
|
|
|
|
* offset by @rect_anchor_dx and @rect_anchor_dy, which is equivalent to
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* offsetting the position of @surface.
|
2016-06-15 15:00:38 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @anchor_hints determines how @surface will be moved if the anchor points cause
|
2016-06-15 15:00:38 +00:00
|
|
|
|
* it to move off-screen. For example, %GDK_ANCHOR_FLIP_X will replace
|
|
|
|
|
* %GDK_GRAVITY_NORTH_WEST with %GDK_GRAVITY_NORTH_EAST and vice versa if
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface extends beyond the left or right edges of the monitor.
|
2016-06-15 15:00:38 +00:00
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* Connect to the #GdkSurface::moved-to-rect signal to find out how it was
|
2016-06-15 15:00:38 +00:00
|
|
|
|
* actually positioned.
|
|
|
|
|
*/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_move_to_rect (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
const GdkRectangle *rect,
|
|
|
|
|
GdkGravity rect_anchor,
|
|
|
|
|
GdkGravity surface_anchor,
|
|
|
|
|
GdkAnchorHints anchor_hints,
|
|
|
|
|
gint rect_anchor_dx,
|
|
|
|
|
gint rect_anchor_dy)
|
2016-06-15 15:00:38 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceImplClass *impl_class;
|
2016-06-15 15:00:38 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
|
|
|
|
g_return_if_fail (surface->transient_for);
|
2016-06-15 15:00:38 +00:00
|
|
|
|
g_return_if_fail (rect);
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
|
|
|
|
|
impl_class->move_to_rect (surface,
|
2016-06-15 15:00:38 +00:00
|
|
|
|
rect,
|
|
|
|
|
rect_anchor,
|
2018-03-20 11:05:26 +00:00
|
|
|
|
surface_anchor,
|
2016-06-15 15:00:38 +00:00
|
|
|
|
anchor_hints,
|
|
|
|
|
rect_anchor_dx,
|
|
|
|
|
rect_anchor_dy);
|
|
|
|
|
}
|
2008-06-27 14:27:44 +00:00
|
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
|
static void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_cursor_internal (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkDevice *device,
|
|
|
|
|
GdkCursor *cursor)
|
2010-05-25 22:38:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (GDK_SURFACE_DESTROYED (surface))
|
2011-05-03 22:01:10 +00:00
|
|
|
|
return;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_assert (gdk_surface_get_display (surface) == gdk_device_get_display (device));
|
2014-10-28 04:18:15 +00:00
|
|
|
|
|
2018-03-20 23:55:59 +00:00
|
|
|
|
if (surface->surface_type == GDK_SURFACE_FOREIGN)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_DEVICE_GET_CLASS (device)->set_surface_cursor (device, surface, cursor);
|
2011-05-03 22:01:10 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkPointerSurfaceInfo *pointer_info;
|
2011-05-03 22:01:10 +00:00
|
|
|
|
GdkDisplay *display;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
display = gdk_surface_get_display (surface);
|
2011-05-03 22:01:10 +00:00
|
|
|
|
pointer_info = _gdk_display_get_pointer_info (display, device);
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (_gdk_surface_event_parent_of (surface, pointer_info->surface_under_pointer))
|
2011-05-03 22:01:10 +00:00
|
|
|
|
update_cursor (display, device);
|
|
|
|
|
}
|
2010-05-25 22:38:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-07-16 06:16:01 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_cursor:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2009-07-16 06:16:01 +00:00
|
|
|
|
*
|
|
|
|
|
* Retrieves a #GdkCursor pointer for the cursor currently set on the
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* specified #GdkSurface, or %NULL. If the return value is %NULL then
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* there is no custom cursor set on the specified surface, and it is
|
|
|
|
|
* using the cursor for its parent surface.
|
2009-07-16 06:16:01 +00:00
|
|
|
|
*
|
2014-05-08 19:55:50 +00:00
|
|
|
|
* Returns: (nullable) (transfer none): a #GdkCursor, or %NULL. The
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* returned object is owned by the #GdkSurface and should not be
|
|
|
|
|
* unreferenced directly. Use gdk_surface_set_cursor() to unset the
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* cursor of the surface
|
2009-07-16 06:16:01 +00:00
|
|
|
|
*/
|
|
|
|
|
GdkCursor *
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_cursor (GdkSurface *surface)
|
2009-07-16 06:16:01 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
|
2009-07-16 06:16:01 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface->cursor;
|
2009-07-16 06:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_cursor:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2010-06-27 14:39:02 +00:00
|
|
|
|
* @cursor: (allow-none): a cursor
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* Sets the default mouse pointer for a #GdkSurface.
|
2014-10-28 04:44:33 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Note that @cursor must be for the same display as @surface.
|
2014-10-28 04:44:33 +00:00
|
|
|
|
*
|
2017-11-30 01:14:53 +00:00
|
|
|
|
* Use gdk_cursor_new_for_display() or gdk_cursor_new_from_texture() to
|
2014-10-28 04:44:33 +00:00
|
|
|
|
* create the cursor. To make the cursor invisible, use %GDK_BLANK_CURSOR.
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* Passing %NULL for the @cursor argument to gdk_surface_set_cursor() means
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* that @surface will use the cursor of its parent surface. Most surfaces
|
2014-10-28 04:44:33 +00:00
|
|
|
|
* should use this default.
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_cursor (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkCursor *cursor)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
{
|
2008-12-15 13:02:52 +00:00
|
|
|
|
GdkDisplay *display;
|
2008-06-27 14:27:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2008-06-27 14:27:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
display = gdk_surface_get_display (surface);
|
2008-06-27 14:27:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->cursor)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_object_unref (surface->cursor);
|
|
|
|
|
surface->cursor = NULL;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (!GDK_SURFACE_DESTROYED (surface))
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2015-12-15 22:20:40 +00:00
|
|
|
|
GdkDevice *device;
|
|
|
|
|
GList *seats, *s;
|
2011-05-03 22:01:10 +00:00
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
|
if (cursor)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
surface->cursor = g_object_ref (cursor);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2015-12-15 22:20:40 +00:00
|
|
|
|
seats = gdk_display_list_seats (display);
|
2011-05-03 22:01:10 +00:00
|
|
|
|
|
2015-12-15 22:20:40 +00:00
|
|
|
|
for (s = seats; s; s = s->next)
|
2011-05-03 22:01:10 +00:00
|
|
|
|
{
|
2017-07-25 13:37:10 +00:00
|
|
|
|
GList *devices, *d;
|
|
|
|
|
|
2015-12-15 22:20:40 +00:00
|
|
|
|
device = gdk_seat_get_pointer (s->data);
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_cursor_internal (surface, device, surface->cursor);
|
2017-07-25 13:37:10 +00:00
|
|
|
|
|
|
|
|
|
devices = gdk_seat_get_slaves (s->data, GDK_SEAT_CAPABILITY_TABLET_STYLUS);
|
|
|
|
|
for (d = devices; d; d = d->next)
|
|
|
|
|
{
|
|
|
|
|
device = gdk_device_get_associated_device (d->data);
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_cursor_internal (surface, device, surface->cursor);
|
2017-07-25 13:37:10 +00:00
|
|
|
|
}
|
|
|
|
|
g_list_free (devices);
|
2011-05-03 22:01:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-12-15 22:20:40 +00:00
|
|
|
|
g_list_free (seats);
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (surface), properties[PROP_CURSOR]);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
2008-06-27 14:27:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_device_cursor:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface.
|
2010-12-20 22:04:44 +00:00
|
|
|
|
* @device: a master, pointer #GdkDevice.
|
2010-05-25 22:38:44 +00:00
|
|
|
|
*
|
|
|
|
|
* Retrieves a #GdkCursor pointer for the @device currently set on the
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* specified #GdkSurface, or %NULL. If the return value is %NULL then
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* there is no custom cursor set on the specified surface, and it is
|
|
|
|
|
* using the cursor for its parent surface.
|
2010-05-25 22:38:44 +00:00
|
|
|
|
*
|
2014-05-08 19:55:50 +00:00
|
|
|
|
* Returns: (nullable) (transfer none): a #GdkCursor, or %NULL. The
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* returned object is owned by the #GdkSurface and should not be
|
|
|
|
|
* unreferenced directly. Use gdk_surface_set_cursor() to unset the
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* cursor of the surface
|
2010-05-25 22:38:44 +00:00
|
|
|
|
**/
|
|
|
|
|
GdkCursor *
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_device_cursor (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkDevice *device)
|
2010-05-25 22:38:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
|
2010-12-20 22:04:44 +00:00
|
|
|
|
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
|
|
|
|
|
g_return_val_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_MASTER, NULL);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return g_hash_table_lookup (surface->device_cursor, device);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_device_cursor:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2010-12-20 22:04:44 +00:00
|
|
|
|
* @device: a master, pointer #GdkDevice
|
2010-05-25 22:38:44 +00:00
|
|
|
|
* @cursor: a #GdkCursor
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Sets a specific #GdkCursor for a given device when it gets inside @surface.
|
2017-11-30 01:14:53 +00:00
|
|
|
|
* Use gdk_cursor_new_for_display() or gdk_cursor_new_from_texture() to create
|
2010-05-25 22:38:44 +00:00
|
|
|
|
* the cursor. To make the cursor invisible, use %GDK_BLANK_CURSOR. Passing
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* %NULL for the @cursor argument to gdk_surface_set_cursor() means that
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface will use the cursor of its parent surface. Most surfaces should
|
2010-05-25 22:38:44 +00:00
|
|
|
|
* use this default.
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_device_cursor (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkDevice *device,
|
|
|
|
|
GdkCursor *cursor)
|
2010-05-25 22:38:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2010-05-26 11:22:25 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_DEVICE (device));
|
2010-12-20 22:04:44 +00:00
|
|
|
|
g_return_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD);
|
|
|
|
|
g_return_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_MASTER);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
|
|
|
|
if (!cursor)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_hash_table_remove (surface->device_cursor, device);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
else
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_hash_table_replace (surface->device_cursor, device, g_object_ref (cursor));
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_cursor_internal (surface, device, cursor);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_geometry:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
* @x: (out) (allow-none): return location for X coordinate of surface (relative to its parent)
|
|
|
|
|
* @y: (out) (allow-none): return location for Y coordinate of surface (relative to its parent)
|
|
|
|
|
* @width: (out) (allow-none): return location for width of surface
|
|
|
|
|
* @height: (out) (allow-none): return location for height of surface
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*
|
|
|
|
|
* Any of the return location arguments to this function may be %NULL,
|
2014-02-07 18:32:47 +00:00
|
|
|
|
* if you aren’t interested in getting the value of that field.
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* The X and Y coordinates returned are relative to the parent surface
|
|
|
|
|
* of @surface, which for toplevels usually means relative to the
|
|
|
|
|
* surface decorations (titlebar, etc.) rather than relative to the
|
2008-06-27 14:27:44 +00:00
|
|
|
|
* root window (screen-size background window).
|
|
|
|
|
*
|
|
|
|
|
* On the X11 platform, the geometry is obtained from the X server,
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* so reflects the latest position of @surface; this may be out-of-sync
|
|
|
|
|
* with the position of @surface delivered in the most-recently-processed
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* #GdkEventConfigure. gdk_surface_get_position() in contrast gets the
|
2008-06-27 14:27:44 +00:00
|
|
|
|
* position from the most recent configure event.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Note: If @surface is not a toplevel, it is much better
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* to call gdk_surface_get_position(), gdk_surface_get_width() and
|
|
|
|
|
* gdk_surface_get_height() instead, because it avoids the roundtrip to
|
2010-09-20 10:53:46 +00:00
|
|
|
|
* the X server and because these functions support the full 32-bit
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* coordinate space, whereas gdk_surface_get_geometry() is restricted to
|
2010-09-20 10:53:46 +00:00
|
|
|
|
* the 16-bit coordinates of X11.
|
2014-02-02 06:22:14 +00:00
|
|
|
|
*/
|
2008-06-27 14:27:44 +00:00
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_geometry (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gint *x,
|
|
|
|
|
gint *y,
|
|
|
|
|
gint *width,
|
|
|
|
|
gint *height)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *parent;
|
|
|
|
|
GdkSurfaceImplClass *impl_class;
|
2008-06-27 14:27:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2008-06-27 14:27:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (!GDK_SURFACE_DESTROYED (surface))
|
2008-06-27 14:27:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (gdk_surface_has_impl (surface))
|
2018-03-21 08:06:31 +00:00
|
|
|
|
{
|
|
|
|
|
impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
|
|
|
|
|
impl_class->get_geometry (surface, x, y,
|
|
|
|
|
width, height);
|
|
|
|
|
/* This reports the position wrt to the native parent, we need to convert
|
|
|
|
|
it to be relative to the client side parent */
|
|
|
|
|
parent = surface->parent;
|
|
|
|
|
if (parent && !gdk_surface_has_impl (parent))
|
|
|
|
|
{
|
|
|
|
|
if (x)
|
|
|
|
|
*x -= parent->abs_x;
|
|
|
|
|
if (y)
|
|
|
|
|
*y -= parent->abs_y;
|
|
|
|
|
}
|
|
|
|
|
}
|
2008-07-18 13:03:42 +00:00
|
|
|
|
else
|
2018-03-21 08:06:31 +00:00
|
|
|
|
{
|
2010-04-15 10:59:44 +00:00
|
|
|
|
if (x)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
*x = surface->x;
|
2010-04-15 10:59:44 +00:00
|
|
|
|
if (y)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
*y = surface->y;
|
2018-03-21 08:06:31 +00:00
|
|
|
|
if (width)
|
|
|
|
|
*width = surface->width;
|
|
|
|
|
if (height)
|
|
|
|
|
*height = surface->height;
|
|
|
|
|
}
|
2008-06-27 14:27:44 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-09-20 09:10:37 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_width:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2010-09-20 09:10:37 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns the width of the given @surface.
|
2010-09-20 09:10:37 +00:00
|
|
|
|
*
|
|
|
|
|
* On the X11 platform the returned size is the size reported in the
|
|
|
|
|
* most-recently-processed configure event, rather than the current
|
|
|
|
|
* size on the X server.
|
2010-09-28 00:59:08 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: The width of @surface
|
2010-09-20 09:10:37 +00:00
|
|
|
|
*/
|
|
|
|
|
int
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_width (GdkSurface *surface)
|
2010-09-20 09:10:37 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), 0);
|
2010-09-20 09:10:37 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface->width;
|
2010-09-20 09:10:37 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_height:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2010-09-20 09:10:37 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns the height of the given @surface.
|
2010-09-20 09:10:37 +00:00
|
|
|
|
*
|
|
|
|
|
* On the X11 platform the returned size is the size reported in the
|
|
|
|
|
* most-recently-processed configure event, rather than the current
|
|
|
|
|
* size on the X server.
|
2010-09-28 00:59:08 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: The height of @surface
|
2010-09-20 09:10:37 +00:00
|
|
|
|
*/
|
|
|
|
|
int
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_height (GdkSurface *surface)
|
2010-09-20 09:10:37 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), 0);
|
2010-09-20 09:10:37 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface->height;
|
2010-09-20 09:10:37 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_origin:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2010-12-04 13:55:11 +00:00
|
|
|
|
* @x: (out) (allow-none): return location for X coordinate
|
|
|
|
|
* @y: (out) (allow-none): return location for Y coordinate
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Obtains the position of a surface in root window coordinates.
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* (Compare with gdk_surface_get_position() and
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* gdk_surface_get_geometry() which return the position of a surface
|
|
|
|
|
* relative to its parent surface.)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: not meaningful, ignore
|
2008-06-27 14:27:44 +00:00
|
|
|
|
*/
|
|
|
|
|
gint
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_origin (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gint *x,
|
|
|
|
|
gint *y)
|
2008-06-27 14:27:44 +00:00
|
|
|
|
{
|
2014-02-28 02:07:18 +00:00
|
|
|
|
gint dummy_x, dummy_y;
|
2008-06-27 14:27:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), 0);
|
2008-06-27 14:27:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_root_coords (surface,
|
2014-02-28 02:07:18 +00:00
|
|
|
|
0, 0,
|
|
|
|
|
x ? x : &dummy_x,
|
|
|
|
|
y ? y : &dummy_y);
|
2008-06-27 14:27:44 +00:00
|
|
|
|
|
2009-06-08 15:03:47 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_root_coords:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
* @x: X coordinate in surface
|
|
|
|
|
* @y: Y coordinate in surface
|
2011-01-18 09:10:30 +00:00
|
|
|
|
* @root_x: (out): return location for X coordinate
|
|
|
|
|
* @root_y: (out): return location for Y coordinate
|
2009-06-08 15:03:47 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Obtains the position of a surface position in root
|
2009-06-08 15:03:47 +00:00
|
|
|
|
* window coordinates. This is similar to
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_origin() but allows you to pass
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* in any position in the surface, not just the origin.
|
2009-06-08 15:03:47 +00:00
|
|
|
|
*/
|
2009-06-30 07:30:53 +00:00
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_root_coords (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gint x,
|
|
|
|
|
gint y,
|
|
|
|
|
gint *root_x,
|
|
|
|
|
gint *root_y)
|
2009-06-08 15:03:47 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceImplClass *impl_class;
|
2009-06-08 15:03:47 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2009-06-08 15:03:47 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (GDK_SURFACE_DESTROYED (surface))
|
2009-06-30 07:30:53 +00:00
|
|
|
|
{
|
2011-09-28 22:16:30 +00:00
|
|
|
|
*root_x = 0;
|
|
|
|
|
*root_y = 0;
|
2009-06-30 07:30:53 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
|
|
|
|
|
impl_class->get_root_coords (surface->impl_surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
x + surface->abs_x,
|
|
|
|
|
y + surface->abs_y,
|
|
|
|
|
root_x, root_y);
|
2008-06-27 14:27:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-04-15 10:59:44 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_coords_to_parent:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a child surface
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* @x: X coordinate in child’s coordinate system
|
|
|
|
|
* @y: Y coordinate in child’s coordinate system
|
2010-05-25 15:54:16 +00:00
|
|
|
|
* @parent_x: (out) (allow-none): return location for X coordinate
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* in parent’s coordinate system, or %NULL
|
2010-05-25 15:54:16 +00:00
|
|
|
|
* @parent_y: (out) (allow-none): return location for Y coordinate
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* in parent’s coordinate system, or %NULL
|
2010-04-15 10:59:44 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Transforms surface coordinates from a child surface to its parent
|
|
|
|
|
* surface. Calling this function is equivalent to adding the return
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* values of gdk_surface_get_position() to the child coordinates.
|
2010-04-15 10:59:44 +00:00
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* See also: gdk_surface_coords_from_parent()
|
2010-04-15 10:59:44 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_coords_to_parent (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gdouble x,
|
|
|
|
|
gdouble y,
|
|
|
|
|
gdouble *parent_x,
|
|
|
|
|
gdouble *parent_y)
|
2010-04-15 10:59:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2010-04-15 10:59:44 +00:00
|
|
|
|
|
2016-10-25 07:54:37 +00:00
|
|
|
|
if (parent_x)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
*parent_x = x + surface->x;
|
2010-04-15 10:59:44 +00:00
|
|
|
|
|
2016-10-25 07:54:37 +00:00
|
|
|
|
if (parent_y)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
*parent_y = y + surface->y;
|
2010-04-15 10:59:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_coords_from_parent:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a child surface
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* @parent_x: X coordinate in parent’s coordinate system
|
|
|
|
|
* @parent_y: Y coordinate in parent’s coordinate system
|
|
|
|
|
* @x: (out) (allow-none): return location for X coordinate in child’s coordinate system
|
|
|
|
|
* @y: (out) (allow-none): return location for Y coordinate in child’s coordinate system
|
2010-04-15 10:59:44 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Transforms surface coordinates from a parent surface to a child
|
|
|
|
|
* surface.
|
2010-04-15 10:59:44 +00:00
|
|
|
|
*
|
2016-10-25 07:54:37 +00:00
|
|
|
|
* Calling this function is equivalent to subtracting the return
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* values of gdk_surface_get_position() from the parent coordinates.
|
2010-04-15 10:59:44 +00:00
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* See also: gdk_surface_coords_to_parent()
|
2010-04-15 10:59:44 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_coords_from_parent (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gdouble parent_x,
|
|
|
|
|
gdouble parent_y,
|
|
|
|
|
gdouble *x,
|
|
|
|
|
gdouble *y)
|
2010-04-15 10:59:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2010-04-15 10:59:44 +00:00
|
|
|
|
|
2016-10-25 07:54:37 +00:00
|
|
|
|
if (x)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
*x = parent_x - surface->x;
|
2010-04-15 10:59:44 +00:00
|
|
|
|
|
2016-10-25 07:54:37 +00:00
|
|
|
|
if (y)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
*y = parent_y - surface->y;
|
2010-04-15 10:59:44 +00:00
|
|
|
|
}
|
2008-12-06 21:43:01 +00:00
|
|
|
|
|
2008-12-17 10:24:46 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_input_shape_combine_region:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
* @shape_region: region of surface to be non-transparent
|
|
|
|
|
* @offset_x: X position of @shape_region in @surface coordinates
|
|
|
|
|
* @offset_y: Y position of @shape_region in @surface coordinates
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* Like gdk_surface_shape_combine_region(), but the shape applies
|
2008-12-17 10:24:46 +00:00
|
|
|
|
* only to event handling. Mouse events which happen while
|
2009-06-01 10:04:36 +00:00
|
|
|
|
* the pointer position corresponds to an unset bit in the
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* mask will be passed on the surface below @surface.
|
2008-12-17 10:24:46 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* An input shape is typically used with RGBA surfaces.
|
|
|
|
|
* The alpha channel of the surface defines which pixels are
|
2008-12-17 10:24:46 +00:00
|
|
|
|
* invisible and allows for nicely antialiased borders,
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* and the input shape controls where the surface is
|
2014-02-05 19:50:22 +00:00
|
|
|
|
* “clickable”.
|
2008-12-17 10:24:46 +00:00
|
|
|
|
*
|
|
|
|
|
* On the X11 platform, this requires version 1.1 of the
|
|
|
|
|
* shape extension.
|
|
|
|
|
*
|
|
|
|
|
* On the Win32 platform, this functionality is not present and the
|
|
|
|
|
* function does nothing.
|
|
|
|
|
*/
|
2009-06-01 10:04:36 +00:00
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_input_shape_combine_region (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
const cairo_region_t *shape_region,
|
|
|
|
|
gint offset_x,
|
|
|
|
|
gint offset_y)
|
2008-12-17 10:24:46 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceImplClass *impl_class;
|
2008-12-17 10:24:46 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2008-12-17 10:24:46 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (GDK_SURFACE_DESTROYED (surface))
|
2008-12-17 10:24:46 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->input_shape)
|
|
|
|
|
cairo_region_destroy (surface->input_shape);
|
2008-12-17 10:24:46 +00:00
|
|
|
|
|
|
|
|
|
if (shape_region)
|
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->input_shape = cairo_region_copy (shape_region);
|
|
|
|
|
cairo_region_translate (surface->input_shape, offset_x, offset_y);
|
2008-12-17 10:24:46 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->input_shape = NULL;
|
2008-12-17 10:24:46 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (gdk_surface_has_impl (surface))
|
2009-08-31 08:44:11 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
|
|
|
|
|
impl_class->input_shape_combine_region (surface, surface->input_shape, 0, 0);
|
2009-08-31 08:44:11 +00:00
|
|
|
|
}
|
2008-12-17 10:24:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
do_child_input_shapes (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gboolean merge)
|
2008-12-17 10:24:46 +00:00
|
|
|
|
{
|
|
|
|
|
GdkRectangle r;
|
2010-06-28 12:54:37 +00:00
|
|
|
|
cairo_region_t *region;
|
2008-12-17 10:24:46 +00:00
|
|
|
|
|
|
|
|
|
r.x = 0;
|
|
|
|
|
r.y = 0;
|
2018-03-20 14:14:10 +00:00
|
|
|
|
r.width = surface->width;
|
|
|
|
|
r.height = surface->height;
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2010-06-28 12:44:12 +00:00
|
|
|
|
region = cairo_region_create_rectangle (&r);
|
2018-03-20 14:14:10 +00:00
|
|
|
|
remove_child_area (surface, TRUE, region);
|
2008-12-17 10:24:46 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (merge && surface->input_shape)
|
|
|
|
|
cairo_region_subtract (region, surface->input_shape);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2014-02-04 11:03:03 +00:00
|
|
|
|
cairo_region_xor_rectangle (region, &r);
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_input_shape_combine_region (surface, region, 0, 0);
|
2008-12-17 10:24:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_child_input_shapes:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Sets the input shape mask of @surface to the union of input shape masks
|
|
|
|
|
* for all children of @surface, ignoring the input shape mask of @surface
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* itself. Contrast with gdk_surface_merge_child_input_shapes() which includes
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* the input shape mask of @surface in the masks to be merged.
|
2008-12-17 10:24:46 +00:00
|
|
|
|
**/
|
2009-06-01 10:04:36 +00:00
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_child_input_shapes (GdkSurface *surface)
|
2008-12-17 10:24:46 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
do_child_input_shapes (surface, FALSE);
|
2008-12-17 10:24:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-06-08 13:36:43 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_pass_through:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2015-06-08 13:36:43 +00:00
|
|
|
|
* @pass_through: a boolean
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Sets whether input to the surface is passed through to the surface
|
2015-06-08 13:36:43 +00:00
|
|
|
|
* below.
|
|
|
|
|
*
|
|
|
|
|
* The default value of this is %FALSE, which means that pointer
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* events that happen inside the surface are send first to the surface,
|
2015-06-08 13:36:43 +00:00
|
|
|
|
* but if the event is not selected by the event mask then the event
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* is sent to the parent surface, and so on up the hierarchy.
|
2015-06-08 13:36:43 +00:00
|
|
|
|
*
|
|
|
|
|
* If @pass_through is %TRUE then such pointer events happen as if the
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* surface wasn't there at all, and thus will be sent first to any
|
|
|
|
|
* surfaces below @surface. This is useful if the surface is used in a
|
2015-06-08 13:36:43 +00:00
|
|
|
|
* transparent fashion. In the terminology of the web this would be called
|
|
|
|
|
* "pointer-events: none".
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Note that a surface with @pass_through %TRUE can still have a subsurface
|
|
|
|
|
* without pass through, so you can get events on a subset of a surface. And in
|
2015-06-08 13:36:43 +00:00
|
|
|
|
* that cases you would get the in-between related events such as the pointer
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* enter/leave events on its way to the destination surface.
|
2015-06-08 13:36:43 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_pass_through (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gboolean pass_through)
|
2015-06-08 13:36:43 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2015-06-08 13:36:43 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->pass_through = !!pass_through;
|
2015-06-08 13:36:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_pass_through:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2015-06-08 13:36:43 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns whether input to the surface is passed through to the surface
|
2015-06-08 13:36:43 +00:00
|
|
|
|
* below.
|
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* See gdk_surface_set_pass_through() for details
|
2015-06-08 13:36:43 +00:00
|
|
|
|
**/
|
|
|
|
|
gboolean
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_pass_through (GdkSurface *surface)
|
2015-06-08 13:36:43 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
|
2015-06-08 13:36:43 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface->pass_through;
|
2015-06-08 13:36:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-12-17 10:24:46 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_merge_child_input_shapes:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2009-06-01 10:04:36 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Merges the input shape masks for any child surfaces into the
|
|
|
|
|
* input shape mask for @surface. i.e. the union of all input masks
|
|
|
|
|
* for @surface and its children will become the new input mask
|
|
|
|
|
* for @surface. See gdk_surface_input_shape_combine_region().
|
2008-12-17 10:24:46 +00:00
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* This function is distinct from gdk_surface_set_child_input_shapes()
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* because it includes @surface’s input shape mask in the set of
|
2008-12-17 10:24:46 +00:00
|
|
|
|
* shapes to be merged.
|
|
|
|
|
**/
|
2009-06-01 10:04:36 +00:00
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_merge_child_input_shapes (GdkSurface *surface)
|
2008-12-17 10:24:46 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
do_child_input_shapes (surface, TRUE);
|
2008-12-17 10:24:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-06-27 14:27:44 +00:00
|
|
|
|
|
2010-05-25 15:54:16 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_modal_hint:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: A toplevel #GdkSurface.
|
2010-05-25 15:54:16 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Determines whether or not the surface manager is hinted that @surface
|
2010-05-25 15:54:16 +00:00
|
|
|
|
* has modal behaviour.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: whether or not the surface has the modal hint set.
|
2010-05-25 15:54:16 +00:00
|
|
|
|
*/
|
|
|
|
|
gboolean
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_modal_hint (GdkSurface *surface)
|
2010-05-25 15:54:16 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
|
2010-05-25 15:54:16 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface->modal_hint;
|
2010-05-25 15:54:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_accept_focus:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface.
|
2010-05-25 15:54:16 +00:00
|
|
|
|
*
|
|
|
|
|
* Determines whether or not the desktop environment shuld be hinted that
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* the surface does not want to receive input focus.
|
2010-05-25 15:54:16 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: whether or not the surface should receive input focus.
|
2010-05-25 15:54:16 +00:00
|
|
|
|
*/
|
|
|
|
|
gboolean
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_accept_focus (GdkSurface *surface)
|
2010-05-25 15:54:16 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
|
2010-05-25 15:54:16 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface->accept_focus;
|
2010-05-25 15:54:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_focus_on_map:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface.
|
2010-05-25 15:54:16 +00:00
|
|
|
|
*
|
|
|
|
|
* Determines whether or not the desktop environment should be hinted that the
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* surface does not want to receive input focus when it is mapped.
|
2010-05-25 15:54:16 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: whether or not the surface wants to receive input focus when
|
2010-05-25 15:54:16 +00:00
|
|
|
|
* it is mapped.
|
|
|
|
|
*/
|
|
|
|
|
gboolean
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_focus_on_map (GdkSurface *surface)
|
2010-05-25 15:54:16 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
|
2010-05-25 15:54:16 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface->focus_on_map;
|
2010-05-25 15:54:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_is_input_only:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2010-05-25 15:54:16 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Determines whether or not the surface is an input only surface.
|
2010-05-25 15:54:16 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: %TRUE if @surface is input only
|
2010-05-25 15:54:16 +00:00
|
|
|
|
*/
|
|
|
|
|
gboolean
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_is_input_only (GdkSurface *surface)
|
2010-05-25 15:54:16 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
|
2010-05-25 15:54:16 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface->input_only;
|
2010-05-25 15:54:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* Gets the toplevel for a surface as used for events,
|
2009-06-08 13:57:59 +00:00
|
|
|
|
i.e. including offscreen parents going up to the native
|
|
|
|
|
toplevel */
|
2018-03-20 10:40:08 +00:00
|
|
|
|
static GdkSurface *
|
2018-03-20 14:14:10 +00:00
|
|
|
|
get_event_toplevel (GdkSurface *surface)
|
2009-06-08 13:57:59 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *parent;
|
2009-06-08 13:57:59 +00:00
|
|
|
|
|
2018-03-20 23:55:59 +00:00
|
|
|
|
while ((parent = surface->parent) != NULL)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface = parent;
|
2009-06-08 13:57:59 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface;
|
2009-06-08 13:57:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-07-07 03:06:46 +00:00
|
|
|
|
gboolean
|
2018-03-20 10:40:08 +00:00
|
|
|
|
_gdk_surface_event_parent_of (GdkSurface *parent,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkSurface *child)
|
2009-06-08 13:57:59 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *w;
|
2009-06-08 13:57:59 +00:00
|
|
|
|
|
|
|
|
|
w = child;
|
|
|
|
|
while (w != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (w == parent)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
return TRUE;
|
2009-06-08 13:57:59 +00:00
|
|
|
|
|
2016-10-25 07:54:37 +00:00
|
|
|
|
w = w->parent;
|
2009-06-08 13:57:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2010-05-25 22:38:44 +00:00
|
|
|
|
update_cursor (GdkDisplay *display,
|
|
|
|
|
GdkDevice *device)
|
2009-06-08 13:57:59 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GdkSurface *cursor_surface, *parent, *toplevel;
|
|
|
|
|
GdkSurface *pointer_surface;
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkPointerSurfaceInfo *pointer_info;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
GdkDeviceGrabInfo *grab;
|
2010-08-17 13:39:03 +00:00
|
|
|
|
GdkCursor *cursor;
|
2009-06-08 13:57:59 +00:00
|
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
|
pointer_info = _gdk_display_get_pointer_info (display, device);
|
2018-03-20 14:14:10 +00:00
|
|
|
|
pointer_surface = pointer_info->surface_under_pointer;
|
2009-06-08 13:57:59 +00:00
|
|
|
|
|
|
|
|
|
/* We ignore the serials here and just pick the last grab
|
|
|
|
|
we've sent, as that would shortly be used anyway. */
|
2010-05-25 22:38:44 +00:00
|
|
|
|
grab = _gdk_display_get_last_device_grab (display, device);
|
2009-09-08 09:48:20 +00:00
|
|
|
|
if (/* have grab */
|
|
|
|
|
grab != NULL &&
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* the pointer is not in a descendant of the grab surface */
|
|
|
|
|
!_gdk_surface_event_parent_of (grab->surface, pointer_surface))
|
2010-05-25 22:38:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* use the cursor from the grab surface */
|
|
|
|
|
cursor_surface = grab->surface;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
}
|
2009-09-08 09:48:20 +00:00
|
|
|
|
else
|
2010-05-25 22:38:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* otherwise use the cursor from the pointer surface */
|
|
|
|
|
cursor_surface = pointer_surface;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
}
|
2009-09-08 09:48:20 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* Find the first surface with the cursor actually set, as
|
2009-09-08 09:48:20 +00:00
|
|
|
|
the cursor is inherited from the parent */
|
2018-03-20 14:14:10 +00:00
|
|
|
|
while (cursor_surface->cursor == NULL &&
|
|
|
|
|
!g_hash_table_contains (cursor_surface->device_cursor, device) &&
|
2018-03-21 08:06:31 +00:00
|
|
|
|
(parent = cursor_surface->parent) != NULL)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
cursor_surface = parent;
|
2009-06-08 13:57:59 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
cursor = g_hash_table_lookup (cursor_surface->device_cursor, device);
|
2010-08-17 13:39:03 +00:00
|
|
|
|
|
|
|
|
|
if (!cursor)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
cursor = cursor_surface->cursor;
|
2010-08-17 13:39:03 +00:00
|
|
|
|
|
2009-06-08 13:57:59 +00:00
|
|
|
|
/* Set all cursors on toplevel, otherwise its tricky to keep track of
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* which native surface has what cursor set. */
|
|
|
|
|
toplevel = get_event_toplevel (pointer_surface);
|
2018-03-20 11:05:26 +00:00
|
|
|
|
GDK_DEVICE_GET_CLASS (device)->set_surface_cursor (device, toplevel, cursor);
|
2009-06-08 13:57:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
|
static gboolean
|
2018-03-20 14:14:10 +00:00
|
|
|
|
point_in_surface (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gdouble x,
|
|
|
|
|
gdouble y)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
|
|
|
|
return
|
2018-03-20 14:14:10 +00:00
|
|
|
|
x >= 0 && x < surface->width &&
|
|
|
|
|
y >= 0 && y < surface->height &&
|
|
|
|
|
(surface->input_shape == NULL ||
|
|
|
|
|
cairo_region_contains_point (surface->input_shape,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
x, y));
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
Bug 318807 – Offscreen windows and window redirection.
2008-03-18 10:49:20 Tim Janik <timj@imendio.com>
* Applied pixmap redirection patch by Alexander Larsson with
various updates from:
Bug 318807 – Offscreen windows and window redirection.
Updates:
* updated docs to mention "Since 2.16".
* tests/testgtk.c: fixed snapshooting pixmap leak.
convert pixmap to pixbuf after snapshooting, to compensate for different
bit depths (occurs when snapshooting ARGB visuals and displaying the
pixmap in an RGB visual).
* gdk/gdkwindow.[hc]: made GdkWindowRedirect private.
* gdk/gdkwindow.c: removed damage idle handler, there's no aparent
need for it. enqueue damage notification as GDK_DAMAGE events
for each painting redirection at the start of the event queue.
consider windows with a redirection fully visible when invalidating,
and when updating from backing store. cleaned up stale variables.
* gdk/gdkevents.c: added _gdk_event_queue_prepend().
* gtk/gtkwidget.c: fixed coordinates for !NO_WINDOW widgets in
gtk_widget_get_snapshot; this fixes garbage snap offsets for gammacurve,
tree, drawingarea, text, handlebox, etc.
clip the redirected window hierarchy to window sizes, the visible
rectangles don't need to be taken into account here.
extended snapshooting docs to recommend gdk_pixbuf_get_from_drawable()
in case pixmap visuals could mismatch.
* gdk/x11/gdkwindow-x11.c: removed _gdk_windowing_window_get_visible_rect().
Base patch:
* tests/testgtk.c: add a "Snapshot" test to demonstrate snapshooting
of possibly obscured widgets into an offscreen pixmap.
* gtk/gtkwidget.[hc]: add GtkWidget::damage-event signal, add
gtk_widget_get_snapshot() to render a widget's contents to a GdkPixmap.
* gtk/gtkmain.c: dispatch GDK_DAMAGE events.
* gdk/gdkwindow.c: moved outer gdk_window_new() and gdk_window_reparent()
implementations here, adapted them to propagate redirects to child windows.
gdk_window_end_paint(): copy repainted window contents to redirection pixmap,
clipped to visible region. queue GDK_DAMAGE event delivery.
gdk_window_redirect_to_drawable(): install window painting redirection.
gdk_window_remove_redirection(): remove previously installed redirection.
* gdk/x11/gdkwindow-x11.c: added _gdk_windowing_window_get_visible_rect(),
renamed _gdk_window_new() and _gdk_window_reparent().
* gdk/gdkwindow.h: added GdkWindowRedirect* to GdkWindowObject, export
gdk_window_redirect_to_drawable() and gdk_window_remove_redirection().
* gdk/gdkevents.h: added GDK_DAMAGE event type.
* gdk/gdkevents.c: extract time and state from GDK_DAMAGE events.
* gdk/gdkinternals.h: added internal prototypes.
svn path=/trunk/; revision=20122
2008-05-21 19:04:24 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* Same as point_in_surface, except it also takes pass_through and its
|
|
|
|
|
interaction with child surfaces into account */
|
2015-06-08 13:36:43 +00:00
|
|
|
|
static gboolean
|
2018-03-20 14:14:10 +00:00
|
|
|
|
point_in_input_surface (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gdouble x,
|
|
|
|
|
gdouble y,
|
|
|
|
|
GdkSurface **input_surface,
|
|
|
|
|
gdouble *input_surface_x,
|
|
|
|
|
gdouble *input_surface_y)
|
2015-06-08 13:36:43 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *sub;
|
2015-06-08 13:36:43 +00:00
|
|
|
|
double child_x, child_y;
|
|
|
|
|
GList *l;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (!point_in_surface (surface, x, y))
|
2015-06-08 13:36:43 +00:00
|
|
|
|
return FALSE;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (!surface->pass_through)
|
2015-06-08 13:36:43 +00:00
|
|
|
|
{
|
2018-03-20 11:05:26 +00:00
|
|
|
|
if (input_surface)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
{
|
|
|
|
|
*input_surface = surface;
|
|
|
|
|
*input_surface_x = x;
|
|
|
|
|
*input_surface_y = y;
|
|
|
|
|
}
|
2015-06-08 13:36:43 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* For pass-through, must be over a child input surface */
|
2015-06-08 13:36:43 +00:00
|
|
|
|
|
|
|
|
|
/* Children is ordered in reverse stack order, i.e. first is topmost */
|
2018-03-20 14:14:10 +00:00
|
|
|
|
for (l = surface->children; l != NULL; l = l->next)
|
2015-06-08 13:36:43 +00:00
|
|
|
|
{
|
|
|
|
|
sub = l->data;
|
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
if (!GDK_SURFACE_IS_MAPPED (sub))
|
2018-03-21 08:06:31 +00:00
|
|
|
|
continue;
|
2015-06-08 13:36:43 +00:00
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
gdk_surface_coords_from_parent ((GdkSurface *)sub,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
x, y,
|
|
|
|
|
&child_x, &child_y);
|
2018-03-20 11:05:26 +00:00
|
|
|
|
if (point_in_input_surface (sub, child_x, child_y,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
input_surface, input_surface_x, input_surface_y))
|
|
|
|
|
{
|
|
|
|
|
if (input_surface)
|
|
|
|
|
gdk_surface_coords_to_parent (sub,
|
|
|
|
|
*input_surface_x,
|
|
|
|
|
*input_surface_y,
|
|
|
|
|
input_surface_x,
|
|
|
|
|
input_surface_y);
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
2015-06-08 13:36:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *
|
2018-03-20 14:14:10 +00:00
|
|
|
|
_gdk_surface_find_child_at (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
double x,
|
|
|
|
|
double y)
|
2009-06-04 16:45:35 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *sub;
|
2009-06-04 16:45:35 +00:00
|
|
|
|
double child_x, child_y;
|
|
|
|
|
GList *l;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (point_in_surface (surface, x, y))
|
2009-06-04 16:45:35 +00:00
|
|
|
|
{
|
|
|
|
|
/* Children is ordered in reverse stack order, i.e. first is topmost */
|
2018-03-20 14:14:10 +00:00
|
|
|
|
for (l = surface->children; l != NULL; l = l->next)
|
2018-03-21 08:06:31 +00:00
|
|
|
|
{
|
|
|
|
|
sub = l->data;
|
2009-06-04 16:45:35 +00:00
|
|
|
|
|
2018-03-21 08:06:31 +00:00
|
|
|
|
if (!GDK_SURFACE_IS_MAPPED (sub))
|
|
|
|
|
continue;
|
2009-06-04 16:45:35 +00:00
|
|
|
|
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gdk_surface_coords_from_parent ((GdkSurface *)sub,
|
2010-04-15 11:16:17 +00:00
|
|
|
|
x, y,
|
|
|
|
|
&child_x, &child_y);
|
2018-03-21 08:06:31 +00:00
|
|
|
|
if (point_in_input_surface (sub, child_x, child_y,
|
|
|
|
|
NULL, NULL, NULL))
|
|
|
|
|
return (GdkSurface *)sub;
|
|
|
|
|
}
|
2009-06-04 16:45:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *
|
2018-03-20 14:14:10 +00:00
|
|
|
|
_gdk_surface_find_descendant_at (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gdouble x,
|
|
|
|
|
gdouble y,
|
|
|
|
|
gdouble *found_x,
|
|
|
|
|
gdouble *found_y)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-03-20 11:05:26 +00:00
|
|
|
|
GdkSurface *sub, *input_surface;
|
2009-08-31 04:55:32 +00:00
|
|
|
|
gdouble child_x, child_y;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
GList *l;
|
2009-06-08 13:57:59 +00:00
|
|
|
|
gboolean found;
|
Bug 318807 – Offscreen windows and window redirection.
2008-03-18 10:49:20 Tim Janik <timj@imendio.com>
* Applied pixmap redirection patch by Alexander Larsson with
various updates from:
Bug 318807 – Offscreen windows and window redirection.
Updates:
* updated docs to mention "Since 2.16".
* tests/testgtk.c: fixed snapshooting pixmap leak.
convert pixmap to pixbuf after snapshooting, to compensate for different
bit depths (occurs when snapshooting ARGB visuals and displaying the
pixmap in an RGB visual).
* gdk/gdkwindow.[hc]: made GdkWindowRedirect private.
* gdk/gdkwindow.c: removed damage idle handler, there's no aparent
need for it. enqueue damage notification as GDK_DAMAGE events
for each painting redirection at the start of the event queue.
consider windows with a redirection fully visible when invalidating,
and when updating from backing store. cleaned up stale variables.
* gdk/gdkevents.c: added _gdk_event_queue_prepend().
* gtk/gtkwidget.c: fixed coordinates for !NO_WINDOW widgets in
gtk_widget_get_snapshot; this fixes garbage snap offsets for gammacurve,
tree, drawingarea, text, handlebox, etc.
clip the redirected window hierarchy to window sizes, the visible
rectangles don't need to be taken into account here.
extended snapshooting docs to recommend gdk_pixbuf_get_from_drawable()
in case pixmap visuals could mismatch.
* gdk/x11/gdkwindow-x11.c: removed _gdk_windowing_window_get_visible_rect().
Base patch:
* tests/testgtk.c: add a "Snapshot" test to demonstrate snapshooting
of possibly obscured widgets into an offscreen pixmap.
* gtk/gtkwidget.[hc]: add GtkWidget::damage-event signal, add
gtk_widget_get_snapshot() to render a widget's contents to a GdkPixmap.
* gtk/gtkmain.c: dispatch GDK_DAMAGE events.
* gdk/gdkwindow.c: moved outer gdk_window_new() and gdk_window_reparent()
implementations here, adapted them to propagate redirects to child windows.
gdk_window_end_paint(): copy repainted window contents to redirection pixmap,
clipped to visible region. queue GDK_DAMAGE event delivery.
gdk_window_redirect_to_drawable(): install window painting redirection.
gdk_window_remove_redirection(): remove previously installed redirection.
* gdk/x11/gdkwindow-x11.c: added _gdk_windowing_window_get_visible_rect(),
renamed _gdk_window_new() and _gdk_window_reparent().
* gdk/gdkwindow.h: added GdkWindowRedirect* to GdkWindowObject, export
gdk_window_redirect_to_drawable() and gdk_window_remove_redirection().
* gdk/gdkevents.h: added GDK_DAMAGE event type.
* gdk/gdkevents.c: extract time and state from GDK_DAMAGE events.
* gdk/gdkinternals.h: added internal prototypes.
svn path=/trunk/; revision=20122
2008-05-21 19:04:24 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (point_in_surface (surface, x, y))
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2009-06-01 10:04:36 +00:00
|
|
|
|
do
|
2018-03-21 08:06:31 +00:00
|
|
|
|
{
|
|
|
|
|
found = FALSE;
|
|
|
|
|
/* Children is ordered in reverse stack order, i.e. first is topmost */
|
|
|
|
|
for (l = surface->children; l != NULL; l = l->next)
|
|
|
|
|
{
|
|
|
|
|
sub = l->data;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2018-03-21 08:06:31 +00:00
|
|
|
|
if (!GDK_SURFACE_IS_MAPPED (sub))
|
|
|
|
|
continue;
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gdk_surface_coords_from_parent ((GdkSurface *)sub,
|
2010-04-15 11:16:17 +00:00
|
|
|
|
x, y,
|
|
|
|
|
&child_x, &child_y);
|
2018-03-21 08:06:31 +00:00
|
|
|
|
if (point_in_input_surface (sub, child_x, child_y,
|
|
|
|
|
&input_surface, &child_x, &child_y))
|
|
|
|
|
{
|
|
|
|
|
x = child_x;
|
|
|
|
|
y = child_y;
|
|
|
|
|
surface = input_surface;
|
|
|
|
|
found = TRUE;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-06-08 13:57:59 +00:00
|
|
|
|
while (found);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* Not in surface at all */
|
|
|
|
|
surface = NULL;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (found_x)
|
|
|
|
|
*found_x = x;
|
|
|
|
|
if (found_y)
|
|
|
|
|
*found_y = y;
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface;
|
Bug 318807 – Offscreen windows and window redirection.
2008-03-18 10:49:20 Tim Janik <timj@imendio.com>
* Applied pixmap redirection patch by Alexander Larsson with
various updates from:
Bug 318807 – Offscreen windows and window redirection.
Updates:
* updated docs to mention "Since 2.16".
* tests/testgtk.c: fixed snapshooting pixmap leak.
convert pixmap to pixbuf after snapshooting, to compensate for different
bit depths (occurs when snapshooting ARGB visuals and displaying the
pixmap in an RGB visual).
* gdk/gdkwindow.[hc]: made GdkWindowRedirect private.
* gdk/gdkwindow.c: removed damage idle handler, there's no aparent
need for it. enqueue damage notification as GDK_DAMAGE events
for each painting redirection at the start of the event queue.
consider windows with a redirection fully visible when invalidating,
and when updating from backing store. cleaned up stale variables.
* gdk/gdkevents.c: added _gdk_event_queue_prepend().
* gtk/gtkwidget.c: fixed coordinates for !NO_WINDOW widgets in
gtk_widget_get_snapshot; this fixes garbage snap offsets for gammacurve,
tree, drawingarea, text, handlebox, etc.
clip the redirected window hierarchy to window sizes, the visible
rectangles don't need to be taken into account here.
extended snapshooting docs to recommend gdk_pixbuf_get_from_drawable()
in case pixmap visuals could mismatch.
* gdk/x11/gdkwindow-x11.c: removed _gdk_windowing_window_get_visible_rect().
Base patch:
* tests/testgtk.c: add a "Snapshot" test to demonstrate snapshooting
of possibly obscured widgets into an offscreen pixmap.
* gtk/gtkwidget.[hc]: add GtkWidget::damage-event signal, add
gtk_widget_get_snapshot() to render a widget's contents to a GdkPixmap.
* gtk/gtkmain.c: dispatch GDK_DAMAGE events.
* gdk/gdkwindow.c: moved outer gdk_window_new() and gdk_window_reparent()
implementations here, adapted them to propagate redirects to child windows.
gdk_window_end_paint(): copy repainted window contents to redirection pixmap,
clipped to visible region. queue GDK_DAMAGE event delivery.
gdk_window_redirect_to_drawable(): install window painting redirection.
gdk_window_remove_redirection(): remove previously installed redirection.
* gdk/x11/gdkwindow-x11.c: added _gdk_windowing_window_get_visible_rect(),
renamed _gdk_window_new() and _gdk_window_reparent().
* gdk/gdkwindow.h: added GdkWindowRedirect* to GdkWindowObject, export
gdk_window_redirect_to_drawable() and gdk_window_remove_redirection().
* gdk/gdkevents.h: added GDK_DAMAGE event type.
* gdk/gdkevents.c: extract time and state from GDK_DAMAGE events.
* gdk/gdkinternals.h: added internal prototypes.
svn path=/trunk/; revision=20122
2008-05-21 19:04:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-06-11 20:11:48 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_beep:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2009-06-11 20:11:48 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Emits a short beep associated to @surface in the appropriate
|
2009-06-11 20:11:48 +00:00
|
|
|
|
* display, if supported. Otherwise, emits a short beep on
|
|
|
|
|
* the display just as gdk_display_beep().
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_beep (GdkSurface *surface)
|
2009-06-11 20:11:48 +00:00
|
|
|
|
{
|
|
|
|
|
GdkDisplay *display;
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *toplevel;
|
2009-06-11 20:11:48 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2009-06-11 20:11:48 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (GDK_SURFACE_DESTROYED (surface))
|
2009-06-11 20:11:48 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
toplevel = get_event_toplevel (surface);
|
|
|
|
|
display = gdk_surface_get_display (surface);
|
2009-06-11 20:11:48 +00:00
|
|
|
|
|
2010-11-25 11:28:08 +00:00
|
|
|
|
if (toplevel)
|
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
if (GDK_SURFACE_IMPL_GET_CLASS (toplevel->impl)->beep (toplevel))
|
2010-11-25 11:28:08 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
2018-03-21 08:06:31 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* If surfaces fail to beep, we beep the display. */
|
2010-11-25 11:28:08 +00:00
|
|
|
|
gdk_display_beep (display);
|
2009-06-11 20:11:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_support_multidevice:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface.
|
|
|
|
|
* @support_multidevice: %TRUE to enable multidevice support in @surface.
|
2010-05-25 22:38:44 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* This function will enable multidevice features in @surface.
|
2010-05-25 22:38:44 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Multidevice aware surfaces will need to handle properly multiple,
|
2010-05-25 22:38:44 +00:00
|
|
|
|
* per device enter/leave events, device grabs and grab ownerships.
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_support_multidevice (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gboolean support_multidevice)
|
2010-05-25 22:38:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (GDK_SURFACE_DESTROYED (surface))
|
2010-05-25 22:38:44 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->support_multidevice == support_multidevice)
|
2010-05-25 22:38:44 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->support_multidevice = support_multidevice;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
/* FIXME: What to do if called when some pointers are inside the surface ? */
|
2010-05-25 22:38:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_support_multidevice:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface.
|
2010-05-25 22:38:44 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns %TRUE if the surface is aware of the existence of multiple
|
2010-05-25 22:38:44 +00:00
|
|
|
|
* devices.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: %TRUE if the surface handles multidevice features.
|
2010-05-25 22:38:44 +00:00
|
|
|
|
**/
|
|
|
|
|
gboolean
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_support_multidevice (GdkSurface *surface)
|
2010-05-25 22:38:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (GDK_SURFACE_DESTROYED (surface))
|
2010-05-25 22:38:44 +00:00
|
|
|
|
return FALSE;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface->support_multidevice;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
|
/* send motion events if the right buttons are down */
|
2012-01-05 00:04:15 +00:00
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
|
GdkEvent *
|
2018-03-20 14:14:10 +00:00
|
|
|
|
_gdk_make_event (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkEventType type,
|
|
|
|
|
GdkEvent *event_in_queue,
|
|
|
|
|
gboolean before_event)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
|
|
|
|
GdkEvent *event = gdk_event_new (type);
|
|
|
|
|
guint32 the_time;
|
|
|
|
|
GdkModifierType the_state;
|
|
|
|
|
|
|
|
|
|
the_time = gdk_event_get_time (event_in_queue);
|
|
|
|
|
gdk_event_get_state (event_in_queue, &the_state);
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
event->any.surface = g_object_ref (surface);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
event->any.send_event = FALSE;
|
2009-08-26 08:34:15 +00:00
|
|
|
|
if (event_in_queue && event_in_queue->any.send_event)
|
|
|
|
|
event->any.send_event = TRUE;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2017-10-06 19:19:42 +00:00
|
|
|
|
switch ((guint) type)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
|
|
|
|
case GDK_MOTION_NOTIFY:
|
|
|
|
|
event->motion.time = the_time;
|
|
|
|
|
event->motion.axes = NULL;
|
|
|
|
|
event->motion.state = the_state;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GDK_BUTTON_PRESS:
|
|
|
|
|
case GDK_BUTTON_RELEASE:
|
|
|
|
|
event->button.time = the_time;
|
|
|
|
|
event->button.axes = NULL;
|
|
|
|
|
event->button.state = the_state;
|
|
|
|
|
break;
|
|
|
|
|
|
2011-02-28 19:53:42 +00:00
|
|
|
|
case GDK_TOUCH_BEGIN:
|
|
|
|
|
case GDK_TOUCH_UPDATE:
|
|
|
|
|
case GDK_TOUCH_END:
|
|
|
|
|
case GDK_TOUCH_CANCEL:
|
|
|
|
|
event->touch.time = the_time;
|
|
|
|
|
event->touch.axes = NULL;
|
|
|
|
|
event->touch.state = the_state;
|
|
|
|
|
break;
|
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
|
case GDK_SCROLL:
|
|
|
|
|
event->scroll.time = the_time;
|
|
|
|
|
event->scroll.state = the_state;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GDK_KEY_PRESS:
|
|
|
|
|
case GDK_KEY_RELEASE:
|
|
|
|
|
event->key.time = the_time;
|
|
|
|
|
event->key.state = the_state;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GDK_ENTER_NOTIFY:
|
|
|
|
|
case GDK_LEAVE_NOTIFY:
|
|
|
|
|
event->crossing.time = the_time;
|
|
|
|
|
event->crossing.state = the_state;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GDK_PROXIMITY_IN:
|
|
|
|
|
case GDK_PROXIMITY_OUT:
|
|
|
|
|
event->proximity.time = the_time;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GDK_DRAG_ENTER:
|
|
|
|
|
case GDK_DRAG_LEAVE:
|
|
|
|
|
case GDK_DRAG_MOTION:
|
|
|
|
|
case GDK_DROP_START:
|
|
|
|
|
event->dnd.time = the_time;
|
|
|
|
|
break;
|
|
|
|
|
|
2015-07-09 16:44:09 +00:00
|
|
|
|
case GDK_TOUCHPAD_SWIPE:
|
|
|
|
|
event->touchpad_swipe.time = the_time;
|
|
|
|
|
event->touchpad_swipe.state = the_state;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GDK_TOUCHPAD_PINCH:
|
|
|
|
|
event->touchpad_pinch.time = the_time;
|
|
|
|
|
event->touchpad_pinch.state = the_state;
|
|
|
|
|
break;
|
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
|
case GDK_FOCUS_CHANGE:
|
|
|
|
|
case GDK_CONFIGURE:
|
|
|
|
|
case GDK_MAP:
|
|
|
|
|
case GDK_UNMAP:
|
|
|
|
|
case GDK_DELETE:
|
|
|
|
|
case GDK_DESTROY:
|
|
|
|
|
case GDK_EXPOSE:
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (event_in_queue)
|
|
|
|
|
{
|
|
|
|
|
if (before_event)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
_gdk_event_queue_insert_before (gdk_surface_get_display (surface), event_in_queue, event);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
else
|
2018-03-20 14:14:10 +00:00
|
|
|
|
_gdk_event_queue_insert_after (gdk_surface_get_display (surface), event_in_queue, event);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
2018-03-20 14:14:10 +00:00
|
|
|
|
_gdk_event_queue_append (gdk_surface_get_display (surface), event);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
|
|
|
|
return event;
|
|
|
|
|
}
|
|
|
|
|
|
2008-12-15 13:02:52 +00:00
|
|
|
|
void
|
2018-03-20 11:05:26 +00:00
|
|
|
|
_gdk_display_set_surface_under_pointer (GdkDisplay *display,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkDevice *device,
|
|
|
|
|
GdkSurface *surface)
|
2008-12-15 09:24:54 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkPointerSurfaceInfo *device_info;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
|
|
|
|
device_info = _gdk_display_get_pointer_info (display, device);
|
|
|
|
|
|
2018-03-20 11:05:26 +00:00
|
|
|
|
if (device_info->surface_under_pointer)
|
|
|
|
|
g_object_unref (device_info->surface_under_pointer);
|
2018-03-20 14:14:10 +00:00
|
|
|
|
device_info->surface_under_pointer = surface;
|
2008-12-15 13:02:52 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface)
|
2010-05-25 22:38:44 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_object_ref (surface);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
update_cursor (display, device);
|
|
|
|
|
}
|
2008-12-15 09:24:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-02-02 13:57:08 +00:00
|
|
|
|
#define GDK_ANY_BUTTON_MASK (GDK_BUTTON1_MASK | \
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GDK_BUTTON2_MASK | \
|
|
|
|
|
GDK_BUTTON3_MASK | \
|
|
|
|
|
GDK_BUTTON4_MASK | \
|
|
|
|
|
GDK_BUTTON5_MASK)
|
2009-02-02 13:57:08 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
#ifdef DEBUG_SURFACE_PRINTING
|
2012-08-23 09:59:00 +00:00
|
|
|
|
|
|
|
|
|
#ifdef GDK_WINDOWING_X11
|
|
|
|
|
#include "x11/gdkx.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
2008-12-18 10:30:10 +00:00
|
|
|
|
static void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_print (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
int indent)
|
2008-12-18 10:30:10 +00:00
|
|
|
|
{
|
2012-08-23 09:59:00 +00:00
|
|
|
|
char *s;
|
2018-03-20 11:05:26 +00:00
|
|
|
|
const char *surface_types[] = {
|
2009-08-28 10:48:13 +00:00
|
|
|
|
"root",
|
|
|
|
|
"toplevel",
|
|
|
|
|
"child",
|
|
|
|
|
"dialog",
|
|
|
|
|
"temp",
|
|
|
|
|
"foreign",
|
2016-10-25 07:54:37 +00:00
|
|
|
|
"subsurface"
|
2009-08-28 10:48:13 +00:00
|
|
|
|
};
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_print ("%*s%p: [%s] %d,%d %dx%d", indent, "", surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
surface->user_data ? g_type_name_from_instance (surface->user_data) : "no widget",
|
|
|
|
|
surface->x, surface->y,
|
|
|
|
|
surface->width, surface->height
|
|
|
|
|
);
|
2008-12-18 10:30:10 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (gdk_surface_has_impl (surface))
|
2008-12-18 10:30:10 +00:00
|
|
|
|
{
|
2009-01-21 10:23:51 +00:00
|
|
|
|
#ifdef GDK_WINDOWING_X11
|
2018-03-20 10:40:08 +00:00
|
|
|
|
g_print (" impl(0x%lx)", gdk_x11_surface_get_xid (window));
|
2009-01-21 10:23:51 +00:00
|
|
|
|
#endif
|
2008-12-18 10:30:10 +00:00
|
|
|
|
}
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->surface_type != GDK_SURFACE_CHILD)
|
|
|
|
|
g_print (" %s", surface_types[surface->surface_type]);
|
2009-08-28 10:48:13 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->input_only)
|
2008-12-18 10:30:10 +00:00
|
|
|
|
g_print (" input-only");
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (!gdk_surface_is_visible ((GdkSurface *)surface))
|
2008-12-18 10:30:10 +00:00
|
|
|
|
g_print (" hidden");
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2008-12-18 10:30:10 +00:00
|
|
|
|
g_print (" abs[%d,%d]",
|
2018-03-21 08:06:31 +00:00
|
|
|
|
surface->abs_x, surface->abs_y);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->alpha != 255)
|
2013-03-01 13:55:54 +00:00
|
|
|
|
g_print (" alpha[%d]",
|
2018-03-21 08:06:31 +00:00
|
|
|
|
surface->alpha);
|
2013-03-01 13:55:54 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
s = print_region (surface->clip_region);
|
2012-08-23 09:59:00 +00:00
|
|
|
|
g_print (" clipbox[%s]", s);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2008-12-18 10:30:10 +00:00
|
|
|
|
g_print ("\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_print_tree (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
int indent,
|
|
|
|
|
gboolean include_input_only)
|
2008-12-18 10:30:10 +00:00
|
|
|
|
{
|
|
|
|
|
GList *l;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->input_only && !include_input_only)
|
2008-12-18 10:30:10 +00:00
|
|
|
|
return;
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_print (surface, indent);
|
2008-12-18 10:30:10 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
for (l = surface->children; l != NULL; l = l->next)
|
2018-03-20 10:40:08 +00:00
|
|
|
|
gdk_surface_print_tree (l->data, indent + 4, include_input_only);
|
2008-12-18 10:30:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
#endif /* DEBUG_SURFACE_PRINTING */
|
2008-12-18 10:30:10 +00:00
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
|
void
|
|
|
|
|
_gdk_windowing_got_event (GdkDisplay *display,
|
2012-02-24 03:20:07 +00:00
|
|
|
|
GList *event_link,
|
|
|
|
|
GdkEvent *event,
|
|
|
|
|
gulong serial)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2018-03-20 11:05:26 +00:00
|
|
|
|
GdkSurface *event_surface;
|
2012-09-26 14:28:06 +00:00
|
|
|
|
gboolean unlink_event = FALSE;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
GdkDeviceGrabInfo *button_release_grab;
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkPointerSurfaceInfo *pointer_info = NULL;
|
2010-12-13 01:12:43 +00:00
|
|
|
|
GdkDevice *device, *source_device;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2016-02-28 15:22:31 +00:00
|
|
|
|
_gdk_display_update_last_event (display, event);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
|
device = gdk_event_get_device (event);
|
2010-12-13 01:12:43 +00:00
|
|
|
|
source_device = gdk_event_get_source_device (event);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
|
|
|
|
if (device)
|
|
|
|
|
{
|
2016-08-04 17:10:21 +00:00
|
|
|
|
if (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD &&
|
|
|
|
|
gdk_device_get_source (device) != GDK_SOURCE_TABLET_PAD)
|
2011-12-03 14:04:19 +00:00
|
|
|
|
{
|
2011-12-06 19:29:22 +00:00
|
|
|
|
pointer_info = _gdk_display_get_pointer_info (display, device);
|
|
|
|
|
|
2011-12-03 14:04:19 +00:00
|
|
|
|
if (source_device != pointer_info->last_slave &&
|
|
|
|
|
gdk_device_get_device_type (source_device) == GDK_DEVICE_TYPE_SLAVE)
|
|
|
|
|
pointer_info->last_slave = source_device;
|
2013-01-23 16:55:59 +00:00
|
|
|
|
else if (pointer_info->last_slave)
|
2011-12-03 14:04:19 +00:00
|
|
|
|
source_device = pointer_info->last_slave;
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-13 01:12:43 +00:00
|
|
|
|
_gdk_display_device_grab_update (display, device, source_device, serial);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2016-05-01 00:59:16 +00:00
|
|
|
|
if (gdk_device_get_input_mode (device) == GDK_MODE_DISABLED ||
|
2010-05-25 22:38:44 +00:00
|
|
|
|
!_gdk_display_check_grab_ownership (display, device, serial))
|
|
|
|
|
{
|
|
|
|
|
/* Device events are blocked by another
|
|
|
|
|
* device grab, or the device is disabled
|
|
|
|
|
*/
|
|
|
|
|
unlink_event = TRUE;
|
|
|
|
|
goto out;
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
event_surface = event->any.surface;
|
2018-03-20 11:05:26 +00:00
|
|
|
|
if (!event_surface)
|
2012-09-26 14:28:06 +00:00
|
|
|
|
goto out;
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
#ifdef DEBUG_SURFACE_PRINTING
|
2017-10-11 13:55:19 +00:00
|
|
|
|
if (event->any.type == GDK_KEY_PRESS &&
|
2009-08-27 13:55:01 +00:00
|
|
|
|
(event->key.keyval == 0xa7 ||
|
|
|
|
|
event->key.keyval == 0xbd))
|
|
|
|
|
{
|
2018-03-20 11:05:26 +00:00
|
|
|
|
gdk_surface_print_tree (event_surface, 0, event->key.keyval == 0xbd);
|
2009-08-27 13:55:01 +00:00
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2017-10-11 13:55:19 +00:00
|
|
|
|
if (event->any.type == GDK_ENTER_NOTIFY)
|
2018-03-20 11:05:26 +00:00
|
|
|
|
_gdk_display_set_surface_under_pointer (display, device, event_surface);
|
2017-10-11 13:55:19 +00:00
|
|
|
|
else if (event->any.type == GDK_LEAVE_NOTIFY)
|
2018-03-20 11:05:26 +00:00
|
|
|
|
_gdk_display_set_surface_under_pointer (display, device, NULL);
|
2009-01-31 18:42:44 +00:00
|
|
|
|
|
2017-10-11 13:55:19 +00:00
|
|
|
|
if ((event->any.type == GDK_BUTTON_RELEASE ||
|
|
|
|
|
event->any.type == GDK_TOUCH_CANCEL ||
|
|
|
|
|
event->any.type == GDK_TOUCH_END) &&
|
2011-12-28 23:06:45 +00:00
|
|
|
|
!event->any.send_event)
|
2009-01-31 18:42:44 +00:00
|
|
|
|
{
|
2017-10-11 13:55:19 +00:00
|
|
|
|
if (event->any.type == GDK_BUTTON_RELEASE ||
|
2016-05-10 19:16:45 +00:00
|
|
|
|
gdk_event_get_pointer_emulated (event))
|
2012-02-24 03:20:07 +00:00
|
|
|
|
{
|
2011-12-28 23:06:45 +00:00
|
|
|
|
button_release_grab =
|
|
|
|
|
_gdk_display_has_device_grab (display, device, serial);
|
|
|
|
|
|
|
|
|
|
if (button_release_grab &&
|
|
|
|
|
button_release_grab->implicit &&
|
|
|
|
|
(event->button.state & GDK_ANY_BUTTON_MASK & ~(GDK_BUTTON1_MASK << (event->button.button - 1))) == 0)
|
|
|
|
|
{
|
|
|
|
|
button_release_grab->serial_end = serial;
|
|
|
|
|
button_release_grab->implicit_ungrab = FALSE;
|
|
|
|
|
_gdk_display_device_grab_update (display, device, source_device, serial);
|
|
|
|
|
}
|
2012-02-24 03:20:07 +00:00
|
|
|
|
}
|
2009-01-31 18:42:44 +00:00
|
|
|
|
}
|
2008-12-09 12:35:46 +00:00
|
|
|
|
|
2009-02-03 19:15:19 +00:00
|
|
|
|
out:
|
2008-12-09 12:35:46 +00:00
|
|
|
|
if (unlink_event)
|
|
|
|
|
{
|
|
|
|
|
_gdk_event_queue_remove_link (display, event_link);
|
|
|
|
|
g_list_free_1 (event_link);
|
2018-05-29 19:53:44 +00:00
|
|
|
|
g_object_unref (event);
|
2008-12-09 12:35:46 +00:00
|
|
|
|
}
|
2012-09-26 14:28:06 +00:00
|
|
|
|
|
|
|
|
|
/* This does two things - first it sees if there are motions at the
|
|
|
|
|
* end of the queue that can be compressed. Second, if there is just
|
|
|
|
|
* a single motion that won't be dispatched because it is a compression
|
|
|
|
|
* candidate it queues up flushing the event queue.
|
|
|
|
|
*/
|
|
|
|
|
_gdk_event_queue_handle_motion_compression (display);
|
Bug 318807 – Offscreen windows and window redirection.
2008-03-18 10:49:20 Tim Janik <timj@imendio.com>
* Applied pixmap redirection patch by Alexander Larsson with
various updates from:
Bug 318807 – Offscreen windows and window redirection.
Updates:
* updated docs to mention "Since 2.16".
* tests/testgtk.c: fixed snapshooting pixmap leak.
convert pixmap to pixbuf after snapshooting, to compensate for different
bit depths (occurs when snapshooting ARGB visuals and displaying the
pixmap in an RGB visual).
* gdk/gdkwindow.[hc]: made GdkWindowRedirect private.
* gdk/gdkwindow.c: removed damage idle handler, there's no aparent
need for it. enqueue damage notification as GDK_DAMAGE events
for each painting redirection at the start of the event queue.
consider windows with a redirection fully visible when invalidating,
and when updating from backing store. cleaned up stale variables.
* gdk/gdkevents.c: added _gdk_event_queue_prepend().
* gtk/gtkwidget.c: fixed coordinates for !NO_WINDOW widgets in
gtk_widget_get_snapshot; this fixes garbage snap offsets for gammacurve,
tree, drawingarea, text, handlebox, etc.
clip the redirected window hierarchy to window sizes, the visible
rectangles don't need to be taken into account here.
extended snapshooting docs to recommend gdk_pixbuf_get_from_drawable()
in case pixmap visuals could mismatch.
* gdk/x11/gdkwindow-x11.c: removed _gdk_windowing_window_get_visible_rect().
Base patch:
* tests/testgtk.c: add a "Snapshot" test to demonstrate snapshooting
of possibly obscured widgets into an offscreen pixmap.
* gtk/gtkwidget.[hc]: add GtkWidget::damage-event signal, add
gtk_widget_get_snapshot() to render a widget's contents to a GdkPixmap.
* gtk/gtkmain.c: dispatch GDK_DAMAGE events.
* gdk/gdkwindow.c: moved outer gdk_window_new() and gdk_window_reparent()
implementations here, adapted them to propagate redirects to child windows.
gdk_window_end_paint(): copy repainted window contents to redirection pixmap,
clipped to visible region. queue GDK_DAMAGE event delivery.
gdk_window_redirect_to_drawable(): install window painting redirection.
gdk_window_remove_redirection(): remove previously installed redirection.
* gdk/x11/gdkwindow-x11.c: added _gdk_windowing_window_get_visible_rect(),
renamed _gdk_window_new() and _gdk_window_reparent().
* gdk/gdkwindow.h: added GdkWindowRedirect* to GdkWindowObject, export
gdk_window_redirect_to_drawable() and gdk_window_remove_redirection().
* gdk/gdkevents.h: added GDK_DAMAGE event type.
* gdk/gdkevents.c: extract time and state from GDK_DAMAGE events.
* gdk/gdkinternals.h: added internal prototypes.
svn path=/trunk/; revision=20122
2008-05-21 19:04:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-08-12 21:43:11 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_create_similar_surface:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: surface to make new surface similar to
|
2010-08-12 21:43:11 +00:00
|
|
|
|
* @content: the content for the new surface
|
|
|
|
|
* @width: width of the new surface
|
|
|
|
|
* @height: height of the new surface
|
|
|
|
|
*
|
|
|
|
|
* Create a new surface that is as compatible as possible with the
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* given @surface. For example the new surface will have the same
|
|
|
|
|
* fallback resolution and font options as @surface. Generally, the new
|
|
|
|
|
* surface will also use the same backend as @surface, unless that is
|
2010-08-12 21:43:11 +00:00
|
|
|
|
* not possible for some reason. The type of the returned surface may
|
|
|
|
|
* be examined with cairo_surface_get_type().
|
|
|
|
|
*
|
|
|
|
|
* Initially the surface contents are all 0 (transparent if contents
|
|
|
|
|
* have transparency, black otherwise.)
|
|
|
|
|
*
|
|
|
|
|
* Returns: a pointer to the newly allocated surface. The caller
|
|
|
|
|
* owns the surface and should call cairo_surface_destroy() when done
|
|
|
|
|
* with it.
|
|
|
|
|
*
|
|
|
|
|
* This function always returns a valid pointer, but it will return a
|
2014-02-05 19:50:22 +00:00
|
|
|
|
* pointer to a “nil” surface if @other is already in an error state
|
2010-08-12 21:43:11 +00:00
|
|
|
|
* or any other error occurs.
|
|
|
|
|
**/
|
|
|
|
|
cairo_surface_t *
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_create_similar_surface (GdkSurface * surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
cairo_content_t content,
|
|
|
|
|
int width,
|
|
|
|
|
int height)
|
2010-08-12 21:43:11 +00:00
|
|
|
|
{
|
2018-04-14 20:45:33 +00:00
|
|
|
|
cairo_surface_t *similar_surface;
|
|
|
|
|
int scale;
|
2010-08-12 21:43:11 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
|
2013-06-04 08:41:44 +00:00
|
|
|
|
|
2018-04-14 20:45:33 +00:00
|
|
|
|
scale = gdk_surface_get_scale_factor (surface);
|
2013-06-04 08:41:44 +00:00
|
|
|
|
|
2018-04-14 20:45:33 +00:00
|
|
|
|
similar_surface = cairo_image_surface_create (content == CAIRO_CONTENT_COLOR ? CAIRO_FORMAT_RGB24 :
|
|
|
|
|
content == CAIRO_CONTENT_ALPHA ? CAIRO_FORMAT_A8 : CAIRO_FORMAT_ARGB32,
|
|
|
|
|
width * scale, height * scale);
|
|
|
|
|
cairo_surface_set_device_scale (similar_surface, scale, scale);
|
2010-08-12 21:43:11 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return similar_surface;
|
2010-08-12 21:43:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_focus:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
* @timestamp: timestamp of the event triggering the surface focus
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Sets keyboard focus to @surface. In most cases, gtk_window_present()
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* should be used on a #GtkWindow, rather than calling this function.
|
|
|
|
|
*
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_focus (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
guint32 timestamp)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->focus (surface, timestamp);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_type_hint:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: A toplevel #GdkSurface
|
|
|
|
|
* @hint: A hint of the function this surface will have
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* The application can use this call to provide a hint to the surface
|
|
|
|
|
* manager about the functionality of a surface. The window manager
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* can use this information when determining the decoration and behaviour
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* of the surface.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* The hint must be set before the surface is mapped.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_type_hint (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkSurfaceTypeHint hint)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_type_hint (surface, hint);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_type_hint:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: A toplevel #GdkSurface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* This function returns the type hint set for a surface.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: The type hint set for @surface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
**/
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceTypeHint
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_type_hint (GdkSurface *surface)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->get_type_hint (surface);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_modal_hint:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: A toplevel #GdkSurface
|
|
|
|
|
* @modal: %TRUE if the surface is modal, %FALSE otherwise.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
|
|
|
|
* The application can use this hint to tell the window manager
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* that a certain surface has modal behaviour. The window manager
|
|
|
|
|
* can use this information to handle modal surfaces in a special
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* way.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* You should only use this on surfaces for which you have
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* previously called gdk_surface_set_transient_for()
|
2010-12-05 20:58:23 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_modal_hint (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gboolean modal)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_modal_hint (surface, modal);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_skip_taskbar_hint:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* @skips_taskbar: %TRUE to skip the taskbar
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Toggles whether a surface should appear in a task list or surface
|
|
|
|
|
* list. If a surface’s semantic type as specified with
|
|
|
|
|
* gdk_surface_set_type_hint() already fully describes the surface, this
|
2014-01-28 06:54:48 +00:00
|
|
|
|
* function should not be called in addition,
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* instead you should allow the surface to be treated according to
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* standard policy for its semantic type.
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_skip_taskbar_hint (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gboolean skips_taskbar)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_skip_taskbar_hint (surface, skips_taskbar);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_skip_pager_hint:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* @skips_pager: %TRUE to skip the pager
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Toggles whether a surface should appear in a pager (workspace
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* switcher, or other desktop utility program that displays a small
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* thumbnail representation of the surfaces on the desktop). If a
|
|
|
|
|
* surface’s semantic type as specified with gdk_surface_set_type_hint()
|
|
|
|
|
* already fully describes the surface, this function should
|
2014-01-28 06:54:48 +00:00
|
|
|
|
* not be called in addition, instead you should
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* allow the surface to be treated according to standard policy for
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* its semantic type.
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_skip_pager_hint (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gboolean skips_pager)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_skip_pager_hint (surface, skips_pager);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_urgency_hint:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
|
|
|
|
* @urgent: %TRUE if the surface is urgent
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Toggles whether a surface needs the user's
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* urgent attention.
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_urgency_hint (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gboolean urgent)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_urgency_hint (surface, urgent);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_geometry_hints:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* @geometry: geometry hints
|
|
|
|
|
* @geom_mask: bitmask indicating fields of @geometry to pay attention to
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Sets the geometry hints for @surface. Hints flagged in @geom_mask
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* are set, hints not flagged in @geom_mask are unset.
|
|
|
|
|
* To unset all hints, use a @geom_mask of 0 and a @geometry of %NULL.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* This function provides hints to the surfaceing system about
|
|
|
|
|
* acceptable sizes for a toplevel surface. The purpose of
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* this is to constrain user resizing, but the windowing system
|
|
|
|
|
* will typically (but is not required to) also constrain the
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* current size of the surface to the provided values and
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* constrain programatic resizing via gdk_surface_resize() or
|
|
|
|
|
* gdk_surface_move_resize().
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Note that on X11, this effect has no effect on surfaces
|
|
|
|
|
* of type %GDK_SURFACE_TEMP since these surfaces are not resizable
|
2016-11-04 01:37:11 +00:00
|
|
|
|
* by the user.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2014-02-07 18:32:47 +00:00
|
|
|
|
* Since you can’t count on the windowing system doing the
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* constraints for programmatic resizes, you should generally
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* call gdk_surface_constrain_size() yourself to determine
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* appropriate sizes.
|
|
|
|
|
*
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_geometry_hints (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
const GdkGeometry *geometry,
|
|
|
|
|
GdkSurfaceHints geom_mask)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2015-07-17 22:37:20 +00:00
|
|
|
|
g_return_if_fail (geometry != NULL || geom_mask == 0);
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_geometry_hints (surface, geometry, geom_mask);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_title:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
|
|
|
|
* @title: title of @surface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Sets the title of a toplevel surface, to be displayed in the titlebar.
|
|
|
|
|
* If you haven’t explicitly set the icon name for the surface
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* (using gdk_surface_set_icon_name()), the icon name will be set to
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* @title as well. @title must be in UTF-8 encoding (as with all
|
|
|
|
|
* user-readable strings in GDK/GTK+). @title may not be %NULL.
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_title (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
const gchar *title)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_title (surface, title);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_role:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* @role: a string indicating its role
|
|
|
|
|
*
|
|
|
|
|
* When using GTK+, typically you should use gtk_window_set_role() instead
|
|
|
|
|
* of this low-level function.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* The window manager and session manager use a surface’s role to
|
|
|
|
|
* distinguish it from other kinds of surface in the same application.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* When an application is restarted after being saved in a previous
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* session, all surfaces with the same title and role are treated as
|
|
|
|
|
* interchangeable. So if you have two surfaces with the same title
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* that should be distinguished for session management purposes, you
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* should set the role on those surfaces. It doesn’t matter what string
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* you use for the role, as long as you have a different role for each
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* non-interchangeable kind of surface.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_role (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
const gchar *role)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_role (surface, role);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_startup_id:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* @startup_id: a string with startup-notification identifier
|
|
|
|
|
*
|
|
|
|
|
* When using GTK+, typically you should use gtk_window_set_startup_id()
|
|
|
|
|
* instead of this low-level function.
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_startup_id (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
const gchar *startup_id)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_startup_id (surface, startup_id);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_transient_for:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* @parent: another toplevel #GdkSurface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Indicates to the window manager that @surface is a transient dialog
|
|
|
|
|
* associated with the application surface @parent. This allows the
|
|
|
|
|
* window manager to do things like center @surface on @parent and
|
|
|
|
|
* keep @surface above @parent.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2014-02-07 18:37:09 +00:00
|
|
|
|
* See gtk_window_set_transient_for() if you’re using #GtkWindow or
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* #GtkDialog.
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_transient_for (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkSurface *parent)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->transient_for = parent;
|
2016-07-16 00:52:35 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_transient_for (surface, parent);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_root_origin:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
|
|
|
|
* @x: (out): return location for X position of surface frame
|
|
|
|
|
* @y: (out): return location for Y position of surface frame
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Obtains the top-left corner of the surface manager frame in root
|
|
|
|
|
* surface coordinates.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_root_origin (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gint *x,
|
|
|
|
|
gint *y)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2014-03-17 19:39:39 +00:00
|
|
|
|
GdkRectangle rect;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_frame_extents (surface, &rect);
|
2014-03-17 19:39:39 +00:00
|
|
|
|
|
|
|
|
|
if (x)
|
|
|
|
|
*x = rect.x;
|
|
|
|
|
|
|
|
|
|
if (y)
|
|
|
|
|
*y = rect.y;
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_frame_extents:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
|
|
|
|
* @rect: (out): rectangle to fill with bounding box of the surface frame
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Obtains the bounding box of the surface, including window manager
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* titlebar/borders if any. The frame position is given in root window
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* coordinates. To get the position of the surface itself (rather than
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* the frame) in root window coordinates, use gdk_surface_get_origin().
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_frame_extents (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkRectangle *rect)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->get_frame_extents (surface, rect);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_accept_focus:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
|
|
|
|
* @accept_focus: %TRUE if the surface should receive input focus
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
|
|
|
|
* Setting @accept_focus to %FALSE hints the desktop environment that the
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* surface doesn’t want to receive input focus.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
|
|
|
|
* On X, it is the responsibility of the window manager to interpret this
|
|
|
|
|
* hint. ICCCM-compliant window manager usually respect it.
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_accept_focus (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gboolean accept_focus)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_accept_focus (surface, accept_focus);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_focus_on_map:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
|
|
|
|
* @focus_on_map: %TRUE if the surface should receive input focus when mapped
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
|
|
|
|
* Setting @focus_on_map to %FALSE hints the desktop environment that the
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* surface doesn’t want to receive input focus when it is mapped.
|
|
|
|
|
* focus_on_map should be turned off for surfaces that aren’t triggered
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* interactively (such as popups from network activity).
|
|
|
|
|
*
|
|
|
|
|
* On X, it is the responsibility of the window manager to interpret
|
|
|
|
|
* this hint. Window managers following the freedesktop.org window
|
|
|
|
|
* manager extension specification should respect it.
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_focus_on_map (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gboolean focus_on_map)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_focus_on_map (surface, focus_on_map);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_icon_list:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: The #GdkSurface toplevel surface to set the icon of.
|
2017-11-04 19:23:33 +00:00
|
|
|
|
* @surfaces: (transfer none) (element-type GdkTexture):
|
2017-10-23 11:43:50 +00:00
|
|
|
|
* A list of image surfaces, of different sizes.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Sets a list of icons for the surface. One of these will be used
|
|
|
|
|
* to represent the surface when it has been iconified. The icon is
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* usually shown in an icon box or some sort of task bar. Which icon
|
|
|
|
|
* size is shown depends on the window manager. The window manager
|
|
|
|
|
* can scale the icon but setting several size icons can give better
|
|
|
|
|
* image quality since the window manager may only need to scale the
|
|
|
|
|
* icon by a small amount or not at all.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Note that some platforms don't support surface icons.
|
2016-08-24 18:43:58 +00:00
|
|
|
|
*/
|
2010-12-05 20:58:23 +00:00
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_icon_list (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GList *textures)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_icon_list (surface, textures);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_icon_name:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
|
|
|
|
* @name: (allow-none): name of surface while iconified (minimized)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Surfaces may have a name used while minimized, distinct from the
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* name they display in their titlebar. Most of the time this is a bad
|
|
|
|
|
* idea from a user interface standpoint. But you can set such a name
|
|
|
|
|
* with this function, if you like.
|
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* After calling this with a non-%NULL @name, calls to gdk_surface_set_title()
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* will not update the icon title.
|
|
|
|
|
*
|
|
|
|
|
* Using %NULL for @name unsets the icon title; further calls to
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_title() will again update the icon title as well.
|
2016-08-24 18:43:58 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Note that some platforms don't support surface icons.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_icon_name (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
const gchar *name)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_icon_name (surface, name);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_iconify:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Asks to iconify (minimize) @surface. The window manager may choose
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* to ignore the request, but normally will honor it. Using
|
|
|
|
|
* gtk_window_iconify() is preferred, if you have a #GtkWindow widget.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* This function only makes sense when @surface is a toplevel surface.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_iconify (GdkSurface *surface)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->iconify (surface);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_deiconify:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Attempt to deiconify (unminimize) @surface. On X11 the window manager may
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* choose to ignore the request to deiconify. When using GTK+,
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* use gtk_window_deiconify() instead of the #GdkSurface variant. Or better yet,
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* you probably want to use gtk_window_present(), which raises the surface, focuses it,
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* unminimizes it, and puts it on the current desktop.
|
|
|
|
|
*
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_deiconify (GdkSurface *surface)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->deiconify (surface);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_stick:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* “Pins” a surface such that it’s on all workspaces and does not scroll
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* with viewports, for window managers that have scrollable viewports.
|
|
|
|
|
* (When using #GtkWindow, gtk_window_stick() may be more useful.)
|
|
|
|
|
*
|
|
|
|
|
* On the X11 platform, this function depends on window manager
|
|
|
|
|
* support, so may have no effect with many window managers. However,
|
|
|
|
|
* GDK will do the best it can to convince the window manager to stick
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* the surface. For window managers that don’t support this operation,
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* there’s nothing you can do to force it to happen.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_stick (GdkSurface *surface)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->stick (surface);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_unstick:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* Reverse operation for gdk_surface_stick(); see gdk_surface_stick(),
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* and gtk_window_unstick().
|
|
|
|
|
*
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_unstick (GdkSurface *surface)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->unstick (surface);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_maximize:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Maximizes the surface. If the surface was already maximized, then
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* this function does nothing.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* On X11, asks the window manager to maximize @surface, if the window
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* manager supports this operation. Not all window managers support
|
2014-02-07 18:32:47 +00:00
|
|
|
|
* this, and some deliberately ignore it or don’t have a concept of
|
|
|
|
|
* “maximized”; so you can’t rely on the maximization actually
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* happening. But it will happen with most standard window managers,
|
|
|
|
|
* and GDK makes a best effort to get it to happen.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* On Windows, reliably maximizes the surface.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_maximize (GdkSurface *surface)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->maximize (surface);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_unmaximize:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Unmaximizes the surface. If the surface wasn’t maximized, then this
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* function does nothing.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* On X11, asks the window manager to unmaximize @surface, if the
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* window manager supports this operation. Not all window managers
|
2014-02-07 18:32:47 +00:00
|
|
|
|
* support this, and some deliberately ignore it or don’t have a
|
|
|
|
|
* concept of “maximized”; so you can’t rely on the unmaximization
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* actually happening. But it will happen with most standard window
|
|
|
|
|
* managers, and GDK makes a best effort to get it to happen.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* On Windows, reliably unmaximizes the surface.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_unmaximize (GdkSurface *surface)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->unmaximize (surface);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_fullscreen:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Moves the surface into fullscreen mode. This means the
|
|
|
|
|
* surface covers the entire screen and is above any panels
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* or task bars.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* If the surface was already fullscreen, then this function does nothing.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* On X11, asks the window manager to put @surface in a fullscreen
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* state, if the window manager supports this operation. Not all
|
|
|
|
|
* window managers support this, and some deliberately ignore it or
|
2014-02-07 18:32:47 +00:00
|
|
|
|
* don’t have a concept of “fullscreen”; so you can’t rely on the
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* fullscreenification actually happening. But it will happen with
|
|
|
|
|
* most standard window managers, and GDK makes a best effort to get
|
|
|
|
|
* it to happen.
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_fullscreen (GdkSurface *surface)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->fullscreen (surface);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-07-13 16:30:42 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_fullscreen_on_monitor:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2015-07-13 16:30:42 +00:00
|
|
|
|
* @monitor: Which monitor to display fullscreen on.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Moves the surface into fullscreen mode on the given monitor. This means
|
|
|
|
|
* the surface covers the entire screen and is above any panels or task bars.
|
2015-07-13 16:30:42 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* If the surface was already fullscreen, then this function does nothing.
|
2015-07-13 16:30:42 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_fullscreen_on_monitor (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkMonitor *monitor)
|
2015-07-13 16:30:42 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2017-11-01 15:52:56 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_MONITOR (monitor));
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (gdk_monitor_get_display (monitor) == gdk_surface_get_display (surface));
|
2017-11-01 15:52:56 +00:00
|
|
|
|
g_return_if_fail (gdk_monitor_is_valid (monitor));
|
2015-07-13 16:30:42 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->fullscreen_on_monitor != NULL)
|
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->fullscreen_on_monitor (surface, monitor);
|
2015-07-13 16:30:42 +00:00
|
|
|
|
else
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->fullscreen (surface);
|
2015-07-13 16:30:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-01-21 10:49:45 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_fullscreen_mode:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2013-01-21 10:49:45 +00:00
|
|
|
|
* @mode: fullscreen mode
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Specifies whether the @surface should span over all monitors (in a multi-head
|
2013-01-21 10:49:45 +00:00
|
|
|
|
* setup) or only the current monitor when in fullscreen mode.
|
|
|
|
|
*
|
|
|
|
|
* The @mode argument is from the #GdkFullscreenMode enumeration.
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* If #GDK_FULLSCREEN_ON_ALL_MONITORS is specified, the fullscreen @surface will
|
2017-11-01 21:08:04 +00:00
|
|
|
|
* span over all monitors of the display.
|
2013-01-21 10:49:45 +00:00
|
|
|
|
*
|
2017-11-01 21:08:04 +00:00
|
|
|
|
* On X11, searches through the list of monitors display the ones
|
|
|
|
|
* which delimit the 4 edges of the entire display and will ask the window
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* manager to span the @surface over these monitors.
|
2013-01-21 10:49:45 +00:00
|
|
|
|
*
|
|
|
|
|
* If the XINERAMA extension is not available or not usable, this function
|
|
|
|
|
* has no effect.
|
|
|
|
|
*
|
2014-02-07 18:32:47 +00:00
|
|
|
|
* Not all window managers support this, so you can’t rely on the fullscreen
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* surface to span over the multiple monitors when #GDK_FULLSCREEN_ON_ALL_MONITORS
|
2013-01-21 10:49:45 +00:00
|
|
|
|
* is specified.
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_fullscreen_mode (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkFullscreenMode mode)
|
2013-01-21 10:49:45 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceImplClass *impl_class;
|
2013-01-21 10:49:45 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2013-01-21 10:49:45 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->fullscreen_mode != mode)
|
2013-01-21 10:49:45 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->fullscreen_mode = mode;
|
2013-01-21 10:49:45 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
|
2013-01-21 10:49:45 +00:00
|
|
|
|
if (impl_class->apply_fullscreen_mode != NULL)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_class->apply_fullscreen_mode (surface);
|
2013-01-21 10:49:45 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_fullscreen_mode:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2013-01-21 10:49:45 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Obtains the #GdkFullscreenMode of the @surface.
|
2013-01-21 10:49:45 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: The #GdkFullscreenMode applied to the surface when fullscreen.
|
2013-01-21 10:49:45 +00:00
|
|
|
|
**/
|
|
|
|
|
GdkFullscreenMode
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_fullscreen_mode (GdkSurface *surface)
|
2013-01-21 10:49:45 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), GDK_FULLSCREEN_ON_CURRENT_MONITOR);
|
2013-01-21 10:49:45 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return surface->fullscreen_mode;
|
2013-01-21 10:49:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-12-05 20:58:23 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_unfullscreen:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Moves the surface out of fullscreen mode. If the surface was not
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* fullscreen, does nothing.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* On X11, asks the window manager to move @surface out of the fullscreen
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* state, if the window manager supports this operation. Not all
|
|
|
|
|
* window managers support this, and some deliberately ignore it or
|
2014-02-07 18:32:47 +00:00
|
|
|
|
* don’t have a concept of “fullscreen”; so you can’t rely on the
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* unfullscreenification actually happening. But it will happen with
|
|
|
|
|
* most standard window managers, and GDK makes a best effort to get
|
|
|
|
|
* it to happen.
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_unfullscreen (GdkSurface *surface)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->unfullscreen (surface);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_keep_above:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
|
|
|
|
* @setting: whether to keep @surface above other surfaces
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Set if @surface must be kept above other surfaces. If the
|
|
|
|
|
* surface was already above, then this function does nothing.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* On X11, asks the window manager to keep @surface above, if the window
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* manager supports this operation. Not all window managers support
|
2014-02-07 18:32:47 +00:00
|
|
|
|
* this, and some deliberately ignore it or don’t have a concept of
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* “keep above”; so you can’t rely on the surface being kept above.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* But it will happen with most standard window managers,
|
|
|
|
|
* and GDK makes a best effort to get it to happen.
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_keep_above (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gboolean setting)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_keep_above (surface, setting);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_keep_below:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
|
|
|
|
* @setting: whether to keep @surface below other surfaces
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Set if @surface must be kept below other surfaces. If the
|
|
|
|
|
* surface was already below, then this function does nothing.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* On X11, asks the window manager to keep @surface below, if the window
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* manager supports this operation. Not all window managers support
|
2014-02-07 18:32:47 +00:00
|
|
|
|
* this, and some deliberately ignore it or don’t have a concept of
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* “keep below”; so you can’t rely on the surface being kept below.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* But it will happen with most standard window managers,
|
|
|
|
|
* and GDK makes a best effort to get it to happen.
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gdk_surface_set_keep_below (GdkSurface *surface,
|
|
|
|
|
gboolean setting)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_keep_below (surface, setting);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_group:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns the group leader surface for @surface. See gdk_surface_set_group().
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: (transfer none): the group leader surface for @surface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
**/
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_group (GdkSurface *surface)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->get_group (surface);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_group:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
|
|
|
|
* @leader: (allow-none): group leader surface, or %NULL to restore the default group leader surface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Sets the group leader surface for @surface. By default,
|
|
|
|
|
* GDK sets the group leader for all toplevel surfaces
|
|
|
|
|
* to a global surface implicitly created by GDK. With this function
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* you can override this default.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* The group leader surface allows the window manager to distinguish
|
|
|
|
|
* all surfaces that belong to a single application. It may for example
|
|
|
|
|
* allow users to minimize/unminimize all surfaces belonging to an
|
|
|
|
|
* application at once. You should only set a non-default group surface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* if your application pretends to be multiple applications.
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_group (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkSurface *leader)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_group (surface, leader);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_decorations:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* @decorations: decoration hint mask
|
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* “Decorations” are the features the window manager adds to a toplevel #GdkSurface.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* This function sets the traditional Motif window manager hints that tell the
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* window manager which decorations you would like your surface to have.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* Usually you should use gtk_window_set_decorated() on a #GtkWindow instead of
|
|
|
|
|
* using the GDK function directly.
|
|
|
|
|
*
|
|
|
|
|
* The @decorations argument is the logical OR of the fields in
|
|
|
|
|
* the #GdkWMDecoration enumeration. If #GDK_DECOR_ALL is included in the
|
|
|
|
|
* mask, the other bits indicate which decorations should be turned off.
|
|
|
|
|
* If #GDK_DECOR_ALL is not included, then the other bits indicate
|
|
|
|
|
* which decorations should be turned on.
|
|
|
|
|
*
|
|
|
|
|
* Most window managers honor a decorations hint of 0 to disable all decorations,
|
|
|
|
|
* but very few honor all possible combinations of bits.
|
|
|
|
|
*
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_decorations (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkWMDecoration decorations)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_decorations (surface, decorations);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_decorations:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: The toplevel #GdkSurface to get the decorations from
|
|
|
|
|
* @decorations: (out): The surface decorations will be written here
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* Returns the decorations set on the GdkSurface with
|
|
|
|
|
* gdk_surface_set_decorations().
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns: %TRUE if the surface has decorations set, %FALSE otherwise.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
**/
|
|
|
|
|
gboolean
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gdk_surface_get_decorations (GdkSurface *surface,
|
|
|
|
|
GdkWMDecoration *decorations)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->get_decorations (surface, decorations);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_functions:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
|
|
|
|
* @functions: bitmask of operations to allow on @surface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
|
|
|
|
* Sets hints about the window management functions to make available
|
|
|
|
|
* via buttons on the window frame.
|
|
|
|
|
*
|
|
|
|
|
* On the X backend, this function sets the traditional Motif window
|
|
|
|
|
* manager hint for this purpose. However, few window managers do
|
|
|
|
|
* anything reliable or interesting with this hint. Many ignore it
|
|
|
|
|
* entirely.
|
|
|
|
|
*
|
|
|
|
|
* The @functions argument is the logical OR of values from the
|
|
|
|
|
* #GdkWMFunction enumeration. If the bitmask includes #GDK_FUNC_ALL,
|
|
|
|
|
* then the other bits indicate which functions to disable; if
|
2014-02-07 18:32:47 +00:00
|
|
|
|
* it doesn’t include #GDK_FUNC_ALL, it indicates which functions to
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* enable.
|
|
|
|
|
*
|
|
|
|
|
**/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_functions (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkWMFunction functions)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_functions (surface, functions);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_begin_resize_drag_for_device:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* @edge: the edge or corner from which the drag is started
|
2011-11-05 05:10:16 +00:00
|
|
|
|
* @device: the device used for the operation
|
2014-01-13 03:06:59 +00:00
|
|
|
|
* @button: the button being used to drag, or 0 for a keyboard-initiated drag
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* @root_x: root window X coordinate of mouse click that began the drag
|
|
|
|
|
* @root_y: root window Y coordinate of mouse click that began the drag
|
|
|
|
|
* @timestamp: timestamp of mouse click that began the drag (use gdk_event_get_time())
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Begins a surface resize operation (for a toplevel surface).
|
2014-02-05 19:50:22 +00:00
|
|
|
|
* You might use this function to implement a “window resize grip,” for
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* example; in fact #GtkStatusbar uses it. The function works best
|
2014-02-03 21:56:15 +00:00
|
|
|
|
* with window managers that support the
|
|
|
|
|
* [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec)
|
|
|
|
|
* but has a fallback implementation for other window managers.
|
2011-11-05 05:10:16 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_begin_resize_drag_for_device (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkSurfaceEdge edge,
|
|
|
|
|
GdkDevice *device,
|
|
|
|
|
gint button,
|
|
|
|
|
gint root_x,
|
|
|
|
|
gint root_y,
|
|
|
|
|
guint32 timestamp)
|
2011-11-05 05:10:16 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->begin_resize_drag (surface, edge, device, button, root_x, root_y, timestamp);
|
2011-11-05 05:10:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_begin_resize_drag:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2011-11-05 05:10:16 +00:00
|
|
|
|
* @edge: the edge or corner from which the drag is started
|
2014-01-13 03:06:59 +00:00
|
|
|
|
* @button: the button being used to drag, or 0 for a keyboard-initiated drag
|
2011-11-05 05:10:16 +00:00
|
|
|
|
* @root_x: root window X coordinate of mouse click that began the drag
|
|
|
|
|
* @root_y: root window Y coordinate of mouse click that began the drag
|
|
|
|
|
* @timestamp: timestamp of mouse click that began the drag (use gdk_event_get_time())
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Begins a surface resize operation (for a toplevel surface).
|
2011-11-05 05:10:16 +00:00
|
|
|
|
*
|
|
|
|
|
* This function assumes that the drag is controlled by the
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* client pointer device, use gdk_surface_begin_resize_drag_for_device()
|
2011-11-05 05:10:16 +00:00
|
|
|
|
* to begin a drag with a different device.
|
|
|
|
|
*/
|
2010-12-05 20:58:23 +00:00
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_begin_resize_drag (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkSurfaceEdge edge,
|
|
|
|
|
gint button,
|
|
|
|
|
gint root_x,
|
|
|
|
|
gint root_y,
|
|
|
|
|
guint32 timestamp)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2015-12-15 22:19:49 +00:00
|
|
|
|
GdkDisplay *display;
|
2011-11-05 05:10:16 +00:00
|
|
|
|
GdkDevice *device;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
display = gdk_surface_get_display (surface);
|
2015-12-15 22:19:49 +00:00
|
|
|
|
device = gdk_seat_get_pointer (gdk_display_get_default_seat (display));
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_begin_resize_drag_for_device (surface, edge,
|
2011-11-05 05:10:16 +00:00
|
|
|
|
device, button, root_x, root_y, timestamp);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_begin_move_drag_for_device:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2011-11-05 05:10:16 +00:00
|
|
|
|
* @device: the device used for the operation
|
2014-01-13 03:06:59 +00:00
|
|
|
|
* @button: the button being used to drag, or 0 for a keyboard-initiated drag
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* @root_x: root window X coordinate of mouse click that began the drag
|
|
|
|
|
* @root_y: root window Y coordinate of mouse click that began the drag
|
|
|
|
|
* @timestamp: timestamp of mouse click that began the drag
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Begins a surface move operation (for a toplevel surface).
|
2014-02-05 19:50:22 +00:00
|
|
|
|
* You might use this function to implement a “window move grip,” for
|
2014-02-03 21:56:15 +00:00
|
|
|
|
* example. The function works best with window managers that support the
|
|
|
|
|
* [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec)
|
|
|
|
|
* but has a fallback implementation for other window managers.
|
2011-11-05 05:10:16 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_begin_move_drag_for_device (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkDevice *device,
|
|
|
|
|
gint button,
|
|
|
|
|
gint root_x,
|
|
|
|
|
gint root_y,
|
|
|
|
|
guint32 timestamp)
|
2011-11-05 05:10:16 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->begin_move_drag (surface,
|
2011-11-05 05:10:16 +00:00
|
|
|
|
device, button, root_x, root_y, timestamp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_begin_move_drag:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a toplevel #GdkSurface
|
2014-01-13 03:06:59 +00:00
|
|
|
|
* @button: the button being used to drag, or 0 for a keyboard-initiated drag
|
2011-11-05 05:10:16 +00:00
|
|
|
|
* @root_x: root window X coordinate of mouse click that began the drag
|
|
|
|
|
* @root_y: root window Y coordinate of mouse click that began the drag
|
|
|
|
|
* @timestamp: timestamp of mouse click that began the drag
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Begins a surface move operation (for a toplevel surface).
|
2011-11-05 05:10:16 +00:00
|
|
|
|
*
|
|
|
|
|
* This function assumes that the drag is controlled by the
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* client pointer device, use gdk_surface_begin_move_drag_for_device()
|
2011-11-05 05:10:16 +00:00
|
|
|
|
* to begin a drag with a different device.
|
|
|
|
|
*/
|
2010-12-05 20:58:23 +00:00
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_begin_move_drag (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gint button,
|
|
|
|
|
gint root_x,
|
|
|
|
|
gint root_y,
|
|
|
|
|
guint32 timestamp)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2015-12-15 22:19:49 +00:00
|
|
|
|
GdkDisplay *display;
|
2011-11-05 05:10:16 +00:00
|
|
|
|
GdkDevice *device;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
display = gdk_surface_get_display (surface);
|
2015-12-15 22:19:49 +00:00
|
|
|
|
device = gdk_seat_get_pointer (gdk_display_get_default_seat (display));
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_begin_move_drag_for_device (surface, device, button, root_x, root_y, timestamp);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_opacity:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a top-level or non-native #GdkSurface
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* @opacity: opacity
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Set @surface to render as partially transparent,
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* with opacity 0 being fully transparent and 1 fully opaque. (Values
|
|
|
|
|
* of the opacity parameter are clamped to the [0,1] range.)
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* For toplevel surfaces this depends on support from the windowing system
|
2012-11-07 12:03:32 +00:00
|
|
|
|
* that may not always be there. For instance, On X11, this works only on
|
2014-10-28 14:48:49 +00:00
|
|
|
|
* X screens with a compositing manager running. On Wayland, there is no
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* per-surface opacity value that the compositor would apply. Instead, use
|
|
|
|
|
* `gdk_surface_set_opaque_region (surface, NULL)` to tell the compositor
|
|
|
|
|
* that the entire surface is (potentially) non-opaque, and draw your content
|
2014-10-28 14:48:49 +00:00
|
|
|
|
* with alpha, or use gtk_widget_set_opacity() to set an overall opacity
|
|
|
|
|
* for your widgets.
|
2012-11-07 12:03:32 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Support for non-toplevel surfaces was added in 3.8.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_opacity (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gdouble opacity)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2012-11-07 12:03:32 +00:00
|
|
|
|
if (opacity < 0)
|
|
|
|
|
opacity = 0;
|
|
|
|
|
else if (opacity > 1)
|
|
|
|
|
opacity = 1;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->alpha = round (opacity * 255);
|
2012-11-07 12:03:32 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->destroyed)
|
2012-11-07 12:03:32 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (gdk_surface_has_impl (surface))
|
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->set_opacity (surface, opacity);
|
2012-11-07 12:03:32 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
recompute_visible_regions (surface, FALSE);
|
2018-03-21 03:07:37 +00:00
|
|
|
|
gdk_surface_invalidate_rect (surface, NULL);
|
2012-11-07 12:03:32 +00:00
|
|
|
|
}
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* This function is called when the XWindow is really gone.
|
|
|
|
|
*/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_destroy_notify (GdkSurface *surface)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->destroy_notify (surface);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_register_dnd:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Registers a surface as a potential drop destination.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_register_dnd (GdkSurface *surface)
|
2010-12-05 20:58:23 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->register_dnd (surface);
|
2010-12-05 20:58:23 +00:00
|
|
|
|
}
|
2010-12-09 05:02:35 +00:00
|
|
|
|
|
2010-12-10 06:27:10 +00:00
|
|
|
|
/**
|
|
|
|
|
* gdk_drag_begin:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: the source surface for this drag
|
2015-12-07 18:47:45 +00:00
|
|
|
|
* @device: the device that controls this drag
|
2017-12-13 14:03:53 +00:00
|
|
|
|
* @content: (transfer none): the offered content
|
2017-12-11 00:45:31 +00:00
|
|
|
|
* @actions: the actions supported by this drag
|
2017-12-10 23:55:56 +00:00
|
|
|
|
* @dx: the x offset to @device's position where the drag nominally started
|
|
|
|
|
* @dy: the y offset to @device's position where the drag nominally started
|
2015-12-07 18:47:45 +00:00
|
|
|
|
*
|
|
|
|
|
* Starts a drag and creates a new drag context for it.
|
|
|
|
|
*
|
|
|
|
|
* This function is called by the drag source.
|
|
|
|
|
*
|
2017-12-11 00:45:31 +00:00
|
|
|
|
* Returns: (transfer full) (nullable): a newly created #GdkDragContext or
|
|
|
|
|
* %NULL on error.
|
2015-12-07 18:47:45 +00:00
|
|
|
|
*/
|
|
|
|
|
GdkDragContext *
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_drag_begin (GdkSurface *surface,
|
2017-12-13 14:03:53 +00:00
|
|
|
|
GdkDevice *device,
|
|
|
|
|
GdkContentProvider *content,
|
|
|
|
|
GdkDragAction actions,
|
|
|
|
|
gint dx,
|
|
|
|
|
gint dy)
|
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
|
2017-12-13 14:03:53 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (gdk_surface_get_display (surface) == gdk_device_get_display (device), NULL);
|
2017-12-13 14:03:53 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_CONTENT_PROVIDER (content), NULL);
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->drag_begin (surface, device, content, actions, dx, dy);
|
2010-12-10 06:27:10 +00:00
|
|
|
|
}
|
2010-12-16 06:21:49 +00:00
|
|
|
|
|
2012-09-26 14:28:06 +00:00
|
|
|
|
static void
|
2018-03-20 10:40:08 +00:00
|
|
|
|
gdk_surface_flush_events (GdkFrameClock *clock,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
void *data)
|
2012-09-26 14:28:06 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GdkSurface *surface;
|
2012-09-26 14:28:06 +00:00
|
|
|
|
GdkDisplay *display;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface = GDK_SURFACE (data);
|
2012-09-26 14:28:06 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
display = gdk_surface_get_display (surface);
|
2013-11-11 23:04:34 +00:00
|
|
|
|
_gdk_event_queue_flush (display);
|
2012-10-07 18:13:56 +00:00
|
|
|
|
_gdk_display_pause_events (display);
|
2012-09-26 14:28:06 +00:00
|
|
|
|
|
|
|
|
|
gdk_frame_clock_request_phase (clock, GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS);
|
2015-01-26 21:52:00 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->frame_clock_events_paused = TRUE;
|
2012-09-26 14:28:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2018-03-20 10:40:08 +00:00
|
|
|
|
gdk_surface_resume_events (GdkFrameClock *clock,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
void *data)
|
2012-09-26 14:28:06 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
GdkSurface *surface;
|
2012-09-26 14:28:06 +00:00
|
|
|
|
GdkDisplay *display;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface = GDK_SURFACE (data);
|
2012-09-26 14:28:06 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
display = gdk_surface_get_display (surface);
|
2012-10-07 18:13:56 +00:00
|
|
|
|
_gdk_display_unpause_events (display);
|
2015-01-26 21:52:00 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->frame_clock_events_paused = FALSE;
|
2012-09-26 14:28:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-01-30 20:09:44 +00:00
|
|
|
|
static void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_frame_clock (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkFrameClock *clock)
|
2012-10-03 22:34:01 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2012-10-03 22:34:01 +00:00
|
|
|
|
g_return_if_fail (clock == NULL || GDK_IS_FRAME_CLOCK (clock));
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (clock == NULL || gdk_surface_is_toplevel (surface));
|
2012-10-03 22:34:01 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (clock == surface->frame_clock)
|
2012-10-03 22:34:01 +00:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (clock)
|
|
|
|
|
{
|
|
|
|
|
g_object_ref (clock);
|
2012-09-26 14:28:06 +00:00
|
|
|
|
g_signal_connect (G_OBJECT (clock),
|
|
|
|
|
"flush-events",
|
2018-03-20 10:40:08 +00:00
|
|
|
|
G_CALLBACK (gdk_surface_flush_events),
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface);
|
2012-10-03 22:34:01 +00:00
|
|
|
|
g_signal_connect (G_OBJECT (clock),
|
|
|
|
|
"paint",
|
2018-03-20 10:40:08 +00:00
|
|
|
|
G_CALLBACK (gdk_surface_paint_on_clock),
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface);
|
2012-09-26 14:28:06 +00:00
|
|
|
|
g_signal_connect (G_OBJECT (clock),
|
|
|
|
|
"resume-events",
|
2018-03-20 10:40:08 +00:00
|
|
|
|
G_CALLBACK (gdk_surface_resume_events),
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface);
|
2012-10-03 22:34:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->frame_clock)
|
2012-10-03 22:34:01 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->frame_clock_events_paused)
|
|
|
|
|
gdk_surface_resume_events (surface->frame_clock, G_OBJECT (surface));
|
2015-01-26 21:52:00 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_signal_handlers_disconnect_by_func (G_OBJECT (surface->frame_clock),
|
2018-03-20 10:40:08 +00:00
|
|
|
|
G_CALLBACK (gdk_surface_flush_events),
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface);
|
|
|
|
|
g_signal_handlers_disconnect_by_func (G_OBJECT (surface->frame_clock),
|
2018-03-20 10:40:08 +00:00
|
|
|
|
G_CALLBACK (gdk_surface_paint_on_clock),
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface);
|
|
|
|
|
g_signal_handlers_disconnect_by_func (G_OBJECT (surface->frame_clock),
|
2018-03-20 10:40:08 +00:00
|
|
|
|
G_CALLBACK (gdk_surface_resume_events),
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface);
|
|
|
|
|
g_object_unref (surface->frame_clock);
|
2012-10-03 22:34:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->frame_clock = clock;
|
2012-10-03 22:34:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_frame_clock:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: surface to get frame clock for
|
2012-10-03 22:34:01 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Gets the frame clock for the surface. The frame clock for a surface
|
|
|
|
|
* never changes unless the surface is reparented to a new toplevel
|
|
|
|
|
* surface.
|
2012-10-03 22:34:01 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: (transfer none): the frame clock
|
2012-10-03 22:34:01 +00:00
|
|
|
|
*/
|
|
|
|
|
GdkFrameClock*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_frame_clock (GdkSurface *surface)
|
2012-10-03 22:34:01 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *toplevel;
|
2013-01-30 20:09:44 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
|
2012-10-03 22:34:01 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
toplevel = gdk_surface_get_toplevel (surface);
|
2012-10-03 22:34:01 +00:00
|
|
|
|
|
2013-01-30 20:09:44 +00:00
|
|
|
|
return toplevel->frame_clock;
|
2012-10-03 22:34:01 +00:00
|
|
|
|
}
|
2013-01-18 14:47:29 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_get_scale_factor:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: surface to get scale factor for
|
2013-01-18 14:47:29 +00:00
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* Returns the internal scale factor that maps from surface coordiantes
|
2013-01-18 14:47:29 +00:00
|
|
|
|
* to the actual device pixels. On traditional systems this is 1, but
|
|
|
|
|
* on very high density outputs this can be a higher value (often 2).
|
|
|
|
|
*
|
|
|
|
|
* A higher value means that drawing is automatically scaled up to
|
|
|
|
|
* a higher resolution, so any code doing drawing will automatically look
|
|
|
|
|
* nicer. However, if you are supplying pixel-based data the scale
|
|
|
|
|
* value can be used to determine whether to use a pixel resource
|
|
|
|
|
* with higher resolution data.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* The scale of a surface may change during runtime, if this happens
|
|
|
|
|
* a configure event will be sent to the toplevel surface.
|
2013-01-18 14:47:29 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the scale factor
|
2013-01-18 14:47:29 +00:00
|
|
|
|
*/
|
|
|
|
|
gint
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_scale_factor (GdkSurface *surface)
|
2013-01-18 14:47:29 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceImplClass *impl_class;
|
2013-01-18 14:47:29 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), 1);
|
2013-01-18 14:47:29 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (GDK_SURFACE_DESTROYED (surface))
|
2013-01-18 14:47:29 +00:00
|
|
|
|
return 1;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
|
2013-01-18 14:47:29 +00:00
|
|
|
|
|
|
|
|
|
if (impl_class->get_scale_factor)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return impl_class->get_scale_factor (surface);
|
2013-01-18 14:47:29 +00:00
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2013-05-14 20:23:33 +00:00
|
|
|
|
|
2014-11-20 10:50:11 +00:00
|
|
|
|
/* Returns the *real* unscaled size, which may be a fractional size
|
2018-03-20 14:14:10 +00:00
|
|
|
|
in surface scale coordinates. We need this to properly handle GL
|
2014-11-20 10:50:11 +00:00
|
|
|
|
coordinates which are y-flipped in the real coordinates. */
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_unscaled_size (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
int *unscaled_width,
|
|
|
|
|
int *unscaled_height)
|
2014-11-20 10:50:11 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceImplClass *impl_class;
|
2014-11-20 10:50:11 +00:00
|
|
|
|
gint scale;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2014-11-20 10:50:11 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (surface->impl_surface == surface)
|
2014-11-20 10:50:11 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
|
2014-11-20 10:50:11 +00:00
|
|
|
|
|
|
|
|
|
if (impl_class->get_unscaled_size)
|
2015-06-13 05:45:57 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_class->get_unscaled_size (surface, unscaled_width, unscaled_height);
|
2015-06-13 05:45:57 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
2014-11-20 10:50:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
scale = gdk_surface_get_scale_factor (surface);
|
2014-11-20 10:50:11 +00:00
|
|
|
|
|
|
|
|
|
if (unscaled_width)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
*unscaled_width = surface->width * scale;
|
2014-11-20 10:50:11 +00:00
|
|
|
|
|
|
|
|
|
if (unscaled_height)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
*unscaled_height = surface->height * scale;
|
2014-11-20 10:50:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2013-05-14 20:23:33 +00:00
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_opaque_region:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a top-level or non-native #GdkSurface
|
2015-04-18 16:54:45 +00:00
|
|
|
|
* @region: (allow-none): a region, or %NULL
|
2013-05-14 20:23:33 +00:00
|
|
|
|
*
|
2015-04-18 16:54:45 +00:00
|
|
|
|
* For optimisation purposes, compositing window managers may
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* like to not draw obscured regions of surfaces, or turn off blending
|
2013-05-14 20:23:33 +00:00
|
|
|
|
* during for these regions. With RGB windows with no transparency,
|
|
|
|
|
* this is just the shape of the window, but with ARGB32 windows, the
|
|
|
|
|
* compositor does not know what regions of the window are transparent
|
|
|
|
|
* or not.
|
|
|
|
|
*
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* This function only works for toplevel surfaces.
|
2013-05-14 20:23:33 +00:00
|
|
|
|
*
|
2015-04-18 16:54:45 +00:00
|
|
|
|
* GTK+ will update this property automatically if
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* the @surface background is opaque, as we know where the opaque regions
|
|
|
|
|
* are. If your surface background is not opaque, please update this
|
2014-01-21 23:41:41 +00:00
|
|
|
|
* property in your #GtkWidget::style-updated handler.
|
2013-05-14 20:23:33 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_opaque_region (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
cairo_region_t *region)
|
2013-05-14 20:23:33 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceImplClass *impl_class;
|
2013-05-14 20:23:33 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
|
|
|
|
g_return_if_fail (!GDK_SURFACE_DESTROYED (surface));
|
2013-05-14 20:23:33 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (cairo_region_equal (surface->opaque_region, region))
|
2017-08-18 10:01:54 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_clear_pointer (&surface->opaque_region, cairo_region_destroy);
|
2017-08-18 10:01:54 +00:00
|
|
|
|
|
|
|
|
|
if (region != NULL)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->opaque_region = cairo_region_reference (region);
|
2017-08-18 10:01:54 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
|
2013-05-14 20:23:33 +00:00
|
|
|
|
|
|
|
|
|
if (impl_class->set_opaque_region)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_class->set_opaque_region (surface, region);
|
2013-05-14 20:23:33 +00:00
|
|
|
|
}
|
2013-12-13 03:38:12 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_set_shadow_width:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2013-12-13 03:38:12 +00:00
|
|
|
|
* @left: The left extent
|
|
|
|
|
* @right: The right extent
|
|
|
|
|
* @top: The top extent
|
|
|
|
|
* @bottom: The bottom extent
|
|
|
|
|
*
|
|
|
|
|
* Newer GTK+ windows using client-side decorations use extra geometry
|
|
|
|
|
* around their frames for effects like shadows and invisible borders.
|
|
|
|
|
* Window managers that want to maximize windows or snap to edges need
|
|
|
|
|
* to know where the extents of the actual frame lie, so that users
|
2014-02-07 18:32:47 +00:00
|
|
|
|
* don’t feel like windows are snapping against random invisible edges.
|
2013-12-13 03:38:12 +00:00
|
|
|
|
*
|
|
|
|
|
* Note that this property is automatically updated by GTK+, so this
|
|
|
|
|
* function should only be used by applications which do not use GTK+
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* to create toplevel surfaces.
|
2013-12-13 03:38:12 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_shadow_width (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
gint left,
|
|
|
|
|
gint right,
|
|
|
|
|
gint top,
|
|
|
|
|
gint bottom)
|
2013-12-13 03:38:12 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceImplClass *impl_class;
|
2013-12-13 03:38:12 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
|
|
|
|
g_return_if_fail (!GDK_SURFACE_DESTROYED (surface));
|
2013-12-13 03:38:12 +00:00
|
|
|
|
g_return_if_fail (left >= 0 && right >= 0 && top >= 0 && bottom >= 0);
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->shadow_top = top;
|
|
|
|
|
surface->shadow_left = left;
|
|
|
|
|
surface->shadow_right = right;
|
|
|
|
|
surface->shadow_bottom = bottom;
|
2016-06-16 15:20:35 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
|
2013-12-13 03:38:12 +00:00
|
|
|
|
|
|
|
|
|
if (impl_class->set_shadow_width)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_class->set_shadow_width (surface, left, right, top, bottom);
|
2013-12-13 03:38:12 +00:00
|
|
|
|
}
|
2014-03-13 21:28:01 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* gdk_surface_show_window_menu:
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* @surface: a #GdkSurface
|
2014-03-13 21:28:01 +00:00
|
|
|
|
* @event: a #GdkEvent to show the menu for
|
|
|
|
|
*
|
2014-05-21 23:01:37 +00:00
|
|
|
|
* Asks the windowing system to show the window menu. The window menu
|
|
|
|
|
* is the menu shown when right-clicking the titlebar on traditional
|
2014-03-13 21:28:01 +00:00
|
|
|
|
* windows managed by the window manager. This is useful for windows
|
|
|
|
|
* using client-side decorations, activating it with a right-click
|
|
|
|
|
* on the window decorations.
|
|
|
|
|
*
|
2014-05-21 23:01:37 +00:00
|
|
|
|
* Returns: %TRUE if the window menu was shown and %FALSE otherwise.
|
2014-03-13 21:28:01 +00:00
|
|
|
|
*/
|
|
|
|
|
gboolean
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_show_window_menu (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkEvent *event)
|
2014-03-13 21:28:01 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceImplClass *impl_class;
|
2014-03-13 21:28:01 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
|
|
|
|
|
g_return_val_if_fail (!GDK_SURFACE_DESTROYED (surface), FALSE);
|
2014-03-13 21:28:01 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
|
2014-03-13 21:28:01 +00:00
|
|
|
|
|
|
|
|
|
if (impl_class->show_window_menu)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return impl_class->show_window_menu (surface, event);
|
2014-03-13 21:28:01 +00:00
|
|
|
|
else
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
2017-09-18 02:09:10 +00:00
|
|
|
|
|
|
|
|
|
gboolean
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_supports_edge_constraints (GdkSurface *surface)
|
2017-09-18 02:09:10 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceImplClass *impl_class;
|
2017-09-18 02:09:10 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
|
|
|
|
|
g_return_val_if_fail (!GDK_SURFACE_DESTROYED (surface), FALSE);
|
2017-09-18 02:09:10 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
|
2017-09-18 02:09:10 +00:00
|
|
|
|
|
|
|
|
|
if (impl_class->supports_edge_constraints)
|
2018-03-20 14:14:10 +00:00
|
|
|
|
return impl_class->supports_edge_constraints (surface);
|
2017-09-18 02:09:10 +00:00
|
|
|
|
else
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
2017-12-15 03:35:27 +00:00
|
|
|
|
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_state (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkSurfaceState new_state)
|
2017-12-15 03:35:27 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2017-12-15 03:35:27 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
if (new_state == surface->state)
|
2017-12-15 03:35:27 +00:00
|
|
|
|
return; /* No actual work to do, nothing changed. */
|
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
/* Actually update the field in GdkSurface, this is sort of an odd
|
2017-12-15 03:35:27 +00:00
|
|
|
|
* place to do it, but seems like the safest since it ensures we expose no
|
|
|
|
|
* inconsistent state to the user.
|
|
|
|
|
*/
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->state = new_state;
|
2017-12-15 03:35:27 +00:00
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
_gdk_surface_update_viewable (surface);
|
2017-12-15 03:35:27 +00:00
|
|
|
|
|
|
|
|
|
/* We only really send the event to toplevels, since
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* all the surface states don't apply to non-toplevels.
|
2018-03-20 10:40:08 +00:00
|
|
|
|
* Non-toplevels do use the GDK_SURFACE_STATE_WITHDRAWN flag
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* internally so we needed to update surface->state.
|
2017-12-15 03:35:27 +00:00
|
|
|
|
*/
|
2018-03-20 14:14:10 +00:00
|
|
|
|
switch (surface->surface_type)
|
2017-12-15 03:35:27 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
case GDK_SURFACE_TOPLEVEL:
|
|
|
|
|
case GDK_SURFACE_TEMP: /* ? */
|
2018-03-20 14:14:10 +00:00
|
|
|
|
g_object_notify (G_OBJECT (surface), "state");
|
2017-12-15 03:35:27 +00:00
|
|
|
|
break;
|
2018-03-20 10:40:08 +00:00
|
|
|
|
case GDK_SURFACE_FOREIGN:
|
|
|
|
|
case GDK_SURFACE_CHILD:
|
2017-12-15 03:35:27 +00:00
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_synthesize_surface_state (GdkSurface *surface,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
GdkSurfaceState unset_flags,
|
|
|
|
|
GdkSurfaceState set_flags)
|
2017-12-15 03:35:27 +00:00
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_set_state (surface, (surface->state | set_flags) & ~unset_flags);
|
2017-12-15 03:35:27 +00:00
|
|
|
|
}
|