Commit Graph

164 Commits

Author SHA1 Message Date
Alexander Larsson
e8b38fedbd gdk: Convert mouse position to doubles, add new getters
We've long had double precision mouse coordinates on wayland (e.g.
when rotating a window) but with the new scaling we even have it on
X (and, its also in Xinput2), so convert all the internal mouse/device
position getters to use doubles and add new accessors for the
public APIs that take doubles instead of ints.
2013-07-03 14:39:25 +02:00
Alexander Larsson
04f83a56a2 gdk: add gdk_window_create_similar_image_surface
This lets us create image surfaces that render faster on specific windows.
It also supports creating scaled image surfaces.
2013-07-03 14:34:13 +02:00
Michael Natterer
8ad851f725 add gdk_screen_ and gdk_window_get_scale_factor()
These report the internal scaling factor, mapping from UI pixels
to hardware pixels.
2013-07-03 12:27:10 +02:00
Matthias Clasen
d824164e31 Add new symbols to docs
Also, minor formatting fixes.
2013-05-27 14:36:53 -04:00
Alexander Larsson
adffcf8af6 Add gdk_window_get_children_with_user_data
This function returns all the children that has a specific user_data set.
This is used a lot in the new GtkWidget drawing code and doing
it this way is faster than getting every child and calling get_user_data
on each (which was a non-neglible part of the profiles). Additionally it
also allows use to use some kind of hashtable to make this operation even
faster if needed in the future.
2013-05-07 16:40:17 +02:00
Alexander Larsson
e13fb1d3e0 Add gdk_window_set_invalidate_handler
This lets you register callbacks for when child widgets invalidate
areas of the window read it and/or change it.

For instance, this lets you do rendering effects and keeping offscreen
caches uptodate.
2013-05-07 16:34:04 +02:00
Matthias Clasen
ca81028901 Add GDK_AVAILABLE_IN_ALL annotations in gdk
This is in preparation to modernizing our handing
of exported symbols.
2013-05-05 15:38:46 -04:00
Owen W. Taylor
be22b9fbb9 GdkWindow: make the frame clock an inherent property of the window
Instead of making the frame clock a settable property of a window, make
toplevel windows inherently have a frame clock when created (getting
rid of the default frame clock.) We need to create or destroy frame
clocks when reparenting a window to be a toplevel, or to not be a
toplevel, but otherwise the frame clock for a window is immutable.
2013-02-14 17:19:52 -05:00
Owen W. Taylor
645b5f398d Reimplement _NET_WM_SYNC_REQUEST inside X11 backend
Deprecate gdk_window_enable_synchronized_configure() and
gdk_window_configure_done() and make them no-ops. Implement the
handling of _NET_WM_SYNC_REQUEST in terms of the frame cycle -
we know that all processing will be finished in the next frame
cycle after the ConfigureNotify is received.
2013-02-14 17:19:51 -05:00
Owen W. Taylor
77bac0d6ae Add GdkFrameClock
Add an object GdkFrameClock that we associate with a GdkWindow.
This tracks when the window needs to be repainted, and will also
be used for other operations in the future like relayout and
updating animations.

Based on a patch from Havoc Pennington:

 https://mail.gnome.org/archives/gtk-devel-list/2010-October/msg00004.html

https://bugzilla.gnome.org/show_bug.cgi?id=685460
2013-02-14 17:19:47 -05:00
Olivier Fourdan
54dc823d67 gdk: add gdk_window_set_fullscreen_mode()
and gdk_window_get_fullscreen_mode() API to allow
applications to specify if a fullscreen window should
span across all monitors in a multi-monitor setup or
remain on the current monitor where the window is
placed.

Fullscreen mode can be either GDK_FULLSCREEN_ON_ALL_MONITORS
or GDK_FULLSCREEN_ON_CURRENT_MONITOR.

