Commit Graph

74 Commits

Author SHA1 Message Date
Michael Natterer
92f86e0496 gdk/gdk.h gdk/gdkcairo.h gdk/gdkcolor.h gdk/gdkgc.h gdk/gdkinternals.h
2008-01-14  Michael Natterer  <mitch@imendio.com>

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

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

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


svn path=/trunk/; revision=19365
2008-01-14 14:02:12 +00:00
Matthias Clasen
82ce59cd0f Remove unnecessary NULL checks before g_free(). (#369666, Morten Welinder,
2007-03-09  Matthias Clasen <mclasen@redhat.com>

        * Everywhere: Remove unnecessary NULL checks before
        g_free().  (#369666, Morten Welinder, Djihed Afifi)

        * configure.in: Check for ftw.h



svn path=/trunk/; revision=17444
2007-03-09 21:57:37 +00:00
Tor Lillqvist
1ff434a681 Remove support for Windows 9x/ME. GTK+ hasn't worked on Win9x since 2.6 or
2006-08-29  Tor Lillqvist  <tml@novell.com>

	Remove support for Windows 9x/ME. GTK+ hasn't worked on Win9x
	since 2.6 or 2.8. It's pointless to keep the Win9x code in here as
	it isn't being maintained anyway. If somebody is interested, it
	can always be found in older GTK+ versions, and in CVS.

	* gdk/win32/gdkcursor-win32.c
	* gdk/win32/gdkdnd-win32.c
	* gdk/win32/gdkdrawable-win32.c
	* gdk/win32/gdkgc-win32.c
	* gdk/win32/gdkglobals-win32.c
	* gdk/win32/gdkkeys-win32.c
	* gdk/win32/gdkmain-win32.c
	* gdk/win32/gdkproperty-win32.c
	* gdk/win32/gdkselection-win32.c: Remove the G_WIN32_IS_NT_BASED()
	and G_WIN32_HAVE_WIDECHAR_API() tests and their false (Win9x)
	branches, and any variables or static functions used only by the
	Win9x branches.

	* gdk/win32/gdkprivate-win32.h: Remove backup definitions for
	constants that aren't missing from current mingw and MSVC6
	headers.

	* gdk/win32/gdkmain-win32.c
	* gdk/win32/gdkprivate-win32.h: Remove the _gdk_win32_gdi_failed()
	function. On NT-based Windows GetLastError() returns error codes
	also for failed GDI calls, so we can use _gdk_win32_api_failed()
	always.
2006-08-29 23:01:53 +00:00
Tor Lillqvist
80d2565d1c [Win32] Bypass libtool, use -Wl,-luuid. This avoids a libtool warning as
2005-07-18  Tor Lillqvist  <tml@novell.com>

	* configure.in (GDK_EXTRA_LIBS): [Win32] Bypass libtool, use
	-Wl,-luuid. This avoids a libtool warning as libuuid is static.

	* gdk/win32/gdkgc-win32.c (gdk_win32_hdc_get): Be sure to remove
	any possible leftover clipping region in the DC if we don't want
	any clipping. Thanks to Robert Ögren. (#309823)
2005-07-18 15:20:28 +00:00
Tor Lillqvist
baad14eee0 Improve and simplify line segment rendering on Win32, especially the
2005-06-23  Tor Lillqvist  <tml@novell.com>

	Improve and simplify line segment rendering on Win32, especially
	the implementation of GDK_CAP_NOT_LAST, and dashed lines. Fixes
	bug #306396.

	* gdk/win32/gdkprivate-win32.h (GdkGCWin32): Save the GdkGC's
	line_style, cap_style and join_style as such in the
	GdkGCWin32. Don't need to keep the pen_double_dash flag, we can
	check the line_style.

	* gdk/win32/gdkgc-win32.c (fixup_pen): New internal function. Sets
	up the GDI pen type, style, end cap and join attributes to use
	based on the pen width, GDK line style, end cap style, and join
	style.

	For a narrow (zero-width) GDK pen with the GDK_CAP_NOT_LAST end
	cap style, which typically are used for XOR drawing where it is
	essential that the last pixel is not drawn, use a GDI cosmetic
	pen. Only for a cosmetic pen does GDI not draw the last pixel. I
	deduced this by experimetation, the documentation is rather vague.

	For other GDK pens use a geometric GDI pen. If the width is 0 or 1
	and the GDK end cap style is GDK_CAP_BUTT, and the line style is
	GDK_LINE_SOLID, use PS_ENDCAP_ROUND. This ensures that also
	single-pixel length lines are drawn. (For sngle-pixel width lines
	roundness as such is of course irrelevant.) For dashed lines, use
	PS_ENDCAP_FLAT.

	For wide lines use PS_ENDCAP_FLAT, _ROUND or _SQUARE,
	respectively, for GDK_CAP_BUTT, GDK_CAP_ROUND and GDK_CAP_PROJECTING.

	For one pixel on-off dashed lines, use PS_ALTERNATE, it seems to
	work better than PS_USERSTYLE. For other dashed lines, use
	PS_USERSTYLE and the dashes as set by the user (or the default
	four-pixel on-off style).

	(gdk_win32_gc_values_to_win32values, gdk_win32_gc_set_dashes):
	Call fixup_pen() to do the pen settings after modifying some of
	the GDK GC attributes that affect pens.

	* gdk/win32/gdkdrawable-win32.c (render_line_horizontal,
	render_line_vertical, draw_segments): Check GdkGCWin32::line_style
	instead of the the removed pen_double_dash member. Don't use
	PATCOPY unconditionally in the PatBlt() call, use a raster ope
	code that depends on the GC function in use.

	(draw_rectangle, draw_segments, draw_lines): Be more careful in
	deciding when to do the manual dash rendering.

	(draw_segments): Don't do any manual "last point" drawing at
	all. The above changes takes care of narrow line segments being
	drawn correctly in most cases, at least on NT-based Windows.
2005-06-24 13:00:05 +00:00
Tor Lillqvist
a622843f4d gdk/win32/gdkdrawable-win32.c (generic_draw, blit_from_pixmap) Minor fixes
2005-05-04  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkdrawable-win32.c (generic_draw, blit_from_pixmap)
	* gdk/win32/gdkgc-win32.c (gdk_win32_gc_values_to_win32values,
	_gdk_win32_gc_new, _gdk_windowing_gc_set_clip_region,
	gdk_win32_hdc_get): Minor fixes to make Win32 backend compile
	again.
2005-05-04 11:43:44 +00:00
Owen Taylor
788bbf520a Add a draw-border style property to allow themes to draw outside the
2005-04-28  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c: Add a draw-border style property to allow
	themes to draw outside the widget's allocation.

	* gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs
	that were working around the clip-leakage bug in Cairo.

	* gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than
	save/fill/restore.

	* gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context()
	That updates a Cairo context to match a GC.

	* gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support
	for tiles/stipples/clipping to gdk_draw_glyphs(),
	gdk_draw_trapezoids().

	* gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal
	implementation of stipples. Use one cairo_t across the entire
	drawing operation. Replace cairo_matrix_create() with
	stack-allocated matrices.

	* gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c
	gdk/win32/gdkgc-win32.c: Save various aspects of the
	GC state (fill, tile, stipple, foreground, background, clip region)
	in instance-private-data for future use. Add getters.
	Get rid of _gdk_windowing_gc_get_foreground() function implemented
	by the backends.

	* gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c
	gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add
	_gdk_gc_init() to do initial setup of the GC from values;
	fixes some problems from drawable redirection.

	* gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c
	gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move
	gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into
	the generic code, add _gdk_windowing_gc_copy(),
	_gdk_windowing_gc_set_clip_region() to do backend specific
	stuff.

	* gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c}
	gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c}
	gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}:
	Don't duplicate state that now is stored by the generic code.

	* gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
