Commit Graph

912 Commits

Author SHA1 Message Date
Kristian Rietveld
0a1982aff3 Move _gtk_tree_view_column_cell_focus to gtktreeview.c 2010-12-05 15:18:13 +01:00
Kristian Rietveld
131783005e Use structure bitfield instead of GtkTreeViewFlags 2010-12-05 15:12:53 +01:00
Kristian Rietveld
73f99eda1d Turn TREE_VIEW_DRAW_EXPANDERS into an inline function 2010-12-05 14:47:51 +01:00
Kristian Rietveld
ebba08a842 Remove unused TREE_VIEW_COLUMN_REQUESTED_WIDTH macro 2010-12-05 14:42:40 +01:00
Kristian Rietveld
43de55d7a9 Turn TREE_VIEW_HEADER_HEIGHT into an inline function 2010-12-05 14:42:08 +01:00
Tristan Van Berkom
0baee408f2 Fixed GtkTreeViewColumn allocation to only subtract the depth padding/indentation from the expander column. 2010-12-05 22:14:27 +09:00
Tristan Van Berkom
779125976c Changed GtkTreeView to bookkeep the deepest expanded depth instead of recalculating it at column allocation time. 2010-12-05 22:14:11 +09:00
Tristan Van Berkom
b54c004c6b Allocate proper inner cell area to the GtkTreeViewColumn.
This is a premature patch, it traverses the tree's expanded
rows and fetches the deepest depth every time we allocate a
column. The deepest depth should rather be cached and pushed
when a row expands, then recalculated when the deepest expanded
row collapses.
2010-12-05 22:13:58 +09:00
Tristan Van Berkom
81e1d02de3 Created _gtk_tree_view_column_request_width().
Removed gtk_tree_view_get_real_requested_width_from_column() from
gtktreeview.c in favor of this function in the treeviewcolumn domain
(since this function goes and checks treeviewcolumn internals, settings
and derives the real requested width, seems logical this should be done
by the treeviewcolumn instead).
2010-12-05 22:12:16 +09:00
Tristan Van Berkom
7b36405a94 Use gtk_tree_view_get_real_requested_width_from_column() all around
GtkTreeView duplicated the contents of this function word-for-word
inside gtk_tree_view_update_size().
2010-12-05 22:12:04 +09:00
Tristan Van Berkom
cf8299f098 Changed _gtk_tree_view_column_set_width for _gtk_tree_view_column_allocate
Now the GtkTreeViewColumn takes care of move/resizing its window and
allocating its button (except for the special case of current drag_column
where the column doesnt actually get reallocated).
2010-12-05 22:11:50 +09:00
Tristan Van Berkom
4038cd76b3 Removed GtkTreeViewPrivate from gtktreeprivate.h and added a few more accessors.
This actually much simplifies interaction with GtkTreeSelection
(at least reduces code size where dealing width the treeview anchor path).
2010-12-05 22:11:37 +09:00
Tristan Van Berkom
4b5c80dc0f Removed the private sharing of internal treeview macros from gtktreeprivate.h
Added them directly to gtktreeview.c.
2010-12-05 22:11:21 +09:00
Tristan Van Berkom
9f4f22faf1 Removed all variables from GtkTreeViewColumn and created GtkTreeViewColumnPrivate
Some details:
  - button_request was not needed, consult the minimum request of the button
  - gtk_tree_view_column_get_button() needed to be public as people can set
    tooltips on the button (and libgail accesses the button).
2010-12-05 22:11:08 +09:00
Tristan Van Berkom
b39521dcf7 Make GtkTreeView tell the column about expand space instead of just assigning column->width.
Also modified the api to open up the way for treeview to tell the column
about how much of its size is really used to render the area.
2010-11-29 18:04:47 +09:00
Tristan Van Berkom
626f27f7ed Changed cell area/renderer "can_focus" semantics to "is_activatable" across the board.
This is because focus in treeviews can be given to cells that cannot do anything
with activation (for better keynav), so we dissociate the concept of cell
activation and focusing.
2010-11-29 16:29:09 +09:00
Kristian Rietveld
7527350d69 validate_row no longer uses focus-line-width 2010-11-28 20:39:51 +01:00
Kristian Rietveld
6fe9df2f1d First go at migrating GtkTreeView(Column) to GtkCellArea
This is still very much a work in progress, but it renders and more or
less works.  I will be fixing up the details in the very near future.

Important: this commit breaks ABI as it modifies the GtkTreeViewColumn
structure in gtktreeviewcolumn.h.  This is a sealed structure that needs
to be moved to an internal header file, most likely gtktreeprivate.h.
2010-11-28 19:54:24 +01:00
Michael Natterer
fb5dd9f72f Move all GdkDevice members to private and add one missing accessor 2010-11-23 20:25:13 +01:00
John (J5) Palmieri
f2a187f27a [gi] add array annotations for DnD related methods 2010-11-19 15:06:40 -05:00
Javier Jardón
4e3db2e3a8 gtkcombobox: Use accessor functions to access GtkTreeViewColumn 2010-11-19 08:38:12 +01:00
Javier Jardón
224ce2cf6c gtktreeview: Use accessor functions to access GtkTreeViewColumn 2010-11-19 08:38:12 +01:00
Javier Jardón
8c941d2b4e Add _gtk_entry_get_im_context() internal accessor
It's needed by gtktreeview
2010-11-19 06:15:27 +01:00
Matthias Clasen
6613fc7b36 Fix the doc build 2010-11-09 08:16:33 -05:00
Javier Jardón
5efde9d6d0 docs: move documentation to inline comments: GtkTreeView 2010-11-06 03:26:14 +01:00
Michael Natterer
3a0afce509 gtk: remove "gboolean homogeneous" from gtk_box_new()
Because it's FALSE in virtually all use cases.
2010-10-31 19:22:28 +01:00
Javier Jardón
a9894d4cf4 Use gtk_box_new() instead gtk_[v|h]box_new() 2010-10-30 05:22:58 +02:00
Tristan Van Berkom
add32bab71 Removing size_request from GtkTreeview.
This should be implemented as propery height-for-width by
the treeview-refactor branch. This commit includes a FIXME
comment that scroll adjustments should not be updated from
inside size requests but only after receiving an allocation.
2010-10-27 22:28:41 +09:00
Javier Jardón
f5615022a7 Use accessor functions to access GtkButton 2010-10-26 06:07:42 +02:00
Tristan Van Berkom
3fe0fb4ed9 Added GtkScrollablePolicy property to scrollable interface
This patch adds the GtkScrollablePolicy type property to GtkScrollable
and implements it in all subclasses. GtkScrolledWindow observes this
property to make a good guess about when to show/hide scrollbars for
height-for-width content.

