shell-drawing: remove shell_draw_box_pointer()

This was originally done in C because it used cairo, but that can be
done from JS now. Since it was only used by altTab.js, move it there.

https://bugzilla.gnome.org/show_bug.cgi?id=642059
This commit is contained in:
Dan Winship
2011-02-10 14:41:24 -05:00
parent f211681d6c
commit 0c0e2cc689
3 changed files with 48 additions and 80 deletions

View File

@ -48,61 +48,3 @@ shell_draw_clock (StDrawingArea *area,
yc + minute_radius * sin (angle));
cairo_stroke (cr);
}
void
shell_draw_box_pointer (StDrawingArea *area,
ShellPointerDirection direction)
{
StThemeNode *theme_node;
ClutterColor border_color, body_color;
guint width, height;
cairo_t *cr;
theme_node = st_widget_get_theme_node (ST_WIDGET (area));
st_theme_node_get_border_color (theme_node, (StSide)direction, &border_color);
st_theme_node_get_foreground_color (theme_node, &body_color);
st_drawing_area_get_surface_size (area, &width, &height);
cr = st_drawing_area_get_context (area);
cairo_set_line_width (cr, 1.0);
clutter_cairo_set_source_color (cr, &border_color);
switch (direction)
{
case SHELL_POINTER_UP:
cairo_move_to (cr, 0, height);
cairo_line_to (cr, floor (width * 0.5), 0);
cairo_line_to (cr, width, height);
break;
case SHELL_POINTER_DOWN:
cairo_move_to (cr, width, 0);
cairo_line_to (cr, floor (width * 0.5), height);
cairo_line_to (cr, 0, 0);
break;
case SHELL_POINTER_LEFT:
cairo_move_to (cr, width, height);
cairo_line_to (cr, 0, floor (height * 0.5));
cairo_line_to (cr, width, 0);
break;
case SHELL_POINTER_RIGHT:
cairo_move_to (cr, 0, 0);
cairo_line_to (cr, width, floor (height * 0.5));
cairo_line_to (cr, 0, height);
break;
default:
g_assert_not_reached();
}
cairo_stroke_preserve (cr);
clutter_cairo_set_source_color (cr, &body_color);
cairo_fill (cr);
}

View File

@ -8,17 +8,6 @@
G_BEGIN_DECLS
/* Note that these correspond to StSide */
typedef enum {
SHELL_POINTER_UP,
SHELL_POINTER_RIGHT,
SHELL_POINTER_DOWN,
SHELL_POINTER_LEFT
} ShellPointerDirection;
void shell_draw_box_pointer (StDrawingArea *area,
ShellPointerDirection direction);
void shell_draw_clock (StDrawingArea *area,
int hour,
int minute);