Commit Graph

152 Commits

Author SHA1 Message Date
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
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
98838df2db gdk: Make GdkWindow->impl a GdkWindowImpl 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
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
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
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
b3bca70d5b gdk: Remove unused medialib code 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
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
William Jon McCann
323df2b280 Make gdk_event_apply_filters safe against changes in filter list
An event filter may add or remove filters itself.  This patch does
two things to address this case.  The first is to take a temporary
reference to the filter while it is being used.  The second is
to wait until after the filter function is run before determining
the next node in the list to process.  This guards against
changes to the next node.  It also does not run functions
that have been marked as removed.  Though I'm not sure if this
case can arise.

https://bugzilla.gnome.org/show_bug.cgi?id=635380
2010-11-22 13:16:24 -05: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
Kristian Rietveld
eca2af5230 Make set_cairo_surface_size a vfunc on GdkWindowImpl
Note the special implementation of this method on GdkOffscreenWindow
that makes sure its current surface is not destroyed.
2010-10-05 15:38:23 +02:00
Michael Natterer
06773b1e8b gdk: remove "screen" member from GdkOffscreenWindow, it has become obsolete
Also remove screen parameter from _gdk_offscreen_window_new() and get
rid of a bunch on includes in gdkoffscreenwindow.c
2010-09-28 16:05:38 +02:00
Benjamin Otte
94f809d439 gdk: Remove nonexisting function from internal header 2010-09-26 15:11:34 +02:00
Benjamin Otte
eee6c002d1 gdk: store the visual in the GdkWindowObject 2010-09-26 15:11:32 +02:00
Benjamin Otte
6a2124d566 gdk: Remove _gdk_drawable_get_source_drawable()
Now that we don't create pixmaps anymore, this function is not needed
anymore. The indirection it did previously is now basically moved to
gdk_window_create_similar_surface()
2010-09-26 15:11:31 +02:00
Benjamin Otte
522becccc0 gdk: Remove pixmap debug category
It's not used anywhere anymore.
2010-09-26 15:11:30 +02:00
Benjamin Otte
f74f9b2766 gdk: Remove GdkPixmap
All iusers of it are gone, so it's now time to let go.
cairo_surface_t is a full replacement, combined with
gdk_window_create_similar_surface().
2010-09-26 15:11:30 +02:00
Benjamin Otte
2bedd205c5 gdk: Remove gdk_windowing_create_cairo_surface()
Instead, actually use the create_cairo_surface vfunc on the
implementation drawable. D'oh.
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
Benjamin Otte
bfa6ad6e7c gdk: Remove _gdk_windowing_get_shape_for_mask()
It's unused. And there's a replacement available with
gdk_cairo_region_create_from_surface()
2010-09-26 15:02:59 +02:00
Benjamin Otte
96b387599d API: Add gdk_cairo_region_create_from_surface()
The function converts the given surface into an alpha bitmap mask. This
is mostly useful for setting shape regions.

Also adds a new internal function _gdk_cairo_surface_extents() that
computes a surface's extents.
2010-09-26 15:02:59 +02:00
Havoc Pennington
b837ef5a6d Revamp and modernize X error traps
* add per-display gdk_x11_display_error_trap_push()
  (X11-specific because gdk_error_trap_push() probably
  should have been)
* make gdk_error_trap_push() handle only GDK displays
  not displays opened without a GDK wrapper
* make gdk_error_trap_pop() and gdk_x11_display_error_trap_pop()
  automatically sync only if needed, so manual gdk_flush() is not
  required
* add gdk_error_trap_pop_ignored() which just asynchronously
  ignores errors, so never needs to sync
* add G_GNUC_WARN_UNUSED_RESULT to plain pop(), because
  if you use plain pop() and don't need the return value,
  the async gdk_error_trap_pop_ignored() should be used
  instead. This results in lots of warnings to clean
  up in a later patch.

The main objective here was to avoid the need to sync just
to ignore an error. Now, syncing is automatic, and only
happens when we need to know the error code.

https://bugzilla.gnome.org/show_bug.cgi?id=629608
2010-09-18 18:19:27 -04:00
Tor Lillqvist
3dda0adf76 Drop GDK_DEBUG_GC and _IMAGE as GDK doesn't do that any more 2010-09-09 01:09:49 +03:00
Benjamin Otte
2944561ba3 API: Add gdk_window_get_background_pattern()
This is the suggested way for GTK3 to store a Window's background so it
makes sense to use the same function today already.
2010-08-16 19:48:46 +02:00
Kristian Rietveld
d819bc4814 Invalidate cairo surface if resizing is not supported for target
While X11 surfaces can be resized, this is not the case for Quartz
surfaces.  Instead of resizing we will invalidate the surface instead.
By giving _gdk_windowing_set_cairo_surface_size() a boolean return
value, we can signal back whether or not resizing was possible.  If not
possible, we invalidate the surface.
2010-08-10 21:02:31 +02:00
Benjamin Otte
c9d08d02e5 gdk: Remove data consructors for GdkPixmap
That is all of the gdk_pixmap/bitmap_create_from_* constructors.
2010-08-10 21:02:31 +02:00
Benjamin Otte
6a48a042c7 API: remove GdkGC
XXX: Some traces in the win32 code are left. I suppose they'd best be
replaced using Cairo.
2010-08-10 21:02:29 +02:00
Benjamin Otte
ef2d37cdaf API: remove begin/end_direct_draw functions
They're not needed without GdkGCs.