Most scrollable children do not do height-for-width *yet* but
most certainly will (toolpalette, treeview, iconview, textview
widgets all TODO), for scrollable widgets that do have a minimum
and natural size, it's important for them to observe the state
of this property in order to properly drive the scroll adjustments
according to the desired GtkScrollablePolicy. This patch makes
GtkViewport do this.

Patch also adds tests/testscrolledwindow.c to display the effects
of this property.
2010-10-26 10:15:56 +09:00
Tristan Van Berkom
051dcde4bf Fixed fallout from GtkScrollable patches.
The scrollable patch removed set_scroll_adjustments (NULL, NULL) from
gtk_tree_view_init() which ensured the treeview would have adjustments
at all times, this patch adds set_v/hadjustment (NULL) to _init to ensure
the same thing (without it, there are crashes when trying to access the
adjustments notably from set_headers_visible() in gedit).
2010-10-23 22:53:06 +09:00
Matthias Clasen
0d9ebb501d Move min-display-width/height to GtkScrolledWindow
It is just too annoying to have to implement these properties in
every scrollable. Instead, we now have ::min-content-height/width
in GtkScrolledWindow.

We also add GtkScrollablePolicy to determine how to size the
scrollable content.
2010-10-22 19:21:17 +02:00
Tadej Borovšak
55196a705f Add GtkScrollable interface
The GtkScrollable interface provides "hadjustment" and "vadjustment"
properties that are used by GtkScrolledWindow. It replaces
the ::set_scroll_adjustment signal. The scrollable interface
also has ::min-display-width/height properties that can be
used to control the minimally visible part inside a scrolled window.
2010-10-22 11:03:45 +02:00
Emmanuele Bassi
2cc059a0e7 Split off gtkprivate.h
The gtkprivate.h header contains GtkWidget-specific private symbols that
are not useful except in a handful of cases. Basically everything
includes gtkprivate.h for the GTK_PARAM_* macros.

https://bugzilla.gnome.org/show_bug.cgi?id=632539
2010-10-20 10:34:26 +01:00
Federico Mena Quintero
85e47b5c4e Part of bgo#613728 - [GtkTreeView] Focus the list, not the headers, when Tab-focusing
The idea is that it is way more common to want to manipulate the
actual list, rather than the headers.  Once you Tab into the treeview
(and the list part gets the focus), you can use Shift-Tab to focus
the headers.

This means that some hysteresis is added to the focus chain, but
it makes the treeview a lot more convenient to focus with the keyboard.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2010-10-14 13:17:46 -05:00
Kristian Rietveld
aeec832f0e Do not call validate_visible_area() from the draw method
Because validate_visible_area() can modify the window size (and thus
the underlying surface), it should not be called from within the draw
method.  Given that the presize handler is run with a higher priority
than redraw, and the presize handler will validate the visible area,
there should not be cases wherein the draw method is called and
validate_visible_area() has not been run yet.

However, one such a case was gdk_window_process_updates(), which would
trigger the draw method at some point.  We now work around this
by factoring this in a new gtk_tree_view_bin_process_updates() function
that will run the presize handler first if needed.

Note: for other platforms, it might still be the case that the draw
method is called and validate_visible_area() has not been run yet.
(For example the Mac backend calls gdk_window_process_updates() from
the drawRect method, and the redraw-in-idle handling thus works
differently).  This does not seem to be a problem now, if
it will be in the future we need to take care of that then.
2010-10-14 17:26:17 +02:00
Kristian Rietveld
e732c16aab Use GtkAdjustment accessors to properly compress changed signals 2010-10-12 19:12:44 +02:00
Javier Jardón
b072ea220c Remove unneded casts
As gtk_adjustment_new() returns a GtkAdjustment* now

https://bugzilla.gnome.org/show_bug.cgi?id=630731
2010-09-29 01:18:10 +02:00
Benjamin Otte
de89fe501d treeview: Fix compilation warnings - missing cast 2010-09-28 18:26:05 +02:00
Matthias Clasen
f53ad33994 Remove GtkObject completely 2010-09-26 22:18:19 -04:00
Javier Jardón
eac1959d2c Move destroy signal to GtkWidget
Also make GtkWidget derive from GInitiallyUnowned
2010-09-26 22:18:18 -04:00
Benjamin Otte
41e6da4075 treeview: Use gtk_cairo_transform_to_window() 2010-09-26 15:11:46 +02:00
Benjamin Otte
d9c9259861 Move GtkSizeRequest into GtkWidget
It doesn't make sense to keep them separate as GtkSizeRequest requires a
GtkWidget and GtkWidget implements GtkSizeRequest, so you can never have
one without the other.
It also makes the code a lot easier because no casts are required when
calling functions.

