Commit Graph

3783 Commits

Author SHA1 Message Date
Alexander Larsson
ae146a2817 Convert a bunch of visual related calls to use the screen vtable 2010-12-21 12:06:55 -05:00
Alexander Larsson
f52223f380 Convert all GdkScreen methods to vtable calls 2010-12-21 12:06:54 -05:00
Alexander Larsson
84c03b14e8 Move GdkScreenClass to internal header 2010-12-21 12:06:54 -05:00
Alexander Larsson
8c6162b50c Convert all gdk_keymap methods to vtable calls 2010-12-21 12:06:54 -05:00
Alexander Larsson
4ad948ec4a Move GdkKeymapClass definition to internal header
This lets us change this without affecting apps.
2010-12-21 12:06:54 -05:00
Alexander Larsson
5fda1669ea Make display method vtable calls 2010-12-21 12:06:54 -05:00
Alexander Larsson
f1c32f109d Hide GdkDisplayClass from public header
There is no need for apps to access this class, as its only implemented
in the gdk backends, and we want to be free to change it later.
2010-12-21 12:06:54 -05:00
Alexander Larsson
ac7d55c948 Convert all gdk_window methods to vtable calls 2010-12-21 12:06:54 -05:00
Michael Natterer
13f18567e9 gdk: return 0, not NULL from gdk_device_get_n_axes() 2010-12-21 15:16:35 +01:00
Carlos Garnacho
17e97467df Strengthen checks in functions taking a GdkDevice
Docs have also been improved, to make explicit the device
type/source accepted.
2010-12-20 23:08:10 +01:00
Matthias Clasen
eb11430228 Fix gdk symbols after recent changes 2010-12-18 17:39:42 -05:00
Colin Walters
d08ff485f2 gdkwindow: Fix event unref iteration
We were double looping previously which caused a NULL deref.
2010-12-17 15:41:15 -05:00
Colin Walters
806c04411d gdk: Fix GdkWindowFilter internal refcounting
Running gnome-shell under valgrind, I saw the attached invalid write.
Basically we can destroy a window during event processing, and the old
window_remove_filters simply called g_free() on the filter, ignoring
the refcount.  Then later in event processing we call filter->refcount--,
which is writing to free()d memory.

Fix this by centralizing list mutation and refcount handling inside
a new shared _gdk_window_filter_unref() function, and using that
everywhere.

==13876== Invalid write of size 4
==13876==    at 0x446B181: gdk_event_apply_filters (gdkeventsource.c:86)
==13876==    by 0x446B411: _gdk_events_queue (gdkeventsource.c:188)
==13876==    by 0x44437EF: gdk_display_get_event (gdkdisplay.c:410)
==13876==    by 0x446B009: gdk_event_source_dispatch (gdkeventsource.c:317)
==13876==    by 0x4AB7159: g_main_context_dispatch (gmain.c:2436)
==13876==    by 0x4AB7957: g_main_context_iterate.clone.5 (gmain.c:3087)
==13876==    by 0x4AB806A: g_main_loop_run (gmain.c:3295)
==13876==    by 0x8084D6B: main (main.c:722)
==13876==  Address 0x1658bcac is 12 bytes inside a block of size 16 free'd
==13876==    at 0x4005EAD: free (vg_replace_malloc.c:366)
==13876==    by 0x4ABE515: g_free (gmem.c:263)
==13876==    by 0x444BCC9: window_remove_filters (gdkwindow.c:1873)
==13876==    by 0x4454BA3: _gdk_window_destroy_hierarchy (gdkwindow.c:2043)
==13876==    by 0x447BF6E: gdk_window_destroy_notify (gdkwindow-x11.c:1115)
==13876==    by 0x43588E2: _gtk_socket_windowing_filter_func (gtksocket-x11.c:518)
==13876==    by 0x446B170: gdk_event_apply_filters (gdkeventsource.c:79)
==13876==    by 0x446B411: _gdk_events_queue (gdkeventsource.c:188)
==13876==    by 0x44437EF: gdk_display_get_event (gdkdisplay.c:410)
==13876==    by 0x446B009: gdk_event_source_dispatch (gdkeventsource.c:317)
==13876==    by 0x4AB7159: g_main_context_dispatch (gmain.c:2436)
==13876==    by 0x4AB7957: g_main_context_iterate.clone.5 (gmain.c:3087)