Owen Taylor
368f15ca59 Use cairo_set_device_offset().
2005-02-24  Owen Taylor  <otaylor@redhat.com>

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

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

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

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

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

	* gdk/win32/gdkdrawable-win32.c: Remove
	gdk_draw_rectangle_alpha_libgtk_only()
2005-03-18 01:23:23 +00:00
Ivan, Wong Yat Cheung
ad24594d10 Big window fix for Win32. Big windows are still emulated within 16-bit
2005-03-12  Ivan, Wong Yat Cheung  <email@ivanwong.info>

	Big window fix for Win32. Big windows are still emulated within
	16-bit coordinate limits, though. Big windows now work on NT-based
	Windows. (#169989)

	* gdk/win32/gdkgc-win32.c (_gdk_win32_gdkregion_to_hrgn): Use
	32-bit coordinates.

	* gdk/win32/gdkgeometry-win32.c: Largely rewrite.

	* gdk/win32/gdkwindow-win32.c: Minor related changes.
2005-03-11 23:50:21 +00:00
Tor Lillqvist
e34f0452b4 Fix for #162790, by Iwan Wong:
2005-01-12  Tor Lillqvist  <tlillqvist@novell.com>

	Fix for #162790, by Iwan Wong:

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

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

	* gdk/win32/gdkgc-win32.c: Set up above new fields.
2005-01-12 21:28:03 +00:00
Hans Breuer
6a3a2cd344 updated
2004-11-21  Hans Breuer  <hans@breuer.org>

	* gdk/makefile.msc.in gtk/stock-icons/makefile.msc
	  gtk/makefile.msc.in demos/gtk-demo/makefile.msc.in : updated

	* gdk/win32/gdkdrawable-win32.c : implement gdk_win32_draw_glyphs_transformed()
	* gdk/win32/gdkgc-win32.c : implement _gdk_windowing_gc_get_foreground()

	* demos/gtk-demo/rotated_text.c : use G_PI
2004-11-21 21:01:28 +00:00
Manish Singh
60b30ff513 gdk/linux-fb/gdkgc-fb.c gdk/win32/gdkgc-win32.c
Fri Nov 19 14:54:09 2004  Manish Singh  <yosh@gimp.org>

        * gdk/linux-fb/gdkgc-fb.c
        * gdk/win32/gdkgc-win32.c
        * gdk/win32/gdkwindow-win32.c
        * gtk/gtkaboutdialog.c
        * gtk/gtkaction.c
        * gtk/gtkactiongroup.c
        * gtk/gtkcellrendererprogress.c
        * gtk/gtkcellview.c
        * gtk/gtkcolorbutton.c
        * gtk/gtkcombobox.c
        * gtk/gtkcomboboxentry.c
        * gtk/gtkentrycompletion.c
        * gtk/gtkfilechooserbutton.c
        * gtk/gtkmenutoolbutton.c
        * gtk/gtkrc.c
        * gtk/gtksettings.c
        * gtk/gtkstyle.c
        * gtk/gtktoggletoolbutton.c
        * gtk/gtktoolbutton.c
        * gtk/gtktoolitem.c
        * gtk/gtktreemodelfilter.c
        * gtk/gtktreeselection.c
        * gtk/gtktreeviewcolumn.c
        * gtk/gtkuimanager.c: get rid of unnecessary casts.

        * gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_set_property):
        cast away the const for g_value_set_enum. This is after the g_warning,
        so this is a hack to begin with.

        * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_set_property):
        add a cast to GTK_FILE_CHOOSER for impl here.
