[Xfce4-commits] <xfce4-panel:devel> Remove the blink button.

Nick Schermer nick at xfce.org
Tue Aug 11 20:28:25 CEST 2009


Updating branch refs/heads/devel
         to aae21cb8a2c4b240825a3adc04e3721237788a1f (commit)
       from bf76ed7ec64986d6e697f11ebf73d0524b8ef534 (commit)

commit aae21cb8a2c4b240825a3adc04e3721237788a1f
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Feb 27 18:33:50 2009 +0100

    Remove the blink button.
    
    It was a short life, but it is better to merge the code in
    the arrow button. We will benefit from this in the task list
    and window list plugin.

 libxfce4panel/xfce-blink-button.c |  188 -------------------------------------
 libxfce4panel/xfce-blink-button.h |   66 -------------
 2 files changed, 0 insertions(+), 254 deletions(-)

diff --git a/libxfce4panel/xfce-blink-button.c b/libxfce4panel/xfce-blink-button.c
deleted file mode 100644
index 523bb6c..0000000
--- a/libxfce4panel/xfce-blink-button.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (c) 2009 Nick Schermer <nick at xfce.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <common/panel-private.h>
-#include <libxfce4panel/xfce-blink-button.h>
-
-#define XFCE_BLINK_BUTTON_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
-                                            XFCE_TYPE_BLINK_BUTTON, \
-                                            XfceBlinkButtonPrivate))
-
-/* blink count, number should be even */
-#define MAX_BLINKING_COUNT 16
-
-
-
-static void xfce_blink_button_finalize (GObject *object);
-
-
-
-struct _XfceBlinkButtonPrivate
-{
-  /* blinking timeout id */
-  guint          blinking_timeout_id;
-
-  /* counter to make the blinking stop when
-   * MAX_BLINKING_COUNT is reached */
-  guint          blinking_counter;
-
-  /* button relief when the blinking starts */
-  GtkReliefStyle relief;
-};
-
-
-
-G_DEFINE_TYPE (XfceBlinkButton, xfce_blink_button, GTK_TYPE_TOGGLE_BUTTON)
-
-
-
-static void
-xfce_blink_button_class_init (XfceBlinkButtonClass *klass)
-{
-  GObjectClass *gobject_class;
-
-  g_type_class_add_private (klass, sizeof (XfceBlinkButtonPrivate));
-
-  gobject_class = G_OBJECT_CLASS (klass);
-  gobject_class->finalize = xfce_blink_button_finalize;
-}
-
-
-
-static void
-xfce_blink_button_init (XfceBlinkButton *button)
-{
-  /* set private pointer */
-  button->priv = XFCE_BLINK_BUTTON_GET_PRIVATE (button);
-
-  /* initialize button values */
-  button->priv->blinking_timeout_id = 0;
-  button->priv->blinking_counter = 0;
-  button->priv->relief = GTK_RELIEF_NORMAL;
-
-  /* set some widget properties */
-  GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_DEFAULT | GTK_CAN_FOCUS);
-  gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
-}
-
-
-
-static void
-xfce_blink_button_finalize (GObject *object)
-{
-  XfceBlinkButton *button = XFCE_BLINK_BUTTON (object);
-
-  if (button->priv->blinking_timeout_id != 0)
-    g_source_remove (button->priv->blinking_timeout_id);
-
-  (*G_OBJECT_CLASS (xfce_blink_button_parent_class)->finalize) (object);
-}
-
-
-
-static gboolean
-xfce_blink_button_blinking_timeout (gpointer user_data)
-{
-  XfceBlinkButton *button = XFCE_BLINK_BUTTON (user_data);
-  GtkStyle        *style;
-  GtkRcStyle      *rc;
-
-  rc = gtk_widget_get_modifier_style (GTK_WIDGET (button));
-  if(PANEL_HAS_FLAG (rc->color_flags[GTK_STATE_NORMAL], GTK_RC_BG)
-     || button->priv->blinking_timeout_id == 0)
-    {
-      gtk_button_set_relief (GTK_BUTTON (button), button->priv->relief);
-      PANEL_UNSET_FLAG (rc->color_flags[GTK_STATE_NORMAL], GTK_RC_BG);
-      gtk_widget_modify_style (GTK_WIDGET (button), rc);
-    }
-  else
-    {
-      gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NORMAL);
-      PANEL_SET_FLAG (rc->color_flags[GTK_STATE_NORMAL], GTK_RC_BG);
-      style = gtk_widget_get_style (GTK_WIDGET (button));
-      rc->bg[GTK_STATE_NORMAL] = style->bg[GTK_STATE_SELECTED];
-      gtk_widget_modify_style(GTK_WIDGET (button), rc);
-    }
-
-  return (button->priv->blinking_counter++ < MAX_BLINKING_COUNT);
-}
-
-
-
-static void
-xfce_blink_button_blinking_timeout_destroyed (gpointer user_data)
-{
-  XfceBlinkButton *button = XFCE_BLINK_BUTTON (user_data);
-
-  button->priv->blinking_timeout_id = 0;
-  button->priv->blinking_counter = 0;
-}
-
-
-
-PANEL_SYMBOL_EXPORT GtkWidget *
-xfce_blink_button_new (void)
-{
-  return g_object_new (XFCE_TYPE_BLINK_BUTTON, NULL);
-}
-
-
-
-PANEL_SYMBOL_EXPORT gboolean
-xfce_blink_button_get_blinking (XfceBlinkButton *button)
-{
-  g_return_val_if_fail (XFCE_IS_BLINK_BUTTON (button), FALSE);
-  return !!(button->priv->blinking_timeout_id != 0);
-}
-
-
-
-PANEL_SYMBOL_EXPORT void
-xfce_blink_button_set_blinking (XfceBlinkButton *button,
-                                gboolean         blinking)
-{
-  g_return_if_fail (XFCE_IS_BLINK_BUTTON (button));
-
-  if (blinking)
-    {
-      /* store the relief of the button */
-      button->priv->relief = gtk_button_get_relief (GTK_BUTTON (button));
-
-      if (button->priv->blinking_timeout_id == 0)
-        {
-          /* start blinking timeout */
-          button->priv->blinking_timeout_id =
-              g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE, 500,
-                                  xfce_blink_button_blinking_timeout, button,
-                                  xfce_blink_button_blinking_timeout_destroyed);
-        }
-    }
-  else if (button->priv->blinking_timeout_id != 0)
-    {
-      /* stop the blinking timeout */
-      g_source_remove (button->priv->blinking_timeout_id);
-    }
-
-  /* start with a blinking or make sure the button is normal */
-  xfce_blink_button_blinking_timeout (button);
-}
diff --git a/libxfce4panel/xfce-blink-button.h b/libxfce4panel/xfce-blink-button.h
deleted file mode 100644
index 247342c..0000000
--- a/libxfce4panel/xfce-blink-button.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (c) 2009 Nick Schermer <nick at xfce.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __XFCE_BLINK_BUTTON_H__
-#define __XFCE_BLINK_BUTTON_H__
-
-#include <gtk/gtk.h>
-#include <libxfce4panel/libxfce4panel.h>
-
-G_BEGIN_DECLS
-
-typedef struct _XfceBlinkButtonPrivate XfceBlinkButtonPrivate;
-typedef struct _XfceBlinkButtonClass   XfceBlinkButtonClass;
-typedef struct _XfceBlinkButton        XfceBlinkButton;
-
-#define XFCE_TYPE_BLINK_BUTTON            (xfce_blink_button_get_type ())
-#define XFCE_BLINK_BUTTON(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFCE_TYPE_BLINK_BUTTON, XfceBlinkButton))
-#define XFCE_BLINK_BUTTON_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_TYPE_BLINK_BUTTON, XfceBlinkButtonClass))
-#define XFCE_IS_BLINK_BUTTON(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFCE_TYPE_BLINK_BUTTON))
-#define XFCE_IS_BLINK_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_TYPE_BLINK_BUTTON))
-#define XFCE_BLINK_BUTTON_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), XFCE_TYPE_BLINK_BUTTON, XfceBlinkButtonClass))
-
-struct _XfceBlinkButtonClass
-{
-  /*< private >*/
-  GtkToggleButtonClass __parent__;
-};
-
-struct _XfceBlinkButton
-{
-  /*< private >*/
-  GtkToggleButton __parent__;
-
-  /*< private >*/
-  XfceBlinkButtonPrivate *priv;
-};
-
-PANEL_SYMBOL_EXPORT
-GType      xfce_blink_button_get_type     (void) G_GNUC_CONST;
-
-GtkWidget *xfce_blink_button_new          (void) G_GNUC_MALLOC;
-
-gboolean   xfce_blink_button_get_blinking (XfceBlinkButton *button);
-void       xfce_blink_button_set_blinking (XfceBlinkButton *button,
-                                           gboolean         blinking);
-
-G_END_DECLS
-
-#endif /* !__XFCE_BLINK_BUTTON_H__ */
-



More information about the Xfce4-commits mailing list