https://bugzilla.gnome.org/show_bug.cgi?id=637464
2010-12-17 12:07:37 -05:00
Carlos Garnacho
2c8c1c6df4 Remove *_set_extension_events() and old API to query devices.
The old functions to get core pointer and devices list are gone as
well. This slice is entirely replaced internally by multidevice
handling and may just go.
2010-12-17 16:25:14 +01:00
Carlos Garnacho
ec82d133b1 Remove debug messages from GdkDevice 2010-12-15 15:48:43 +01:00
Benjamin Otte
88767b0af7 gdk: Don't use NULL for integers 2010-12-15 14:51:25 +01:00
Florian Müllner
ce5dae6702 Complete renaming of gdk_enable_multidevice()
The function was renamed in commit c4a5c2ed4, but some places were
missed, most notably the public header.
2010-12-15 13:05:11 +01:00
Matthias Clasen
208d717fef Optimize gdk_window_set_shape_combine_region
When setting no shape on an unshaped window, nothing changes,
so return early instead of recomputing lots of visibility
information.

Pointed out by Owen Taylor in bug 637156.
2010-12-14 22:21:39 -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
Carlos Garnacho
be7de347bf xi2: Improve device hierarchy handling
The xi2 device manager now handles slaves being detached and/or
attached to a master.

gdk_device_list_slaves() has been added so it is possible to
know how slaves relate with masters. The other backends (X11 and not)
don't neeed to to anything special here since their hierarchy is
fully flat.
2010-12-15 03:17:59 +01:00
Carlos Garnacho
9f41101ccc Emit GdkDevice::changed when the slave device being used changes
When the slave device changes, the master takes the shape of the
new one, modifying its axes, this signal is more useful to catch
this situation than the n-axes property
2010-12-15 03:17:58 +01:00
Carlos Garnacho
f5a20ab65a Add gdk_event_[gs]et_source_device().
This function may be used to know the hardware device that triggered
an event, it could resort to the master device in the few cases there's
not a direct hardware device to relate to the event (i.e.: crossing events
due to grabs)
2010-12-15 03:17:58 +01:00
Carlos Garnacho
c4a5c2ed4b Enable XI2 by default
gdk_enable_multidevice() has been replaced with gdk_disable_multidevice(),
so applications may call that function if they want to go back at the
previous behavior.

