Huge GtkFB patch with lots of small bugfixes and initial selections implementation.

2000-11-23  Alexander Larsson  <alexl@redhat.com>

	* gdk/linux-fb/gdkselection-fb.c:
	Initial selection implementation.

	* gtk/gtkselection.c:
	if GDK_WINDOWING_FB defined, include linux-fb/gdkfb.h and look up
	requestor in gtk_selection_request.

	* gdk/linux-fb/gdkfb.h, gdk/linux-fb/gdkglobals-fb.c:
	Added gdk_selection_property atom.

	* gdk/linux-fb/gdkprivate-fb.h:
	Export _gdk_selection_window_destroyed.
	Removed mask_off_x/y from GdkCursorPrivateFB.
	Removed hbearing, added top, left to PangoFBGlyphInfo.

	* gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_destroy):
	Call _gdk_selection_window_destroyed
	(_gdk_windowing_window_init): Don't call gdk_cursor_new() before
	the root window has been created.
	(static_dx_hack, static_dy_hack, compare_draw_rects,
	gdk_fb_window_move_resize): Remove unnecessary sort of rectangles
	in region. They are already sorted. Instead just traverse them in
	reverse if draw_direction < 0.

	* gdk/linux-fb/gdkinput-ps2.c (send_button_event):
	Double-clicks must be sent after the normal button_press.
	(gdk_fb_cursor_unhide): Remove usage of mask_off_x/y. Clean up.

	* gdk/linux-fb/gdkgeometry-fb.c (gdk_window_scroll):
	Pass _gdk_fb_screen_gc instead of NULL.

	* gdk/linux-fb/gdkmain-fb.c (_gdk_windowing_init_check):
	Initialize gdk_selection_property.
	(gdk_event_make): Remove unused code.

	* gdk/linux-fb/gdkcursor-fb.c:
	Make the pixmap for the cursor the same size as the mask. Also remove
	the mask_off_x/y fields in GdkCursorPrivateFB and combine
	_gdk_cursor_new_from_pixmap() and gdk_cursor_new_from_pixmap()
	Now the whole cursor is visible.

	* gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_drawable_3):
	Fix bug where xdest+height instead of ydest+height was used
	to calculate if the source and dest overlapped. This fixes the
	redraw bug when the main window in testgtk was scrolled when
	partially covered by a tall window.
	Copy rectangles in region in order depending on draw_direction.
	Also moved the draw_direction flipping of start_y and end_y into
	the gc functions, as this might not be what all of them want.
	(gdk_fb_draw_lines): Support dashed lines.
	(gdk_fb_draw_glyphs): Clean up glyph placement. Also fix positioning
	so that the text is positioned correctly (was 1 pixel high).

	gdk/linux-fb/gdkgc-fb.c:
	Initialize cap_style to GTK_CAP_BUTT. This fixes a problem where
	all lines were drawn a pixel to short. Also checked the default of
	the rest of the values, and they're the same as X now.

	* gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_glyph_info):
	Clean up pixel positioning of the glyphs. Just use bgy->top and
	bgy->left. Also used PANGO_PIXEL where appropriate and added 0.5
	to all divisions to get correct rounding behaviour.

	* gdk/linux-fb/gdkrender-fb.c (gdk_fb_draw_drawable_generic,
	gdk_fb_draw_drawable_memmove, gdk_fb_draw_drawable_aa_24):
	Moved start_y/end_y flip into draw_drawable implementations.
	Flip also x rendering when draw_direction < 0.
	Remove unneccesary multiply with draw_direction.
This commit is contained in:
Alexander Larsson
2000-11-25 15:44:35 +00:00
committed by Alexander Larsson
parent f8cec46535
commit 1c805555ce
21 changed files with 988 additions and 189 deletions

View File

@ -477,7 +477,7 @@ pango_fb_font_get_glyph_info (PangoFont *font, PangoGlyph glyph)
PangoRectangle *my_logical_rect, *my_ink_rect;
FT_Face ftf;
gboolean free_buffer = FALSE;
ftf = fbf->ftf;
pango_fb_font_set_size (font);
@ -511,6 +511,8 @@ pango_fb_font_get_glyph_info (PangoFont *font, PangoGlyph glyph)
g_error ("Glyph render failed");
renderme = &bgy->bitmap;
pgi->top = bgy->top;
pgi->left = bgy->left;
free_buffer = TRUE;
}
else
@ -542,21 +544,19 @@ pango_fb_font_get_glyph_info (PangoFont *font, PangoGlyph glyph)
my_logical_rect = &pgi->extents[1];
{
my_ink_rect->width = (PANGO_SCALE * g->metrics.width) >> 6;
my_ink_rect->height = (PANGO_SCALE * g->metrics.height) >> 6;
my_ink_rect->x = - ((PANGO_SCALE * g->metrics.horiBearingX) >> 6);
my_ink_rect->y = - ((PANGO_SCALE * g->metrics.horiBearingY) >> 6);
my_ink_rect->width = (PANGO_SCALE * g->metrics.width + 32) >> 6;
my_ink_rect->height = (PANGO_SCALE * g->metrics.height + 32) >> 6;
my_ink_rect->x = - ((PANGO_SCALE * g->metrics.horiBearingX + 32) >> 6);
my_ink_rect->y = - ((PANGO_SCALE * g->metrics.horiBearingY + 32) >> 6);
}
{
my_logical_rect->width = (PANGO_SCALE * g->metrics.horiAdvance) >> 6;
my_logical_rect->height = (PANGO_SCALE * ftf->size->metrics.height) >> 6;
my_logical_rect->x = - ((PANGO_SCALE * g->metrics.horiBearingX) >> 6);
my_logical_rect->y = - ((PANGO_SCALE * ftf->size->metrics.ascender) >> 6);
my_logical_rect->width = (PANGO_SCALE * g->metrics.horiAdvance + 32) >> 6;
my_logical_rect->height = (PANGO_SCALE * ftf->size->metrics.height + 32) >> 6;
my_logical_rect->x = - ((PANGO_SCALE * g->metrics.horiBearingX + 32) >> 6);
my_logical_rect->y = - ((PANGO_SCALE * ftf->size->metrics.ascender + 32) >> 6);
}
pgi->hbearing = ((-g->metrics.horiBearingY) >> 6);
g_hash_table_insert (fbf->glyph_info, GUINT_TO_POINTER(glyph), pgi);
return pgi;
@ -680,7 +680,7 @@ pango_fb_font_set_size (PangoFont *font)
if (PANGO_FB_FONT (font)->desc.size != GPOINTER_TO_UINT (fbf->ftf->generic.data))
{
fbf->ftf->generic.data = GUINT_TO_POINTER (PANGO_FB_FONT (font)->desc.size);
FT_Set_Char_Size (fbf->ftf, 0, (PANGO_FB_FONT (font)->desc.size << 6)/PANGO_SCALE, 72, 72);
FT_Set_Char_Size (fbf->ftf, 0, PANGO_PIXELS (PANGO_FB_FONT (font)->desc.size << 6), 72, 72);
}
}
@ -721,8 +721,8 @@ pango_fb_font_get_metrics (PangoFont *font,
if (metrics)
{
metrics->ascent = ftf->size->metrics.ascender * PANGO_SCALE >> 6;
metrics->descent = ftf->size->metrics.descender * PANGO_SCALE >> 6;
metrics->ascent = (ftf->size->metrics.ascender * PANGO_SCALE + 32) >> 6;
metrics->descent = (ftf->size->metrics.descender * PANGO_SCALE + 32) >> 6;
}
}