New function to get a GdkWindow to compare event->window to.

Thu Nov 15 16:24:55 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_get_bin_window): New function
	to get a GdkWindow to compare event->window to.

	* gtk/gtktreeview.c (gtk_tree_view_move_cursor_left_right): emit
	the signal for lateral motion too, #64361

	* gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): remove window
	arg as it is useless, #64137
This commit is contained in:
Jonathan Blandford 2001-11-15 22:20:18 +00:00 committed by Jonathan Blandford
parent 91a34f5d56
commit 2fdf30186c
17 changed files with 146 additions and 58 deletions

View File

@ -1,3 +1,14 @@
Thu Nov 15 16:24:55 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_get_bin_window): New function
to get a GdkWindow to compare event->window to.
* gtk/gtktreeview.c (gtk_tree_view_move_cursor_left_right): emit
the signal for lateral motion too, #64361
* gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): remove window
arg as it is useless, #64137
Thu Nov 15 16:07:42 2001 Owen Taylor <otaylor@redhat.com> Thu Nov 15 16:07:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c: Some small drawing fixes for scroll arrows. * gtk/gtknotebook.c: Some small drawing fixes for scroll arrows.

View File

@ -1,3 +1,14 @@
Thu Nov 15 16:24:55 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_get_bin_window): New function
to get a GdkWindow to compare event->window to.
* gtk/gtktreeview.c (gtk_tree_view_move_cursor_left_right): emit
the signal for lateral motion too, #64361
* gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): remove window
arg as it is useless, #64137
Thu Nov 15 16:07:42 2001 Owen Taylor <otaylor@redhat.com> Thu Nov 15 16:07:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c: Some small drawing fixes for scroll arrows. * gtk/gtknotebook.c: Some small drawing fixes for scroll arrows.

View File

@ -1,3 +1,14 @@
Thu Nov 15 16:24:55 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_get_bin_window): New function
to get a GdkWindow to compare event->window to.
* gtk/gtktreeview.c (gtk_tree_view_move_cursor_left_right): emit
the signal for lateral motion too, #64361
* gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): remove window
arg as it is useless, #64137
Thu Nov 15 16:07:42 2001 Owen Taylor <otaylor@redhat.com> Thu Nov 15 16:07:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c: Some small drawing fixes for scroll arrows. * gtk/gtknotebook.c: Some small drawing fixes for scroll arrows.

View File

@ -1,3 +1,14 @@
Thu Nov 15 16:24:55 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_get_bin_window): New function
to get a GdkWindow to compare event->window to.
* gtk/gtktreeview.c (gtk_tree_view_move_cursor_left_right): emit
the signal for lateral motion too, #64361
* gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): remove window
arg as it is useless, #64137
Thu Nov 15 16:07:42 2001 Owen Taylor <otaylor@redhat.com> Thu Nov 15 16:07:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c: Some small drawing fixes for scroll arrows. * gtk/gtknotebook.c: Some small drawing fixes for scroll arrows.

View File

@ -1,3 +1,14 @@
Thu Nov 15 16:24:55 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_get_bin_window): New function
to get a GdkWindow to compare event->window to.
* gtk/gtktreeview.c (gtk_tree_view_move_cursor_left_right): emit
the signal for lateral motion too, #64361
* gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): remove window
arg as it is useless, #64137
Thu Nov 15 16:07:42 2001 Owen Taylor <otaylor@redhat.com> Thu Nov 15 16:07:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c: Some small drawing fixes for scroll arrows. * gtk/gtknotebook.c: Some small drawing fixes for scroll arrows.

View File

@ -1,3 +1,14 @@
Thu Nov 15 16:24:55 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_get_bin_window): New function
to get a GdkWindow to compare event->window to.
* gtk/gtktreeview.c (gtk_tree_view_move_cursor_left_right): emit
the signal for lateral motion too, #64361
* gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): remove window
arg as it is useless, #64137
Thu Nov 15 16:07:42 2001 Owen Taylor <otaylor@redhat.com> Thu Nov 15 16:07:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c: Some small drawing fixes for scroll arrows. * gtk/gtknotebook.c: Some small drawing fixes for scroll arrows.

View File

@ -1,3 +1,14 @@
Thu Nov 15 16:24:55 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_get_bin_window): New function
to get a GdkWindow to compare event->window to.
* gtk/gtktreeview.c (gtk_tree_view_move_cursor_left_right): emit
the signal for lateral motion too, #64361
* gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): remove window
arg as it is useless, #64137
Thu Nov 15 16:07:42 2001 Owen Taylor <otaylor@redhat.com> Thu Nov 15 16:07:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c: Some small drawing fixes for scroll arrows. * gtk/gtknotebook.c: Some small drawing fixes for scroll arrows.

View File

