2008-08-06 Alberto Garcia <agarcia@igalia.com>
authorAlberto Garcia <agarcia@igalia.com>
Wed, 6 Aug 2008 16:31:20 +0000 (16:31 +0000)
committerAlberto Garcia <agarcia@igalia.com>
Wed, 6 Aug 2008 16:31:20 +0000 (16:31 +0000)
* doc/hildon-docs.sgml
* doc/hildon.types
* src/Makefile.am
* src/hildon-toggle-button.c
* src/hildon-toggle-button.h
* src/hildon.h: Removed HildonToggleButton widget, a derived
class is not necessary for this.

ChangeLog
doc/hildon-docs.sgml
doc/hildon.types
src/Makefile.am
src/hildon-toggle-button.c [deleted file]
src/hildon-toggle-button.h [deleted file]
src/hildon.h

index 6c73161..b5fac34 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-08-06  Alberto Garcia  <agarcia@igalia.com>
+
+       * doc/hildon-docs.sgml
+       * doc/hildon.types
+       * src/Makefile.am
+       * src/hildon-toggle-button.c
+       * src/hildon-toggle-button.h
+       * src/hildon.h: Removed HildonToggleButton widget, a derived
+       class is not necessary for this.
+
 2008-08-06  Alejandro G. Castro         <alex@igalia.com>
 
        * src/hildon-pannable-area.c,
index 30c9a7a..73b77ac 100644 (file)
@@ -29,7 +29,6 @@
   <chapter>
     <title>Selectors</title>
     <xi:include href="xml/hildon-button.xml"/>
-    <xi:include href="xml/hildon-toggle-button.xml"/>
     <xi:include href="xml/hildon-color-button.xml"/>
     <xi:include href="xml/hildon-color-chooser-dialog.xml"/>
     <xi:include href="xml/hildon-color-chooser.xml"/>
index c680ff8..71f0d45 100644 (file)
@@ -38,7 +38,6 @@
 #include                                        <src/hildon-stackable-window.h>
 #include                                        <src/hildon-app-menu.h>
 #include                                        <src/hildon-button.h>
-#include                                        <src/hildon-toggle-button.h>
 #include                                        <src/hildon-touch-selector.h>
 #include                                        <src/hildon-time-selector.h>
 #include                                        <src/hildon-date-selector.h>
@@ -83,7 +82,6 @@ hildon_pannable_area_get_type
 hildon_stackable_window_get_type
 hildon_app_menu_get_type
 hildon_button_get_type
-hildon_toggle_button_get_type
 hildon_touch_selector_get_type
 hildon_time_selector_get_type
 hildon_date_selector_get_type
index c5ee190..af62606 100644 (file)
@@ -76,7 +76,6 @@ libhildon_@API_VERSION_MAJOR@_la_SOURCES = \
                hildon-bread-crumb-widget.c             \
                hildon-app-menu.c                       \
                hildon-button.c                         \
-               hildon-toggle-button.c                  \
                hildon-dialog.c
 
 libhildon_@API_VERSION_MAJOR@_built_public_headers  = \
@@ -135,7 +134,6 @@ libhildon_@API_VERSION_MAJOR@_public_headers = \
                hildon-app-menu.h                       \
                hildon-dialog.h                         \
                hildon-button.h                         \
-               hildon-toggle-button.h                  \
                hildon-version.h
 
 libhildon_@API_VERSION_MAJOR@_include_HEADERS = \