Also, the names would translate to gtk_widget_get_width() and people
agreed that this would be a too generic name, so a "preferred" was added
to the names.

So this patch moves the functions:
gtk_size_request_get_request_mode() => gtk_widget_get_request_mode()
gtk_size_request_get_width() => gtk_widget_get_preferred_width()
gtk_size_request_get_height() => gtk_widget_get_preferred_height()
gtk_size_request_get_size() => gtk_widget_get_preferred_size()
gtk_size_request_get_width_for_height() =>
  gtk_widget_get_preferred_width_for_height()
gtk_size_request_get_height_for_width() =>
  gtk_widget_get_preferred_height_for_width()
... and moves the corresponding vfuncs to the GtkWidgetClass.

The patch also renames the implementations of the vfuncs in widgets to
include the word "preferrred".
2010-09-26 15:11:45 +02:00
Benjamin Otte
21d6aba620 treeview: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
1d3f6b30b0 API: Rename gtk_cairo_paint_*() to gtk_paint_*()
Large patch, but just renaming.
Indentation should still mostly be correct because I took care of
keeping the indentation for this function name.
2010-09-26 15:11:42 +02:00
Benjamin Otte
f525837e39 treeview: Port to draw vfunc 2010-09-26 15:11:36 +02:00
Benjamin Otte
327a04807e treeview: Update rubberbanding code to Cairo 2010-09-26 15:11:36 +02:00
Benjamin Otte
bf3b4438bb treeview: Do not put different windows in else if branches anymore 2010-09-26 15:11:36 +02:00
Benjamin Otte
f679516ce1 treeview: Use Cairo for all bin window drawing 2010-09-26 15:11:36 +02:00
Benjamin Otte
62f5fdc856 treeview: Invalidate on expander changes, don't just repaint
Repaints are supposed to be initiated by GDK, not by random repaints.
2010-09-26 15:11:36 +02:00
Benjamin Otte
bc1cd6c5cb treeview: Draw empty tree view with Cairo 2010-09-26 15:11:36 +02:00
Kristian Rietveld
03cf19e8e2 Create cairo context after running validate_visible_area()
validate_visible_area() can change the vertical adjustment and thus
trigger window moves/scrolls.  This seems to change the surface for
which gtk_tree_view_bin_expose() just created a cairo context.  Creating
the cairo context after the call to validate_visible_area() fixes
such crashes.
2010-09-26 15:11:34 +02:00
Benjamin Otte
2ee8fdb79b gtk: gdk_drawable_get_display() => gdk_window_get_display() 2010-09-26 15:11:33 +02:00
Benjamin Otte
9f47be2216 gtk: gdk_drawable_get_screen/visual => gdk_window_get_screen/visual 2010-09-26 15:11:33 +02:00
Benjamin Otte
e8a6bad00b gtk: Don't set colormap anymore when creating GDK windows
Colormaps are about to be removed, so not using them sounds like an
awesome idea.
2010-09-26 15:11:31 +02:00
Benjamin Otte
db47dd6197 API: make gtk_tree_view_create_row_drag_icon() return a cairo_surface_t
GdkPixmap is going to die!
2010-09-26 15:04:02 +02:00
Benjamin Otte
f085bc67cd treeview: Convert GtkTreeViewColumn rendering to Cairo 2010-09-26 15:03:01 +02:00
Benjamin Otte
5e4aaba482 gtk: Remove calls that try to set GDK_NO_BG on their windows
These calls aren't necessary anymore.
2010-09-26 15:03:00 +02:00
Benjamin Otte
8b4d50dd1d treeview: Port to gdk_window_shape_combine_region()
gdk_window_shape_combine_mask() is going away. It's using a GdkPixmap
and falls back to gdk_window_shape_combine_region() anyway.
2010-09-26 15:02:59 +02:00
Matthias Clasen
76d7331578 Fix the annotation of gtk_tree_view_create_row_drag_icon 2010-09-23 13:17:52 -04:00
Matthias Clasen
e0aa12eb0a Tons of transfer annotations 2010-09-21 00:18:11 -04:00
Matthias Clasen
92411d2c84 Fix an annotation 2010-09-19 00:22:37 -04:00
Javier Jardón
b140884fec Use gtk_size_request_get_size() instead deprecated gtk_widget_size_request()
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=629598

Signed-off-by: Javier Jardón <jjardon@gnome.org>
Signed-off-by: Tristan Van Berkom <tristanvb@openismus.com>
2010-09-15 03:02:58 +02:00
Colin Walters
913cdf3be7 GDK: Prefix key names with KEY_
The keysyms create a lot of potential namespace conflicts for
C, and are especially problematic for introspection, where we take
constants into the namespace, so GDK_Display conflicts with GdkDisplay.

For C application compatiblity, add gdkkeysyms-compat.h which uses
the old names.

Just one user in GTK+ continues to use gdkkeysyms-compat.h, which is
the gtkimcontextsimple.c, since porting that requires porting more
custom Perl code.
2010-09-08 18:51:44 -04:00
Javier Jardón
d05d713068 gtk/gtktreeview.c: use accessor functions to access GtkWidget 2010-09-08 21:13:03 +02:00
Tristan Van Berkom
9934007420 Completely removed requisition cache from GtkWidget instance structure.
Since we have a new mechanism for requesting sizes: GtkSizeRequestIface;
it makes no sense to maintain this cache on the GtkWidget structure...
removing the requisition cache however does not break the old "size-request"
signal which is there for backwards compatability reasons.

In any case widget->requisition should not have been accessed,
gtk_widget_get_child_requisition() would have been the correct way
to consult the cache.