https://bugzilla.gnome.org/show_bug.cgi?id=691856
2013-01-25 13:16:56 +01:00
Matthias Clasen
5adecf183b Move single-include guards inside include guards
gcc has optimizations for include guards that only work
if they are outermost in the the header.
https://bugzilla.gnome.org/show_bug.cgi?id=689810
2012-12-28 09:57:56 -05:00
Benjamin Otte
4cfd1f51c0 gdk: API: constify argument
gdk_window_set_background_rgba() should take a const RGBA.
2012-12-17 17:21:07 +01:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Matthias Clasen
d36c10bc03 gdk: Use versioned deprecations
This patch changes all uses of GDK_DEPRECATED(_FOR) in gdk headers
by the versioned variants, GDK_DEPRECATED_IN_3_x(_FOR). At the same
time, we add GDK_AVAILABLE_IN_3_x annotations for all API additions
in 3.2 and 3.4.
2012-02-27 07:11:43 -05:00
Javier Jardón
a3abc18858 Deprecate all the public API that is using GdkColor struct 2011-12-22 02:59:39 +00:00
Matthias Clasen
9cdeaaab30 Remove some accidental additions
These functions were never actually implemented
2011-12-15 23:03:12 -05:00
Matthias Clasen
8b60bc9d24 Cosmetic change 2011-12-15 23:03:12 -05:00
Matthias Clasen
ffb56ecc15 Fix nicks for the window class enum
As pointed out in bug 665999, these were just not right.
Before this commit, the nicks were 'output' and 'only'.
After this commit, they are 'input-output' and 'input-only'.
2011-12-13 21:15:14 -05:00
Alexander Larsson
9613e6ae19 testwindows: Test transparent backgrounds 2011-12-01 22:03:51 +01:00
Matthias Clasen
250d4331b2 Add device-taking variants of begin_resize/move_drag
This was one of the last places where display->core_pointer was
used in non-deprecated code paths.
2011-11-05 01:10:16 -04:00
Matthias Clasen
9e0efc5022 Add deprecation annotations for deprecated functions
We define our own GDK_DEPRECATED[_FOR] macros for this
and allow it to be turned off by defining the
GDK_DISABLE_DEPRECATION_WARNINGS macro.
2011-10-11 15:03:46 -04:00
Matthias Clasen
a35d8764da Add G_GNUC_DEPRECATED annotations in GDK 2011-10-09 09:55:08 -04:00
Benjamin Otte
44c02fcbb1 API: gdk: Change get_drag_window() API
The previous function gdk_drag_get_protocol_for_display() took native
window handles, so it had to be changed. Because it didn't do what it
was named to do (it didn't return a protocol even though it was named
get_protocol) and because it doesn't operate on the display anymore but
on the actual window, it's now called gdk_window_get_drag_protocol().
2011-02-01 18:51:57 +01:00
Benjamin Otte
36a15720b1 API: gdk: Remove gdk_set_pointer_hooks()
Its usecase was GERD - http://testbit.eu/~timj/historic/gerd/ - and that
project is long since dead.