There would be usually little reasons to call that function, unless the
application is doing X calls itself that count on old fashioned core
devices.
2010-12-15 03:17:58 +01:00
Matthias Clasen
3b90d877b7 Remove unused header 2010-12-10 23:39:10 -05:00
Matthias Clasen
fe5e0e4502 Add some forgotten accessors for GdkDragContext
These fields are accessed in gtk.
2010-12-10 00:58:33 -05:00
Matthias Clasen
05abea6c4f Add missing include
See bug 636732
2010-12-08 11:49:48 -05:00
Robert Ancell
6188ea608f Add missing X11/Xlib.h include required for X11/extensions/sync.h 2010-12-08 18:44:20 +11:00
Milan Bouchet-Valat
13209a9a6c More annotations for GdkDisplay
Mostly (out), and a few (allow-none) for parameters.
2010-12-07 19:12:57 +01:00
Benjamin Otte
9b042e39ec gdk: Add section docs for GdkRGBA 2010-12-06 18:57:11 +01:00
Benjamin Otte
8f8aeb7dfe gdk: Remove GdkWindowObject typedef
It's unused by now.
2010-12-06 18:57:11 +01:00
Colin Walters
65e3c09139 introspection: Fix (out) for gdk_screen_get_monitor_geometry
Scanner doesn't detect this case correctly because it's a typedef;
work around it here by explicitly specifying that it's caller
allocates.  See bug 636393 for the scanner issue.
2010-12-06 11:42:47 -05:00
Kristian Rietveld
fd6e57687d Port Quartz backend to latest rendering-cleanup changes 2010-12-06 14:15:47 +01:00
Benjamin Otte
e4c9d1a321 gdk: Constify argument to gdk_rgba_copy() 2010-12-06 01:02:52 +01:00
Benjamin Otte
d55073fde6 gdk: Remove depth argument from GdkWindowImpl->get_geometry() 2010-12-06 01:02:52 +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
84fd9b166c gdk: Remove nonexisting function from internal header 2010-12-06 01:02:19 +01:00
Matthias Clasen
5fdc140dd8 Fix a segfault in gdk_window_beep
Not a good idea to cast an instance to a class...
2010-12-04 17:25:40 -05:00
Matthias Clasen
afcd50d607 Try again to fix the gdk symbol list
Grr, gdk_window_class_class_get_type should have been
gdk_window_window_class_get_type.
2010-12-04 16:32:02 -05:00
Paolo Borelli
cd76b057e9 Annotate gdk_window_get_geometry, get_position and get_origin 2010-12-04 15:47:50 +01:00
Benjamin Berg
e8c103f652 Use cairo gobject support instead of a new boxed type. 2010-12-04 15:38:20 +01:00
Carlos Garnacho
02a30118c6 Add a boxed type for cairo_pattern_t. 2010-12-04 15:38:11 +01:00
Matthias Clasen
12e5e24c3e Another attempt to fix the gdk symbol list 2010-12-03 23:50:58 -05: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
Matthias Clasen
a996a309c7 One more forgotten symbol 2010-12-03 13:05:23 -05:00
Matthias Clasen
5687d7f880 Update gdk symbol list 2010-12-03 13:04:42 -05:00
Matthias Clasen
17e2c5391c Fix up parameter mismatches in the docs
And other minor gdk doc fixes.
2010-12-03 09:07:06 -05:00
Matthias Clasen
4ef86fc500 Add annotation to gdk_screen_get_monitor_geometry
Pointed out by William Jon McCann.
2010-12-03 08:21:48 -05:00
Matthias Clasen
f5c27476a5 Don't require a display for the color test
Its not really needed, and the build bot doesn't have X...
2010-12-02 16:00:15 -05:00
Benjamin Otte
fdb242ac6a gdk: Clean up Cairo code
Remove a bunch of code that is not required.
2010-12-02 20:21:05 +01:00
Benjamin Otte
f9a9567731 gdk: Replace direct calls of _gdk_event_func with _gdk_event_emit()
For now that function just calls the event func.
2010-12-02 20:21:05 +01:00
Benjamin Otte
b3e8504111 x11: Don't include gdkprivate.h in gdkx.h
It's private, mkay?
And include it directly where we need it anyway.
2010-12-02 20:21:05 +01:00
Benjamin Otte
8c6831ab5e gdk: Remove useless macros from gdkprivate.h 2010-12-02 20:21:05 +01:00
Benjamin Otte
585c489577 gdk: Remove GDK_PANGO_UNITS_OVERFLOWS() from internal headers
It's unused.
2010-12-02 20:21:05 +01:00
Benjamin Otte
4d1604c77d gdk: Move window beeps into GdkWindowImpl
One less magic function. Also refactored it to make it easier to
implement. It now returns TRUE if it beeped and FALSE if it failed to do
so. A default implementation exists that just returns FALSE for all the
backends that can't beep windows (read: everything but X11 with XKB -
and why on earth do keyboard libs implement beeping?)
2010-12-02 20:21:05 +01:00
Benjamin Otte
1269f8424f gdk: Make get_shape and get_input_shape vfuncs
Trying to get rid of all the _gdk_windowing_something() functions that
we expect backends to magically know about and instead put them in a
proper interface (mostly GdkWindowImplClass).
2010-12-02 20:21:04 +01:00
Benjamin Otte
218eea4378 gdk: Remove GdkDrawable
It's unused.
2010-12-02 20:21:04 +01:00
Benjamin Otte
b9fc6a0c03 gdk: Remove remaining includes of gdkdrawable.h 2010-12-02 20:21:04 +01:00
Benjamin Otte
4bfa4e0d86 gdk: Make GdkWindowImpl inherit from GObject 2010-12-02 20:21:04 +01:00
Benjamin Otte
3494f87a10 API: Remove GdkNoExposeEvent
It's not used by anyone and not supported by any backend but X11.
2010-12-02 20:21:04 +01:00
Benjamin Otte
98838df2db gdk: Make GdkWindow->impl a GdkWindowImpl 2010-12-02 20:21:04 +01:00
Benjamin Otte
17a0a467a1 gdk: Pass the GdkWindow to resize_cairo_surface vfunc
So it's in sync with all the other vfuncs.
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
1ad7c5f8c5 x11: Remove unused GDK_DRAWABLE_XROOTWIN macro 2010-12-02 20:21:03 +01:00
Benjamin Otte
2408936bb5 x11: Remove duplicate definition of GDK_WINDOW_XID
Now, where did that come from?
2010-12-02 20:21:03 +01:00
Benjamin Otte
d1700d6e3c gdk: Move ref_cairo_surface from GdkDrawable to GdkWindowImpl
Also make it take the actual GdkWindow, not the implementation, like all
the other vfuncs do.
2010-12-02 20:21:03 +01:00
Benjamin Otte
62d004cf8f gdk: Remove _gdk_drawable_ref_cairo_surface()
Instead, call the vfunc directly from gdkWindow.c
2010-12-02 20:21:03 +01:00
Benjamin Otte
9d2abf81d2 x11: Remove outdated variable definition 2010-12-02 20:21:03 +01:00
Benjamin Otte
1215f70e23 gdk: Remove GdkDrawable->create_cairo_surface vfunc
It's unused.
2010-12-02 20:21:03 +01:00
Benjamin Otte
370d272b13 gdk: Remove _gdk_window_impl_get_type() function
It was only used in the backends, and they can use the correct type
directly.
2010-12-02 20:21:03 +01:00
Benjamin Otte
ac4609ecc9 x11: Fix in_rectangle computation
A point is not in a rectangle when it's at the x + width coordinate.
2010-12-02 20:21:03 +01:00
Benjamin Otte
1bb6f48bb3 gdk: Rename GdkWindowObject to GdkWindow
... and remove most of the casting that used to be necessary.
2010-12-02 20:21:03 +01:00
Benjamin Otte
7acb64f983 gdk: Make GdkWindowImpl a class, not an interface
It's a subclass of GdkDrawable and the baseclass for GdkWindowImplX11
etc now.
2010-12-02 20:21:02 +01:00
Benjamin Otte
b3bca70d5b gdk: Remove unused medialib code 2010-12-02 20:21:02 +01:00
Benjamin Otte
b1f6df8085 API: Remove gdkdrawable.h from public headers
It continues to exist as a private header.
2010-12-02 20:21:02 +01:00
Benjamin Otte
cf6ce6e671 API: Decouple GdkWindow from GdkDrawable
Make GdkWindow no longer typedeffed to GdkDrawable, but instead make it
be its own (private) type.
2010-12-02 20:21:02 +01:00
Benjamin Otte
81605623e2 gdk: Use GdkDrawable for impl pointers
... instead of GdkWindow
2010-12-02 20:21:02 +01:00
Benjamin Otte
62622a94ae gdk: Pass Drawable as argument
We're not passing a GdKWindow here, but the implementation.
2010-12-02 20:21:02 +01:00
Benjamin Otte
072498ae87 gdk: Make _gdk_window_ref_cairo_surface() protected and use it
... instead of _gdk_drawable_ref_cairo_surface() where appropriate.
Also, don't implement the drawable->create_cairo_surface vfunc anymore.

