summaryrefslogtreecommitdiff
path: root/gtk/gtkprogressbar.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2010-09-01 23:25:22 -0400
committerMatthias Clasen <mclasen@redhat.com>2010-09-01 23:25:22 -0400
commit4230f7998be0c5d8e5bd82befbfbe31765b2cb0a (patch)
tree3974906bf6212f44557cc3e9bf95af3f214835ae /gtk/gtkprogressbar.c
parentc3a19a4a1403da6b83d8ecd29e6fb26f9f4c3884 (diff)
downloadgtk+-4230f7998be0c5d8e5bd82befbfbe31765b2cb0a.tar.gz
Make GtkProgressBar implement GtkOrientable
This also means that gtk_progress_bar_[sg]et_orientation are gone.
Diffstat (limited to 'gtk/gtkprogressbar.c')
-rw-r--r--gtk/gtkprogressbar.c51
1 files changed, 10 insertions, 41 deletions
diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c
index d387b857f2..fdb9b9b801 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
*