It has been superseded in GTK 2.2 by GdkDisplayPointerHooks anyway.
2011-01-03 16:25:18 +01:00
Matthias Clasen
2d7583c0e3 Make gdk_window_{lookup,foreign_new}_for_display backend specific
At the same time, make GDK_IS_DISPLAY_X11 available in gdkx.h, and
add some exemplaric ifdefs to GTK+ code.
2010-12-21 12:06:59 -05:00
Matthias Clasen
a251d3786b Remove sm-client-id related functions from headers 2010-12-21 12:06:59 -05:00
Carlos Garnacho
44a7ef7bec Add gdk_window_[gs]et_source_events()
This function will enable events for all devices of a given
GdkInputSource, either these available at the time of the call,
or these that are connected in the future.
2010-12-15 03:17:59 +01:00
Benjamin Otte
8f8aeb7dfe gdk: Remove GdkWindowObject typedef
It's unused by now.
2010-12-06 18:57:11 +01:00
Benjamin Otte
645d0ac403 API: gdk: Remove depth argument from gdk_window_get_geometry()
We don't want to expose depth anymore. If you need it, query the visual.
2010-12-06 01:02:52 +01:00
Benjamin Otte
350fb1d55c API: gdk: Rename GdkWindowObjectClass to GdkWindowClass
Be consistent in the naming of objects.
2010-12-03 19:11:13 +01:00
Benjamin Otte
d916398dd2 API: Rename GdkWindowClass to GdkWindowWindowClass
We argued replacing GdkWindowClass with a input_only boolean, but this
is not doable in an API-stable way, so I decided against it.
2010-12-03 19:11:13 +01:00
Benjamin Otte
b9fc6a0c03 gdk: Remove remaining includes of gdkdrawable.h 2010-12-02 20:21:04 +01:00
Benjamin Otte
e4c27b0a59 API: GdkWindow no longer is a GdkDrawable
Also, name the get_type function properly.
2010-12-02 20:21:03 +01:00
Benjamin Otte
becaf660fc API: gdk_drawable_get_visible_region => gdk_window_get_visible_region
Also get rid of the GdkDrawable vfunc.
2010-12-02 20:17:28 +01:00
Benjamin Otte
6a3a89a621 API: gdk_drawable_get_clip_region() => gdk_window_get_clip_region()
Also remove the vfunc from GdkDrawableClass.
2010-12-02 20:17:28 +01:00
Carlos Garnacho
ce06043f17 GdkWindow: Add gdk_window_set_background_rgba()
This new function takes a GdkRGBA in order to set the background to
an alpha color. Keep in mind that RGBA visuals and a composited environment
are still necessary to have an alpha background displayed.
2010-10-22 20:14:56 +02:00
Michael Natterer
4ca2632d42 gdk: add slots for all GdkWindowObject signals
Also add padding for future extension.
2010-10-14 13:43:08 +02:00
Michael Natterer
9d9742f1e5 Bug 631599 - Allow to use arbitrary surfaces for offscreen windows
Add signal GdkWindow::create-surface which allows to use any
surface type as storage for offscreen windows.

Test the new signal in tests/gdkoffscreenbox.c
2010-10-14 13:25:23 +02:00
Matthias Clasen
32d1defc76 GDK docs: help gtk-doc understand gdk_window_invalidate_maybe_recurse 2010-10-01 09:10:52 -04:00
Benjamin Otte
6c971ac479 API: Remove window clear APIs
The feature can and should be implemented manually using
gdk_window_get_background() and Cairo drawing. A non-cairo drawing API
does not make sense in GDK anymore.
2010-09-26 15:11:43 +02:00
Benjamin Otte
af32c9c9be API: Add size getters for GdkWindow
gdk_window_get_width() and gdk_window_get_height() will replace
gdk_drawable_get_size().
2010-09-26 15:11:43 +02:00
Benjamin Otte
f08254074c API: Remove colormap member from GdkWindowAttr
Also remove all code that cares about differing colormaps for child
windows.
2010-09-26 15:11:33 +02:00
Benjamin Otte
7f486231ac API: Add gdk_window_get_display() 2010-09-26 15:11:33 +02:00
Benjamin Otte
5b9bbf9de2 API: Add gdk_window_get_visual() and gdk_window_get_screen()
Now that we store the visual in the GdkWindow, these are rather trivial
accessors.
2010-09-26 15:11:32 +02:00
Benjamin Otte
90b4b88629 API: Remove gdk_window_set_back_pixmap()
The same effect can be achieved with
gdk_window_set_background_pattern().
2010-09-26 15:11:30 +02:00
Benjamin Otte
332652f702 API: Change offscreen windows to use a cairo_surface_t
This requires changes to all the offscreen surface getters that used to
return a GdkPixmap before.
2010-09-26 15:11:29 +02:00
Benjamin Otte
b69fdbbd04 API: Remove gdk_window_get_internal_paint_info()
This function should not exist in public API, it exposes too many
internals.
2010-09-26 15:11:11 +02:00
Benjamin Otte
d7335837e0 gdk: Remove gdk_window_redirect_to_drawable()
Also remove the reverse gdk_window_remove_redirection().

The code was only used by the snapshotting code, and that code is dead
now.
2010-09-26 15:11:11 +02:00
Benjamin Otte
2c1633699f gdk: Rewrite background handling
Now the window background is a cairo_pattern_t. The backends will try to
set this as good as they can on the windowing system, but no guarantees
are made on wether the windowing system supports the pattern.

Also gets rid of GDK_NO_BG as undefined behavior is not a good idea to
support, and GDK_NO_BG effectively made the window's contents undefined.
It wasn't effectively used in GTK anyway.
2010-09-26 15:03:00 +02:00