Changed name to be set_cell_data_func to make it clear what the functino

Wed Feb 21 14:23:05 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_cell_data_func):
	Changed name to be set_cell_data_func to make it clear what
	the functino does.  Close bug #51069.

Tue Feb 20 16:49:00 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/testgtk.c (main): Remove turning on of profiling malloc,
	have memory actually freed.  Keeps box running longer.
This commit is contained in:
Jonathan Blandford 2001-02-21 19:59:23 +00:00 committed by Jonathan Blandford
parent e1e093fa44
commit 334a40e893
15 changed files with 196 additions and 47 deletions

View File

@ -1,3 +1,14 @@
Wed Feb 21 14:23:05 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_cell_data_func):
Changed name to be set_cell_data_func to make it clear what
the functino does. Close bug #51069.
Tue Feb 20 16:49:00 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/testgtk.c (main): Remove turning on of profiling malloc,
have memory actually freed. Keeps box running longer.
2001-02-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkseparatormenuitem.[ch]:
@ -26,6 +37,11 @@
* gtk/gtkarrow.c: Convert to new property API, patch from
Lee Mallabone
Tue Feb 20 14:26:41 2001 Jonathan Blandford <jrb@redhat.com>
* tests/testtreeview.c (toggled_callback): fix to reflect change
in GtkTreeModelStore.
Tue Feb 20 12:16:12 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkiconfactory.c (gtk_icon_set_new_from_pixbuf): New
@ -297,7 +313,6 @@ Sat Feb 17 06:47:27 2001 Tim Janik <timj@gtk.org>
* gtk/gtkliststore.c (gtk_list_store_set_valist):
fix G_VALUE_COLLECT() and G_VALUE_LCOPY() calls.
>>>>>>> 1.1728
Fri Feb 16 17:49:59 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.[hc], gtk/gtkliststore.[ch]: removed

View File

@ -1,3 +1,14 @@
Wed Feb 21 14:23:05 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_cell_data_func):
Changed name to be set_cell_data_func to make it clear what
the functino does. Close bug #51069.
Tue Feb 20 16:49:00 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/testgtk.c (main): Remove turning on of profiling malloc,
have memory actually freed. Keeps box running longer.
2001-02-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkseparatormenuitem.[ch]:
@ -26,6 +37,11 @@
* gtk/gtkarrow.c: Convert to new property API, patch from
Lee Mallabone
Tue Feb 20 14:26:41 2001 Jonathan Blandford <jrb@redhat.com>
* tests/testtreeview.c (toggled_callback): fix to reflect change
in GtkTreeModelStore.
Tue Feb 20 12:16:12 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkiconfactory.c (gtk_icon_set_new_from_pixbuf): New
@ -297,7 +313,6 @@ Sat Feb 17 06:47:27 2001 Tim Janik <timj@gtk.org>
* gtk/gtkliststore.c (gtk_list_store_set_valist):
fix G_VALUE_COLLECT() and G_VALUE_LCOPY() calls.
>>>>>>> 1.1728
Fri Feb 16 17:49:59 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.[hc], gtk/gtkliststore.[ch]: removed

View File

@ -1,3 +1,14 @@
Wed Feb 21 14:23:05 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_cell_data_func):
Changed name to be set_cell_data_func to make it clear what
the functino does. Close bug #51069.
Tue Feb 20 16:49:00 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/testgtk.c (main): Remove turning on of profiling malloc,
have memory actually freed. Keeps box running longer.
2001-02-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkseparatormenuitem.[ch]:
@ -26,6 +37,11 @@
* gtk/gtkarrow.c: Convert to new property API, patch from
Lee Mallabone
Tue Feb 20 14:26:41 2001 Jonathan Blandford <jrb@redhat.com>
* tests/testtreeview.c (toggled_callback): fix to reflect change
in GtkTreeModelStore.
Tue Feb 20 12:16:12 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkiconfactory.c (gtk_icon_set_new_from_pixbuf): New
@ -297,7 +313,6 @@ Sat Feb 17 06:47:27 2001 Tim Janik <timj@gtk.org>
* gtk/gtkliststore.c (gtk_list_store_set_valist):
fix G_VALUE_COLLECT() and G_VALUE_LCOPY() calls.
>>>>>>> 1.1728
Fri Feb 16 17:49:59 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.[hc], gtk/gtkliststore.[ch]: removed

View File

