canvas change (dither support) again



>It seems like this would not break binary compatibility (if I counted
>correctly).  The only issue I see is with the documentation which is
>not in the right place (it should be on the C file, and should include
>patches to the gtk-doc doc system).

Below is a revised patch - now it includes the doc changes Miguel
suggested.

Since no one seems to object to the code changes, I'm planning to
check this in after a few days unless someone speaks up.

-ME

---

Index: gnome-canvas.c
===================================================================
RCS file: /cvs/gnome/gnome-libs/libgnomeui/gnome-canvas.c,v
retrieving revision 1.93.4.13
diff -p -u -r1.93.4.13 gnome-canvas.c
--- gnome-canvas.c	2000/06/29 04:20:38	1.93.4.13
+++ gnome-canvas.c	2000/11/27 22:04:18
@@ -3272,7 +3272,7 @@ paint (GnomeCanvas *canvas)
 							    (draw_y1 - DISPLAY_Y1 (canvas)
 							     + canvas->zoom_yofs),
 							    width, height,
-							    GDK_RGB_DITHER_NONE,
+							    canvas->dither,
 							    buf.buf,
 							    IMAGE_WIDTH_AA * 3);
 				}
@@ -4136,4 +4136,39 @@ gnome_canvas_set_stipple_origin (GnomeCa
 	g_return_if_fail (gc != NULL);
 
 	gdk_gc_set_ts_origin (gc, -canvas->draw_xofs, -canvas->draw_yofs);
+}
+
+/**
+ * gnome_canvas_set_dither:
+ * @canvas: A canvas.
+ * @dither: Type of dither used to render an aa canvas.
+ *
+ * Controls dithered rendering for aa canvases. The value of dither
+ * should be; GDK_RGB_DITHER_NONE, GDK_RGB_DITHER_NORMAL, or
+ * GDK_RGB_DITHER_MAX. The default canvas setting is
GDK_RGB_DITHER_NONE.
+ **/
+void
+gnome_canvas_set_dither (GnomeCanvas *canvas, GdkRgbDither dither)
+{
+	g_return_if_fail (canvas != NULL);
+	g_return_if_fail (GNOME_IS_CANVAS (canvas));
+
+	canvas->dither = dither;
+}
+
+/**
+ * gnome_canvas_get_dither:
+ * @canvas: A canvas.
+ *
+ * Returns the type of dithering used to render an aa canvas.
+ * 
+ * Return value: The dither setting.
+ **/
+GdkRgbDither
+gnome_canvas_get_dither (GnomeCanvas *canvas)
+{
+	g_return_if_fail (canvas != NULL);
+	g_return_if_fail (GNOME_IS_CANVAS (canvas));
+
+	return canvas->dither;
 }