diff --git a/src/hildon-toggle-button.c b/src/hildon-toggle-button.c
deleted file mode 100644 (file)
index 61cc367..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * This file is a part of hildon
- *
- * Copyright (C) 2008 Nokia Corporation, all rights reserved.
- *
- * Contact: Karl Lattimer <karl.lattimer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser Public License as published by
- * the Free Software Foundation; version 2 of the license.
- *
- * 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 Lesser Public License for more details.
- *
- */
-
-/**
- * SECTION:hildon-toggle-button
- * @short_description: Widget representing a toggle button in the Hildon framework.
- *
- * The #HildonToggleButton is a GTK widget which represents a toggle
- * button. It is derived from the GtkToggleButton widget and provides
- * additional commodities specific to the Hildon framework.
- *
- * The height of a #HildonToggleButton can be set to either "finger" height
- * or "thumb" height. It can also be configured to use halfscreen or
- * fullscreen width. Alternatively, either dimension can be set to
- * "auto" so it behaves like a standard GtkToggleButton.
- */
-
-#include                                        "hildon-toggle-button.h"
-#include                                        "hildon-enum-types.h"
-
-#define FINGER_BUTTON_HEIGHT                    70
-#define THUMB_BUTTON_HEIGHT                     105
-#define HALFSCREEN_BUTTON_WIDTH                 400
-#define FULLSCREEN_BUTTON_WIDTH                 800
-
-G_DEFINE_TYPE                                   (HildonToggleButton, hildon_toggle_button, GTK_TYPE_TOGGLE_BUTTON);
-
-enum {
-  PROP_ARRANGEMENT_FLAGS
-};
-
-static void
-hildon_toggle_button_set_arrangement            (HildonToggleButton      *button,
-                                                 HildonToggleButtonFlags  flags);
-
-static void
-hildon_toggle_button_set_property               (GObject      *object,
-                                                 guint         prop_id,
-                                                 const GValue *value,
-                                                 GParamSpec   *pspec)
-{
-    HildonToggleButton *button = HILDON_TOGGLE_BUTTON (object);
-
-    switch (prop_id)
-    {
-    case PROP_ARRANGEMENT_FLAGS:
-        hildon_toggle_button_set_arrangement (button, g_value_get_flags (value));
-        break;
-    default:
-        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-        break;
-    }
-}
-
-static void
-hildon_toggle_button_class_init                 (HildonToggleButtonClass *klass)
-{
-    GObjectClass *gobject_class = (GObjectClass *)klass;
-
-    gobject_class->set_property = hildon_toggle_button_set_property;
-
-    g_object_class_install_property (
-        gobject_class,
-        PROP_ARRANGEMENT_FLAGS,
-        g_param_spec_flags (
-            "arrangement-flags",
-            "Arrangement flags",
-            "How the button contents must be arranged",
-            HILDON_TYPE_TOGGLE_BUTTON_FLAGS,
-            HILDON_TOGGLE_BUTTON_AUTO_WIDTH | HILDON_TOGGLE_BUTTON_AUTO_HEIGHT,
-            G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
-}
-
-static void
-hildon_toggle_button_init                       (HildonToggleButton *self)
-{
-}
-
-/**
- * hildon_toggle_button_new:
- * @flags: flags to set the size of the button
- *
- * Creates a new #HildonToggleButton. To add a child widget use gtk_container_add().
- *
- * Returns: a new #HildonToggleButton
- **/
-GtkWidget *
-hildon_toggle_button_new                        (HildonToggleButtonFlags flags)
-{
-    GtkWidget *button;
-    /* Create widget */
-    button = g_object_new (HILDON_TYPE_TOGGLE_BUTTON,
-                           "arrangement-flags", flags,
-                           NULL);
-    return button;
-}
-
-/**
- * hildon_toggle_button_new_with_label:
- * @flags: flags to set the size of the button
- * @label: a text to set in the button label
- *
- * Creates a new #HildonToggleButton with a text label.
- *
- * Returns: a new #HildonToggleButton
- **/
-GtkWidget *
-hildon_toggle_button_new_with_label             (HildonToggleButtonFlags  flags,
-                                                 const char              *label)
-{
-    GtkWidget *button;
-    /* Create widget */
-    button = g_object_new (HILDON_TYPE_TOGGLE_BUTTON,
-                           "arrangement-flags", flags,
-                           "label", label,
-                           NULL);
-    return button;
-}
-
-static void
-hildon_toggle_button_set_arrangement            (HildonToggleButton      *button,
-                                                 HildonToggleButtonFlags  flags)
-{
-    gint width = -1;
-    gint height = -1;
-    const char *widget_name = NULL;
-
-    /* Requested height */
-    if (flags & HILDON_TOGGLE_BUTTON_FINGER_HEIGHT) {
-        height = FINGER_BUTTON_HEIGHT;
-        widget_name = "hildon-finger-button";
-    } else if (flags & HILDON_TOGGLE_BUTTON_THUMB_HEIGHT) {
-        height = THUMB_BUTTON_HEIGHT;
-        widget_name = "hildon-thumb-button";
-    }
-
-    if (widget_name) {
-        gtk_widget_set_name (GTK_WIDGET (button), widget_name);
-    }
-
-    /* Requested width */
-    if (flags & HILDON_TOGGLE_BUTTON_HALFSCREEN_WIDTH) {
-        width = HALFSCREEN_BUTTON_WIDTH;
-    } else if (flags & HILDON_TOGGLE_BUTTON_FULLSCREEN_WIDTH) {
-        width = FULLSCREEN_BUTTON_WIDTH;
-    }
-
-    g_object_set (button,
-                  "width-request", width,
-                  "height-request", height,
-                  NULL);
-
-}
diff --git a/src/hildon-toggle-button.h b/src/hildon-toggle-button.h
deleted file mode 100644 (file)
index 292442e..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * This file is a part of hildon
- *
- * Copyright (C) 2008 Nokia Corporation, all rights reserved.
- *
- * Contact: Karl Lattimer <karl.lattimer@nokia.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser Public License as published by
- * the Free Software Foundation; version 2 of the license.
- *
- * 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 Lesser Public License for more details.
- *
- */
-
-#ifndef                                         __HILDON_TOGGLE_BUTTON_H__
-#define                                         __HILDON_TOGGLE_BUTTON_H__
-
-#include                                        <gtk/gtk.h>
-
-G_BEGIN_DECLS
-
-#define                                         HILDON_TYPE_TOGGLE_BUTTON \
-                                                (hildon_toggle_button_get_type())
-
-#define                                         HILDON_TOGGLE_BUTTON(obj) \
-                                                (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
-                                                HILDON_TYPE_TOGGLE_BUTTON, HildonToggleButton))
-
-#define                                         HILDON_TOGGLE_BUTTON_CLASS(klass) \
-                                                (G_TYPE_CHECK_CLASS_CAST ((klass), \
-                                                HILDON_TYPE_TOGGLE_BUTTON, HildonToggleButtonClass))
-
-#define                                         HILDON_IS_TOGGLE_BUTTON(obj) \
-                                                (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HILDON_TYPE_TOGGLE_BUTTON))
-
-#define                                         HILDON_IS_TOGGLE_BUTTON_CLASS(klass) \
-                                                (G_TYPE_CHECK_CLASS_TYPE ((klass), HILDON_TYPE_TOGGLE_BUTTON))
-
-#define                                         HILDON_TOGGLE_BUTTON_GET_CLASS(obj) \
-                                                (G_TYPE_INSTANCE_GET_CLASS ((obj), \
-                                                HILDON_TYPE_TOGGLE_BUTTON, HildonToggleButtonClass))
-
-typedef struct                                  _HildonToggleButton HildonToggleButton;
-
-typedef struct                                  _HildonToggleButtonClass HildonToggleButtonClass;
-
-struct                                          _HildonToggleButtonClass
-{
-    GtkToggleButtonClass parent_class;
-};
-
-struct                                          _HildonToggleButton
-{
-    GtkToggleButton parent;
-};
-
-typedef enum {
-   HILDON_TOGGLE_BUTTON_AUTO_WIDTH              = 0,      /* leave width unset */
-   HILDON_TOGGLE_BUTTON_HALFSCREEN_WIDTH        = 1,      /* set to 50% screen width */
-   HILDON_TOGGLE_BUTTON_FULLSCREEN_WIDTH        = 2,      /* set to 100% screen width */
-   HILDON_TOGGLE_BUTTON_AUTO_HEIGHT             = 0 << 2, /* leave height unset */
-   HILDON_TOGGLE_BUTTON_FINGER_HEIGHT           = 1 << 2, /* set to finger height */
-   HILDON_TOGGLE_BUTTON_THUMB_HEIGHT            = 2 << 2, /* set to thumb height */
-}                                               HildonToggleButtonFlags;
-
-GType
-hildon_toggle_button_get_type                   (void) G_GNUC_CONST;
-
-GtkWidget *
-hildon_toggle_button_new                        (HildonToggleButtonFlags flags);
-
-GtkWidget *
-hildon_toggle_button_new_with_label             (HildonToggleButtonFlags  flags,
-                                                 const char              *label);
-
-G_END_DECLS
-
-#endif /* __HILDON_TOGGLE_BUTTON_H__ */
index 30a7941..d0db58d 100644 (file)
@@ -73,7 +73,6 @@
 #include                                        "hildon-pannable-area.h"
 #include                                        "hildon-app-menu.h"
 #include                                        "hildon-button.h"
-#include                                        "hildon-toggle-button.h"
 #include                                        "hildon-dialog.h"
 
 #endif