This commit also deprecates the newly added gtk_widget_get_requisition()
API and makes it fallback on gtk_size_request_get_size().
2010-09-08 18:50:24 +02:00
Matthias Clasen
095fb1afe4 Remove GtkTreeView::row-ending-details
This was a style property to let theme engines 'opt-in' to more
    correct behaviour while maintaining compatibility with existing
    themes. GTK+ 3 engines are expected to handle the more correct
    behaviour.
2010-09-01 20:58:39 -04:00
Matthias Clasen
3e4e2b233b Fix trivial doc typo
Pointed out in bug 627912.
2010-08-25 18:17:43 -04:00
Javier Jardón
c05f344c0a Use gtk_window_has_group() to know if the window has an explicit window group.
gtk_window_get_group() never returns NULL; if the window isn't in a group,
a default window group is returned instead. Use gtk_window_has_group() instead.
This fixes some previous commits to use accessors to access GtkWindow.

Reported by Philip Withnall in bug
https://bugzilla.gnome.org/show_bug.cgi?id=627828
2010-08-24 16:16:42 +02:00
Javier Jardón
f05acd707d gtk/gtktreeview.c: Use accessor functions to access GtkWindow 2010-08-23 20:19:38 +02:00
Matthias Clasen
fb48e023d2 Fix a sporadic segfault in treeview keynav
If a a treeview has frequent periodic additions and removals of
rows, it is possible that a page down keypress moves the cursor
out of the height of the treeview. In some of these cases, we
can be tricked into dereferencing a  NULL pointer.

Bug 612919.
2010-08-10 00:31:46 -04:00
Javier Jardón
237ed3bbf8 Remove some unused variables 2010-08-03 12:44:52 +02:00
Benjamin Otte
5cd6d309ea treeview: Draw the dnd pixmaps with Cairo 2010-07-26 16:42:47 +02:00
Benjamin Otte
da426ec97c treeview: Draw lines with Cairo 2010-07-26 16:42:47 +02:00
Benjamin Otte
8dd3317502 treeview: Unify all line drawing into the same function
This is useful because the dashing stuff needs to be done and it seems
like a good idea to unify it.
2010-07-26 16:42:47 +02:00
Benjamin Otte
526aac1fda treeview: Draw column reordering arrows with Cairo 2010-07-26 16:42:47 +02:00
Szilárd Pfeiffer
ac34031b4e Moved the drawing of horizontal grid lines after cell drawing.
Without the change if the cell background is set the horizontal
grid line cannot be seen.
2010-07-25 14:50:12 +02:00
Javier Jardón
3a10216dd0 Use accessor functions to acces GtkContainer 2010-07-13 19:40:46 +02:00
Javier Jardón
0a07e9733b gtk/: fully remove gtkalias hacks
https://bugzilla.gnome.org/show_bug.cgi?id=623845
2010-07-10 02:51:26 +02:00
Philip Withnall
0b51abbfdf Add (out) annotations to GtkTreeIter parameters 2010-07-07 18:20:37 +02:00
Benjamin Otte
300e6b84cd s/GdkRegion/cairo_region_t/ in all of gtk
https://bugzilla.gnome.org/show_bug.cgi?id=613284
2010-06-29 16:06:38 +02:00
Benjamin Otte
3e96cfe8fc Deprecate the GdkRegion API
Includes fixing all callers to use the cairo region API instead. This is
usually just replacing the function names, the only difference is
gdk_region_get_rectangles() being replaced by
cairo_region_num_rectangles() and cairo_region_get_rectangle() which
required a bit more work.

https://bugzilla.gnome.org/show_bug.cgi?id=613284
2010-06-29 16:06:38 +02:00
Colin Walters
905f988166 Revert "Add length to gtk_tree_path_get_indices"
This reverts commit eebb16eb1a.

Was an accidental commit.
2010-06-28 14:15:10 -04:00
Colin Walters
eebb16eb1a Add length to gtk_tree_path_get_indices
The old version wasn't introspectable as it didn't have a length
return parameter.  Also, delete gtk_tree_path_get_indices_with_depth,
since it's no longer needed.
2010-06-28 13:50:36 -04:00
Tristan Van Berkom
17516dc83c Exposed GtkTreeView's internal GtkTreeSelection for builder files 2010-06-25 12:15:49 -04:00
John (J5) Palmieri
256759a3b7 gtk_tree_view_get_model: return value annotated transfer none 2010-05-27 16:58:52 -04:00
Matthias Clasen
bd4609b140 Merge the xi2-for-master branch 2010-05-25 18:38:44 -04:00
John (J5) Palmieri
57754edef6 add a transfer none annotation to gtk_tree_view_get_selection
* it returns the selection from its priv structure without reffing
2010-05-25 11:49:10 -04:00
Javier Jardón
b18b33ae82 Revert "Forward-port a GtkAdjustment compatibility fix"
In the early 2.14.x releases, GtkAdjustment was changed to enforce
that values are restricted to the range [lower, upper - page_size].
This has always been the documented behaviour, and the recommended
practice is to set page_size to 0 when using adjustments for simple
scalar values, like in a slider or spin button.
Due to the large number of applications that are affected by this
change, the behaviour has been reverted to the old behaviour in
2.14.3, with an explicit warning that this change will be
reintroduced in 2.90.

This reverts commit e6373738fc.

https://bugzilla.gnome.org/show_bug.cgi?id=619474
2010-05-24 15:39:30 +02:00
Kristian Rietveld
f3fa17a16a Bug 565559 - Incorrect leave-notify signals for treeview
Set enter and leave notify mask on header window.

