Commit Graph

100 Commits

Author SHA1 Message Date
Tor Lillqvist
5155f3ca66 gdk/win32/gdkinput-win32.h Drop the GdkEvent* parameter, it wasn't used.
2003-08-07  Tor Lillqvist  <tml@iki.fi>

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

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


	[Win32] Add support for multiple monitors.

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkwindow-win32.c (_gdk_win32_adjust_client_rect,
	_gdk_win32_get_adjusted_client_rect): New helper functions.
2003-08-07 22:17:18 +00:00
Hans Breuer
76cb03f43f now it works as intended ;-)
2003-08-06  Hans Breuer  <hans@breuer.org>

	* gdk/win32/gdkwindow-win32.c (gdk_window_set_icon) :
	now it works as intended ;-)
2003-08-06 21:01:00 +00:00
Hans Breuer
d2c64e305c set HWND_NOTOPMOST for modal==FALSE, fixes bug #118435
2003-08-04  Hans Breuer  <hans@breuer.org>

	* gdk/win32/gdkwindow-win32.c(gdk_window_set_modal_hint) :
	set HWND_NOTOPMOST for modal==FALSE, fixes bug #118435

	* gdk/win32/gdkwindow-win32.c : implement gdk_window_[un]fullscreen
	(gdk_window_{move,resize,move_rezize})) : noop if FULLSCREEN

	* gdk/win32/gdkwindow-win32.c (gdk_window_set_icon) :
	against all expectations it is basically ony a call with WM_SETICON
	needed (the visual effect is there, though colors or mask are
	still somewhat wrong).
	* gdk/win32/gdkwindow-win32.h : place to store the HICON

	* gdk/win32/gdkdrawabke.win32.c : readded the conditional end
	pixel drawing as it was fixed at 1999-08-23

	gtk/gtk.def : updated
2003-08-05 22:24:35 +00:00
Tor Lillqvist
3dc24f5893 Fix gdk/win32 window geometry handling again. The window position in a
2003-08-02  Tor Lillqvist  <tml@iki.fi>

	Fix gdk/win32 window geometry handling again. The window position
	in a GDK_CONFIGURE event should be that of the client area, not of
	the window decorations. (I was confused by the term "window
	border" in X11. It does *not* mean the window manager
	decorations. There are no X11-style window borders in Win32.)
	Also, this time do take the geometry hints into account
	appropriately when moving windows. Now testgtk's gravity test's
	move buttons work OK. There are stil problems with taking gravity
	into account when showing a hidden window.

	* gdk/win32/gdkwindow-win32.h: Keep a whole GdkGeometry as hints
	instead of separate fields.

	* gdk/win32/gdkevents-win32.c (handle_configure_event): Don't
	adjust for decorations.

	* gdk/win32/gdkwindow-win32.c (get_outer_rect,
	adjust_for_gravity_hints): New functions.
	(gdk_window_move, gdk_window_resize, gdk_window_move_resize): Use
	above functions, take geometry hints into account.
	(gdk_window_set_geometry_hints): Size hints specicy client area,
	not including decorations.
2003-08-02 02:05:12 +00:00
Tor Lillqvist
09f777e5ea Fix for #108007, #112402, #117042: There was confusion in gdk/win32 at
2003-07-29  Tor Lillqvist  <tml@iki.fi>

	Fix for #108007, #112402, #117042: There was confusion in
	gdk/win32 at various places whether a window position refers to
	the decoration position or the client area position. Also whether
	window size includes decorations or not.

	The correct interpretation apparently is that in GDK (like in
	X11), a top-level window position means the decoration's position,
	but size means the window's inner size (client area size). In the
	Win32 API, the window size usually includes the decorations,
	though.

	* gdk/win32/gdkevents-win32.c (decode_key_lparam): Move inside
	#ifdef G_ENABLE_DEBUG.
	(handle_configure_event): New function, generates GDK_CONFIGURE
	events from WM_SIZE and WM_MOVE messages. Even if no event is
	generated because of the event mask, still set the private
	position and size fields. Calculate position and size correctly.
	(gdk_event_translate): Call handle_configure_event().

	* gdk/win32/gdkgeometry-win32.c: Cosmetics.

	* gdk/win32/gdkwindow-win32.c: Use GDI_CALL() and API_CALL()
	macros. Cosmetic debugging output changes.
	(SafeAdjustWindowRectEx): Remove. If an application wants to
	locate a window outside of the screen, it's not GDK's business to
	prevent it. And anyway, with multiple monitors, negative
	coordinates are perfectly normal.
	(gdk_window_new): Adjust the window size for decorations after
	_gdk_window_init_position() has done its job. (But the big window
	code currently is presumably broken on Win32 anyway.)
	(gdk_window_move): The position passed in is supposed to be that
	of the window border, so don't need to adjust for decorations.
	(gdk_window_resize, gdk_window_move_resize): Simplify somewhat.