FIXME: This breaks the win32 XP theme. Someone gotta fix it.
2010-08-10 21:02:29 +02:00
Benjamin Otte
f7608c33ac gdk: Move scratch GC handling to X11
... and implement it directly instead of using GdkGC, as GdkGC is about
to be deleted, but we need this code.
2010-08-10 21:02:29 +02:00
Benjamin Otte
1ac8d80e34 API: remove GdkPangoRenderer
Also removes the pango attributes for stipple, emboss and emboss color
2010-08-10 21:02:29 +02:00
Benjamin Otte
3fc31e88b0 gdk: Remove _gdk_drawable_get_scratch_gc()
The function is unused now.
2010-08-10 21:02:28 +02:00
Benjamin Otte
14fe04ec89 API: remove GdkImage
It was unused and buggy.
2010-08-10 21:02:26 +02:00
Benjamin Otte
6f5084551a API: remove gdk_drawable_copy_to_image() 2010-08-10 21:02:26 +02:00
Benjamin Otte
548ebc29e5 debug: remove GdkRGB debuggability
GdkRGB is on its way out, so there's no need to have a debugging
category for it.
2010-08-10 21:02:26 +02:00
Javier Jardón
319d2bb4f1 [gdk] Remove GdkWindowObject public structure
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=622677
2010-07-01 02:26:34 +02:00
Benjamin Otte
300e6b84cd s/GdkRegion/cairo_region_t/ in all of gtk
https://bugzilla.gnome.org/show_bug.cgi?id=613284
2010-06-29 16:06:38 +02:00
Benjamin Otte
52200eee01 Remove _gdk_region_new_from_yxbanded_rects()
It was an internal function and we can use
cairo_region_create_rectangles() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=613284
2010-06-29 16:06:38 +02:00
Christian Dywan
655dcff096 Remove deprecated GdkFont
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=604196

Signed-off-by: Javier Jardón <jjardon@gnome.org>
2010-06-28 23:38:03 +02:00
Martin Schlemmer
4696e94138 win32: Fix the xp there to correctly clip when drawing
This makes the xp theme work again, and also enables it.
2010-06-11 20:20:07 +02:00
Matthias Clasen
bd4609b140 Merge the xi2-for-master branch 2010-05-25 18:38:44 -04:00
Alexander Larsson
841fa47715 Track direct window cairo access and avoid tricks when used
When a cairo surface is requested for direct window access (i.e. not
when double-buffering) we can't really track when the actual drawing happens
as cairo drawing is not virtualized. This means we can't properly flush
any outstanding window moves or implicit paints.

This actually causes problems with e.g. abiword (bug #606009) where they
draw without double-buffering. If you press down it scrolls the window
and then draws the caret, but the caret drawing does not flush the
outstanding move from the scroll, so the caret gets drawn on the wrong
screen.

We fix this by never allowing either implicit paints or outstanding window
moves on impl-windows where any windows related to it has an outstanding
direct cairo surface. Luckily this is not very common so in practice this
doesn't matter much.
2010-01-19 15:01:03 +01:00
Alexander Larsson
739121dee0 Remove unused grab_one_pointer_release_event var
We don't use this anymore, so just remove.
2009-09-28 15:26:19 +02:00
Alexander Larsson
5ebb32d1ff Extend _gdk_windowing_window_at_pointer to be able to get toplevels only
This has two advantages:
1) In many backends, this is faster as we can terminate the window
hierarchy traversal earlier
2) When used in gdkdisplay.c::get_current_toplevel() to get the
current toplevel that has the pointer we now correctly return
a toplevel with the pointer in it where the pointer is inside
some foreign subwindow of a toplevel window.

The second advantage fixes some bugs in client side event generation
when the pointer is inside such a foreign child window.
2009-09-28 15:21:54 +02:00
Alexander Larsson
0c7830aa42 Make public GDK_WINDOW_TYPE and GDK_WINDOW_DESTROYED use functions calls 2009-09-04 17:59:17 +02:00
Alexander Larsson
a10e90b799 Move _gdk_window_event_parent_of to gdkinternals.h
gdkprivate.h is in installed file and this function does not
need to be exported.
2009-09-04 17:59:17 +02:00