Commit Graph

58 Commits

Author SHA1 Message Date
Tor Lillqvist
d9d1a36c59 Replace all calls to g_strcasecmp() with g_ascii_strcasecmp().
2006-02-20  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkfont-win32.c: Replace all calls to g_strcasecmp()
	with g_ascii_strcasecmp().
2006-02-20 08:52:19 +00:00
J. Ali Harlow
3502a2a259 Make the last change compile.
2005-08-10  J. Ali Harlow  <ali@juiblex.co.uk>

        * gdk/win32/gdkfont-win32.c (gdk_font_from_description_for_display): Make
	the last change compile.
2005-08-10 11:02:29 +00:00
Owen Taylor
bfd04045e5 Strip out all Xft, FreeType, and pangoxft checking. Rewrite X checks to
2005-08-09  Owen Taylor  <otaylor@redhat.com>

        * configure.in: Strip out all Xft, FreeType, and pangoxft checking.
        Rewrite X checks to use pkg-config as much as possible.

        * gdk/win32/gdkfont-win32.c (gdk_font_from_description_for_display): Make
        this return Arial always to avoid using PangoWin32FontMap. (X11 backend
        has always been returned "fixed" for a long time)

        * gdk/linux-fb/gdkdrawable-fb2.c: Remove draw_glyphs() implementations,
        fall through to the default implementation in terms of Cairo.

        * gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_text): Use gdk_draw_glyphs()
        on the wrapper rather than gdk_fb_draw_glyphs()
2005-08-10 02:31:51 +00:00
Ivan, Wong Yat Cheung
e41ade967e Match character height instead of cell height. Fix #301228.
2005-04-19  Ivan, Wong Yat Cheung  <email@ivanwong.info>

	* gdk/win32/gdkfont-win32.c (gdk_font_load_internal): Match
	character height instead of cell height. Fix #301228.
