Commit Graph

3139 Commits

Author SHA1 Message Date
Tor Lillqvist
03e4664a1c Thanks to Gabriele Greco:
2003-07-17  Tor Lillqvist  <tml@iki.fi>

	Thanks to Gabriele Greco:

	* gtk/gtkdnd.c (gtk_drag_source_handle_event): Actually use the
	intended cursor in the Win32 case.

2003-04-29  Tor Lillqvist  <tml@iki.fi>

	Thanks to Chisheng Huang:

	* gdk/win32/makefile.mingw: Include make.mingw from the GLib
	directory, like in the parent directory.

	* gdk/gdk.c (gdk_arg_debug_cb, gdk_arg_no_debug_cb): Bypass when
	not used (without G_ENABLE_DEBUG), to silence compiler
	warning.
2003-07-17 13:46:53 +00:00
Tor Lillqvist
ffb8606928 Fix hacks needed in the dimm.h check.
2003-03-06  Tor Lillqvist  <tml@iki.fi>

	* configure.in: Fix hacks needed in the dimm.h check.

	* gtk/gtkfilesel.c (gtk_file_selection_set_filename): UTF-8 fix.
2003-03-06 01:09:39 +00:00
Tor Lillqvist
d5927d43b1 Clean up. Instead of always skipping A: and B:, use GetDriveType() to skip
2003-02-09  Tor Lillqvist  <tml@iki.fi>

	* gtk/gtkfilesel.c (win32_gtk_add_drives_to_dir_list): Clean up.
	Instead of always skipping A: and B:, use GetDriveType() to skip
	removable drives. (#105654)
2003-02-09 21:40:19 +00:00
Tor Lillqvist
a9fb56f336 On Win32 with gcc, use either -fnative-struct or -mms-bitfields depending
2003-01-15  Tor Lillqvist  <tml@iki.fi>

	* configure.in: On Win32 with gcc, use either -fnative-struct or
	-mms-bitfields depending on gcc version.
2003-01-15 07:00:12 +00:00
Tor Lillqvist
0f1f73ec37 Remove fnmatch.h from here, too.
2003-01-15  Tor Lillqvist  <tml@iki.fi>

	* gtk/Makefile.am (gtk_c_sources): Remove fnmatch.h from here, too.
2003-01-15 06:56:58 +00:00
Tor Lillqvist
ab0b717cb8 Use UTF-8-clean version from GTK+ 2.2.0, with entry point _gtk_fnmatch().
2002-12-22  Tor Lillqvist  <tml@iki.fi>

	* gtk/fnmatch.c: Use UTF-8-clean version from GTK+ 2.2.0, with
	entry point _gtk_fnmatch(). One change: On Win32, casefold *all*
	characters, not just the ASCII ones.

	* gtk/fnmatch.h: Remove.

	* gtk/gtkprivate.h: Declate _gtk_fnmatch() here.

	* gtk/gtkfilesel.c: Change accordingly. Add some assertions to
	make sure that we don't confuse UTF-8 and system codepage
	strings. Remove CMPL_ERRNO_TOO_LONG handling, was never used.
2002-12-22 22:41:29 +00:00
Tor Lillqvist
94e6913a28 Initialise wintab_window as NULL. (gdk_input_exit): Don't unref
2002-12-21  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkinput-win32.c: Initialise wintab_window as NULL.
	(gdk_input_exit): Don't unref wintab_window if it is
	NULL. (#101005, Katsuhiro Okuno)
2002-12-21 16:39:48 +00:00
Tor Lillqvist
c2894650d6 Umm, I wonder where I got that code snippet from. Called ClientToScreen()
2002-12-19  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkwindow-win32.c (gdk_window_get_geometry): Umm, I
	wonder where I got that code snippet from. Called ClientToScreen()
	and ScreenToClient() with a RECT, although they take a POINT.

	(gdk_window_set_decorations, gdk_window_set_functions):
	Reimplement correctly. The GDK_DECOR_ALL and GDK_FUNC_ALL bits
	have interesting semantics, see the documentation in GTK+ 2.0.
	(#79036)
2002-12-19 00:17:13 +00:00
Tor Lillqvist
81add74bb2 When copy-pasting bugfix from 2.0, forgot to change to change some names
2002-12-15  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkwindow-win32.c (gdk_window_get_geometry): When
	copy-pasting bugfix from 2.0, forgot to change to change some
	names that are different here in 1.3.0.
2002-12-15 05:11:53 +00:00
Tor Lillqvist
219c35fdd5 If we are asked for "courier", try "Courier New" instead right away.
2002-11-27  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkfont-win32.c (gdk_font_load_internal): If we are
	asked for "courier", try "Courier New" instead right
	away. Otherwise (as there is no TrueType font called just
	"courier"), Windows might well decide to match some unsuitable
	font. For instance, after I installed the Code2000 font, Windows
	started returning that when trying to load (a nonexistent)
	"courier" font at certain sizes, which didn't look good at all.
	To clarify code, always allocate lpszFace dynamically, and free it
	each round through the loop.

	* gtk/gtkmain.c (check_sizeof_GtkWindow): Also mention -mms-bitfields.

	* gtk/gtktext.c (draw_line_wrap): As stippled drawing is not
	implemented on Win32 in this version of GTK+, don't try to draw a
	stippled rectangle (as it would appear as an ugly filled
	rectangle). Draw a small solid triangle instead, either pointing
	left-down or right depending on whether lines are wrapped or
	truncated. (#35850, J. Ali Harlow)
2002-11-27 04:43:54 +00:00
Tor Lillqvist
5b4a8842e7 Do include docs. (EXTRA_DIST): Include config.h.win32.
2002-11-03  Tor Lillqvist  <tml@iki.fi>

	* Makefile.am (SUBDIRS): Do include docs.
	(EXTRA_DIST): Include config.h.win32.

	* configure.in: Must call AM_CONDITIONAL for XINPUT_GXI and
	XINPUT_XFREE (setting them to falce) also in the win32 branch.

	* gdk/gdkdnd.h: Fix lint, put the "extra tokens" inside comment
	after the #endif.

	* gdk/win32/gdkdrawable-win32.c: A couple of logging fixes.

	* gdk/win32/gdkevents-win32.c (gdk_event_translate):
	WM_SYSKEYDOWN, WM_SYSKEYUP: Need to handle F10 specially here in
	order to be able to handle it normally in the application.

	* gdk/win32/gdkpixmap-win32.c: Minor logging changes.

	* gdk/win32/gdkwindow-win32.c (gdk_window_get_geometry): Return
	the window's coordintes relative to the *parent*.

	* gtk/gtkmain.c (gtk_init_check): Don't need to call
	bind_textdomain_codeset() for glib20, GLib handles that itself.
2002-11-03 15:43:56 +00:00
Tor Lillqvist
f61dffae75 If the font supports Latin scripts, assume it has the currency symbols,
2002-10-04  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkfont-win32.c (gdk_font_load_internal): If the font
	supports Latin scripts, assume it has the currency symbols, even
	if the fsUsb doesn't say so. At least for Arial this is true, it
	contains the Euro sign. This is a gross hack, but better than the
	Euro not showing up even though the font does contain it.
2002-10-03 21:16:02 +00:00
Tor Lillqvist
f86b1a57fe Fix from gtk-1-2: Tue Feb 13 13:56:58 2001 Owen Taylor
2002-09-21  Tor Lillqvist  <tml@iki.fi>

	* gtk/gtktext.c (find_char_width): Fix from gtk-1-2: Tue Feb 13
	13:56:58 2001 Owen Taylor <otaylor@redhat.com> Fix problems with
	characters < 256 in wide character locales. (Patch from Yoichi
	Imai.)
2002-09-21 20:47:18 +00:00
Tor Lillqvist
ad0fd37b31 Fix typo, actually do check each char, not just the first one, as looping
2002-09-05  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkproperty-win32.c (gdk_property_change): Fix typo,
	actually do check each char, not just the first one, as looping
	through the text looking to insert CR in front of LF. Bug noticed
	and fix by Florent Duguet.
2002-09-04 21:03:36 +00:00
Tor Lillqvist
f139bcb69d Let the system handle Alt-Space, too. Thanks to Tim Evans (#91477).
2002-08-24  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkevents-win32.c (gdk_event_translate): Let the
	system handle Alt-Space, too. Thanks to Tim Evans (#91477).

	Fix for #81831 by Tim Evans:

	* gdk/win32/gdkevents-win32.c (gdk_event_translate): Don't call
	_gdk_event_button_generate() here, it would append the double- or
	triple-click events too early, before the single-click event.

	(inner_window_proc): If we got a single-click event, call
	_gdk_event_button_generate() to perhaps append the double- or
	triple-click event after that.
2002-08-24 20:57:52 +00:00
Tor Lillqvist
8a1457e100 Use GetSystemMetrics (SM_C[XY]SCREEN) instead of
2002-08-01  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkinput-win32.c (gdk_input_init): Use
	GetSystemMetrics (SM_C[XY]SCREEN) instead of
	gdk_screen_{width,height}().

	* gtk/gtkmain.c (gtk_init_check): Call bind_textdomain_codeset()
	also for glib20.
2002-07-31 21:48:45 +00:00
Tor Lillqvist
3a2d421feb Remove gtk+.spec stuff, not needed in this (Win32 only) branch.
2002-08-01  Tor Lillqvist  <tml@iki.fi>

	* Makefile.am: Remove gtk+.spec stuff, not needed in this (Win32
	only) branch.

	* gtk+-zip.sh: Use /tmp, not /g/tmp.

	* gdk/win32/gdkdrawable-win32.c: (gdk_win32_draw_segments,
	gdk_win32_draw_lines): Check for IS_WIN_NT before drawing end
	pixel separately, as already done in another place.
2002-07-31 21:43:01 +00:00
Tor Lillqvist
c58504d731 Fix for problem reported by Mark Raine: When Windows is set up not to have
2002-08-01  Tor Lillqvist  <tml@iki.fi>

	Fix for problem reported by Mark Raine: When Windows is set up not
	to have any Explorer desktop (icons), dragging the mouse from a
	popped-down menu onto the "root" window causes a crash.

	* gdk/win32/gdkevents-win32.c (propagate): Check for parent being
	NULL before trying to propagate to it, and return FALSE in that
	case. (If parent is NULL, we are handling gdk_parent_root, and
	probably should have noticed that and bailed out earlier. But
	better late than never.)
	(synthesize_crossing_events): Check for curWnd being non-NULL
	before gdk_window_ref'ing it.
2002-07-31 21:36:38 +00:00
Tor Lillqvist
bafb577769 Backport from HEAD: Don't clear all of the pen_style, just the
2002-03-22  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Backport from
	HEAD: Don't clear all of the pen_style, just the PS_STYLE_MASK.
	Fixes at least the special case of one-pixel wide one-pixel on-off
	dotted lines, for instance as in ctrees. To fully implement
	generic X11 style dashed lines a major rewrite would be needed.
2002-03-21 22:48:46 +00:00
Tor Lillqvist
8471793f5f Don't use return value from GlobalSize() as length of string when calling
2002-03-20  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkselection-win32.c (gdk_selection_convert): Don't
	use return value from GlobalSize() as length of string when
	calling MultiByteToWideChar(). Pass -1 instead (zero-terminated
	string). Thanks to Iwasa Kazmi.
2002-03-19 22:24:58 +00:00
Tor Lillqvist
3c1bfb6ad2 Output the Makefiles in the build subdirectory.
2002-03-13  Tor Lillqvist  <tml@iki.fi>

	* configure.in: Output the Makefiles in the build subdirectory.

	* gdk/win32/Makefile.am (EXTRA_DIST): Move bdfcursor.c here, it is
	not part of the library sources.

	* gdk/gdkwindow.c (gdk_window_get_toplevel): Fix silly bug,
	actually return the toplevel found, not the original
	parameter. (Backport from HEAD.)

	* gdk/win32/gdkdnd-win32.c (gdk_drag_find_window): Use
	gdk_window_get_toplevel(), as it is the top-level windows that are
	registered for DND. This fixes drag-and-drop of layers from GIMP's
	L,C&P dialog to GIMP's toolbox, for instance.
2002-03-12 22:59:40 +00:00
Tor Lillqvist
5d6a12e109 In the bitmap case, use just the LSB of the pixel value.
2002-02-28  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkgc-win32.c (gdk_win32_colormap_color_pack): In the
	bitmap case, use just the LSB of the pixel value.
2002-02-28 00:18:14 +00:00
Tor Lillqvist
f4fdd9e262 Do accept window handle zero, as that is in fact HWND_DESKTOP.
2002-02-24  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkwindow-win32.c (gdk_window_foreign_new): Do accept
	window handle zero, as that is in fact HWND_DESKTOP.
2002-02-24 12:52:13 +00:00
Tor Lillqvist
b21c381532 WM_QUERYNEWPALETTE): Don't do anything if the system visual is static
2002-02-18  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkevents-win32.c
	(gdk_event_translate:WM_QUERYNEWPALETTE): Don't do anything if the
	system visual is static color, i.e. the user has told GDK to use
	just the 16 static colors. In that case no need to redraw
	anything, as the colors are static and by definition always
	correctly mapped in the system palette.
	(WM_PALETTECHANGED): Ditto, no need to call UpdateColors() either.

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

	* gdk/win32/gdkcolor-win32.c (free_colors): Less verbose debugging
	output.

	* gdk/win32/gdkevents-win32.c (gdk_event_translate:WM_PALETTE):
	Just check if it was *this* window that caused the palette change.
	This means that we call UpdateColors() also if window(s) under
	another top-level window of the same application has realized its
	palette.
2002-02-17 22:12:36 +00:00
Tor Lillqvist
cbb3b4e07d Depend on gtk.ico.
2002-02-16  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/rc/Makefile.am (gdk-win32res.lo): Depend on gtk.ico.

	* gdk/win32/rc/gtk.ico: Use the real GTK logo. Thanks to Jernej
	Simoncic for providing the multi-resolution .ico file.
2002-02-15 23:24:31 +00:00
Tor Lillqvist
4ea98cbe1a No need to create new images to scan with gdk_image_get(). Use the
2002-02-16  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap): No
	need to create new images to scan with gdk_image_get(). Use the
	GdkImage view of the GdkPixmap always present nowadays with the
	unified GdkPixmap-GdkImage implementation.

	* gdk/win32/rc/Makefile.am (gdk-win32res.lo): Depend on gtk.ico.

	* gdk/win32/rc/gtk.ico: Use the real GTK logo. Thanks to Jernej
	Simoncic for providing the nice multi-resolution .ico file.
2002-02-15 23:23:56 +00:00
Tor Lillqvist
84d9defe96 Fix memory overrun.
2002-02-15  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkdrawable-win32.c (gdk_win32_drawable_description):
	Fix memory overrun.
2002-02-14 23:49:10 +00:00
Tor Lillqvist
218386c7e6 Mention gdkinputprivate.h.
2002-02-14  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/Makefile.am (libgdk_win32_la_SOURCES): Mention
	gdkinputprivate.h.

	* 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-11  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkimage-win32.c (gdk_image_new_bitmap): Remove unused
	variable private.
2002-02-14 20:58:46 +00:00
Tor Lillqvist
f0532dc0de Add a couple of missing entry points.
2002-02-10  Tor Lillqvist  <tml@iki.fi>

	* gtk/gtk.def: Add a couple of missing entry points.

	* gdk/win32/gdkcolor-win32.c (gdk_colormap_free_colors): Don't
	unnecessarily use a GdkColormapPrivateWin32 pointer.

	* gdk/win32/gdkpixmap-win32.c (gdk_pixmap_create_from_data): Use
	gdk_win32_blit(), not gdk_draw_drawable().
2002-02-10 18:47:25 +00:00
Tor Lillqvist
b733ebda81 Remove the actually unused colormap_hash table and add_colormap() and
2002-02-09  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkcolor-win32.c: Remove the actually unused
	colormap_hash table and add_colormap() and remove_colormap()
	functions. Move the sync_colormap() function inline to the only
	place where it was called. (Its semantics didn't match the
	corresponding function on X11 anyway. On Windows the entries in a
	logical palette don't change behind the curtain. Logical palettes
	are private to the application.)

	* gdk/win32/gdkprivate-win32.h: Remove the now unnecessary
	include of <time.h>.
	(struct _GdkColormapPrivateWin32): Remove the now unused
	last_sync_time.
2002-02-08 23:41:13 +00:00
Tor Lillqvist
4b6c14f8de Some typos. 2002-02-06 01:04:23 +00:00
Tor Lillqvist
1c60270352 Forgot to mention one thing. 2002-02-06 00:56:34 +00:00
Tor Lillqvist
edf8e89542 A batch of changes mainly with improvements to 256-color mode. Add
2002-02-06  Tor Lillqvist  <tml@iki.fi>

	A batch of changes mainly with improvements to 256-color mode. Add
	possibility for the user to override size of palette used with
	either the GDK_WIN32_MAX_COLORS environment variable, or a
	-max-colors command line option. Plug some memory leaks.

	* gdk/gdkrgb.c: More debugging output added here and there, some
	very verbose. I tried hard to also come up with a color cube and a
	GdkRgbConvFunc that would use all the 16 static VGA colors if the
	visual is such, but no. Will have to make do with the 2x2x2 color
	cube in that case.

	(gdk_rgb_cmap_fail): Drop the message argument, instead use
	explicit GDK_NOTE calls before calling this function.

	(gdk_rgb_do_colormaps): Use G_N_ELEMENTS().

	(gdk_rgb_init): Use the 2x2x2 color cube only for depths 3 and 4.
	Check return value from gdk_rgb_do_colormaps(), call g_error() if
	fails.

	(gdk_rgb_convert_4_pack): New GdkRgbConvFunc, for 4 bits-per-pixel
	static color visuals.

	(gdk_rgb_select_conv): Use correct bpp for 4 < depth < 8. Choose
	gdk_rgb_convert_8() also for depth < 8. Choose
	gdk_rgb_convert_4_pack() when bpp == depth == 4. Call g_error() if
	no suitable conv function was found.

	* gdk/win32/gdkcolor-win32.c: Minor debugging output
	changes. Remove #if 0 code.

	(create_colormap): If the visual indicates the static 16 VGA
	colors only, use only those in the palette (and not the four
	colors in the middle of the default palette).

	* gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap):
	Debugging output improvements.

	* gdk/win32/gdkdrawable-win32.c (gdk_win32_blit): New function,
	bulk of code from the old gdk_win32_draw_drawable(), with one
	extra parameter use_fg_bg to indicate whether to use the fg and bg
	pixel values (indexes) from the GC when blitting from bitmaps, or
	0 and 1. The values from the GC are used only when being called
	from gdk_image_put(). (Compare to XCopyArea(), XGetImage() and
	XPutImage().)

	Plug memory leak: always delete the outside_rgn HRGN.

	(gdk_win32_draw_drawable): Just call gdk_win32_blit().

	(blit_from_pixmap, blit_inside_window, blit_from_window): New
	functions, containing code sections moved out from (what is now)
	gdk_win32_blit().

	(blit_from_pixmap): Gets passed the use_fg_bg parameter of
	gdk_win32_blit(). Call gdk_win32_clear_hdc_cache_for_hwnd() for
	the source bitmap to make sure it isn't selected into a DC in the
	DC cache. Combine the branches for 1-bit and 8-bit bitmaps: Set
	the source DIB section's color table appropriately before calling
	BitBlt(), restore afterwards.

	* gdk/win32/gdkgc-win32.c: Only cosmetics and debugging output changes.

	* gdk/win32/gdkglobals-win32.c: New global variable: gdk_max_colors.

	* gdk/win32/gdkimage-win32.c (gdk_image_get): Call
	gdk_win32_blit() with use_fg_bg FALSE.

	(gdk_image_get_pixel, gdk_image_put_pixel): Handle depth == 4 case
	(two packed pixels per byte).

	* gdk/win32/gdkmain-win32.c: New command-line option -max-colors.

	* gdk/win32/gdkpixmap-win32.c (setup_pixmap_image): Handle also
	depths 4, 5, 6 and 7, with depth 4 meaning two pixels per byte,
	and 5, 6 and 7 meaning one pixel per byte, but restricting pixel
	values to said number of bits.

	(gdk_win32_pixmap_new, showpixmap): Ditto.

	* gdk/win32/gdkprivate-win32.h: Declate gdk_win32_blit() and
	gdk_max_colors.

	* gdk/win32/gdkselection-win32.c (gdk_text_property_to_text_list): Fix lint.

	* gdk/win32/gdkvisual-win32.c (gdk_visual_init): Look for a
	GDK_WIN32_MAX_COLORS environment variable, and check the
	gdk_max_colors variable possibly set by the command-line
	option. They can be used to override the number of colormap
	entries for 256-color "pseudocolor" mode. Set depth of visual
	accordingly. If restricted to 16-color, say it's "static
	color". Call gdk_rgb_min_colors() with an appropriate value for
	the restricted colormaps.

	* gdk/win32/gdkwindow-win32.c (gdk_window_shape_combine_mask):
	Plug memory leak: Delete temporary HRGN after use.
2002-02-06 00:44:30 +00:00
Tor Lillqvist
68a50d31a2 Don't square the diffs of the colour components before summing, might
2002-01-28  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkcolor-win32.c (match_color): Don't square the diffs
	of the colour components before summing, might overflow. Use sum
	of absolute diffs like in the X11 backend. Rename the max variable
	to min, as it tracks the minimum sum, not maximum...

	(alloc_color): Mimic XAllocColor() better: do return false if
	failure, don't just use the closest entry. It's the callers who
	then search for a best match if necessary.

	(free_colors): If we have freed the last entry or entries in the
	palette, resize the palette down. Mark unused palette slots in the
	middle with PC_EXPLICIT so that they won't be matched and realized
	unnecessarily, worsening the colour flashing. (This is just a
	hunch, haven't done any actual testing to confirm that this
	helps.)

	(alloc1, gdk_colormap_alloc_colors): Handle failure from
	alloc_color() like failure from XAllocColor() in the X11 backend.

	(alloc_private): Fix logic a bit in the case when the colour will
	fit in the colormap. Set the entry in the colormap's color table,
	too, if we successfully changes one palette entry.

	(alloc_shared): Typo fix backported from HEAD.
2002-01-28 00:19:20 +00:00
Tor Lillqvist
c01594a97c Remove declaration of gdk_image_bitmap_new(), the fuinction was removed
2002-01-27  Tor Lillqvist  <tml@iki.fi>

	* gdk/gdkimage.h: Remove declaration of gdk_image_bitmap_new(),
	the fuinction was removed already earlier.

	* gdk/win32/gdkdrawable-win32.c: Make gdk_win32_draw_drawable()
	public (but not exported from DLL).

	* gdk/win32/gdkgc-win32.c (gdk_win32_colormap_color_unpack):
	Remove unused variables. Don't return value from void function.

	* gdk/win32/gdkimage-win32.c: (gdk_image_get): Simplify by using
	gdk_win32_draw_drawable.
	(gdk_image_put): Use gdk_win32_draw_drawable() directly instead of
	gdk_draw_drawable().
	(gdk_image_get_pixel): Call GdiFlush(). Cosmetics.
	(gdk_image_put_pixel): Call GdiFlush().

	* gdk/win32/gdkpixmap-win32.c: (showpixmap): Improve this verbose
	debugging function (which isn't even compiled normally, though).

	* gdk/win32/gdkprivate-win32.h: Declare gdk_win32_draw_drawable().
2002-01-27 21:37:30 +00:00
Tor Lillqvist
8bb8d2e7f1 Unify GdkPixmap and GdkImage implementation: For each GdkPixmap, allocate
2002-01-27  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkprivate-win32.h: Unify GdkPixmap and GdkImage
	implementation: For each GdkPixmap, allocate a GdkImage, and vice
	versa. GdkDrawableWin32Data has a pointer to the GdkImage.
	GdkImagePrivateWin32 has a pointer to the GdkPixmap. Declare new
	and renamed functions (see below).

	* gdk/win32/gdkcolor-win32.c (gdk_colormap_alloc_colors): Cosmetics.

	* gdk/win32/gdkdrawable-win32.c	(gdk_win32_drawable_type_to_string,
	gdk_win32_drawable_description): New debugging functions.
	(gdk_win32_draw_drawable): Revamp the from-pixmap case: Use
	foreground and background in the GC correctly when drawing
	bitmaps. (The 0 bits select the background, the 1 bits the
	foreground.) Still need to handle blitting from 8-bit pixmaps in
	general correctly: Now we let the BitBlt convert colours (if it
	thinks that is necessary), we should change the colour table of
	the source to match that of the destination before blitting, so
	that just the indexes are copied, like X11 does.

	* gdk/win32/gdkgc-win32.c (gdk_win32_colormap_color_pack): Rename
	from gdk_colormap_color.
	(gdk_win32_colormap_color_unpack): New function, kinda inverse of
	gdk_win32_colormap_color_pack. Actually not used, though.
	(gdk_win32_bitmap_to_region): Simplify greatly, now that
	GdkPixmaps always have the DIB section bits available. Take a
	GdkPixmap parameter.

	* gdk/win32/gdkimage-win32.c: Change according to the
	GdkPixmap-GdkImage unification. Many function reduced a lot:
	(gdk_image_new_bitmap, gdk_image_new, gdk_image_get): Use
	gdk_win32_pixmap_new().
	(gdk_image_put): Use gdk_draw_drawable().

	gdk_image_get() should probably be changed to use
	gdk_draw_drawable(), too.

	* gdk/win32/gdkinput-win32.c: Fix problems if !HAVE_WINTAB_H.

	* gdk/win32/gdkpixmap-win32.c: Change according to the
	GdkPixmap-GdkImage unification.
	(setup_pixmap_image): New function, initialises the GdkImage
	attached to a GdkPixmap.
	(gdk_win32_pixmap_new): New function, that handles all creations
	of the unified GdkPixmap-GdkImage DIB section. Yes, only one call
	to CreateDIBsection() left in the code.
	(_gdk_pixmap_create_from_xpm): No need to create the resulting
	pixmap separately and gdk_draw_image() into it. Just use the
	GdkPixmap view of the GdkImage that we have been storing pixels
	into.

	* gdk/win32/gdkvisual-win32.c (gdk_visual_init): Don't error out
	if on palettized display any longer.

2002-01-24  Tor Lillqvist  <tml@iki.fi>

	* gdk/gdkpixmap.h: Remove gdk_pixmap_create_on_shared_image()
	declaration.
2002-01-27 04:11:59 +00:00
Tor Lillqvist
53f7005ca6 Committing now to get a huge amount of changes checked in. There might be
2002-01-24  Tor Lillqvist  <tml@iki.fi>

	Committing now to get a huge amount of changes checked in. There
	might be some silly debugging printouts left, or stuff like
	that. But everything does seem to work as well as before. Much
	cleanup and refactoring still do to.

	* gdk/gdkprivate.h: There is no gdk_debug_level variable.

	* gdk/gdkimage.h (enum GdkImageType): Remove GDK_IMAGE_SHARED_PIXMAP.
	Was used by the long abandoned gdk-imlib port.

	* gdk/gdk.def
	* gdk/win32/gdkimage-win32.c
	* gdk/win32/gdkpixmap-win32.c: Remove gdk_image_bitmap_new() and
	gdk_pixmap_create_on_shared_image() which also were used only by
	the gdk-imlib port.

	* gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap): Add
	verbose debugging output of the source and mask images.

	* gtk/Makefile.am: Let gtk-win32res.lo depend on gtk.def and the
	libgtk_la_OBJECTS.

	* gtk/gtk.def: Export the private (but still used by some apps)
	_gtk_private_signals and _gtk_private_n_signals. Re-sort the file.

	* gtk/gtkfilesel.c: Silence some gcc -Wall warnings.

	* gtk/gtkmain.c: If we HAVE_BIND_TEXTDOMAIN_CODESET, tell libintl
	to use UTF-8.

2002-01-22  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkgc-win32.c (gdk_colormap_color): For (single-bit
	depth) bitmaps (recognized by having a null colormap), use
	DIBINDEX.

	* gdk/win32/*.c: Always use format %p instead of %#x in debugging
	output of GDI HANDLEs.

2002-01-21  Tor Lillqvist  <tml@iki.fi>

	Big cleanups and fixes to 256-colour mode: Too many changes to
	list here in detail, partial list below. All GIMP features now
	seem to work as previously in 16- and 32-bit colour mode, plus
	also in 256-colour mode.

	The Win32 pixmap and image code is still very ugly. Lots of
	duplicated code snippets that create DIB sections, select and
	realize palettes, etc. Now when I finally got 256-colour mode
	working, I really need to go through the code and factorize out
	such common snippets.

	Probably it would be a good idea to keep the pointer to the DIB
	section's pixels also for GdkPixmaps, and not just GdkImages
	(where it of course is visible to the application, even). Maybe
	even have a GdkImage struct as such as a part of the private data
	for Win32 GdkPixmaps? Having the pixel data accessible would
	simplify gdk_win32_bitmap_to_region() a lot. Perhaps
	gdk_image_get() and _put() between pixmaps and images, too, and
	maybe even gdk_win32_draw_drawable(). We could skip all the HDC
	and palette setup and the BitBlt, and just copy the bits
	ourselves. Hmm. It might seem silly to roll your own BitBlt, but
	if we did that, we wouldn't have to bother about HDCs and palettes
	at all when blitting between bitmaps (pixmaps and/or images).
	OTOH, when blitting to/from a window, we still would need the
	palette setup. Maybe just some nice refactoring.

	* gdk/win32/gdkprivate-win32.h: Remove definitions of the X11
	structs ColormapStruct, Visual and XStandardColormap.

	(GdkGCWin32Data): Add field holdpal to hold the previous palette
	selected into the DC.

	(GdkVisualPrivate): No need for a poiner to an X11 Visual
	emulating struct.

	(GdkWin32PalEntryState): New enum, describing the state of logical
	palette entries: static (the 20 static colours), available or in
	use.

	(GdkColormapPrivateWin32): Instead of the X11 emulation Colormap
	struct pointer, store the Windows logical palette HPALETTE
	directly here, plus its current size and the state of its entries.

	* gdk/win32/gdkcc-win32.c: Don't use the removed XStandardColormap
	or Visual structs.

	* gdk/win32/gdkcolor-win32.c: Rename static functions to shorter
	names. Add much debugging output.

	(create_colormap): As we implement both "shared" and "private"
 	colormaps identically on Win32, always allocate a Windows logical
 	palette containing the (presumably 20) static colours from the
 	system palette, marked as such.

	(gdk_win32_print_paletteentries, gdk_win32_print_system_palette,
 	gdk_win32_print_hpalette): New debugging functions.

	(gdk_colormap_free_colors): Instead of keeping two essentially
	identical functions "in sync" (this and gdk_colors_free()), build
	a table of the pixel values and call gdk_colors_free from here...

	* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_drawable): In
	256-colour mode, when blitting from a window, select and realize
	palette.

	* gdk/win32/gdkevents-win32.c (update_colors): New function. Call
	UpdateColors() on a window and all its descendants.

	(synthesize_expose_events_children): New function: Synthesize
	expose events for a window and all its descendants, in order to
	realize our palettes and redraw everything.

	(gdk_event_translate): Handle WM_QUERYNEWPALETTE: Call
	synthesize_expose_events_children().

	Handle WM_PALETTECHANGED: Call update_colors(), or if we have done
	that three times already (a randomly chosen limit), generate
	expose events.

	* gdk/win32/gdkwindow-win32.c (gdk_window_get_children):
	Implement, using EnumChildWindows().

2002-01-21  Tor Lillqvist  <tml@iki.fi>

	* gdk/gdkprivate.h: Add new flags to GdkDebugFlag:
 	GDK_DEBUG_COLORMAP, GDKRGB, GC, PIXMAP, IMAGE, INPUT and CURSOR.

	* gdk/gdk.c: Handle them.
	(gdk_init_check): Check also for '/'-delimited argv[0].

	* gdk/gdkrgb.c: Indentation fixups. Add some logging messages
 	using GDK_NOTE (GDKRGB, ...). Seg gdk_rgb_verbose if
 	GDK_DEBUG_GDKRGB is turned on.

	* gdk/win32/gdkcursor-win32.c
	* gdk/win32/gdkgc-win32.c
	* gdk/win32/gdkinput-win32.c
	* gdk/win32/gdkimage-win32.c
	* gdk/win32/gdkpixmap-win32.c: Use the new flags instead of MISC.

2002-01-13  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkgc-win32.c (get_bw_palette): New function, factored
	out from:
	(predraw_set_foreground, BitmapToRegion): Use it.

	* gtk/Makefile.am (gtk-win32res.lo): Depend on gtk.def and
	libgtk_la_OBJECTS.

	* gtk/gtk.def: Add _gtk_private_signals and _gtk_private_n_signals
	to really export them. Some applications apparently use these
	private variables.
2002-01-24 01:49:52 +00:00
Tor Lillqvist
39a6e943f5 Committing now to get a huge amount of changes checked in. There might be
2002-01-24  Tor Lillqvist  <tml@iki.fi>

	Committing now to get a huge amount of changes checked
	in. There might be some silly debugging printouts left, or
	stuff like that. But everything does seem to work as well as
	before. Much cleanup and refactoring still do to.

	* gdk/gdkprivate.h: There is no gdk_debug_level variable.

	* gdk/gdkimage.h (enum GdkImageType): Remove GDK_IMAGE_SHARED_PIXMAP.
	Was used by the long abandoned gdk-imlib port.

	* gdk/gdk.def
	* gdk/win32/gdkimage-win32.c
	* gdk/win32/gdkpixmap-win32.c: Remove gdk_image_bitmap_new() and
	gdk_pixmap_create_on_shared_image() which also were used only by
	the gdk-imlib port.

	* gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap): Add
	verbose debugging output of the source and mask images.

	* gtk/Makefile.am: Let gtk-win32res.lo depend on gtk.def and the
	libgtk_la_OBJECTS.

	* gtk/gtk.def: Export the private (but still used by some apps)
	_gtk_private_signals and _gtk_private_n_signals. Re-sort the file.

	* gtk/gtkfilesel.c: Silence some gcc -Wall warnings.

	* gtk/gtkmain.c: If we HAVE_BIND_TEXTDOMAIN_CODESET, tell libintl
	to use UTF-8.

2002-01-22  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkgc-win32.c (gdk_colormap_color): For (single-bit
	depth) bitmaps (recognized by having a null colormap), use
	DIBINDEX.

	* gdk/win32/*.c: Always use format %p instead of %#x in debugging
	output of GDI HANDLEs.

2002-01-21  Tor Lillqvist  <tml@iki.fi>

	Big cleanups and fixes to 256-colour mode: Too many changes to
	list here in detail, partial list below. All GIMP features now
	seem to work as previously in 16- and 32-bit colour mode, plus
	also in 256-colour mode.

	The Win32 pixmap and image code is still very ugly. Lots of
	duplicated code snippets that create DIB sections, select and
	realize palettes, etc. Now when I finally got 256-colour mode
	working, I really need to go through the code and factorize out
	such common snippets.

	Probably it would be a good idea to keep the pointer to the DIB
	section's pixels also for GdkPixmaps, and not just GdkImages
	(where it of course is visible to the application, even). Maybe
	even have a GdkImage struct as such as a part of the private data
	for Win32 GdkPixmaps? Having the pixel data accessible would
	simplify gdk_win32_bitmap_to_region() a lot. Perhaps
	gdk_image_get() and _put() between pixmaps and images, too, and
	maybe even gdk_win32_draw_drawable(). We could skip all the HDC
	and palette setup and the BitBlt, and just copy the bits
	ourselves. Hmm. It might seem silly to roll your own BitBlt, but
	if we did that, we wouldn't have to bother about HDCs and palettes
	at all when blitting between bitmaps (pixmaps and/or images).
	OTOH, when blitting to/from a window, we still would need the
	palette setup. Maybe just some nice refactoring.

	* gdk/win32/gdkprivate-win32.h: Remove definitions of the X11
	structs ColormapStruct, Visual and XStandardColormap.

	(GdkGCWin32Data): Add field holdpal to hold the previous palette
	selected into the DC.

	(GdkVisualPrivate): No need for a poiner to an X11 Visual
	emulating struct.

	(GdkWin32PalEntryState): New enum, describing the state of logical
	palette entries: static (the 20 static colours), available or in
	use.

	(GdkColormapPrivateWin32): Instead of the X11 emulation Colormap
	struct pointer, store the Windows logical palette HPALETTE
	directly here, plus its current size and the state of its entries.

	* gdk/win32/gdkcc-win32.c: Don't use the removed XStandardColormap
	or Visual structs.

	* gdk/win32/gdkcolor-win32.c: Rename static functions to shorter
	names. Add much debugging output.

	(create_colormap): As we implement both "shared" and "private"
 	colormaps identically on Win32, always allocate a Windows logical
 	palette containing the (presumably 20) static colours from the
 	system palette, marked as such.

	(gdk_win32_print_paletteentries, gdk_win32_print_system_palette,
 	gdk_win32_print_hpalette): New debugging functions.

	(gdk_colormap_free_colors): Instead of keeping two essentially
	identical functions "in sync" (this and gdk_colors_free()), build
	a table of the pixel values and call gdk_colors_free from here...

	* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_drawable): In
	256-colour mode, when blitting from a window, select and realize
	palette.

	* gdk/win32/gdkevents-win32.c (update_colors): New function. Call
	UpdateColors() on a window and all its descendants.

	(synthesize_expose_events_children): New function: Synthesize
	expose events for a window and all its descendants, in order to
	realize our palettes and redraw everything.

	(gdk_event_translate): Handle WM_QUERYNEWPALETTE: Call
	synthesize_expose_events_children().

	Handle WM_PALETTECHANGED: Call update_colors(), or if we have done
	that three times already (a randomly chosen limit), generate
	expose events.

	* gdk/win32/gdkwindow-win32.c (gdk_window_get_children):
	Implement, using EnumChildWindows().

2002-01-21  Tor Lillqvist  <tml@iki.fi>

	* gdk/gdkprivate.h: Add new flags to GdkDebugFlag:
 	GDK_DEBUG_COLORMAP, GDKRGB, GC, PIXMAP, IMAGE, INPUT and CURSOR.

	* gdk/gdk.c: Handle them.
	(gdk_init_check): Check also for '/'-delimited argv[0].

	* gdk/gdkrgb.c: Indentation fixups. Add some logging messages
 	using GDK_NOTE (GDKRGB, ...). Seg gdk_rgb_verbose if
 	GDK_DEBUG_GDKRGB is turned on.

	* gdk/win32/gdkcursor-win32.c
	* gdk/win32/gdkgc-win32.c
	* gdk/win32/gdkinput-win32.c
	* gdk/win32/gdkimage-win32.c
	* gdk/win32/gdkpixmap-win32.c: Use the new flags instead of MISC.

2002-01-13  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkgc-win32.c (get_bw_palette): New function, factored
	out from:
	(predraw_set_foreground, BitmapToRegion): Use it.

	* gtk/Makefile.am (gtk-win32res.lo): Depend on gtk.def and
	libgtk_la_OBJECTS.

	* gtk/gtk.def: Add _gtk_private_signals and _gtk_private_n_signals
	to really export them. Some applications apparently use these
	private variables.
2002-01-24 01:47:11 +00:00
Tor Lillqvist
260ed9f176 Add USE_OLE2_DND.
2002-01-24  Tor Lillqvist  <tml@iki.fi>

	* acconfig.h: Add USE_OLE2_DND.

	* configure.in: Add option --disable-ole2-dnd.

	* autogen.sh: Check for glib-2.0.m4 and glib-gettext.m4.
2002-01-24 01:40:41 +00:00
Tor Lillqvist
9306a53a50 Palettized mode improvements by Stephan R.A. Deibel
2002-01-12  Tor Lillqvist  <tml@iki.fi>

	Palettized mode improvements by Stephan R.A. Deibel
	<sdeibel@archaeopteryx.com>:

	* win32/gdkevents-win32.c (gdk_win32_erase_background)
	* win32/gdkgc-win32.c (gdk_colormap_color, predraw_set_foreground)
	* win32/gdkimage-win32.c (gdk_image_put): Improve support for
	palettized (256-colour) mode.

	* win32/gdkvisual-win32.c (gdk_visual_init): But still require the
	GDK_WIN32_ENABLE_BROKEN_PSEUDOCOLOR_VISUAL environment variable,
	as the palettized mode support is unusable for the GIMP, for
	instance (IMHO).

2002-01-12  Tor Lillqvist  <tml@iki.fi>

	* win32/gdkcolor-win32.c: Silence gcc -Wall. Mark
	gdk_colormap_sync() static.

	* gdk/win32/gdkdnd-win32.c: Silence gcc -Wall.
2002-01-12 01:25:34 +00:00
Tor Lillqvist
5c59e277ae Report failure to requestor also if we cannot handle the target asked for.
2002-01-12  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkselection-win32.c (gdk_selection_convert): Report
	failure to requestor also if we cannot handle the target asked
	for.

	* gdk/win32/gdkdnd-win32.c: Some indentation fixes.

	Applying more of the Archaeopteryx Software patches:

	* gdk/win32/gdkgc-win32.c (predraw_set_foreground): Better error
	checking.
2002-01-12 00:29:54 +00:00
Tor Lillqvist
cd14721291 gdk/win32/gdkprivate-win32.h gdk/win32/gdkglobals-win32.c
2002-01-09  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkglobals-win32.c
	* gdk/win32/gdkmain-win32.c
	* gdk/win32/gdkevents-win32.c: Remove declaration, definition,
	initialisation and handling of gdk_selection_notify_msg,
	gdk_selection_request_msg and gdk_selection_clear_msg. They aren't
	generated any longer.
2002-01-09 22:00:43 +00:00
Tor Lillqvist
9863dfa44c Use nifty macros. (print_event_mask): Remove, use event_mask_string().
2002-01-09  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkevents-win32.c (event_mask_string, print_event,
	print_event_state): Use nifty macros.
	(print_event_mask): Remove, use event_mask_string().

	* 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, always as
	single-element text list or single-component compound text.

2002-01-09  Tor Lillqvist  <tml@iki.fi>

	* 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.

2002-01-09  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkselection-win32.c (gdk_selection_owner_set)
	* gdk/win32/gdkselection-win32.c (gdk_selection_owner_get): Do
	support PRIMARY. Seems to work fine after all (intra-app).

2002-01-09  Tor Lillqvist  <tml@iki.fi>

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

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

	* gdk/win32/gdkmain-win32.c: Initialise them.

	* gdk/win32/gdkproperty-win32.c
	* gdk/win32/gdkselection-win32.c: Use them.

2002-01-09  Tor Lillqvist  <tml@iki.fi>

	* 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/gdkevents-win32.c (gdk_event_translate):
	Correspondingly, for the messages that shouldn't come in any
	longer, assert if one does. Will remove the
	gdk_selection_*_msg variables and handling code completely
	after a while.

2002-01-09  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkim-win32.c (gdk_nwchar_ts_to_mbs): New function,
	converts from a wchar_t string to UTF-8.

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

	* gdk/win32/gdkevents-win32.c (build_keypress_event): Use it.
2002-01-09 05:43:57 +00:00
Tor Lillqvist
62e41803eb Solve the Unicode issue with copying text to the Windows clipboard. (Still
2002-01-08  Tor Lillqvist  <tml@iki.fi>

	Solve the Unicode issue with copying text to the Windows
	clipboard. (Still need to add code for pasting from the
	clipboard. That will be easy, but I'm tired now.)

	* 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_property_delete): Don't declare gdk_selection_property_delete()
	here.

	* gdk/win32/gdkprivate-win32.h: Declare
	gdk_selection_property_delete() here instead.

	* gdk/win32/gdkselection-win32.c: Remove some unnecessary logging.
2002-01-08 00:21:13 +00:00
Tor Lillqvist
3247b1d687 Some bug fixes and cleanup of selection and DND functionality. Now
2002-01-06  Tor Lillqvist  <tml@iki.fi>

	Some bug fixes and cleanup of selection and DND functionality. Now
	cut&paste inside an application works again. Removed attempts at
	supporting the X11 PRIMARY selection -style cut&paste, can't be
	made to work correctly anyway, and is "non-Windowsish".

	There are still things that need to be fixed regarding the
	clipboard and DND:

	- Unicode issues. We currently bluntly store UTF-8 text as
	CF_TEXT, and expect CF_TEXT to be UTF-8. This is very wrong, just
	try to copy-paste non-ASCII text between a GTK+ app and Notepad,
	for instance. Instead we should use CF_UNICODETEXT if we are on
	NT. If on 9x, when storing into the clipboard, check if the string
	can be represented in a single code page, and in that case use
	that. Also, store CF_LOCALE data in the clipboard to (indirectly)
	indicate that code page.

	Problem: How to elegantly check what code page, if any, contains
	all the Unicode characters in a string? What if there is no such
	code page, don't store anything then?

	Problem: In order to store CF_LOCALE data, how does one find a
	language that uses the code page in question? Build a reverse
	mapping table once, use that?

	- Handling of non-text data in the clipboard. Not that I think
	any relevant GTK+ application even tries to handle much else
	than text on the clipboard?

	- Need to add Archaeopteryx Software's OLE2 DND support.

	* 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.

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

	* gdk/win32/gdkproperty-win32.c

	* gdk/win32/gdkselection-win32.c: Now we don't try to support the
	X11 PRIMARY selection -style cut&paste at all, it won't fit anyway
	in the Windows cut&paste model. Only support CLIPBOARD style
	cut&paste, which matches nicely with Windows Clipboard.

	Clear up 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.

	(sel_prop_store): Now static.

	(gdk_win32_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.

	* gdkprivate-win32.h: Declare gdk_win32_dropfiles_store.

	* gdkglobals-win32.c
	* gdkmain-win32.c: gdk_selection_property is a GdkAtom, not
	ATOM. Declare also text_uri_list_atom globally, initialise.

	* gdkwindow-win32.c: Some lint cleanup (ambiguous else, unused
	variables).
2002-01-06 02:04:43 +00:00
Tor Lillqvist
889863e454 Correct line endings. 2002-01-03 21:02:14 +00:00
Tor Lillqvist
293cde2040 Use G_N_ELEMENTS(). (unicode_classify): Don't fail with an assertion on
2001-12-28  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkfont-win32.c: Use G_N_ELEMENTS().
	(unicode_classify): Don't fail with an assertion on encountering
	an unclassified character, but punt and return U_BASIC_LATIN.
2001-12-28 21:40:58 +00:00
Tor Lillqvist
663b69cfa2 Lint cleanup.
2001-12-23  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/*.c: Lint cleanup.

	Changes contributed by Archaeopteryx Software: This is the
	first batch of their changes. Will commit more later.

	* gdk/gdk.def: Add gdk_add_client_message_filter.

	* gdk/gdkgc.c (gdk_gc_unref): Plug memory leak: g_free() the gc
	after calling the destroy function.

	* gdk/win32/*.c: Add more checks for failed GDI calls. If a call
	fails, don't use bogus values.

	* gdk/win32/gdkcursor-win32.c (_gdk_win32_data_to_wcursor): Plug
	memory leak: g_free() the AND and XOR bitmaps after use.
	(_gdk_cursor_destroy): Set the current cursor to none if we are
	destroying it.

	* gdk/win32/gdkevents-win32.c: Remove superfluous duplicate
	definition of client_filters.

	* gdk/win32/gdkwindow-win32.c (gdk_win32_window_destroy): If the
	window has a cursor, and it is the current cursor, before
	destroying it set the current cursor to none.
	(gdk_window_foreign_new): If the window id is 0, return NULL.
	(gdk_window_clear_area): Report ReleaseDC failure.
	(gdk_window_set_cursor): Also here, set current cursor to none if
	destroying the current cursor.
	(gdk_window_get_pointer): Revamp logic.
2001-12-23 01:03:45 +00:00
Tor Lillqvist
0a32e7a666 Fix handling of parent-relative background pixmaps. Thanks to Joel Baxter.
2001-11-25  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkevents-win32.c: Fix handling of parent-relative
	background pixmaps. Thanks to Joel Baxter. (Bug#56866)
	Remove lint. Remove unused GdkIOClosure stuff.
2001-11-24 23:56:52 +00:00
Tor Lillqvist
41ff22e71d Increment source_window refcount.
2001-11-15  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkdnd-win32.c (gdk_dropfiles_filter): Increment
	source_window refcount.
2001-11-15 00:08:14 +00:00