mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +00:00
Another tedious chore off the to-do list. I've just checked over my
custom Columns layout class to see what fiddly details of GTK2isation were yet to be done. It turns out that all the basic object management got moved out of GTK into a separate library, so that all the gtk_object_* calls are deprecated and g_object_* should be used instead; having done that, though, it all looks perfectly fine. [originally from svn r7962]
This commit is contained in:
parent
50d4d05679
commit
ed085ca824
@ -3,12 +3,6 @@ TODO for PuTTY GTK2 port before merging back into main trunk code
|
||||
|
||||
Things to do before deciding a merge is feasible:
|
||||
|
||||
- gtkcols.c is currently a minimal-work GTK2 port of my original
|
||||
GTK1 implementation. Someone should go through it and compare it
|
||||
to a real GTK2 container class, to make sure there aren't any
|
||||
large chunks we should have reimplemented and haven't, or indeed
|
||||
that we shouldn't have reimplemented and have.
|
||||
|
||||
- Update the autoconf build. Richard B says he had to replace
|
||||
AM_PATH_GTK([1.2.0],
|
||||
with
|
||||
|
@ -26,6 +26,7 @@ static void columns_size_allocate(GtkWidget *widget, GtkAllocation *alloc);
|
||||
|
||||
static GtkContainerClass *parent_class = NULL;
|
||||
|
||||
#if !GTK_CHECK_VERSION(2,0,0)
|
||||
GtkType columns_get_type(void)
|
||||
{
|
||||
static GtkType columns_type = 0;
|
||||
@ -47,6 +48,31 @@ GtkType columns_get_type(void)
|
||||
|
||||
return columns_type;
|
||||
}
|
||||
#else
|
||||
GType columns_get_type(void)
|
||||
{
|
||||
static GType columns_type = 0;
|
||||
|
||||
if (!columns_type) {
|
||||
static const GTypeInfo columns_info = {
|
||||
sizeof(ColumnsClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) columns_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof(Columns),
|
||||
0,
|
||||
(GInstanceInitFunc)columns_init,
|
||||
};
|
||||
|
||||
columns_type = g_type_register_static(GTK_TYPE_CONTAINER, "Columns",
|
||||
&columns_info, 0);
|
||||
}
|
||||
|
||||
return columns_type;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !GTK_CHECK_VERSION(2,0,0)
|
||||
static gint (*columns_inherited_focus)(GtkContainer *container,
|
||||
@ -55,20 +81,21 @@ static gint (*columns_inherited_focus)(GtkContainer *container,
|
||||
|
||||
static void columns_class_init(ColumnsClass *klass)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
GtkContainerClass *container_class;
|
||||
|
||||
object_class = (GtkObjectClass *)klass;
|
||||
widget_class = (GtkWidgetClass *)klass;
|
||||
container_class = (GtkContainerClass *)klass;
|
||||
#if !GTK_CHECK_VERSION(2,0,0)
|
||||
GtkObjectClass *object_class = (GtkObjectClass *)klass;
|
||||
GtkWidgetClass *widget_class = (GtkWidgetClass *)klass;
|
||||
GtkContainerClass *container_class = (GtkContainerClass *)klass;
|
||||
#else
|
||||
/* GObjectClass *object_class = G_OBJECT_CLASS(klass); */
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
|
||||
GtkContainerClass *container_class = GTK_CONTAINER_CLASS(klass);
|
||||
#endif
|
||||
|
||||
#if !GTK_CHECK_VERSION(2,0,0)
|
||||
parent_class = g_type_class_peek_parent(klass);
|
||||
#else
|
||||
parent_class = gtk_type_class(GTK_TYPE_CONTAINER);
|
||||
|
||||
/*
|
||||
* FIXME: do we have to do all this faffing with set_arg,
|
||||
* get_arg and child_arg_type? Ick.
|
||||
*/
|
||||
#endif
|
||||
|
||||
widget_class->map = columns_map;
|
||||
widget_class->unmap = columns_unmap;
|
||||
@ -300,7 +327,12 @@ GtkWidget *columns_new(gint spacing)
|
||||
{
|
||||
Columns *cols;
|
||||
|
||||
#if !GTK_CHECK_VERSION(2,0,0)
|
||||
cols = gtk_type_new(columns_get_type());
|
||||
#else
|
||||
cols = g_object_new(TYPE_COLUMNS, NULL);
|
||||
#endif
|
||||
|
||||
cols->spacing = spacing;
|
||||
|
||||
return GTK_WIDGET(cols);
|
||||
|
Loading…
Reference in New Issue
Block a user