Commit 60051ff6 authored by Jonathan Blandford's avatar Jonathan Blandford Committed by Jonathan Blandford

add missing '}' that got munched by #endif.

Mon Apr 23 18:57:03 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtksocket.c (gtk_socket_filter_func): add missing '}' that
	got munched by #endif.

	* gtk/Makefile.am (gtk_plug_c_sources): add missing '\'

	* gtk/gtktreeview.c: Refactored code to clean up a number of
	events.

	* gtk/gtktreemodel.c (gtk_tree_path_compare): Switched return
	values to make consistent with other functions.  Spotted by Jeff
	Franks <jcf@tpg.com.au>.

	* gtk/gtktreeview.h (struct _GtkTreeViewClass): Fixes to signal
	declaration spotted by Jeff Franks <jcf@tpg.com.au>.
parent 79546682
Mon Apr 23 18:57:03 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtksocket.c (gtk_socket_filter_func): add missing '}' that
got munched by #endif.
* gtk/Makefile.am (gtk_plug_c_sources): add missing '\'
* gtk/gtktreeview.c: Refactored code to clean up a number of
events.
* gtk/gtktreemodel.c (gtk_tree_path_compare): Switched return
values to make consistent with other functions. Spotted by Jeff
Franks <jcf@tpg.com.au>.
* gtk/gtktreeview.h (struct _GtkTreeViewClass): Fixes to signal
declaration spotted by Jeff Franks <jcf@tpg.com.au>.
2001-04-23 Sven Neumann <sven@gimp.org>
* gtk/Makefile.am
......
Mon Apr 23 18:57:03 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtksocket.c (gtk_socket_filter_func): add missing '}' that
got munched by #endif.
* gtk/Makefile.am (gtk_plug_c_sources): add missing '\'
* gtk/gtktreeview.c: Refactored code to clean up a number of
events.
* gtk/gtktreemodel.c (gtk_tree_path_compare): Switched return
values to make consistent with other functions. Spotted by Jeff
Franks <jcf@tpg.com.au>.
* gtk/gtktreeview.h (struct _GtkTreeViewClass): Fixes to signal
declaration spotted by Jeff Franks <jcf@tpg.com.au>.
2001-04-23 Sven Neumann <sven@gimp.org>
* gtk/Makefile.am
......
Mon Apr 23 18:57:03 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtksocket.c (gtk_socket_filter_func): add missing '}' that
got munched by #endif.
* gtk/Makefile.am (gtk_plug_c_sources): add missing '\'
* gtk/gtktreeview.c: Refactored code to clean up a number of
events.
* gtk/gtktreemodel.c (gtk_tree_path_compare): Switched return
values to make consistent with other functions. Spotted by Jeff
Franks <jcf@tpg.com.au>.
* gtk/gtktreeview.h (struct _GtkTreeViewClass): Fixes to signal
declaration spotted by Jeff Franks <jcf@tpg.com.au>.
2001-04-23 Sven Neumann <sven@gimp.org>
* gtk/Makefile.am
......
Mon Apr 23 18:57:03 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtksocket.c (gtk_socket_filter_func): add missing '}' that
got munched by #endif.
* gtk/Makefile.am (gtk_plug_c_sources): add missing '\'
* gtk/gtktreeview.c: Refactored code to clean up a number of
events.
* gtk/gtktreemodel.c (gtk_tree_path_compare): Switched return
values to make consistent with other functions. Spotted by Jeff
Franks <jcf@tpg.com.au>.
* gtk/gtktreeview.h (struct _GtkTreeViewClass): Fixes to signal
declaration spotted by Jeff Franks <jcf@tpg.com.au>.
2001-04-23 Sven Neumann <sven@gimp.org>
* gtk/Makefile.am
......
Mon Apr 23 18:57:03 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtksocket.c (gtk_socket_filter_func): add missing '}' that
got munched by #endif.
* gtk/Makefile.am (gtk_plug_c_sources): add missing '\'
* gtk/gtktreeview.c: Refactored code to clean up a number of
events.
* gtk/gtktreemodel.c (gtk_tree_path_compare): Switched return
values to make consistent with other functions. Spotted by Jeff
Franks <jcf@tpg.com.au>.
* gtk/gtktreeview.h (struct _GtkTreeViewClass): Fixes to signal
declaration spotted by Jeff Franks <jcf@tpg.com.au>.
2001-04-23 Sven Neumann <sven@gimp.org>
* gtk/Makefile.am
......
Mon Apr 23 18:57:03 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtksocket.c (gtk_socket_filter_func): add missing '}' that
got munched by #endif.
* gtk/Makefile.am (gtk_plug_c_sources): add missing '\'
* gtk/gtktreeview.c: Refactored code to clean up a number of
events.
* gtk/gtktreemodel.c (gtk_tree_path_compare): Switched return
values to make consistent with other functions. Spotted by Jeff
Franks <jcf@tpg.com.au>.
* gtk/gtktreeview.h (struct _GtkTreeViewClass): Fixes to signal
declaration spotted by Jeff Franks <jcf@tpg.com.au>.
2001-04-23 Sven Neumann <sven@gimp.org>
* gtk/Makefile.am
......
Mon Apr 23 18:57:03 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtksocket.c (gtk_socket_filter_func): add missing '}' that
got munched by #endif.
* gtk/Makefile.am (gtk_plug_c_sources): add missing '\'
* gtk/gtktreeview.c: Refactored code to clean up a number of
events.
* gtk/gtktreemodel.c (gtk_tree_path_compare): Switched return
values to make consistent with other functions. Spotted by Jeff
Franks <jcf@tpg.com.au>.
* gtk/gtktreeview.h (struct _GtkTreeViewClass): Fixes to signal
declaration spotted by Jeff Franks <jcf@tpg.com.au>.
2001-04-23 Sven Neumann <sven@gimp.org>
* gtk/Makefile.am
......
......@@ -839,6 +839,38 @@ normally be used to create a #GtkCList widget. Use gtk_clist_new() instead.
of the columns. There should be enough strings in the array for
the number of columns specified.
<!-- ##### FUNCTION gtk_color_selection_get_old_color ##### -->
<para>
</para>
@colorsel:
@color:
<!-- ##### FUNCTION gtk_color_selection_get_use_opacity ##### -->
<para>
</para>
@colorsel:
@Returns:
<!-- ##### FUNCTION gtk_color_selection_get_use_palette ##### -->
<para>
</para>
@colorsel:
@Returns:
<!-- ##### FUNCTION gtk_color_selection_set_old_color ##### -->
<para>
</para>
@colorsel:
@color:
<!-- ##### FUNCTION gtk_color_selection_set_opacity ##### -->
<para>
Controls whether opacity can be set with the #GtkColorSelection.
......@@ -852,6 +884,22 @@ the gtk_color_selection_get_color() function.
@use_opacity: a boolean indicating whether the opacity selection
is enabled.
<!-- ##### FUNCTION gtk_color_selection_set_use_opacity ##### -->
<para>
</para>
@colorsel:
@use_opacity:
<!-- ##### FUNCTION gtk_color_selection_set_use_palette ##### -->
<para>
</para>
@colorsel:
@use_palette:
<!-- ##### FUNCTION gtk_ctree_construct ##### -->
<para>
This function is not usually used by users.
......
......@@ -64,42 +64,6 @@ time.
@policy: a #GtkUpdateType value indicating the desired policy.
<!-- ##### FUNCTION gtk_color_selection_set_use_opacity ##### -->
<para>
</para>
@colorsel:
@use_opacity:
<!-- ##### FUNCTION gtk_color_selection_get_use_opacity ##### -->
<para>
</para>
@colorsel:
@Returns:
<!-- ##### FUNCTION gtk_color_selection_set_use_palette ##### -->
<para>
</para>
@colorsel:
@use_palette:
<!-- ##### FUNCTION gtk_color_selection_get_use_palette ##### -->
<para>
</para>
@colorsel:
@Returns:
<!-- ##### FUNCTION gtk_color_selection_set_color ##### -->
<para>
Sets the color in the #GtkColorSelection. The widgets are updated
......@@ -121,33 +85,17 @@ Retrieve the currently selected color value.
blue, and opacity.
<!-- ##### FUNCTION gtk_color_selection_set_old_color ##### -->
<para>
</para>
@colorsel:
@color:
<!-- ##### FUNCTION gtk_color_selection_get_old_color ##### -->
<para>
</para>
@colorsel:
@color:
<!-- ##### FUNCTION gtk_color_selection_set_palette_color ##### -->
<para>
</para>
@colorsel:
@index:
@color:
<!-- # Unused Parameters # -->
@x:
@y:
@color:
<!-- ##### FUNCTION gtk_color_selection_get_palette_color ##### -->
......@@ -156,10 +104,12 @@ blue, and opacity.
</para>
@colorsel:
@x:
@y:
@index:
@color:
@Returns:
<!-- # Unused Parameters # -->
@x:
@y:
<!-- ##### FUNCTION gtk_color_selection_unset_palette_color ##### -->
......@@ -168,6 +118,8 @@ blue, and opacity.
</para>
@colorsel:
@index:
<!-- # Unused Parameters # -->
@x:
@y:
......
......@@ -496,7 +496,6 @@ This can later be composited together with other
#GtkRcStyle structures to form a #GtkStyle.
</para>
@parent_instance:
@name:
@bg_pixmap_name:
@font_desc:
......
......@@ -363,7 +363,7 @@ gtk_c_sources = @STRIP_BEGIN@ \
if USE_X11
gtk_plug_c_sources = @STRIP_BEGIN@ \
gtkplug.c \
gtksocket.c
gtksocket.c \
@STRIP_END@
endif
......
......@@ -1086,7 +1086,8 @@ gtk_socket_filter_func (GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data)
GDK_WINDOW_XWINDOW (toplevel->window),
RevertToParent, CurrentTime); /* FIXME? */
}
#endif }
#endif
}
return_val = GDK_FILTER_REMOVE;
break;
case FocusOut:
......
......@@ -103,6 +103,7 @@ _gtk_tree_data_list_check_type (GType type)
return FALSE;
}
void
_gtk_tree_data_list_node_to_value (GtkTreeDataList *list,
GType type,
......
......@@ -350,8 +350,8 @@ gtk_tree_path_copy (GtkTreePath *path)
* @a: A #GtkTreePath.
* @b: A #GtkTreePath to compare with.
*
* Compares two paths. If @a appears before @b in a tree, then 1, is returned.
* If @b appears before @a, then -1 is returned. If the two nodes are equal,
* Compares two paths. If @a appears before @b in a tree, then -1, is returned.
* If @b appears before @a, then 1 is returned. If the two nodes are equal,
* then 0 is returned.
*
* Return value: The relative positions of @a and @b
......@@ -371,12 +371,12 @@ gtk_tree_path_compare (const GtkTreePath *a,
{
if (a->indices[p] == b->indices[q])
continue;
return (a->indices[p] < b->indices[q]?1:-1);
return (a->indices[p] < b->indices[q]?-1:1);
}
while (++p < a->depth && ++q < b->depth);
if (a->depth == b->depth)
return 0;
return (a->depth < b->depth?1:-1);
return (a->depth < b->depth?-1:1);
}
/**
......
......@@ -46,6 +46,7 @@ extern "C" {
#define TREE_VIEW_VERTICAL_SEPARATOR 2
#define TREE_VIEW_HORIZONTAL_SEPARATOR 0
#define TREE_VIEW_DRAG_WIDTH 6
typedef enum
......@@ -56,7 +57,8 @@ typedef enum
GTK_TREE_VIEW_ARROW_PRELIT = 1 << 3,
GTK_TREE_VIEW_HEADERS_VISIBLE = 1 << 4,
GTK_TREE_VIEW_DRAW_KEYFOCUS = 1 << 5,
GTK_TREE_VIEW_MODEL_SETUP = 1 << 6
GTK_TREE_VIEW_MODEL_SETUP = 1 << 6,
GTK_TREE_VIEW_IN_COLUMN_DRAG = 1 << 7,
} GtkTreeViewFlags;
#define GTK_TREE_VIEW_SET_FLAG(tree_view, flag) G_STMT_START{ (tree_view->priv->flags|=flag); }G_STMT_END
......@@ -66,6 +68,20 @@ typedef enum
#define TREE_VIEW_COLUMN_WIDTH(column) (CLAMP (column->width, (column->min_width!=-1)?column->min_width:column->width, (column->max_width!=-1)?column->max_width:column->width))
#define TREE_VIEW_DRAW_EXPANDERS(tree_view) (!GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_IS_LIST)&&GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_SHOW_EXPANDERS))
/* This lovely little value is used to determine how far away from the title bar
* you can move the mouse and still have a column drag work.
*/
#define TREE_VIEW_COLUMN_DRAG_DEAD_MULTIPLIER(tree_view) (10*TREE_VIEW_HEADER_HEIGHT(tree_view))
typedef struct _GtkTreeViewColumnReorder GtkTreeViewColumnReorder;
struct _GtkTreeViewColumnReorder
{
gint left_align;
gint right_align;
GtkTreeViewColumn *left_column;
GtkTreeViewColumn *right_column;
};
struct _GtkTreeViewPrivate
{
GtkTreeModel *model;
......@@ -118,8 +134,10 @@ struct _GtkTreeViewPrivate
gint n_columns;
GList *columns;
gint header_height;
GtkTreeViewColumnDropFunc *column_drop_func;
GList *column_drag_info;
GtkTreeViewColumnReorder *cur_reorder;
/* Scroll timeout (e.g. during dnd) */
guint scroll_timeout;
......
......@@ -764,7 +764,7 @@ gtk_tree_selection_real_select_range (GtkTreeSelection *selection,
switch (gtk_tree_path_compare (start_path, end_path))
{
case -1:
case 1:
_gtk_tree_view_find_node (selection->tree_view,
end_path,
&start_tree,
......@@ -782,7 +782,7 @@ gtk_tree_selection_real_select_range (GtkTreeSelection *selection,
end_tree = start_tree;
end_node = start_node;
break;
case 1:
case -1:
_gtk_tree_view_find_node (selection->tree_view,
start_path,
&start_tree,
......
......@@ -70,15 +70,6 @@ struct _GtkTreeViewChild
};
typedef struct _GtkTreeViewColumnReorder GtkTreeViewColumnReorder;
struct _GtkTreeViewColumnReorder
{
gint left_align;
gint right_align;
GtkTreeViewColumn *left_column;
GtkTreeViewColumn *right_column;
};
enum
{
ROW_ACTIVATED,
......@@ -268,6 +259,7 @@ static gboolean gtk_tree_view_maybe_begin_dragging_row (GtkTreeView *tree_v
GdkEventMotion *event);
static void _gtk_tree_view_update_col_width (GtkTreeView *tree_view);
static void gtk_tree_view_column_reorder_remove_draw (GtkTreeViewColumnReorder *reorder);
static GtkContainerClass *parent_class = NULL;
static guint tree_view_signals[LAST_SIGNAL] = { 0 };
......@@ -1649,7 +1641,7 @@ gtk_tree_view_column_button_expose (GtkWidget *button,
button->allocation.width - 2,
button->allocation.height);
gdk_draw_line (button->window,
button->style->white_gc,
button->style->bg_gc[GTK_STATE_SELECTED],
button->allocation.width - 1, 0,
button->allocation.width - 1,
button->allocation.height);
......@@ -1664,7 +1656,7 @@ gtk_tree_view_column_button_expose (GtkWidget *button,
1, 0,
1, button->allocation.height);
gdk_draw_line (button->window,
button->style->white_gc,
button->style->bg_gc[GTK_STATE_SELECTED],
0, 0,
0, button->allocation.height);
}
......@@ -1672,58 +1664,83 @@ gtk_tree_view_column_button_expose (GtkWidget *button,
return FALSE;
}
/* Motion Event */
static gboolean
gtk_tree_view_motion (GtkWidget *widget,
GdkEventMotion *event)
gtk_tree_view_motion_resize_column (GtkWidget *widget,
GdkEventMotion *event)
{
GtkTreeView *tree_view;
GtkRBTree *tree;
GtkRBNode *node;
gint new_y;
GtkRBTree *old_prelight_tree;
GtkRBNode *old_prelight_node;
gint x;
gint new_width;
tree_view = (GtkTreeView *) widget;
if (event->is_hint || event->window != widget->window)
gtk_widget_get_pointer (widget, &x, NULL);
else
x = event->x;
if (GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_IN_COLUMN_RESIZE))
{
gint x;
gint new_width;
new_width = gtk_tree_view_new_column_width (GTK_TREE_VIEW (widget),
GTK_TREE_VIEW (widget)->priv->drag_pos, &x);
if (x != GTK_TREE_VIEW (widget)->priv->x_drag)
gtk_tree_view_column_set_width (gtk_tree_view_get_column (GTK_TREE_VIEW (widget), GTK_TREE_VIEW (widget)->priv->drag_pos), new_width);
if (event->is_hint || event->window != widget->window)
gtk_widget_get_pointer (widget, &x, NULL);
else
x = event->x;
/* FIXME: Do we need to scroll */
_gtk_tree_view_update_size (GTK_TREE_VIEW (widget));
return FALSE;
}
new_width = gtk_tree_view_new_column_width (GTK_TREE_VIEW (widget), tree_view->priv->drag_pos, &x);
if (x != tree_view->priv->x_drag)
{
gtk_tree_view_column_set_width (gtk_tree_view_get_column (GTK_TREE_VIEW (widget), tree_view->priv->drag_pos), new_width);
}
static gboolean
gtk_tree_view_motion_drag_column (GtkWidget *widget,
GdkEventMotion *event)
{
GtkTreeView *tree_view = (GtkTreeView *) widget;
GtkTreeViewColumn *column = tree_view->priv->drag_column;
GtkTreeViewColumnReorder *reorder = NULL;
GList *list;
gint x, y;
/* FIXME: Do we need to scroll */
_gtk_tree_view_update_size (GTK_TREE_VIEW (widget));
return FALSE;
}
if (column == NULL)
return FALSE;
if (event->window == tree_view->priv->drag_window)
{
GtkTreeViewColumn *column = tree_view->priv->drag_column;
gint x, y;
if (event->window != tree_view->priv->drag_window)
return FALSE;
if (column == NULL)
return FALSE;
gdk_window_get_position (tree_view->priv->drag_window, &x, &y);
x = CLAMP (x + (gint)event->x - column->drag_x, 0,
MAX (tree_view->priv->width, GTK_WIDGET (tree_view)->allocation.width) - column->button->allocation.width);
gdk_window_get_position (tree_view->priv->drag_window, &x, &y);
x = CLAMP (x + (gint)event->x - column->drag_x, 0,
MAX (tree_view->priv->width, GTK_WIDGET (tree_view)->allocation.width) - column->button->allocation.width);
gdk_window_move (tree_view->priv->drag_window, x, y);
return TRUE;
}
gdk_window_move (tree_view->priv->drag_window, x, y);
/* Sanity check it */
if (event->window != tree_view->priv->bin_window)
return FALSE;
gdk_window_get_position (tree_view->priv->drag_window, &x, NULL);
x += (gint)event->x;
for (list = tree_view->priv->column_drag_info; list; list = list->next)
{
reorder = (GtkTreeViewColumnReorder *) list->data;
if (x >= reorder->left_align && x < reorder->right_align)
break;
reorder = NULL;
}
if (reorder && reorder == tree_view->priv->cur_reorder)
return TRUE;
gtk_tree_view_column_reorder_remove_draw (reorder);
tree_view->priv->cur_reorder = reorder;
return TRUE;
}
static gboolean
gtk_tree_view_motion_bin_window (GtkWidget *widget,
GdkEventMotion *event)
{
GtkTreeView *tree_view;
GtkRBTree *tree;
GtkRBNode *node;
gint new_y;
GtkRBTree *old_prelight_tree;
GtkRBNode *old_prelight_node;
tree_view = (GtkTreeView *) widget;
if (tree_view->priv->tree == NULL)
return FALSE;
......@@ -1771,6 +1788,27 @@ gtk_tree_view_motion (GtkWidget *widget,
return TRUE;
}
static gboolean
gtk_tree_view_motion (GtkWidget *widget,
GdkEventMotion *event)
{
GtkTreeView *tree_view;
tree_view = (GtkTreeView *) widget;
if (GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_IN_COLUMN_RESIZE))
return gtk_tree_view_motion_resize_column (widget, event);
/* Drag column */
if (GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_IN_COLUMN_DRAG))
gtk_tree_view_motion_drag_column (widget, event);
/* Sanity check it */
if (event->window == tree_view->priv->bin_window)
return gtk_tree_view_motion_bin_window (widget, event);
return FALSE;
}
/* FIXME Is this function necessary? Can I get an enter_notify event
* w/o either an expose event or a mouse motion event?
*/
......@@ -2064,6 +2102,10 @@ gtk_tree_view_button_release (GtkWidget *widget,
gtk_widget_queue_resize (GTK_WIDGET (tree_view));
gdk_window_hide (tree_view->priv->drag_window);
g_list_foreach (tree_view->priv->column_drag_info, (GFunc) g_free, NULL);
g_list_free (tree_view->priv->column_drag_info);
tree_view->priv->column_drag_info = NULL;
return TRUE;
}
......@@ -2827,6 +2869,14 @@ gtk_tree_view_forall (GtkContainer *container,
}
}
/**
* gtk_tree_view_row_activated:
* @tree_view: A #GtkTreeView
* @path: The #GtkTreePath to be activated.
* @column: The #GtkTreeViewColumn to be activated.
*
* Activates the cell determined by @path and @column.
**/