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.
This commit is contained in:
Tor Lillqvist
2000-11-30 23:39:50 +00:00
committed by Tor Lillqvist
parent 094159e431
commit 68ae419bfb
19 changed files with 327 additions and 41 deletions

View File

@ -961,14 +961,22 @@ gdk_win32_hdc_get (GdkDrawable *drawable,
GdkGCValuesMask usage)
{
GdkGCWin32 *win32_gc = (GdkGCWin32 *) gc;
GdkDrawableImplWin32 *impl;
gboolean ok = TRUE;
int flag;
g_assert (win32_gc->hdc == NULL);
win32_gc->hwnd = GDK_DRAWABLE_IMPL_WIN32(drawable)->handle;
if (GDK_IS_DRAWABLE_IMPL_WIN32 (drawable))
impl = GDK_DRAWABLE_IMPL_WIN32(drawable);
else if (GDK_IS_WINDOW (drawable))
impl = ((GdkWindowObject *) drawable)->impl;
else if (GDK_IS_PIXMAP (drawable))
impl = ((GdkPixmapObject *) drawable)->impl;
if (GDK_IS_PIXMAP_IMPL_WIN32 (drawable))
win32_gc->hwnd = impl->handle;
if (GDK_IS_PIXMAP_IMPL_WIN32 (impl))
{
if ((win32_gc->hdc = CreateCompatibleDC (NULL)) == NULL)
WIN32_GDI_FAILED ("CreateCompatibleDC"), ok = FALSE;
@ -989,12 +997,12 @@ gdk_win32_hdc_get (GdkDrawable *drawable,
}
if (ok && (usage & GDK_GC_FOREGROUND))
predraw_set_foreground (gc, GDK_DRAWABLE_IMPL_WIN32 (drawable)->colormap, &ok);
predraw_set_foreground (gc, impl->colormap, &ok);
if (ok
&& (usage & GDK_GC_BACKGROUND)
&& (win32_gc->values_mask & GDK_GC_BACKGROUND))
predraw_set_background (gc, GDK_DRAWABLE_IMPL_WIN32 (drawable)->colormap, &ok);
predraw_set_background (gc, impl->colormap, &ok);
if (ok && (usage & GDK_GC_FONT))
{
@ -1148,9 +1156,17 @@ gdk_win32_hdc_release (GdkDrawable *drawable,
GdkGCValuesMask usage)
{
GdkGCWin32 *win32_gc = (GdkGCWin32 *) gc;
GdkDrawableImplWin32 *impl;
HGDIOBJ hpen = NULL;
HGDIOBJ hbr = NULL;
if (GDK_IS_DRAWABLE_IMPL_WIN32 (drawable))
impl = GDK_DRAWABLE_IMPL_WIN32(drawable);
else if (GDK_IS_WINDOW (drawable))
impl = ((GdkWindowObject *) drawable)->impl;
else if (GDK_IS_PIXMAP (drawable))
impl = ((GdkPixmapObject *) drawable)->impl;
if (usage & GDK_GC_FOREGROUND)
{
if ((hpen = GetCurrentObject (win32_gc->hdc, OBJ_PEN)) == NULL)
@ -1172,7 +1188,7 @@ gdk_win32_hdc_release (GdkDrawable *drawable,
WIN32_GDI_FAILED ("UnrealizeObject");
}
#endif
if (GDK_IS_PIXMAP_IMPL_WIN32 (drawable))
if (GDK_IS_PIXMAP_IMPL_WIN32 (impl))
{
if (!DeleteDC (win32_gc->hdc))
WIN32_GDI_FAILED ("DeleteDC");

View File

@ -179,6 +179,7 @@ gdk_window_impl_win32_set_colormap (GdkDrawable *drawable,
GDK_DRAWABLE_GET_CLASS (draw_impl)->set_colormap (drawable, cmap);
/* XXX */
g_print("gdk_window_impl_win32_set_colormap: XXX\n");
}
static void
@ -1313,9 +1314,13 @@ gdk_window_set_geometry_hints (GdkWindow *window,
rect.bottom = geometry->max_height;
dwStyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE);
dwExStyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE);
AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle);
/* HB: dont' know why AdjustWindowRectEx is called here, ... */
SafeAdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle);
impl->hint_max_width = rect.right - rect.left;
impl->hint_max_height = rect.bottom - rect.top;
/* ... but negative sizes are always wrong */
if (impl->hint_max_width < 0) impl->hint_max_width = G_MAXSHORT;
if (impl->hint_max_height < 0) impl->hint_max_height = G_MAXSHORT;
/* Again, check if the window is too large currently. */
GetClientRect (GDK_WINDOW_HWND (window), &rect);