@ -1,3 +1,14 @@
Wed Feb 21 14:23:05 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_cell_data_func):
Changed name to be set_cell_data_func to make it clear what
the functino does. Close bug #51069.
Tue Feb 20 16:49:00 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/testgtk.c (main): Remove turning on of profiling malloc,
have memory actually freed. Keeps box running longer.
2001-02-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkseparatormenuitem.[ch]:
@ -26,6 +37,11 @@
* gtk/gtkarrow.c: Convert to new property API, patch from
Lee Mallabone
Tue Feb 20 14:26:41 2001 Jonathan Blandford <jrb@redhat.com>
* tests/testtreeview.c (toggled_callback): fix to reflect change
in GtkTreeModelStore.
Tue Feb 20 12:16:12 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkiconfactory.c (gtk_icon_set_new_from_pixbuf): New
@ -297,7 +313,6 @@ Sat Feb 17 06:47:27 2001 Tim Janik <timj@gtk.org>
* gtk/gtkliststore.c (gtk_list_store_set_valist):
fix G_VALUE_COLLECT() and G_VALUE_LCOPY() calls.
>>>>>>> 1.1728
Fri Feb 16 17:49:59 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.[hc], gtk/gtkliststore.[ch]: removed

View File

@ -1,3 +1,14 @@
Wed Feb 21 14:23:05 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_cell_data_func):
Changed name to be set_cell_data_func to make it clear what
the functino does. Close bug #51069.
Tue Feb 20 16:49:00 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/testgtk.c (main): Remove turning on of profiling malloc,
have memory actually freed. Keeps box running longer.
2001-02-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkseparatormenuitem.[ch]:
@ -26,6 +37,11 @@
* gtk/gtkarrow.c: Convert to new property API, patch from
Lee Mallabone
Tue Feb 20 14:26:41 2001 Jonathan Blandford <jrb@redhat.com>
* tests/testtreeview.c (toggled_callback): fix to reflect change
in GtkTreeModelStore.
Tue Feb 20 12:16:12 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkiconfactory.c (gtk_icon_set_new_from_pixbuf): New
@ -297,7 +313,6 @@ Sat Feb 17 06:47:27 2001 Tim Janik <timj@gtk.org>
* gtk/gtkliststore.c (gtk_list_store_set_valist):
fix G_VALUE_COLLECT() and G_VALUE_LCOPY() calls.
>>>>>>> 1.1728
Fri Feb 16 17:49:59 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.[hc], gtk/gtkliststore.[ch]: removed

View File

@ -1,3 +1,14 @@
Wed Feb 21 14:23:05 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_cell_data_func):
Changed name to be set_cell_data_func to make it clear what
the functino does. Close bug #51069.
Tue Feb 20 16:49:00 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/testgtk.c (main): Remove turning on of profiling malloc,
have memory actually freed. Keeps box running longer.
2001-02-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkseparatormenuitem.[ch]:
@ -26,6 +37,11 @@
* gtk/gtkarrow.c: Convert to new property API, patch from
Lee Mallabone
Tue Feb 20 14:26:41 2001 Jonathan Blandford <jrb@redhat.com>
* tests/testtreeview.c (toggled_callback): fix to reflect change
in GtkTreeModelStore.
Tue Feb 20 12:16:12 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkiconfactory.c (gtk_icon_set_new_from_pixbuf): New
@ -297,7 +313,6 @@ Sat Feb 17 06:47:27 2001 Tim Janik <timj@gtk.org>
* gtk/gtkliststore.c (gtk_list_store_set_valist):
fix G_VALUE_COLLECT() and G_VALUE_LCOPY() calls.
>>>>>>> 1.1728
Fri Feb 16 17:49:59 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.[hc], gtk/gtkliststore.[ch]: removed

View File

@ -1,3 +1,14 @@
Wed Feb 21 14:23:05 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_cell_data_func):
Changed name to be set_cell_data_func to make it clear what
the functino does. Close bug #51069.
Tue Feb 20 16:49:00 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/testgtk.c (main): Remove turning on of profiling malloc,
have memory actually freed. Keeps box running longer.
2001-02-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkseparatormenuitem.[ch]:
@ -26,6 +37,11 @@
* gtk/gtkarrow.c: Convert to new property API, patch from
Lee Mallabone
Tue Feb 20 14:26:41 2001 Jonathan Blandford <jrb@redhat.com>
* tests/testtreeview.c (toggled_callback): fix to reflect change
in GtkTreeModelStore.
Tue Feb 20 12:16:12 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkiconfactory.c (gtk_icon_set_new_from_pixbuf): New
@ -297,7 +313,6 @@ Sat Feb 17 06:47:27 2001 Tim Janik <timj@gtk.org>
* gtk/gtkliststore.c (gtk_list_store_set_valist):
fix G_VALUE_COLLECT() and G_VALUE_LCOPY() calls.
>>>>>>> 1.1728
Fri Feb 16 17:49:59 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.[hc], gtk/gtkliststore.[ch]: removed

View File