Extract from a patch by Hans van Hintum.
2010-05-12 12:15:48 +02:00
Alan Knowles
ee357cf885 Fix various gir annotations on tree API
Just add (out) tags where needed to generate valid gir.
2010-05-11 13:40:15 +08:00
Christian Dywan
11e97600f0 Remove deprecated GtkTreeView functions 2010-05-03 01:39:50 +02:00
Emmanuele Bassi
621b415e5b tree-view: Use gtk_widget_send_focus_change()
Remove the second (and last) internal user of the GTK_HAS_FOCUS flag.

https://bugzilla.gnome.org/show_bug.cgi?id=593671
2010-04-26 18:59:24 +01:00
Javier Jardón
32b9aeaadd Don't use GTK_WIDGET_STATE in internal code anymore
Use gtk_widget_get/set_state() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-09 02:40:17 +01:00
Javier Jardón
74ed719fa4 Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_MAPPED)
Use new API instead: gtk_widget_set_mapped ()

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-06 12:02:21 +01:00
Javier Jardón
1934de4b65 Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_REALIZED)
Use new API instead: gtk_widget_set_realized ()

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-06 11:51:33 +01:00
Javier Jardón
16a59ad912 Deprecate widget flag: GTK_WIDGET_REALIZED
Use gtk_widget_get_realized() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-03 20:41:05 +01:00
Javier Jardón
1fe7d3cefd Deprecate widget flag: GTK_WIDGET_MAPPED
Use gtk_widget_get_mapped() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-03 20:19:03 +01:00
Javier Jardón
214a023e91 Deprecate widget flag: GTK_WIDGET_VISIBLE
Use gtk_widget_get_visible() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-01 07:52:07 +01:00
Javier Jardón
4232115e22 Deprecate widget flag: GTK_WIDGET_HAS_FOCUS
Use gtk_widget_has_focus() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-01 06:11:01 +01:00
Javier Jardón
a27d5a2c9e Deprecate widget flag: GTK_WIDGET_IS_SENSITIVE
Use gtk_widget_is_sensitive() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-01 05:32:51 +01:00
Matthias Clasen
1e381138f3 Correct annotations for gtk_tree_view_get_path_at_pos
Patch by Alan Knowles, bug 609514.
2010-02-23 12:51:45 -05:00
Johan Dahlin
fe85272112 [annotations] Add allow-none
This commit was created using a script that searched for all docstrings
containing a parameter and the string 'or %NULL'.
Gdk backends and demos excluded as they are not part of a public API

https://bugzilla.gnome.org/show_bug.cgi?id=610474
2010-02-19 17:57:51 -02:00
Michael Natterer
07dc2f6c35 gtk: fix crash in _gtk_rbtree_find_offset() called from update_prelight()
Move the check for tree_view->priv->tree being NULL into update_prelight()
so the function will never call _gtk_rbtree_find_offset() on a NULL rbtree.
2010-02-06 15:57:15 +01:00
Claudio Saavedra
52acceef56 GtkTreeView: plug a leaking GtkTreeRowReference
This is exposed by overshooting in a HildonPannableArea. Leaking
a GtkTreeRowReference also means leaking the whole model, since
the GtkTreeModel reference count is increased for each row
reference.

Fixes bug #607770 - Leak in GtkTreeView with HildonPannableArea
2010-01-22 16:53:33 +02:00
Kristian Rietveld
2f73fb76c1 Bug 607322 - Double-click doesn't work if the item is selected in...
Slight correction to fix for #596473.
2010-01-18 22:22:30 +01:00
Javier Jardón
56a893ca8c Deprecate widget flag: GTK_WIDGET_CAN_FOCUS
https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-01-07 10:05:08 +01:00
Christian Dywan
bb1824c131 Deprecate flag macros for toplevel, state, no window and composite child
Deprecate widget flag macros GTK_WIDGET_STATE, GTK_WIDGET_SAVED_STATE,
GTK_WIDGET_FLAGS, GTK_WIDGET_TOPLEVEL, GTK_WIDGET_NO_WINDOW and
GTK_WIDGET_COMPOSITE_CHILD.

Also deprecate the type macros GTK_WIDGET_TYPE, GTK_OBJECT_TYPE_NAME and
GTK_OBJECT_TYPE which have become redundant.

Instances of GTK_WIDGET_TOPLEVEL are replaced with gtk_widget_is_toplevel,
GTK_WIDGET_TYPE is replaced with G_OBJECT_TYPE, GTK_WIDGET_COMPOSITE_CHILD
is replaced with use of the "composite-child" property and uses of
GTK_WIDGET_NO_WINDOW are adjusted to use gtk_widget_get_has_window.

Uses of GTK_WIDGET_SAVED_STATE and GTK_WIDGET_FLAGS inside GtkWidget are
changed to direct flag usage.

Documentation is updated to refer to gtk_widget_set_has_window and
gtk_widget_get_has_window.

Gail and tests are updated as well.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-01-04 07:57:05 +01:00
Kristian Rietveld
436855210e Unset expander_column when expander column is removed from tree view 2009-12-28 21:34:17 +01:00
Kristian Rietveld
acb6f4ff33 Fix call to update_prelight()
Seems like some minus signs sneaked in while diffing and reapplying...
Fixes regression noted in 480065.
2009-12-23 08:33:10 +01:00
Kristian Rietveld
f59294fd93 Correct problems with earlier fix for bug #480065
Initialize event_last_[xy] to out of range coordinates and also update
these values in enter and leave notify.  Fix up calls to
update_prelight() from size allocate.  Unconditionally doing these calls
caused problems with hover selection.  Now we only do this call when
the "width before the expander column" has changed.  (Which might be
awkward, but it is the best heuristic I could come up with so far).
2009-12-21 22:42:15 +01:00
Kristian Rietveld
f223577a88 Bug 480065 - wrong tree collapsed (or expanded) after having scrolled
Commit again after revert.