Index: gnome-canvas.h
===================================================================
RCS file: /cvs/gnome/gnome-libs/libgnomeui/gnome-canvas.h,v
retrieving revision 1.47.4.2
diff -p -u -r1.47.4.2 gnome-canvas.h
--- gnome-canvas.h	2000/06/29 04:20:38	1.47.4.2
+++ gnome-canvas.h	2000/11/27 21:12:31
@@ -465,6 +465,7 @@ struct _GnomeCanvas {
 	/* GC for temporary draw pixmap */
 	GdkGC *pixmap_gc;
 
+
 	/* Whether items need update at next idle loop iteration */
 	unsigned int need_update : 1;
 
@@ -482,6 +483,9 @@ struct _GnomeCanvas {
 
 	/* Whether the canvas is in antialiased mode or not */
 	unsigned int aa : 1;
+
+	/* dither mode for aa drawing */
+	unsigned int dither : 2;
 };
 
 struct _GnomeCanvasClass {
@@ -594,6 +598,15 @@ gulong gnome_canvas_get_color_pixel (Gno
  */
 void gnome_canvas_set_stipple_origin (GnomeCanvas *canvas, GdkGC *gc);
 
+/* Controls the dithering used when the canvase renders.
+ * Only applicable to aa canvases - ingnored by non-aa canvases.
+ */
+void gnome_canvas_set_dither (GnomeCanvas *canvas, GdkRgbDither
dither);
+
+/* Returns the dither mode of an aa canvas.
+ * Only applicable to aa canvases - ingnored by non-aa canvases.
+ */
+GdkRgbDither gnome_canvas_get_dither (GnomeCanvas *canvas);
 
 END_GNOME_DECLS
 


Index: tmpl/gnome-canvas.sgml
===================================================================
RCS file:
/cvs/gnome/gnome-libs/devel-docs/gnomeui/tmpl/gnome-canvas.sgml,v
retrieving revision 1.12
diff -p -u -r1.12 gnome-canvas.sgml
--- tmpl/gnome-canvas.sgml	1999/10/01 22:36:31	1.12
+++ tmpl/gnome-canvas.sgml	2000/11/27 22:13:42
@@ -483,7 +483,26 @@ GnomeCanvas
 </para>
 
 @canvas: 
- gc: <!--
+ gc: 
+
+<!-- ##### FUNCTION gnome_canvas_get_dither ##### -->
+<para>
+
+</para>
+
+ canvas: 
+ Returns: 
+
+<!-- ##### FUNCTION gnome_canvas_set_dither ##### -->
+<para>
+
+</para>
+
+ canvas: 
+ dither:
+ Returns: 
+
+<!--
 Local variables:
 mode: sgml
 sgml-parent-document: ("../gnomeui-docs.sgml" "book" "sect1" "")


Index: gnomeui-decl.txt
===================================================================
RCS file: /cvs/gnome/gnome-libs/devel-docs/gnomeui/gnomeui-decl.txt,v
retrieving revision 1.8
diff -p -u -r1.8 gnomeui-decl.txt
--- gnomeui-decl.txt	1999/07/14 16:05:09	1.8
+++ gnomeui-decl.txt	2000/11/27 22:13:01
@@ -2396,6 +2396,9 @@ struct GnomeCanvas {
 
 	/* Whether the canvas is in antialiased mode or not */
 	unsigned int aa : 1;
+
+	/* dither mode for aa drawing */
+	unsigned int dither : 2;
 };
 </STRUCT>
 <FUNCTION>
@@ -2507,6 +2510,16 @@ GnomeCanvas *canvas,guint        rgba
 <NAME>gnome_canvas_set_stipple_origin</NAME>
 <RETURNS>void  </RETURNS>
 GnomeCanvas *canvas, GdkGC *gc
+</FUNCTION>
+<FUNCTION>
+<NAME>gnome_canvas_set_dither</NAME>
+<RETURNS>void  </RETURNS>
+GnomeCanvas *canvas, GdkRgbDither dither
+</FUNCTION>
+<FUNCTION>
+<NAME>gnome_canvas_get_dither</NAME>
+<RETURNS>GdkRgbDither  </RETURNS>
+GnomeCanvas *canvas
 </FUNCTION>
 <MACRO>
 <NAME>GNOME_CLIENT</NAME>


Index: gnomeui-sections.txt
===================================================================
RCS file:
/cvs/gnome/gnome-libs/devel-docs/gnomeui/gnomeui-sections.txt,v
retrieving revision 1.3.4.1
diff -p -u -r1.3.4.1 gnomeui-sections.txt
--- gnomeui-sections.txt	2000/05/04 11:06:08	1.3.4.1
+++ gnomeui-sections.txt	2000/11/27 22:12:34
@@ -148,6 +148,8 @@ gnome_canvas_window_to_world
 gnome_canvas_world_to_window
 gnome_canvas_get_color
 gnome_canvas_set_stipple_origin
+gnome_canvas_set_dither
+gnome_canvas_get_dither
 <SUBSECTION Standard>
 gnome_canvas_get_type
 GNOME_TYPE_CANVAS




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]