From c80acfda086bfd95f3cd06afd633817a5772505a Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Wed, 19 Oct 2011 13:31:01 -0400 Subject: [PATCH] shell: Remove shell-arrow It was unused and used deprecated Clutter APIs. --- src/Makefile.am | 2 - src/shell-arrow.c | 143 ---------------------------------------------- src/shell-arrow.h | 34 ----------- 3 files changed, 179 deletions(-) delete mode 100644 src/shell-arrow.c delete mode 100644 src/shell-arrow.h diff --git a/src/Makefile.am b/src/Makefile.am index d19f0fe90..1cfea99c9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -101,7 +101,6 @@ shell_public_headers_h = \ shell-app.h \ shell-app-system.h \ shell-app-usage.h \ - shell-arrow.h \ shell-contact-system.h \ shell-doc-system.h \ shell-embedded-window.h \ @@ -138,7 +137,6 @@ libgnome_shell_la_SOURCES = \ shell-a11y.c \ shell-app-system.c \ shell-app-usage.c \ - shell-arrow.c \ shell-contact-system.c \ shell-doc-system.c \ shell-embedded-window.c \ diff --git a/src/shell-arrow.c b/src/shell-arrow.c deleted file mode 100644 index 380ec44ca..000000000 --- a/src/shell-arrow.c +++ /dev/null @@ -1,143 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ - -#include "config.h" - -#include "shell-arrow.h" - -#include -#include -#include - -enum { - PROP_0, - - PROP_DIRECTION -}; - -G_DEFINE_TYPE(ShellArrow, shell_arrow, CLUTTER_TYPE_CAIRO_TEXTURE); - -struct _ShellArrowPrivate { - GtkArrowType direction; -}; - -static void shell_arrow_redraw (ShellArrow *self); - -static void -shell_arrow_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ShellArrow *self = SHELL_ARROW (object); - - switch (prop_id) - { - case PROP_DIRECTION: - self->priv->direction = g_value_get_enum (value); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } - - shell_arrow_redraw (self); -} - -static void -shell_arrow_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ShellArrow *self = SHELL_ARROW (object); - - switch (prop_id) - { - case PROP_DIRECTION: - g_value_set_enum (value, self->priv->direction); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -shell_arrow_redraw (ShellArrow *self) -{ - cairo_t *cr; - guint width, height; - - g_object_get (G_OBJECT (self), "surface-width", &width, - "surface-height", &height, - NULL); - - if (width == 0) - return; - - cr = clutter_cairo_texture_create (CLUTTER_CAIRO_TEXTURE (self)); - - cairo_set_source_rgb (cr, 1, 1, 1); - - switch (self->priv->direction) - { - case GTK_ARROW_RIGHT: - cairo_move_to (cr, 0, 0); - cairo_line_to (cr, width, height*0.5); - cairo_line_to (cr, 0, height); - break; - case GTK_ARROW_LEFT: - cairo_move_to (cr, width, 0); - cairo_line_to (cr, 0, height*0.5); - cairo_line_to (cr, width, height); - break; - case GTK_ARROW_UP: - cairo_move_to (cr, 0, height); - cairo_line_to (cr, width*0.5, 0); - cairo_line_to (cr, width, height); - break; - case GTK_ARROW_DOWN: - cairo_move_to (cr, 0, 0); - cairo_line_to (cr, width*0.5, height); - cairo_line_to (cr, width, height); - break; - case GTK_ARROW_NONE: - default: - break; - } - - cairo_close_path (cr); - cairo_fill (cr); - - cairo_destroy (cr); -} - -static void -shell_arrow_class_init (ShellArrowClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - g_type_class_add_private (klass, sizeof (ShellArrowPrivate)); - - object_class->get_property = shell_arrow_get_property; - object_class->set_property = shell_arrow_set_property; - - g_object_class_install_property (object_class, - PROP_DIRECTION, - g_param_spec_enum ("direction", - "Direction", - "Direction", - GTK_TYPE_ARROW_TYPE, - GTK_ARROW_NONE, - G_PARAM_READWRITE)); -} - -static void -shell_arrow_init (ShellArrow *actor) -{ - actor->priv = G_TYPE_INSTANCE_GET_PRIVATE (actor, SHELL_TYPE_ARROW, - ShellArrowPrivate); - g_signal_connect (actor, "notify::surface-width", G_CALLBACK (shell_arrow_redraw), NULL); -} diff --git a/src/shell-arrow.h b/src/shell-arrow.h deleted file mode 100644 index 3a18a1677..000000000 --- a/src/shell-arrow.h +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ -#ifndef __SHELL_ARROW_H__ -#define __SHELL_ARROW_H__ - -#include -#include - -#define SHELL_TYPE_ARROW (shell_arrow_get_type ()) -#define SHELL_ARROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHELL_TYPE_ARROW, ShellArrow)) -#define SHELL_ARROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_ARROW, ShellArrowClass)) -#define SHELL_IS_ARROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHELL_TYPE_ARROW)) -#define SHELL_IS_ARROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_ARROW)) -#define SHELL_ARROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_ARROW, ShellArrowClass)) - -typedef struct _ShellArrow ShellArrow; -typedef struct _ShellArrowClass ShellArrowClass; - -typedef struct _ShellArrowPrivate ShellArrowPrivate; - -struct _ShellArrow -{ - ClutterCairoTexture parent; - - ShellArrowPrivate *priv; -}; - -struct _ShellArrowClass -{ - ClutterCairoTextureClass parent_class; -}; - -GType shell_arrow_get_type (void) G_GNUC_CONST; - -#endif /* __SHELL_ARROW_H__ */