Store (x, y) of last motion event.  From
gtk_tree_view_adjustment_changed(), call prelight_or_select() so that
the prelight is recalculated.  We do the same from
gtk_tree_view_size_allocate() for the case that clicking on an expander
shows new rows that resize the column(s) left of the expander.  This
means that the expander is moved horizontally, in such a case the
prelight also has to be reconsidered.
2009-12-21 22:42:15 +01:00
Colin Walters
6529c07614 [introspection] Merge in Gtk-custom.c annotations
The Gtk-custom.c file in gir-repository contained a number of
introspection annotations.  Merge those into the GTK source files.

Some documentation was moved from the tmpl/ files to accomodate
the addition of annotations.
2009-12-16 17:22:01 -02:00
Benjamin Otte
9647285441 Revert dd511e825a
The patch completely breaks entry completion - as can be seen when using
epiphany. Bug 480065 has been reopened.
2009-12-16 11:48:11 +01:00
Kristian Rietveld
2ef9b989bf Bug 596473 - Second double-click of GtkTreeView row doesn't emit...
Rework double click handling in GtkTreeView.  We cannot blindly use
the 2BUTTON_PRESS and 3BUTTON_PRESS events.  In case a user does two
fast double clicks, we receive a 3BUTTON_PRESS and BUTTON_PRESS.  We
cannot easily deduce two double clicks from this.

We have removed the bookkeeping using row references of the last paths
clicked.  Instead we monitor event time, (x, y) coordinates and compare
against double-click-time and double-click-distance ourselves.
2009-11-27 13:48:16 +01:00
Kristian Rietveld
dd511e825a Bug 480065 - wrong tree collapsed (or expanded) after having scrolled
Store (x, y) of last motion event.  From
gtk_tree_view_adjustment_changed(), call prelight_or_select() so that
the prelight is recalculated.  We do the same from
gtk_tree_view_size_allocate() for the case that clicking on an expander
shows new rows that resize the column(s) left of the expander.  This
means that the expander is moved horizontally, in such a case the
prelight also has to be reconsidered.
2009-11-27 13:48:16 +01:00
Yevgen Muntyan
3c510f028f Use standard mac shortcuts
This changes Ctrl-X, Ctrl-C, etc. to Cmd-X, Cmd-C, etc. Also,
Alt-Left and Alt-Right in text widgets bound to Ctrl-Left and
Ctrl-Right actions

https://bugzilla.gnome.org/show_bug.cgi?id=530351
2009-10-26 00:03:05 +01:00
Kristian Rietveld
f77042aae2 Avoid recursive calls to gtk_tree_view_top_row_to_dy()
Commit 3f306a4042 made it possible for
gtk_tree_view_top_row_to_dy() to be called recursively.  (In a different
way than was already guarded for).  This caused a single test case in
the scrolling test suite to fail.  We now also guard for recursive calls at
the beginning of gtk_tree_view_top_row_to_dy().
2009-09-06 20:26:09 +02:00
Kristian Rietveld
5ec80eb5ba Recalculate heights when a (new) separator func is set on GtkTreeView 2009-09-04 17:08:29 +02:00
Kristian Rietveld
3f306a4042 Have tree view process exposes after adjustments have been updated
This was removed long ago by the patch in bug 101235.  On a hindsight,
all other scrollable widgets are processing exposes at this point, which
completely makes sense to me, so I am putting it back.
2009-09-04 14:06:58 +02:00
Kristian Rietveld
44469e4684 Make gtk_tree_view_real_set_cursor() handle non-existing paths
Such paths (eg. a child node that is collapsed) should be ignored.  This
is fixed by checking the return value of _gtk_tree_view_find_node(),
which returns a partial return value (the parent node) when it returns
TRUE.  Also added a unit test.
2009-08-28 11:04:54 +02:00
Kristian Rietveld
ec7187e039 Bug 543310 - set_enable_tree_lines doesn't work when a cellrenderer...
Reorder drawing in gtk_tree_view_bin_expose() so that the tree lines are
drawn after the cells have been drawn.  This is because cell-background
is handled in the cell renderer, so the tree lines need to be drawn
after this.
2009-08-27 18:12:54 +02:00
Kristian Rietveld
786b3914cd Bug 588199 - GtkTreeView rendering glitch while using a default ...
Contrary to what was believed before, do_validate_rows() does need to
queue a normal resize (including a redraw) when it has to.  The redraw
is required because of the size of the tree has changed because new
row(s) have been validated.
2009-08-27 18:12:54 +02:00
Kristian Rietveld
4449acbb82 Remove broken logic in backwards walks in validate_visible_area()
In validate_visible_area() it was assumed that gtk_tree_path_prev()
would always return the correct path of the preceding node.  This is
obviously not true.  The if-clause has been removed so that we now
always use _gtk_tree_view_find_path() to get the path from the tree,
node.
2009-08-23 22:06:16 +02:00
Kristian Rietveld
9976554c6e Bug 528283 - Problems when using PageUp & PageDown to navigate...
Patch from Jonathan Matthew to make focus grabbing of page up/down,
home/end and left/right movements consistent with up/down.
2009-08-23 22:06:15 +02:00
Kristian Rietveld
a79ef0866b Bug 555109 – selection broken when typeahead active
gtk_tree_view_enter_notify() now "ignores" the synthesized crossing
events.  The synthesized crossing events always have (0, 0) as
coordinates, which messes things up.  This patch does not fix all issues,
at least it makes the behavior much more reasonable again.  Watch bug
555109 for further discussion on the issue.
2009-07-30 20:24:31 +02:00
Kristian Rietveld
069a593b0f Bug 539377 – Unnecessary warnings when GtkTreeView is not realized
Adapt gtk_tree_view_get_path_at_pos() and
gtk_tree_view_get_drag_dest_row() to just return FALSE when bin_window
is NULL and not hit a warning.  Makes this case consistent with the tree
view not having a model.  Documentation has been updated to clarify
this, unit test has been added.