2004-11-19 23:18:38 +00:00
Tor Lillqvist
a841d12888 gdk/win32/gdkprivate-win32.h gdk/win32/gdkglobals-win32.c Remove
2004-10-31  Tor Lillqvist  <tml@iki.fi>

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

	* gdk/win32/*.c: Use G_WIN32_IS_NT_BASED() from GLib instead.
2004-10-31 14:47:15 +00:00
Tor Lillqvist
f215db2b12 Plug memory leak. (#140775, John Ehresman)
2004-04-29  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Plug memory
	leak. (#140775, John Ehresman)
2004-04-29 10:06:12 +00:00
Tor Lillqvist
de2332ee9a Don't just copy the whole GdkGCWin32 with a single assignment, that
2004-03-15  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkgc-win32.c (gdk_gc_copy): Don't just copy the whole
	GdkGCWin32 with a single assignment, that overwrites GObject's
	private data (for instance ref_count). (#137012, John Ehresman)
2004-03-15 11:55:55 +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
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
323bcc614d Fix for #111028, thanks to J. Ali Harlow, who writes: I found that the
2003-06-28  Tor Lillqvist  <tml@iki.fi>

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

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

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

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

	* gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap)
	* gdk/win32/gdkdrawable-win32.c (blit_from_pixmap)
	* gdk/win32/gdkgc-win32.c (_gdk_win32_bitmap_to_hrgn)
	* gdk/win32/gdkmain-win32.c (_gdk_win32_drawable_description):
	* gdk/win32/gdkpixmap-win32.c (gdk_pixmap_impl_win32_finalize,
	gdk_pixmap_new, gdk_bitmap_create_from_data, gdk_pixmap_foreign_new)
	Corresponding changes.
2003-06-28 01:12:51 +00:00
Tor Lillqvist
37ccf562d7 Set graphics_exposures and subwindow_mode, too, even if they aren't
2003-06-06  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkgc-win32.c (_gdk_win32_gc_new): Set
	graphics_exposures and subwindow_mode, too, even if they aren't
	currently used.
2003-06-06 22:55:55 +00:00
Tor Lillqvist
7ed6dc1da8 Minor cosmetics.
2002-12-17  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkglobals-win32.c: Minor cosmetics.

	Implement two missing functions (#101369)

	* gdk/win32/gdkevents-win32.c
	(gdk_display_add_client_message_filter): Implement by calling
	gdk_add_client_message_filter(), no separate displays on Windows,
	at least not yet.

	* gdk/win32/gdkgc-win32.c (gdk_gc_get_screen): Implement by
	returning the only screen so far, _gdk_screen.
2002-12-17 01:39:11 +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
fda3e29611 Reflect recent renamings and removals of functions.
2002-11-15  Tor Lillqvist  <tml@iki.fi>

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

	Merge from stable:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	Merge from stable:

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

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

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

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

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

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

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

	Bug #79720 should be fixed now.

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

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

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

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

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

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

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

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

	(gdk_event_get_graphics_expose): A bit more verbose debugging output.

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

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

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

	(gdk_text_size): Remove, unused.

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

	(gdk_gc_copy): Increase refcount on colormap if present.

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

	(_gdk_win32_bitmap_to_hrgn): Rename from _gdk_win32_bitmap_to_region.

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

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

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

	(gdk_window_scroll): Don't do guffaw scrolling.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	* gdk/win32/gdkdisplay-win32.c
	* gdk/win32/gdkmain-win32.c
	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkselection-win32.c
	* gdk/win32/gdkinput-win32.h
	* gdk/win32/gdkinput.c: Make it compile again, pass a GdkDisplay in
	a couple of places.
2002-09-19 23:27:10 +00:00
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
Hans Breuer
fe60d43a26 Fixed dashed line issues (#74441) to an IMO reasonable extend. That is:
2002-03-29  Hans Breuer  <hans@breuer.org>

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

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

	* gdk/win32/gdkkeys-win32.c (gdk_keyval_name) : return NULL
	for keyval == 0 to avoid to have zeros in all menu entries
	without accelerator.
2002-03-28 23:25:33 +00:00
Tor Lillqvist
1ffa06c6a5 Don't clear all of the pen_style, just the PS_STYLE_MASK. Seems to fix
2002-03-22  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Don't clear
	all of the pen_style, just the PS_STYLE_MASK. Seems to fix #74441,
	but that is just the special case of one-pixel wide one-pixel
	on-off dotted lines. To fully implement generic X11 style dashed
	lines a major rewrite would be needed.
2002-03-21 22:36:02 +00:00
Tor Lillqvist
3244b86dd6 Move bdfcursor.c from libgdk_win32_la_SOURCES to EXTRA_DIST.
2002-02-28  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/Makefile.am: Move bdfcursor.c from
	libgdk_win32_la_SOURCES to EXTRA_DIST.

	* gdk/win32/gdkgc-win32.c (gdk_win32_colormap_color_pack): In the
	bitmap case, use just the LSB of the pixel value. Does this match
	X11 semantics? Or should it be pixel!=0?
2002-02-28 00:49:36 +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
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
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
Tor Lillqvist
a53f14a6e3 New file, hand-written wrapper for the Wintab library.
2001-10-29  Tor Lillqvist  <tml@iki.fi>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Miscellaneous fixes:

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

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

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

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

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

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

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

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

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

      Add some space for future expansion to multihead.

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

	* gtk/gtkwindow.h gtk/gtkinvisible.h: Add reserved pointer
	where we can put a GdkScreen * later.
2001-09-07 21:50:20 +00:00
Hans Breuer
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
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
1fa43ed5b4 updated exports
2001-01-06  Hans Breuer  <hans@breuer.org>

	* gdk/gdk.def : updated exports

	* gdk/win32/makefile.msc : -DGDK_ENABLE_BROKEN otherwise
	gdk won't compile anymore

	* gdk/win32/gdkevents-win32.c : initialize ret_val when
	processing GDK_FILTER functions, initialize event.key->hardware_keycode.
	Improved gdk_flush () to not only do pending drawing operations
	but also process all currently pending events. This should make
	the behaviour more similar to the X11 version.

	* gdk/win32/gdkgc-win32.c (predraw_set_background) : a background
	option needs to be set even if there is no GDK_GC_BACKGROUND.
	(gdk_win32_hdc_get) : use predraw_set_background () independent
	of value_mask. This allows to draw dashed lines leaving the original
	background intact.

	* gdk/win32/gdkimage-win32.c (gdk_image_new_bitamp) : free data
	after processing, because we can't reuse it as the X11 version does.

	* gtk/gtk.def : updated exports

	* gtk/makefile.msc.in : added ATK, removed all test apps. (I
	would like to get rid of this file again, and use straight
	makefile.msc again, as the other Gtk+ subdirs do)

	* test/makefile.msc (new file) : build the test apps here
2001-05-06 14:02:45 +00:00
Hans Breuer
0f6d1b4a27 updated
2001-03-10  Hans Breuer  <hans@breuer.org>

	* gdk/gdk.def : updated

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

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

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

	* gdk/win32/gdkprivate-win32.h : added _gdk_window_process_expose
	prototype
2001-03-10 18:13:03 +00:00
Tor Lillqvist
2e70f892cc Add gdkkeys.
2000-12-15  Tor Lillqvist  <tml@iki.fi>

	* gdk/makefile.{mingw.in,msc} (gdk_OBJECTS): Add gdkkeys.

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

	* gdk/win32/gdkmain-win32.c
	* gdk/win32/gdkkeys-win32.c: New file. Move some functions from
	gdkmain-win32.c here.

	* gdk/win32/makefile.mingw.in (all): No need to make
	gdk-win32res.o here, the makefile one step up will call us to make
	it.

	* gdk/win32/makefile.{mingw.in,msc} (gdk_win32_OBJECTS): Add
	gdkkeys-win32.

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

	* gdk/win32/gdkevents-win32.c (gdk_events_init): Remove leftover
	call to g_source_add().

	* gdk/win32/gdkgc-win32.c (BitmapToRegion): Plug memory
	leak. Thanks to Andreas Kemnade.
2000-12-14 23:14:18 +00:00
Tor Lillqvist
68ae419bfb Changes by Hans Breuer:
2000-11-30  Tor Lillqvist  <tml@iki.fi>

	Changes by Hans Breuer:

	* gdk/win32/gdkwindow-win32.c (gdk_window_set_geometry_hints):
	Dont't use negative width and height as max_hints. This fixes
	Owen's recent testgtk changes for win32.

	* gdk/win32/gdkgc-win32.c (gdk_win32_hdc_get,
	gdk_win32_hdc_release): These are exported and may be called with
	other drawable types than our GdkDrawableImplWin32 (?).

	* gdk/gdkwindow.c: Backing store appears to work on Windows now,
	so always #define USE_BACKING_STORE.

	* gtk/gtktextdisplay.c (render_layout_line): Use g_print instead
	of printf for debugging output.

	* gtk/gtktextlayout.c (allocate_child_widgets): Ditto.

	* gtk/gtktextview.c (gtk_text_view_child_allocated): Ditto.

	* gtk/gtkmain.h (GTKMAIN_C_VAR): Win32 fix for dllimport
	declaration.

	* gtk/gtktexttypes.h: Ditto.

	* gtk/gtklabel.c (gtk_label_set_markup_with_accel): Return a value
	(GDK_VoidSymbol) also if in case of arg check failure.

	* gtk/gtkimcontextsimple.c
	(gtk_im_context_simple_get_preedit_string): Don't assign cursor
	position to the pointer, but to the variable it points to.

	* gtk/makefile.msc.in (DEFINES): Define GTK_VERSION.

	* gtk/gtk.def: Updates.
2000-11-30 23:39:50 +00:00
Tor Lillqvist
22a0c3a5f5 gdk/gdk.def Update.
2000-11-11  Tor Lillqvist  <tml@iki.fi>

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

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

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

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

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

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

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

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

	* gdk_pixbuf.def: Add gdk_pixbuf_new_subpixbuf.
2000-11-11 18:39:57 +00:00
Tor Lillqvist
f49a2a0055 gdk/win32/gdkgc-win32.c Remove gcc -Wall warnings.
2000-10-22  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkgc-win32.c
	* gdk/win32/gdkimage-win32.c: Remove gcc -Wall warnings.

	Patches by Hans Breuer:

	* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_glyphs): Call
	SetBkMode() and SetTextAlign() before calling
	pango_win32_render().

	* gdk/win32/gdkgc-win32.c (gdk_win32_gc_values_to_win32values):
	Set hcliprgn to NULL after destroying it.
	(gdk_gc_set_clip_rectangle): Delete hcliprgn and set to NULL.

	* gdk/win32/gdkgeometry-win32.c
	(_gdk_windowing_window_queue_antiexpose): More effective
	implementation.

	* gdk/win32/gdkpixmap-win32.c (gdk_pixmap_new): Use drawable's
	depth as default, not the visual's.

	* gdk/win32/gdkwindow-win32.c (gdk_window_set_title): Guard
	against empty title.

	* gdk/win32/gdkprivate-win32.h: Define a helper macro,
	IMAGE_PRIVATE_DATA.

	* gdk/win32/gdkimage-win32.c (gdk_image_get_type): Use it.
2000-10-22 17:16:42 +00:00
Tor Lillqvist
658b4b1da8 Update.
2000-10-09  Tor Lillqvist  <tml@iki.fi>

	* README.win32: Update.

	* gdk/win32/gdkgeometry-win32.c (gdk_window_clip_changed): Add two
	lines that had been deleted by mistake (?).

	* gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap): Handle
	also the case fg==white and bg==black (but still not randomly
	coloured cursors). Thanks to Wolfgang Sourdeau.

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

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

	Fixes by Hans Breuer:

	* gdk/makefile.msc
	* gdk/win32/makefile.msc: Update.

	* gdk/testgdk.c: If compiling with debugging (with _DEBUG defined,
	some MSVC thing, presumably), cause breakpoint on failures. Add
	GDK_NOR case. Call g_log_set_always_fatal.

	* gdk/win32/gdkwin32id.c (gdk_win32_handle_table_insert): Handle
	should be pased by reference.

	* gdk/win32/gdkprivate-win32.h: Correct declaration accordingly.

	* gdk/win32/*.c: Correct calls to gdk_win32_handle_table_insert.

	* gdk/win32/gdkevents-win32.c
	* gdk/win32/gdkwindow-win32.c: Handle WM_CREATE.

	* gdk/win32/gdkgc-win32.c: Fix mixups of drawable and
	implementation object.

	* gdk/win32/gdkimage-win32.c (gdk_image_get): Handle drawables,
	not just windows.

	* gdk/win32/gdkpixmap-win32.c (gdk_pixmap_impl_win32_finalize):
	Use the wrapper object.
2000-10-09 19:49:42 +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
5ac61d3eee Include the build directory.
2000-07-25  Tor Lillqvist  <tml@iki.fi>

	* Makefile.am: Include the build directory.

	* configure.in: Generate build/Makefile and build/win32/Makefile.

	* config.h.win32: Add USE_GMODULE and USE_MMX for gdk-pixbuf.

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

	* gdk/makefile.mingw.in: Define GDK_COMPILATION. Link with
	PANGOWIN32_LIBS and gdk_pixbuf.

	* gdk/win32: Compiles, but no doubt doesn't work at all.

	* gdk/win32/makefile.mingw.in: Define GDK_COMPILATION.

	* gdk/win32/gdkinput.c: New file, temporarily.

	* gdk/win32/gdkinput-win32.h: New file

	* gdk/win32/gdkinputprivate.h: Remove.

	* gtk/gtkrc.[ch] (gtk_win32_get_installation_directory): Renamed and
	made externally visible.
2000-07-25 17:31:05 +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
20b5d8ec2f More work on GDK for Win32. Still in an intermediate state.
2000-07-23  Tor Lillqvist  <tml@iki.fi>

	More work on GDK for Win32. Still in an intermediate state.

	* gdk/makefile.cygwin
	* gdk/win32/makefile.cygwin: Removed.

	* gdk/makefile.mingw.in
	* gdk/win32/makefile.mingw.in: New files.

	* gdk/Makefile.am
	* gdk/win32/Makefile.am: Generate and distribute them.

	* gdk/win32/gdkwindow-win32.h
	* gdk/win32/gdkdrawable-win32.h
	* gdk/win32/gdkpixmap-win32.h: New files.

	* gdk/win32/gdkcolor-win32.c
	* gdk/win32/gdkcursor-win32.c
	* gdk/win32/gdkgc-win32.c
	* gdk/win32/gdkimage-win32.c
	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkwin32.h: Update data structures. Cosmetics:
	don't use fields and variables called xcursor, xid, etc (leftovers
	from the X11 backend).
2000-07-23 01:18:34 +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
8596f7edc5 Plug same refcount leaks as in the X11 backend.
2000-05-17  Tor Lillqvist  <tml@iki.fi>

* gdk/win32/gdkevents-win32.c (gdk_event_translate): Plug same
refcount leaks as in the X11 backend.

* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_values): Logging
cosmetics.

* gdk/win32/gdkwindow-win32.c: Similar changes as in X11
backend. Add _gdk_windowing_window_destroy().

* gtk/gtkcolorsel.c: Include correct backend-specific header.
Don't use XColor unless on X11. (No GDK_VISUAL_STATIC_COLOR
either, but these probably do exist on nanox?)

* gtk/gtkhsv.c: Use G_PI (fresh from <glib.h>) instead of M_PI
which isn't necessarily defined by <math.h>.

* gtk/gtkobject.c (gtk_object_init): Don't go up the class
ancestry past GtkObject.

* gtk/gtktypeutils.h: Mark GTK_TYPE_IDENTIFIER for export/import
from DLL on Win32.

* gtk/gtk.def: Update corresponding to recent changes.

* gtk/makefile.{cygwin,msc}: Updates.
2000-05-16 21:27:10 +00:00