free colormap in here. Sync from X port. (gdk_fb_set_colormap): allow the

2001-01-05  Alexander Larsson  <alexl@redhat.com>

	* gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_drawable_finalize): free
	colormap in here. Sync from X port.
	(gdk_fb_set_colormap): allow the colormap to be NULL if you like.
	Sync from X port.
	(gdk_fb_clip_region): Comment out g_warning about empty clip region.
	This happens now and then, and i don't think it is a bug.
	(gdk_fb_draw_polygon): Correctly add extra point if startpoint
	!= endpoint.
	(gdk_fb_draw_lines): Don't draw dashed lines if line_style is
	GDK_LINE_SOLID.

	* gdk/linux-fb/gdkfont-fb.c: Return bogus GdkFont that has
	some of the fields filled in at least.

	* gdk/linux-fb/miwideline.c: The widths argument to miLineArcI, and
	miLineArcD is no more, remove it from the function definition.
This commit is contained in:
Alexander Larsson 2001-01-05 14:01:36 +00:00 committed by Alexander Larsson
parent ae89b1e1b1
commit 30888237b9
10 changed files with 200 additions and 26 deletions

View File

@ -1,3 +1,22 @@
2001-01-05 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_drawable_finalize): free
colormap in here. Sync from X port.
(gdk_fb_set_colormap): allow the colormap to be NULL if you like.
Sync from X port.
(gdk_fb_clip_region): Comment out g_warning about empty clip region.
This happens now and then, and i don't think it is a bug.
(gdk_fb_draw_polygon): Correctly add extra point if startpoint
!= endpoint.
(gdk_fb_draw_lines): Don't draw dashed lines if line_style is
GDK_LINE_SOLID.
* gdk/linux-fb/gdkfont-fb.c: Return bogus GdkFont that has
some of the fields filled in at least.
* gdk/linux-fb/miwideline.c: The widths argument to miLineArcI, and
miLineArcD is no more, remove it from the function definition.
2001-01-04 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeselection.c (gtk_tree_selection_get_tree_view): add

View File

@ -1,3 +1,22 @@
2001-01-05 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_drawable_finalize): free
colormap in here. Sync from X port.
(gdk_fb_set_colormap): allow the colormap to be NULL if you like.
Sync from X port.
(gdk_fb_clip_region): Comment out g_warning about empty clip region.
This happens now and then, and i don't think it is a bug.
(gdk_fb_draw_polygon): Correctly add extra point if startpoint
!= endpoint.
(gdk_fb_draw_lines): Don't draw dashed lines if line_style is
GDK_LINE_SOLID.
* gdk/linux-fb/gdkfont-fb.c: Return bogus GdkFont that has
some of the fields filled in at least.
* gdk/linux-fb/miwideline.c: The widths argument to miLineArcI, and
miLineArcD is no more, remove it from the function definition.
2001-01-04 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeselection.c (gtk_tree_selection_get_tree_view): add

View File

@ -1,3 +1,22 @@
2001-01-05 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_drawable_finalize): free
colormap in here. Sync from X port.
(gdk_fb_set_colormap): allow the colormap to be NULL if you like.
Sync from X port.
(gdk_fb_clip_region): Comment out g_warning about empty clip region.
This happens now and then, and i don't think it is a bug.
(gdk_fb_draw_polygon): Correctly add extra point if startpoint
!= endpoint.
(gdk_fb_draw_lines): Don't draw dashed lines if line_style is
GDK_LINE_SOLID.
* gdk/linux-fb/gdkfont-fb.c: Return bogus GdkFont that has
some of the fields filled in at least.
* gdk/linux-fb/miwideline.c: The widths argument to miLineArcI, and
miLineArcD is no more, remove it from the function definition.
2001-01-04 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeselection.c (gtk_tree_selection_get_tree_view): add

View File

@ -1,3 +1,22 @@
2001-01-05 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_drawable_finalize): free
colormap in here. Sync from X port.
(gdk_fb_set_colormap): allow the colormap to be NULL if you like.
Sync from X port.
(gdk_fb_clip_region): Comment out g_warning about empty clip region.
This happens now and then, and i don't think it is a bug.
(gdk_fb_draw_polygon): Correctly add extra point if startpoint
!= endpoint.
(gdk_fb_draw_lines): Don't draw dashed lines if line_style is
GDK_LINE_SOLID.
* gdk/linux-fb/gdkfont-fb.c: Return bogus GdkFont that has
some of the fields filled in at least.
* gdk/linux-fb/miwideline.c: The widths argument to miLineArcI, and
miLineArcD is no more, remove it from the function definition.
2001-01-04 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeselection.c (gtk_tree_selection_get_tree_view): add

View File