Fixes bug 539377, based on a patch by Bjorn Lindqvist.
2009-07-30 20:24:31 +02:00
Kristian Rietveld
ff10f9ce02 Bug 498010, 546005 - fix assertion in gtk_tree_view_set_cursor_on_cell
Instead of failing with warning on !tree_view->priv->tree, return
silently when tree_view->priv->model is NULL.  Clarified in the
documentation that for invalid paths (and every path is invalid when no
model is set), the function will fail silently although the current
cursor will be unset.

Fixes bugs 498010 and 546005.
2009-07-30 20:24:31 +02:00
Kristian Rietveld
c035c122e2 Remove unused dirty iter discovery functions
gtk_tree_view_discover_dirty_iter() and gtk_tree_view_discover_iter()
have been in the tree forever, but unused since 1.3.8 or so.  I guess we
no longer need them, so removed them.  Fixes a compiler warning as well.
2009-07-30 12:02:18 +02:00
Paolo Borelli
c564b3ef2b Microoptimization in interactive search handling 2009-07-20 15:54:48 +02:00
Paolo Borelli
48f1b45b62 Bug 588943 – set correct selection before emitting cursor-changed when searching
Make sure the correct selection is set when emitting cursor-changed
during an interactive search
2009-07-20 15:54:35 +02:00
Benjamin Otte
33ada9e938 Bug 588273 - Make number of validated rows depend on time, not row count
Previously, do_validate_rows() validated 300 rows per iteration. While
this is usually not problematic, as the typical tree view contains less
than 100 rows. Tree views with a lot of columns or complex cell
renderers could take inacceptably long, like:
- Epiphany's location bar entry completion has multiline and marked up
  text in every cell. Validating a single row took ~1.5ms here.
- In the list view in Nautilus, When enabling all columns, validating a
  single row would take ~3ms.
With 300 rows per iteration, that made those examples take 500ms/1s in a
signle main loop callback, and this obviously caused responsiveness
problems.

Now the code uses a timer and limits the time for validating rows to
30ms. This can cause less lines to be invalidated per call, so the
function might be called more often, but generally results in more
responsive applications.
2009-07-17 21:35:32 +02:00
Benjamin Otte
6c18c25adb check for allowed NULL inside g_return_if_fail() statements
This patch replaces

if (foo != NULL)
  g_return_if_fail (GTK_IS_FOO (foo));

with

g_return_if_fail (foo == NULL || GTK_IS_FOO (foo));
2009-06-27 11:31:13 +02:00
Benjamin Otte
1a385c50f0 fix compile warnings
Fallout from running make CFLAGS="-Werror"; mostly missing casts and
constness issues.
2009-06-17 10:28:03 +02:00
Federico Mena Quintero
2b3de3dd75 bgo#580560 - Make Backspace work in the file chooser to to to the parent directory
GtkFileChooserDefault actually implements a binding signal for
Backspace, to make it go to the parent directory.  However,
GtkTreeView was eating our Backspace, and thus the file chooser was
not getting a chance to execute its binding signal.

GtkTreeView implements a Backspace binding itself, which it uses to
move to the parent node of the current cursor node.  However, the
binding handler would return TRUE even if there was no parent to the
current node.  Now the binding handler only returns TRUE if it
actually changed the cursor.

Additionally, gtk_tree_view_key_press() sees if no bindings handled a
key press; in that case, it re-sends the key press to the treeview's
search entry.  However, sending a Backspace to an empty entry makes
the entry beep.  Thus, we add a flag that gets set from GtkTreeView's
Backspace binding handler, to tell gtk_tree_view_key_press() when it
should *not* re-emit the key press on the search entry.  Sort of,
"yeah, I didn't handle this key press, but I don't want you to send it
to the search entry, either!".

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-15 12:37:07 -05:00
Matthias Clasen
e6373738fc Forward-port a GtkAdjustment compatibility fix
We reverted GtkAdjustment to its traditional behaviour wrt. to
clamping in 2.14.3, but the fix was lost between 2.14 and 2.16.
2009-05-03 13:04:06 -04:00
Matthias Clasen
2ca507fbe7 Bug 570824 – [a11y] TreeView is not keyboard (re)focusable after
selecting a cell in a non-sortable column

        * gtk/gtktreeview.c (gtk_tree_view_header_focus): Don't grab
        focus to a header button if it is not focusable. Problem reported
        by Joanmarie Diggs


svn path=/trunk/; revision=22316
2009-02-11 18:53:24 +00:00
Philip Withnall
b33a3d925e Small documentation fix.
2009-01-28  Philip Withnall  <philip@tecnocode.co.uk>

	* gtk/gtktreeview.c: Small documentation fix.


svn path=/trunk/; revision=22247
2009-01-28 20:35:35 +00:00
Claudio Saavedra
08b4777ae6 Use gtk-doc syntax to refer to properties in the docstrings.
2009-01-25  Claudio Saavedra  <csaavedra@igalia.com>

	* gtk/gtktreeview.c: Use gtk-doc syntax to refer to properties in
	the docstrings.


svn path=/trunk/; revision=22213
2009-01-24 22:54:53 +00:00
Claudio Saavedra
758cb60ee4 improve ::search-column property description.
2009-01-24  Claudio Saavedra  <csaavedra@igalia.com>

	* gtk/gtktreeview.c: (gtk_tree_view_class_init):
	improve ::search-column property description.