@ -21,8 +21,9 @@
#include <stdio.h>
#include <string.h>
#include <glib.h>
#include <gobject/gobject.h>
#include <gobject/gvaluecollector.h>
#include "gtkmarshal.h"
#include "gtktreemodel.h"
struct _GtkTreePath
@ -31,6 +32,9 @@ struct _GtkTreePath
gint *indices;
};
static void gtk_tree_model_base_init (gpointer g_class);
GtkType
gtk_tree_model_get_type (void)
{
@ -41,7 +45,7 @@ gtk_tree_model_get_type (void)
static const GTypeInfo tree_model_info =
{
sizeof (GtkTreeModelIface), /* class_size */
NULL, /* base_init */
gtk_tree_model_base_init, /* base_init */
NULL, /* base_finalize */
NULL,
NULL, /* class_finalize */
@ -57,6 +61,56 @@ gtk_tree_model_get_type (void)
return tree_model_type;
}
static void
gtk_tree_model_base_init (gpointer g_class)
{
static gboolean initted = FALSE;
#if 0
if (! initted)
{
g_signal_newc ("changed",
GTK_TYPE_TREE_MODEL,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GtkTreeModelIface, changed),
NULL,
gtk_marshal_VOID__BOXED_BOXED,
G_TYPE_NONE, 2,
GTK_TYPE_TREE_PATH,
GTK_TYPE_TREE_ITER);
g_signal_newc ("inserted",
GTK_TYPE_TREE_MODEL,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GtkTreeModelIface, inserted),
NULL,
gtk_marshal_VOID__BOXED_BOXED,
G_TYPE_NONE, 2,
GTK_TYPE_TREE_PATH,
GTK_TYPE_TREE_ITER);
g_signal_newc ("child_toggled",
GTK_TYPE_TREE_MODEL,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GtkTreeModelIface, child_toggled),
NULL,
gtk_marshal_VOID__BOXED_BOXED,
G_TYPE_NONE, 2,
GTK_TYPE_TREE_PATH,
GTK_TYPE_TREE_ITER);
g_signal_newc ("deleted",
GTK_TYPE_TREE_MODEL,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GtkTreeModelIface, deleted),
NULL,
gtk_marshal_VOID__BOXED_BOXED,
G_TYPE_NONE, 1,
GTK_TYPE_TREE_PATH);
initted = TRUE;
}
#endif
}
/**
* gtk_tree_path_new:
*

View File

@ -57,10 +57,6 @@ struct _GtkTreeModelIface
GTypeInterface g_iface;
/* Signals */
/* Currently unimplemented as interfaces do not support signals yet, so
* objects implementing this interface need this. Later, it will be moved
* back here.
*/
void (* changed) (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
@ -76,7 +72,7 @@ struct _GtkTreeModelIface
GtkTreePath *path,
gint *new_order);
/* VTable - not signals */
/* Virtual Table */
GtkTreeModelFlags (* get_flags) (GtkTreeModel *tree_model);
gint (* get_n_columns) (GtkTreeModel *tree_model);

View File

@ -48,9 +48,7 @@
* TREE_VIEW_VERTICAL_SEPARATOR%2 pixels below the row.
*/
/* Set to large number for debugging. Should normally be 2. */
#define TREE_VIEW_VERTICAL_SEPARATOR 2
#define TREE_VIEW_HORIZONTAL_SEPARATOR 0
/* The "background" areas of all rows/cells add up to cover the entire tree.
@ -3360,7 +3358,11 @@ gtk_tree_view_draw_arrow (GtkTreeView *tree_view,
}
else
{
state = (node==tree_view->priv->prelight_node&&GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_ARROW_PRELIT)?GTK_STATE_PRELIGHT:GTK_STATE_NORMAL);
if (node == tree_view->priv->prelight_node &&
GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_ARROW_PRELIT))
state = GTK_STATE_PRELIGHT;
else
state = GTK_STATE_NORMAL;
}
/* FIXME expander size should come from a style property */

View File

