2008-07-01 22:57:50 +00:00
|
|
|
|
/* GDK - The GIMP Drawing Kit
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* Copyright (C) 1995-2007 Peter Mattis, Spencer Kimball,
|
|
|
|
|
* Josh MacDonald, Ryan Lortie
|
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
1998-03-17 07:54:57 +00:00
|
|
|
|
|
1999-02-24 07:37:18 +00:00
|
|
|
|
/*
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
|
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
|
* files for a list of changes. These files are distributed with
|
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
|
|
|
*/
|
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
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* SECTION:gdksurface
|
|
|
|
|
* @Short_description: Onscreen display areas in the target window system
|
|
|
|
|
* @Title: Surfaces
|
|
|
|
|
*
|
|
|
|
|
* A #GdkSurface is a (usually) rectangular region on the screen.
|
|
|
|
|
* It’s a low-level object, used to implement high-level objects such as
|
|
|
|
|
* #GtkWidget and #GtkWindow on the GTK level. A #GtkWindow is a toplevel
|
|
|
|
|
* surface, the thing a user might think of as a “window” with a titlebar
|
|
|
|
|
* 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
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* GdkSurface:
|
|
|
|
|
*
|
|
|
|
|
* The GdkSurface struct contains only private fields and
|
|
|
|
|
* 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,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* be it a toplevel window or a child window. In this setup the
|
|
|
|
|
* GdkSurface (and other GdkDrawables) were platform independent classes,
|
|
|
|
|
* and the actual platform specific implementation was in a delegate
|
|
|
|
|
* object available as “impl” in the surface object.
|
|
|
|
|
*
|
|
|
|
|
* With the addition of client side windows this changes a bit. The
|
|
|
|
|
* application-visible GdkSurface object behaves as it did before, but
|
|
|
|
|
* such surfaces now don't a corresponding native window. Instead subwindows
|
|
|
|
|
* surfaces are “client side”, i.e. emulated by the gdk code such
|
|
|
|
|
* that clipping, drawing, moving, events etc work as expected.
|
|
|
|
|
*
|
|
|
|
|
* GdkSurfaces have a pointer to the “impl surface” they are in, i.e.
|
|
|
|
|
* the topmost GdkSurface which have the same “impl” value. This is stored
|
|
|
|
|
* 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).
|
|
|
|
|
*/
|
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 {
|
2019-03-25 12:33:56 +00:00
|
|
|
|
MOVED_TO_RECT,
|
|
|
|
|
SIZE_CHANGED,
|
|
|
|
|
RENDER,
|
|
|
|
|
EVENT,
|
|
|
|
|
LAST_SIGNAL
|
2009-06-04 18:15:29 +00:00
|
|
|
|
};
|
|
|
|
|
|
2009-07-16 06:16:01 +00:00
|
|
|
|
enum {
|
2019-03-25 12:33:56 +00:00
|
|
|
|
PROP_0,
|
|
|
|
|
PROP_CURSOR,
|
|
|
|
|
PROP_DISPLAY,
|
|
|
|
|
PROP_STATE,
|
|
|
|
|
PROP_MAPPED,
|
|
|
|
|
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,
|
2019-03-25 12:33:56 +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,
|
2019-03-25 12:33:56 +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,
|
2019-03-25 12:33:56 +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,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
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,
|
2019-03-25 12:33:56 +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)
|
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
cairo_region_get_rectangle (region, 0, &r);
|
|
|
|
|
g_string_append_printf (s, "%dx%d @%d,%d", r.width, r.height, r.x, r.y);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
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++)
|
2012-08-23 09:59:00 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
cairo_region_get_rectangle (region, i, &r);
|
|
|
|
|
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
|
|
|
|
}
|
2019-03-25 12:33:56 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
g_string_append (s, "}");
|
|
|
|
|
return g_string_free (s, FALSE);
|
2012-08-23 09:59:00 +00:00
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2015-09-10 10:57:16 +00:00
|
|
|
|
static GList *
|
|
|
|
|
list_insert_link_before (GList *list,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GList *sibling,
|
|
|
|
|
GList *link)
|
2015-09-10 10:57:16 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
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);
|
2015-09-10 10:57:16 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
last->next = link;
|
|
|
|
|
link->prev = last;
|
|
|
|
|
link->next = NULL;
|
2015-09-10 10:57:16 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
link->next = sibling;
|
|
|
|
|
link->prev = sibling->prev;
|
|
|
|
|
sibling->prev = link;
|
2015-09-10 10:57:16 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (link->prev)
|
|
|
|
|
link->prev->next = link;
|
2015-09-21 14:58:41 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
return list;
|
|
|
|
|
}
|
2015-09-10 10:57:16 +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 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
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
/* 0-initialization is good for all other fields. */
|
1998-03-07 18:38:18 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
surface->surface_type = GDK_SURFACE_CHILD;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +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
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
surface->device_cursor = g_hash_table_new_full (NULL, NULL,
|
|
|
|
|
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
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +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
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
/* Properties */
|
2009-12-20 20:39:42 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
/**
|
|
|
|
|
* GdkSurface:cursor:
|
|
|
|
|
*
|
|
|
|
|
* The mouse pointer for a #GdkSurface. See gdk_surface_set_cursor() and
|
|
|
|
|
* gdk_surface_get_cursor() for details.
|
|
|
|
|
*/
|
|
|
|
|
properties[PROP_CURSOR] =
|
|
|
|
|
g_param_spec_object ("cursor",
|
|
|
|
|
P_("Cursor"),
|
|
|
|
|
P_("Cursor"),
|
|
|
|
|
GDK_TYPE_CURSOR,
|
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GdkSurface:display:
|
|
|
|
|
*
|
|
|
|
|
* The #GdkDisplay connection of the surface. See gdk_surface_get_display()
|
|
|
|
|
* for details.
|
|
|
|
|
*/
|
|
|
|
|
properties[PROP_DISPLAY] =
|
|
|
|
|
g_param_spec_object ("display",
|
|
|
|
|
P_("Display"),
|
|
|
|
|
P_("Display"),
|
|
|
|
|
GDK_TYPE_DISPLAY,
|
|
|
|
|
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
|
|
|
|
|
|
|
|
|
|
properties[PROP_STATE] =
|
|
|
|
|
g_param_spec_flags ("state",
|
|
|
|
|
P_("State"),
|
|
|
|
|
P_("State"),
|
|
|
|
|
GDK_TYPE_SURFACE_STATE, GDK_SURFACE_STATE_WITHDRAWN,
|
|
|
|
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
|
|
|
|
|
|
|
|
|
properties[PROP_MAPPED] =
|
|
|
|
|
g_param_spec_boolean ("mapped",
|
|
|
|
|
P_("Mapped"),
|
|
|
|
|
P_("Mapped"),
|
|
|
|
|
FALSE,
|
|
|
|
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
|
|
|
|
|
|
|
|
|
g_object_class_install_properties (object_class, LAST_PROP, properties);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GdkSurface::moved-to-rect:
|
|
|
|
|
* @surface: the #GdkSurface that moved
|
|
|
|
|
* @flipped_rect: (nullable): the position of @surface after any possible
|
|
|
|
|
* flipping or %NULL if the backend can't obtain it
|
|
|
|
|
* @final_rect: (nullable): the final position of @surface or %NULL if the
|
|
|
|
|
* backend can't obtain it
|
|
|
|
|
* @flipped_x: %TRUE if the anchors were flipped horizontally
|
|
|
|
|
* @flipped_y: %TRUE if the anchors were flipped vertically
|
|
|
|
|
*
|
|
|
|
|
* Emitted when the position of @surface is finalized after being moved to a
|
|
|
|
|
* destination rectangle.
|
|
|
|
|
*
|
|
|
|
|
* @surface might be flipped over the destination rectangle in order to keep
|
|
|
|
|
* it on-screen, in which case @flipped_x and @flipped_y will be set to %TRUE
|
|
|
|
|
* accordingly.
|
|
|
|
|
*
|
|
|
|
|
* @flipped_rect is the ideal position of @surface after any possible
|
|
|
|
|
* flipping, but before any possible sliding. @final_rect is @flipped_rect,
|
|
|
|
|
* but possibly translated in the case that flipping is still ineffective in
|
|
|
|
|
* keeping @surface on-screen.
|
|
|
|
|
* 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);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GdkSurface::size-changed:
|
|
|
|
|
* @surface: the #GdkSurface
|
|
|
|
|
* @width: the new width
|
|
|
|
|
* @height: the new height
|
|
|
|
|
*
|
|
|
|
|
* Emitted when the size of @surface is changed.
|
|
|
|
|
*/
|
|
|
|
|
signals[SIZE_CHANGED] =
|
|
|
|
|
g_signal_new (g_intern_static_string ("size-changed"),
|
|
|
|
|
G_OBJECT_CLASS_TYPE (object_class),
|
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
|
0,
|
|
|
|
|
NULL,
|
|
|
|
|
NULL,
|
|
|
|
|
NULL,
|
|
|
|
|
G_TYPE_NONE,
|
|
|
|
|
2,
|
|
|
|
|
G_TYPE_INT,
|
|
|
|
|
G_TYPE_INT);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GdkSurface::render:
|
|
|
|
|
* @surface: the #GdkSurface
|
|
|
|
|
* @region: the region that needs to be redrawn
|
|
|
|
|
*
|
|
|
|
|
* Emitted when part of the surface needs to be redrawn.
|
|
|
|
|
*
|
|
|
|
|
* Returns: %TRUE to indicate that the signal has been handled
|
|
|
|
|
*/
|
|
|
|
|
signals[RENDER] =
|
|
|
|
|
g_signal_new (g_intern_static_string ("render"),
|
|
|
|
|
G_OBJECT_CLASS_TYPE (object_class),
|
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
|
0,
|
|
|
|
|
g_signal_accumulator_true_handled,
|
|
|
|
|
NULL,
|
|
|
|
|
NULL,
|
|
|
|
|
G_TYPE_BOOLEAN,
|
|
|
|
|
1,
|
|
|
|
|
CAIRO_GOBJECT_TYPE_REGION);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GdkSurface::event:
|
|
|
|
|
* @surface: the #GdkSurface
|
|
|
|
|
* @event: an input event
|
|
|
|
|
*
|
|
|
|
|
* Emitted when GDK receives an input event for @surface.
|
|
|
|
|
*
|
|
|
|
|
* Returns: %TRUE to indicate that the event has been handled
|
|
|
|
|
*/
|
|
|
|
|
signals[EVENT] =
|
|
|
|
|
g_signal_new (g_intern_static_string ("event"),
|
|
|
|
|
G_OBJECT_CLASS_TYPE (object_class),
|
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
|
0,
|
|
|
|
|
g_signal_accumulator_true_handled,
|
|
|
|
|
NULL,
|
|
|
|
|
NULL,
|
|
|
|
|
G_TYPE_BOOLEAN,
|
|
|
|
|
1,
|
|
|
|
|
GDK_TYPE_EVENT);
|
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,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkSeat *seat,
|
|
|
|
|
GdkSurface *surface)
|
2010-05-25 22:38:44 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkDevice *device = gdk_seat_get_pointer (seat);
|
2015-12-15 22:22:00 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +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
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkSurface *surface = GDK_SURFACE (object);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +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
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (!GDK_SURFACE_DESTROYED (surface))
|
|
|
|
|
{
|
|
|
|
|
g_warning ("losing last reference to undestroyed surface");
|
|
|
|
|
_gdk_surface_destroy (surface, FALSE);
|
|
|
|
|
}
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (surface->impl)
|
|
|
|
|
{
|
|
|
|
|
g_object_unref (surface->impl);
|
|
|
|
|
surface->impl = NULL;
|
|
|
|
|
}
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (surface->impl_surface != surface)
|
|
|
|
|
{
|
|
|
|
|
g_object_unref (surface->impl_surface);
|
|
|
|
|
surface->impl_surface = NULL;
|
|
|
|
|
}
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (surface->input_shape)
|
|
|
|
|
cairo_region_destroy (surface->input_shape);
|
2008-12-17 10:24:46 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (surface->cursor)
|
|
|
|
|
g_object_unref (surface->cursor);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (surface->device_cursor)
|
|
|
|
|
g_hash_table_destroy (surface->device_cursor);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (surface->devices_inside)
|
|
|
|
|
g_list_free (surface->devices_inside);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_clear_object (&surface->display);
|
2016-10-27 13:38:41 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (surface->opaque_region)
|
|
|
|
|
cairo_region_destroy (surface->opaque_region);
|
2017-08-18 10:01:54 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +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,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
guint prop_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
2009-07-16 06:16:01 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkSurface *surface = GDK_SURFACE (object);
|
2009-07-16 06:16:01 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
switch (prop_id)
|
|
|
|
|
{
|
|
|
|
|
case PROP_CURSOR:
|
|
|
|
|
gdk_surface_set_cursor (surface, g_value_get_object (value));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PROP_DISPLAY:
|
|
|
|
|
surface->display = g_value_dup_object (value);
|
|
|
|
|
g_assert (surface->display != NULL);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2009-07-16 06:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2018-03-20 10:40:08 +00:00
|
|
|
|
gdk_surface_get_property (GObject *object,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
guint prop_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
2009-07-16 06:16:01 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkSurface *surface = GDK_SURFACE (object);
|
2009-07-16 06:16:01 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
switch (prop_id)
|
|
|
|
|
{
|
|
|
|
|
case PROP_CURSOR:
|
|
|
|
|
g_value_set_object (value, gdk_surface_get_cursor (surface));
|
|
|
|
|
break;
|
2009-07-16 06:16:01 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
case PROP_DISPLAY:
|
|
|
|
|
g_value_set_object (value, surface->display);
|
|
|
|
|
break;
|
2016-10-27 13:38:41 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
case PROP_STATE:
|
|
|
|
|
g_value_set_flags (value, surface->state);
|
|
|
|
|
break;
|
2017-12-14 23:51:38 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
case PROP_MAPPED:
|
|
|
|
|
g_value_set_boolean (value, GDK_SURFACE_IS_MAPPED (surface));
|
|
|
|
|
break;
|
2018-07-15 18:23:54 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
default:
|
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2009-07-16 06:16:01 +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
|
|
|
|
{
|
2019-03-25 12:33:56 +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
|
|
|
|
{
|
2019-03-25 12:33:56 +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
|
|
|
|
{
|
2019-03-25 12:33:56 +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
|
|
|
|
{
|
2019-03-25 12:33:56 +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
|
|
|
|
{
|
2019-03-25 12:33:56 +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,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
gboolean for_input,
|
|
|
|
|
cairo_region_t *region)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkSurface *child;
|
|
|
|
|
cairo_region_t *child_region;
|
|
|
|
|
GdkRectangle r;
|
|
|
|
|
GList *l;
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
for (l = surface->children; l; l = l->next)
|
|
|
|
|
{
|
|
|
|
|
child = l->data;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
/* If region is empty already, no need to do
|
|
|
|
|
anything potentially costly */
|
|
|
|
|
if (cairo_region_is_empty (region))
|
|
|
|
|
break;
|
2009-07-19 20:36:43 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (!GDK_SURFACE_IS_MAPPED (child) || child->input_only)
|
|
|
|
|
continue;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +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
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
/* Bail early if child totally outside region */
|
|
|
|
|
if (cairo_region_contains_rectangle (region, &r) == CAIRO_REGION_OVERLAP_OUT)
|
|
|
|
|
continue;
|
2009-07-19 20:35:25 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
child_region = cairo_region_create_rectangle (&r);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (for_input)
|
|
|
|
|
{
|
|
|
|
|
if (child->input_shape)
|
|
|
|
|
cairo_region_intersect (child_region, child->input_shape);
|
|
|
|
|
}
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
cairo_region_subtract (region, child_region);
|
|
|
|
|
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,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
gboolean recalculate_clip,
|
|
|
|
|
gboolean recalculate_children)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GList *l;
|
|
|
|
|
GdkSurface *child;
|
|
|
|
|
gboolean abs_pos_changed;
|
|
|
|
|
int old_abs_x, old_abs_y;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
old_abs_x = private->abs_x;
|
|
|
|
|
old_abs_y = private->abs_y;
|
2009-05-26 18:53:48 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
/* Update absolute position */
|
|
|
|
|
if (gdk_surface_has_impl (private))
|
|
|
|
|
{
|
|
|
|
|
/* Native surfaces and toplevel subsurfaces start here */
|
|
|
|
|
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;
|
|
|
|
|
}
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
abs_pos_changed =
|
|
|
|
|
private->abs_x != old_abs_x ||
|
|
|
|
|
private->abs_y != old_abs_y;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
/* Update all children, recursively */
|
|
|
|
|
if ((abs_pos_changed || recalculate_children))
|
|
|
|
|
{
|
|
|
|
|
for (l = private->children; l; l = l->next)
|
|
|
|
|
{
|
|
|
|
|
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:
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* size changed
|
|
|
|
|
* surface moved
|
|
|
|
|
* new surface added
|
|
|
|
|
* stacking order of surface changed
|
|
|
|
|
* child deleted
|
|
|
|
|
*
|
|
|
|
|
* It will recalculate abs_x/y and the clip regions
|
|
|
|
|
*
|
|
|
|
|
* Unless the surface didn’t change stacking order or size/pos, pass in TRUE
|
|
|
|
|
* for recalculate_siblings. (Mostly used internally for the recursion)
|
|
|
|
|
*
|
|
|
|
|
* If a child surface was removed (and you can’t use that child for
|
|
|
|
|
* recompute_visible_regions), pass in TRUE for recalculate_children on the parent
|
|
|
|
|
*/
|
2008-07-18 13:03:42 +00:00
|
|
|
|
static void
|
2018-03-20 10:40:08 +00:00
|
|
|
|
recompute_visible_regions (GdkSurface *private,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
gboolean recalculate_children)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
recompute_visible_regions_internal (private,
|
|
|
|
|
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
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GSList *l;
|
2018-04-08 22:35:32 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
for (l = surface->draw_contexts; l; l = l->next)
|
|
|
|
|
gdk_draw_context_surface_resized (l->data);
|
2018-04-08 22:35:32 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
recompute_visible_regions (surface, FALSE);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface*
|
|
|
|
|
gdk_surface_new (GdkDisplay *display,
|
2019-03-25 12:33:56 +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
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkSurface *surface;
|
|
|
|
|
gboolean native;
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_val_if_fail (attributes != NULL, NULL);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (parent != NULL && GDK_SURFACE_DESTROYED (parent))
|
|
|
|
|
{
|
|
|
|
|
g_warning ("gdk_surface_new(): parent is destroyed");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +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
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
surface->parent = parent;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
surface->accept_focus = TRUE;
|
|
|
|
|
surface->focus_on_map = TRUE;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +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
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (attributes->wclass == GDK_INPUT_ONLY)
|
|
|
|
|
{
|
|
|
|
|
/* Backwards compatiblity - we've always ignored
|
|
|
|
|
* attributes->surface_type for input-only surfaces
|
|
|
|
|
* before
|
|
|
|
|
*/
|
|
|
|
|
if (parent == NULL)
|
|
|
|
|
surface->surface_type = GDK_SURFACE_TEMP;
|
|
|
|
|
else
|
|
|
|
|
surface->surface_type = GDK_SURFACE_CHILD;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
surface->surface_type = attributes->surface_type;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
/* Sanity checks */
|
|
|
|
|
switch (surface->surface_type)
|
|
|
|
|
{
|
|
|
|
|
case GDK_SURFACE_TOPLEVEL:
|
|
|
|
|
case GDK_SURFACE_TEMP:
|
|
|
|
|
if (parent != NULL)
|
|
|
|
|
g_warning (G_STRLOC "Toplevel surfaces must be created without a parent");
|
|
|
|
|
break;
|
|
|
|
|
case GDK_SURFACE_CHILD:
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
g_warning (G_STRLOC "cannot make surfaces of type %d", surface->surface_type);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (attributes->wclass == GDK_INPUT_OUTPUT)
|
|
|
|
|
{
|
|
|
|
|
surface->input_only = FALSE;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
surface->input_only = TRUE;
|
|
|
|
|
}
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
native = FALSE;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (surface->parent != NULL)
|
|
|
|
|
surface->parent->children = g_list_concat (&surface->children_list_node, surface->parent->children);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
GdkFrameClock *frame_clock = g_object_new (GDK_TYPE_FRAME_CLOCK_IDLE, NULL);
|
|
|
|
|
gdk_surface_set_frame_clock (surface, frame_clock);
|
|
|
|
|
g_object_unref (frame_clock);
|
2013-01-30 20:09:44 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
native = TRUE; /* Always use native surfaces for toplevels */
|
|
|
|
|
}
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (native)
|
|
|
|
|
{
|
|
|
|
|
/* Create the impl */
|
|
|
|
|
gdk_display_create_surface_impl (display, surface, parent, attributes);
|
|
|
|
|
surface->impl_surface = surface;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
surface->impl_surface = g_object_ref (surface->parent->impl_surface);
|
|
|
|
|
surface->impl = g_object_ref (surface->impl_surface->impl);
|
|
|
|
|
}
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
recompute_visible_regions (surface, FALSE);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_signal_connect (display, "seat-removed", G_CALLBACK (seat_removed_cb), surface);
|
2014-10-09 09:03:47 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +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
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* gdk_surface_new_toplevel: (constructor)
|
|
|
|
|
* @display: the display to create the surface on
|
|
|
|
|
* @width: width of new surface
|
|
|
|
|
* @height: height of new surface
|
|
|
|
|
*
|
|
|
|
|
* Creates a new toplevel surface. The surface will be managed by the surface
|
|
|
|
|
* manager.
|
|
|
|
|
*
|
|
|
|
|
* Returns: (transfer full): the new #GdkSurface
|
|
|
|
|
**/
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *
|
|
|
|
|
gdk_surface_new_toplevel (GdkDisplay *display,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
gint width,
|
|
|
|
|
gint height)
|
2016-11-06 16:40:59 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkSurfaceAttr attr;
|
2016-11-06 16:40:59 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
2016-11-06 16:40:59 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
attr.wclass = GDK_INPUT_OUTPUT;
|
|
|
|
|
attr.x = 0;
|
|
|
|
|
attr.y = 0;
|
|
|
|
|
attr.width = width;
|
|
|
|
|
attr.height = height;
|
|
|
|
|
attr.surface_type = GDK_SURFACE_TOPLEVEL;
|
2016-11-06 16:40:59 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +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
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* gdk_surface_new_popup: (constructor)
|
|
|
|
|
* @display: the display to create the surface on
|
|
|
|
|
* @position: position of the surface on screen
|
|
|
|
|
*
|
|
|
|
|
* Creates a new toplevel popup surface. The surface will bypass surface
|
|
|
|
|
* management.
|
|
|
|
|
*
|
|
|
|
|
* Returns: (transfer full): the new #GdkSurface
|
|
|
|
|
**/
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *
|
|
|
|
|
gdk_surface_new_popup (GdkDisplay *display,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
const GdkRectangle *position)
|
2016-11-06 22:47:56 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkSurfaceAttr attr;
|
2016-11-06 22:47:56 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
|
|
|
|
g_return_val_if_fail (position != NULL, NULL);
|
2016-11-06 22:47:56 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
attr.wclass = GDK_INPUT_OUTPUT;
|
|
|
|
|
attr.x = position->x;
|
|
|
|
|
attr.y = position->y;
|
|
|
|
|
attr.width = position->width;
|
|
|
|
|
attr.height = position->height;
|
|
|
|
|
attr.surface_type = GDK_SURFACE_TEMP;
|
2016-11-06 22:47:56 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +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
|
|
|
|
|
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* gdk_surface_new_temp: (constructor)
|
|
|
|
|
* @display: the display to create the surface on
|
|
|
|
|
*
|
|
|
|
|
* Creates a new toplevel temporary surface. The surface will be
|
|
|
|
|
* situated off-screen and not handle output.
|
|
|
|
|
*
|
|
|
|
|
* You most likely do not want to use this function.
|
|
|
|
|
*
|
|
|
|
|
* Returns: (transfer full): the new #GdkSurface
|
|
|
|
|
**/
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *
|
|
|
|
|
gdk_surface_new_temp (GdkDisplay *display)
|
2016-11-07 00:03:17 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkSurfaceAttr attr;
|
2016-11-07 00:03:17 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
2016-11-07 00:03:17 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
attr.wclass = GDK_INPUT_ONLY;
|
|
|
|
|
attr.x = -100;
|
|
|
|
|
attr.y = -100;
|
|
|
|
|
attr.width = 10;
|
|
|
|
|
attr.height = 10;
|
|
|
|
|
attr.surface_type = GDK_SURFACE_TEMP;
|
2016-11-07 00:03:17 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +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
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* gdk_surface_new_child: (constructor)
|
|
|
|
|
* @parent: the parent surface
|
|
|
|
|
* @position: placement of the surface inside @parent
|
|
|
|
|
*
|
|
|
|
|
* Creates a new client-side child surface.
|
|
|
|
|
*
|
|
|
|
|
* Returns: (transfer full): the new #GdkSurface
|
|
|
|
|
**/
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *
|
|
|
|
|
gdk_surface_new_child (GdkSurface *parent,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
const GdkRectangle *position)
|
2016-10-17 18:11:23 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkSurfaceAttr attr;
|
2016-10-17 18:11:23 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (parent), NULL);
|
2016-10-17 18:11:23 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
attr.wclass = GDK_INPUT_OUTPUT;
|
|
|
|
|
attr.x = position->x;
|
|
|
|
|
attr.y = position->y;
|
|
|
|
|
attr.width = position->width;
|
|
|
|
|
attr.height = position->height;
|
|
|
|
|
attr.surface_type = GDK_SURFACE_CHILD;
|
2016-10-17 18:11:23 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +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,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkDevice *device,
|
|
|
|
|
GdkPointerSurfaceInfo *pointer_info,
|
|
|
|
|
gpointer user_data)
|
2010-05-25 22:38:44 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkSurface *surface = user_data;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (pointer_info->surface_under_pointer == surface)
|
|
|
|
|
{
|
|
|
|
|
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,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkDisplay *display)
|
2010-05-25 22:38:44 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
_gdk_display_pointer_info_foreach (display,
|
|
|
|
|
update_pointer_info_foreach,
|
|
|
|
|
surface);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-07-18 13:03:42 +00:00
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* _gdk_surface_destroy_hierarchy:
|
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
* @recursing: If %TRUE, then this is being called because a parent
|
|
|
|
|
* was destroyed.
|
|
|
|
|
* @recursing_native: If %TRUE, then this is being called because a native parent
|
|
|
|
|
* was destroyed. This generally means that the call to the
|
|
|
|
|
* windowing system to destroy the surface can be omitted, since
|
|
|
|
|
* it will be destroyed as a result of the parent being destroyed.
|
|
|
|
|
* Unless @foreign_destroy.
|
|
|
|
|
* @foreign_destroy: If %TRUE, the surface or a parent was destroyed by some
|
|
|
|
|
* external agency. The surface has already been destroyed and no
|
|
|
|
|
* windowing system calls should be made. (This may never happen
|
|
|
|
|
* for some windowing systems.)
|
|
|
|
|
*
|
|
|
|
|
* Internal function to destroy a surface. Like gdk_surface_destroy(),
|
|
|
|
|
* 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,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
gboolean recursing,
|
|
|
|
|
gboolean recursing_native,
|
|
|
|
|
gboolean foreign_destroy)
|
2000-05-15 16:09:53 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkSurfaceImplClass *impl_class;
|
|
|
|
|
GdkSurface *temp_surface;
|
|
|
|
|
GdkDisplay *display;
|
|
|
|
|
GList *tmp;
|
2008-10-21 21:42:39 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2008-10-21 21:42:39 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (GDK_SURFACE_DESTROYED (surface))
|
|
|
|
|
return;
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
display = gdk_surface_get_display (surface);
|
2009-02-28 05:24:07 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
switch (surface->surface_type)
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GDK_SURFACE_TOPLEVEL:
|
|
|
|
|
case GDK_SURFACE_CHILD:
|
|
|
|
|
case GDK_SURFACE_TEMP:
|
|
|
|
|
if (surface->parent)
|
|
|
|
|
{
|
|
|
|
|
if (surface->parent->children)
|
|
|
|
|
surface->parent->children = g_list_remove_link (surface->parent->children, &surface->children_list_node);
|
|
|
|
|
|
|
|
|
|
if (!recursing &&
|
|
|
|
|
GDK_SURFACE_IS_MAPPED (surface))
|
2000-05-15 16:09:53 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
recompute_visible_regions (surface, FALSE);
|
|
|
|
|
gdk_surface_invalidate_in_parent (surface);
|
2000-05-15 16:09:53 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (surface->gl_paint_context)
|
|
|
|
|
{
|
|
|
|
|
/* Make sure to destroy if current */
|
|
|
|
|
g_object_run_dispose (G_OBJECT (surface->gl_paint_context));
|
|
|
|
|
g_object_unref (surface->gl_paint_context);
|
|
|
|
|
surface->gl_paint_context = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (surface->frame_clock)
|
|
|
|
|
{
|
|
|
|
|
g_object_run_dispose (G_OBJECT (surface->frame_clock));
|
|
|
|
|
gdk_surface_set_frame_clock (surface, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (surface), properties[PROP_STATE]);
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (surface), properties[PROP_MAPPED]);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2000-05-15 16:09:53 +00:00
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* _gdk_surface_destroy:
|
|
|
|
|
* @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
|
|
|
|
|
* windowing system calls should be made. (This may never happen
|
|
|
|
|
* for some windowing systems.)
|
|
|
|
|
*
|
|
|
|
|
* Internal function to destroy a surface. Like gdk_surface_destroy(),
|
|
|
|
|
* 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,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
gboolean foreign_destroy)
|
2000-05-15 16:09:53 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +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
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* gdk_surface_destroy:
|
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
*
|
|
|
|
|
* 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
|
|
|
|
|
* destroyed, but the children’s reference counts are not decremented.
|
|
|
|
|
*
|
|
|
|
|
* Note that a surface will not be destroyed automatically when its reference count
|
|
|
|
|
* reaches zero. You must call this function yourself before that happens.
|
|
|
|
|
*
|
|
|
|
|
**/
|
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
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
_gdk_surface_destroy_hierarchy (surface, FALSE, FALSE, FALSE);
|
|
|
|
|
g_object_unref (surface);
|
2000-05-15 16:09:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
void
|
2019-02-23 23:56:02 +00:00
|
|
|
|
gdk_surface_set_widget (GdkSurface *surface,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
gpointer widget)
|
1998-01-01 20:38:21 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
surface->widget = widget;
|
1998-01-01 20:38:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-02-23 23:56:02 +00:00
|
|
|
|
gpointer
|
|
|
|
|
gdk_surface_get_widget (GdkSurface *surface)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
return surface->widget;
|
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
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* gdk_surface_get_surface_type:
|
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
*
|
|
|
|
|
* Gets the type of the surface. See #GdkSurfaceType.
|
|
|
|
|
*
|
|
|
|
|
* Returns: type of surface
|
|
|
|
|
**/
|
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
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), (GdkSurfaceType) -1);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
return GDK_SURFACE_TYPE (surface);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-08-29 00:03:19 +00:00
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* gdk_surface_get_display:
|
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
*
|
|
|
|
|
* Gets the #GdkDisplay associated with a #GdkSurface.
|
|
|
|
|
*
|
|
|
|
|
* 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
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
|
2010-08-29 00:03:19 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
return surface->display;
|
2010-08-29 00:03:19 +00:00
|
|
|
|
}
|
2009-09-04 15:49:57 +00:00
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* gdk_surface_is_destroyed:
|
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
*
|
|
|
|
|
* Check to see if a surface is destroyed..
|
|
|
|
|
*
|
|
|
|
|
* 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
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
return GDK_SURFACE_DESTROYED (surface);
|
2009-09-04 15:49:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-06-28 22:31:39 +00:00
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* gdk_surface_has_native:
|
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
*
|
|
|
|
|
* Checks whether the surface has a native surface or not.
|
|
|
|
|
*
|
|
|
|
|
* 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
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
|
2010-06-28 22:31:39 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +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
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* gdk_surface_get_position:
|
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
* @x: (out) (allow-none): X coordinate of surface
|
|
|
|
|
* @y: (out) (allow-none): Y coordinate of surface
|
|
|
|
|
*
|
|
|
|
|
* Obtains the position of the surface as reported in the
|
|
|
|
|
* most-recently-processed #GdkEventConfigure. Contrast with
|
|
|
|
|
* gdk_surface_get_geometry() which queries the X server for the
|
|
|
|
|
* current surface position, regardless of which events have been
|
|
|
|
|
* received or processed.
|
|
|
|
|
*
|
|
|
|
|
* The position coordinates are relative to the surface’s parent surface.
|
|
|
|
|
*
|
|
|
|
|
**/
|
1997-11-24 22:37:52 +00:00
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_get_position (GdkSurface *surface,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
gint *x,
|
|
|
|
|
gint *y)
|
1999-11-08 20:14:59 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (x)
|
|
|
|
|
*x = surface->x;
|
|
|
|
|
if (y)
|
|
|
|
|
*y = surface->y;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-10-03 18:19:48 +00:00
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* gdk_surface_get_parent:
|
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
*
|
|
|
|
|
* Obtains the parent of @surface, as known to GDK. Does not query the
|
|
|
|
|
* X server; thus this returns the parent as passed to gdk_surface_new(),
|
|
|
|
|
* not the actual parent. This should never matter unless you’re using
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
* Returns: (transfer none): parent of @surface
|
|
|
|
|
**/
|
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
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
return surface->parent;
|
1998-11-06 22:05:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-10-03 18:19:48 +00:00
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* gdk_surface_get_toplevel:
|
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
*
|
|
|
|
|
* Gets the toplevel surface that’s an ancestor of @surface.
|
|
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
* Returns: (transfer none): the toplevel surface containing @surface
|
|
|
|
|
**/
|
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
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
|
1999-11-08 20:14:59 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
while (surface->surface_type == GDK_SURFACE_CHILD)
|
|
|
|
|
{
|
|
|
|
|
if (gdk_surface_is_toplevel (surface))
|
|
|
|
|
break;
|
|
|
|
|
surface = surface->parent;
|
|
|
|
|
}
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +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
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* gdk_surface_get_children:
|
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
*
|
|
|
|
|
* Gets the list of children of @surface known to GDK.
|
|
|
|
|
* This function only returns children created via GDK,
|
|
|
|
|
* so for example it’s useless when used with the root window;
|
|
|
|
|
* it only returns surfaces an application created itself.
|
|
|
|
|
*
|
|
|
|
|
* The returned list must be freed, but the elements in the
|
|
|
|
|
* list need not be.
|
|
|
|
|
*
|
|
|
|
|
* Returns: (transfer container) (element-type GdkSurface):
|
|
|
|
|
* list of child surfaces inside @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
|
|
|
|
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
|
|
|
|
{
|
2019-03-25 12:33:56 +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
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (GDK_SURFACE_DESTROYED (surface))
|
|
|
|
|
return 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
|
|
|
|
|
2019-03-25 12:33:56 +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
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* gdk_surface_peek_children:
|
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
*
|
|
|
|
|
* Like gdk_surface_get_children(), but does not copy the list of
|
|
|
|
|
* children, so the list does not need to be freed.
|
|
|
|
|
*
|
|
|
|
|
* Returns: (transfer none) (element-type GdkSurface):
|
|
|
|
|
* a reference to the list of child surfaces in @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
|
|
|
|
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
|
|
|
|
{
|
2019-03-25 12:33:56 +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
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (GDK_SURFACE_DESTROYED (surface))
|
|
|
|
|
return 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
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
return surface->children;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-10-03 18:19:48 +00:00
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* gdk_surface_is_visible:
|
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
*
|
|
|
|
|
* Checks whether the surface has been mapped (with gdk_surface_show() or
|
|
|
|
|
* gdk_surface_show_unraised()).
|
|
|
|
|
*
|
|
|
|
|
* Returns: %TRUE if the surface is mapped
|
|
|
|
|
**/
|
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
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
return GDK_SURFACE_IS_MAPPED (surface);
|
1999-01-15 16:00:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-10-03 18:19:48 +00:00
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* gdk_surface_is_viewable:
|
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
*
|
|
|
|
|
* Check if the surface and all ancestors of the surface are
|
|
|
|
|
* mapped. (This is not necessarily "viewable" in the X sense, since
|
|
|
|
|
* we only check as far as we have GDK surface parents, not to the root
|
|
|
|
|
* surface.)
|
|
|
|
|
*
|
|
|
|
|
* Returns: %TRUE if the surface is viewable
|
|
|
|
|
**/
|
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
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
|
2003-06-09 01:55:01 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (surface->destroyed)
|
|
|
|
|
return FALSE;
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
return surface->viewable;
|
1999-01-15 16:00:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-02-27 20:40:15 +00:00
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* gdk_surface_get_state:
|
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
*
|
|
|
|
|
* Gets the bitwise OR of the currently active surface state flags,
|
|
|
|
|
* from the #GdkSurfaceState enumeration.
|
|
|
|
|
*
|
|
|
|
|
* Returns: surface state bitfield
|
|
|
|
|
**/
|
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
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +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,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GError **error)
|
2014-10-09 08:45:44 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GError *internal_error = NULL;
|
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
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (GDK_DISPLAY_DEBUG_CHECK (surface->display, GL_DISABLE))
|
|
|
|
|
{
|
|
|
|
|
g_set_error_literal (error, GDK_GL_ERROR,
|
|
|
|
|
GDK_GL_ERROR_NOT_AVAILABLE,
|
|
|
|
|
_("GL support disabled via GDK_DEBUG"));
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2014-10-16 01:13:45 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (surface->impl_surface->gl_paint_context == NULL)
|
|
|
|
|
{
|
|
|
|
|
GdkSurfaceImplClass *impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
|
2014-10-09 08:45:44 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +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;
|
|
|
|
|
}
|
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
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
surface->impl_surface->gl_paint_context =
|
|
|
|
|
impl_class->create_gl_context (surface->impl_surface,
|
|
|
|
|
TRUE,
|
|
|
|
|
NULL,
|
|
|
|
|
&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
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (internal_error != NULL)
|
|
|
|
|
{
|
|
|
|
|
g_propagate_error (error, internal_error);
|
|
|
|
|
g_clear_object (&(surface->impl_surface->gl_paint_context));
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gdk_gl_context_realize (surface->impl_surface->gl_paint_context, &internal_error);
|
|
|
|
|
if (internal_error != NULL)
|
|
|
|
|
{
|
|
|
|
|
g_propagate_error (error, internal_error);
|
|
|
|
|
g_clear_object (&(surface->impl_surface->gl_paint_context));
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return surface->impl_surface->gl_paint_context;
|
2014-10-09 08:45:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* gdk_surface_create_gl_context:
|
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
* @error: return location for an error
|
|
|
|
|
*
|
|
|
|
|
* Creates a new #GdkGLContext matching the
|
|
|
|
|
* framebuffer format to the visual of the #GdkSurface. The context
|
|
|
|
|
* is disconnected from any particular surface or surface.
|
|
|
|
|
*
|
|
|
|
|
* If the creation of the #GdkGLContext failed, @error will be set.
|
|
|
|
|
*
|
|
|
|
|
* Before using the returned #GdkGLContext, you will need to
|
|
|
|
|
* call gdk_gl_context_make_current() or gdk_gl_context_realize().
|
|
|
|
|
*
|
|
|
|
|
* Returns: (transfer full): the newly created #GdkGLContext, or
|
|
|
|
|
* %NULL on error
|
|
|
|
|
**/
|
2014-10-09 08:45:44 +00:00
|
|
|
|
GdkGLContext *
|
2018-04-11 22:16:43 +00:00
|
|
|
|
gdk_surface_create_gl_context (GdkSurface *surface,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GError **error)
|
2014-10-09 08:45:44 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkGLContext *paint_context;
|
2014-10-09 08:45:44 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
|
|
|
|
|
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
2014-10-09 08:45:44 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
paint_context = gdk_surface_get_paint_gl_context (surface, error);
|
|
|
|
|
if (paint_context == NULL)
|
|
|
|
|
return NULL;
|
2014-10-09 08:45:44 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
return GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->create_gl_context (surface->impl_surface,
|
|
|
|
|
FALSE,
|
|
|
|
|
paint_context,
|
|
|
|
|
error);
|
2018-04-11 22:16:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-04-12 14:48:31 +00:00
|
|
|
|
/**
|
2019-03-25 12:33:56 +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)
|
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkDisplay *display;
|
2018-04-12 14:48:31 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
|
2018-04-12 14:48:31 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
display = gdk_surface_get_display (surface);
|
2018-04-12 14:48:31 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
return g_object_new (GDK_DISPLAY_GET_CLASS (display)->cairo_context_type,
|
|
|
|
|
"surface", surface,
|
|
|
|
|
NULL);
|
2014-10-09 08:45:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-11-28 15:34:01 +00:00
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* gdk_surface_create_vulkan_context:
|
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
* @error: return location for an error
|
|
|
|
|
*
|
|
|
|
|
* Creates a new #GdkVulkanContext for rendering on @surface.
|
|
|
|
|
*
|
|
|
|
|
* If the creation of the #GdkVulkanContext failed, @error will be set.
|
|
|
|
|
*
|
|
|
|
|
* Returns: (transfer full): the newly created #GdkVulkanContext, or
|
|
|
|
|
* %NULL on error
|
|
|
|
|
**/
|
2016-11-28 15:34:01 +00:00
|
|
|
|
GdkVulkanContext *
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_create_vulkan_context (GdkSurface *surface,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GError **error)
|
2016-11-28 15:34:01 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkDisplay *display;
|
2016-11-28 15:34:01 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
|
|
|
|
|
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
2016-11-28 15:34:01 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (GDK_DISPLAY_DEBUG_CHECK (surface->display, VULKAN_DISABLE))
|
|
|
|
|
{
|
|
|
|
|
g_set_error_literal (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_NOT_AVAILABLE,
|
|
|
|
|
_("Vulkan support disabled via GDK_DEBUG"));
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2016-11-29 14:35:04 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
display = gdk_surface_get_display (surface);
|
2016-11-28 15:34:01 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +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;
|
|
|
|
|
}
|
2016-11-28 15:34:01 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
return g_initable_new (GDK_DISPLAY_GET_CLASS (display)->vk_context_type,
|
|
|
|
|
NULL,
|
|
|
|
|
error,
|
|
|
|
|
"surface", surface,
|
|
|
|
|
NULL);
|
2016-11-28 15:34:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-03-28 01:24:44 +00:00
|
|
|
|
/* Code for dirty-region queueing
|
2019-03-25 12:33:56 +00:00
|
|
|
|
*/
|
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,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkSurface *ancestor)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
while (surface)
|
|
|
|
|
{
|
|
|
|
|
GdkSurface *parent = surface->parent;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (parent == ancestor)
|
|
|
|
|
return TRUE;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
surface = parent;
|
|
|
|
|
}
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
return FALSE;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GSList *tmp;
|
|
|
|
|
GSList *prev = NULL;
|
|
|
|
|
gboolean has_ancestor_in_list = FALSE;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
/* Check whether "surface" is already in "update_surfaces" list.
|
|
|
|
|
* It could be added during execution of gtk_widget_destroy() when
|
|
|
|
|
* setting focus widget to NULL and redrawing old focus widget.
|
|
|
|
|
* See bug 711552.
|
|
|
|
|
*/
|
|
|
|
|
tmp = g_slist_find (update_surfaces, surface);
|
|
|
|
|
if (tmp != NULL)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
for (tmp = update_surfaces; tmp; tmp = tmp->next)
|
|
|
|
|
{
|
|
|
|
|
GdkSurface *parent = surface->parent;
|
2013-12-18 11:23:28 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +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
|
|
|
|
|
*/
|
|
|
|
|
if (!has_ancestor_in_list && gdk_surface_is_ancestor (surface, tmp->data))
|
|
|
|
|
has_ancestor_in_list = TRUE;
|
|
|
|
|
|
|
|
|
|
/* insert in reverse stacking order when adding around siblings,
|
|
|
|
|
* so processing updates properly paints over lower stacked surfaces
|
|
|
|
|
*/
|
|
|
|
|
if (parent == GDK_SURFACE (tmp->data)->parent)
|
|
|
|
|
{
|
|
|
|
|
if (parent != NULL)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
gint index = g_list_index (parent->children, surface);
|
|
|
|
|
for (; tmp && parent == GDK_SURFACE (tmp->data)->parent; tmp = tmp->next)
|
|
|
|
|
{
|
|
|
|
|
gint sibling_index = g_list_index (parent->children, tmp->data);
|
|
|
|
|
if (index > sibling_index)
|
|
|
|
|
break;
|
|
|
|
|
prev = tmp;
|
|
|
|
|
}
|
2008-07-18 13:03:42 +00:00
|
|
|
|
}
|
2019-03-25 12:33:56 +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
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
/* if "surface" has an ancestor in the list and tmp is one of
|
|
|
|
|
* "surface's" children, insert "surface" before tmp
|
|
|
|
|
*/
|
|
|
|
|
if (has_ancestor_in_list && gdk_surface_is_ancestor (tmp->data, surface))
|
|
|
|
|
{
|
|
|
|
|
tmp = g_slist_prepend (tmp, g_object_ref (surface));
|
|
|
|
|
|
|
|
|
|
if (prev)
|
|
|
|
|
prev->next = tmp;
|
|
|
|
|
else
|
|
|
|
|
update_surfaces = tmp;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 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)
|
|
|
|
|
{
|
|
|
|
|
tmp = g_slist_append (tmp, g_object_ref (surface));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
prev = tmp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* if all above checks failed ("surface" is from a different
|
|
|
|
|
* hierarchy than what is already in the list) or the list is
|
|
|
|
|
* empty, prepend
|
|
|
|
|
*/
|
|
|
|
|
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
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GSList *link;
|
2013-12-12 14:02:19 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
link = g_slist_find (update_surfaces, surface);
|
|
|
|
|
if (link != NULL)
|
|
|
|
|
{
|
|
|
|
|
update_surfaces = g_slist_delete_link (update_surfaces, link);
|
|
|
|
|
g_object_unref (surface);
|
|
|
|
|
}
|
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
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkSurface *toplevel;
|
2007-09-12 17:13:24 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
toplevel = gdk_surface_get_toplevel (surface);
|
2007-09-12 17:13:24 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
return toplevel->update_and_descendants_freeze_count > 0;
|
2007-09-12 17:13:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkFrameClock *frame_clock;
|
2013-01-30 20:09:44 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (surface &&
|
|
|
|
|
(surface->update_freeze_count ||
|
|
|
|
|
gdk_surface_is_toplevel_frozen (surface)))
|
|
|
|
|
return;
|
2004-08-26 14:09:08 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
/* If there's no frame clock (a foreign surface), then the invalid
|
|
|
|
|
* region will just stick around unless gdk_surface_process_updates()
|
|
|
|
|
* is called. */
|
|
|
|
|
frame_clock = gdk_surface_get_frame_clock (surface);
|
|
|
|
|
if (frame_clock)
|
|
|
|
|
gdk_frame_clock_request_phase (gdk_surface_get_frame_clock (surface),
|
|
|
|
|
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,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
cairo_region_t *expose_region)
|
2008-07-18 13:03:42 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
gboolean handled;
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (surface->destroyed)
|
|
|
|
|
return;
|
2014-06-23 20:12:45 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
/* Paint the surface before the children, clipped to the surface region */
|
|
|
|
|
g_signal_emit (surface, signals[RENDER], 0, expose_region, &handled);
|
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
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* expose events for the surface and all non-native descendants.
|
|
|
|
|
*/
|
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
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
/* Ensure the surface lives while updating it */
|
|
|
|
|
g_object_ref (surface);
|
2009-08-20 15:09:08 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
surface->in_update = TRUE;
|
2013-04-17 21:06:07 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
/* If an update got queued during update processing, we can get a
|
|
|
|
|
* surface in the update queue that has an empty update_area.
|
|
|
|
|
* just ignore it.
|
|
|
|
|
*/
|
|
|
|
|
if (surface->update_area)
|
|
|
|
|
{
|
|
|
|
|
g_assert (surface->active_update_area == NULL); /* No reentrancy */
|
2014-10-09 08:09:51 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
surface->active_update_area = surface->update_area;
|
|
|
|
|
surface->update_area = NULL;
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (gdk_surface_is_viewable (surface))
|
|
|
|
|
{
|
|
|
|
|
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
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
expose_region = cairo_region_copy (surface->active_update_area);
|
2014-10-09 08:09:51 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
gdk_surface_process_updates_recurse (surface, expose_region);
|
2014-06-21 22:03:56 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
cairo_region_destroy (expose_region);
|
|
|
|
|
}
|
2014-10-09 08:09:51 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
cairo_region_destroy (surface->active_update_area);
|
|
|
|
|
surface->active_update_area = NULL;
|
|
|
|
|
}
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
surface->in_update = FALSE;
|
2013-04-17 21:06:07 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +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,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
void *data)
|
2013-06-26 08:03:51 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkSurface *surface;
|
2013-06-26 08:03:51 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
surface = GDK_SURFACE (data);
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +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
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (GDK_SURFACE_DESTROYED (surface))
|
|
|
|
|
return;
|
2009-08-20 15:09:08 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_object_ref (surface);
|
2009-09-14 11:24:55 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (surface->update_area &&
|
|
|
|
|
!surface->update_freeze_count &&
|
|
|
|
|
!gdk_surface_is_toplevel_frozen (surface) &&
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
/* Don't recurse into process_updates_internal, we'll
|
|
|
|
|
* do the update later when idle instead. */
|
|
|
|
|
!surface->in_update)
|
|
|
|
|
{
|
|
|
|
|
gdk_surface_process_updates_internal (surface);
|
|
|
|
|
gdk_surface_remove_update_surface (surface);
|
|
|
|
|
}
|
2009-08-20 15:09:08 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_object_unref (surface);
|
2000-03-28 01:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-21 03:07:37 +00:00
|
|
|
|
/**
|
2019-03-25 12:33:56 +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.
|
|
|
|
|
**/
|
2018-03-21 03:07:37 +00:00
|
|
|
|
void
|
|
|
|
|
gdk_surface_invalidate_rect (GdkSurface *surface,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
const GdkRectangle *rect)
|
2000-03-28 01:24:44 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkRectangle surface_rect;
|
|
|
|
|
cairo_region_t *region;
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (GDK_SURFACE_DESTROYED (surface))
|
|
|
|
|
return;
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (surface->input_only || !surface->viewable)
|
|
|
|
|
return;
|
2000-07-31 17:18:36 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (!rect)
|
|
|
|
|
{
|
|
|
|
|
surface_rect.x = 0;
|
|
|
|
|
surface_rect.y = 0;
|
|
|
|
|
surface_rect.width = surface->width;
|
|
|
|
|
surface_rect.height = surface->height;
|
|
|
|
|
rect = &surface_rect;
|
|
|
|
|
}
|
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
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
region = cairo_region_create_rectangle (rect);
|
|
|
|
|
gdk_surface_invalidate_region (surface, region);
|
|
|
|
|
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,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
cairo_region_t *region)
|
2009-09-14 11:28:38 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (impl_surface->update_area)
|
|
|
|
|
cairo_region_union (impl_surface->update_area, region);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gdk_surface_add_update_surface (impl_surface);
|
|
|
|
|
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
|
|
|
|
/**
|
2019-03-25 12:33:56 +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.
|
|
|
|
|
**/
|
2018-03-28 14:42:26 +00:00
|
|
|
|
void
|
|
|
|
|
gdk_surface_queue_expose (GdkSurface *surface)
|
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
cairo_region_t *region;
|
2018-03-28 14:42:26 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2018-03-28 14:42:26 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
while (!gdk_surface_has_impl (surface))
|
|
|
|
|
surface = surface->parent;
|
2018-03-28 14:42:26 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
region = cairo_region_create ();
|
|
|
|
|
impl_surface_add_update_area (surface, region);
|
|
|
|
|
cairo_region_destroy (region);
|
2018-03-28 14:42:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-21 03:07:37 +00:00
|
|
|
|
/**
|
2019-03-25 12:33:56 +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.
|
|
|
|
|
**/
|
2018-03-21 03:07:37 +00:00
|
|
|
|
void
|
|
|
|
|
gdk_surface_invalidate_region (GdkSurface *surface,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
const cairo_region_t *region)
|
2000-03-28 01:24:44 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
cairo_region_t *visible_region;
|
|
|
|
|
cairo_rectangle_int_t r;
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (GDK_SURFACE_DESTROYED (surface))
|
|
|
|
|
return;
|
2009-05-27 15:08:09 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (surface->input_only ||
|
|
|
|
|
!surface->viewable ||
|
|
|
|
|
cairo_region_is_empty (region))
|
|
|
|
|
return;
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
r.x = 0;
|
|
|
|
|
r.y = 0;
|
2013-04-20 23:27:07 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
visible_region = cairo_region_copy (region);
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
while (surface != NULL &&
|
|
|
|
|
!cairo_region_is_empty (visible_region))
|
|
|
|
|
{
|
|
|
|
|
r.width = surface->width;
|
|
|
|
|
r.height = surface->height;
|
|
|
|
|
cairo_region_intersect_rectangle (visible_region, &r);
|
2009-05-27 15:08:09 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (gdk_surface_has_impl (surface))
|
|
|
|
|
{
|
|
|
|
|
impl_surface_add_update_area (surface, visible_region);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
cairo_region_translate (visible_region,
|
|
|
|
|
surface->x, surface->y);
|
|
|
|
|
surface = surface->parent;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cairo_region_destroy (visible_region);
|
2000-03-28 01:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-05-15 16:09:53 +00:00
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* _gdk_surface_clear_update_area:
|
|
|
|
|
* @surface: a #GdkSurface.
|
|
|
|
|
*
|
|
|
|
|
* 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
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2000-05-15 16:09:53 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (surface->update_area)
|
|
|
|
|
{
|
|
|
|
|
gdk_surface_remove_update_surface (surface);
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +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
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* gdk_surface_freeze_updates:
|
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
*
|
|
|
|
|
* Temporarily freezes a surface such that it won’t receive expose
|
|
|
|
|
* events. The surface will begin receiving expose events again when
|
|
|
|
|
* gdk_surface_thaw_updates() is called. If gdk_surface_freeze_updates()
|
|
|
|
|
* has been called more than once, gdk_surface_thaw_updates() must be called
|
|
|
|
|
* 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
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkSurface *impl_surface;
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
impl_surface = gdk_surface_get_impl_surface (surface);
|
|
|
|
|
impl_surface->update_freeze_count++;
|
2000-03-28 01:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-10-03 18:19:48 +00:00
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* gdk_surface_thaw_updates:
|
|
|
|
|
* @surface: a #GdkSurface
|
|
|
|
|
*
|
|
|
|
|
* Thaws a surface frozen with gdk_surface_freeze_updates().
|
|
|
|
|
**/
|
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
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkSurface *impl_surface;
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_SURFACE (surface));
|
2000-03-28 01:24:44 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
impl_surface = gdk_surface_get_impl_surface (surface);
|
2009-02-04 15:36:33 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
g_return_if_fail (impl_surface->update_freeze_count > 0);
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +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
|
|
|
|
{
|
2019-03-25 12:33:56 +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
|
|
|
|
|
2019-03-25 12:33:56 +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
|
|
|
|
{
|
2019-03-25 12:33:56 +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
|
|
|
|
|
2019-03-25 12:33:56 +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
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
gdk_surface_schedule_update (surface);
|
2007-09-12 17:13:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-03-29 21:17:45 +00:00
|
|
|
|
/**
|
2019-03-25 12:33:56 +00:00
|
|
|
|
* gdk_surface_constrain_size:
|
|
|
|
|
* @geometry: a #GdkGeometry structure
|
|
|
|
|
* @flags: a mask indicating what portions of @geometry are set
|
|
|
|
|
* @width: desired width of surface
|
|
|
|
|
* @height: desired height of the surface
|
|
|
|
|
* @new_width: (out): location to store resulting width
|
|
|
|
|
* @new_height: (out): location to store resulting height
|
|
|
|
|
*
|
|
|
|
|
* Constrains a desired width and height according to a
|
|
|
|
|
* set of geometry hints (such as minimum and maximum size).
|
|
|
|
|
*/
|
2001-03-29 21:17:45 +00:00
|
|
|
|
void
|
2018-03-20 10:40:08 +00:00
|
|
|
|
gdk_surface_constrain_size (GdkGeometry *geometry,
|
2019-03-25 12:33:56 +00:00
|
|
|
|
GdkSurfaceHints flags,
|
|
|
|
|
gint width,
|
|
|
|
|
gint height,
|
|
|
|
|
gint *new_width,
|
|
|
|
|
gint *new_height)
|
|
|
|
|
{
|
|
|
|
|
/* 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
|
|
|
|
|
2019-03-25 12:33:56 +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;
|
|
|
|
|
}
|
2001-03-29 21:17:45 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (flags & GDK_HINT_MAX_SIZE)
|
|
|
|
|
{
|
|
|
|
|
max_width = geometry->max_width ;
|
|
|
|
|
max_height = geometry->max_height;
|
|
|
|
|
}
|
2001-03-29 21:17:45 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
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
|
|
|
|
|
2019-03-25 12:33:56 +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
|
|
|
|
|
2019-03-25 12:33:56 +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:
|
|
|
|
|
*
|
|
|
|
|
* width
|
|
|
|
|
* min_aspect <= -------- <= max_aspect
|
|
|
|
|
* height
|
|
|
|
|
*/
|
2009-06-01 10:04:36 +00:00
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
if (flags & GDK_HINT_ASPECT &&
|
|
|
|
|
geometry->min_aspect > 0 &&
|
|
|
|
|
geometry->max_aspect > 0)
|
|
|
|
|
{
|
|
|
|
|
gint delta;
|
|
|
|
|
|
|
|
|
|
if (geometry->min_aspect * height > width)
|
|
|
|
|
{
|
|
|
|
|
delta = FLOOR (height - width / geometry->min_aspect, yinc);
|
|
|
|
|
if (height - delta >= min_height)
|
|
|
|
|
height -= delta;
|
|
|
|
|
else
|
2001-03-29 21:17:45 +00:00
|
|
|
|
{
|
2019-03-25 12:33:56 +00:00
|
|
|
|
delta = FLOOR (height * geometry->min_aspect - width, xinc);
|
|
|
|
|
if (width + delta <= max_width)
|
|
|
|
|
width += delta;
|
2001-03-29 21:17:45 +00:00
|
|
|
|
}
|
2019-03-25 12:33:56 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (geometry->max_aspect * height < width)
|
|
|
|
|
{
|
|
|
|
|
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
|
|
|
|
|
2019-03-25 12:33:56 +00:00
|
|
|
|
*new_width = width;
|
|
|
|
|
*new_height = height;
|
2001-03-29 21:17:45 +00:00
|
|
|
|
}
|
2001-07-05 13:41:34 +00:00
|
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
|
/**
|
2019-03-25 14:12:01 +00:00
|
|
|
|
* gdk_surface_get_device_position:
|
|
|
|
|
* @surface: a #GdkSurface.
|
|
|
|
|
* @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 in doubles and modifier state.
|
|
|
|
|
* The position is given in coordinates relative to the upper left
|
|
|
|
|
* corner of @surface.
|
|
|
|
|
*
|
|
|
|
|
* Returns: (nullable) (transfer none): The surface underneath @device
|
|
|
|
|
* (as with gdk_device_get_surface_at_position()), or %NULL if the
|
|
|
|
|
* surface is not known to GDK.
|
|
|
|
|
**/
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurface *
|
2019-03-25 14:12:01 +00:00
|
|
|
|
gdk_surface_get_device_position (GdkSurface *surface,
|
|
|
|
|
GdkDevice *device,
|
|
|
|
|
double *x,
|
|
|
|
|
double *y,
|
|
|
|
|
GdkModifierType *mask)
|
|
|
|
|
{
|
|
|
|
|
gdouble tmp_x, tmp_y;
|
|
|
|
|
GdkModifierType tmp_mask;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
|
|
|
|
|
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
|
|
|
|
|
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
|
|
|
|
|
|
|
|
|
|
tmp_x = tmp_y = 0;
|
|
|
|
|
tmp_mask = 0;
|
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->get_device_state (surface,
|
|
|
|
|
device,
|
|
|
|
|
&tmp_x, &tmp_y,
|
|
|
|
|
&tmp_mask);
|
|
|
|
|
|
|
|
|
|
if (x)
|
|
|
|
|
*x = tmp_x;
|
|
|
|
|
if (y)
|
|
|
|
|
*y = tmp_y;
|
|
|
|
|
if (mask)
|
|
|
|
|
*mask = tmp_mask;
|
2019-03-25 12:33:56 +00:00
|
|
|
|
|
2019-03-25 14:12:01 +00:00
|
|
|
|
return NULL;
|
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-06-25 22:47:40 +00:00
|
|
|
|
if (gdk_surface_is_toplevel (surface) ||
|
|
|
|
|
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]);
|
2018-07-15 18:23:54 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (surface), properties[PROP_MAPPED]);
|
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
|
|
|
|
|
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-07-15 19:36:19 +00:00
|
|
|
|
* If @surface is a toplevel, the window manager may choose to deny the
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* 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]);
|
2018-07-15 18:23:54 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (surface), properties[PROP_MAPPED]);
|
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
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
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-07-15 23:52:28 +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
|
|
|
|
}
|
2018-07-15 14:45:57 +00:00
|
|
|
|
}
|
2008-07-18 13:03:42 +00:00
|
|
|
|
|
2018-07-15 23:52:28 +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
|
2019-02-24 15:51:21 +00:00
|
|
|
|
* 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-06-25 22:47:40 +00:00
|
|
|
|
GdkPointerSurfaceInfo *pointer_info;
|
|
|
|
|
GdkDisplay *display;
|
|
|
|
|
|
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-06-25 22:47:40 +00:00
|
|
|
|
display = gdk_surface_get_display (surface);
|
|
|
|
|
pointer_info = _gdk_display_get_pointer_info (display, device);
|
2011-05-03 22:01:10 +00:00
|
|
|
|
|
2018-06-25 22:47:40 +00:00
|
|
|
|
if (_gdk_surface_event_parent_of (surface, pointer_info->surface_under_pointer))
|
|
|
|
|
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
|
|
|
|
*
|
2018-07-13 08:06:10 +00:00
|
|
|
|
* Use gdk_cursor_new_from_name() 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.
|
2018-07-13 08:06:10 +00:00
|
|
|
|
* Use gdk_cursor_new_fromm_name() 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-07-15 19:36:19 +00:00
|
|
|
|
* Determines whether or not the window 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:
|
2018-07-15 23:52:28 +00:00
|
|
|
|
case GDK_CONFIGURE:
|
2008-07-18 13:03:42 +00:00
|
|
|
|
case GDK_DELETE:
|
|
|
|
|
case GDK_DESTROY:
|
|
|
|
|
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-07-25 15:48:52 +00:00
|
|
|
|
* Sets keyboard focus to @surface. In most cases, gtk_window_present_with_time()
|
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
|
2019-02-24 15:51:21 +00:00
|
|
|
|
* user-readable strings in GDK and GTK). @title may not be %NULL.
|
2010-12-05 20:58:23 +00:00
|
|
|
|
**/
|
|
|
|
|
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_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
|
|
|
|
|
*
|
2019-02-24 15:51:21 +00:00
|
|
|
|
* When using GTK, typically you should use gtk_window_set_startup_id()
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* 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-07-15 19:36:19 +00:00
|
|
|
|
* Obtains the top-left corner of the window manager frame in root
|
2018-03-20 14:14:10 +00:00
|
|
|
|
* 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
|
2019-02-24 15:51:21 +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-07-25 15:48:52 +00:00
|
|
|
|
* you probably want to use gtk_window_present_with_time(), 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
|
2019-03-23 18:56:21 +00:00
|
|
|
|
* @x: surface X coordinate of mouse click that began the drag
|
|
|
|
|
* @y: surface Y coordinate of mouse click that began the drag
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* @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).
|
2019-03-23 18:56:21 +00:00
|
|
|
|
* You might use this function to implement a “window resize grip,”
|
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,
|
2019-03-23 18:56:21 +00:00
|
|
|
|
GdkDevice *device,
|
|
|
|
|
gint button,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y,
|
|
|
|
|
guint32 timestamp)
|
2011-11-05 05:10:16 +00:00
|
|
|
|
{
|
2019-03-23 18:56:21 +00:00
|
|
|
|
GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->begin_resize_drag (surface, edge, device, button, x, 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
|
2019-03-23 18:56:21 +00:00
|
|
|
|
* @x: surface X coordinate of mouse click that began the drag
|
|
|
|
|
* @y: surface Y coordinate of mouse click that began the drag
|
2011-11-05 05:10:16 +00:00
|
|
|
|
* @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,
|
2019-03-23 18:56:21 +00:00
|
|
|
|
gint button,
|
|
|
|
|
gint x,
|
|
|
|
|
gint 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,
|
2019-03-23 18:56:21 +00:00
|
|
|
|
device, button, x, 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
|
2019-03-23 18:56:21 +00:00
|
|
|
|
* @x: surface X coordinate of mouse click that began the drag
|
|
|
|
|
* @y: surface Y coordinate of mouse click that began the drag
|
2010-12-05 20:58:23 +00:00
|
|
|
|
* @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
|
|
|
|
*/
|
|
|
|
|
void
|
2018-03-20 14:14:10 +00:00
|
|
|
|
gdk_surface_begin_move_drag_for_device (GdkSurface *surface,
|
2019-03-23 18:56:21 +00:00
|
|
|
|
GdkDevice *device,
|
|
|
|
|
gint button,
|
|
|
|
|
gint x,
|
|
|
|
|
gint 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,
|
2019-03-23 18:56:21 +00:00
|
|
|
|
device, button, x, y, timestamp);
|
2011-11-05 05:10:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
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
|
2019-03-23 18:56:21 +00:00
|
|
|
|
* @x: surface X coordinate of mouse click that began the drag
|
|
|
|
|
* @y: surface Y coordinate of mouse click that began the drag
|
2011-11-05 05:10:16 +00:00
|
|
|
|
* @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,
|
2019-03-23 18:56:21 +00:00
|
|
|
|
gint x,
|
|
|
|
|
gint y,
|
2018-03-21 08:06:31 +00:00
|
|
|
|
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));
|
2019-03-23 18:56:21 +00:00
|
|
|
|
gdk_surface_begin_move_drag_for_device (surface, device, button, x, 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.
|
|
|
|
|
*
|
2018-06-29 17:34:14 +00:00
|
|
|
|
* Returns: (transfer full) (nullable): a newly created #GdkDrag or
|
2017-12-11 00:45:31 +00:00
|
|
|
|
* %NULL on error.
|
2015-12-07 18:47:45 +00:00
|
|
|
|
*/
|
2018-06-29 17:34:14 +00:00
|
|
|
|
GdkDrag *
|
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
|
|
|
|
*
|
2019-02-24 15:51:21 +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
|
|
|
|
|
*
|
2019-02-24 15:51:21 +00:00
|
|
|
|
* Newer GTK windows using client-side decorations use extra geometry
|
2013-12-13 03:38:12 +00:00
|
|
|
|
* 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
|
|
|
|
*
|
2019-02-24 15:51:21 +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-07-15 18:23:54 +00:00
|
|
|
|
gboolean was_mapped, mapped;
|
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-07-15 18:23:54 +00:00
|
|
|
|
was_mapped = GDK_SURFACE_IS_MAPPED (surface);
|
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
|
surface->state = new_state;
|
2017-12-15 03:35:27 +00:00
|
|
|
|
|
2018-07-15 18:23:54 +00:00
|
|
|
|
mapped = GDK_SURFACE_IS_MAPPED (surface);
|
|
|
|
|
|
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-07-15 18:23:54 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (surface), properties[PROP_STATE]);
|
2017-12-15 03:35:27 +00:00
|
|
|
|
break;
|
2018-03-20 10:40:08 +00:00
|
|
|
|
case GDK_SURFACE_CHILD:
|
2017-12-15 03:35:27 +00:00
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
2018-07-15 18:23:54 +00:00
|
|
|
|
|
|
|
|
|
if (was_mapped != mapped)
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (surface), properties[PROP_MAPPED]);
|
2017-12-15 03:35:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
2018-07-16 00:11:56 +00:00
|
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
|
gdk_surface_handle_event (GdkEvent *event)
|
|
|
|
|
{
|
2019-02-23 18:45:10 +00:00
|
|
|
|
gboolean handled = FALSE;
|
2018-07-16 00:11:56 +00:00
|
|
|
|
if (gdk_event_get_event_type (event) == GDK_CONFIGURE)
|
|
|
|
|
{
|
|
|
|
|
g_signal_emit (gdk_event_get_surface (event), signals[SIZE_CHANGED], 0,
|
|
|
|
|
event->configure.width, event->configure.height);
|
2019-02-23 18:45:10 +00:00
|
|
|
|
handled = TRUE;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
g_signal_emit (gdk_event_get_surface (event), signals[EVENT], 0, event, &handled);
|
2018-07-16 00:11:56 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-02-23 18:45:10 +00:00
|
|
|
|
return handled;
|
2018-07-16 00:11:56 +00:00
|
|
|
|
}
|