svn path=/trunk/; revision=22207
2009-01-24 21:00:12 +00:00
Matthias Clasen
5c99971a67 Fix typos
svn path=/trunk/; revision=22190
2009-01-23 05:54:02 +00:00
Sven Herzberg
2b31f26827 Document the "set-scroll-adjustments" signal
2008-12-11  Sven Herzberg  <sven@imendio.com>

	Document the "set-scroll-adjustments" signal

	Reviewed by Kristian Rietveld.

	* gtk/gtkiconview.c,
	* gtk/gtklayout.c,
	* gtk/gtktextview.c,
	* gtk/gtktreeview.c,
	* gtk/gtkviewport.c: added proper documentation for the signal


svn path=/trunk/; revision=21871
2008-12-11 13:09:27 +00:00
Matthias Clasen
31774edd4a Bug 554453 – "typeahead find" widget of GtkTreeView appears on wrong
2008-11-29  Matthias Clasen  <mclasen@redhat.com>

        Bug 554453 – "typeahead find" widget of GtkTreeView appears on
        wrong monitor in a multi-head environment

        * gtk/gtktreeview.c (gtk_tree_view_ensure_interactive_directory):
        Make sure the typeahead window follows screen changes of the
        treeview. Noticed by Rainer Stransky



svn path=/trunk/; revision=21835
2008-11-30 06:05:23 +00:00
Federico Mena Quintero
d9c8224a91 bnc447004 - Flip tree lines around in the right-to-left case
2008-11-29  Federico Mena Quintero  <federico@novell.com>

	* gtk/gtktreeview.c (gtk_tree_view_bin_expose): If tree lines are
	enabled, flip them around for the right-to-left case.  Fixes
	https://bugzilla.novell.com/show_bug.cgi?id=447004.  Patch by
	Ricardo Cruz <rpmcruz@alunos.dcc.fc.up.pt>

Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=21829
2008-11-29 22:15:37 +00:00
Murray Cumming
093d425393 gtk_icon_view_set_tooltip_row(), gtk_icon_view_set_tooltip_item():
2008-10-20  Murray Cumming  <murrayc@murrayc.com>

* gtk/gtkiconview.c: gtk_icon_view_set_tooltip_row(), 
gtk_icon_view_set_tooltip_item():
* gtk/gtktreeview.c: gtk_icon_view_set_tooltip_row(), 
gtk_icon_view_set_tooltip_cell():
Documentation: Mention the simple set_tooltip_column() 
alternative.

svn path=/trunk/; revision=21689
2008-10-20 12:11:05 +00:00
Christian Dywan
0c5bfe5f2b Bug 541391 – Unfocussable Treeview swallows focus
* gtk/gtktreeview.c (grab_focus_and_unset_draw_keyfocus),
(gtk_tree_view_focus): Honor GTK_WIDGET_CAN_FOCUS properly

svn path=/trunk/; revision=21507
2008-09-24 08:19:51 +00:00
Michael Natterer
2fc992e0f5 small formatting fix.
2008-08-21  Michael Natterer  <mitch@imendio.com>

	* gtk/gtktreeview.c (gtk_tree_view_realize): small formatting fix.


svn path=/trunk/; revision=21178
2008-08-21 11:42:32 +00:00
Michael Natterer
e0bbf16989 get rid of the deprecated aliases NONE and BOOL.
2008-08-13  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkmarshalers.list: get rid of the deprecated aliases NONE
	and BOOL.

	* gtk/gtkdialog.c
	* gtk/gtkentrycompletion.c
	* gtk/gtkmenuitem.c
	* gtk/gtkoldeditable.c
	* gtk/gtkrange.c
	* gtk/gtktreeview.c
	* gtk/gtkwidget.c: changed accordingly.


svn path=/trunk/; revision=21111
2008-08-13 18:44:11 +00:00
Michael Natterer
d9d3379698 gtk/gtkaccellabel.c gtk/gtkcalendar.c gtk/gtkclist.c gtk/gtkentry.c
2008-08-12  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkaccellabel.c
	* gtk/gtkcalendar.c
	* gtk/gtkclist.c
	* gtk/gtkentry.c
	* gtk/gtkeventbox.c
	* gtk/gtkfilechooserbutton.c
	* gtk/gtkfilechooserdefault.c
	* gtk/gtkhandlebox.c
	* gtk/gtkhsv.c
	* gtk/gtkiconview.c
	* gtk/gtkimage.c
	* gtk/gtklayout.c
	* gtk/gtklistitem.c
	* gtk/gtkmenuitem.c
	* gtk/gtkmessagedialog.c
	* gtk/gtknotebook.c
	* gtk/gtkpaned.c
	* gtk/gtkpathbar.c
	* gtk/gtkplug.c
	* gtk/gtkprintunixdialog.c
	* gtk/gtkrange.c
	* gtk/gtkrecentchooserdefault.c
	* gtk/gtkruler.c
	* gtk/gtksocket.c
	* gtk/gtktext.c
	* gtk/gtktextview.c
	* gtk/gtktoolbar.c
	* gtk/gtktreeitem.c
	* gtk/gtktreeview.c
	* gtk/gtkviewport.c
	* gtk/gtkwin32embedwidget.c: chain up unconditionally in
	realize(), unrealize(), map(), unmap(), style_set(),
	key_press_event() and size_request()


svn path=/trunk/; revision=21088
2008-08-12 09:44:32 +00:00
Michael Natterer
e18d3c6fd3 consistently chain up using GTK_FOO_CLASS(parent_class)->bar(instance)
2008-08-12  Michael Natterer  <mitch@imendio.com>

	* gtk/*.c: consistently chain up using
	GTK_FOO_CLASS(parent_class)->bar(instance) instead of
	(*GTK_FOO_CLASS(parent_class))->bar(instance).


svn path=/trunk/; revision=21085
2008-08-12 09:06:34 +00:00