Commit 5fee601f authored by Vincent Untz's avatar Vincent Untz Committed by Vincent Untz
Browse files

require GTK+ 2.15.1 for orientable GtkBox.

2009-02-17  Vincent Untz  <vuntz@gnome.org>

	* configure.in: require GTK+ 2.15.1 for orientable GtkBox.

2009-02-17  Vincent Untz  <vuntz@gnome.org>

	Kill OBox since GtkBox now supports changing the orientation.
	Patch by Christian Persch <chpe@gnome.org>.
	Fix bug #571042.

	* Makefile.am: remove obox.[ch]
	* obox.[ch]: killed
	* clock.c: (clock_box_init), (clock_box_class_init): add an
	instantiable GtkBox type
	(create_clock_widget), (applet_change_orient): use GtkBox methods.

2009-02-17  Vincent Untz  <vuntz@gnome.org>

	Kill OBox since GtkBox now supports changing the orientation.
	Patch by Christian Persch <chpe@gnome.org>.
	Fix bug #571042.

	* Makefile.am: remove obox.[ch]
	* obox.[ch]: killed
	* main.c: remove useless include
	* na-tray.c: (na_box_init), (na_box_class_init): add an
	instantiable GtkBox type
	(update_size_and_orientation), (na_tray_init): use GtkBox methods.