@ -1,3 +1,22 @@
2001-01-05 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_drawable_finalize): free
colormap in here. Sync from X port.
(gdk_fb_set_colormap): allow the colormap to be NULL if you like.
Sync from X port.
(gdk_fb_clip_region): Comment out g_warning about empty clip region.
This happens now and then, and i don't think it is a bug.
(gdk_fb_draw_polygon): Correctly add extra point if startpoint
!= endpoint.
(gdk_fb_draw_lines): Don't draw dashed lines if line_style is
GDK_LINE_SOLID.
* gdk/linux-fb/gdkfont-fb.c: Return bogus GdkFont that has
some of the fields filled in at least.
* gdk/linux-fb/miwideline.c: The widths argument to miLineArcI, and
miLineArcD is no more, remove it from the function definition.
2001-01-04 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeselection.c (gtk_tree_selection_get_tree_view): add

View File

@ -1,3 +1,22 @@
2001-01-05 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_drawable_finalize): free
colormap in here. Sync from X port.
(gdk_fb_set_colormap): allow the colormap to be NULL if you like.
Sync from X port.
(gdk_fb_clip_region): Comment out g_warning about empty clip region.
This happens now and then, and i don't think it is a bug.
(gdk_fb_draw_polygon): Correctly add extra point if startpoint
!= endpoint.
(gdk_fb_draw_lines): Don't draw dashed lines if line_style is
GDK_LINE_SOLID.
* gdk/linux-fb/gdkfont-fb.c: Return bogus GdkFont that has
some of the fields filled in at least.
* gdk/linux-fb/miwideline.c: The widths argument to miLineArcI, and
miLineArcD is no more, remove it from the function definition.
2001-01-04 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeselection.c (gtk_tree_selection_get_tree_view): add

View File

@ -1,3 +1,22 @@
2001-01-05 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_drawable_finalize): free
colormap in here. Sync from X port.
(gdk_fb_set_colormap): allow the colormap to be NULL if you like.
Sync from X port.
(gdk_fb_clip_region): Comment out g_warning about empty clip region.
This happens now and then, and i don't think it is a bug.
(gdk_fb_draw_polygon): Correctly add extra point if startpoint
!= endpoint.
(gdk_fb_draw_lines): Don't draw dashed lines if line_style is
GDK_LINE_SOLID.
* gdk/linux-fb/gdkfont-fb.c: Return bogus GdkFont that has
some of the fields filled in at least.
* gdk/linux-fb/miwideline.c: The widths argument to miLineArcI, and
miLineArcD is no more, remove it from the function definition.
2001-01-04 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeselection.c (gtk_tree_selection_get_tree_view): add

View File

