summaryrefslogtreecommitdiff
path: root/gtk/gtk_plotters.c
diff options
context:
space:
mode:
authorRob Kendrick <rjek@netsurf-browser.org>2006-03-21 17:22:41 +0000
committerRob Kendrick <rjek@netsurf-browser.org>2006-03-21 17:22:41 +0000
commit388ce7b8c46ae20b97f891605f014db7fcb2fc6f (patch)
treea3d5ec3fd55c255fdbef57317ed84a6ad2a9f93d /gtk/gtk_plotters.c
parent0d445d0f41b6a4da0581511c38f4b8d7404b6a59 (diff)
downloadnetsurf-388ce7b8c46ae20b97f891605f014db7fcb2fc6f.tar.gz
netsurf-388ce7b8c46ae20b97f891605f014db7fcb2fc6f.tar.bz2
[project @ 2006-03-21 17:22:41 by rjek]
Radio and checkbox widgets are now 3D, and implemented arc plotting for them svn path=/import/netsurf/; revision=2145
Diffstat (limited to 'gtk/gtk_plotters.c')
-rw-r--r--gtk/gtk_plotters.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/gtk/gtk_plotters.c b/gtk/gtk_plotters.c
index 911cd2135..8da2d3c51 100644
--- a/gtk/gtk_plotters.c
+++ b/gtk/gtk_plotters.c
@@ -31,6 +31,8 @@ static bool nsgtk_plot_clip(int clip_x0, int clip_y0,
static bool nsgtk_plot_text(int x, int y, struct css_style *style,
const char *text, size_t length, colour bg, colour c);
static bool nsgtk_plot_disc(int x, int y, int radius, colour c, bool filled);
+static bool nsgtk_plot_arc(int x, int y, int radius, int angle1, int angle2,
+ colour c);
static bool nsgtk_plot_bitmap(int x, int y, int width, int height,
struct bitmap *bitmap, colour bg);
static bool nsgtk_plot_bitmap_tile(int x, int y, int width, int height,
@@ -53,6 +55,7 @@ const struct plotter_table nsgtk_plotters = {
nsgtk_plot_clip,
nsgtk_plot_text,
nsgtk_plot_disc,
+ nsgtk_plot_arc,
nsgtk_plot_bitmap,
nsgtk_plot_bitmap_tile,
nsgtk_plot_group_start,
@@ -65,7 +68,6 @@ bool nsgtk_plot_clg(colour c)
return true;
}
-
bool nsgtk_plot_rectangle(int x0, int y0, int width, int height,
int line_width, colour c, bool dotted, bool dashed)
{
@@ -197,6 +199,23 @@ bool nsgtk_plot_disc(int x, int y, int radius, colour c, bool filled)
return true;
}
+bool nsgtk_plot_arc(int x, int y, int radius, int angle1, int angle2, colour c)
+{
+ nsgtk_set_colour(c);
+#ifdef CAIRO_VERSION
+ cairo_set_line_width(current_cr, 1);
+ cairo_arc(current_cr, x, y, radius,
+ (angle1 + 90) * (M_PI / 180),
+ (angle2 + 90) * (M_PI / 180));
+ cairo_stroke(current_cr);
+#else
+ gdk_draw_arc(current_drawable, current_gc,
+ FALSE, x - (radius), y - radius,
+ radius * 2, radius * 2,
+ angle1 * 64, angle2 * 64);
+#endif
+ return true;
+}
bool nsgtk_plot_bitmap(int x, int y, int width, int height,
struct bitmap *bitmap, colour bg)