@ -630,7 +630,7 @@ gtk_tree_view_column_set_attributes (GtkTreeViewColumn *tree_column,
/**
* gtk_tree_view_column_set_func:
* gtk_tree_view_column_set_cell_data_func:
* @tree_column: A #GtkTreeViewColumn
* @func: The #GtkTreeViewColumnFunc to use.
* @func_data: The user data for @func.
@ -642,10 +642,10 @@ gtk_tree_view_column_set_attributes (GtkTreeViewColumn *tree_column,
* may be NULL to remove an older one.
**/
void
gtk_tree_view_column_set_func (GtkTreeViewColumn *tree_column,
GtkTreeViewColumnFunc func,
gpointer func_data,
GtkDestroyNotify destroy)
gtk_tree_view_column_set_cell_data_func (GtkTreeViewColumn *tree_column,
CellDataFunc func,
gpointer func_data,
GtkDestroyNotify destroy)
{
g_return_if_fail (tree_column != NULL);
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
@ -711,12 +711,6 @@ gtk_tree_view_column_set_cell_data (GtkTreeViewColumn *tree_column,
if (tree_model == NULL)
return;
if (tree_column->func)
{
(* tree_column->func) (tree_column, tree_model, iter, tree_column->func_data);
return;
}
cell = (GObject *) tree_column->cell;
list = tree_column->attributes;
@ -732,6 +726,10 @@ gtk_tree_view_column_set_cell_data (GtkTreeViewColumn *tree_column,
list = list->next->next;
}
if (tree_column->func)
(* tree_column->func) (tree_column, tree_column->cell, tree_model, iter, tree_column->func_data);
g_object_thaw_notify (cell);
}
@ -1154,7 +1152,7 @@ update_button_contents (GtkTreeViewColumn *tree_column)
**/
void
gtk_tree_view_column_set_title (GtkTreeViewColumn *tree_column,
gchar *title)
const gchar *title)
{
g_return_if_fail (tree_column != NULL);
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));

View File

@ -45,10 +45,11 @@ typedef enum
typedef struct _GtkTreeViewColumn GtkTreeViewColumn;
typedef struct _GtkTreeViewColumnClass GtkTreeViewColumnClass;
typedef void (* GtkTreeViewColumnFunc) (GtkTreeViewColumn *tree_column,
GtkTreeModel *tree_model,
GtkTreeIter *iter,
gpointer data);
typedef void (* CellDataFunc) (GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell,
GtkTreeModel *tree_model,
GtkTreeIter *iter,
gpointer data);
struct _GtkTreeViewColumn
@ -68,8 +69,9 @@ struct _GtkTreeViewColumn
gint width;
gint min_width;
gint max_width;
gint allocated_width;
GtkTreeViewColumnFunc func;
CellDataFunc func;
gpointer func_data;
GtkDestroyNotify destroy;
gchar *title;
@ -104,8 +106,8 @@ void gtk_tree_view_column_add_attribute (GtkTreeViewColumn
gint column);
void gtk_tree_view_column_set_attributes (GtkTreeViewColumn *tree_column,
...);
void gtk_tree_view_column_set_func (GtkTreeViewColumn *tree_column,
GtkTreeViewColumnFunc func,
void gtk_tree_view_column_set_cell_data_func (GtkTreeViewColumn *tree_column,
CellDataFunc func,
gpointer func_data,
GtkDestroyNotify destroy);
void gtk_tree_view_column_clear_attributes (GtkTreeViewColumn *tree_column);
@ -134,7 +136,7 @@ void gtk_tree_view_column_clicked (GtkTreeViewColumn
/* Options for manipulating the column headers
*/
void gtk_tree_view_column_set_title (GtkTreeViewColumn *tree_column,
gchar *title);
const gchar *title);
G_CONST_RETURN gchar *gtk_tree_view_column_get_title (GtkTreeViewColumn *tree_column);
void gtk_tree_view_column_set_clickable (GtkTreeViewColumn *tree_column,
gboolean active);

View File

@ -9472,8 +9472,6 @@ main (int argc, char *argv[])
{
GtkBindingSet *binding_set;
g_mem_set_vtable (glib_mem_profiler_table);
srand (time (NULL));
test_init ();
@ -9508,8 +9506,6 @@ main (int argc, char *argv[])
while (g_main_pending ())
g_main_iteration (FALSE);
}
g_blow_chunks ();
g_mem_profile ();
return 0;
}

View File

@ -9472,8 +9472,6 @@ main (int argc, char *argv[])
{
GtkBindingSet *binding_set;
g_mem_set_vtable (glib_mem_profiler_table);
srand (time (NULL));
test_init ();
@ -9508,8 +9506,6 @@ main (int argc, char *argv[])
while (g_main_pending ())
g_main_iteration (FALSE);
}
g_blow_chunks ();
g_mem_profile ();
return 0;
}

View File

@ -209,7 +209,7 @@ toggled_callback (GtkCellRendererToggle *celltoggle,
if (GTK_IS_LIST_STORE (model))
{
gtk_list_store_get (GTK_LIST_STORE (model),
gtk_tree_model_get (GTK_TREE_MODEL (model),
&iter,
BOOL_COLUMN,
&active,
@ -223,7 +223,7 @@ toggled_callback (GtkCellRendererToggle *celltoggle,
}
else if (GTK_IS_TREE_STORE (model))
{
gtk_tree_store_get (GTK_TREE_STORE (model),
gtk_tree_model_get (GTK_TREE_MODEL (model),
&iter,
BOOL_COLUMN,
&active,