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.
Includes fixing all callers to use the cairo region API instead. This is
usually just replacing the function names, the only difference is
gdk_region_get_rectangles() being replaced by
cairo_region_num_rectangles() and cairo_region_get_rectangle() which
required a bit more work.
https://bugzilla.gnome.org/show_bug.cgi?id=613284
Turns out pygtk build broke due to the argument addition to draw_drawable.
So, we now add a new vfunc for the new draw_drawable and are thus
backwards compat.
2006-08-29 Tor Lillqvist <tml@novell.com>
Remove support for Windows 9x/ME. GTK+ hasn't worked on Win9x
since 2.6 or 2.8. It's pointless to keep the Win9x code in here as
it isn't being maintained anyway. If somebody is interested, it
can always be found in older GTK+ versions, and in CVS.
* gdk/win32/gdkcursor-win32.c
* gdk/win32/gdkdnd-win32.c
* gdk/win32/gdkdrawable-win32.c
* gdk/win32/gdkgc-win32.c
* gdk/win32/gdkglobals-win32.c
* gdk/win32/gdkkeys-win32.c
* gdk/win32/gdkmain-win32.c
* gdk/win32/gdkproperty-win32.c
* gdk/win32/gdkselection-win32.c: Remove the G_WIN32_IS_NT_BASED()
and G_WIN32_HAVE_WIDECHAR_API() tests and their false (Win9x)
branches, and any variables or static functions used only by the
Win9x branches.
* gdk/win32/gdkprivate-win32.h: Remove backup definitions for
constants that aren't missing from current mingw and MSVC6
headers.
* gdk/win32/gdkmain-win32.c
* gdk/win32/gdkprivate-win32.h: Remove the _gdk_win32_gdi_failed()
function. On NT-based Windows GetLastError() returns error codes
also for failed GDI calls, so we can use _gdk_win32_api_failed()
always.
2006-06-09 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkdrawable-win32.c (_gdk_win32_drawable_release_dc):
Call ReleaseDC() on DCs acquired with GetDC() (for windows), and
DeleteDC() on DCs acquired with CreateCompatibleDC() (for
bitmaps). According to MSDN, this is the correct thing to do, even
if always using DeleteDC() seems to have worked fine in
practice. (#337491)
2006-03-11 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkdrawable-win32.c (draw_polygon): Use Polygon() for
outlined polygons, too. Same idea as in draw_rectangle(): Set pen
to NULL_PEN if drawing a filled polygon, set brush to HOLLOW_BRUSH
if drawing a polygon outline. (#332662)
(gdk_win32_draw_polygon): Corresponding simplification: no need to
add an extra final copy of the starting point.
2005-11-09 Tor Lillqvist <tml@novell.com>
* gdk/gdkinternals.h
* gdk/gdk.c (gdk_debug_keys[]): Add new GDK_DEBUG_DRAW flag to
the GdkDebugFlag enum.
* gdk/win32/gdkdrawable-win32.c: Use DRAW to trigger GDK_NOTEs in
this file instead of MISC. Now asking for MISC will give mainly
window manipulation debugging output.
2005-10-01 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkdrawable-win32.c (blit_from_pixmap): In case
BitBlt() fails with ERROR_INVALID_HANDLE, the most probable cause
is that the the desktop isn't visible because the session has been
switched, the screen is locked, or a terminal server session
disconnected, so no error message necessary. (#137796)
It is of course remotely possible that BitBlt() failing with
ERROR_INVALID_HANDLE might also be caused by some other
problem. We could strive for perfection and track whether the
desktop is visible by using WTSRegisterSessionNotification() and
handling WM_WTSESSION_CHANGE. I think that's overdoing it just for
this issue, though. If we would track desktop visibility, we
should then avoid even trying to update the display at all while
the desktop isn't visible.
2005-07-29 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkdrawable-win32.c (blit_inside_drawable): Rename
from blit_inside_window(), as it now does blitting inside a
bitmap, too. No code change, still just call BitBlt().
(_gdk_win32_blit): Check for source equalling destination
first. (#169508, #131977)
Do away with the superfluous local draw_impl variable, the
parameter to this function is already a GdkDrawableImplWin32*, no
need to copy and cast it.
2005-06-23 Tor Lillqvist <tml@novell.com>
Improve and simplify line segment rendering on Win32, especially
the implementation of GDK_CAP_NOT_LAST, and dashed lines. Fixes
bug #306396.
* gdk/win32/gdkprivate-win32.h (GdkGCWin32): Save the GdkGC's
line_style, cap_style and join_style as such in the
GdkGCWin32. Don't need to keep the pen_double_dash flag, we can
check the line_style.
* gdk/win32/gdkgc-win32.c (fixup_pen): New internal function. Sets
up the GDI pen type, style, end cap and join attributes to use
based on the pen width, GDK line style, end cap style, and join
style.
For a narrow (zero-width) GDK pen with the GDK_CAP_NOT_LAST end
cap style, which typically are used for XOR drawing where it is
essential that the last pixel is not drawn, use a GDI cosmetic
pen. Only for a cosmetic pen does GDI not draw the last pixel. I
deduced this by experimetation, the documentation is rather vague.
For other GDK pens use a geometric GDI pen. If the width is 0 or 1
and the GDK end cap style is GDK_CAP_BUTT, and the line style is
GDK_LINE_SOLID, use PS_ENDCAP_ROUND. This ensures that also
single-pixel length lines are drawn. (For sngle-pixel width lines
roundness as such is of course irrelevant.) For dashed lines, use
PS_ENDCAP_FLAT.
For wide lines use PS_ENDCAP_FLAT, _ROUND or _SQUARE,
respectively, for GDK_CAP_BUTT, GDK_CAP_ROUND and GDK_CAP_PROJECTING.
For one pixel on-off dashed lines, use PS_ALTERNATE, it seems to
work better than PS_USERSTYLE. For other dashed lines, use
PS_USERSTYLE and the dashes as set by the user (or the default
four-pixel on-off style).
(gdk_win32_gc_values_to_win32values, gdk_win32_gc_set_dashes):
Call fixup_pen() to do the pen settings after modifying some of
the GDK GC attributes that affect pens.
* gdk/win32/gdkdrawable-win32.c (render_line_horizontal,
render_line_vertical, draw_segments): Check GdkGCWin32::line_style
instead of the the removed pen_double_dash member. Don't use
PATCOPY unconditionally in the PatBlt() call, use a raster ope
code that depends on the GC function in use.
(draw_rectangle, draw_segments, draw_lines): Be more careful in
deciding when to do the manual dash rendering.
(draw_segments): Don't do any manual "last point" drawing at
all. The above changes takes care of narrow line segments being
drawn correctly in most cases, at least on NT-based Windows.
2005-05-26 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkdrawable-win32.c (_gdk_win32_blit): If blitting
from the root window, take the multi-monitor offset into
account. (#305511)
2005-04-28 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Add a draw-border style property to allow
themes to draw outside the widget's allocation.
* gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs
that were working around the clip-leakage bug in Cairo.
* gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than
save/fill/restore.
* gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context()
That updates a Cairo context to match a GC.
* gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support
for tiles/stipples/clipping to gdk_draw_glyphs(),
gdk_draw_trapezoids().
* gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal
implementation of stipples. Use one cairo_t across the entire
drawing operation. Replace cairo_matrix_create() with
stack-allocated matrices.
* gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c
gdk/win32/gdkgc-win32.c: Save various aspects of the
GC state (fill, tile, stipple, foreground, background, clip region)
in instance-private-data for future use. Add getters.
Get rid of _gdk_windowing_gc_get_foreground() function implemented
by the backends.
* gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c
gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add
_gdk_gc_init() to do initial setup of the GC from values;
fixes some problems from drawable redirection.
* gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c
gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move
gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into
the generic code, add _gdk_windowing_gc_copy(),
_gdk_windowing_gc_set_clip_region() to do backend specific
stuff.
* gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c}
gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c}
gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}:
Don't duplicate state that now is stored by the generic code.
* gdk/gdk.symbols Update