Commit Graph

996 Commits

Author SHA1 Message Date
Benjamin Otte
2783158f8d treeview: Do a simple replace for gdk_window_get_pointer()
Replace it with the equivalent gdk_window_get_device_position() with the
core pointer.
2011-11-09 03:23:43 +01:00
Benjamin Otte
28d3d6e039 treeview: Remove unused crack code
No, querying the pointer position in a draw callback is not a good idea.
No, setting FOCUSSED based on that position is not a good idea either.
2011-11-08 21:14:06 +01:00
Benjamin Otte
a1fb2c863b treeview: Remove call to gtk_widget_get_pointer() 2011-11-08 21:14:06 +01:00
Benjamin Otte
1425ecbc52 treeview: Fix warnings from fixing warnings
Warnings introdcued by fixing deprecation warnings in
2ead4c6038
2011-11-08 21:14:05 +01:00
Matthias Clasen
2ead4c6038 Remove some more uses of gdk_window_get_pointer 2011-11-02 08:10:42 -04:00
Matthias Clasen
8370052180 Don't use *DISABLE_DEPRECATED guards
Instead define GDK_DISABLE_DEPRECATION_WARNINGS where appropriate.
2011-11-01 22:35:57 -04:00
Michael Natterer
5c4f2ef0c1 gtk: move _gtk_modules_has_mixed_deps() to gtkmodlesprivate.h
and remove gtkmainprivate.h completely.
2011-10-23 13:57:07 +02:00
Javier Jardón
0853ce3077 Use G_VALUE_INIT
Instead of an explicit { 0, } when declaring the variable.
2011-10-15 16:45:16 +01:00
Michael Natterer
87cc0dc79f gtk: use the new modifier API instead of GTK_DEFAULT_ACCEL_MOD_MASK
in gtkimcontextsimple and gtktreeview, which are the easy places,
but also true bugfixes, because on OSX we can't use the virtual META
here, we needs MOD2 as delivered in key events.
2011-10-07 09:33:07 +02:00
Benjamin Otte
58d9c7e53e docs: Fix typo in treeview docs 2011-09-30 00:26:22 +02:00
Michael Natterer
11f8c1ba6f gtk: remove the private GTK_EXTEND/MODIFY_SELECTION_MOD_MASK
and use the new public modifier abstraction API instead.
2011-09-27 12:06:10 +02:00
Michael Natterer
0955a59563 app: abstract which modifiers are used for extending and modifying selections
which are SHIFT and MOD2 on the Mac, and SHIFT and CONTROL otherwise.
Use the new define all over the place and rename variables and
members to not say "shift" or "control".
2011-09-26 16:01:50 +02:00
Matthias Clasen
5ff8fe6971 Documentation fixes
Mostly making sure that return values and varargs don't loose
their docs.
2011-09-25 21:04:49 -04:00
Benjamin Otte
9e8b2f2521 treeview: Return FALSE from draw handler
... like every widget should.

https://bugzilla.gnome.org/show_bug.cgi?id=658981
2011-09-14 16:10:14 +02:00
Matthias Clasen
3a1ce87c7e Fix typos in gtk_tree_view_set_reorderable docs
As pointed out in bug 530253.
2011-09-04 23:52:36 -04:00
Matthias Clasen
eaed6d1912 Improve gtk_tree_view_set_drag_dest_row docs
As requested in bug 581435.
2011-09-04 23:42:42 -04:00
Cosimo Cecchi
640f06928f treeview: add GTK_STYLE_CLASS_SEPARATOR for tree view separators
https://bugzilla.gnome.org/show_bug.cgi?id=657985
2011-09-02 15:11:15 -04:00
Matthias Clasen
6f39855c08 More include cleanups 2011-08-28 01:54:55 -04:00
Matthias Clasen
2ba9c4b4a7 Make focus rectangles optional
This commit introduces a new setting, gtk-visible-focus, backed
by the Gtk/VisibleFocus X setting. Its three values control how
focus rectangles are displayed.

