Commit Graph

86 Commits

Author SHA1 Message Date
Tor Lillqvist
55d7d50e13 Bug 132501 - Make utility window translate to tool window in win32
2008-10-04  Tor Lillqvist  <tml@novell.com>

	Bug 132501 - Make utility window translate to tool window in win32

	Implement the utility window type hint. Such windows are kept on
	top of other windows. Makes GIMP's toolbox and dock windows behave
	more like in GNOME under metacity. Apply the same logic also to
	windows marked with the dialog window type hint, and windows that
	are transient for some other window. I'll call such windows
	"transient-type" below.

	* gdk/win32/gdkevents-win32.c (doesnt_want_key): Drop unused
	variables.

	(ensure_stacking_on_unminimize)
	(ensure_stacking_on_window_pos_changing)
	(ensure_stacking_on_activate_app): New functions to implement the
	desired stacking order. Make sure that a window that is not
	transient-type stays below any transient-type windows of the
	application. When activating a non-transient-type window make sure
	it rises as high as possible.

	(gdk_event_translate): Call above functions on
	WM_WINDOWPOSCHANGING, WM_ACTIVATEAPP and on WM_SIZE when
	unminimizing. Improve debugging printout.

	* gdk/win32/gdkwindow-win32.c (get_effective_window_decorations):
	Handle utility windows like toolbar windows.

	(gdk_window_new_internal) (update_style_bits): Give utility
	windows the WS_EX_TOOLWINDOW extended style.

	(gdk_window_set_title): If debugging "misc" or "events", make the
	handle of top-level windows show up in their title bars. Very
	useful when looking at debugging output.

	(gdk_window_set_keep_above) (gdk_window_set_keep_below)
	(gdk_window_set_modal_hint) (gdk_window_set_skip_taskbar_hint)
	(gdk_window_set_skip_pager_hint): Add and improve debugging
	printout.

	(gdk_window_set_type_hint): Print hint symbolically in GDK_NOTE().

2008-10-04  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkmain-win32.c (_gdk_win32_window_exstyle_to_string)
	(_gdk_win32_window_pos_bits_to_string): New debugging printout
	functions. Decode the WS_EX_* and SWP_* bits.

	* gdk/win32/gdkprivate-win32.h: Declare them. Define
	GDK_DEBUG_MISC_OR_EVENTS for use in GDK_NOTE() to match either
	"misc" or "events".


svn path=/trunk/; revision=21587
2008-10-05 00:00:10 +00:00
Cody Russell
e625b41a1d Bug 541162 – [Win32] Update for the new GdkWindowImpl stuff
2008-07-02  Cody Russell  <bratsche@gnome.org>

        Bug 541162 – [Win32] Update for the new GdkWindowImpl stuff

        * gdk/win32/gdkprivate-win32.h:
        * gdk/win32/gdkgeometry-win32.c:
        * gdk/win32/gdkevents-win32.c:
        * gdk/win32/gdkwindow-win32.c: Update Win32 backend according to
        the newly refactored GdkWindow code.


svn path=/trunk/; revision=20729
2008-07-02 06:06:29 +00:00
Johan Dahlin
d97cdbdf53 Include "config.h" instead of <config.h> Command used: find -name
2008-06-21  Johan Dahlin  <jdahlin@async.com.br>

    * *.[ch]: Include "config.h" instead of <config.h>
    Command used:
    find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g'
    Rubberstamped by Mitch and Tim


svn path=/trunk/; revision=20669
2008-06-22 14:28:52 +00:00
Tor Lillqvist
0f7099e308 Bug 520286 - Non-deletable window has no minimize / maximize buttons
2008-03-10  Tor Lillqvist  <tml@novell.com>

	Bug 520286 - Non-deletable window has no minimize / maximize buttons

	* gdk/win32/gdkmain-win32.c (_gdk_win32_window_style_to_string):
	New debugging output function that decodes a set of WS_* bits.

	* gdk/win32/gdkprivate-win32.h: Declare it.

	* gdk/win32/gdkwindow-win32.c (update_single_system_menu_entry):
	New function that enables or disables one menu entry in the system
	menu of a top-level window. (The corresponding decoration will
	then also be enabled or disabled (grayed).)

	(update_style_bits): Do as the comment says and don't try to
	update the window style based on the GdkWMFunctions set for the
	window.
		   
	(update_system_menu): New function that enables or disables the
	system menu entries based on a window's stored set of
	GdkWMFunctions.

	(gdk_window_set_functions): Call update_system_menu() instead of
	update_style_bits().


