summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Janik <timj@gtk.org>1998-09-03 07:28:37 +0000
committerTim Janik <timj@src.gnome.org>1998-09-03 07:28:37 +0000
commit0f0d9509c061a1df2a6386e9ddc02ee4a921de26 (patch)
treefd6a814ccee786532644edf216b01467c70b3502
parentebe76c752c982e361c481b743fa195618cc19b52 (diff)
downloadgdk-pixbuf-0f0d9509c061a1df2a6386e9ddc02ee4a921de26.tar.gz
`const' fixups.merge-to-themes-2-4
Thu Sep 3 07:16:54 1998 Tim Janik <timj@gtk.org> * gtk/gtkctree.h: * gtk/gtkctree.c: `const' fixups. * gtk/gtkclist.h: * gtk/gtkclist.c: `const' fixups and some coding style adaptions. * gtk/gtkctree.c (gtk_ctree_insert_node): don't dereference *text if it is passed as NULL.
-rw-r--r--ChangeLog11
-rw-r--r--ChangeLog.pre-2-011
-rw-r--r--ChangeLog.pre-2-1011
-rw-r--r--ChangeLog.pre-2-211
-rw-r--r--ChangeLog.pre-2-411
-rw-r--r--ChangeLog.pre-2-611
-rw-r--r--ChangeLog.pre-2-811
-rw-r--r--gtk/gtkclist.c72
-rw-r--r--gtk/gtkclist.h442
-rw-r--r--gtk/gtkctree.c38
-rw-r--r--gtk/gtkctree.h8
11 files changed, 367 insertions, 270 deletions
diff --git a/ChangeLog b/ChangeLog
index ff12e1bd3..082570314 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+Thu Sep 3 07:16:54 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkctree.h:
+ * gtk/gtkctree.c: `const' fixups.
+
+ * gtk/gtkclist.h:
+ * gtk/gtkclist.c: `const' fixups and some coding style adaptions.
+
+ * gtk/gtkctree.c (gtk_ctree_insert_node): don't dereference *text
+ if it is passed as NULL.
+
Wed Sep 2 22:41:40 1998 Raph Levien <raph@gimp.org>
* gdk/gdkrgb.c (gdk_rgb_select_conv): Fixed 32bpp image depth
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index ff12e1bd3..082570314 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,14 @@
+Thu Sep 3 07:16:54 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkctree.h:
+ * gtk/gtkctree.c: `const' fixups.
+
+ * gtk/gtkclist.h:
+ * gtk/gtkclist.c: `const' fixups and some coding style adaptions.
+
+ * gtk/gtkctree.c (gtk_ctree_insert_node): don't dereference *text
+ if it is passed as NULL.
+
Wed Sep 2 22:41:40 1998 Raph Levien <raph@gimp.org>
* gdk/gdkrgb.c (gdk_rgb_select_conv): Fixed 32bpp image depth
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index ff12e1bd3..082570314 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,14 @@
+Thu Sep 3 07:16:54 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkctree.h:
+ * gtk/gtkctree.c: `const' fixups.
+
+ * gtk/gtkclist.h:
+ * gtk/gtkclist.c: `const' fixups and some coding style adaptions.
+
+ * gtk/gtkctree.c (gtk_ctree_insert_node): don't dereference *text
+ if it is passed as NULL.
+
Wed Sep 2 22:41:40 1998 Raph Levien <raph@gimp.org>
* gdk/gdkrgb.c (gdk_rgb_select_conv): Fixed 32bpp image depth
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index ff12e1bd3..082570314 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,14 @@
+Thu Sep 3 07:16:54 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkctree.h:
+ * gtk/gtkctree.c: `const' fixups.
+
+ * gtk/gtkclist.h:
+ * gtk/gtkclist.c: `const' fixups and some coding style adaptions.
+
+ * gtk/gtkctree.c (gtk_ctree_insert_node): don't dereference *text
+ if it is passed as NULL.
+
Wed Sep 2 22:41:40 1998 Raph Levien <raph@gimp.org>
* gdk/gdkrgb.c (gdk_rgb_select_conv): Fixed 32bpp image depth
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index ff12e1bd3..082570314 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,14 @@
+Thu Sep 3 07:16:54 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkctree.h:
+ * gtk/gtkctree.c: `const' fixups.
+
+ * gtk/gtkclist.h:
+ * gtk/gtkclist.c: `const' fixups and some coding style adaptions.
+
+ * gtk/gtkctree.c (gtk_ctree_insert_node): don't dereference *text
+ if it is passed as NULL.
+
Wed Sep 2 22:41:40 1998 Raph Levien <raph@gimp.org>
* gdk/gdkrgb.c (gdk_rgb_select_conv): Fixed 32bpp image depth
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index ff12e1bd3..082570314 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,14 @@
+Thu Sep 3 07:16:54 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkctree.h:
+ * gtk/gtkctree.c: `const' fixups.
+
+ * gtk/gtkclist.h:
+ * gtk/gtkclist.c: `const' fixups and some coding style adaptions.
+
+ * gtk/gtkctree.c (gtk_ctree_insert_node): don't dereference *text
+ if it is passed as NULL.
+
Wed Sep 2 22:41:40 1998 Raph Levien <raph@gimp.org>
* gdk/gdkrgb.c (gdk_rgb_select_conv): Fixed 32bpp image depth
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index ff12e1bd3..082570314 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,14 @@
+Thu Sep 3 07:16:54 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkctree.h:
+ * gtk/gtkctree.c: `const' fixups.
+
+ * gtk/gtkclist.h:
+ * gtk/gtkclist.c: `const' fixups and some coding style adaptions.
+
+ * gtk/gtkctree.c (gtk_ctree_insert_node): don't dereference *text
+ if it is passed as NULL.
+
Wed Sep 2 22:41:40 1998 Raph Levien <raph@gimp.org>
* gdk/gdkrgb.c (gdk_rgb_select_conv): Fixed 32bpp image depth
diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c
index 2a0776e1c..720f7d6e4 100644
--- a/gtk/gtkclist.c
+++ b/gtk/gtkclist.c
@@ -285,23 +285,23 @@ static void hadjustment_value_changed (GtkAdjustment * adjustment,
/* Memory Allocation/Distruction Routines */
static GtkCListColumn *columns_new (GtkCList * clist);
-static void column_title_new (GtkCList * clist,
- gint column,
- gchar * title);
+static void column_title_new (GtkCList *clist,
+ gint column,
+ const gchar *title);
static void columns_delete (GtkCList * clist);
static GtkCListRow *row_new (GtkCList * clist);
static void row_delete (GtkCList * clist,
GtkCListRow * clist_row);
-static void set_cell_contents (GtkCList * clist,
- GtkCListRow * clist_row,
- gint column,
- GtkCellType type,
- gchar * text,
- guint8 spacing,
- GdkPixmap * pixmap,
- GdkBitmap * mask);
+static void set_cell_contents (GtkCList *clist,
+ GtkCListRow *clist_row,
+ gint column,
+ GtkCellType type,
+ const gchar *text,
+ guint8 spacing,
+ GdkPixmap *pixmap,
+ GdkBitmap *mask);
static gint real_insert_row (GtkCList * clist,
gint row,
gchar * text[]);
@@ -1074,9 +1074,9 @@ gtk_clist_column_titles_passive (GtkCList * clist)
}
void
-gtk_clist_set_column_title (GtkCList * clist,
- gint column,
- gchar * title)
+gtk_clist_set_column_title (GtkCList *clist,
+ gint column,
+ const gchar *title)
{
gint new_button = 0;
GtkWidget *old_widget;
@@ -1348,10 +1348,10 @@ gtk_clist_get_cell_type (GtkCList * clist,
}
void
-gtk_clist_set_text (GtkCList * clist,
- gint row,
- gint column,
- gchar * text)
+gtk_clist_set_text (GtkCList *clist,
+ gint row,
+ gint column,
+ const gchar *text)
{
GtkCListRow *clist_row;
@@ -1471,13 +1471,13 @@ gtk_clist_get_pixmap (GtkCList * clist,
}
void
-gtk_clist_set_pixtext (GtkCList * clist,
- gint row,
- gint column,
- gchar * text,
- guint8 spacing,
- GdkPixmap * pixmap,
- GdkBitmap * mask)
+gtk_clist_set_pixtext (GtkCList *clist,
+ gint row,
+ gint column,
+ const gchar *text,
+ guint8 spacing,
+ GdkPixmap *pixmap,
+ GdkBitmap *mask)
{
GtkCListRow *clist_row;
@@ -4676,9 +4676,9 @@ columns_new (GtkCList * clist)
}
static void
-column_title_new (GtkCList * clist,
- gint column,
- gchar * title)
+column_title_new (GtkCList *clist,
+ gint column,
+ const gchar *title)
{
if (clist->column[column].title)
g_free (clist->column[column].title);
@@ -4741,14 +4741,14 @@ row_delete (GtkCList * clist,
}
static void
-set_cell_contents (GtkCList * clist,
- GtkCListRow * clist_row,
- gint column,
- GtkCellType type,
- gchar * text,
- guint8 spacing,
- GdkPixmap * pixmap,
- GdkBitmap * mask)
+set_cell_contents (GtkCList *clist,
+ GtkCListRow *clist_row,
+ gint column,
+ GtkCellType type,
+ const gchar *text,
+ guint8 spacing,
+ GdkPixmap *pixmap,
+ GdkBitmap *mask)
{
g_return_if_fail (clist_row != NULL);
diff --git a/gtk/gtkclist.h b/gtk/gtkclist.h
index a3c75031c..eed34ccc1 100644
--- a/gtk/gtkclist.h
+++ b/gtk/gtkclist.h
@@ -30,9 +30,9 @@
#include <gtk/gtkenums.h>
#ifdef __cplusplus
-extern "C"
-{
-#endif /* __cplusplus */
+extern "C" {
+#pragma }
+#endif /* __cplusplus */
/* clist flags */
enum
@@ -106,15 +106,15 @@ struct _GtkCList
GtkContainer container;
guint16 flags;
-
+
/* mem chunks */
GMemChunk *row_mem_chunk;
GMemChunk *cell_mem_chunk;
-
+
/* allocation rectangle after the conatiner_border_width
* and the width of the shadow border */
GdkRectangle internal_allocation;
-
+
/* rows */
gint rows;
gint row_center_offset;
@@ -145,44 +145,44 @@ struct _GtkCList
/* the list's selection mode (gtkenums.h) */
GtkSelectionMode selection_mode;
-
+
/* list of selected rows */
GList *selection;
GList *selection_end;
-
+
GList *undo_selection;
GList *undo_unselection;
gint undo_anchor;
-
+
/* scrollbars */
GtkWidget *vscrollbar;
GtkWidget *hscrollbar;
guint8 vscrollbar_policy;
guint8 hscrollbar_policy;
-
+
/* xor GC for the vertical drag line */
GdkGC *xor_gc;
-
+
/* gc for drawing unselected cells */
GdkGC *fg_gc;
GdkGC *bg_gc;
-
+
/* cursor used to indicate dragging */
GdkCursor *cursor_drag;
-
+
/* the current x-pixel location of the xor-drag line */
gint x_drag;
-
+
/* focus handling */
gint focus_row;
-
+
/* dragging the selection */
gint anchor;
GtkStateType anchor_state;
gint drag_pos;
gint htimer;
gint vtimer;
-
+
GtkSortType sort_type;
GtkCListCompareFunc compare;
gint sort_column;
@@ -192,61 +192,61 @@ struct _GtkCListClass
{
GtkContainerClass parent_class;
- void (*select_row) (GtkCList * clist,
- gint row,
- gint column,
- GdkEvent * event);
- void (*unselect_row) (GtkCList * clist,
- gint row,
- gint column,
- GdkEvent * event);
- void (*click_column) (GtkCList * clist,
- gint column);
- void (*toggle_focus_row) (GtkCList * clist);
- void (*select_all) (GtkCList * clist);
- void (*unselect_all) (GtkCList * clist);
- void (*undo_selection) (GtkCList * clist);
- void (*start_selection) (GtkCList * clist);
- void (*end_selection) (GtkCList * clist);
- void (*extend_selection) (GtkCList * clist,
- GtkScrollType scroll_type,
- gfloat position,
- gboolean auto_start_selection);
- void (*scroll_horizontal) (GtkCList * clist,
- GtkScrollType scroll_type,
- gfloat position);
- void (*scroll_vertical) (GtkCList * clist,
- GtkScrollType scroll_type,
- gfloat position);
- void (*toggle_add_mode) (GtkCList * clist);
- void (*abort_column_resize) (GtkCList * clist);
- void (*resync_selection) (GtkCList * clist,
- GdkEvent * event);
- GList * (*selection_find) (GtkCList *clist,
- gint row_number,
- GList *row_list_element);
- void (*draw_row) (GtkCList * clist,
- GdkRectangle * area,
- gint row,
- GtkCListRow * clist_row);
- void (*clear) (GtkCList * clist);
- void (*fake_unselect_all) (GtkCList * clist,
- gint row);
- void (*sort_list) (GtkCList * clist);
- gint (*insert_row) (GtkCList * clist,
- gint row,
- gchar * text[]);
- void (*remove_row) (GtkCList * clist,
- gint row);
- void (*set_cell_contents) (GtkCList * clist,
- GtkCListRow * clist_row,
- gint column,
- GtkCellType type,
- gchar * text,
- guint8 spacing,
- GdkPixmap * pixmap,
- GdkBitmap * mask);
-
+ void (*select_row) (GtkCList *clist,
+ gint row,
+ gint column,
+ GdkEvent *event);
+ void (*unselect_row) (GtkCList *clist,
+ gint row,
+ gint column,
+ GdkEvent *event);
+ void (*click_column) (GtkCList *clist,
+ gint column);
+ void (*toggle_focus_row) (GtkCList *clist);
+ void (*select_all) (GtkCList *clist);
+ void (*unselect_all) (GtkCList *clist);
+ void (*undo_selection) (GtkCList *clist);
+ void (*start_selection) (GtkCList *clist);
+ void (*end_selection) (GtkCList *clist);
+ void (*extend_selection) (GtkCList *clist,
+ GtkScrollType scroll_type,
+ gfloat position,
+ gboolean auto_start_selection);
+ void (*scroll_horizontal) (GtkCList *clist,
+ GtkScrollType scroll_type,
+ gfloat position);
+ void (*scroll_vertical) (GtkCList *clist,
+ GtkScrollType scroll_type,
+ gfloat position);
+ void (*toggle_add_mode) (GtkCList *clist);
+ void (*abort_column_resize) (GtkCList *clist);
+ void (*resync_selection) (GtkCList *clist,
+ GdkEvent *event);
+ GList* (*selection_find) (GtkCList *clist,
+ gint row_number,
+ GList *row_list_element);
+ void (*draw_row) (GtkCList *clist,
+ GdkRectangle *area,
+ gint row,
+ GtkCListRow *clist_row);
+ void (*clear) (GtkCList *clist);
+ void (*fake_unselect_all) (GtkCList *clist,
+ gint row);
+ void (*sort_list) (GtkCList *clist);
+ gint (*insert_row) (GtkCList *clist,
+ gint row,
+ gchar *text[]);
+ void (*remove_row) (GtkCList *clist,
+ gint row);
+ void (*set_cell_contents) (GtkCList *clist,
+ GtkCListRow *clist_row,
+ gint column,
+ GtkCellType type,
+ const gchar *text,
+ guint8 spacing,
+ GdkPixmap *pixmap,
+ GdkBitmap *mask);
+
gint scrollbar_spacing;
};
@@ -257,10 +257,10 @@ struct _GtkCListColumn
GtkWidget *button;
GdkWindow *window;
-
+
gint width;
GtkJustification justification;
-
+
gint width_set : 1;
};
@@ -268,13 +268,13 @@ struct _GtkCListRow
{
GtkCell *cell;
GtkStateType state;
-
+
GdkColor foreground;
GdkColor background;
-
+
gpointer data;
GtkDestroyNotify destroy;
-
+
gint fg_set : 1;
gint bg_set : 1;
};
@@ -327,25 +327,25 @@ struct _GtkCellWidget
struct _GtkCell
{
GtkCellType type;
-
+
gint vertical;
gint horizontal;
-
+
union {
gchar *text;
-
+
struct {
GdkPixmap *pixmap;
GdkBitmap *mask;
} pm;
-
+
struct {
gchar *text;
guint8 spacing;
GdkPixmap *pixmap;
GdkBitmap *mask;
} pt;
-
+
GtkWidget *widget;
} u;
};
@@ -353,219 +353,233 @@ struct _GtkCell
GtkType gtk_clist_get_type (void);
/* constructers useful for gtk-- wrappers */
-void gtk_clist_construct (GtkCList * clist,
- gint columns,
- gchar * titles[]);
+void gtk_clist_construct (GtkCList *clist,
+ gint columns,
+ gchar *titles[]);
/* create a new GtkCList */
-GtkWidget *gtk_clist_new (gint columns);
-GtkWidget *gtk_clist_new_with_titles (gint columns,
- gchar * titles[]);
+GtkWidget *gtk_clist_new (gint columns);
+GtkWidget *gtk_clist_new_with_titles (gint columns,
+ gchar *titles[]);
/* set the border style of the clist */
-void gtk_clist_set_border (GtkCList * clist,
+void gtk_clist_set_border (GtkCList *clist,
GtkShadowType border);
/* set the clist's selection mode */
-void gtk_clist_set_selection_mode (GtkCList * clist,
+void gtk_clist_set_selection_mode (GtkCList *clist,
GtkSelectionMode mode);
/* set policy on the scrollbar, to either show them all the time
* or show them only when they are needed, ie., when there is more than one page
- * of information */
-void gtk_clist_set_policy (GtkCList * clist,
+ * of information
+ */
+void gtk_clist_set_policy (GtkCList *clist,
GtkPolicyType vscrollbar_policy,
GtkPolicyType hscrollbar_policy);
/* freeze all visual updates of the list, and then thaw the list after you have made
* a number of changes and the updates wil occure in a more efficent mannor than if
- * you made them on a unfrozen list */
-void gtk_clist_freeze (GtkCList * clist);
-void gtk_clist_thaw (GtkCList * clist);
+ * you made them on a unfrozen list
+ */
+void gtk_clist_freeze (GtkCList *clist);
+void gtk_clist_thaw (GtkCList *clist);
/* show and hide the column title buttons */
-void gtk_clist_column_titles_show (GtkCList * clist);
-void gtk_clist_column_titles_hide (GtkCList * clist);
+void gtk_clist_column_titles_show (GtkCList *clist);
+void gtk_clist_column_titles_hide (GtkCList *clist);
/* set the column title to be a active title (responds to button presses,
* prelights, and grabs keyboard focus), or passive where it acts as just
- * a title */
-void gtk_clist_column_title_active (GtkCList * clist,
- gint column);
-void gtk_clist_column_title_passive (GtkCList * clist,
- gint column);
-void gtk_clist_column_titles_active (GtkCList * clist);
-void gtk_clist_column_titles_passive (GtkCList * clist);
+ * a title
+ */
+void gtk_clist_column_title_active (GtkCList *clist,
+ gint column);
+void gtk_clist_column_title_passive (GtkCList *clist,
+ gint column);
+void gtk_clist_column_titles_active (GtkCList *clist);
+void gtk_clist_column_titles_passive (GtkCList *clist);
/* set the title in the column title button */
-void gtk_clist_set_column_title (GtkCList * clist,
- gint column,
- gchar * title);
+void gtk_clist_set_column_title (GtkCList *clist,
+ gint column,
+ const gchar *title);
/* set a widget instead of a title for the column title button */
-void gtk_clist_set_column_widget (GtkCList * clist,
- gint column,
- GtkWidget * widget);
+void gtk_clist_set_column_widget (GtkCList *clist,
+ gint column,
+ GtkWidget *widget);
/* set the justification on a column */
-void gtk_clist_set_column_justification (GtkCList * clist,
- gint column,
+void gtk_clist_set_column_justification (GtkCList *clist,
+ gint column,
GtkJustification justification);
/* set the pixel width of a column; this is a necessary step in
* creating a CList because otherwise the column width is chozen from
- * the width of the column title, which will never be right */
-void gtk_clist_set_column_width (GtkCList * clist,
- gint column,
- gint width);
+ * the width of the column title, which will never be right
+ */
+void gtk_clist_set_column_width (GtkCList *clist,
+ gint column,
+ gint width);
-/* change the height of the rows, the default is the hight of the current
- * font */
-void gtk_clist_set_row_height (GtkCList * clist,
- gint height);
+/* change the height of the rows, the default is the hight
+ * of the current font
+ */
+void gtk_clist_set_row_height (GtkCList *clist,
+ gint height);
/* scroll the viewing area of the list to the given column
* and row; row_align and col_align are between 0-1 representing the
* location the row should appear on the screnn, 0.0 being top or left,
* 1.0 being bottom or right; if row or column is -1 then then there
- * is no change */
-void gtk_clist_moveto (GtkCList * clist,
- gint row,
- gint column,
- gfloat row_align,
- gfloat col_align);
+ * is no change
+ */
+void gtk_clist_moveto (GtkCList *clist,
+ gint row,
+ gint column,
+ gfloat row_align,
+ gfloat col_align);
/* returns whether the row is visible */
-GtkVisibility gtk_clist_row_is_visible (GtkCList * clist,
- gint row);
+GtkVisibility gtk_clist_row_is_visible (GtkCList *clist,
+ gint row);
/* returns the cell type */
-GtkCellType gtk_clist_get_cell_type (GtkCList * clist,
- gint row,
- gint column);
+GtkCellType gtk_clist_get_cell_type (GtkCList *clist,
+ gint row,
+ gint column);
/* sets a given cell's text, replacing it's current contents */
-void gtk_clist_set_text (GtkCList * clist,
- gint row,
- gint column,
- gchar * text);
+void gtk_clist_set_text (GtkCList *clist,
+ gint row,
+ gint column,
+ const gchar *text);
/* for the "get" functions, any of the return pointer can be
- * NULL if you are not interested */
-gint gtk_clist_get_text (GtkCList * clist,
- gint row,
- gint column,
- gchar ** text);
+ * NULL if you are not interested
+ */
+gint gtk_clist_get_text (GtkCList *clist,
+ gint row,
+ gint column,
+ gchar **text);
/* sets a given cell's pixmap, replacing it's current contents */
-void gtk_clist_set_pixmap (GtkCList * clist,
- gint row,
- gint column,
- GdkPixmap * pixmap,
- GdkBitmap * mask);
-
-gint gtk_clist_get_pixmap (GtkCList * clist,
- gint row,
- gint column,
- GdkPixmap ** pixmap,
- GdkBitmap ** mask);
+void gtk_clist_set_pixmap (GtkCList *clist,
+ gint row,
+ gint column,
+ GdkPixmap *pixmap,
+ GdkBitmap *mask);
+
+gint gtk_clist_get_pixmap (GtkCList *clist,
+ gint row,
+ gint column,
+ GdkPixmap **pixmap,
+ GdkBitmap **mask);
/* sets a given cell's pixmap and text, replacing it's current contents */
-void gtk_clist_set_pixtext (GtkCList * clist,
- gint row,
- gint column,
- gchar * text,
- guint8 spacing,
- GdkPixmap * pixmap,
- GdkBitmap * mask);
-
-gint gtk_clist_get_pixtext (GtkCList * clist,
- gint row,
- gint column,
- gchar ** text,
- guint8 * spacing,
- GdkPixmap ** pixmap,
- GdkBitmap ** mask);
+void gtk_clist_set_pixtext (GtkCList *clist,
+ gint row,
+ gint column,
+ const gchar *text,
+ guint8 spacing,
+ GdkPixmap *pixmap,
+ GdkBitmap *mask);
+
+gint gtk_clist_get_pixtext (GtkCList *clist,
+ gint row,
+ gint column,
+ gchar **text,
+ guint8 *spacing,
+ GdkPixmap **pixmap,
+ GdkBitmap **mask);
/* sets the foreground color of a row, the colar must already
- * be allocated */
-void gtk_clist_set_foreground (GtkCList * clist,
- gint row,
- GdkColor * color);
+ * be allocated
+ */
+void gtk_clist_set_foreground (GtkCList *clist,
+ gint row,
+ GdkColor *color);
/* sets the background color of a row, the colar must already
- * be allocated */
-void gtk_clist_set_background (GtkCList * clist,
- gint row,
- GdkColor * color);
+ * be allocated
+ */
+void gtk_clist_set_background (GtkCList *clist,
+ gint row,
+ GdkColor *color);
/* this sets a horizontal and vertical shift for drawing
* the contents of a cell; it can be positive or negitive; this is
- * partuculary useful for indenting items in a column */
-void gtk_clist_set_shift (GtkCList * clist,
- gint row,
- gint column,
- gint vertical,
- gint horizontal);
+ * particulary useful for indenting items in a column
+ */
+void gtk_clist_set_shift (GtkCList *clist,
+ gint row,
+ gint column,
+ gint vertical,
+ gint horizontal);
/* append returns the index of the row you just added, making
- * it easier to append and modify a row */
-gint gtk_clist_append (GtkCList * clist,
- gchar * text[]);
+ * it easier to append and modify a row
+ */
+gint gtk_clist_append (GtkCList *clist,
+ gchar *text[]);
/* inserts a row at index row and returns the row where it was actually
-inserted (may be different from "row" in auto_sort mode) */
-gint gtk_clist_insert (GtkCList * clist,
- gint row,
- gchar * text[]);
+ * inserted (may be different from "row" in auto_sort mode)
+ */
+gint gtk_clist_insert (GtkCList *clist,
+ gint row,
+ gchar *text[]);
/* removes row at index row */
-void gtk_clist_remove (GtkCList * clist,
- gint row);
+void gtk_clist_remove (GtkCList *clist,
+ gint row);
/* sets a arbitrary data pointer for a given row */
-void gtk_clist_set_row_data (GtkCList * clist,
- gint row,
- gpointer data);
+void gtk_clist_set_row_data (GtkCList *clist,
+ gint row,
+ gpointer data);
/* sets a data pointer for a given row with destroy notification */
-void gtk_clist_set_row_data_full (GtkCList * clist,
- gint row,
- gpointer data,
+void gtk_clist_set_row_data_full (GtkCList *clist,
+ gint row,
+ gpointer data,
GtkDestroyNotify destroy);
/* returns the data set for a row */
-gpointer gtk_clist_get_row_data (GtkCList * clist,
- gint row);
+gpointer gtk_clist_get_row_data (GtkCList *clist,
+ gint row);
/* givin a data pointer, find the first (and hopefully only!)
- * row that points to that data, or -1 if none do */
-gint gtk_clist_find_row_from_data (GtkCList * clist,
- gpointer data);
+ * row that points to that data, or -1 if none do
+ */
+gint gtk_clist_find_row_from_data (GtkCList *clist,
+ gpointer data);
/* force selection of a row */
-void gtk_clist_select_row (GtkCList * clist,
- gint row,
- gint column);
+void gtk_clist_select_row (GtkCList *clist,
+ gint row,
+ gint column);
/* force unselection of a row */
-void gtk_clist_unselect_row (GtkCList * clist,
- gint row,
- gint column);
+void gtk_clist_unselect_row (GtkCList *clist,
+ gint row,
+ gint column);
/* undo the last select/unselect operation */
void gtk_clist_undo_selection (GtkCList *clist);
/* clear the entire list -- this is much faster than removing each item
- * with gtk_clist_remove */
-void gtk_clist_clear (GtkCList * clist);
+ * with gtk_clist_remove
+ */
+void gtk_clist_clear (GtkCList *clist);
/* return the row column corresponding to the x and y coordinates */
-gint gtk_clist_get_selection_info (GtkCList * clist,
- gint x,
- gint y,
- gint * row,
- gint * column);
+gint gtk_clist_get_selection_info (GtkCList *clist,
+ gint x,
+ gint y,
+ gint *row,
+ gint *column);
/* in multiple or extended mode, select all rows */
void gtk_clist_select_all (GtkCList *clist);
@@ -574,7 +588,9 @@ void gtk_clist_select_all (GtkCList *clist);
void gtk_clist_unselect_all (GtkCList *clist);
/* swap the position of two rows */
-void gtk_clist_swap_rows (GtkCList * clist, gint row1, gint row2);
+void gtk_clist_swap_rows (GtkCList *clist,
+ gint row1,
+ gint row2);
/* sets a compare function different to the default */
void gtk_clist_set_compare_func (GtkCList *clist,
diff --git a/gtk/gtkctree.c b/gtk/gtkctree.c
index 2702abf81..b8b2ea381 100644
--- a/gtk/gtkctree.c
+++ b/gtk/gtkctree.c
@@ -74,13 +74,13 @@ static void set_cell_contents (GtkCList *clist,
GtkCListRow *clist_row,
gint column,
GtkCellType type,
- gchar *text,
+ const gchar *text,
guint8 spacing,
GdkPixmap *pixmap,
GdkBitmap *mask);
static void set_node_info (GtkCTree *ctree,
GtkCTreeNode *node,
- gchar *text,
+ const gchar *text,
guint8 spacing,
GdkPixmap *pixmap_closed,
GdkBitmap *mask_closed,
@@ -3018,14 +3018,14 @@ real_tree_collapse (GtkCTree *ctree,
}
static void
-set_cell_contents (GtkCList * clist,
- GtkCListRow * clist_row,
- gint column,
- GtkCellType type,
- gchar * text,
- guint8 spacing,
- GdkPixmap * pixmap,
- GdkBitmap * mask)
+set_cell_contents (GtkCList *clist,
+ GtkCListRow *clist_row,
+ gint column,
+ GtkCellType type,
+ const gchar *text,
+ guint8 spacing,
+ GdkPixmap *pixmap,
+ GdkBitmap *mask)
{
GtkCTree *ctree;
@@ -3133,7 +3133,7 @@ set_cell_contents (GtkCList * clist,
static void
set_node_info (GtkCTree *ctree,
GtkCTreeNode *node,
- gchar *text,
+ const gchar *text,
guint8 spacing,
GdkPixmap *pixmap_closed,
GdkBitmap *mask_closed,
@@ -3803,7 +3803,7 @@ gtk_ctree_insert_node (GtkCTree *ctree,
GTK_CLIST_CLASS_FW (clist)->set_cell_contents
(clist, &(new_row->row), i, GTK_CELL_TEXT, text[i], 0, NULL, NULL);
- set_node_info (ctree, node, text[ctree->tree_column], spacing, pixmap_closed,
+ set_node_info (ctree, node, text ? text[ctree->tree_column] : NULL, spacing, pixmap_closed,
mask_closed, pixmap_opened, mask_opened, is_leaf, expanded);
/* sorted insertion */
@@ -4641,7 +4641,7 @@ void
gtk_ctree_node_set_text (GtkCTree *ctree,
GtkCTreeNode *node,
gint column,
- gchar *text)
+ const gchar *text)
{
GtkCList *clist;
@@ -4695,7 +4695,7 @@ void
gtk_ctree_node_set_pixtext (GtkCTree *ctree,
GtkCTreeNode *node,
gint column,
- gchar *text,
+ const gchar *text,
guint8 spacing,
GdkPixmap *pixmap,
GdkBitmap *mask)
@@ -4729,7 +4729,7 @@ gtk_ctree_node_set_pixtext (GtkCTree *ctree,
void
gtk_ctree_set_node_info (GtkCTree *ctree,
GtkCTreeNode *node,
- gchar *text,
+ const gchar *text,
guint8 spacing,
GdkPixmap *pixmap_closed,
GdkBitmap *mask_closed,
@@ -5068,6 +5068,8 @@ gtk_ctree_show_stub (GtkCTree *ctree,
g_return_if_fail (ctree != NULL);
g_return_if_fail (GTK_IS_CTREE (ctree));
+ show_stub = show_stub != FALSE;
+
if (show_stub != ctree->show_stub)
{
GtkCList *clist;
@@ -5089,10 +5091,12 @@ gtk_ctree_set_reorderable (GtkCTree *ctree,
g_return_if_fail (ctree != NULL);
g_return_if_fail (GTK_IS_CTREE (ctree));
- if (ctree->reorderable == (reorderable != 0))
+ reorderable = reorderable != FALSE;
+
+ if (ctree->reorderable == reorderable)
return;
- ctree->reorderable = (reorderable != 0);
+ ctree->reorderable = reorderable;
if (GTK_WIDGET_REALIZED (ctree))
{
diff --git a/gtk/gtkctree.h b/gtk/gtkctree.h
index 5854e57b9..01774921c 100644
--- a/gtk/gtkctree.h
+++ b/gtk/gtkctree.h
@@ -293,7 +293,7 @@ void gtk_ctree_real_select_recursive (GtkCTree *ctree,
void gtk_ctree_node_set_text (GtkCTree *ctree,
GtkCTreeNode *node,
gint column,
- gchar *text);
+ const gchar *text);
void gtk_ctree_node_set_pixmap (GtkCTree *ctree,
GtkCTreeNode *node,
gint column,
@@ -302,13 +302,13 @@ void gtk_ctree_node_set_pixmap (GtkCTree *ctree,
void gtk_ctree_node_set_pixtext (GtkCTree *ctree,
GtkCTreeNode *node,
gint column,
- gchar *text,
+ const gchar *text,
guint8 spacing,
GdkPixmap *pixmap,
GdkBitmap *mask);
void gtk_ctree_set_node_info (GtkCTree *ctree,
GtkCTreeNode *node,
- gchar *text,
+ const gchar *text,
guint8 spacing,
GdkPixmap *pixmap_closed,
GdkBitmap *mask_closed,
@@ -388,7 +388,7 @@ void gtk_ctree_set_use_drag_icons (GtkCTree *ctree,
void gtk_ctree_set_line_style (GtkCTree *ctree,
GtkCTreeLineStyle line_style);
void gtk_ctree_set_drag_compare_func (GtkCTree *ctree,
- GtkCTreeCompareDragFunc cmp_func);
+ GtkCTreeCompareDragFunc cmp_func);
/***********************************************************
* Tree sorting functions *