'always' is equivalent to the traditional GTK+ behaviour of always
rendering focus rectangles.

'never' does what it says, and is intended for keyboardless
situations, e.g. tablets.

'automatic' hides focus rectangles initially, until the user
interacts with the keyboard, at which point focus rectangles
become visible.

https://bugzilla.gnome.org/show_bug.cgi?id=649567
2011-08-10 16:34:20 +02:00
Kristian Rietveld
dca9db124b Bug 655545 - condition can never be true in gtk_tree_view_real_set_cursor
Spotted by Ben Pfaff.
2011-07-30 23:01:38 +02:00
Matthias Clasen
6012f096c9 Convert GailTreeView to GtkTreeViewAccessible
Mostly code rearrangement and cleanup, but also a memory
leak fix in gtk_tree_view_accessible_get_column_description().
2011-07-05 16:08:56 -04:00
Matthias Clasen
8771f2ce9c Don't rely on button allocations for invisible headers
Now that we are not allocating treeview column buttons anymore
with invisible headers, we can't rely on their allocations for
other things like cell area computations anymore. Use x-offset
and width of the column directly, instead.
2011-06-10 00:17:56 -04:00
Matthias Clasen
a081485269 GtkTreeView: Don't short-circuit header-height calculation
The code was putting header_height at zero when there is
no model. That leads to temporary underallocation of header
buttons.
2011-06-09 21:40:08 -04:00
Matthias Clasen
7d3c5b2763 Drop unneeded includes: gtkalignment.h 2011-06-07 21:53:11 -04:00
Benjamin Otte
a6daba5e78 API: Change semantics of gtk_container_get_child_path()
Include the child widget path in the returned path now. This allows
customizing the path of the current widgets - like adding flags to child
widgets (and maybe siblings in the future).
2011-06-02 02:03:50 +02:00
Benjamin Otte
c5af8c7e3a treeview: Remove unused variables
... and all the code doing complex computations to assign values to
them.
2011-05-27 16:11:10 +02:00
Cosimo Cecchi
f398745a15 treeview: don't arbitrairly add 2 to the expander size
Bump the default expander size by 2 pixels instead.

https://bugzilla.gnome.org/show_bug.cgi?id=650424
2011-05-18 11:12:47 -04:00
Cosimo Cecchi
42f5856e77 treeview: render a frame around the rows, after drawing their background
https://bugzilla.gnome.org/show_bug.cgi?id=650424
2011-05-18 11:12:31 -04:00
Micah Carrick
86f5849158 Fix annotation for Gtk.TreeView.enable_model_drag_source
https://bugzilla.gnome.org/show_bug.cgi?id=649979
2011-05-11 16:15:23 -04:00
Kristian Rietveld
874dfc24b2 treeview: Do not unconditionally set width_changed to TRUE, which redraws
Patches by Benjamin Otte.

The "invalidate last column" hack is removed.  It is now of no use since
the entire widget will be redrawn when a single column changes.
2011-04-17 01:14:51 +02:00
Kristian Rietveld
4d5d915afe treeview: if we are below rows that changed height: redraw
We have to redraw if we are below a couple of rows that changed height
in do_validate_rows().  This will still require a redraw for a large
amount of cases, can we do better?  You would expect that a redraw of
the tree view is not required when the dy changes with the same delta
as the delta of the height accrued when validating the nodes.  This
further optimization will likely require changes to the top_row/dy
synchronization code.
2011-04-17 01:14:51 +02:00
Kristian Rietveld
4594370b46 treeview: Avoid queueing a redraw in do_validate_rows()
If the changed rows are not visible, we likely do not have to redraw
in conjunction to resize.  Spotted by Benjamin Otte.
2011-04-17 01:14:51 +02:00
Kristian Rietveld
84ebafc305 Merge two if-blocks with same condition 2011-04-16 20:16:03 +02:00
Xavier Claessens
00fa4a2fc0 Do not call invalidate_empty_focus() when not realized
Fixes bug 626503
2011-04-16 20:13:51 +02:00
Garrett Regier
793d12d70d Fix leaking calls to gdk_device_manager_list_devices()
gdk_device_manager_list_devices() returns a newly allocated list.