2005-04-21 10:39:39 +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
Federico Mena Quintero
80581c3011 Fixes #136082 and #135265, patch by Morten Welinder.
2004-03-05  Federico Mena Quintero  <federico@ximian.com>

	Fixes #136082 and #135265, patch by Morten Welinder.

	* configure.in: Use AC_SYS_LARGEFILE.

	* */*.c: #include <config.h>
2004-03-06 03:38:59 +00:00
Tor Lillqvist
72d622fcf5 Add missing entries, thanks to J. Ali Harlow.
2004-03-05  Tor Lillqvist  <tml@iki.fi>

	* gdk/gdk.def: Add missing entries, thanks to J. Ali Harlow.

	* gdk/win32/gdkcursor-win32.c (color_is_white): const-correctness.

	(gdk_cursor_new_from_pixbuf): Copy of the non-Xcursor X11
	implementation.

	(gdk_display_supports_cursor_alpha,
	gdk_display_supports_cursor_color): Dummy implementations.

	(gdk_display_get_default_cursor_size,
	gdk_display_get_maximal_cursor_size): Implement.

	* gdk/win32/gdkdisplay-win32.c (gdk_display_get_default_group):
	Dummy implementation.

	* gdk/win32/gdkevents-win32.c (gdk_net_wm_supports): Dummy
	implementation.

	* gdk/win32/gdkfont-win32.c (gdk_font_get_display): Implement.

	* gdk/win32/gdkinput-win32.c (gdk_input_motion_events): Remove,
	not in API.

	* gdk/win32/gdkwindow-win32.c (gdk_window_get_group): Dummy
	implementation.
2004-03-05 23:26:07 +00:00
Tor Lillqvist
209dc33b3b gdk/gdk.def Add missing function, trivially implement.
2003-08-07  Tor Lillqvist  <tml@iki.fi>

	* gdk/gdk.def
	* gdk/win32/gdkfont-win32.c (gdk_fontset_load_for_display): Add
	missing function, trivially implement.
2003-08-07 03:30:38 +00:00
Matthias Clasen
d03b2741ad Trivial cleanups (bug #107664) 2003-03-08 20:49:00 +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
Matthias Clasen
5cc215cddf Remove redundant doc comments. 2002-10-23 21:03:35 +00:00
Manish Singh
234e191c1c add -DG_DISABLE_DEPRECATED and -DGDK_PIXBUF_DISABLE_DEPRECATED to compile
Wed Sep 25 00:16:53 2002  Manish Singh  <yosh@gimp.org>

        * gdk/Makefile.am gdk/x11/Makefile.am: add -DG_DISABLE_DEPRECATED
        and -DGDK_PIXBUF_DISABLE_DEPRECATED to compile flags

        * gdk/gdkcolor.c gdk/gdkdisplay.c gdk/gdkdraw.c gdk/gdkevents.c
        gdk/gdkgc.c gdk/gdkimage.c gdk/gdkpango.c gdk/gdkpixbuf-render.c
        gdk/gdkpixmap.c gdk/gdkrgb.c gdk/gdkwindow.c gdk/linux-fb/gdkdnd-fb.c
        gdk/linux-fb/gdkfont-fb.c gdk/win32/gdkdnd-win32.c
        gdk/win32/gdkfont-win32.c gdk/x11/gdkdisplay-x11.c gdk/x11/gdkdnd-x11.c
        gdk/x11/gdkdrawable-x11.c gdk/x11/gdkevents-x11.c gdk/x11/gdkfont-x11.c
        gdk/x11/gdkgc-x11.c gdk/x11/gdkgeometry-x11.c gdk/x11/gdkim-x11.c
        gdk/x11/gdkinput-x11.c gdk/x11/gdkkeys-x11.c gdk/x11/gdkscreen-x11.c
        gdk/x11/gdkwindow-x11.c: Deprecation cleanup, mostly changing
        gdk_foo_{ref,unref} to g_object equivalents.
2002-09-25 07:23:55 +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
28c2b0a31f Renames:
Thu Jun 20 19:41:09 2002  Owen Taylor  <otaylor@redhat.com>

        * gdk/gdkdisplay.h gdk/gdkscreen.h gdk/**.c gtk/*.c
        tests/*.c: Renames:

         gdk_get_default_display => gdk_display_get_default
         gdk_get_default_screen  => gdk_screen_get_default
         gdk_open_display        => gdk_display_open
2002-06-20 23:59:27 +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
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
Tor Lillqvist
12c7fc52d8 Use G_N_ELEMENTS(). (unicode_classify): Don't return -1 on encountering an
2001-12-28  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkfont-win32.c: Use G_N_ELEMENTS().
	(unicode_classify): Don't return -1 on encountering an
	unclassified character, but play it safe and return U_BASIC_LATIN.
2001-12-28 21:52:04 +00:00
Hans Breuer
36ddd7d958 reflect Pango API change
2001-11-23  Hans Breuer  <hans@breuer.org>

	* gdk/win32/gdkfont-win32.c (gdk_font_from_description) :
	reflect Pango API change

	* gtk/gtk.def : updated externals

	* gtk/gtkfixed.c (gtk_fixed_get_has_window) : use
	g_return_val_if_fail() to avoid 'function must return a value'

	* gtk/gtkrc.c : added spaces to fix small coding style issues
	* gtk/gtkwidget.c : ... and linebreaks. Also a static for
	'static correctness'

	* gtk/makefile.msc.in : temporary(?) disable gtk<plug|socket>
	because they only can be build on win32 after applying my patch
2001-11-23 16:05:39 +00:00
Hans Breuer
be3809f0ba use g_strcasecmp(), some poor platforms don't have strcasecmp()
2001-10-28  Hans Breuer  <hans@breuer.org>

	* gtk/gtkfontsel.c : use g_strcasecmp(), some poor platforms
	don't have strcasecmp()

	* gtk/gtktextview.c : to fix crashing on e.g. TextView::find need
	to remove the idle funcs in gtk_text_view_destroy (). To reduce
	code duplication wrap it in its own function and use it in
	gtk_text_view_unrealize () and gtk_text_view_destroy_layout ()

	* gdk/win32/gdkdrawable-win32.c : implement the finalize
	method like the X11 version does, allow to set_colormap NULL
	* gdk/win32/gdkwindow-win32.c : adapt GdkWindowImplWin32::
	set_colormap, also some adaption to X11 version :
	(gdk_window_hide) call _gdk_window_clear_update_area
	(gdk_window_reparent) call _gdk_window_init_position

	* gdk/win32/gdkwindow-win32.c (gdk_window_set_geometry_hints) :
	call gdk_window_resize() after all hints are set, because the
	window resizing process (WM_GETMINMAXINFO) takes all of them into
	account

	* gdk/win32/gdkfont-win32.c : make gdk_font_equal return a gboolean

	* gdk/win32/gdkvisual-win32.c : register GdkVisual with
	sizeof (GdkVisualPrivate)

	* gdk/gdk.def gtk/gtk.def : upated externals

	* gdk/makefile.msc gdk/win32/makefile.msc gdk-pixbuf/makefile.msc
	  gdk-pixbuf/pixops/makefile.msc gtk/makefile.msc.in tests/makefile.msc :
	from now on use make.msc from $(TOP)/glib/build/win32

	* gtk/stock-icons/makefile.msc : add stock_missing_image
2001-11-09 21:52:52 +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
Alexander Larsson
cdb59b8949 Update to the new pango win32 api.
2001-08-09  Alexander Larsson <alexl@redhat.com>

	* gdk/win32/gdkfont-win32.c:
	Update to the new pango win32 api.
2001-08-09 05:09:01 +00:00
Hans Breuer
da155bb731 build in the backend dir after auto-generating files
2001-07-29  Hans Breuer  <hans@breuer.org>

	* gdk/makefile.msc : build in the backend dir after
	auto-generating files

	* gdk/win32/gdkfont-win32.c (gdk_font_load) : reimplement
	with code from win32-production-branch.

	*  gdk/win32/gdkwindow-win32.c : set the private->destroyed flag
	before calling DestroyWindow, which indirectly calls
	gdk_window_destroy_notify ()

	(performance patch merged from win32-production-branch)
	* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_segments):
	Use PatBlt() instead of LineTo() when possible (solid single-pixel pen,
	R2_COPYPEN rop). It is claimed to be much faster.
2001-07-28 23:02:02 +00:00
Tor Lillqvist
18e95c4e0f Include <stdlib.h> for getenv().
2001-01-16  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkvisual-win32.c: Include <stdlib.h> for getenv().

	* gdk/win32/gdkevents-win32.c (gdk_event_translate): Don't use
	GDK_COLORMAP_PRIVATE_DATA on a potentially NULL GdkColormap.

	* gdk/win32/gdkfont-win32.c (gdk_font_load_internal): Adapt calls
	to g_{locale,filename}_{to,from}_utf8 to match current API.

	* gtk/makefile.msc.in (gtk_OBJECTS)
	* gtk/makefile.mingw.in (gtk_OBJECTS): Add gtkwindow-decorate.

	* gtk/gtk.def: Update.
2001-01-15 22:12:31 +00:00
Robert Brady
b17f1a964a g_filename_{to,from}_utf8 now takes an extra parameter.
Sun Nov 12 22:15:35 2000  Robert Brady  <robert@suse.co.uk>

	* gtk/gtkfileselection.c, gdk/win32/gdkfont-win32.c:
	g_filename_{to,from}_utf8 now takes an extra parameter.

	* gtk/gtkcalendar.c (gtk_calendar_init): Convert output of
	strftime into UTF-8.

	(column_from_x, gtk_calendar_paint_day_names): Support RTL
	calendars.

	(gtk_calendar_paint_day_names): Draw day names in the right
	place.
2000-11-12 22:15:43 +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
Tor Lillqvist
e0833cd52a gdk/gdk.def Add missing entries.
2000-08-12  Tor Lillqvist  <tml@iki.fi>

	* gdk/gdk.def
	* gtk/gtk.def: Add missing entries.

	* gdk/win32/gdkfont-win32.c (gdk_font_load_internal): Use
	OUT_TT_ONLY_PRECIS, try to get a TrueType font.

	* gdk/win32/gdkinput-win32.c (gdk_device_get_state): New
	function. Dummy implementation at this point.

	* gtk/makefile.mingw.in: Fix typo. Add testtext and testtextbuffer
	rules. Undefine GTK_COMPILATION when compiling the test programs.

	* gtk/gtkdebug.h: Mark gtk_debug_flags for export/import.

	* gdk_pixbuf.def: Add missing entry point.
2000-08-12 19:51:05 +00:00
Tim Janik
afee2c67c5 applied patch from Andreas Persenius <ndap@swipnet.se> that updates the
Wed Jul 26 12:59:31 2000  Tim Janik  <timj@gtk.org>

        * *.[hc]: applied patch from Andreas Persenius <ndap@swipnet.se> that
        updates the license headers to the GNU Lesser General Public License,
        as well as updating the copyright year to 2000.
2000-07-26 11:33:08 +00:00
Tor Lillqvist
20e675e1a3 Generate gtk/makefile.mingw.
2000-07-25  Tor Lillqvist  <tml@iki.fi>

	* configure.in: Generate gtk/makefile.mingw.

	* config.h.win32: Add GETTEXT_PACKAGE.

	* gdk/gdk.def
	* gtk/gtk.def: Updates.

	* gdk/gdkfont.h
	* gdk/gdkpixmap.h: Remove temporary Win32-only functions, we don't
	need them any longer.

	* gdk/gdkinput.h: Mark gdk_core_pointer for export/import.

	* gdk/win32/*.c: More work.

	* gdk/win32/gdkpango-win32.c: New file.

	* gtk/makefile.mingw.in: New file

	* gtk/makefile.cygwin: Removed

	* gtk/Makefile.am: Update accordingly.

	* gtk/gtkmain.c: Use gtk_win32_get_installation_directory().

	* gtk/gtktextdisplay.c: No need to include pangox.h, pango.h
	is enough.

	* gtk/gtktypeutils.c: Mark glib_debug_objects for import.
2000-07-25 20:38:35 +00:00
Tor Lillqvist
4658795817 More work on the Win32 backend. More files compile now. 2000-07-23 21:43:23 +00:00
Tor Lillqvist
2823963703 Win32 changes, still doesn't build though.
2000-07-12  Tor Lillqvist  <tml@iki.fi>

Win32 changes, still doesn't build though.

* gdk/makefile.cygwin
* gdk/win32/makefile.cygwin
* gtk/makefile.cygwin: Updates.

* gdk/win32/gdkgc-win32.c (_gdk_win32_gc_new): Use the same
default values for fg and bg pixel as X11 does (0 and 1), not
black and white. Use PS_ENDCAP_FLAT and PS_JOIN_MITER by default.
Use 0 for pen width by default (treated as 1 anyway later, but for
apps that might check the value in the GdkGC).
(gdk_win32_hdc_get, gdk_win32_hdc_release): New functions, public
interface to gdk_gc_predraw and _postdraw.

* gdk/win32/gdkwin32.h
* gdk/gdk.def: Add gdk_win32_hdc_{get,release}.

* gdk/win32/gdkcolor-win32.c (gdk_colormap_alloc1): Remove
extraneous semicolon.

* gdk/win32/gdkdrawable-win32.c: Check also for pen_width == 0.

* gdk/win32/gdkimage-win32.c (gdk_image_new): Use the visual's depth,
not the Win32 bitspixel value.
2000-07-11 21:42:15 +00:00
Tor Lillqvist
1f149b3a8d Large changes to the Win32 backend, partially made necessary by the
2000-05-02  Tor Lillqvist  <tml@iki.fi>

Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)

* README.win32: Add the above comment about versions.

* gdk/gdkwindow.c: Don't use backing store for now on Win32.

* gdk/gdk.def: Update.

* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.

* gdk/makefile.{cygwin,msc}: Update.

* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.

* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.

* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.

* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.

* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.

* gdk/win32/gdkgc-win32.c: Largish changes.

* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.

* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.

* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.

* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.

* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
Tor Lillqvist
0cc2a00dc9 Remove the #ifndef USE_DISPATCHMESSAGE sections, we do want to use
2000-03-17  Tor Lillqvist  <tml@iki.fi>

* gdk/win32/gdkevents-win32.c: Remove the #ifndef
USE_DISPATCHMESSAGE sections, we do want to use DispatchMessage.

* gdk/win32/gdkfont-win32.c
* gdk/win32/gdkproperty-win32.c
* gdk/win32/gdkselection-win32.c
* gdk/win32/gdkwindow-win32.c: Add const to some arguments that are
now declared such.
2000-03-16 21:58:35 +00:00
Tor Lillqvist
ec1e8f1f5d Internal GDK error reporting changes: (gdk_win32_gdi_failed) New function
2000-03-07  Tor Lillqvist  <tml@iki.fi>

* gdk/win32/gdkmain-win32.c: Internal GDK error reporting changes:
(gdk_win32_gdi_failed) New function for reporting errors from GDI,
for which it is no use to call GetLastError on Win9x.
(gdk_other_api_failed) New function, for
general error reporting without calling GetLastError.
(gdk_win32_api_failed) OTOH, this function always calls
GetLastError. (gdk_win32_last_error_string) Remove this function,
GLib has the equivalent now.

* gdk/win32/gdkprivate-win32.h: Declare the above, and macros to
call them with function name, file name and line number in the
arguments.

* gdk/win32/*.c: Use the new macros for reporting errors from GDI
functions.

* gtk/gtk.def: Add some missing entry points.

* gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
gtk_paned_set_gutter_size, which don't exist any longer, as void.

Fixes by Hans Breuer:

* gdk/makefile.msc: Update for debugging.

* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Fake
implementation, just use the PS_DASH, PS_DOT, PS_DASHDOT or
PS_DASHDOTDOT or PS_DASH styles depending on the number of entries
in the dash_list.

* gdk/win32/gdkwin32.h (GDK_FONT_XFONT): New macro, similar as in
the x11 backend.

* gdk/win32/gdkprivate-win32.h (IS_WIN_NT): New macro.

* gtk/testgtk.c: Include config.h, guard inclusion of unistd.h.
2000-03-08 06:18:41 +00:00
Tor Lillqvist
ff99eb7cc1 Add an extra parameter so that we don't have to do unnecessary settings to
2000-02-13  Tor Lillqvist  <tml@iki.fi>

* gdk/win32/gdkgc-win32.c (gdk_gc_predraw): Add an extra parameter
so that we don't have to do unnecessary settings to the HDC.

* gdk/win32/gdkdrawable-win32.c
* gdk/win32/gdkimage-win32.c: Corresponding changes to the calls of
gdk_gc_predraw.

* gdk/win32/gdkdrawable-win32.c: Special-casing for GdkGCs where
the fill style is GDK_OPAQUE_STIPPLED. In those cases we construct
GDI paths, call WidenPath to get the outline of the stroken path,
and then fill the outline (with the brush that was built from the
stipple).

* gdk/win32/gdkgc-win32.c: Factor out common code from
_gdk_win32_gc_new and gdk_win32_gc_set_values into
gdk_win32_gc_values_to_win32values.

* gdk/win32/gdkmain-win32.c (gdk_win32_last_error_string,
gdk_win32_api_failed): New functions for error logging.

* gdk/win32/gdkprivate-win32.h: Declare them, and a macro
WIN32_API_FAILED to call them, passing function or file name and
line number.

* gdk/win32/*.c: Use the WIN32_API_FAILED macro.

* gdk/win32/gdkprivate-win32.h: Store just the pixel values from
GdkColor for foreground and background in GdkGCWin32Data.

* gdk/makefile.cygwin: Link in the resource object separately.

* gdk/win32/rc/gdk.rc
* gtk/gtk.rc (New file)
* gdk/win32/makefile.cygwin
* gtk/makefile.cygwin: Update build number in DLLs automatically,
as in GLib.
2000-02-13 14:52:47 +00:00
Tor Lillqvist
e57b1afa2b Use g_filename_to_utf8 to convert the font names Windows gives us from
2000-02-04  Tor Lillqvist  <tml@iki.fi>

* gdk/win32/gdkfont-win32.c (logfont_to_xlfd): Use
g_filename_to_utf8 to convert the font names Windows gives us from
whatever is the default codepage to UTF-8.
(gdk_font_load_internal) Use g_filename_from_utf8 for conversion
in the other direction.

* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_values): Fix cut&paste
error in debugging output.

2000-02-02  Tor Lillqvist  <tml@iki.fi>

* gdk/win32/gdkwindow-win32.c (gdk_window_clear): Pass zero width
and height parameters to gdk_window_clear_area(). Not minus one.

2000-02-01  Tor Lillqvist  <tml@iki.fi>

* gtk/gtkfilesel.c: Use the g_filename_to_utf8 and
g_filename_from_utf8 functions (which were added a moment ago to
GLib). Some cleanups: Use gbooleans. Use GStrings instead of fixed
size buffers.

* gtk/gtkfilesel.h: Add comment about
gtk_file_selection_get_filename returning the filename in the C
runtime's encoding.

* README.win32
* gdk/gdk.def
* gdk/makefile.{cygwin,msc}
* gtk/gtk.def: Updates.

* gdk/gdkcursor-win32.c: Initialise refcount.
2000-02-03 01:19:03 +00:00
Tor Lillqvist
0733eb725d When handling a single character (text length == 1), don't handle it as if
1999-12-18  Tor Lillqvist  <tml@iki.fi>

* gdk/win32/gdkfont-win32.c (gdk_text_size, gdk_text_extents):
When handling a single character (text length == 1), don't handle
it as if it was UTF-8.
1999-12-18 02:03:13 +00:00
Tor Lillqvist
7df755b181 More tweaks. Check only if at least one of those Unicode subrange bits we
1999-12-11  Tor Lillqvist  <tml@iki.fi>

* gdk/win32/gdkfont-win32.c (check_unicode_subranges): More
tweaks. Check only if at least one of those Unicode subrange bits
we care for is set. If no code page bits are set, guess (wildly)
based on the charset.
1999-12-12 01:32:53 +00:00
Tor Lillqvist
6817444e14 Fix string measurement code. For now, the rbearing is set to the same as
1999-12-07  Tor Lillqvist  <tml@iki.fi>

* gdk/win32/gdkfont-win32.c: Fix string measurement code. For now,
the rbearing is set to the same as the width, but this should be
fixed.
1999-12-06 23:48:08 +00:00
Tor Lillqvist
0f5c8e857c New function. Guesstimate what Unicode subranges a font covers based on
1999-12-06  Tor Lillqvist  <tml@iki.fi>

* gdk/win32/gdkfont-win32.c (check_unicode_subranges): New
function. Guesstimate what Unicode subranges a font covers based
on the codepages. Windows tells us it covers. This will hopefully
help those Windows versions or fonts that don't give us any useful
Unicode subrange information with GetTextCharsetInfo. Call this
function in gdk_font_load_internal.

* gdk/win32/{gdkdnd,gdkimage,gdkpixmap,gdkprivate}-win32.c: Misc
minor changes.
1999-12-05 23:26:46 +00:00
Tor Lillqvist
72fc042792 Fix two copy&paste errors.
1999-11-25  Tor Lillqvist  <tml@iki.fi>

* gdk/gdkgc.c (gdk_gc_set_ts_origin, gdk_gc_set_clip_origin):
Fix two copy&paste errors.

* gdk/makefile.cygwin: Also rebuild DLL when the static archive in
win32 has changed.

* gdk/win32/gdkprivate-win32.h: Don't need CPINFO in the
GdkWin32SingleFont struct.

* gdk/win32/gdkfont-win32.c: Some more debugging: Print Unicode
subranges of loaded fonts. Clear font signature first, in case
GetTextCharsetInfo fails. Pretend SYMBOL_CHARSET fonts have
ASCII+Basic Latin (i.e. 0x40--0xFF) as they are single-byte.

* gdk/win32/gdkgc-win32.c: Improved logging. (gdk_gc_postdraw):
Unoffset clip region.
1999-11-25 00:27:11 +00:00
Tor Lillqvist
143002cac5 Remove, as this is a file generated by configure (or copied from
1999-11-21  Tor Lillqvist  <tml@iki.fi>

* gdk/gdkconfig.h: Remove, as this is a file generated by configure
(or copied from gdkconfig.h.win32 on Win32, sigh).

* gdk/gdkprivate.h: Mark gdk_parent_root for export from DLL.

* gdk/gdkgc.c (gdk_gc_alloc): Remove duplicated line.
1999-11-21 22:56:37 +00:00
Tor Lillqvist
8e06c4d7f4 Further hacking. Now actually compiles. Haven't tried yet whether
actually does anything useful... Time for bed.
1999-11-20 01:22:57 +00:00
Tor Lillqvist
b6524a84f5 Intermediate commit. 1999-11-19 01:09:13 +00:00
Tor Lillqvist
638ebcee70 re-adding for manual rename of repository files. 1999-11-11 22:12:27 +00:00
Tor Lillqvist
84477de7fc Just renamed the Win32 backend files to *-win32. 1999-11-10 00:04:17 +00:00
Tor Lillqvist
b5f414a1a5 gdk/win32/gdkdraw.c gdk/win32/gdkfont.c Various minor cleanups and
1999-11-08  Tor Lillqvist  <tml@iki.fi>

* gdk/win32/gdkdraw.c
* gdk/win32/gdkfont.c
* gdk/win32/gdkgc.c: Various minor cleanups and bugfixes
following yesterday's changes. (Unrelated to Owen's reorg.)
1999-11-08 21:34:06 +00:00
Tor Lillqvist
0ad4aa57d6 New font private structures, related to fontsets.
1999-11-07  Tor Lillqvist  <tml@iki.fi>

* gdk/win32/gdkprivate.h: New font private structures, related to
fontsets.

* gdk/win32/gdkfont.c: New functions gdk_font_list_new() and
gdk_font_list_free(). On X11, will just be wrappers to
XListFonts() and XFreeFontNames(). On Win32, the code previously
in gtkfontsel.c is now here.

New function gdk_font_xlfd_create(). On X11 will get the FONT
property of the font (for GDK_FONT_FONTs), or call
XBaseFontNameListOfFontSet (for GDK_FONT_FONTSETs), on Win32
builds a XLFD style name from the font information in the LOGFONT
struct(s).

New function gdk_font_xlfd_free(), which correspondingly frees the
string returned by gdk_font_xlfd_create().

Implement fontsets on Win32. Add a function that iterates over a
wide char string and calls a callback function for each substring
of wide chars from the same Unicode subrange (and thus probably
available in the same real font).

Improve the XLFD emulation a bit.

* gdk/win32/gdkim.c (gdk_nmbstowchar_ts): Small bugfix.

* gdk/win32/gdkevents.c: Workaround for suspected bug on Win2k
Beta3, WM_IME_CHAR messages don't seem to contain the composed
multi-byte char as with the Active IMM on Win9x. Oh well, handle
WM_IME_COMPOSITION with GCS_RESULTSTR instead, use
ImmGetCompositionStringW() to get the composed Unicode chars.

* gdk/win32/gdkgc.c
* gdk/win32/gdkdraw.c: Changes needed because of the font private
struct changes.

* gdk/win32/gdk.def: Add the new functions.
1999-11-08 00:09:29 +00:00
Tor Lillqvist
f527b8909f Don't define HAVE_DIMM_H if MSC, as you have to get the Platform SDK to
1999-11-04  Tor Lillqvist  <tml@iki.fi>

* config.h.win32: Don't define HAVE_DIMM_H if MSC, as you have to
get the Platform SDK to get <dimm.h>.

* gdk/win32/gdkevents.c: More event handling fixes and
simplification. Never generate motion events with is_hint true. We
used to do that on bogus grounds earlier. Windows sends
WM_MOUSEMOVE messages on button events even if the mouse hasn't
moved, ignore these.

* gdk/win32/gdkfont.c: Load all fonts as (pretended) fontsets.

* gdk/win32/gdkglobals.c
* gdk/win32/gdkprivate.h: Define a typedef for the pointer to
the TrackMouseEvent function, and use it.

* gdk/win32/gdkwindow.c: Terminate widechar string with a zero
char before calling WideCharToMultiByte in order to get a string
for the window title.

* gdk/win32/gdkdnd.c: Some more random hacking, ifdeffed out.

* gdk/win32/gdk.def: Remove obsolete functions.

* gdk/win32/makefile.{cygwin,msc}: Remove gdkcompat.{o,obj}. Add
/nodefaultlib and /defaultlib switches.

* gtk/gtkrc.c: s/gwin_getlocale/g_win32_getlocale/.
1999-11-04 23:42:51 +00:00