shell-drawing: remove
Remove shell-drawing.[ch], which now only contained shell_draw_clock(), which hadn't been used since the sidebar went away. https://bugzilla.gnome.org/show_bug.cgi?id=642059
This commit is contained in:
parent
0c0e2cc689
commit
688b9697c8
@ -56,7 +56,6 @@ shell_public_headers_h = \
|
|||||||
shell-app-usage.h \
|
shell-app-usage.h \
|
||||||
shell-arrow.h \
|
shell-arrow.h \
|
||||||
shell-doc-system.h \
|
shell-doc-system.h \
|
||||||
shell-drawing.h \
|
|
||||||
shell-embedded-window.h \
|
shell-embedded-window.h \
|
||||||
shell-generic-container.h \
|
shell-generic-container.h \
|
||||||
shell-gtk-embed.h \
|
shell-gtk-embed.h \
|
||||||
@ -88,7 +87,6 @@ libgnome_shell_la_SOURCES = \
|
|||||||
shell-app-usage.c \
|
shell-app-usage.c \
|
||||||
shell-arrow.c \
|
shell-arrow.c \
|
||||||
shell-doc-system.c \
|
shell-doc-system.c \
|
||||||
shell-drawing.c \
|
|
||||||
shell-embedded-window.c \
|
shell-embedded-window.c \
|
||||||
shell-evolution-event-source.h \
|
shell-evolution-event-source.h \
|
||||||
shell-evolution-event-source.c \
|
shell-evolution-event-source.c \
|
||||||
|
@ -1,50 +0,0 @@
|
|||||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#include "shell-drawing.h"
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
void
|
|
||||||
shell_draw_clock (StDrawingArea *area,
|
|
||||||
int hour,
|
|
||||||
int minute)
|
|
||||||
{
|
|
||||||
cairo_t *cr;
|
|
||||||
guint width, height;
|
|
||||||
double xc, yc, radius, hour_radius, minute_radius;
|
|
||||||
double angle;
|
|
||||||
|
|
||||||
st_drawing_area_get_surface_size (area, &width, &height);
|
|
||||||
xc = (double)width / 2;
|
|
||||||
yc = (double)height / 2;
|
|
||||||
radius = (double)(MIN(width, height)) / 2 - 2;
|
|
||||||
minute_radius = radius - 3;
|
|
||||||
hour_radius = radius / 2;
|
|
||||||
|
|
||||||
cr = st_drawing_area_get_context (area);
|
|
||||||
cairo_set_line_width (cr, 1.0);
|
|
||||||
|
|
||||||
/* Outline */
|
|
||||||
cairo_arc (cr, xc, yc, radius, 0.0, 2.0 * M_PI);
|
|
||||||
cairo_stroke (cr);
|
|
||||||
|
|
||||||
/* Hour hand. (We add a fraction to @hour for the minutes, then
|
|
||||||
* convert to radians, and then subtract pi/2 because cairo's origin
|
|
||||||
* is at 3:00, not 12:00.)
|
|
||||||
*/
|
|
||||||
angle = ((hour + minute / 60.0) / 12.0) * 2.0 * M_PI - M_PI / 2.0;
|
|
||||||
cairo_move_to (cr, xc, yc);
|
|
||||||
cairo_line_to (cr,
|
|
||||||
xc + hour_radius * cos (angle),
|
|
||||||
yc + hour_radius * sin (angle));
|
|
||||||
cairo_stroke (cr);
|
|
||||||
|
|
||||||
/* Minute hand */
|
|
||||||
angle = (minute / 60.0) * 2.0 * M_PI - M_PI / 2.0;
|
|
||||||
cairo_move_to (cr, xc, yc);
|
|
||||||
cairo_line_to (cr,
|
|
||||||
xc + minute_radius * cos (angle),
|
|
||||||
yc + minute_radius * sin (angle));
|
|
||||||
cairo_stroke (cr);
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
||||||
|
|
||||||
#ifndef __SHELL_DRAWING_H__
|
|
||||||
#define __SHELL_DRAWING_H__
|
|
||||||
|
|
||||||
#include <clutter/clutter.h>
|
|
||||||
#include "st.h"
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
void shell_draw_clock (StDrawingArea *area,
|
|
||||||
int hour,
|
|
||||||
int minute);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __SHELL_GLOBAL_H__ */
|
|
Loading…
x
Reference in New Issue
Block a user