https://bugzilla.gnome.org/show_bug.cgi?id=645234
2011-03-21 10:37:10 -04:00
Cosimo Cecchi
151cf7204b treeview: add the separator style class to the tree view separator lines 2011-03-17 17:12:58 -04:00
Cosimo Cecchi
96d6c2d108 treeview: propagate the selected state from the row
An expander in a row can't be selected on its own otherwise. This way
themes can override the expander colors when the row is selected.

https://bugzilla.gnome.org/show_bug.cgi?id=644089
2011-03-07 08:12:48 -05:00
Matthias Clasen
405b54c72e Check the return value of gtk_tree_model_get_iter
Noticed in passing, didn't really see it crash there, but
better safe than sorry.
2011-02-16 18:48:42 -05:00
Matthias Clasen
beb8c290d1 Always chain up in ::style-updated
This was not handled consistently, but the default handler
does useful things, so we should always chain up.
2011-02-07 07:30:37 -05:00
Matthias Clasen
8448780a6c Make treeview expanders work reliably
It turns out that the gtk_grab_remove() can trigger a do_prelight()
call, which may end up changing prelight_node, and then the state
gets messed up. Moving the grab removal until after we're done with
button_pressed_node and prlight_node makes expanders work reliably.

One thing that is still not right is that the expander doesn't get
prelight again after the animation is done, if you manage to release
without any additional motion events.

https://bugzilla.gnome.org/show_bug.cgi?id=641039
2011-02-01 01:32:02 -05:00
Carlos Garnacho
08af1783c5 Make GtkTreeView use GtkStyleContext
Expander animation has been replaced by implicit animations
from the style context.

Column headers are also properly themed, GtkContainer::get_path_for_child()
is implemented and the treeview resets column buttons style on columns
being reordered.

The default CSS has changed to theme treeviews sensibly.
2011-01-27 20:57:11 +01:00
Martin Pitt
d7b71be49b [GI] Fix gtk_tree_view_get_cursor() transfer annotation 2011-01-26 14:39:50 +01:00
Matthias Clasen
d9fcc4c630 Silence new gcc warnings
gcc 4.6.0 has started to warn about set-but-unused variables.
So don't do that, then.
2011-01-23 21:51:38 -05:00
Pavel Holejsovsky
374e76a19d [GI] Mark unintrospectable constructs as (skip)
Also adds 'Rename to:' annotation to some constructs replacing the
skipped ones.
2011-01-20 13:57:21 +01:00
Pavel Holejsovsky
2fb1c06402 [GI] Add missing (out) and (array) annotations 2011-01-20 13:57:20 +01:00
Pavel Holejsovsky
3c8fc21e9b [GI] Fixes of existing incorrect annotations 2011-01-20 13:56:06 +01:00
Sebastian Pölsterl
cbbfe48ee4 [GI] Added missing (transfer none) annotation to gtk_tree_view_get_path_at_pos 2011-01-19 15:09:05 +01:00
Kristian Rietveld
4ed781778d Introduce gtk_tree_view_is_blank_at_pos()
This function is useful to figure out whether the tree view is "blank"
at a given location.  For such locations you might want to popup a
custom popup menu, clear the current selection or start rubber banding.
In the future, we are planning on updating GtkTreeView's user
interactions to take advantage of this new function.