This is in preparation for the split of GdkWindow from GdkDrawable.
2010-12-02 20:21:02 +01:00
Benjamin Otte
e724054d19 API: Remove GDK_WINDOW_XWINDOW() macro
Use GDK_WINDOW_XID() instead.

THis was done using sed, so there might be issues resulting to that.
Feel free to fix.
2010-12-02 20:20:56 +01:00
Benjamin Otte
18a6976e5a API: gdk: Don't track outstanding surfaces
You are not allowed to track surfaces from GDK or draw outside of expose
events. So we can remove ugly hacks needed previously. See
https://bugzilla.gnome.org/show_bug.cgi?id=606009 for the introduction
of this workaround.
2010-12-02 20:17:28 +01:00
Benjamin Otte
fe6f76a5a2 x11: Make wrapper member a GdkDrawable
This is in preparation for getting rid of GdkDrawable as a dependency of
GdkWindow.
2010-12-02 20:17:28 +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
Benjamin Otte
97e6e9d212 API: Make gdk_cairo_create() take a GdkWindow
This is not strictly an API change as GdkDrawable is typedeffed to
GdkWindow, but it changes the header, so I'm marking it as such.
gdk_cairo_create() can only be used with windows these days, so it makes
sense to pass a window. With that, we can alseo remove the
set_cairo_clip() vfunc from GdkDrawable and implement it inside
gdkwindow.c.
2010-12-02 20:17:28 +01:00
Benjamin Otte
65dde2f92f API: Remove gdk_cairo_reset_clip()
You should not ever ever ever call cairo_reset_clip(). If you do, your
code is broken and you deserve everything you get.
And we should definitely not support this insanity.
2010-12-02 20:17:28 +01:00
Benjamin Otte
d154344a43 win32: Remove some unused defines 2010-12-02 20:17:28 +01:00
Benjamin Otte
88399c041c x11: Remove GdkDrawableImplX11
It's not use anymore, the whole functionality has been moved to
GdkWindowImplX11.
2010-12-02 20:17:27 +01:00
Benjamin Otte
3e6a4af6d3 x11: _gdk_x11_drawable_update_size() => _gdk_x11_window_update_size() 2010-12-02 20:17:27 +01:00
Benjamin Otte
bb79506665 x11: Move cairo_surface and wrapper members to GdkWindowImplX11 struct 2010-12-02 20:17:27 +01:00
Benjamin Otte
1c7f58fdb6 x11: Move xid member from GdkDrawableImplX11 to GdkWindowImplX11 2010-12-02 20:17:27 +01:00
Benjamin Otte
a3c5005eef x11: Use GDK_WINDOW_XID() instead of writing it out 2010-12-02 20:17:27 +01:00
Benjamin Otte
094b0eeb98 x11: Remove screen member from GdkDrawableImplX11 2010-12-02 20:17:27 +01:00
Benjamin Otte
5f12730599 x11: Get display from window, not from impl-drawable's screen 2010-12-02 20:17:27 +01:00
Benjamin Otte
cfa67127a1 x11: Get display from window, not from impl-drawable's screen 2010-12-02 20:17:27 +01:00
Benjamin Otte
dc7d8dae67 x11: Change GDK_WINDOW_SCREEN macro
on't look at GdkDrawableImplX11->screen, but call
gdk_window_get_screen() instead.
2010-12-02 20:17:27 +01:00
Benjamin Otte
5139eecc75 API: x11: Remove GDK_DRAWABLE_XID and GDK_DRAWABLE_XDISPLAY
Window equivalents exist and drawables are on their way out.
2010-12-02 20:17:27 +01:00
Benjamin Otte
3b8aea389d x11: Use window macros instead of drawable macros
GDK_WINDOW_XID() instead of GDK_DRAWABLE_XID()
GDK_WINDOW_XDISPLAY() instead of GDK_DRAWABLE_XDISPLAY()
2010-12-02 20:17:27 +01:00
Benjamin Otte
91679c384a API: Remove gdk_x11_drawable_get_xdisplay()
No need for the function. Macros exist to do the same thing.
2010-12-02 20:17:27 +01:00
Benjamin Otte
0841281b55 x11: Use window macros in test code 2010-12-02 20:17:27 +01:00