* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
+#include <config.h>
#include "gtkfixed.h"
+#include "gtkprivate.h"
#include "gtkintl.h"
-
+#include "gtkalias.h"
enum {
CHILD_PROP_0,
CHILD_PROP_X,
CHILD_PROP_Y
};
-static void gtk_fixed_class_init (GtkFixedClass *klass);
-static void gtk_fixed_init (GtkFixed *fixed);
static void gtk_fixed_realize (GtkWidget *widget);
static void gtk_fixed_size_request (GtkWidget *widget,
GtkRequisition *requisition);
gboolean include_internals,
GtkCallback callback,
gpointer callback_data);
-static GtkType gtk_fixed_child_type (GtkContainer *container);
+static GType gtk_fixed_child_type (GtkContainer *container);
static void gtk_fixed_set_child_property (GtkContainer *container,
GtkWidget *child,
GValue *value,
GParamSpec *pspec);
-static GtkContainerClass *parent_class = NULL;
-
-
-GtkType
-gtk_fixed_get_type (void)
-{
- static GtkType fixed_type = 0;
-
- if (!fixed_type)
- {
- static const GtkTypeInfo fixed_info =
- {
- "GtkFixed",
- sizeof (GtkFixed),
- sizeof (GtkFixedClass),
- (GtkClassInitFunc) gtk_fixed_class_init,
- (GtkObjectInitFunc) gtk_fixed_init,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- fixed_type = gtk_type_unique (GTK_TYPE_CONTAINER, &fixed_info);
- }
-
- return fixed_type;
-}
+G_DEFINE_TYPE (GtkFixed, gtk_fixed, GTK_TYPE_CONTAINER)
static void
gtk_fixed_class_init (GtkFixedClass *class)
{
- GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkContainerClass *container_class;
- object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) class;
container_class = (GtkContainerClass*) class;
- parent_class = gtk_type_class (GTK_TYPE_CONTAINER);
-
widget_class->realize = gtk_fixed_realize;
widget_class->size_request = gtk_fixed_size_request;
widget_class->size_allocate = gtk_fixed_size_allocate;
gtk_container_class_install_child_property (container_class,
CHILD_PROP_X,
g_param_spec_int ("x",
- _("X position"),
- _("X position of child widget"),
+ P_("X position"),
+ P_("X position of child widget"),
G_MININT,
G_MAXINT,
0,
- G_PARAM_READWRITE));
+ GTK_PARAM_READWRITE));
gtk_container_class_install_child_property (container_class,
CHILD_PROP_Y,
g_param_spec_int ("y",
- _("Y position"),
- _("Y position of child widget"),
+ P_("Y position"),
+ P_("Y position of child widget"),
G_MININT,
G_MAXINT,
0,
- G_PARAM_READWRITE));
+ GTK_PARAM_READWRITE));
}
-static GtkType
+static GType
gtk_fixed_child_type (GtkContainer *container)
{
return GTK_TYPE_WIDGET;
GtkWidget*
gtk_fixed_new (void)
{
- GtkFixed *fixed;
-
- fixed = gtk_type_new (GTK_TYPE_FIXED);
- return GTK_WIDGET (fixed);
+ return g_object_new (GTK_TYPE_FIXED, NULL);
}
static GtkFixedChild*
GtkFixedChild *child_info;
g_return_if_fail (GTK_IS_FIXED (fixed));
- g_return_if_fail (widget != NULL);
+ g_return_if_fail (GTK_IS_WIDGET (widget));
child_info = g_new (GtkFixedChild, 1);
child_info->widget = widget;
gint x,
gint y)
{
- g_return_if_fail (GTK_IS_FIXED (fixed));
- g_return_if_fail (GTK_IS_WIDGET (widget));
- g_return_if_fail (widget->parent == GTK_WIDGET (fixed));
-
gtk_fixed_move_internal (fixed, widget, TRUE, x, TRUE, y);
}
GdkWindowAttr attributes;
gint attributes_mask;
- g_return_if_fail (GTK_IS_FIXED (widget));
-
if (GTK_WIDGET_NO_WINDOW (widget))
- GTK_WIDGET_CLASS (parent_class)->realize (widget);
+ GTK_WIDGET_CLASS (gtk_fixed_parent_class)->realize (widget);
else
{
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
GList *children;
GtkRequisition child_requisition;
- g_return_if_fail (GTK_IS_FIXED (widget));
- g_return_if_fail (requisition != NULL);
-
fixed = GTK_FIXED (widget);
requisition->width = 0;
requisition->height = 0;
GList *children;
guint16 border_width;
- g_return_if_fail (GTK_IS_FIXED(widget));
- g_return_if_fail (allocation != NULL);
-
fixed = GTK_FIXED (widget);
widget->allocation = *allocation;
gtk_fixed_add (GtkContainer *container,
GtkWidget *widget)
{
- g_return_if_fail (GTK_IS_FIXED (container));
- g_return_if_fail (widget != NULL);
-
gtk_fixed_put (GTK_FIXED (container), widget, 0, 0);
}
GtkFixedChild *child;
GList *children;
- g_return_if_fail (GTK_IS_FIXED (container));
- g_return_if_fail (widget != NULL);
-
fixed = GTK_FIXED (container);
children = fixed->children;
GtkFixedChild *child;
GList *children;
- g_return_if_fail (GTK_IS_FIXED (container));
g_return_if_fail (callback != NULL);
fixed = GTK_FIXED (container);
* @has_window: %TRUE if a separate window should be created
*
* Sets whether a #GtkFixed widget is created with a separate
- * #GdkWindow for widget->window or not. (By default, it will be
+ * #GdkWindow for @widget->window or not. (By default, it will be
* created with no separate #GdkWindow). This function must be called
- * while the is not realized, for instance, immediately after the
+ * while the #GtkFixed is not realized, for instance, immediately after the
* window is created.
+ *
+ * This function was added to provide an easy migration path for
+ * older applications which may expect #GtkFixed to have a separate window.
**/
void
gtk_fixed_set_has_window (GtkFixed *fixed,
* gtk_fixed_get_has_window:
* @fixed: a #GtkWidget
*
- * Gets whether the #GtkFixed has it's own #GdkWindow.
+ * Gets whether the #GtkFixed has its own #GdkWindow.
* See gdk_fixed_set_has_window().
*
- * Return value:
+ * Return value: %TRUE if @fixed has its own window.
**/
gboolean
gtk_fixed_get_has_window (GtkFixed *fixed)
return !GTK_WIDGET_NO_WINDOW (fixed);
}
+
+#define __GTK_FIXED_C__
+#include "gtkaliasdef.c"