gdk/win32/gdkdraw.c gdk/win32/gdkfont.c Various minor cleanups and

1999-11-08  Tor Lillqvist  <tml@iki.fi>

* gdk/win32/gdkdraw.c
* gdk/win32/gdkfont.c
* gdk/win32/gdkgc.c: Various minor cleanups and bugfixes
following yesterday's changes. (Unrelated to Owen's reorg.)
This commit is contained in:
Tor Lillqvist 1999-11-08 21:34:06 +00:00 committed by Tor Lillqvist
parent 5491cd971d
commit b5f414a1a5
13 changed files with 99 additions and 32 deletions

View File

@ -1,3 +1,10 @@
1999-11-08 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkdraw.c
* gdk/win32/gdkfont.c
* gdk/win32/gdkgc.c: Various minor cleanups and bugfixes
following yesterday's changes. (Unrelated to Owen's reorg.)
Mon Nov 8 16:18:25 1999 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkinput-gxi.c: Add missing include,

View File

@ -1,3 +1,10 @@
1999-11-08 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkdraw.c
* gdk/win32/gdkfont.c
* gdk/win32/gdkgc.c: Various minor cleanups and bugfixes
following yesterday's changes. (Unrelated to Owen's reorg.)
Mon Nov 8 16:18:25 1999 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkinput-gxi.c: Add missing include,

View File

@ -1,3 +1,10 @@
1999-11-08 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkdraw.c
* gdk/win32/gdkfont.c
* gdk/win32/gdkgc.c: Various minor cleanups and bugfixes
following yesterday's changes. (Unrelated to Owen's reorg.)
Mon Nov 8 16:18:25 1999 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkinput-gxi.c: Add missing include,

View File

@ -1,3 +1,10 @@
1999-11-08 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkdraw.c
* gdk/win32/gdkfont.c
* gdk/win32/gdkgc.c: Various minor cleanups and bugfixes
following yesterday's changes. (Unrelated to Owen's reorg.)
Mon Nov 8 16:18:25 1999 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkinput-gxi.c: Add missing include,

View File

@ -1,3 +1,10 @@
1999-11-08 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkdraw.c
* gdk/win32/gdkfont.c
* gdk/win32/gdkgc.c: Various minor cleanups and bugfixes
following yesterday's changes. (Unrelated to Owen's reorg.)
Mon Nov 8 16:18:25 1999 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkinput-gxi.c: Add missing include,

View File

@ -1,3 +1,10 @@
1999-11-08 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkdraw.c
* gdk/win32/gdkfont.c
* gdk/win32/gdkgc.c: Various minor cleanups and bugfixes
following yesterday's changes. (Unrelated to Owen's reorg.)
Mon Nov 8 16:18:25 1999 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkinput-gxi.c: Add missing include,

View File

@ -1,3 +1,10 @@
1999-11-08 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkdraw.c
* gdk/win32/gdkfont.c
* gdk/win32/gdkgc.c: Various minor cleanups and bugfixes
following yesterday's changes. (Unrelated to Owen's reorg.)
Mon Nov 8 16:18:25 1999 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkinput-gxi.c: Add missing include,

View File