svn path=/trunk/; revision=19743
2008-03-10 15:48:06 +00:00
Cody Russell
db58254c5c gdk/win32/gdkprivate-win32.h gdk/win32/gdkevents-win32.c
2008-02-05  Cody Russell  <bratsche@gnome.org>

        * gdk/win32/gdkprivate-win32.h
        * gdk/win32/gdkevents-win32.c
        * gdk/win32/gdkwindow-win32.c
        * gdk/win32/gdkwindow-win32.h
        * gdk/win32/gdkwin32.h:
        Modal window rework.  (#455627 and #511111)


svn path=/trunk/; revision=19463
2008-02-05 16:47:24 +00:00
Michael Natterer
92f86e0496 gdk/gdk.h gdk/gdkcairo.h gdk/gdkcolor.h gdk/gdkgc.h gdk/gdkinternals.h
2008-01-14  Michael Natterer  <mitch@imendio.com>

	* gdk/gdk.h
	* gdk/gdkcairo.h
	* gdk/gdkcolor.h
	* gdk/gdkgc.h
	* gdk/gdkinternals.h
	* gdk/gdkregion.h
	* gdk/gdkwindow.h: made GdkRectangle*, GdkRegion* and GdkColor*
	parameters const.

	* gdk/gdkcairo.c
	* gdk/gdkgc.c
	* gdk/gdkwindow.c
	* gdk/gdkrectangle.c
	* gdk/gdkpolyreg-generic.c
	* gdk/gdkregion-generic.c
	* gdk/directfb/gdkcolor-directfb.c
	* gdk/directfb/gdkgc-directfb.c
	* gdk/directfb/gdkgeometry-directfb.c
	* gdk/directfb/gdkwindow-directfb.c
	* gdk/quartz/gdkcolor-quartz.c
	* gdk/quartz/gdkgc-quartz.c
	* gdk/quartz/gdkgeometry-quartz.c
	* gdk/quartz/gdkwindow-quartz.c
	* gdk/win32/gdkcolor-win32.c
	* gdk/win32/gdkgc-win32.c
	* gdk/win32/gdkgeometry-win32.c
	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkwindow-win32.c
	* gdk/x11/gdkcolor-x11.c
	* gdk/x11/gdkgc-x11.c
	* gdk/x11/gdkgeometry-x11.c
	* gdk/x11/gdkmain-x11.c
	* gdk/x11/gdkprivate-x11.h
	* gdk/x11/gdkwindow-x11.c: changed accordingly.

	* gdk/gdkpolyreg-generic.c: uncruftify to have proper function
	headers.


svn path=/trunk/; revision=19365
2008-01-14 14:02:12 +00:00
Tor Lillqvist
8dab0b9360 gdk/win32/gdkdisplay-win32.c gdk/win32/gdkglobals-win32.c
2008-01-10  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkdisplay-win32.c
	* gdk/win32/gdkglobals-win32.c
	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkscreen-win32.c
	* gdk/win32/gdkwindow-win32.c: Implement
	gdk_screen_get_monitor_width_mm(), gdk_screen_get_monitor_height_mm()
	and gdk_screen_get_monitor_plug_name(). Thanks to Kazuki
	Iwamoto. (#505753)


svn path=/trunk/; revision=19346
2008-01-10 21:40:48 +00:00
Tor Lillqvist
8a99fbc640 gdk/win32/gdkprivate-win32.h gdk/win32/gdkmain-win32.c Define WINVER and
2006-09-10  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkmain-win32.c
	* gdk/win32/gdkwindow-win32.c: Define WINVER and _WIN32_WINNT as
	0x0500 in gdkprivate-win32.h instead of doing it in two source
	files. (#355212, Mike Edenfield)

	* gdk/win32/gdkwindow-win32.c: We can also remove the ersatz
	GetAncestor() for the _MSC_VER && WINVER < 0x0500 case, I hope.
2006-09-10 17:33:29 +00:00
Tor Lillqvist
1ff434a681 Remove support for Windows 9x/ME. GTK+ hasn't worked on Win9x since 2.6 or
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-08-29 23:01:53 +00:00
Tor Lillqvist
53e2c08380 Get the invalidated region from ScrollWindowEx() instead of an incorrect
2006-01-02  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkgeometry-win32.c (gdk_window_scroll): Get the
	invalidated region from ScrollWindowEx() instead of an incorrect
	attempt to calculate it ourselves. Fix by John Ehresman. (#323666)

	* gdkevents-win32.c: Make _gdk_win32_hrgn_to_region() non-static.

	* gdkprivate-win32.h: Declare it.
2006-01-02 00:45:39 +00:00
Tor Lillqvist
9b5c5f9db5 Remove unnecessary includes.
2005-11-09  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkwindow-win32.c: Remove unnecessary includes.

	(_gdk_win32_get_adjusted_client_rect): Remove this two-line
	function which was used only in one place.

	(get_outer_rect): Use _gdk_win32_adjust_client_rect().

	(gdk_window_set_geometry_hints): If we have identical minimum and
	maximum size hints, remove the resize and maximize
	decorations/functions. (#104514)

	If we have a maximum size hint, remove the maximize
	decoration/function but ensure the resize decoration/function is
	available. Otherwise ensure both resize and maximize
	decorations/functions are there.

	(set_or_clear_style_bits): Factored out common code from
	gdk_window_set_decorations() and gdk_window_set_functions().

	Hack the window style setting once more: Only touch the window
	style bits corresponding to the GdkWMDecoration or GdkWMFunction
	parameter bitmasks. Hopefully this finally is the correct thing to
	do. We used to clear all other bits than those that were being
	set, or set all other bits than those that were being cleared.

	Take into account that adding or removing decorations leaves the
	window's outer size unchanged, i.e., the client area's size and
	position change. This is apparently not what we want, so change
	also the window's (outer) position and size appropriately so that
	the client area's position and size stay constant.

	gtk-demo's color selector dialog is now non-resizable like on X11
	(I tested with metacity in GNOME). Torn off menus are shrinkable
	vertically but have a maximum size, and are not maximizable or
	minimizable, like on X11.

	(gdk_window_set_decorations, gdk_window_set_functions): Let
	set_or_clear_decorations() do most of the job.

	* gdk/win32/gdkprivate-win32.h: Remove declaration of
	_gdk_win32_get_adjusted_client_rect().
2005-11-09 12:35:56 +00:00
Tor Lillqvist
4d1b5589c5 gdk/win32/gdkprivate-win32.h gdk/win32/gdkglobals-win32.c Add more
2005-11-01  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkglobals-win32.c
	* gdk/win32/gdkmain-win32.c (_gdk_windowing_init): Add more
	pre-interned GdkAtoms and pre-registered clipboard formats. Sort
	their declarations, definitions and assignments into a more
	logical and consistent order.

	* gdk/win32/gdkmain-win32.c (_gdk_win32_cf_to_string): Include the
	CF_ prefix for the predefined clipboard format names. Put quotes
	around registered format names to distinguish them.

	* gdk/win32/gdkproperty-win32.c (gdk_property_change): Return
	immediately with a warning if the property type is STRING, TEXT,
	COMPOUND_TEXT or SAVE_TARGETS, as these are X11-specific that we
	should never pretend to handle on Win32. Handle only UTF8_STRING
	here, other formats with delayed rendering. Use \uc1 instead of
	\uc0 when generating Rich Text Format for easier testability on
	XP, where WordPad misinterprets \uc0 encoded characters. Add more
	GDK_NOTE debugging output for Clipboard operations.

	* gdk/win32/gdkselection-win32.c: Debugging printout improvements.
	(gdk_selection_convert): Don't pretent to handle STRING, just
	UTF8_STRING. Streamline error handling, don't unnecessarily have a
	GError which then isn't used for anything anyway if it gets set.
	(gdk_win32_selection_add_targets): Skip also STRING, TEXT,
	COMPOUND_TEXT and SAVE_TARGETS in addition to UTF8_STRING.
2005-11-01 15:29:59 +00:00
Tor Lillqvist
baad14eee0 Improve and simplify line segment rendering on Win32, especially the
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-06-24 13:00:05 +00:00
Tor Lillqvist
d42fa02bc3 gdk/win32/gdkcursor-win32.c gdk/win32/gdkwindow-win32.c Support
2005-06-04  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkcursor-win32.c
	* gdk/win32/gdkwindow-win32.c
	* gdk/win32/gdkprivate-win32.h: Support full-colour cursors.
	Support cursors with alpha on XP. Use code in common with the
	support for alpha icons that already was present. (#306101, Tim
	Evans)
2005-06-04 21:43:03 +00:00
Tor Lillqvist
ba7ee2270a gdk/win32/gdkevents-win32.c gdk/win32/gdkkeys-win32.c Check the
2005-05-18  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkevents-win32.c
	* gdk/win32/gdkkeys-win32.c
	* gdk/win32/gdkprivate-win32.h: Check the KF_EXTENDED bit in
	lParam of WM_KEY* messages to distinguish between left and right
	Control and Alt keys. Unfortunately, the right Shift key doesnt
	set KF_EXTENDED, so to distinguish between left and right Shift
	keys, check the scan code. (#304584)
2005-05-18 14:53:00 +00:00
Owen Taylor
788bbf520a Add a draw-border style property to allow themes to draw outside the
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
2005-05-02 23:29:24 +00:00
Tor Lillqvist
0b2ac32cf5 New debugging function, to log a clipboard format name symbolically.
2005-04-04  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkmain.c (_gdk_win32_cf_to_string): New debugging
	function, to log a clipboard format name symbolically.
	(_gdk_win32_data_to_string): Also new, to log random data bytes.

	Implement delayed rendering on Win32, specifically for transfering
	images through the clipboard from GTK+ apps to other
	apps (#168173, implementation by Ivan Wong):

	* gdk/win32/gdkevents-win32.c (gdk_event_translate):
	Handle WM_RENDERFORMAT.

	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkglobals-win32.c: Add _format_atom_table,
	_delayed_rendering_data and _image_bmp.

	* gdk/win32/gdkmain-win32.c: Initialize _image_bmp.

	* gdk/win32/gdkproperty-win32.c (gdk_property_change):
	Accept formats other than GDK_TARGET_STRING or _utf8_string, and
	assume they are handled through delayed rendering.

	* gdk/win32/gdkselection-win32.c (gdk_selection_convert):
	Return all available formats (including those registered by GTK+
	apps) on request_targets.
	(gdk_selection_property_get): We should append a zero byte like
	X11 does.
	(gdk_win32_selection_add_targets): New function, for
	gtkselection's use. Win32 requires that the clipboard owner
	registers all valid formats even if the owner wants delayed
	rendering.
	(_gdk_win32_selection_convert_to_dib): New function. Convert
	images to DIB using gdk-pixbuf.

	* gdk/win32/gdkwin32.h: Declare gdk_win32_selection_add_targets().

	* gtk/gtkselection.c (gtk_selection_add_target,
	gtk_selection_add_targets): Call gdk_win32_selection_add_targets()
	to register target formats.

	* gdk/gdk.symbols: Add gdk_win32_selection_add_targets().
2005-04-04 00:12:26 +00:00
Owen Taylor
368f15ca59 Use cairo_set_device_offset().
2005-02-24  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkwindow.c: Use cairo_set_device_offset().

	* gdk/win32/gdkdrawable-win32.[ch] gdk/win32/gdkwindow-win32.c
	gdk/win32/gdkpixmap-win32.c:
	Add_gdk_win32_drawable_acquire/release_dc() to get a DC for the
	drawable. Add _gdk_drawable_win32_finish() to clean up resources
	when a drawable is destroyed.

	* gdk/win32/gdkgc-win32.c gdk/win32/gdkdrawable-win32.c
	(blit_from_pixmap) gdk/win32/gdkprivate-win32.h : Use
	acquire/release_dc when getting a DC to use with a GC or for
	blitting from a pixmap.

	* gdk/win32/gdkdrawable-win32.[ch]: Implement ref_cairo_surface()

	* gdk/win32/gdkpango-win32.c gdk/win32/gdkdrawable-win32.c Makefile.am:
	Remove gdk_screen_get_pango_context(), draw_glyph[_transformed]
	implementations.

	* gdk/win32/gdkdrawable-win32.c: Remove
	gdk_draw_rectangle_alpha_libgtk_only()
2005-03-18 01:23:23 +00:00
Tor Lillqvist
34bfd71279 gdk/win32/gdkprivate-win32.h Drop global variable _gdk_root_window, just
2005-03-16  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/*.c: Drop global variable _gdk_root_window, just call
	GetDesktopWindow(). Rename the GdkWindow* _gdk_parent_root to
	_gdk_root.

	* gdk/win32/gdkwindow-win32.h (GdkWindowImplWin32): Add
	toplevel_window_type field.

	* gdk/win32/gdkwindow-win32.c: As there is only one root
	window in GDK on Win32, we can compare directly to _gdk_root
	instead of checking the window type.
	(gdk_window_reparent): When reparenting a child of the desktop
	clear out the window decorations. Correspondingly, when
	reparenting to the desktop, add decorations. As in the X11
	backend, save the window type of a toplevel window when
	reparenting, in case it is reparented back to toplevel.
2005-03-16 02:21:14 +00:00
Tor Lillqvist
7c12edeb93 New debugging function. As GetKeyNameText() returns a localized key name
2005-03-15  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkmain-win32.c (_gdk_win32_key_to_string): New
	debugging function. As GetKeyNameText() returns a localized key
	name we need to convert it to UTF-8.

	* gdk/win32/gdkprivate-win32.h: Declare it.

	* gdk/win32/gdkevents-win32.c: Use it.

	* gdk/win32/gdkwindow-win32.c (gdk_window_new_internal): Fix
	handling of children of foreign windows. They should be child
	windows from Windows's perspective, even if they are toplevel GDK
	windows.
2005-03-15 02:07:08 +00:00
Tor Lillqvist
736f4c8758 Fix for #163702, from Ivan Wong:
2005-01-23  Tor Lillqvist  <tml@novell.com>

	Fix for #163702, from Ivan Wong:

	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkglobals-win32.c: New flag _ignore_destroy_clipboard.

	* gdk/win32/gdkevents-win32.c (gdk_event_translate): Handle
	WM_DESTROYCLIPBOARD. Unless _ignore_destroy_clipboard, generate a
	GDK_SELECTION_CLEAR event.

	* gdk/win32/gdkselection-win32.c
	(gdk_selection_owner_set_for_display): Set _ignore_destroy_clipboard
	when emptying the clipboard ourselves.

	(gdk_selection_send_notify_for_display): Remove the artifical
	GDK_SELECTION_CLEAR event generation.
2005-01-23 00:38:17 +00:00
Tor Lillqvist
e34f0452b4 Fix for #162790, by Iwan Wong:
2005-01-12  Tor Lillqvist  <tlillqvist@novell.com>

	Fix for #162790, by Iwan Wong:

	* gdk/win32/gdkdrawable-win32.c: Implement dashed lines
	correctly. Simplify the interface to render_line_horizontal() and
	render_line_vertical(). Need to draw lines "manually" also on
	NT-based Windowses if we have a dash offset or are drawing
	double-dashed lines.

	* gdk/win32/gdkprivate-win32.h: Keep also the dash offset,
	double-dash flag, and a brush for the background colour (used by
	the odd dashes in the double-dash line style) in the GdkGCWin32
	struct.

	* gdk/win32/gdkgc-win32.c: Set up above new fields.
2005-01-12 21:28:03 +00:00
Tor Lillqvist
a841d12888 gdk/win32/gdkprivate-win32.h gdk/win32/gdkglobals-win32.c Remove
2004-10-31  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkglobals-win32.c
	* gdk/win32/gdkmain-win32.c: Remove _windows_version and the
	IS_WIN_NT() macro.

	* gdk/win32/*.c: Use G_WIN32_IS_NT_BASED() from GLib instead.
2004-10-31 14:47:15 +00:00
Tor Lillqvist
f8ef369e78 List the three theme gtkrc files separately, zip doesn't do anything if
2004-09-03  Tor Lillqvist  <tml@iki.fi>

	* gtk-zip.sh.in: List the three theme gtkrc files separately, zip
	doesn't do anything if one of the files on its command line
	doesn't exist.

	Handle changes of screen resolution on Win32. (#151581, reported by
	Arjohn Kampman)

	* gdk/win32/gdkwindow-win32.c (_gdk_windowing_window_init,
	_gdk_root_window_size_init): Factor out setting the root window's
	size (as the size of the union of all monitors) to a new function.

	* gdk/win32/gdkdisplay-win32.c (gdk_display_open,
	_gdk_monitor_init): Factor out the monitor query to a new
	function.

	* gdk/win32/gdkprivate-win32.h: Declare above new functions.

	* gdk/win32/gdkevents-win32.c (gdk_event_translate,
	handle_display_change): Handle WM_DISPLAYCHANGE by calling the
	above two functions, and emitting the "size_changed" signal on our
	(only) GdkScreen.
2004-09-03 01:27:57 +00:00
Robert Ögren
c0ba86bc81 On Win32, do not produce tablet motion or button events while a window is
2004-08-28  Robert Ögren  <gtk@roboros.com>

	On Win32, do not produce tablet motion or button events while a
	window is being moved or resized. (#151090, reported by Shaneyfelt)

	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkglobals-win32.c
	* gdk/win32/gdkevents-win32.c: Rename the variable resizing to
	_sizemove_in_progress and make it extern.

	* gdk/win32/gdkinput-win32.c (_gdk_input_other_event): Ignore
	motion and button events if _sizemove_in_progress is true.
2004-08-31 19:13:24 +00:00
Tor Lillqvist
d8b2f46c18 gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text)
2004-07-07  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text)
	* gdk/win32/gdkfont-win32.c (gdk_text_extents)
	* gdk/win32/gdkproperty-win32.c (find_common_locale,
	gdk_property_change)
	* gdk/win32/gdkselection-win32.c (gdk_selection_convert): Use
	g_utf8_to_utf16() instead of the removed _gdk_utf8_to_ucs2() (see
	below).

	* gdk/win32/gdkglobals-win32.c
	* gdk/win32/gdkmain-win32.c (_gdk_windowing_init)
	* gdk/win3/gdkprivate-win32.h: Add a variable for the TARGETS
	atom. Initialize it. Declare it. Drop the variable for the
	COMPOUND_TEXT atom.

	* gdk/win32/gdkim-win32.c (gdk_wcstombs): Don't return UTF-8. This
	function is supposed to return the string in the locale's charset
	and encoding. Use g_convert().

	(gdk_mbstowcs): Similarily, don't take an UTF-8 string, but a
	string in the locale's charset. Use g_convert().

	(_gdk_ucs2_to_utf8, _gdk_utf8_to_wcs, _gdk_utf8_to_ucs2):
	Delete. The UCS-2 functions didn't handle surrogates anyway. Use
	GLib's UTF-16 functions instead. Windows uses UTF-16.

	* gdk/win32/gdkprivate-win32.h: Remove declarations of the deleted
	functions mentioned above.

	* gdk/win32/gdkproperty-win32.c (gdk_property_change): Use CF_TEXT
	also if the string is of type STRING, i.e. ISO-8859-1, and the
	current codepage is 1252, and contains no C1 chars. Accept
	also UTF8_STRING.

	* gdk/win32/gdkselection-win32.c (_gdk_selection_property_store):
	Mark as static. When storing STRING data, convert to
	Latin-1. (#140537)
	(gdk_selection_owner_set_for_display): Now that STRING is always
	ISO-8859-1, use UTF8_STRING when sending the selection request
	to ourselves.

	(gdk_selection_convert): Handle also UTF8_STRING. (#140537, John
	Ehresman)

	(gdk_text_property_to_text_list_for_display): Make work more like
	X11 version. Do obey the encoding parameter.

	(gdk_string_to_compound_text_for_display,
	gdk_utf8_to_compound_text_for_display): Don't even pretend
	supporting COMPOUND_TEXT.

	(gdk_utf8_to_string_target): Convert to ISO-8859-1, like on X11.

	(sanitize_utf8): Zero-terminate string.
2004-07-07 00:10:03 +00:00
Tor Lillqvist
15567341f1 If the WM_TRANSIENT_FOR property is being deleted, set the owner of the
2004-01-25  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkproperty-win32.c (gdk_property_delete): If the
	WM_TRANSIENT_FOR property is being deleted, set the owner of the
	window to the root window (i.e., effectively unset it). (#132411)

	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkglobals-win32.c
	* gdk/win32/gdkmain-win32.c: Declare, define and initialize
	_wm_transient_for, a GdkAtom for WM_TRANSIENT_FOR.

	* acconfig.h: Remove HAVE_WINSOCK_H, not used any longer.
2004-01-25 22:19:40 +00:00
Tor Lillqvist
5155f3ca66 gdk/win32/gdkinput-win32.h Drop the GdkEvent* parameter, it wasn't used.
2003-08-07  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkinput-win32.h
	* gdk/win32/gdkinput-win32.c (_gdk_input_configure_event,
	_gdk_input_enter_event): Drop the GdkEvent* parameter, it wasn't
	used.

	* gdk/win32/gdkevents-win32.c (gdk_event_translate): Adapt caller
	accordingly, in fact an uninitialised variable was dereferenced.


	[Win32] Add support for multiple monitors.

	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkglobals-win32.c: New global variables for
	multiple-monitor info: _gdk_num_monitors, _gdk_monitors, and
	_gdk_offset_x and _gdk_offset_y.

	* gdk/win32/gdkdisplay-win32.c (count_monitor, enum_monitor): New
	functions, enumeration functions passed to EnumDisplayMonitors().

	(gdk_display_open): If the EnumDisplayMonitors() and
	GetMonitorInfo() API is present (on Win98, Win2000 and newer), use
	if to find out monitor info.

	Calculate the offset between Win32 coordinates (relative to the
	primary monitor's origin (and thus negative on monitors to the
	left of or above it), and GDK's (visible coordinates should be
	non-negative).

	* gdk/win32/gdkscreen-win32 (gdk_screen_get_n_monitors,
	gdk_screen_get_monitor_geometry): Use information collected above.

	(gdk_window_move, gdk_window_move_resize_window_get_geometry):
	Subtract _gdk_offset_{x,y} from GDK root window coordinates.

	(gdk_window_get_geometry, gdk_window_get_origin,
	gdk_window_get_frame_extents): For top-level windows, add
	_gdk_offset_{x,y} to GDK root window coordinates

	Still need to handle multiple monitors in
	gdk_window_fullscreen(). Probably should make the window
	fullscreen on the monitor where the cursor is?

	* gdk/win32/gdkevents-win32.c: Add _gdk_offset_{x,y} to all GDK
	root window coordinates in GdkEvents.


	[Win32] Fix geometry hint handling. Add support for resize
	increment and base size, and aspect ratio geometry hints. The
	"gridded geometry" test in testgtk now works beautifully.

	* gdk/win32/gdkwindow-win32.c (gdk_window_set_geometry_hints):
	Turns out this function shouldn't actually ever modify the
	window's size, just store the hints. (Old code kept for a while
	inside #if 0.)

	(gdk_window_set_hints): Remove presumably broken code that handles
	the position hints, this function is obsolete anyway.

	* gdk/win32/gdkevents-win32.c: Drop the current_{x,y}_root
	variables, not used.

	(adjust_drag): New function, used to implement resize increment
	hints.

	(gdk_event_translate): Handle WM_SIZING, implement resize
	increment and base size, and aspect ratio geometry hints here. The
	WM_GETMINMAXINFO handler takes care of the minimum and maximum
	size hints as before. Fix the WM_GETMINMAXINFO handler to take
	into account window decorations. No need to modify the
	ptMaxPosition and ptMaxSize fields in the MINMAXINFO struct,
	the defaults are fine.

	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkwindow-win32.c (_gdk_win32_adjust_client_rect,
	_gdk_win32_get_adjusted_client_rect): New helper functions.
2003-08-07 22:17:18 +00:00
Tor Lillqvist
63f745738d gdk/win32/gdkprivate-win32.h New flags _gdk_input_locale_is_ime and
2003-07-25  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkglobals-win32.c: New flags _gdk_input_locale_is_ime
	and _gdk_keyboard_has_altgr.

	* gdk/win32/gdkevents-win32.c: Lots of changes. Most important
	ones detailled here.

	Code that has been ifdeffed out for a long time removed. Remove
	some really old doc comments that were left behind for some public
	functions, the official ones are in the X11 backend anyway. Change
	GDK_WINDOW_OBJECT() calls to GdkWindowObject casts. Reformat
	multi-line boolean expressions to have the operators at ends of
	lines.

	As mouse capture with SetCapture() indeed seems to work OK, no
	need to have the correspoinding macro USE_SETCAPTURE and ifdefs.

	Ifdef out the gdk-ping-msg stuff. I don't remember why it was
	needed at some time, and things seem to work fine now without
	(knock on wood).

	Ifdef out the search for some Latin locale keyboard layout being
	loaded. Not used currently, but might be needed after all, if we
	decide that we want to be able to generate ASCII control character
	events with a non-Latin keyboard.

	(assign_object): New helper function, handles the g_object_ref()
	and unref() calls when assigning GObject pointers.

	(generate_crossing_events): Also generate the GDK_NOTIFY_INTERIOR
	enter event when the pointer has moved to an ancestor window. Was
	left out by mistake.

	(gdk_window_is_ancestor): Renamed from gdk_window_is_child().

	(gdk_pointer_grab, gdk_pointer_ungrab): Implement the confine_to
	functionality, using ClipCursor().

	(find_window_for_mouse_event): Splice part of code into new
	function find_real_window_for_grabbed_mouse_event().

	(fixup_event, append_event, apply_filters): New functions, code
	refactored out from elsewhere.

	(synthesize_enter_or_leave_event, synthesize_leave_event,
	synthesize_enter_event,
	synthesize_leave_events,synthesize_enter_events): Also take a
	GdkCrossingMode parameter, in preparation to generating
	GDK_CROSSING_GRAB and GDK_CROSSING_UNGRAB events.

	(fixup_event, append_event, fill_key_event_string): New functions,
	code refactoring.

	(vk_from_char, build_keypress_event, build_keyrelease_event):
	Removed as part of dropping WM_CHAR handling.

	(build_key_event_state,gdk_event_translate): Call
	GetKeyboardState(), once, for each keyboard message, instead of
	several calls to GetKeyState() here and there.

	(gdk_event_translate): Fix bugs #104516, #104662, #115902. While
	at it, do some major refactoring, and some fixes for potential
	problems noticed while going through the code.

	Don't handle WM_CHAR at all. Only handle WM_KEYDOWN and
	WM_KEYUP. Don't need the state variables related to whether to
	wait for WM_CHAR or not, and whether the current key is
	AltGr. Remove lots of complexity. Thus don't need the
	use_ime_composition flag.

	Not handling WM_CHAR means dead key handling will have to be taken
	care of by GTK, but that seems to work fine, so no worry.

	Another side-effect is that Alt+keypad digits don't work any
	longer, but it's better to learn to use GTK's ISO14755 support is
	anyway.

	Be more careful in checking whether AltGr is involved. Only
	attempt to handle it if the keyboard actually has it. And
	explicitly check for *left* Control plus *right* Alt being
	pressed. Still, allow (left) Alt and/or (right) Control with AltGr
	chars.

	Handle keys using similar code as in the X11 backend. As we have
	built a keymap in gdkkeys-win32.c anyway, use it by calling
	gdk_keymap_translate_keyboard_state() to look up the keysym from
	the virtual key code and keyboard state. Build the key event
	string in exactly the same way as the X11 backend.

	If an IME is being used, don't generate GDK events for keys
	between receiving WM_IME_STARTCOMPOSITION and
	WM_IME_ENDCOMPOSITION, as those keys are for the IME.

	For WM_IME_COMPOSITION, handle all the Unicode chars returned from
	the IME, not just the first one.

	gdk_event_translate() is still quite complex, could split the
	message handler cases out into separate functions.

	On mouse events, when the mouse is grabbed, use
	find_real_window_for_grabbed_mouse_event() in order to be able to
	generate correct crossing events.

	No longer take a pre-allocated GdkEvent as parameter. Instead,
	allocate events as needed and append them to the queue. (This is
	different from how gdk_event_translate() in the X11 backend
	works.) This change made the code much clearer, especially in the
	cases where we have to generate several GDK events for one Windows
	message.  Return FALSE if DefWindowProc() should be called, TRUE
	if not. If DefWindowProc() should not be called, also return the
	value to be returned from the window procedure.

	(Previously, the interaction with gdk_event_translate()'s caller
	was much more complex, when we had to indicate whether the
	already-queued event should be left in the queue or removed, and
	in addition also had to indicate whether to call DefWindowProc()
	or not, and what value to return from the window procedure if
	not.)

	Don't use a separate "private" variable required to be pointing to
	the GdkWindowObject of the "window" variable at all times. Just
	use casts, even if looks a bit uglier.

	Notice destroyed windows as early as possible, and break out of
	the messsage switch.

	Use _gdk_pointer_root as current_window when the pointer is
	outside GDK's top-level windows.

	On WM_INPUTLANGCHANGE, set _gdk_input_locale_is_ime as
	appropriate, based on ImmIsIME().

	(gdk_event_translate, gdk_event_send_client_message_for_display,
	gdk_screen_broadcast_client_message): Implement client messages.
	Use a registered Windows message to pass GDK client messages. Note
	that the amount of user data is restricted to four bytes, as it is
	carried in the LPARAM. (The WPARAM is used for the message type
	"atom".)

	(real_window_procedure): Adapt for new gdk_event_translate()
	interface.

	* gdk/win32/gdkmain-win32.c (_gdk_windowing_init): Set
	_gdk_input_locale_is_ime initially.

	* gdk/win32/gdkwindow-win32.c: Use g_object_ref()/unref() instead
	of g_colormap_ref()/unref().

	(gdk_window_new): Made code a bit more like the X11 one, pretend
	to handle screens (although we just have one for now).

	* gdk/x11/gdkevents-x11.c
	(gdk_event_send_client_message_for_display,
	gdk_screen_broadcast_client_message): Document the user data
	limitation on Win32.

	* gdk/win32/gdkevents-win32.c (print_event): More complete enter
	and leave notify detail output.

	* gdk/win32/gdkkeys-win32.c (update_keymap): Make dead keys
	visible to GDK and GTK. Store the corresponding GDK_dead_* keysym
	for those, so that the GtkIMContextCimple compose tables will
	work. Deduce if the keyboard layout has the AltGr key, and set the
	above flag accordingly.
2003-07-26 01:54:59 +00:00
Tor Lillqvist
323bcc614d Fix for #111028, thanks to J. Ali Harlow, who writes: I found that the
2003-06-28  Tor Lillqvist  <tml@iki.fi>

	Fix for #111028, thanks to J. Ali Harlow, who writes:
	I found that the GdkPixmap->GdkImage reference really isn't
	important. It's only really there to have somewhere convenient to
	store the location of the pixel data in the pixmap and as an easy
	way of accessing the dimensions of that data. I have therefore put
	together a fix which removes this reference entirely which seems
	to solve the problem.

	* gdk/win32/gdkpixmap-win32.h (struct _GdkPixmapImplWin32):
	Instead of a pointer to a GdkImage, keep a pointer to the pixels
	directly.

	* gdk/win32/gdkimage-win32.c (_gdk_win32_setup_pixmap_image): Remove.
	(_gdk_win32_new_image): New function, replacing the above. Creates
	a GdkImage without any associated GdkPixmap.
	(gdk_image_new_bitmap, _gdk_image_new_for_depth): Use it instead.

	* gdk/win32/gdkprivate-win32.h: Remove from here, too.

	* gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap)
	* gdk/win32/gdkdrawable-win32.c (blit_from_pixmap)
	* gdk/win32/gdkgc-win32.c (_gdk_win32_bitmap_to_hrgn)
	* gdk/win32/gdkmain-win32.c (_gdk_win32_drawable_description):
	* gdk/win32/gdkpixmap-win32.c (gdk_pixmap_impl_win32_finalize,
	gdk_pixmap_new, gdk_bitmap_create_from_data, gdk_pixmap_foreign_new)
	Corresponding changes.
2003-06-28 01:12:51 +00:00
Tor Lillqvist
f91ae98003 Fix typo.
2003-06-06  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkprivate-win32.h: Fix typo.
2003-06-06 23:06:29 +00:00
Tor Lillqvist
5fc015b4e9 gdk/win32/gdkpixmap-win32.c (gdk_pixmap_new, gdk_bitmap_create_from_data,
2002-12-11  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkpixmap-win32.c (gdk_pixmap_new,
	gdk_bitmap_create_from_data, gdk_pixmap_create_from_data)
	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkimage-win32.c (_gdk_win32_setup_pixmap_image):
	Functions now take a GdkDrawable instead of GdkWindow parameter,
	like in X11 and linux-fb backends (#100780)

	* gdk/win32/gdkwindow-win32.c (get_default_title): Do use
	g_get_application_name() (I now have a fresh enough GLib).
2002-12-11 23:04:39 +00:00
Tor Lillqvist
af9b53fc58 Merge from stable:
2002-12-09  Tor Lillqvist  <tml@iki.fi>

	Merge from stable:

	* gdk/win32/gdkdrawable-win32.c (generic_draw): Don't leak
	stipple_gc. More checks for errors. Use correct ternary ROP when
	blitting the foreground into the tile pixmap onto those pixels
	where the stipple is set. (I didn't notice that I had used the
	wrong one, as it didn't matter on Win2k, where DIB sections
	apparently are zeroed upon creation. But on Win98 they have random
	initial contents. Thanks to Hans Breuer for reporting this.)
	(gdk_win32_draw_rectangle, gdk_win32_draw_arc,
	gdk_win32_draw_polygon): Don't pass the LINE_ATTRIBUTES bits to
	generic_draw() if drawing a filled figure.

	* gdk/win32/gdkmain-win32.c (_gdk_win32_print_dc): Minor cosmetics.
	(_gdk_win32_gcvalues_mask_to_string): Initialize buffer as empty.
	(_gdk_win32_window_state_to_string): New debugging output helper
	function.

	* gdk/win32/gdkevents-win32.c: Minor debugging output changes.
	(gdk_event_translate): Ignore the WM_SHOWWINDOW/SW_OTHERUNZOOM or
	SW_OTHERZOOM messages. Do not generate a GDK_UNMAP event for
	WM_SIZE/SIZE_MINIMIZED messages, they do not really corrspond to
	unmapping on X11. Set window state correctly for all three of
	SIZE_{MINIMIZED,MAXIMIZED,RESTORED}. A maximized and then iconified
	("minimized" in Windows terminology) window still has the
	"maximized" property, i.e. when deiconified, it will reappear as
	maximized. (#10557)

	* gdk/win32/gdkprivate-win32.h: Declare new function.
	(WIN32_API_FAILED, WIN32_GDI_FAILED, OTHER_API_FAILED): Don't use
	__PRETTY_FUNCTION__ if __GNUC__ >= 3, to avoid warning message.

	* gdk/win32/gdkwindow-win32.c (show_window_internal): Handle more
	situations. Add parameter to tell whether deiconifying. Code
	reorg: Return early when appropriate instead of using nested if
	statements. If just deiconifying without raising, restore active
	window. (#10557)

	(gdk_window_hide, gdk_window_withdraw, gdk_window_iconify,
	gdk_window_deiconify, gdk_window_maximize, gdk_window_unmaximize,
	gdk_window_focus): Use _gdk_win32_window_state_to_string() in
	debugging output.

	(gdk_window_iconify): Restore active window after calling
	ShowWindow(). Otherwise the "next" window gets activated.

	(gdk_window_stick, gdk_window_unstick): Don't output any warnings.

	(gdk_window_set_transient_for): Rewrite. Just call SetWindowLong()
	with GWL_HWNDPARENT, which despite its name sets the *owner*
	window, which should be exactly what we want. The PSDK
	documentation is said to be misleading. testgtk's modal window
	test now works much better. (#50586)
2002-12-09 00:43:42 +00:00
Tor Lillqvist
36a56b08e5 Add missing entries, needed by gtk.
2002-11-16  Tor Lillqvist  <tml@iki.fi>

	* gdk/gdk.def: Add missing entries, needed by gtk.

	* gdk/win32/gdkcolor-win32.c (gdk_screen_get_system_colormap):
	Remove g_return_val_if_fail call. This function is called from
	gdk_display_open() with the _gdk_screen it just created, but when
	gdk_screen_get_default() still returns NULL.

	* gdk/win32/gdkdisplay-win32.c
	* gdk/win32/gdkscreen-win32.c: Make more like the linux-fb
	versions. For instance, don't call
	gdk_display_manager_set_default_display() from gdk_display_open().

	* gdk/win32/gdkglobals-win32.c: Move _gdk_display, _gdk_screen and
	_gdk_parent_root here.

	* gdk/win32/gdkinput.c (gdk_display_list_devices): New function.

	* gdk/win32/gdkmain-win32.c (gdk_get_display): New function.

	* gdk/win32/gdkvisual-win32.c (gdk_screen_get_system_visual):
	Don't require that the screen parameter is non-NULL. It can be,
	and the linux-fb version doesn't check either.

	* gdk/win32/gdkwindow-win32.c (gdk_window_set_skip_taskbar_hint,
	gdk_window_set_skip_pager_hint, gdk_window_fullscreen,
	gdk_window_unfullscreen): Implement as no-ops.
2002-11-16 21:51:47 +00:00
Tor Lillqvist
fda3e29611 Reflect recent renamings and removals of functions.
2002-11-15  Tor Lillqvist  <tml@iki.fi>

	* gdk/gdk.def: Reflect recent renamings and removals of functions.

	Merge from stable:

	Start implementing all fill styles (i.e. tiled, stippled, and
	opaque stippled in addition to the plain solid style) in the Win32
	backend in an elegant and generic way. For now only did the
	draw_rectangle() and draw_glyphs() methods. The rest will
	follow. Previously some of the drawing methods implemented opaque
	stippling, but not tiles or non-opaque stippling.

	Seems to work fine, now the check marks show up in check buttons,
	the stippled background and stippled text in gtk-demo's Text
	Widget look as they should, and GtkText's line wrap arrow shows
	correctly instead of an ugly rectangle. [This refers to the stable
	branch, haven't actually checked HEAD.]

	The implementation does do a lot of pixmap handling and blitting
	back and forth, especially on Win9x. But performance is hopefully
	not an issue. I don't think many applications do a lot of tiled or
	stippled drawing.

	* gdk/win32/gdkprivate-win32.h: Define a new macro, GDI_CALL, that
	calls a GDI function and prints a warning if it failed. Also
	API_CALL for non-GDI calls. Cleans all the the if (!BlaBla())
	WIN32_GDI_FAILED ("BlaBla") snippets, these can now be written
	GDI_CALL (BlaBla, ()). Declare new functions.

	* gdk/win32/gdkdrawable-win32.c: Use GDI_CALL macro in lots of places.

	(generic_draw): New function that handles all the blitting
	necessary to implement tiles and stipples. A function that
	actually draws stuff is passed as a parameter to
	generic_draw(). If the fill style is solid, it is called
	directly, to draw on the destination drawable. Otherwise it is
	called to draw on a temporary mask bitmap, which then is used in
	blitting operations. The tiles and/or stipples are rendered into
	another temporary pixmap. If MaskBlt() is available (on NT/2k/XP),
	it is used, otherwise a sequence of BitBlt() is used to do the
	final composition onto the destination drawable.

	(draw_tiles_lowlevel, draw_tiles): Some renaming and code
	reorg. Use BitBlt() to blit each tile, not gdk_draw_drawable().

	(rop2_to_rop3): New function, does binary->ternary rop mapping.

	(blit_from_pixmap, blit_inside_window, blit_from_window): Use
	rop2_to_rop3(). Previously used SRCCOPY always...

	(draw_rectangle, gdk_win32_draw_rectangle, draw_glyphs,
	gdk_win32_draw_glyphs): Split functionality into two functions,
	with generic_draw() doing its magic inbetween.

	* gdk/win32/gdkevents-win32.c: Remove the TrackMouseEvent code, it
	was ifdeffed out and wouldn't have done anything even if
	enabled. Remove the GDK_EVENT_FUNC_FROM_WINDOW_PROC code, didn't
	have any effect any more anyway after all the changes GTK+ has
	gone through in the last years. Remove some #if 0 code.

	* gdk/win32/gdkgc-win32.c (gdk_gc_copy): Set the copy's hdc field
	to NULL in case a GC is copied while it has a Windows DC active.

	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkglobals-win32.c: Remove gdk_event_func_from_window_proc.

	* gdk/win32/gdkmain-win32.c: Remove -event-func-from-window-proc
	option. If there is a PRETEND_WIN9X envvar, set windows_version as
	if on Win9x.

	* gdk/win32/gdkpixmap-win32.c (_gdk_win32_pixmap_new,
	gdk_pixmap_new): Combine these two, _gdk_win32_pixmap_new() wasn't
	used or exported. Make a bit more like the X11 version. Hopefully
	I didn't break the fragile palettized display ("pseudocolor")
	code.

	* gdk/win32/gdkgc-win32.c: Various debugging output improvements.

	(predraw_set_foreground): Check whether
	tile/stipple origins are valid when calling SetBrushOrgEx().

	(gdk_win32_hdc_get): Ifdef out code that tries to handle the
	stipple by converting it into a region, and combining the clip
	region with that. A stipple shouldn't work like that, it should
	replicate in x and y directions. Stipples are now handled by
	generic_draw() in gdkdrawable-win32.c.

	* gdk/win32/gdkmain-win32.c: (gdk_win32_gcvalues_mask_to_string,
	gdk_win32_rop2_to_string): New debugging functions.

	(gdk_win32_print_dc): Print also DC's rop2 and text color.
2002-11-16 01:12:10 +00:00
Tor Lillqvist
e96a41be45 gdk/win32/gdkprivate-win32.h Rename all global variables and functions to
2002-11-12  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/*.c: Rename all global variables and functions to
	start with underscore.

	Merge from stable:

	More work on the Win32 backend. The cause of some scrolling
	problems was that SetWindowPos() and ScrollWindowEx() don't blit
	those parts of the window they think are invalid. As we didn't
	keep Windows's update region in synch with GDK's, Windows thought
	those areas that in fact had been updated were invalid. Calling
	ValidateRgn() in _gdk_windowing_window_queue_antiexpose() seems to
	be an elegant and efficient solution, removing from Windows's
	update region those areas we are about to repaint proactively.

	In some cases garbage leftover values were used for the clip
	origin in GdkGCWin32. This showed up as odd blank areas around the
	pixmaps included in the Text Widget in gtk-demo.

	Having the clip region either as a GdkRegion or a HRGN in
	GdkGCWin32 was unnecessary, it's better to just use a HRGN.

	The translation and antiexpose queue handling in
	gdkgeometry-win32.c seems unnecessary (and not implementable in
	the same way as on X11 anyway, no serial numbers) on Windows,
	ifdeffed out.

	Don't (try to) do guffaw scrolling as there is no static window
	gravity on Windows. Guffaw scrolling would be unnecessary anyway,
	as there is the ScrollWindow() API. This improves the behaviour of
	the Text Widget demo in gtk-demo a lot. But I have no idea how the
	lack of static win gravity should be handled in other places where
	the X11 code uses it. Especially _gdk_window_move_resize_child().

	There is still some problem in expose handling. By moving an
	obscuring window back and forth over testgtk's main window, for
	instance, every now and then you typically get narrow vertical or
	horizontal strips of pixels that haven't been properly redrawn
	after being exposed. A fencepost error somewhere?

	Otherwise, all of testgtk and gtk-demo except "big windows" now
	seem to work pretty well.

	Bug #79720 should be fixed now.

	* gdk/win32/gdkcolor-win32.c (gdk_win32_color_to_string,
	gdk_win32_print_paletteentries, gdk_win32_print_system_palette,
	gdk_win32_print_hpalette)
	* gdk/win32/gdkdrawable-win32.c (gdk_win32_drawable_description)
	* gdk/win32/gdkevents-win32.c (gdk_win32_message_name):
	Move all debugging helper functions to gdkmain-win32.c.

	* gdk/win32/gdkdrawable-win32.c (_gdk_win32_draw_tiles):
	Rewrite. Make static. Must take tile origin parameters, too.

	(gdk_win32_draw_rectangle): Pass the tile/stipple origin to
	_gdk_win32_draw_tiles(). Remove #if 0 code.

	(blit_inside_window): Don't call ScrollDC(), that didn't work at
	all like I thought. A simple call to BitBlt() is enough.

	* gdk/win32/gdkevents-win32.c (gdk_event_translate) Remove unused
	latin_locale_loaded variable.

	(_gdk_win32_get_next_tick): New function. Used to make sure
	timestamps of events are always increasing, both in events
	generated from the window procedure and in events gotten via
	PeekMessage(). Not sure whether this is actually useful, but it
	seemed as a good idea.

	(real_window_procedure): Don't use a local GdkEventPrivate
	variable. Don't attempt any compression of configure or expose
	events here, handled elsewhere.

	(erase_background): Accumulate window offsets when traversing up
	the parent chain for GDK_PARENT_RELATIVE_BG, in order to get
	correct alignment of background pixmaps. Don't fill with
	BLACK_BRUSH if GDK_NO_BG.

	(gdk_event_get_graphics_expose): A bit more verbose debugging output.

	(gdk_event_translate): Use _gdk_win32_get_next_tick(). In the
	WM_PAINT handler, don't check for empty update rect. When we get a
	WM_PAINT, the update region isn't empty. And if it for some
	strange reason is, that will be handled later anyway. Call
	GetUpdateRgn() before calling BeginPaint() and EndPaint() (which
	empty the update region).

	* gdk/win32/gdkdnd-win32.c
	* gdk/win32/gdkinput-win32.c:
	Use _gdk_win32_get_next_tick().

	* gdk/win32/gdkfont-win32.c: Use %p to print HFONTs.

	(gdk_text_size): Remove, unused.

	* gdk/win32/gdkgc-win32.c:  Set clip origins to zero
	when appropriate.

	(gdk_gc_copy): Increase refcount on colormap if present.

	(gdk_win32_hdc_get): Handle just hcliprgn. If we have a stipple,
	combine it with clip region after selecting into the DC.

	(_gdk_win32_bitmap_to_hrgn): Rename from _gdk_win32_bitmap_to_region.

	(_gdk_win3_gdkregion_to_hrgn): New function, code snippet
	extracted from gdk_win32_hdc_get().

	* gdk/win32/gdkgeometry-win32.c: Ifdef out the translate_queue
	handling.

	(gdk_window_copy_area_scroll): Increase clipRect to avoid
	ScrollWindowEx() not scrolling pixels it thinks are invalid.
	Scroll also children with the ScrollWindowEx() call. No need to
	call gdk_window_move() on the children.

	(gdk_window_scroll): Don't do guffaw scrolling.

	(gdk_window_compute_position): Fix typo, used win32_y where x was
	intended.

	(gdk_window_premove, gdk_window_postmove,
	gdk_window_clip_changed): Add debugging output.

	(_gdk_windowing_window_queue_antiexpose): Just call ValidateRgn()
	on the region.

	(_gdk_window_process_expose): No use for the serial number
	parameter now. Instead of a rectangle, take a region parameter, as
	Windows gives us one in WM_PAINT.

	* gdk/win32/gdkmain-win32.c (_gdk_win32_lbstyle_to_string,
	_gdk_win32_pstype_to_string, _gdk_win32_psstyle_to_string,
	_gdk_win32_psendcap_to_string, _gdk_win32_psjoin_to_string,
	_gdk_win32_rect_to_string, _gdk_win32_gdkrectangle_to_string,
	_gdk_win32_gdkregion_to_string): New debugging functions.

	(static_printf): Helper function for the above. sprintfs into a
	static circular buffer, return value should be used "soon".

	* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Plug memory
	leak, free list after use.

	(gdk_window_gravity_works): Remove, we know that there is no such
	thing on Windows.

	(gdk_window_set_static_bit_gravity,
	gdk_window_set_static_win_gravity): Ditto, remove, they didn't do
	anything anyway.

	(_gdk_windowing_window_init, gdk_window_foreign_new): Call
	_gdk_window_init_position() like in the X11 backend.

	(gdk_window_reparent): Don't call the now nonexistent
	gdk_window_set_static_win_gravity(). No idea what should be done
	instead.

	(gdk_window_get_geometry): The returned x and y should be relative
	to parent. Used to be always zero..

	(gdk_window_set_static_gravities): Return FALSE if trying to set
	static gravity.

	* gdk/win32/gdkprivate-win32.h: Drop the clip_region field from
	GdkGCWin32. Only use the HRGN hcliprgn. Declare new
	functions.

	* gdk/win32/*.c: Use new debugging functions.

	* gdk/win32/rc/gdk.rc.in: Update copyright year.
2002-11-12 22:17:48 +00:00
Tor Lillqvist
d8a4962708 Delete leftover declarations of the obsolete Win32-only functions
2002-09-20  Tor Lillqvist  <tml@iki.fi>

	* gdk/gdkfont.h: Delete leftover declarations of the obsolete
	Win32-only functions gdk_font_full_name_get() and
	gdk_font_full_name_free().

	* gdk/gdk.def: Delete from here, too.

	* gdk/win32/gdkfont-win32.c (logfont_to_xlfd,
	gdk_font_full_name_get, gdk_font_full_name_free): Delete
	implementation, and helper functions.

	(pattern_match, InnerEnumFontFamExProc, EnumFontFamExProc,
	gdk_font_list_new, gdk_font_list_free): Delete unused functions.

	(gdk_text_width, gdk_text_width_wc) Instead of code duplication,
	let gdk_text_extents() and gdk_text_extents_wc() do the job.

	* gdk/win32/gdkgc-win32.c (gdk_win32_gc_values_to_win32values):
	Don't use the above removed functions in debugging output.

	* gdk/win32/gdkdisplay-win32.c
	* gdk/win32/gdkmain-win32.c
	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkselection-win32.c
	* gdk/win32/gdkinput-win32.h
	* gdk/win32/gdkinput.c: Make it compile again, pass a GdkDisplay in
	a couple of places.
2002-09-19 23:27:10 +00:00
Owen Taylor
aeaaae04ac Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun  5 18:34:47 2002  Owen Taylor  <otaylor@redhat.com>

	Changes multihead reorganizing code for win32 support,
	mostly from a patch by Hans Breuer.

	* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
	  gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
	  gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
	  gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
	  gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
	  gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
	  gdk/x11/gdkpango-x11.c gdk/gdkselection.c
	  gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
	  gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
	  Move port-independent singlehead wrapper functions into
	  port-independent part of GDK. (#80009)

	* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
	  gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
	  gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
	  gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
	  gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
	Turn singlehead functions into "multihead" functions that ignore
	their GdkDisplay or GdkScreen arguments.

	* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
	gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
	Misc multihead-compatibility changes.

	* gtk/gtk.def gdk/gdk.def: Update for multihead functions.

	* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
	gdk/x11/gdkvisual-x11.c: Remove the screen fields
	from the public parts of the colormap/visual structures, add accessors
	instead.

	* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
	  gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
	  gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
	  gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
	for colormaps, visuals; move the fields into the private
	structures for the x11 backend.

	* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
	  gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
	Remove virtualization of screen and display functions.
	(#79990, patch from Erwann Chenede)

	* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
	gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
	New files containing stub implementations of Display,
	Screen functions.

	* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
	gdk/x11/gdkx.h: Clean up function exports and what
	headers they are in. (#79954)

	* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
	screen->screen_num. (In the patch for #79972, Erwann Chenede)

	* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
	 gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
	to use window hooks. (#79972, patch partly from Erwann Chenede)

	* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
	some warnings.
2002-06-06 00:26:42 +00:00
Hans Breuer
fe60d43a26 Fixed dashed line issues (#74441) to an IMO reasonable extend. That is:
2002-03-29  Hans Breuer  <hans@breuer.org>

	Fixed dashed line issues (#74441) to an IMO reasonable extend.
	That is: use PS_USERSTYLE on WinNT (the next GDI limit appears
	to be with lines width > 50); Render horizontal and vertical
	dashed lines on Win9x 'by hand'. Dotted selection rectangles
	and Dia look nice ...

	* gdk/win32/gdkprivate-win32.h : add pen_dashes pointer and
	num_pen_dashes to _GdkGCWin32
	* gdk/win32/gdkgc-win32.c : initialize pen_dashes and remove
	the guesses from dashes to windoze line styles.
	(predraw_set_forground) : always ExtCreatePen (PS_SOLID) on
	Win9x, which does not support PS_USERSTYLE.
	* gdk/win32/gdkdrawable-win32.c : new functions render_line_
	<horizontal|vertical>. Use them if not running on NT in
	gdk_win32_draw_<rectangle|segments|lines> ()

	* gdk/win32/gdkkeys-win32.c (gdk_keyval_name) : return NULL
	for keyval == 0 to avoid to have zeros in all menu entries
	without accelerator.
2002-03-28 23:25:33 +00:00
Tor Lillqvist
93fa867e14 Implement the functions that until now just were non-functional stubs. For
2002-02-26  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkkeys-win32.c: Implement the functions that until
	now just were non-functional stubs. For "hardware keycodes", we
	use Windows virtual keycodes. Not scancodes, although that at
	first might seem more low-level and a better match to X11
	keycodes.

	The Windows API is really mixed up and confused with respect to
	scancodes and virtual keycodes. (Surprised?) Some scancodes are
	generated by two keys on the keyboard (!), and although the
	keyboard messages do have a flag to indicate which key the user
	pressed, other API that take a scan code as input don't let you
	specify which actual key you mean.

	(update_keymap): Function to build a X11-like representation of
	the keyboard. Each key has four keysyms: two levels (nonshifted
	and shifted) and two groups (normal and with AltGr).

	(gdk_keymap_get_direction): Use the codepage corresponding to the
	thread's input locale, not the system codepage.

	* gdk/win32/gdkglobals-win32.c
	* gdk/win32/gdkmain-win32.c
	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkwindow-win32.h
	* gdk/win32/gdkwindow-win32.c: Remove the input_locale and
	charset_info fields from GdkWindowImplWin32. Input locale is
	per-thread in Windows, and as GDK on Windows really only works
	when the GDI interaction all happens in just one thread anyway,
	this state can be global. Use globals _gdk_input_locale and
	_gdk_input_codepage instead. Set these based on the thread's input
	locale (keyboard layout, or which IME is active).

	* gdk/win32/gdkevents-win32.c: Set the group and hardware_keycode
	fields in GDK key events. On input locale change messages, set
	the global state variables, and inform update_keymap() that it
	has to rebuild the keymap.
2002-02-26 01:18:27 +00:00
Tor Lillqvist
bc1ec5c14a Massive changes. Too many to list here, but I'll try a summary:
2002-02-17  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/*.c: Massive changes. Too many to list here, but I'll
	try a summary:

	1) Unify GdkPixmap and GdkImage implementation: For each
	GdkPixmap, allocate a GdkImage, and vice versa.
	GdkPixmapImplWin32Data has a pointer to the GdkImage.
	GdkImage::windowing_data is a pointer to the GdkPixmap.

	This simplifies many pixmap and image related functions a lot, and
	reduces duplicated code snippets. For instance, there is only one
	place in gdk/win32 where CreateDIBSection() is called, in the
	function _gdk_win32_new_pixmap(). Converting a bitmap (GdkPixmap)
	to a Windows region is almost trivial, with the bitmap bits being
	readily accessible in the associated GdkImage.

	All blitting between GdkPixmaps, GdkWindows and GdkImages goes
	through handled the _gdk_win32_blit() function, which calls
	different functions to handle the cases of blitting from pixmaps,
	inside windows (scrolling), or from windows, which all require
	somewhat different handling.

	2) Support 256-color mode. This has long been very broken, now it
	works more or less OK. Keep the logical palette for each colormap
	as small as possible while allocating and freeing colors. Select
	and realize the logical palette associated with a GdkColormap into
	a DC before drawing or blitting.

	When the display is in 256-color mode, make it possible for the
	user to override the size of the palette(s) used with either the
	GDK_WIN32_MAX_COLORS environment variable, or a -max-colors
	command line option. It is possible to reduce the palette size all
	the way down to using just the 16 static colors (which causes the
	system visual to be of type GDK_VISUAL_STATIC_COLOR. This could
	possibly be useful if one desperately wants to avoid color
	flashing. (Note that in order for this to work properly, an as of
	yet not commited fix to gdkrgb.c is needed.)

	Handle the palette messages. On WM_PALETTECHANGED, call
	UpdateColors() for the given window hierarchy. Do this only if a
	window in some other top-level window hierarchy caused the palette
	change (realized a palette). Do this max five times in a row (an
	arbitrarily chosen limit), though, otherwise redraw by generating
	expose events. On WM_QUERYNEWPALETTE, cause a redraw of the whole
	window hierarchy by generating GDK_EXPOSE events.

	3) Code cleanup in general. For instance, remove the "emulated"
	X11 structs ColormapStruct, Visual and XStandardColormap. Use the
	new GDK_DEBUG_* flags for debugging output in the relevant source
	files. Remove the unused colormap hash table in gdkcolor-win32.c

	4) Plug some resource leaks.

2002-02-14  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkdnd-win32.c (gdk_dropfiles_filter): Use
	g_filename_to_uri() to actually create legal URIs in the
	text/uri-list data.
2002-02-17 00:25:05 +00:00
Tor Lillqvist
1b7cff4755 Apply the same fixes and improvements as to the gtk-1-3-win32-production
2002-01-10  Tor Lillqvist  <tml@iki.fi>

	Apply the same fixes and improvements as to the
	gtk-1-3-win32-production branch: Bug fixes and cleanup of
	selection and DND functionality. Still doesn't work as well as the
	win32-production branch, though, but getting closer.

	After this, need to add Archaeopteryx Software's OLE2 DND support.

	* gdk/win32/gdkselection-win32.c (gdk_selection_owner_set,
	gdk_selection_send_notify, generate_selection_notify): Don't use
	SendMessage() to generate events for the same app, instead use
	gdk_event_put().

	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkglobals-win32.c
	* gdk/win32/gdkmain-win32.c
	* gdk/win32/gdkevents-win32.c: Thus, remove declaration, definition,
	initialisation and handling of gdk_selection_notify_msg,
	gdk_selection_request_msg and gdk_selection_clear_msg.

	* gdk/win32/gdkselection-win32.c (gdk_text_property_to_text_list,
	gdk_free_text_list, gdk_string_to_compound_text,
	gdk_free_compound_text): Implement trivially, witrh a text_list
	always having a single element, and a compound text always
	consisting of just a single (UTF-8!) string. Let's see how well
	this works.

	* gdk/win32/gdkselection-win32.c (gdk_selection_convert): Fix
	non-ASCII paste from the clipboard: Try getting the same formats
	from the Windows clipboard that gdk_property_change() puts there:
	CF_UNICODETEXT, UTF8_STRING or CF_TEXT+CF_LOCALE.

	* gdk/win32/gdkproperty-win32.c (gdk_property_change): When
	storing text on the clipboard, handle non-ASCII text
	correctly. The logic is as follows:

	If we have only ASCII characters, use CF_TEXT.

	Else, if we are on NT, use CF_UNICODETEXT.

	Else (we are on Win9x), if all the characters are present in the
	code page of some installed locale, use CF_TEXT and also set
	CF_LOCALE to that locale.

	Else (still on Win9x) store as RTF. We use a very simple RTF
	string, just the text, no fonts or other crap, with the non-ASCII
	characters as Unicode \uN keywords. Additionally, also store the
	UTF-8 string as such, under the format "UTF8_STRING", so that GDK
	can also paste from the Clipboard what it has copied there. (Thus
	no need to implement any RTF parser.)

	(find_common_locale): New function, implements the search for a
	locale for case 3 above.

	* gdk/win32/gdkglobals-win32.c: New global variables
	compound_text, text_uri_list, utf8_string, cf_rtf and
	cf_utf8_string.

	* gdk/win32/gdkim-win32.c (_gdk_ucs2_to_utf8): New function,
	converts from a wchar_t string to UTF-8.
	(_gdk_utf8_to_ucs2): Rename from _gdk_win32_nmbstowchar_ts.
	(_gdk_utf8_to_wcs): Rename from gdk_nmbstowchar_ts.

	* gdk/win32/gdkevents-win32.c (build_keypress_event): Use
	_gdk_ucs2_to_utf8().

	* gdk/win32/gdkselection-win32.c: Remove some unnecessary logging.

	* gdk/win32/gdkdnd-win32.c: Plug memory leaks, the
	gdk_drag_context_ref() was called unnecessarily in a couple of
	places, meaning drag contexts were never freed. The same memory
	leaks seem to be present in gdk/linux-fb/gdkselection-fb.c, BTW.

	(gdk_drop_reply): For WIN32_DROPFILES drops, free the temporarily
	stored file list.

	* gdk/win32/gdkselection-win32.c: Clarify the use of the
	sel_prop_table. Now it is used only for storing the GDK_SELECTION
	"properties".

	The file names dropped with WM_DROPFILES -style DND is stored
	temporarily (between the drop and the target picking them up) in a
	separate place.

	Have a separate hash table to map selection atoms to owner
	windows. This used to be quite mixed up.

	(_gdk_dropfiles_store): New function, to store the dropped file
	list for the drop target to possibly fetch, and clear it
	afterwards, from gdk_drop_reply().

	(gdk_selection_owner_get): Much simplified now.
2002-01-10 00:53:39 +00:00
Hans Breuer
ec81d4a8af need to cast image->mem away from void* to avoid 'error C2036: 'void *' :
2002-01-04  Hans Breuer  <hans@breuer.org>

	* gdk/gdkdraw.c gdk/gdkpixbuf-drawable.c :
	need to cast image->mem away from void* to avoid
	'error C2036: 'void *' : unknown size'. Doing pointer
	arithmetics on void pointers is a GCCism afaik.

	* gdk/gdkpixbuf-render.c : #include "gdkinternals.h" for
	_gdk_draw_pixbuf ()

	* gdk/makefile.msc gdk/win32/makefile.msc
        gdk/gtk/makefile.msc.in : use -FI msvc_recommended_pragmas.h

	* gdk/win32/gdkdrawable-win32.c : use _gkd_win32_copy_to_image
	and take care of image->visual possibly NULL.

	* gdk/win32/gdkimage-win32.c : implement _gdk_image_new_for_depth(),
	_gdk_win32_copy_to_image() and _gdk_windowing_bits_for_depth().
	Again take care of image->visual possibly NULL.

	* gdk/win32/gdkprivate-win32.h : declare _gdk_win32_copy_to_image()

	* gdk/win32/gdkevents-win32.c : use gdk_drawable_get_colormap
	instead of private field access

	* gdk/win32/gdkpixmap-win32.c (gdk_pixmap_new) : adapt
	colormap setting to the gdk-X behaviour
2002-01-05 19:07:13 +00:00
Tor Lillqvist
a53f14a6e3 New file, hand-written wrapper for the Wintab library.
2001-10-29  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/libwntab32x.la: New file, hand-written wrapper for the
	Wintab library.

	* gdk/win32/gdkwin32.h
	* gdk/win32/gdkprivate-win32.h: Reorganise to match corresponding
	X11 headers better, and to enable gdkwin32.h to be installed and
	included from applications, but not the *-win32.h headers.

	* gdk/win32/*.c: Corresponding small changes, simplifications of
	#includes.

	* gdk/win32/gdkregion-win32.c: Remove.

	* gdk/win32/gdkevents-win32.c (print_event): Add GDK_SETTING.

	* gdk/win32/gdkfont-win32.c
	* gdk/win32/gdkgeometry-win32.c: Remove unused variables.

	* gdk/win32/gdkproperty-win32.c (gdk_atom_intern): Don't insert
	GDK_NONE values into hash table.

	Changes for autoconfiscated build on Win32, and addition of Win32
	backend to the related files:

	* gdk/win32/Makefile.am: Actually enable building the win32
	objects here, not just list all files in EXTRA_DIST. Link in the
	compiled resource file from rc/gdk-win32res.lo. If HAVE_WINTAB,
	copy the Wintab library into the .libs directory.

	* gdk/win32/gdkwindow-win32.c (RegisterGdkClass): Don't assume the
	name of the GDK DLL when fetching the icon. Use the HMODULE saved
	in gdk_dll_hinstance by DllMain.

	* gdk/win32/rc/Makefile.am: Build gdk-win32res.lo using the
	build/win32/lt-compile-resource script.

	* gdk/win32/rc/gdk.rc.in
	* gtk/gtk-win32.rc.in: Use the DLL name that libtool would use.
2001-10-29 06:50:55 +00:00
Hans Breuer
93f12bd6d4 static correct-ness, underscore prefixing of library internal functions
2001-10-28  Hans Breuer  <hans@breuer.org>

	* gdk/gdk.c gdk/gdkevents.c
	  gdk/win32/gdkcolor-win32.c gdk/win32/gdkdnd-win32.c
	  gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
	  gdk/win32/gdkfont-win32.c gdk/win32/gdkgc-win32.c
	  gdk/win32/gdkim-win32.c gdk/win32/gdkmain-win32.c
	  gdk/win32/gdkprivate-win32.h gdk/win32/gdkproperty-win32.c
	  gdk/win32/gdkselection-win32.c gdk/win32/gdkwin32.h
	  gdk/win32/gdkwindow-win32.c gdk/win32/gdkwindow-win32.h :
	static correct-ness, underscore prefixing of library internal
	functions
	(applied the undisputed and the win32 part. Of the latter
	 I'm probably the one who will change it back again, if Owen
	 decides that the Gdk*Impl types should not be private to Gdk)

	* gdk/gdk.def : added the remaining exported functions
2001-10-28 21:28:51 +00:00
Owen Taylor
1bbf2ac7ee Make gdkx.h the only installed header from gdk/x11. All structures in
Fri Sep  7 11:51:44 2001  Owen Taylor  <otaylor@redhat.com>

      Make gdkx.h the only installed header from gdk/x11.
      All structures in gdk/x11 are opaque.

	* gdk/x11/Makefile.am gdk/x11/gdkx.h gdk/x11/gdkprivate-x11.h:
	Don't install gdk{drawable,pixmap,window}-x11.h.

	* gdk/x11/{gdkcolormap-x11.c, gdkfont-x11.c, gdkx.h, gdkvisual-x11.c:
	Move GdkColormapPrivateX11, GdkFontPrivateX GdkImagePrivateX11,
	GdkVisualClass into C files.

	* gdk/gdkpixmap-x11.[ch]: Make gdk_pixmap_impl_get_type() static.

	* gdk/x11/{gdkcolor-x11.c, gdkcursor-x11.c, gdkdrawable-x11.c,
	gdkfont-x11.c, gdkgc-x11.c, gdkx.h, gdkimage-x11,gdkvisual-x11.c}
	Add public functions to replace previously exported direct
	structure access.
	gdk_x11_colormap_get_{xdisplay,xcolormap}
	gdk_x11_cursor_get_{xdisplay,xcursor},
	gdk_x11_drawable_get_{xdisplay,xcursor,gdk_x11_visual_get_xvisual,
	gdk_x11_font_get_{xdisplay,xfont}, gdk_x11_image_get_{xdisplay,ximage},
	gdk_x11_gc_get_{xdisplay,ximage}

	* gdk/gdkprivate.h gdk/gdkinternals.h: Move GdkColorInfo,
	GdkEventFilter, GdkClientFilter, GdkFontPrivate to gdkinternals.

      Fix a number of variables and functions that were exported
      "accidentally" from GDK.

	* gdk/**.[ch]: gdk => _gdk for gdk_visual_init,
	gdk_events_init, gdk_input_init, gdk_dnd_init, gdk_image_exit,
	gdk_input_exit,	gdk_windowing_exit, gdk_event_func, gdk_event_data,
	gdk_event_notify, gdk_queued_events, gdk_queued_tail,
	gdk_event_new, gdk_events_queue, gdk_events_unqueue,
	gdk_event_queue_find_first, gdk_event_queue_remove_link,
	gdk_event_queue_append, gdk_event_button_generate,
	gdk_debug_flags, gdk_default_filters, gdk_parent_root.

	* gdk/x11/{gdkevents-x11.c, gdkglobals-x11.c, gdkimage-x11.c,
	   gdkmain-x11.c, gdkprivate-x11.h, gdk/x11/gdkwindow-x11.c}:
	gdk => _gdk for gdk_event_mask_table, gkd_nevent_masks,
	gdk_wm_window_protocols, gdk_leader_window, gdk_xgrab_window,
	gdk_use_xshm, gdk_input_ignore_core.

	* gdk/x11/xsettings-common.h (xsettings_list_insert): Add
	#defines to namespace functions into the private _gdk_
	namespace.

	* gdk/gdkwindow.[ch] gdk/x11/gdkx.h: Add gdk_get_default_root_window ()
	to replace gdk_parent_root exported variable. Adjust and
	deprecate GDK_ROOT_PARENT().

	* demos/{testpixbuf-drawable.c,testpixbuf-save.c}: Fix
	GDK_ROOT_PARENT usage, remove includes of port-specific
	headers.

	* gdk/{win32,x11,fb}/gdkinput*.[ch]: s/gdk/_gdk/ for
	_gdk_input_gxid_host, _gdk_input_gxid_port, _gdk_input_ignore_core,
	gdk_input_devices, _gdk_input_windows, gdk_init_input_core.

	* gdk/x11/{gdkevents-x11.,c gdkglobals-x11.c, gdkmain-x11.c}
	docs/Changes-2.0.txt: Remove gdk_wm_protocols,
	gdk_wm_delete_window functions, gdk_wm_take_focus,
	use gdk_atom_intern() instead.

	* gdk/linux-fb/{gdkselection-fb.c, gdkmain-fb.c, gdkprivatefb.h}
	  gdk/win32/{gdkselection-win32.c, gdkmgdkwin32.h, gdkprivate-win32.h}
	  gdk/x11/{gdkselection-x11.c gdkx.h, gtkprivate-x11.h}
	  gtk/gtkselection.c
        Unexport gdk_selection_property, just use
	gdk_atom_intern ("GDK_SELECTION").

	* gdk/x11/{gdkprivate-x11.h,gdkdrawable-x11h,gdkgc-x11.c,gdkx.h}:
	Unexport gdk_drawable_impl_x11_get_type, gdk_gc_x11_get_type,
	GDK_GC_X11 cast macros, GdkGCX11 structures, GdkCursorPrivate,
	GdkVisualprivate, gdk_x11_gc_flush.

      Make a number of public exports of variables into functions
      to increase encapsulation.

	* gdk/gdkinternals.h gdk/gdkinput.h gdk/gdkevents.h
	gdk/linux-fb/gdkmouse-fb.c: gdk_core_pointer => _gdk_core_pointer,
	move to gdkinternals.h. Add gdk_device_get_core_pointer ().

	* gdk/gdkprivate.h gdk/gdkpango.c gdk/gdkinternals.h
	docs/Changes-2.0.txt: Unexport gdk_parent_root, gdk_error_code,
	gdk_error_warnings.

	* gdk/x11/{gdkcolormap-x11.c, gdkmain-x11.c, gdkx.h}
	  docs/Changes-2.0.txt:
	s/gdk_screen/_gdk_screen/, add gdk_x11_get_default_screen()
	s/gdk_root_window/_gdk_root_window/, add gdk_x11_get_default_root_xwindow()
	Add gdk_x11_get_default_xdisplay().

	* gdk/gdk.h gdk/gdk.c linux-fb/gdkfb.h linux-fb/gdkglobals-fb.c
	win32/gdkwin32.h x11/gdkglobals-x11.c gdk/x11/gdkmain-x11.c
	gdk/x11/gdkx.h: gdk/gdk.def: Add gdk_get/set_program_class,
	Don't export gdk_progclass, move --class command line
	option and handling to common portion of GDK.

      Miscellaneous fixes:

	* gdk/x11/gdkwindow-x11.c (gdk_window_set_icon_list): Fix
	g_return_val_if_fail that should have been g_return_if_fail.

	* gdk/gdkinternals.h gdk/gdkprivate.h: Move
	gdk_synthesize_window_state() to the semi-public gdkprivate.h.

	* gtk/gtkdnd.c (_gtk_drag_source_handle_event): Remove uneeded
	X11 dependency.

	* gdk/linux-fb/gdkmain-fb.c gdk/win32/gdkmain-win32.c gdk/TODO:
	Remove unused gdk_key_repeat_disable/restore.

	* linux-fb/gdkglobals-fb.c win32/gdkglobals-win32.c
	x11/gdkglobals-x11.c x11/gdkprivate-x11.h gdk/gdk.def:
	Remove unused gdk_null_window_warnings variable.

	* gdk/Makefile.am (DIST_SUBDIRS) nanox/*: cvs remove nanox;
	it can be retrieved from the repository; it is too far
	from functional to be worth having people check out;
	it would be easier to start from scratch, I suspect.

	* gdk/x11/gdkpixmap-x11.c: Fix lvalue usage of GDK_PIXMAP_XID().

	* gdk/x11/gdkkeys-x11.c gdk/gdkrgb.c gdk/gdkwindow.c
	gdk/x11/gdkpango-x11.c gdk/x11/gdkselection-x11.c:
	Fix some accidentally global variables and unused global variables.

	* gdk/x11/gdkkeys-x11.c gdk/gdkrgb.c gdk/gdkwindow.c
	gdk/x11/gdkpango-x11.c gdk/x11/gdkselection-x11.c:
	Fix some accidentally global variables and unused global variables.

      Add some space for future expansion to multihead.

	* gdk/gdkdrawable.h: Add four reserved function pointers
	for future expansion of GdkDrawableClass.

	* gtk/gtkwindow.h gtk/gtkinvisible.h: Add reserved pointer
	where we can put a GdkScreen * later.
2001-09-07 21:50:20 +00:00
Hans Breuer
eed3dbb64c updated
2001-04-14  Hans Breuer  <hans@breuer.org>

	* gdk/gdk.def :
	* gdk/makefile.msc : updated

	* gdk/win32/gdkdrawable.win32 (gdk_win32_draw_rectangle) : if modus is
	"fill with tile" do so with new helper function	gdk_win32_draw_tiles
	(the testgtk::text backgound pixmap is drawn again)
	Changed SetTextAlign before pango_win32_render to TA_BASELINE to reflect
	Win32 Pango change
	* gdk/win32/gdkprivate-win32.h : prototype for gdk_win32_draw_tiles

	* gdk/win32/gdkproperty-win32.c : first implementation of gdk_setting_get
	Not sure if the returned settings have the right unit, because I couldn't
	find any docs for the X version ...

	* gtk/gtk.def :
	* gtk/makefile.msc.in : updated
2001-04-13 23:56:19 +00:00
Hans Breuer
0f6d1b4a27 updated
2001-03-10  Hans Breuer  <hans@breuer.org>

	* gdk/gdk.def : updated

	* gdk/win32/gdkgc-win32.c : pixmaps are visible again, due
	to offseting the clip_mask at the right place

	* gdk/win32/gdkwindow-win32.c : don't create background brushes
	for all the gdkClasses, especially not for the input_only case.
	Otherwise flickering wont be avoidable, because we don't get
	WM_ERASEBKGND message for these windows.

	* gdk/win32/gdkevents-win32.c : initialize event->expose.region
	and fixed massive redraw problems apparently triggered by Alexanders
	recent change. Not fully understood the GDK_EXPOSE / WM_PAINT handling
	but it seems to work quite well :-)

	* gdk/win32/gdkprivate-win32.h : added _gdk_window_process_expose
	prototype
2001-03-10 18:13:03 +00:00
Tor Lillqvist
22a0c3a5f5 gdk/gdk.def Update.
2000-11-11  Tor Lillqvist  <tml@iki.fi>

	* gdk/gdk.def
	* gtk/gtk.def: Update.

	* gdk/win32/*.c: Add last argument to g_type_register_static()
	calls.

	* gdk/win32/gdkwindow-win32.c: Silence gcc -Wall.

	* gdk/win32/gdkevents-win32.c: Handle MSH_MOUSEWHEEL messages
	generated by older wheel mouse drivers. Get the correct y
	coordinate from WM_MOUSEWHEEL messages.

	* gdk/win32/gdkgc-win32.c (gdk_win32_cap_style_to_string,
	gdk_win32_fill_style_to_string, gdk_win32_function_to_string,
	gdk_win32_join_style_to_string, gdk_win32_line_style_to_string):
	Debugging functions.

	* gdk/win32/gdkprivate-win32.h: Declare them.

	* gdk/win32/gdkinput-win32.h: Add declaration for
	gdk_input_window_destroy().

	* gtk/makefile.mingw.in: Pass -DGTK_VERSION. Add gtktreemodel.o.

	* gdk_pixbuf.def: Add gdk_pixbuf_new_subpixbuf.
2000-11-11 18:39:57 +00:00
Tor Lillqvist
fb2127452a Include x11/gdkx.h only when building for X11.
2000-10-25  Tor Lillqvist  <tml@iki.fi>

	* gdk/gdkwindow.c: Include x11/gdkx.h only when building for X11.

	* gdk/win32/gdkdrawable-win32.c
	* gdk/win32/gdkimage-win32.c
	* gdk/win32/gdkprivate-win32.h: Corresponding changes as in the
	X11 backend.

	* gdk/win32/gdkcc-win32.c
	* gdk/win32/gdkcolor-win32.c
	* gdk/win32/gdkfont-win32.c
	* gdk/win32/gdkinput-win32.c
	* gdk/win32/gdkmain-win32.c
	* gdk/win32/gdkproperty-win32.c: Silence gcc -Wall.
2000-10-25 18:07:12 +00:00