Part of bug 350618.
2011-01-07 15:38:06 +01:00
Benjamin Otte
f65fa81e3a treeview: Update adjustment usage for sealing
Use getters instead of direct structure access.
2011-01-05 14:30:59 +01:00
Benjamin Otte
6ff585e189 treeview: Update adjustment usage for sealing
Use gtk_adjustment_set_upper() instead of doing its work manually.
2011-01-05 14:30:59 +01:00
Benjamin Otte
e93eb20794 treeview: Update adjustment usage for sealing
Use gtk_adjustment_configure() when toggling header visibility.
2011-01-05 14:30:58 +01:00
Matthias Clasen
b123bc41fd Move docs for gtkmain inline
At the same time, introduce a gtkmainprivate.h header
and various other cleanups.

Based on a patch by Tadej Borovšak.
https://bugzilla.gnome.org/show_bug.cgi?id=617471
2011-01-04 17:32:12 -05:00
Matthias Clasen
98440ad031 Remove gtktypeutils altogether
Based on patches by Javier Jardón.

https://bugzilla.gnome.org/show_bug.cgi?id=629955
2011-01-04 14:51:19 -05:00
Matthias Clasen
b5c6904c2f Drop explicit includes of gdkkeysyms.h
These are no longer needed. At the same time, port gtkimcontextsimpleseqs.h
to use the new GDK_KEY_ symbols.
2011-01-04 12:21:41 -05:00
Matthias Clasen
59ea137fa0 GtkTreeView: Don't use deprecated grab api 2010-12-26 23:40:59 -05:00
Matthias Clasen
bde1d072e5 Don't use gdk_{pointer,keyboard}_grab
Instead use gdk_device_grab.
2010-12-24 20:00:19 -05:00
Kristian Rietveld
31536736ea Hide GtkTreeViewColumn buttons when header_window is not visible 2010-12-23 18:19:56 +01:00
Javier Jardón
74a7bc3a77 gtk/gtktreeview.c: Use accessor to access GtkTreeSelection 2010-12-19 04:56:32 +00:00
Tristan Van Berkom
71e7cd0ec4 Merge branch 'master' into treeview-refactor
Conflicts:
	tests/testtreeedit.c
2010-12-17 15:25:15 +09:00
Kristian Rietveld
735fa8b197 Avoid recursion in do_validate_rows()
I have never really liked the updates done to the adjustments in
do_validate_rows() and other validation functions.  But it is really
required.  I have to come up with a real solution to this one day.
2010-12-16 23:33:42 +01:00
Javier Jardón
1cfd78269e gtk/gtktreeview.c: Use accessor functions to access GtkSelectionData 2010-12-15 23:58:15 +00:00
Kristian Rietveld
c8d130efa7 Revisit "Handle clicks in indentation area"
Check (x, y) is inside background area.  If yes, continue processing
and clamp the coordinates into cell area.  This way we will properly
handle getting a cell (which is only used for setting the focus cell)
for clicks in the indentation area (in LTR and RTL mode) and clicks
in the focus rectangle area in case focus-line-width is large.
2010-12-15 23:55:26 +01:00
Kristian Rietveld
8e98333d8b RTL fix for gtk_tree_view_focus_to_cursor() 2010-12-15 21:31:35 +01:00
Kristian Rietveld
92e145e719 No need to correct direction for rtl, GtkCellArea takes care of that 2010-12-15 21:27:40 +01:00
Tristan Van Berkom
2e1e97305f Make GtkTreeView explicitly focus the first cell in the first column when grabbing focus
When focus is initially grabbed and there is no focus column, when selecting
the first column for focus, further explicitly focus into the first cell
using gtk_cell_area_focus().
2010-12-12 17:21:28 +01:00
Tristan Van Berkom
31226ebfb2 Fixed GtkTreeView to give focus back to the last focued cell when hitting
the edge.

