summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorRob Kendrick <rjek@netsurf-browser.org>2006-03-20 10:56:54 +0000
committerRob Kendrick <rjek@netsurf-browser.org>2006-03-20 10:56:54 +0000
commitdd6bb6434755d34519dc4c8341a22fc45eb7aca5 (patch)
tree286b0bad2e5504cb6edc4d56a21fbbbc59fdeb8a /gtk
parentf51956947411288735f6c495d5e64610d3b75551 (diff)
downloadnetsurf-dd6bb6434755d34519dc4c8341a22fc45eb7aca5.tar.gz
netsurf-dd6bb6434755d34519dc4c8341a22fc45eb7aca5.tar.bz2
[project @ 2006-03-20 10:56:54 by rjek]
Source cleanup and true/false to TRUE/FALSE conversion for GTK plotters svn path=/import/netsurf/; revision=2142
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtk_plotters.c92
-rw-r--r--gtk/gtk_window.c4
2 files changed, 48 insertions, 48 deletions
diff --git a/gtk/gtk_plotters.c b/gtk/gtk_plotters.c
index 607a80e05..353b4ecc3 100644
--- a/gtk/gtk_plotters.c
+++ b/gtk/gtk_plotters.c
@@ -71,12 +71,12 @@ bool nsgtk_plot_rectangle(int x0, int y0, int width, int height,
{
nsgtk_set_colour(c);
#ifdef CAIRO_VERSION
- if (line_width == 0)
- line_width = 1;
+ if (line_width == 0)
+ line_width = 1;
- cairo_set_line_width(current_cr, line_width);
- cairo_rectangle(current_cr, x0, y0, width, height);
- cairo_stroke(current_cr);
+ cairo_set_line_width(current_cr, line_width);
+ cairo_rectangle(current_cr, x0, y0, width, height);
+ cairo_stroke(current_cr);
#else
gdk_draw_rectangle(current_drawable, current_gc,
FALSE, x0, y0, width, height);
@@ -90,18 +90,18 @@ bool nsgtk_plot_line(int x0, int y0, int x1, int y1, int width,
{
nsgtk_set_colour(c);
#ifdef CAIRO_VERSION
- if (width == 0)
- width = 1;
+ if (width == 0)
+ width = 1;
- cairo_set_line_width(current_cr, width);
- cairo_move_to(current_cr, x0, y0);
- cairo_line_to(current_cr, x1, y1);
- cairo_stroke(current_cr);
+ cairo_set_line_width(current_cr, width);
+ cairo_move_to(current_cr, x0, y0);
+ cairo_line_to(current_cr, x1, y1);
+ cairo_stroke(current_cr);
#else
gdk_draw_line(current_drawable, current_gc,
x0, y0, x1, y1);
#endif
- return true;
+ return true;
}
@@ -109,16 +109,16 @@ bool nsgtk_plot_polygon(int *p, unsigned int n, colour fill)
{
unsigned int i;
#ifdef CAIRO_VERSION
- nsgtk_set_colour(fill);
- cairo_set_line_width(current_cr, 0);
- cairo_move_to(current_cr, p[0], p[1]);
- for (i = 1; i != n; i++) {
- cairo_line_to(current_cr, p[i * 2], p[i * 2 + 1]);
- }
- cairo_fill(current_cr);
- cairo_stroke(current_cr);
+ nsgtk_set_colour(fill);
+ cairo_set_line_width(current_cr, 0);
+ cairo_move_to(current_cr, p[0], p[1]);
+ for (i = 1; i != n; i++) {
+ cairo_line_to(current_cr, p[i * 2], p[i * 2 + 1]);
+ }
+ cairo_fill(current_cr);
+ cairo_stroke(current_cr);
#else
- GdkPoint q[n];
+ GdkPoint q[n];
for (i = 0; i != n; i++) {
q[i].x = p[i * 2];
q[i].y = p[i * 2 + 1];
@@ -135,15 +135,15 @@ bool nsgtk_plot_fill(int x0, int y0, int x1, int y1, colour c)
{
nsgtk_set_colour(c);
#ifdef CAIRO_VERSION
- cairo_set_line_width(current_cr, 0);
- cairo_rectangle(current_cr, x0, y0, x1 - x0, y1 - y0);
- cairo_fill(current_cr);
- cairo_stroke(current_cr);
+ cairo_set_line_width(current_cr, 0);
+ cairo_rectangle(current_cr, x0, y0, x1 - x0, y1 - y0);
+ cairo_fill(current_cr);
+ cairo_stroke(current_cr);
#else
gdk_draw_rectangle(current_drawable, current_gc,
TRUE, x0, y0, x1 - x0, y1 - y0);
#endif
- return true;
+ return true;
}
@@ -151,12 +151,12 @@ bool nsgtk_plot_clip(int clip_x0, int clip_y0,
int clip_x1, int clip_y1)
{
#ifdef CAIRO_VERSION
- cairo_reset_clip(current_cr);
- cairo_rectangle(current_cr, clip_x0 - 1, clip_y0 - 1,
- clip_x1 - clip_x0 + 1, clip_y1 - clip_y0 + 1);
- cairo_clip(current_cr);
+ cairo_reset_clip(current_cr);
+ cairo_rectangle(current_cr, clip_x0 - 1, clip_y0 - 1,
+ clip_x1 - clip_x0 + 1, clip_y1 - clip_y0 + 1);
+ cairo_clip(current_cr);
#endif
- cliprect.x = clip_x0;
+ cliprect.x = clip_x0;
cliprect.y = clip_y0;
cliprect.width = clip_x1 - clip_x0 + 1;
cliprect.height = clip_y1 - clip_y0 + 1;
@@ -174,25 +174,25 @@ bool nsgtk_plot_text(int x, int y, struct css_style *style,
bool nsgtk_plot_disc(int x, int y, int radius, colour c, bool filled)
{
- nsgtk_set_colour(c);
+ nsgtk_set_colour(c);
#ifdef CAIRO_VERSION
- if (filled)
- cairo_set_line_width(current_cr, 0);
- else
- cairo_set_line_width(current_cr, 1);
+ if (filled)
+ cairo_set_line_width(current_cr, 0);
+ else
+ cairo_set_line_width(current_cr, 1);
- cairo_arc(current_cr, x, y, radius, 0, M_PI * 2);
+ cairo_arc(current_cr, x, y, radius, 0, M_PI * 2);
- if (filled)
- cairo_fill(current_cr);
+ if (filled)
+ cairo_fill(current_cr);
- cairo_stroke(current_cr);
+ cairo_stroke(current_cr);
#else
- gdk_draw_arc(current_drawable, current_gc,
- filled, x - (radius), y - radius,
- radius * 2, radius * 2,
- 0,
- 360 * 64);
+ gdk_draw_arc(current_drawable, current_gc,
+ filled ? TRUE : FALSE, x - (radius), y - radius,
+ radius * 2, radius * 2,
+ 0,
+ 360 * 64);
#endif
return true;
}
@@ -303,6 +303,6 @@ void nsgtk_set_colour(colour c)
&colour);
gdk_gc_set_foreground(current_gc, &colour);
#ifdef CAIRO_VERSION
- gdk_cairo_set_source_color(current_cr, &colour);
+ gdk_cairo_set_source_color(current_cr, &colour);
#endif
}
diff --git a/gtk/gtk_window.c b/gtk/gtk_window.c
index 4221cf814..858d1336e 100644
--- a/gtk/gtk_window.c
+++ b/gtk/gtk_window.c
@@ -184,7 +184,7 @@ gboolean gui_window_expose_event(GtkWidget *widget,
current_drawable = widget->window;
current_gc = gdk_gc_new(current_drawable);
#ifdef CAIRO_VERSION
- current_cr = gdk_cairo_create(current_drawable);
+ current_cr = gdk_cairo_create(current_drawable);
#endif
plot = nsgtk_plotters;
@@ -200,7 +200,7 @@ gboolean gui_window_expose_event(GtkWidget *widget,
g_object_unref(current_gc);
#ifdef CAIRO_VERSION
- cairo_destroy(current_cr);
+ cairo_destroy(current_cr);
#endif
return FALSE;