@ -447,13 +447,13 @@ gdk_draw_text_handler (GdkWin32SingleFont *singlefont,
int wclen,
void *arg)
{
HDC hdc;
HGDIOBJ oldfont;
SIZE size;
GdkDrawablePrivate *drawable_private;
GdkGCPrivate *gc_private;
gdk_draw_text_arg *argp = (gdk_draw_text_arg *) arg;
if (!singlefont)
return;
if ((oldfont = SelectObject (argp->hdc, singlefont->xfont)) == NULL)
{
g_warning ("gdk_draw_text_handler: SelectObject failed");
@ -465,7 +465,7 @@ gdk_draw_text_handler (GdkWin32SingleFont *singlefont,
GetTextExtentPoint32W (argp->hdc, wcstr, wclen, &size);
argp->x += size.cx;
SelectObject (hdc, oldfont);
SelectObject (argp->hdc, oldfont);
}
/* gdk_draw_text
@ -480,7 +480,6 @@ gdk_draw_text (GdkDrawable *drawable,
const gchar *text,
gint text_length)
{
HDC hdc;
GdkDrawablePrivate *drawable_private;
GdkGCPrivate *gc_private;
wchar_t *wcstr;
@ -534,7 +533,6 @@ gdk_draw_text_wc (GdkDrawable *drawable,
const GdkWChar *text,
gint text_length)
{
HDC hdc;
GdkDrawablePrivate *drawable_private;
GdkGCPrivate *gc_private;
gint i, wlen;

View File

@ -447,13 +447,13 @@ gdk_draw_text_handler (GdkWin32SingleFont *singlefont,
int wclen,
void *arg)
{
HDC hdc;
HGDIOBJ oldfont;
SIZE size;
GdkDrawablePrivate *drawable_private;
GdkGCPrivate *gc_private;
gdk_draw_text_arg *argp = (gdk_draw_text_arg *) arg;
if (!singlefont)
return;
if ((oldfont = SelectObject (argp->hdc, singlefont->xfont)) == NULL)
{
g_warning ("gdk_draw_text_handler: SelectObject failed");
@ -465,7 +465,7 @@ gdk_draw_text_handler (GdkWin32SingleFont *singlefont,
GetTextExtentPoint32W (argp->hdc, wcstr, wclen, &size);
argp->x += size.cx;
SelectObject (hdc, oldfont);
SelectObject (argp->hdc, oldfont);
}
/* gdk_draw_text
@ -480,7 +480,6 @@ gdk_draw_text (GdkDrawable *drawable,
const gchar *text,
gint text_length)
{
HDC hdc;
GdkDrawablePrivate *drawable_private;
GdkGCPrivate *gc_private;
wchar_t *wcstr;
@ -534,7 +533,6 @@ gdk_draw_text_wc (GdkDrawable *drawable,
const GdkWChar *text,
gint text_length)
{
HDC hdc;
GdkDrawablePrivate *drawable_private;
GdkGCPrivate *gc_private;
gint i, wlen;

View File

@ -789,12 +789,11 @@ gdk_font_load (const gchar *font_name)
font->ascent = textmetric.tmAscent;
font->descent = textmetric.tmDescent;
GDK_NOTE (MISC, g_print ("... = %#x charset %s codepage %d (max %d bytes) "
GDK_NOTE (MISC, g_print ("... = %#x charset %s codepage %d "
"asc %d desc %d\n",
singlefont->xfont,
charset_name (singlefont->charset),
singlefont->codepage,
singlefont->cpinfo.MaxCharSize,
font->ascent, font->descent));
gdk_font_hash_insert (GDK_FONT_FONTSET, font, font_name);
@ -851,10 +850,16 @@ gdk_fontset_load (gchar *fontset_name)
singlefont = gdk_font_load_internal (s);
if (singlefont)
{
GDK_NOTE
(MISC, g_print ("... = %#x charset %s codepage %d\n",
singlefont->xfont,
charset_name (singlefont->charset),
singlefont->codepage));
private->fonts = g_slist_append (private->fonts, singlefont);
oldfont = SelectObject (gdk_DC, singlefont->xfont);
GetTextMetrics (gdk_DC, &textmetric);
singlefont->charset = GetTextCharsetInfo (gdk_DC, &singlefont->fs, 0);
singlefont->charset =
GetTextCharsetInfo (gdk_DC, &singlefont->fs, 0);
SelectObject (gdk_DC, oldfont);
font->ascent = MAX (font->ascent, textmetric.tmAscent);
font->descent = MAX (font->descent, textmetric.tmDescent);
@ -932,6 +937,7 @@ gdk_font_unref (GdkFont *font)
list = list->next;
}
g_slist_free (private->fonts);
break;
default:
@ -1130,6 +1136,8 @@ gdk_wchar_text_handle (GdkFont *font,
end = wcp + wclen;
private = (GdkFontPrivate *) font;
g_assert (private->ref_count > 0);
while (wcp < end)
{
/* Split Unicode string into pieces of the same class */
@ -1175,6 +1183,9 @@ gdk_text_size_handler (GdkWin32SingleFont *singlefont,
HGDIOBJ oldfont;
gdk_text_size_arg *arg = (gdk_text_size_arg *) argp;
if (!singlefont)
return;
if ((oldfont = SelectObject (gdk_DC, singlefont->xfont)) == NULL)
{
g_warning ("gdk_text_size_handler: SelectObject failed");
@ -1208,12 +1219,9 @@ gdk_text_size (GdkFont *font,
wcstr = g_new (wchar_t, text_length);
if ((wlen = gdk_nmbstowchar_ts (wcstr, text, text_length, text_length)) == -1)
{
g_warning ("gdk_text_size: gdk_nmbstowchar_ts failed");
return FALSE;
}
gdk_wchar_text_handle (font, wcstr, wlen, gdk_text_size_handler, arg);
g_warning ("gdk_text_size: gdk_nmbstowchar_ts failed");
else
gdk_wchar_text_handle (font, wcstr, wlen, gdk_text_size_handler, arg);
g_free (wcstr);
@ -1347,6 +1355,8 @@ gdk_text_extents (GdkFont *font,
else
gdk_wchar_text_handle (font, wcstr, wlen, gdk_text_size_handler, &arg);
g_free (wcstr);
/* XXX This is quite bogus */
if (lbearing)
*lbearing = 0;

View File

@ -789,12 +789,11 @@ gdk_font_load (const gchar *font_name)
font->ascent = textmetric.tmAscent;
font->descent = textmetric.tmDescent;
GDK_NOTE (MISC, g_print ("... = %#x charset %s codepage %d (max %d bytes) "
GDK_NOTE (MISC, g_print ("... = %#x charset %s codepage %d "
"asc %d desc %d\n",
singlefont->xfont,
charset_name (singlefont->charset),
singlefont->codepage,
singlefont->cpinfo.MaxCharSize,
font->ascent, font->descent));
gdk_font_hash_insert (GDK_FONT_FONTSET, font, font_name);
@ -851,10 +850,16 @@ gdk_fontset_load (gchar *fontset_name)
singlefont = gdk_font_load_internal (s);
if (singlefont)
{
GDK_NOTE
(MISC, g_print ("... = %#x charset %s codepage %d\n",
singlefont->xfont,
charset_name (singlefont->charset),
singlefont->codepage));
private->fonts = g_slist_append (private->fonts, singlefont);
oldfont = SelectObject (gdk_DC, singlefont->xfont);
GetTextMetrics (gdk_DC, &textmetric);
singlefont->charset = GetTextCharsetInfo (gdk_DC, &singlefont->fs, 0);
singlefont->charset =
GetTextCharsetInfo (gdk_DC, &singlefont->fs, 0);
SelectObject (gdk_DC, oldfont);
font->ascent = MAX (font->ascent, textmetric.tmAscent);
font->descent = MAX (font->descent, textmetric.tmDescent);
@ -932,6 +937,7 @@ gdk_font_unref (GdkFont *font)
list = list->next;
}
g_slist_free (private->fonts);
break;
default:
@ -1130,6 +1136,8 @@ gdk_wchar_text_handle (GdkFont *font,
end = wcp + wclen;
private = (GdkFontPrivate *) font;
g_assert (private->ref_count > 0);
while (wcp < end)
{
/* Split Unicode string into pieces of the same class */
@ -1175,6 +1183,9 @@ gdk_text_size_handler (GdkWin32SingleFont *singlefont,
HGDIOBJ oldfont;
gdk_text_size_arg *arg = (gdk_text_size_arg *) argp;
if (!singlefont)
return;
if ((oldfont = SelectObject (gdk_DC, singlefont->xfont)) == NULL)
{
g_warning ("gdk_text_size_handler: SelectObject failed");
@ -1208,12 +1219,9 @@ gdk_text_size (GdkFont *font,
wcstr = g_new (wchar_t, text_length);
if ((wlen = gdk_nmbstowchar_ts (wcstr, text, text_length, text_length)) == -1)
{
g_warning ("gdk_text_size: gdk_nmbstowchar_ts failed");
return FALSE;
}
gdk_wchar_text_handle (font, wcstr, wlen, gdk_text_size_handler, arg);
g_warning ("gdk_text_size: gdk_nmbstowchar_ts failed");
else
gdk_wchar_text_handle (font, wcstr, wlen, gdk_text_size_handler, arg);
g_free (wcstr);
@ -1347,6 +1355,8 @@ gdk_text_extents (GdkFont *font,
else
gdk_wchar_text_handle (font, wcstr, wlen, gdk_text_size_handler, &arg);
g_free (wcstr);
/* XXX This is quite bogus */
if (lbearing)
*lbearing = 0;

View File

@ -29,6 +29,7 @@
#include <string.h>
#include "gdkgc.h"
#include "gdkfont.h"
#include "gdkpixmap.h"
#include "gdkprivate.h"
#include "gdkx.h"
@ -92,7 +93,7 @@ gdk_gc_new_with_values (GdkWindow *window,
{
private->font = values->font;
gdk_font_ref (private->font);
GDK_NOTE (MISC, g_print (" font=%#x", private->font));
GDK_NOTE (MISC, g_print (" font"));
}
else
private->font = NULL;

View File

@ -29,6 +29,7 @@
#include <string.h>
#include "gdkgc.h"
#include "gdkfont.h"
#include "gdkpixmap.h"
#include "gdkprivate.h"
#include "gdkx.h"
@ -92,7 +93,7 @@ gdk_gc_new_with_values (GdkWindow *window,
{
private->font = values->font;
gdk_font_ref (private->font);
GDK_NOTE (MISC, g_print (" font=%#x", private->font));
GDK_NOTE (MISC, g_print (" font"));
}
else
private->font = NULL;