When focusing left/right or up/down inside GtkCellArea, now we save what
was the last focused cell and if we hit the side (or top or bottom) of
the view we then restore focus to the last focused cell.
2010-12-12 17:21:28 +01:00
Tristan Van Berkom
632f1f3ac4 Modified gtk_tree_view_move_cursor_up_down to move focus inside the cell area
This currently leaves us the problem of maintaining the right cell in
focus for horizontal areas, the solution for that comming in the
next patch.
2010-12-12 17:21:28 +01:00
Tristan Van Berkom
2752fd0f16 Removing gtk_tree_view_move_focus_column() and only calling gtk_cell_area_focus()
This function did alot of nothing, gtk_cell_area_focus() simply returns whether
the focus stays in the area (column) or not, seems not to cause regressions to
just call it directly instead.
2010-12-12 17:21:28 +01:00
Kristian Rietveld
ff39c76bfd Welcome _gtk_tree_view_column_get_cell_at_pos to the second dimension 2010-12-12 15:22:49 +01:00
Kristian Rietveld
cbfc3f5bf0 Make gtk_tree_view_get_cell_area() aware of row separators 2010-12-12 15:09:27 +01:00
Kristian Rietveld
d142d8bb6c Do not enforce a minimum of expander_size in gtk_tree_view_get_row_height
Instead this is now enforced in gtk_tree_view_get_cell_area_height().
There are rows for which a height in between 0 and expander_size is
allowed, for example separator rows.
2010-12-12 14:34:26 +01:00
Tristan Van Berkom
2f4e451075 Added "edit_only" argument to gtk_cell_area_activate()
This argument allows the caller to specify that only an editable
cell should start editing but an activatable cell should not toggle
it's state, this is important for public apis like
gtk_tree_view_set_cursor_on_cell() which are only intended to
programatically bring attention to the editing of a specific
row or cell but not actually change any data.

GtkTreeView & CellAreaScaffold updated for the last minute api change.
2010-12-12 17:15:46 +09:00
Matthias Clasen
83204928b9 Don't access GdkDragContext fields directly
Instead use the accessors.
2010-12-10 00:59:07 -05:00
Tristan Van Berkom
95ca1e241c Removed calculation of background area when about to edit a cell (no need to check the background area of the cell in this case). 2010-12-09 13:59:17 +09:00
Tristan Van Berkom
1b33698384 Revert "Temporary fix to make separator rows request enough space for the expander size."
This reverts commit 515af9ce70.
2010-12-07 14:09:26 +09:00
Tristan Van Berkom
515af9ce70 Temporary fix to make separator rows request enough space for the expander size.
This fix is incorrect, treeviews dont rely on the expander size for drawing
separator rows (added XXX comment in line), need to fix this somewhere else
2010-12-07 13:52:31 +09:00
Tristan Van Berkom
97e060b094 Fixed my mistake in validate_row (), now the height of treeviews in GtkEntryCompletion is correct again. 2010-12-07 13:52:18 +09:00
Tristan Van Berkom
bf1aa2ad87 Changed GtkTreeViewColumn->requested_width to ->padding
Now we bookkeep the treeview assigned padding asides from the
requested width stored in the GtkCellAreaContext, this removes
the need for bookkeeping the deepest expanded depth in gtktreeview.c

At allocation time, just remove the padding from the allocated width
of the column and feed the rest to the underlying cell area.
2010-12-06 16:31:07 +09:00
Kristian Rietveld
d28cbd6e6d Bring back _gtk_tree_view_column_get_cell_at_pos
The function has been re-implemented around GtkCellArea.  This commits
also brings back the invocation of this function in
gtk_tree_view_button_press().  I shouldn't have removed this.
2010-12-05 18:18:36 +01:00
Kristian Rietveld
2a6550176c Replace FIRST_PIXEL macros with something that's more clear 2010-12-05 18:04:07 +01:00
Kristian Rietveld
7fe950a745 Clean up and clarify row height calculations 2010-12-05 17:56:30 +01:00
Kristian Rietveld
924359c31d Clean up _gtk_tree_view_column_cell_event 2010-12-05 17:12:37 +01:00
Kristian Rietveld
6c73647727 Remove the need for _gtk_tree_view_column_get_focus_area 2010-12-05 17:10:21 +01:00
Kristian Rietveld
77d972e436 Remove private accessor for focus column 2010-12-05 15:20:17 +01:00
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