@ -1158,12 +1158,6 @@ produce superscript and subscript.
</para> </para>
<!-- ##### STRUCT GtkTreeModelSort ##### -->
<para>
</para>
<!-- ##### STRUCT GtkTreeSelectionClass ##### --> <!-- ##### STRUCT GtkTreeSelectionClass ##### -->
<para> <para>
@ -1178,14 +1172,6 @@ produce superscript and subscript.
@GTK_TREE_SELECTION_SINGLE: @GTK_TREE_SELECTION_SINGLE:
@GTK_TREE_SELECTION_MULTI: @GTK_TREE_SELECTION_MULTI:
<!-- ##### STRUCT GtkTreeView ##### -->
<para>
</para>
@parent:
@priv:
<!-- ##### USER_FUNCTION GtkTreeViewDraggableFunc ##### --> <!-- ##### USER_FUNCTION GtkTreeViewDraggableFunc ##### -->
<para> <para>

View File

@ -23,6 +23,12 @@ types related to the text widget and how they work together.
#GtkTextView, #GtkTextIter, #GtkTextMark #GtkTextView, #GtkTextIter, #GtkTextMark
</para> </para>
<!-- ##### STRUCT GtkTextBuffer ##### -->
<para>
</para>
<!-- ##### FUNCTION gtk_text_buffer_new ##### --> <!-- ##### FUNCTION gtk_text_buffer_new ##### -->
<para> <para>

View File

@ -20,12 +20,6 @@ types related to the text widget and how they work together.
</para> </para>
<!-- ##### STRUCT GtkTextBuffer ##### -->
<para>
</para>
<!-- ##### STRUCT GtkTextIter ##### --> <!-- ##### STRUCT GtkTextIter ##### -->
<para> <para>

View File

@ -21,6 +21,12 @@ types related to the text widget and how they work together.
</para> </para>
<!-- ##### STRUCT GtkTextTagTable ##### -->
<para>
</para>
<!-- ##### USER_FUNCTION GtkTextTagTableForeach ##### --> <!-- ##### USER_FUNCTION GtkTextTagTableForeach ##### -->
<para> <para>

View File

@ -14,6 +14,12 @@ The tree interface used by #GtkTreeView
#GtkTreeView, #GtkTreeStore, #GtkListStore #GtkTreeView, #GtkTreeStore, #GtkListStore
</para> </para>
<!-- ##### STRUCT GtkTreeModel ##### -->
<para>
</para>
<!-- ##### STRUCT GtkTreeIter ##### --> <!-- ##### STRUCT GtkTreeIter ##### -->
<para> <para>
@ -36,12 +42,6 @@ The tree interface used by #GtkTreeView
</para> </para>
<!-- ##### STRUCT GtkTreeModel ##### -->
<para>
</para>
<!-- ##### STRUCT GtkTreeModelIface ##### --> <!-- ##### STRUCT GtkTreeModelIface ##### -->
<para> <para>

View File

@ -14,6 +14,12 @@ GtkTreeModelSort
</para> </para>
<!-- ##### STRUCT GtkTreeModelSort ##### -->
<para>
</para>
<!-- ##### FUNCTION gtk_tree_model_sort_new_with_model ##### --> <!-- ##### FUNCTION gtk_tree_model_sort_new_with_model ##### -->
<para> <para>

View File

@ -14,6 +14,12 @@ GtkTreeSelection
</para> </para>
<!-- ##### STRUCT GtkTreeSelection ##### -->
<para>
</para>
<!-- ##### USER_FUNCTION GtkTreeSelectionFunc ##### --> <!-- ##### USER_FUNCTION GtkTreeSelectionFunc ##### -->
<para> <para>

View File

@ -14,6 +14,12 @@ GtkTreeView
</para> </para>
<!-- ##### STRUCT GtkTreeView ##### -->
<para>
</para>
<!-- ##### ENUM GtkTreeViewDropPosition ##### --> <!-- ##### ENUM GtkTreeViewDropPosition ##### -->
<para> <para>

View File

