[gtk+] Make GtkProgressBar implement GtkOrientable
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Make GtkProgressBar implement GtkOrientable
- Date: Thu, 2 Sep 2010 04:07:19 +0000 (UTC)
commit 4230f7998be0c5d8e5bd82befbfbe31765b2cb0a
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Sep 1 23:25:22 2010 -0400
Make GtkProgressBar implement GtkOrientable
This also means that gtk_progress_bar_[sg]et_orientation are
gone.
gtk/gtk.symbols | 2 -
gtk/gtkprogressbar.c | 51 +++++++++----------------------------------------
gtk/gtkprogressbar.h | 3 --
3 files changed, 10 insertions(+), 46 deletions(-)
---
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols
index ae926f8..9f72583 100644
--- a/gtk/gtk.symbols
+++ b/gtk/gtk.symbols
@@ -2569,7 +2569,6 @@ gtk_print_win32_devnames_from_printer_name
#if IN_HEADER(__GTK_PROGRESS_BAR_H__)
#if IN_FILE(__GTK_PROGRESS_BAR_C__)
gtk_progress_bar_get_fraction
-gtk_progress_bar_get_orientation
gtk_progress_bar_get_inverted
gtk_progress_bar_get_pulse_step
gtk_progress_bar_get_text
@@ -2578,7 +2577,6 @@ gtk_progress_bar_get_type G_GNUC_CONST
gtk_progress_bar_new
gtk_progress_bar_pulse
gtk_progress_bar_set_fraction
-gtk_progress_bar_set_orientation
gtk_progress_bar_set_inverted
gtk_progress_bar_set_pulse_step
gtk_progress_bar_set_text
diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c
index d387b85..fdb9b9b 100644
--- a/gtk/gtkprogressbar.c
+++ b/gtk/gtkprogressbar.c
@@ -29,6 +29,7 @@
#include <string.h>
#include "gtkprogressbar.h"
+#include "gtkorientable.h"
#include "gtkprivate.h"
#include "gtkintl.h"
@@ -92,9 +93,11 @@ static void gtk_progress_bar_paint (GtkProgressBar *progress);
static void gtk_progress_bar_act_mode_enter (GtkProgressBar *progress);
static void gtk_progress_bar_realize (GtkWidget *widget);
static void gtk_progress_bar_finalize (GObject *object);
+static void gtk_progress_bar_set_orientation (GtkProgressBar *progress,
+ GtkOrientation orientation);
-
-G_DEFINE_TYPE (GtkProgressBar, gtk_progress_bar, GTK_TYPE_WIDGET)
+G_DEFINE_TYPE_WITH_CODE (GtkProgressBar, gtk_progress_bar, GTK_TYPE_WIDGET,
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, NULL))
static void
gtk_progress_bar_class_init (GtkProgressBarClass *class)
@@ -114,14 +117,9 @@ gtk_progress_bar_class_init (GtkProgressBarClass *class)
widget_class->size_request = gtk_progress_bar_size_request;
widget_class->size_allocate = gtk_progress_bar_size_allocate;
- g_object_class_install_property (gobject_class,
- PROP_ORIENTATION,
- g_param_spec_enum ("orientation",
- P_("Orientation"),
- P_("Orientation and of the progress bar"),
- GTK_TYPE_ORIENTATION,
- GTK_ORIENTATION_HORIZONTAL,
- GTK_PARAM_READWRITE));
+ g_object_class_override_property (gobject_class,
+ PROP_ORIENTATION,
+ "orientation");
g_object_class_install_property (gobject_class,
PROP_INVERTED,
@@ -1112,22 +1110,11 @@ gtk_progress_bar_set_pulse_step (GtkProgressBar *pbar,
g_object_notify (G_OBJECT (pbar), "pulse-step");
}
-/**
- * gtk_progress_bar_set_orientation:
- * @pbar: a #GtkProgressBar
- * @orientation: orientation of the progress bar
- *
- * Causes the progress bar to switch to a different orientation.
- */
-void
+static void
gtk_progress_bar_set_orientation (GtkProgressBar *pbar,
GtkOrientation orientation)
{
- GtkProgressBarPrivate *priv;
-
- g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar));
-
- priv = pbar->priv;
+ GtkProgressBarPrivate *priv = pbar->priv;
if (priv->orientation != orientation)
{
@@ -1135,8 +1122,6 @@ gtk_progress_bar_set_orientation (GtkProgressBar *pbar,
if (gtk_widget_is_drawable (GTK_WIDGET (pbar)))
gtk_widget_queue_resize (GTK_WIDGET (pbar));
-
- g_object_notify (G_OBJECT (pbar), "orientation");
}
}
@@ -1222,22 +1207,6 @@ gtk_progress_bar_get_pulse_step (GtkProgressBar *pbar)
}
/**
- * gtk_progress_bar_get_orientation:
- * @pbar: a #GtkProgressBar
- *
- * Retrieves the current progress bar orientation.
- *
- * Return value: orientation of the progress bar
- **/
-GtkOrientation
-gtk_progress_bar_get_orientation (GtkProgressBar *pbar)
-{
- g_return_val_if_fail (GTK_IS_PROGRESS_BAR (pbar), GTK_ORIENTATION_HORIZONTAL);
-
- return pbar->priv->orientation;
-}
-
-/**
* gtk_progress_bar_get_inverted:
* @pbar: a #GtkProgressBar
*
diff --git a/gtk/gtkprogressbar.h b/gtk/gtkprogressbar.h
index 5067e56..5bf855f 100644
--- a/gtk/gtkprogressbar.h
+++ b/gtk/gtkprogressbar.h
@@ -90,8 +90,6 @@ void gtk_progress_bar_set_fraction (GtkProgressBar *pbar,
void gtk_progress_bar_set_pulse_step (GtkProgressBar *pbar,
gdouble fraction);
-void gtk_progress_bar_set_orientation (GtkProgressBar *pbar,
- GtkOrientation orientation);
void gtk_progress_bar_set_inverted (GtkProgressBar *pbar,
gboolean inverted);
@@ -99,7 +97,6 @@ G_CONST_RETURN gchar* gtk_progress_bar_get_text (GtkProgressBar *pbar);
gdouble gtk_progress_bar_get_fraction (GtkProgressBar *pbar);
gdouble gtk_progress_bar_get_pulse_step (GtkProgressBar *pbar);
-GtkOrientation gtk_progress_bar_get_orientation (GtkProgressBar *pbar);
gboolean gtk_progress_bar_get_inverted (GtkProgressBar *pbar);
void gtk_progress_bar_set_ellipsize (GtkProgressBar *pbar,
PangoEllipsizeMode mode);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]