2003-07-29 23:35:40 +00:00
Tor Lillqvist
63f745738d gdk/win32/gdkprivate-win32.h New flags _gdk_input_locale_is_ime and
2003-07-25  Tor Lillqvist  <tml@iki.fi>

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

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

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

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

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

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

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

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

	(gdk_window_is_ancestor): Renamed from gdk_window_is_child().

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	* gdk/win32/gdkkeys-win32.c (update_keymap): Make dead keys
	visible to GDK and GTK. Store the corresponding GDK_dead_* keysym
	for those, so that the GtkIMContextCimple compose tables will
	work. Deduce if the keyboard layout has the AltGr key, and set the
	above flag accordingly.
2003-07-26 01:54:59 +00:00
Tor Lillqvist
f976beaf41 WindowFromPoint() wants screen coordinates (#115422, Tim Evans).
2003-07-01  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkwindow-win32.c (_gdk_windowing_window_get_pointer):
	WindowFromPoint() wants screen coordinates (#115422, Tim Evans).
2003-07-01 11:14:46 +00:00
Tor Lillqvist
33902a67f0 New function, callback proc for EnumWindows().
2003-06-30  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkdnd-win32.c (find_window_enum_proc): New function,
	callback proc for EnumWindows().
	(gdk_drag_find_window_for_screen): Actually take the drag_window
	argument into account: Instead of using WindowFromPoint(), use
	EnumWindows(), to be able to skip the drag_window. (#116320, Tony
	M Brown, Herman Bloggs)

	* gdk/win32/*.c: Replace gdk_drawable_ref()/unref() and
	gdk_window_ref()/unref() calls with g_object_ref()/unref().
	Consistently use %p format in debugging output of pointers and
	HANDLEs.
2003-06-30 21:58:24 +00:00
Tor Lillqvist
d867b9a8df Merge from stable:
2003-01-19  Tor Lillqvist  <tml@iki.fi>

	Merge from stable:

	Fix for #103614 and some other problems with GtkFileSelection on
	Windows:

	* gtk/fnmatch.c (get_char): Need to use g_unichar_tolower(), not
	g_ascii_tolower(). Windows file names are case-insensitive for all
	Unicode letters.

	* gtk/gtkfilesel.c: Instead of checking for G_OS_WIN32 or
	G_WITH_CYGWIN, check G_PLATFORM_WIN32. Move inclusion of gtkintl.h
	earlier, as it includes config.h unconditionally, and gtkprivate.h
	redefines GTK_LOCALEDIR.
	(struct _CompletionDirSent): Ifdef out the fields not used on
	Windows.
	(compare_utf8_filenames, compare_sys_filenames): Need different
	comparison implementation for UTF-8 file names and system locale
	file names on Win32. Cannot simply use g_ascii_strcasecmp(), but
	need to casefold all Unicode letters.
	(cmpl_completion_matches, open_dir, correct_parent): Ifdef out
	variables not used on Win32 to avoid warnings about unused
	variables.
	(open_ref_dir): Use g_path_skip_root() to skip past potential
	drive letter in front of the leading (back)slash.
	(open_new_dir): Ifdef out use of CompletionDirSent fields not
	there on Win32.
	(correct_parent): Bypass inode check also on Cygwin.

	Fix bug noticed by Alex Shaduri: Tooltips and other
	GDK_WINDOW_TEMP windows were activated. This looked very odd, and
	was a regression from earlier versions.

	* gdk/win32/gdkwindow-win32.c (show_window_internal): Fine-tune
	behaviour. Don't ever activate GDK_WINDOW_TEMP windows.
	(gdk_window_move, gdk_window_resize): Add debug logging.

	* gdk/win32/gdkevents-win32.c (gdk_event_translate): When we get a
	WM_SIZE message for a non-visible (withdrawn) window, don't clear
	the GDK_WINDOW_STATE_WITHDRAWN bit. The window is still withdrawn
	even if its size changes.
2003-01-19 21:18:15 +00:00
Tor Lillqvist
4a3c812b7d Merge from stable:
2003-01-12  Tor Lillqvist  <tml@iki.fi>

	Merge from stable:

	* gtk/gtkmain.c: Move inclusion of config.h and gtkintl.h earlier,
	as gtkprivate.h redefines GTK_LOCALEDIR on Win32, for run-time
	lookup.

	* gdk/Makefile.am (libgdk_win32_2_0_la_DEPENDENCIES): Depend on
	gdk.def.

	* gdk/gdk.def
	* gtk/gtk.def: Add some missing entries. Thanks to Kenichi SUTO.

	* gtk-zip.sh.in (DEVZIP): Add bin/{gtk-query-immodules-2.0,
	gtk-demo}.exe and share/gtk-2.0.

	* gdk/win32/gdkwindow-win32.c (gdk_window_set_skip_taskbar_hint):
	Implement by setting or clearing the WS_EX_TOOLWINDOW extended
	window style.
	(gdk_window_set_type_hint): Add all cases to the switch (not all
	do anything, though). Handle GDK_WINDOW_TYPE_HINT_TOOLBAR by
	calling gdk_window_set_skip_taskbar_hint(). This means that GTK
	won't know that the skip_taskbar hint is on for the window, is
	this bad?
2003-01-12 04:44:23 +00:00
Tor Lillqvist
eee70b8153 Move the code that sets the window style and extended window style, and
2002-12-21  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkwindow-win32.c (gdk_window_new): Move the code that
	sets the window style and extended window style, and adjusts the
	width and height to take the window decorations into account
	earlier. The adjusted width and height used to be ignored. Remove
	the local x, y, width and height variables, no need to further
	confuse the code by having local copies. (Partial fix, I hope, for
	#101588)

	(gdk_window_move): When moving top-level windows, take title bar
	and border width into account, offsetting the coordinates before
	calling SetWindowPos().

	(gdk_window_set_decorations, gdk_window_set_functions):
	Reimplement, taking into account the peculiar semantics of
	GDK_DECOR_ALL and GDK_FUNC_ALL. (#79036)

	(gdk_window_get_decorations): Implement. (#98981)

	(gdk_window_set_type_hint): When setting
	GDK_WINDOW_TYPE_HINT_MENU, call	gdk_window_set_decorations().
	(#79036)

	* gdk/gdk.def: Add gdk_window_get_decorations. (#98981)
2002-12-21 23:32:20 +00:00
Tor Lillqvist
5fc015b4e9 gdk/win32/gdkpixmap-win32.c (gdk_pixmap_new, gdk_bitmap_create_from_data,
2002-12-11  Tor Lillqvist  <tml@iki.fi>

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

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

	Merge from stable:

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

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

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

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

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

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

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

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

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

	Merge from stable:

	Implement tiles and stipples for all drawing methids (except the
	deprecated draw_text() and draw_text_wc()).

	* gdk/win32/gdkdrawable-win32.c: Remove the already ifdeffed-out
	code that didn't use generic_draw().

	(generic_draw): When drawing into the mask (for tiled/stippled
	fill styles), copy the line attributes from the actual GC. Also
	ask for text drawing setup if needed. Use differently set up HDCs
	in the normal and tiled/stippled cases.

	(draw_lines, gdk_win32_draw_lines, draw_polygon,
	gdk_win32_draw_polygon, draw_segments, gdk_win32_draw_segments,
	draw_arc, gdk_win32_draw_arc): Use generic_draw(), thus
	implementing tiled and stippled fill styles for lines, polygons,
	segments, and args.

	(gdk_win32_draw_points): Use Rectangle() instead of
	SetPixel(). Rectangle() uses the function (raster op) set for the
	HDC, SetPixel() doesn't.

	(widen_bounds): New function, refactoring.

	* gdk/win32/gdkgc-win32.c: Remove ifdeffed-out code.

	(predraw_set_foreground, gdk_win32_hdc_get): Some code moved
	around. Call SetROP2() only if necessary. Call SetTextColor() only
	if GDK_GC_FOREGROUND flag present. Don't handle
	GDK_OPAQUE_STIPPLED here, has been superseded by the code in
	generic_draw(). Always create a solid brush.

	Remove background color handling from here. The background color
	of a GdkGC is supposed to affect only GDK_OPAQUE_STIPPLED fill
	style, which it is already handled in generic_draw(), and
	GDK_LINE_DOUBLE_DASH lines, which aren't implemented properly
	anyway. Calling SetBkColor() is unnecessary as we always use
	TRANSPARENT text output.

	(gdk_win32_hdc_get, gdk_win32_hdc_release): Add doc comments, as
	these are public functions.

	* gdk/win32/gdkevents-win32.c (synthesize_expose_events): Don't
	synthesize expose events for GDK_INPUT_ONLY windows.
	(gdk_event_translate): On WM_SIZE, call
	gdk_synthesize_window_state() if window was iconified, restored or
	maximized. (#98983, Arnaud Charlet)

	* gtk+/gdk/win32/gdkwindow-win32.c
	(gdk_window_get_frame_extents): Fix typo in setting y.  (#98983,
	Arnaud Charlet)
2002-11-24 23:54:01 +00:00
Tor Lillqvist
36a56b08e5 Add missing entries, needed by gtk.
2002-11-16  Tor Lillqvist  <tml@iki.fi>

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

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

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

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

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

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

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

	* gdk/win32/gdkwindow-win32.c (gdk_window_set_skip_taskbar_hint,
	gdk_window_set_skip_pager_hint, gdk_window_fullscreen,
	gdk_window_unfullscreen): Implement as no-ops.
2002-11-16 21:51:47 +00:00
Tor Lillqvist
e96a41be45 gdk/win32/gdkprivate-win32.h Rename all global variables and functions to
2002-11-12  Tor Lillqvist  <tml@iki.fi>

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

	Merge from stable:

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

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

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

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

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

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

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

	Bug #79720 should be fixed now.

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

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

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

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

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

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

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

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

	(gdk_event_get_graphics_expose): A bit more verbose debugging output.

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

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

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

	(gdk_text_size): Remove, unused.

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

	(gdk_gc_copy): Increase refcount on colormap if present.

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

	(_gdk_win32_bitmap_to_hrgn): Rename from _gdk_win32_bitmap_to_region.

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

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

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

	(gdk_window_scroll): Don't do guffaw scrolling.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	* gdk/win32/rc/gdk.rc.in: Update copyright year.
2002-11-12 22:17:48 +00:00
Tor Lillqvist
ae26d02476 Don't call GetWindowLong for GWL_EXSTYLE, the extended window style wasn't
2002-10-28  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkwindow-win32.c (gdk_window_set_decorations,
	gdk_window_set_functions): Don't call GetWindowLong for
	GWL_EXSTYLE, the extended window style wasn't used or
	changed. After setting the window style with SetWindowLong, call
	SetWindowPos with the SWP_FRAMECHANGED flag for the window to
	actually be updated, as Platform SDK docs say one should. (#95812,
	huzheng)
2002-10-28 20:48:40 +00:00
Owen Taylor
253458ec52 - Replace GdkPointerHooks with a multihead-safe GdkDisplayPointerHooks,
Mon Oct  7 15:10:00 2002  Owen Taylor  <otaylor@redhat.com>

        * gdk/gdkdisplay.[ch] gdk/gdkinternals.h
        gdk/gdkwindow.[ch] gdk/linux-fb/gdkwindow-fb.c
        gdk/win32/gdkwindow-win32.c gdk/x11/gdkwindow-x11.c:

        - Replace GdkPointerHooks with a multihead-safe
          GdkDisplayPointerHooks, leave GdkPointerHooks
          around for singlehead.
        - Add gdk_display_get_pointer() to get the pointer
          location with the screen it is on.

        * gdk/gdk.def gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch]:
        Change gdk_screen_get_window_at_pointer() to
        gdk_display_get_window_at_pointer().

        * gtk/gtktreeview.c demos/gtk-demo/changedisplay.c
        tests/testgtk.c: Use gdk_display_get_window_at_pointer(),
        not gdk_screen_get_window_at_pointer().

        * gtk/gtkcolorsel.c: Fix grabbing color to be multihead
        safe.

        * gtk/gtkwidget.c: Allow gtk_widget_push_colormap (NULL).
        since it is useful for writing code that doesn't
        know the dcurrent state but needs a clean colormap.

        * gtk/gtkrc.c: When loading the settings for a particular
        screen, only reset toplevels on that screen.

        * gtk/gtkiconfactory.h: Fix #ifdef GTK_MULTIHEAD_SAFE
        that should have been #ifndef GTK_MULTIHEAD_SAFE.
2002-10-07 19:42:49 +00:00
Tor Lillqvist
41590bea09 Use HWND_NOTOPMOST instead of HWND_TOPMOST. Suggested by Florent Duguet.
2002-09-05  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkwindow-win32.c (gdk_window_set_transient_for):
	Use HWND_NOTOPMOST instead of HWND_TOPMOST. Suggested by Florent
	Duguet.
2002-09-04 21:45:38 +00:00
Tor Lillqvist
eab30a1223 Use MAX_PATH (from windef.h) insted of _MAX_PATH (from stdlib.h in mingw
2002-08-26  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkwindow-win32.c (RegisterGdkClass): Use MAX_PATH
	(from windef.h) insted of _MAX_PATH (from stdlib.h in mingw and
	MSVC, but not there in Cygwin) (#91681, Masahiro Sakai).
2002-08-26 20:00:36 +00:00
Owen Taylor
b7c0c06b8e Fix args to pango_x_shutdown_display().
Fri Aug  2 15:56:47 2002  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkscreen-x11.c (gdk_screen_x11_dispose): Fix
        args to pango_x_shutdown_display().

        * gdk/linux-fb/gdkinput.c gdk/linux-fb/gdkinputprivate.h
        gdk/win32/gdkinput-win32.[ch] gdk/win32/gdkinput.c
        gdk/win32/gdkwindow-win32.c gdk/x11/gdkinput-x11.c
        gdk/x11/gdkinput-xfree.c gdk/x11/gdkinput.c
        gdk/x11/gdkinputprivate.h gdk/x11/gdkwindow-x11.c: Move
        a bunch of functions gdk_input => _gdk_input. Clean
        up some header file cruft. (#79971)
2002-08-02 20:22:49 +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
Tor Lillqvist
663ec013a4 [ merge from stable ]
2002-06-10  Tor Lillqvist  <tml@iki.fi>

	[ merge from stable ]

	* gdk/win32/gdkmain-win32.c (gdk_screen_get_width_mm,
	gdk_screen_get_height_mm): Use the "logical dpi" to calculate
	(pseudo) physical sizes. Similar to the use of "logical dpi" in
	Pango as suggested by Joaquin Cuenca Abela.

	Two fixes by Florent Duguet:

	* gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): Correct
	semantics for setting cursor to NULL (should use cursor of parent
	window).

	* gdk/win32/gdkgc-win32.c (gdk_win32_hdc_get): Plug memory
	leak.
2002-06-10 20:27:15 +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
Owen Taylor
1dd8a1453f Add a sanity g_return_if_fail() check for the depths for the window and
Tue May 14 15:40:49 2002  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkwindow-{linux-fb,win32,x11.c} (gdk_window_set_back_pixmap):        Add a sanity g_return_if_fail() check for the depths
        for the window and pixmap. (#79191, Shivaram Upadhyayula)
2002-05-14 19:45:08 +00:00
Tor Lillqvist
d0ebbe9d77 Bypass calls to the grab/ungrab functions in gdkinput-win32.c, as they
2002-03-06  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkevents-win32.c (gdk_pointer_grab,
	gdk_pointer_ungrab): Bypass calls to the grab/ungrab functions in
	gdkinput-win32.c, as they don't effectively do anything anyway.
	(build_key_event_state): Set MOD2 bit if key is in AltGr group.
	(gdk_event_translate): Call _gdk_windowing_window_get_offsets()
	each time the offsets are used, on the window they refer to,
	instead of once in the beginning. The window in question might
	change due to event propagation.
	(gdk_event_translate): Set key event group to 0 for non-AltGr
	keys. Do set the SHIFT bit in the key event state also for
	ISO_Left_Tab. Now backtabbing finally works again.

	* gdk/win32/gdkunput-win32.c: Minor debugging output change.

	* gdk/win32/gdkkeys-win32.c (update_keymap): Set VK_TAB mapping to
	Gdk_Tab and GDK_ISO_Left_Tab, like on X11.
	(gdk_keymap_translate_keyboard_state): Add similar code as in the
	non-XKB case on X11 to generate a more correct
	consumed_modifiers. Add debugging output.
	(gdk_keyval_name): Use the U+xxxx format for UCS characters
	encoded as keyvals. Never return NULL, but hex number
	representation if keyval not in table.

	* gdk/win32/gdkwindow-win32.c (gdk_window_focus): Call
	SetFocus(). Doesn't seem to have any harmful effect, and probably
	is close to what this function is supposed to do. But it didn't
	fix GtkCombo as I had hoped.
	(gdk_window_set_type_hint): Don't intern the _NET_WM_* atoms that
	weren't used and wouldn't have any meaning on Win32 anyway.
2002-03-06 00:36:08 +00:00
Tor Lillqvist
8beceb3846 Remove the event_mask, it is now in GdkWindowObject.
2002-03-01  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkwindow-win32.h (struct _GdkWindowImplWin32): Remove
	the event_mask, it is now in GdkWindowObject.

	* gdk/win32/gdkwindow-win32.c: Change accordingly. Set the
	GDK_STRUCTURE_MASK in gdk_window_set_events(), as it is always set
	in gdk_window_new(), too. (Bug#72921)

	* gdk/win32/gdkevents-win32.c: Change accordingly here, too.
	(vk_from_char): New function, calculates the virtual keycode
	corresponding to the char in a WM_CHAR message.
	(build_keypress_event, build_keyrelease_event): Use it.
	(build_keypress_event): Call ImmReleaseContext() after using the
	input context. This might plug a memory or resource leak.
	(build_key_event_state): Remove #if 0 code.
	(gdk_event_translate): Actually, it would be preferrable to always
	handle just the WM_KEYDOWN and WM_KEYUP messages, not WM_CHAR at
	all, and thus drop the contorted logic with ignore_wm_char etc.

	* gdk/win32/gdkkeys-win32.c: (gdk_keymap_get_entries_for_keyval):
	Debugging output.
	(gdk_keymap_translate_keyboard_state): Return correct value. (But
	_gtk_key_hash_lookup() doesn't check the return value...)
2002-02-28 23:38:55 +00:00
Owen Taylor
7ea17ce7fd ed Feb 27 19:16:50 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkwindow-x11.c (gdk_window_new):
        * gdk/x11/gdkwindow-x11.c (gdk_window_get_events):
        * gdk/x11/gdkwindow-x11.c (gdk_window_set_events):
        * gdk/win32/gdkwindow-win32.c (gdk_window_set_events):
        * gdk/win32/gdkwindow-win32.c (gdk_window_new):
        * gdk/gdkwindow.h (struct _GdkWindowObject):
        * gdk/linux-fb/gdkwindow-fb.c (gdk_window_set_events):
        Save the window's event mask in window->event_mask.

        * gdk/gdkwindow.c (gdk_window_process_updates_internal): Only
        generate expose events if GDK_EXPOSE_MASK is included
        window->event_mask. (#54506)
2002-02-28 00:26:51 +00:00
Tor Lillqvist
93fa867e14 Implement the functions that until now just were non-functional stubs. For
2002-02-26  Tor Lillqvist  <tml@iki.fi>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	4) Plug some resource leaks.

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

	* gdk/win32/gdkdnd-win32.c (gdk_dropfiles_filter): Use
	g_filename_to_uri() to actually create legal URIs in the
	text/uri-list data.
2002-02-17 00:25:05 +00:00
Hans Breuer
6d33d1c7e3 don't reduce the scroll rect size by the scroll amount
2002-02-10  Hans Breuer  <hans@breuer.org>

	* gdk/win32/gdkgeometry-win32.c : don't reduce the scroll
	rect size by the scroll amount

	* gdk/win32/gdkwindow-win32.c
	* gdk/win32/gdkselection-win32.c : added some casts to
	make it compile with msvc's strict type checking

	* gtk/fnmatch.c : #include <ctype.h> again for tolower
	prototype. The fnmatch() code assumes to be in the crt
	locale though it is feeded by utf8 strings from gtkfilesel.c

	* gtk/gtkfilesel.c : let ->cmpl_text be a strdup managed by
	_CompletionDir instead of referencing already freed memory

	* gtk/gtktooltips.c (gtk_tooltips_init) : fix typo to
	gtk_rc_parse_string (theDefaultTooltipColor) once as it
	was intended

	* tests/makefile.msc : added more tests

	* tests/testgtk.c (create_list) : don't try to load gtkenums.h
	from the current directory use ../gtk/gtkenums.h instead
2002-02-10 13:18:51 +00:00
Tor Lillqvist
ffcd60398a Fixes contributed by Archaeopteryx Software: This is a first small part of
2002-01-12  Tor Lillqvist  <tml@iki.fi>

	Fixes contributed by Archaeopteryx Software: This is a first small
	part of their changes. Will commit more later.

	* gdk/win32/*.c: Add some 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): If we are destroying the current Windows
	cursor, set the Windows cursor to none first.

	* gdk/win32/gdkgc-win32.c (predraw_set_foreground): Delete the old
	brush that was in the DC, like the win32-procution branch does. I
	guess this plugs a resource leak? With the HDC cache, the old
	brush might be something we created ourselves, and not a stock
	brush. And it doesn't do any harm to call DeleteObject on stock
	brushes.

	* gdk/win32/gdkwindow-win32.c (gdk_window_impl_win32_finalize): If
	the window has a cursor which is the current Windows cursor,
	before destroying it set the current Windows cursor to none.
	(gdk_window_set_cursor): Also here, if destroying the current
	Windows cursor, set the current Windows cursor to none first.
	(gdk_window_get_pointer): Revamp logic.
2002-01-11 23:56:28 +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
c8940d6fdc Append EXEEXT to ../gdk-pixbuf/gdk-pixbuf-csource.
2002-01-01  Tor Lillqvist  <tml@iki.fi>

	* demos/Makefile.am (test-inline-pixbufs.h): Append EXEEXT to
	../gdk-pixbuf/gdk-pixbuf-csource.

2001-12-31  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkgc-win32.c (predraw_set_foreground): Improved error
	handling.
	(gdk_win32_hdc_get,gdk_win32_hdc_release): Silence gcc -Wall.

	* gdk/win32/gdkimage-win32.c (_gdk_win32_get_image): Silence gcc
	-Wall.  Use GDK_IS_PIXMAP_IMPL_WIN32 instead of GDK_IS_PIXMAP in
	one more place.

	* gdk/win32/gdkinput-win32.c (_gdk_input_other_event): Silence gcc
	-Wall.

	* gtk/Makefile.am (libgtk_win32_1_3_la_LDFLAGS): Add -lwsock32.
2002-01-01 22:17:09 +00:00
Owen Taylor
86dbeabc40 Include glib-object.h instead of gobject/gsignal.h
Sat Nov 17 21:07:46 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkenums.h: Include glib-object.h instead of
	gobject/gsignal.h

	* gdk/{gdkinternals.h,gdkwindow.c,gdkwindow.[ch],
	  x11,{fb,win32,x11/gdkwindow-*.c}: Add a dummy GdkScreen
	argument to the window_at_pointer() field of
	GdkPointerHooks. (Patch from Erwann Chenede)

	* gdk/gdkdrawable.h (struct _GdkDrawableClass ): Up
	to 6 pointers.
2001-11-18 02:15:52 +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
Owen Taylor
b7c639eafe Always set window->parent (except or the root window itself); if the
Tue Oct 23 17:31:42 2001  Owen Taylor  <otaylor@redhat.com>

	* gdk/x11/gdkwindow-x11.c gdk/win32/gdkwindow-win32.c: Always
	set window->parent (except or the root window itself); if
	the window's parent is not a GdkWindow, or is a window of
        type GDK_WINDOW_FOREIGN, set window->parent to the root parent.

	* gdk/gdkwindow.c (gdk_window_get_toplevels): Don't include
	windows of type GDK_WINDOW_FOREIGN.
2001-10-24 14:15:50 +00:00
Matthias Clasen
73e845eeab Add gdk_window_lookup, gdk_window_foreign_new, gdk_pixmap_lookup and
* gdk/gdkwindow.h, gdk/gdkpixmap.h, gdk/x11/gdkx.h,
        gdk/x11/gdkwindow-x11.c, gdk/x11/gdkpixmap-x11.c,
        gdk/win32/gdkwin32.h, gdk/win32/gdkwindow-win32.c,
        gdk/win32/gdkpixmap-win32.c, gdk/linux-fb/gdkfb.h,
        gdk/linux-fb/gdkwindow-fb.c, gdk/linux-fb/gdkpixmap-fb.c:
        Add gdk_window_lookup, gdk_window_foreign_new, gdk_pixmap_lookup
        and gkd_pixmap_foreign_new to the gdk frontend api. (#62063)

        * gtk/gtkselection.c: Remove gdk backend dependencies. (#62063)
2001-10-18 20:23:17 +00:00
Hans Breuer
293d787783 updated externals
2001-09-21  Hans Breuer  <hans@breuer.org>

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

	* gtk/gtkmain.h : define get_gtk_win32_directoty ()
	* gtk/gtkmain.c (find_module) : don't use module_name after freeing it.
	Also handle that Win32 pathes cann't be hard-coded

	* gtk/gtkrc.c : use get_gtk_win32_directoty () to cleanup the various
	module, themes etc directory calculations

	* gdk/win32/gdkgeometry-win32.c : some more hacking to get coordinates
	>16 bit right. The size limit within Win9x appears _not_ to be 32767
	but slightly smaller ...

	* gdk/win32/gdkwindow-win32.c : use impl->position_info to avoid
	>16 bit clipping. Added dummy body for gdk_window_set_icon_list ()

	* gdk/win32/gdkdrawable-win32.c : implement gdk_win32_drawable_get_handle ()

	* gdk/win32/gdkevents-win32.c : some tweaking to get better expose
	handling. I'm not sure if it is better now, but at least not worse

	* gdk/win32/makefile.msc : define INSIDE_GDK_WIN32, some cleanup

	* gdk/win32/gdkwin32.h : reflect recent API restrictions
2001-09-21 19:58:35 +00:00
Owen Taylor
1bbf2ac7ee Make gdkx.h the only installed header from gdk/x11. All structures in
Fri Sep  7 11:51:44 2001  Owen Taylor  <otaylor@redhat.com>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Miscellaneous fixes:

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

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

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

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

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

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

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

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

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

      Add some space for future expansion to multihead.

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

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

	* gdk/gdk.def : updated externals

	* gdk/win32/gdkselection-win32.c : returning TRUE with gdk_selection_set
	is required to get (at least) visible in entry fields. Some selections
	are really handled now - even on win32 - but copying via middle
	mouse button into a different app needs to wait ...

	* gdk/win32/gdkdnd-win32.c : implemented inter-app drag&drop
	mostly by stealling code from gdkdnd-fb.c. Thanks to who ever wrote it!

	* gdk/win32/gdkevents-win32.c : some tweaking to get better expose
	handling. I'm not sure if it is better now, but at least not worse

	* gdk/win32/gdkgeometry-win32.c : replaced every call to MoveWindow
	with SetWindowPos () which allows more fine-tuning backing-store wise

	* gdk/win32/gdkwindow-win32.c : allow unraised gdk_window_show ().
	Also changed move/resize to be more like the X version.

	* gtk/gtk.def : updated externals
2001-08-19 18:34:59 +00:00
Hans Breuer
0b5db507da coalescing property notifies
2001-08-11  Hans Breuer  <hans@breuer.org>

	* gtk/gtkalignment.c, gtk/gtkarrow.c, gtk/gtkaspectframe.c,
	  gtk/gtkcellrenderer.c, gtk/gtkcellrenderertext.c,
	  gtk/gtkcombo.c, gtk/gtkcurve.c, gtk/gtkfontsel.c,
	  gtk/gtklayout.c, gtk/gtkmisc.c, gtk/gtkpacker.c,
	  gtk/gtkprogress.c, gtk/gtkruler.c,, gtk/gtksettings.c,
	  gtk/gtkspinbutton.c, gtk/gtktexttag.c : coalescing property notifies

	* gtk/gtkclist.c, gtk/gtktipsquery.c, gtk/gtktexttag.c,
	  gtk/gtkwidget.c : added G_SIGNAL_TYPE_STATIC_SCOPE to all
	GDK_TYPE_EVENT signals

	* gtk/gtkalignment.c : removed 'direct allocation bug',
	which Tim discovered while reading the patch
2001-08-11 20:27:36 +00:00
Hans Breuer
afb6e60fb3 new file use it
2001-08-04  Hans Breuer  <hans@breuer.org>

	* gtk/stocks-icons/makefile.msc : new file
	* gtk/makefile.msc.in : use it

	* gtk/gtkstyle.c : not all platforms do provide M_PI and
	friends, but luckily there is G_PI

	* gtk/gtk.def : updated

	* gdk/win32/gdkwindow.c (gdk_window_new) : don't make all TEMP
	windows WS_POPUP, but only those without a parent. This fixes the
	mis-alignment between the selectable (temp, input only) window and
	the window text of GtkLabel.

	(gdk_window_show) : respect private->state when actually showing
	the window.

	(gdk_window_set_transient_for) : Implementation from Wolfgang
	Sourdeau <wolfgang@contre.com> ported to 2.0 and added some
	error handling. Should fix #50586.

	* gdk/win32/gdkevents-win32.c : beautify log output
2001-08-04 13:17:33 +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
Owen Taylor
191e83b32a Add gdk_set_pointer_hooks() to allow pointer-querying to be hooked by an
Mon Jul  2 01:09:37 2001  Owen Taylor  <otaylor@redhat.com>

 	* gdk/gdkwindow.[ch] gdk/gdkinternals.h gdk/x11/gdkwindow-x11.c
 	gdk/linux-fb/gdkwindow-fb.c gdk/x11/gdkwindow-x11.c gdk/gdk:
 	Add gdk_set_pointer_hooks() to allow pointer-querying to
 	be hooked by an event record/playback system like GERD.
	(#56914)
2001-07-05 13:41:34 +00:00
Hans Breuer
b5db5d514d made fil mode GDK_STIPPLED actually work -> check boxes and radio buttons
2001-05-25  Hans Breuer  <hans@breuer.org>

	* gdk/win32/gdkgc-win32.c : made fil mode GDK_STIPPLED actually
	work -> check boxes and radio buttons are drawn now, even on win9x.
	Improved line settings a bit, still no clue how to get really dotted
	lines on win9x, on NT it's PS_ALTERNATE.

	* gdk/win32/gdkwindow-win32.c : use SafeAdjustWindowRect for
	GDK_HINT_MIN_SIZE as well

	* gdk/win32/makefile.am : added gdkkeys-win32.c to EXTRA_DIST

	* gtk/gtk.def : updated

	* gtk/gtktreeprivate.h : change column_drop_func to be a function
	pointer not a function pointer pointer

	* tests/testdnd.c : include <stdlib.h> for putenv prototype

	* tests/testsocket.c : made it compile on win32 again

	* tests/makefile.msc : one more test-app uses prop-editor.obj
2001-05-25 15:43:53 +00:00
Hans Breuer
6ff97d2e0b disable USE_MMX for msvc build cause the assembler doesn't fit and is out
2001-03-31  Hans Breuer  <hans@breuer.org>

	* config.h.win32.in : disable USE_MMX for msvc build cause
	the assembler doesn't fit and is out of my scope. Disable
	USE_GMODULE for msvc build as wel. The right way to share
	binaries on win32 would be to use libtiff.dll etc. To reduce
	installation hassles IMO it's better to include all fileformats
	builtin to gdk-pixbuf

	* gdk-pixbuf/makefile.msc : new file

	* gdk/gdk.def : updated

	* gdk/win32/gdkevents-win32.c : don't erase the background if
	.no_bg is set. It improves the scrolling (e.g. of testgtk main
	buttons
	* gdk/win32/gdkgeometry-win32.c : added comment about the above

	* gdk/win32/gdkwindow-win32.c : added three new functions like
	the X version. Only one is implemented, because the other two
	"gdk_window_begin_(resize|move)_drag" got no docs and appear to
	be default behaviour on win32 anyway ...

	* gtk/gtk.def : updated

	* gtk/makefile.msc.in : update for new files, use glib-genmarshal
	from where it was built and add an additional rule to automagically
	build gtkmarshal.[hc]

	* gtk/gtkfilesel.c (open_new_dir) : don't increase n_entries
	before array access for the current entry isn't finished

	* gtk/gtktreeitem.c (gtk_tree_item_subtree_button_click) :
	use g_return_val_if_fail

	* gtk/testgtk.c (window_controls) : don't use the *wrong* size
	for the static array, but let the compiler calculate it. It
	makes me wonder if gcc isn't capable to catch bugs like this ...
2001-03-31 19:33:49 +00:00
Hans Breuer
0f6d1b4a27 updated
2001-03-10  Hans Breuer  <hans@breuer.org>

	* gdk/gdk.def : updated

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

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

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

	* gdk/win32/gdkprivate-win32.h : added _gdk_window_process_expose
	prototype
2001-03-10 18:13:03 +00:00