@ -81,7 +81,7 @@ static void gdk_fb_set_colormap (GdkDrawable *drawable,
GdkColormap *colormap);
static gint gdk_fb_get_depth (GdkDrawable *drawable);
static GdkVisual* gdk_fb_get_visual (GdkDrawable *drawable);
static void gdk_fb_drawable_finalize (GObject *object);
static gpointer parent_class = NULL;
@ -98,9 +98,12 @@ static void
gdk_drawable_impl_fb_class_init (GdkDrawableFBClass *klass)
{
GdkDrawableClass *drawable_class = GDK_DRAWABLE_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gdk_fb_drawable_finalize;
drawable_class->create_gc = _gdk_fb_gc_new;
drawable_class->draw_rectangle = gdk_fb_draw_rectangle;
drawable_class->draw_arc = gdk_fb_draw_arc;
@ -125,6 +128,15 @@ gdk_drawable_impl_fb_class_init (GdkDrawableFBClass *klass)
drawable_class->get_image = _gdk_fb_get_image;
}
static void
gdk_fb_drawable_finalize (GObject *object)
{
gdk_drawable_set_colormap (GDK_DRAWABLE (object), NULL);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
GType
gdk_drawable_impl_fb_get_type (void)
{
@ -177,10 +189,15 @@ gdk_fb_set_colormap (GdkDrawable *drawable,
GdkDrawableFBData *private;
private = GDK_DRAWABLE_FBDATA (drawable);
old_cmap = private->colormap;
private->colormap = gdk_colormap_ref (colormap);
gdk_colormap_unref (old_cmap);
if (private->colormap == colormap)
return;
if (private->colormap)
gdk_colormap_unref (private->colormap);
private->colormap = colormap;
if (private->colormap)
gdk_colormap_ref (private->colormap);
}
/* Calculates the real clipping region for a drawable, taking into account
@ -295,8 +312,10 @@ gdk_fb_clip_region (GdkDrawable *drawable,
tmpreg = gdk_region_rectangle (&draw_rect);
gdk_region_intersect (real_clip_region, tmpreg);
gdk_region_destroy (tmpreg);
/*
if (!real_clip_region->numRects)
g_warning ("Empty clip region");
*/
}
}
@ -814,11 +833,24 @@ gdk_fb_draw_polygon (GdkDrawable *drawable,
miFillPolygon (drawable, gc, 0, 0, npoints, points);
else
{
GdkPoint *realpts = g_alloca (sizeof(GdkPoint) * (npoints + 1));
gint tmp_npoints;
GdkPoint *tmp_points;
memcpy (realpts, points, sizeof(GdkPoint) * npoints);
realpts[npoints] = points[0];
gdk_fb_draw_lines (drawable, gc, points, npoints);
if (points[0].x != points[npoints-1].x || points[0].y != points[npoints-1].y)
{
tmp_npoints = npoints + 1;
tmp_points = g_new (GdkPoint, tmp_npoints);
memcpy (tmp_points, points, sizeof(GdkPoint) * npoints);
tmp_points[npoints].x = points[0].x;
tmp_points[npoints].y = points[0].y;
}
else
{
tmp_npoints = npoints;
tmp_points = points;
}
gdk_fb_draw_lines (drawable, gc, tmp_points, tmp_npoints);
}
}
@ -833,14 +865,14 @@ gdk_fb_draw_lines (GdkDrawable *drawable,
private = GDK_GC_FBDATA (gc);
if (private->values.line_width > 0)
{
if (private->dash_list)
if ((private->values.line_style != GDK_LINE_SOLID) && private->dash_list)
miWideDash (drawable, gc, 0, npoints, points);
else
miWideLine (drawable, gc, 0, npoints, points);
}
else
{
if (private->dash_list)
if ((private->values.line_style != GDK_LINE_SOLID) && private->dash_list)
miZeroDashLine (drawable, gc, 0, npoints, points);
else
miZeroLine (drawable, gc, 0, npoints, points);

View File

@ -38,23 +38,32 @@
#error "We need Freetype 2.0 (beta?)"
#endif
GdkFont*
gdk_font_from_description (PangoFontDescription *font_desc)
static GdkFont *
gdk_fb_bogus_font (gint height)
{
GdkFont *font;
GdkFontPrivateFB *private;
g_return_val_if_fail (font_desc, NULL);
private = g_new0 (GdkFontPrivateFB, 1);
font = (GdkFont *)private;
font->type = GDK_FONT_FONT;
private->size = font_desc->size;
private->base.ref_count = 1;
font->type = GDK_FONT_FONT;
font->ascent = height*3/4;
font->descent = height/4;
private->size = height;
private->base.ref_count = 1;
return font;
}
GdkFont*
gdk_font_from_description (PangoFontDescription *font_desc)
{
g_return_val_if_fail (font_desc, NULL);
return gdk_fb_bogus_font (PANGO_PIXELS(font_desc->size));
}
/* ********************* */
#if 0
static GHashTable *font_name_hash = NULL;
@ -171,13 +180,13 @@ gdk_fontset_load (const gchar *fontset_name)
GdkFont*
gdk_fontset_load (const gchar *fontset_name)
{
return NULL;
return gdk_fb_bogus_font (10);
}
GdkFont *
gdk_font_load (const gchar *font_name)
{
return NULL;
return gdk_fb_bogus_font (10);
}
void
@ -306,7 +315,7 @@ gdk_text_width (GdkFont *font,
private = (GdkFontPrivateFB*) font;
return text_length * private->size / (2*PANGO_SCALE);
return (text_length * private->size) / 2;
#endif
}
@ -363,11 +372,11 @@ gdk_text_extents (GdkFont *font,
*rbearing = ((double)mi.bbox.urx) / 1000.0 * private->size;
#else
if(ascent)
*ascent = 0;
*ascent = font->ascent;
if(descent)
*descent = 0;
*descent = font->descent;
if(width)
*width = 0;
*width = gdk_text_width(font, text, text_length);
if(lbearing)
*lbearing = 0;
if(rbearing)

View File

@ -532,7 +532,7 @@ miLineJoin (GdkDrawable *pDrawable, GdkGC *pGC, GdkColor *pixel, SpanDataPtr spa
}
static int
miLineArcI (pDraw, pGC, xorg, yorg, points, widths)
miLineArcI (pDraw, pGC, xorg, yorg, points)
GdkDrawable* pDraw;
GdkGC* pGC;
int xorg, yorg;
@ -609,7 +609,7 @@ miLineArcI (pDraw, pGC, xorg, yorg, points, widths)
}
static int
miLineArcD (pDraw, pGC, xorg, yorg, points, widths,
miLineArcD (pDraw, pGC, xorg, yorg, points,
edge1, edgey1, edgeleft1, edge2, edgey2, edgeleft2)
GdkDrawable* pDraw;
GdkGC* pGC;