svn path=/trunk/; revision=11518
parent 2ee675ac
2009-02-17 Vincent Untz <vuntz@gnome.org>
* configure.in: require GTK+ 2.15.1 for orientable GtkBox.
2009-02-03 Vincent Untz <vuntz@gnome.org>
* configure.in: late post-release bump to 2.25.91
......
2009-02-17 Vincent Untz <vuntz@gnome.org>
Kill OBox since GtkBox now supports changing the orientation.
Patch by Christian Persch <chpe@gnome.org>.
Fix bug #571042.
* Makefile.am: remove obox.[ch]
* obox.[ch]: killed
* clock.c: (clock_box_init), (clock_box_class_init): add an
instantiable GtkBox type
(create_clock_widget), (applet_change_orient): use GtkBox methods.
2009-02-10 Matthias Clasen <mclasen@redhat.com>
* clock.glade: Fix two small oversights/regressions. There should
......
......@@ -42,8 +42,6 @@ endif
CLOCK_SOURCES = \
calendar-window.c \
calendar-window.h \
obox.c \
obox.h \
clock.c \
clock.h \
clock-face.c \
......
......@@ -68,7 +68,6 @@
#include "clock-location-tile.h"
#include "clock-map.h"
#include "clock-utils.h"
#include "obox.h"
#include "set-timezone.h"
#include "system-timezone.h"
......@@ -249,6 +248,27 @@ static void edit_hide (GtkWidget *unused, ClockData *cd);
static gboolean edit_delete (GtkWidget *unused, GdkEvent *event, ClockData *cd);
static void save_cities_store (ClockData *cd);
/* ClockBox, an instantiable GtkBox */
typedef GtkBox ClockBox;
typedef GtkBoxClass ClockBoxClass;
static GType clock_box_get_type (void);
G_DEFINE_TYPE (ClockBox, clock_box, GTK_TYPE_BOX)
static void
clock_box_init (ClockBox *box)
{
}
static void
clock_box_class_init (ClockBoxClass *klass)
{
}
/* Clock */
static void
unfix_size (ClockData *cd)
{
......@@ -1376,13 +1396,13 @@ create_clock_widget (ClockData *cd)
gtk_widget_show (cd->panel_button);
/* Main orientable box */
cd->main_obox = clock_obox_new ();
cd->main_obox = g_object_new (clock_box_get_type (), NULL);
gtk_box_set_spacing (GTK_BOX (cd->main_obox), 12); /* spacing between weather and time */
gtk_container_add (GTK_CONTAINER (cd->panel_button), cd->main_obox);
gtk_widget_show (cd->main_obox);
/* Weather orientable box */
cd->weather_obox = clock_obox_new ();
cd->weather_obox = g_object_new (clock_box_get_type (), NULL);
gtk_box_set_spacing (GTK_BOX (cd->weather_obox), 2); /* spacing between weather icon and temperature */
gtk_box_pack_start (GTK_BOX (cd->main_obox), cd->weather_obox, FALSE, FALSE, 0);
gtk_widget_set_has_tooltip (cd->weather_obox, TRUE);
......@@ -1481,8 +1501,8 @@ applet_change_orient (PanelApplet *applet,
return;
}
clock_obox_set_orientation (CLOCK_OBOX (cd->main_obox), o);
clock_obox_set_orientation (CLOCK_OBOX (cd->weather_obox), o);
gtk_orientable_set_orientation (GTK_ORIENTABLE (cd->main_obox), o);
gtk_orientable_set_orientation (GTK_ORIENTABLE (cd->weather_obox), o);
unfix_size (cd);
update_clock (cd);
......
/* OBox Copyright (C) 2002 Red Hat Inc. based on GtkHBox */
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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 General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "obox.h"
#include <gtk/gtk.h>
static void clock_obox_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void clock_obox_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
G_DEFINE_TYPE (ClockOBox, clock_obox, GTK_TYPE_BOX)
static void
clock_obox_finalize (GObject *object)
{
ClockOBox *obox;
obox = CLOCK_OBOX (object);
g_type_class_unref (obox->hbox_type);
g_type_class_unref (obox->vbox_type);
G_OBJECT_CLASS (clock_obox_parent_class)->finalize (object);
}
static void
clock_obox_class_init (ClockOBoxClass *class)
{
GObjectClass *gobject_class;
GtkWidgetClass *widget_class;
gobject_class = (GObjectClass*) class;
widget_class = (GtkWidgetClass*) class;
gobject_class->finalize = clock_obox_finalize;
widget_class->size_request = clock_obox_size_request;
widget_class->size_allocate = clock_obox_size_allocate;
}
static void
clock_obox_init (ClockOBox *obox)
{
obox->orientation = GTK_ORIENTATION_HORIZONTAL;
obox->reverse_order = FALSE;
obox->hbox_type = g_type_class_ref (GTK_TYPE_HBOX);
obox->vbox_type = g_type_class_ref (GTK_TYPE_VBOX);
}
GtkWidget*
clock_obox_new (void)
{
ClockOBox *obox;
obox = g_object_new (CLOCK_TYPE_OBOX, NULL);
return GTK_WIDGET (obox);
}
static GtkWidgetClass*
get_class (ClockOBox *obox)
{
GtkWidgetClass *klass;
switch (obox->orientation)
{
case GTK_ORIENTATION_HORIZONTAL:
klass = GTK_WIDGET_CLASS (obox->hbox_type);
break;
case GTK_ORIENTATION_VERTICAL:
klass = GTK_WIDGET_CLASS (obox->vbox_type);
break;
default:
g_assert_not_reached ();
klass = NULL;
break;
}
return klass;
}
static void
clock_obox_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkWidgetClass *klass;
ClockOBox *obox;
obox = CLOCK_OBOX (widget);
klass = get_class (obox);
klass->size_request (widget, requisition);
}
static void
clock_obox_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkWidgetClass *klass;
ClockOBox *obox;
obox = CLOCK_OBOX (widget);
klass = get_class (obox);
klass->size_allocate (widget, allocation);
}
void
clock_obox_set_orientation (ClockOBox *obox,
GtkOrientation orientation)
{
g_return_if_fail (CLOCK_IS_OBOX (obox));
if (obox->orientation == orientation)
return;
obox->orientation = orientation;
gtk_widget_queue_resize (GTK_WIDGET (obox));
}
void
clock_obox_set_reverse_order (ClockOBox *obox,
gboolean reverse_order)
{
GtkBox *box;
g_return_if_fail (CLOCK_IS_OBOX (obox));
if (obox->reverse_order == reverse_order)
return;
obox->reverse_order = reverse_order;
box = GTK_BOX (obox);
box->children = g_list_reverse (box->children);
gtk_widget_queue_resize (GTK_WIDGET (obox));
}
/* OBox Copyright (C) 2002 Red Hat Inc. based on GtkHBox */
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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 General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __CLOCK_OBOX_H__
#define __CLOCK_OBOX_H__
#include <gtk/gtk.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define CLOCK_TYPE_OBOX (clock_obox_get_type ())
#define CLOCK_OBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCK_TYPE_OBOX, ClockOBox))
#define CLOCK_OBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCK_TYPE_OBOX, ClockOBoxClass))
#define CLOCK_IS_OBOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCK_TYPE_OBOX))
#define CLOCK_IS_OBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCK_TYPE_OBOX))
#define CLOCK_OBOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCK_TYPE_OBOX, ClockOBoxClass))
typedef struct _ClockOBox ClockOBox;
typedef struct _ClockOBoxClass ClockOBoxClass;
struct _ClockOBox
{
GtkBox box;
GtkOrientation orientation;
gboolean reverse_order;
gpointer hbox_type;
gpointer vbox_type;
};
struct _ClockOBoxClass
{
GtkBoxClass parent_class;
};
GType clock_obox_get_type (void) G_GNUC_CONST;
GtkWidget* clock_obox_new (void);
void clock_obox_set_orientation (ClockOBox *obox,
GtkOrientation orientation);
void clock_obox_set_reverse_order (ClockOBox *obox,
gboolean reverse_order);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __CLOCK_OBOX_H__ */
2009-02-17 Vincent Untz <vuntz@gnome.org>
Kill OBox since GtkBox now supports changing the orientation.
Patch by Christian Persch <chpe@gnome.org>.
Fix bug #571042.
* Makefile.am: remove obox.[ch]
* obox.[ch]: killed
* main.c: remove useless include
* na-tray.c: (na_box_init), (na_box_class_init): add an
instantiable GtkBox type
(update_size_and_orientation), (na_tray_init): use GtkBox methods.
==================== 2.25.90 ====================
2009-01-21 Frederic Crozat <fcrozat@mandriva.com>
......
......@@ -18,8 +18,6 @@ NOTIFICATION_AREA_SOURCES = \
fixedtip.h \
fixedtip.c \
main.c \
obox.c \
obox.h \
na-tray.c \
na-tray.h \
na-tray-child.c \
......@@ -101,8 +99,6 @@ testtray_SOURCES = \
na-tray-child.h \
na-tray-manager.c \
na-tray-manager.h \
obox.c \
obox.h \
testtray.c
testtray_LDADD = \
......
......@@ -32,7 +32,6 @@
#include "na-tray-manager.h"
#include "na-tray.h"
#include "fixedtip.h"
#include "obox.h"
#define NOTIFICATION_AREA_ICON "gnome-panel-notification-area"
......
......@@ -29,7 +29,6 @@
#include "na-tray-manager.h"
#include "fixedtip.h"
#include "obox.h"
#include "na-tray.h"
......@@ -86,6 +85,27 @@ static TraysScreen *trays_screens = NULL;
static void icon_tip_show_next (IconTip *icontip);
/* NaBox, an instantiable GtkBox */
typedef GtkBox NaBox;
typedef GtkBoxClass NaBoxClass;
static GType na_box_get_type (void);
G_DEFINE_TYPE (NaBox, na_box, GTK_TYPE_BOX)
static void
na_box_init (NaBox *box)
{
}
static void
na_box_class_init (NaBoxClass *klass)
{
}
/* NaTray */
G_DEFINE_TYPE (NaTray, na_tray, GTK_TYPE_BIN)
static NaTray *
......@@ -375,7 +395,7 @@ update_size_and_orientation (NaTray *tray)
{
NaTrayPrivate *priv = tray->priv;
na_obox_set_orientation (NA_OBOX (priv->box), priv->orientation);
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->box), priv->orientation);
/* This only happens when setting the property during object construction */
if (!priv->trays_screen)
......@@ -447,7 +467,7 @@ na_tray_init (NaTray *tray)
gtk_container_add (GTK_CONTAINER (tray), priv->frame);
gtk_widget_show (priv->frame);
priv->box = na_obox_new ();
priv->box = g_object_new (na_box_get_type (), NULL);
g_signal_connect (priv->box, "expose-event",
G_CALLBACK (na_tray_expose_box), tray);
gtk_box_set_spacing (GTK_BOX (priv->box), ICON_SPACING);
......
/* OBox Copyright (C) 2002 Red Hat Inc. based on GtkHBox */
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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 General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "obox.h"
#include <gtk/gtk.h>
static void na_obox_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void na_obox_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
G_DEFINE_TYPE (NaOBox, na_obox, GTK_TYPE_BOX)
static void
na_obox_finalize (GObject *object)
{
NaOBox *obox;
obox = NA_OBOX (object);
g_type_class_unref (obox->hbox_type);
g_type_class_unref (obox->vbox_type);
G_OBJECT_CLASS (na_obox_parent_class)->finalize (object);
}
static void
na_obox_class_init (NaOBoxClass *class)
{
GObjectClass *gobject_class;
GtkWidgetClass *widget_class;
gobject_class = (GObjectClass*) class;
widget_class = (GtkWidgetClass*) class;
gobject_class->finalize = na_obox_finalize;
widget_class->size_request = na_obox_size_request;
widget_class->size_allocate = na_obox_size_allocate;
}
static void
na_obox_init (NaOBox *obox)
{
obox->orientation = GTK_ORIENTATION_HORIZONTAL;
obox->hbox_type = g_type_class_ref (GTK_TYPE_HBOX);
obox->vbox_type = g_type_class_ref (GTK_TYPE_VBOX);
}
GtkWidget*
na_obox_new (void)
{
NaOBox *obox;
obox = g_object_new (NA_TYPE_OBOX, NULL);
return GTK_WIDGET (obox);
}
static GtkWidgetClass*
get_class (NaOBox *obox)
{
GtkWidgetClass *klass;
switch (obox->orientation)
{
case GTK_ORIENTATION_HORIZONTAL:
klass = GTK_WIDGET_CLASS (obox->hbox_type);
break;
case GTK_ORIENTATION_VERTICAL:
klass = GTK_WIDGET_CLASS (obox->vbox_type);
break;
default:
g_assert_not_reached ();
klass = NULL;
break;
}
return klass;
}
static void
na_obox_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkWidgetClass *klass;
NaOBox *obox;
obox = NA_OBOX (widget);
klass = get_class (obox);
klass->size_request (widget, requisition);
}
static void
na_obox_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkWidgetClass *klass;
NaOBox *obox;
obox = NA_OBOX (widget);
klass = get_class (obox);
klass->size_allocate (widget, allocation);
}
void
na_obox_set_orientation (NaOBox *obox,
GtkOrientation orientation)
{
g_return_if_fail (NA_IS_OBOX (obox));
if (obox->orientation == orientation)
return;
obox->orientation = orientation;
gtk_widget_queue_resize (GTK_WIDGET (obox));
}
/* OBox Copyright (C) 2002 Red Hat Inc. based on GtkHBox */
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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 General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __NA_OBOX_H__
#define __NA_OBOX_H__
#include <gtk/gtk.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define NA_TYPE_OBOX (na_obox_get_type ())
#define NA_OBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NA_TYPE_OBOX, NaOBox))
#define NA_OBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NA_TYPE_OBOX, NaOBoxClass))
#define NA_IS_OBOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NA_TYPE_OBOX))