@ -3497,7 +3497,6 @@ gtk_tree_view_maybe_begin_dragging_row (GtkTreeView *tree_view,
tree_view->priv->pressed_button = -1; tree_view->priv->pressed_button = -1;
gtk_tree_view_get_path_at_pos (tree_view, gtk_tree_view_get_path_at_pos (tree_view,
tree_view->priv->bin_window,
tree_view->priv->press_start_x, tree_view->priv->press_start_x,
tree_view->priv->press_start_y, tree_view->priv->press_start_y,
&path, &path,
@ -6000,6 +5999,7 @@ gtk_tree_view_move_cursor_left_right (GtkTreeView *tree_view,
cursor_tree, cursor_tree,
cursor_node, cursor_node,
NULL); NULL);
g_signal_emit (G_OBJECT (tree_view), tree_view_signals[CURSOR_CHANGED], 0);
} }
gtk_tree_view_clamp_column_visible (tree_view, tree_view->priv->focus_column); gtk_tree_view_clamp_column_visible (tree_view, tree_view->priv->focus_column);
} }
@ -8140,10 +8140,27 @@ gtk_tree_view_set_cursor (GtkTreeView *tree_view,
} }
/**
* gtk_tree_view_get_bin_window:
* @tree_view: A #GtkTreeView
*
* Returns the window that @tree_view renders to. This is used primarily to
* compare to <literal>event->window</literal> to confirm that the event on
* @tree_view is on the right window.
*
* Return value: A #GdkWindow, or %NULL when @tree_view hasn't been realized yet
**/
GdkWindow *
gtk_tree_view_get_bin_window (GtkTreeView *tree_view)
{
g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), NULL);
return tree_view->priv->bin_window;
}
/** /**
* gtk_tree_view_get_path_at_pos: * gtk_tree_view_get_path_at_pos:
* @tree_view: A #GtkTreeView. * @tree_view: A #GtkTreeView.
* @window: The #GdkWindow to check against.
* @x: The x position to be identified. * @x: The x position to be identified.
* @y: The y position to be identified. * @y: The y position to be identified.
* @path: A pointer to a #GtkTreePath pointer to be filled in, or %NULL * @path: A pointer to a #GtkTreePath pointer to be filled in, or %NULL
@ -8151,22 +8168,20 @@ gtk_tree_view_set_cursor (GtkTreeView *tree_view,
* @cell_x: A pointer where the X coordinate relative to the cell can be placed, or %NULL * @cell_x: A pointer where the X coordinate relative to the cell can be placed, or %NULL
* @cell_y: A pointer where the Y coordinate relative to the cell can be placed, or %NULL * @cell_y: A pointer where the Y coordinate relative to the cell can be placed, or %NULL
* *
* Finds the path at the point (@x, @y) relative to @window. If @window is * Finds the path at the point (@x, @y), relative to widget coordinates. That
* %NULL, then the point is found relative to the widget coordinates. This * is, @x and @y are relative to an events coordinates. It is primarily for
* function is expected to be called after an event, with <literal>event->window</literal> being * things like popup menus. If @path is non-%NULL, then it will be filled with
* passed in as @window. It is primarily for things like popup menus. If @path * the #GtkTreePath at that point. This path should be freed with
* is non-%NULL, then it will be filled with the #GtkTreePath at that point. * gtk_tree_path_free(). If @column is non-%NULL, then it will be filled with
* This path should be freed with gtk_tree_path_free(). If @column is non-%NULL, * the column at that point. @cell_x and @cell_y return the coordinates relative
* then it will be filled with the column at that point. @cell_x and @cell_y * to the cell background (i.e. the @background_area passed to
* return the coordinates relative to the cell background (i.e. the * gtk_cell_renderer_render()). This function is only meaningful if @tree_view
* @background_area passed to gtk_cell_renderer_render()). This function only * is realized.
* works if @tree_view is realized.
* *
* Return value: %TRUE if a row exists at that coordinate. * Return value: %TRUE if a row exists at that coordinate.
**/ **/
gboolean gboolean
gtk_tree_view_get_path_at_pos (GtkTreeView *tree_view, gtk_tree_view_get_path_at_pos (GtkTreeView *tree_view,
GdkWindow *window,
gint x, gint x,
gint y, gint y,
GtkTreePath **path, GtkTreePath **path,
@ -8181,9 +8196,6 @@ gtk_tree_view_get_path_at_pos (GtkTreeView *tree_view,
g_return_val_if_fail (tree_view != NULL, FALSE); g_return_val_if_fail (tree_view != NULL, FALSE);
g_return_val_if_fail (tree_view->priv->bin_window != NULL, FALSE); g_return_val_if_fail (tree_view->priv->bin_window != NULL, FALSE);
if (window)
g_return_val_if_fail (window == tree_view->priv->bin_window, FALSE);
if (path) if (path)
*path = NULL; *path = NULL;
if (column) if (column)
@ -8239,21 +8251,12 @@ gtk_tree_view_get_path_at_pos (GtkTreeView *tree_view,
} }
} }
if (window)
{
y_offset = _gtk_rbtree_find_offset (tree_view->priv->tree,
TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, y),
&tree, &node);
}
else
{
if (y < TREE_VIEW_HEADER_HEIGHT (tree_view)) if (y < TREE_VIEW_HEADER_HEIGHT (tree_view))
return FALSE; return FALSE;
y_offset = _gtk_rbtree_find_offset (tree_view->priv->tree, y_offset = _gtk_rbtree_find_offset (tree_view->priv->tree,
TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, y + tree_view->priv->vadjustment->value), TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, y + tree_view->priv->vadjustment->value),
&tree, &node); &tree, &node);
}
if (tree == NULL) if (tree == NULL)
return FALSE; return FALSE;
@ -8690,7 +8693,6 @@ gtk_tree_view_get_dest_row_at_pos (GtkTreeView *tree_view,
*/ */
if (!gtk_tree_view_get_path_at_pos (tree_view, if (!gtk_tree_view_get_path_at_pos (tree_view,
tree_view->priv->bin_window,
x, y, x, y,
&tmp_path, &tmp_path,
&column, &column,

View File

@ -217,7 +217,6 @@ void gtk_tree_view_get_cursor (GtkTreeView
/* Layout information */ /* Layout information */
gboolean gtk_tree_view_get_path_at_pos (GtkTreeView *tree_view, gboolean gtk_tree_view_get_path_at_pos (GtkTreeView *tree_view,
GdkWindow *window,
gint x, gint x,
gint y, gint y,
GtkTreePath **path, GtkTreePath **path,