Commit Graph

71 Commits

Author SHA1 Message Date
Carlos Garnacho
41d6837fa2 Make GtkCellArea use GtkStyleContext
gtk_cell_area_[gs]et_style_detail() is no longer needed, as
the passed widget's context would already have all necessary
info.
2011-01-27 19:32:07 +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
2fb1c06402 [GI] Add missing (out) and (array) annotations 2011-01-20 13:57:20 +01:00
Pavel Holejsovsky
2f0d40335b [GI] Add missing (transfer) annotations 2011-01-20 13:57:18 +01:00
Pavel Holejsovsky
9b88eb356d [GI] Add missing (scope) annotations 2011-01-20 13:57:15 +01:00
Tristan Van Berkom
4a5c435e9a Plugging memory leak in GtkCellArea (free ->style_detail at finalize time). 2011-01-16 18:15:57 +09:00
Guillaume Desmottes
aa1f58b731 _gtk_cell_area_set_cell_data_func_with_proxy: set the proxy when creating a new CellInfo (#637965) 2011-01-12 14:33:27 +01:00
Tristan Van Berkom
34a7dbae3b Fixed GtkCellArea to never activate/start editing insensitive cells.
Included extension to tests/testtreeedit to show this is working properly.
2011-01-10 17:58:57 +09:00
Tristan Van Berkom
685fe29473 Fixed documentation of gtk_cell_area_set_focus_cell(). 2011-01-07 16:21:51 +09:00
Matthias Clasen
aead0b04df Forgotten documentation fix 2011-01-06 11:27:38 -05:00
Matthias Clasen
6cdb6255af More documentation fixes 2011-01-06 09:44:08 -05:00
Milan Bouchet-Valat
ebe9d075f4 Fix GtkCellArea:edit-widget to be of type GtkCellEditable
More correct, and consistent with gtk_cell_area_get_editable_widget().
2011-01-05 16:45:51 +01:00
Matthias Clasen
680b64d04a Fix some parameter name mismatches in the docs 2011-01-05 10:04:48 -05:00
Tristan Van Berkom
c8ae68c33d Fixed gtk_cell_layout_set_cell_data_func() to pass the correct layout object
Added _gtk_cell_area_set_cell_data_func_with_proxy() to be called by
gtk_cell_layout_set_cell_data_func() when the layouting object itself
is not the underlying cell area.
2010-12-22 00:28:18 +09:00
Matthias Clasen
a2dda0c2bb Trivial changes
Whitespace fixes, comment formatting, etc
2010-12-17 19:14:35 -05:00
Matthias Clasen
8bc4e13c22 No links in title, please 2010-12-17 18:41:24 -05:00
Kristian Rietveld
88f8859f90 Should pass inner_area to cell in gtk_cell_area_activate_cell() 2010-12-16 22:42:10 +01:00
Kristian Rietveld
e3cab18354 Clip focus rectangle to background area 2010-12-16 12:33:00 +01:00
Kristian Rietveld
be39883de2 Correct calculation of the cell focus rectangle
The cell's focus rectangle is located around the cell's aligned area.
To get to the correct coordinates for this rectangle, we have to subtract
focus_line_width from the found aligned_area.
2010-12-15 21:17:27 +01:00
Tristan Van Berkom
8ca6bbbfc0 Make GtkCellArea independantly GtkBuildable.
Simply use the GtkCellLayoutIface hooks for this.
2010-12-14 15:52:40 +09:00
Tristan Van Berkom
0431dd67f8 Added apis to GtkCellArea for GtkIconView purposes.
Added a few apis,

  - GtkCellAreaContext get_preferred_height_for_width &
    width for height apis and vfuncs, this lets the icon view
    request the collective (and aligned) height for width for
    a said row.

  - gtk_cell_area_copy_context() this creates a duplicate of
    an already created and requested context, this way the icon
    view uses a global context to request the widths of all rows
    and then makes a copy with all the stored alignments and
    uses a separate copy to calculate the height and alignments
    of each row separately.
2010-12-13 00:29:21 +09: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
Tristan Van Berkom
32d9396f00 Changed misleading variable name in gtk_cell_area_real_activate. 2010-12-09 13:59:04 +09:00
Tristan Van Berkom
f1c26dfdb2 Fixed gtk-docs typo in gtkcellarea.c 2010-12-08 22:31:33 +09:00
Tristan Van Berkom
40e9f91f43 Fixed foreach_alloc call from gtk_cell_area_real_render to pass the real background area. 2010-12-08 21:27:52 +09:00
Tristan Van Berkom
34f4b5c190 Added 'background_area' calculation to GtkCellAreaClass->foreach_alloc vfunc
This allows us to reduce code allocation code paths in subclasses, as
a result GtkCellArea implements the ->render() vfunc and the subclass
only decides the cell area and background area distributions in a single
code path.
2010-12-08 21:18:05 +09:00
Tristan Van Berkom
f08f1f92aa Fixed some nit-picking bugs in GtkCellArea
- Dont try fetching a cell renderer for an event when the event
    coordinate is outside the cell area allocation (can happen
    on the y axis, not all events are button events).
  - Dont remove focus-line-width (inner area) an extra time from
    GtkCellArea->event
  - Dont remove focus-line-width from the cell area at all for the
    editable widget... use the whole area including the focus line
    (compared with git master behaviour and now it looks right, check
    the multiline editable string in testtreeedit).
2010-12-06 17:27:03 +09:00
Tristan Van Berkom
2588165bfb Added gtk_cell_area_foreach_alloc() to further simplify GtkCellArea subclasses
gtk_cell_area_foreach_alloc() itterates over an allocated list of cells
and calls a callback with the cell's allocation until the callback returns
TRUE.
  - Removed vfunc get_cell_allocation() and implemented
    gtk_cell_area_get_cell_allocation() using foreach_alloc()
  - Added gtk_cell_area_get_cell_at_position() using foreach_alloc()
  - Removed GtkCellAreaBox ->event() implementation and implemented
    mouse "click" cell activation in GtkCellArea class directly using
    gtk_cell_area_get_cell_at_position().
2010-12-06 14:11:28 +09:00
Tristan Van Berkom
4b065f5389 Changed gtk_cell_area_forall to gtk_cell_area_foreach since thats more widely used semantics.
Also gave a boolean return value to the callback to allow breaking out of the loop.
2010-12-06 12:41:38 +09:00
Tristan Van Berkom
f24c21f1f0 Added proper handling of right to left layouting of cells to GtkCellAreaBox. 2010-12-05 15:24:19 +09:00
Tristan Van Berkom
bbee4de33d Fixed typo in GtkCellArea docs. 2010-12-04 20:54:36 +09:00
Tristan Van Berkom
7e2571a358 Added "Cell Properties" section to the GtkCellArea documentation. 2010-12-04 15:02:53 +09:00
Tristan Van Berkom
4c165de31f Added gtk-doc to GtkCellArea & GtkCellAreaContext. 2010-12-03 16:29:11 +09:00
Tristan Van Berkom
a7ad110fe9 Adding more documentation to GtkCellArea, documented GtkCellAreaClass structure. 2010-12-03 00:29:22 +09:00
Tristan Van Berkom
a852deeb03 Fixed GtkCellArea to always activate a cell at gtk_cell_area_activate() time even if no cells have focus. 2010-12-01 16:22:18 +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
Tristan Van Berkom
87892261e0 Make editable widget fill the entire inner area of the edited cell
instead of just the aligned focus area to match previous behaviour
2010-11-29 16:03:53 +09:00
Tristan Van Berkom
2394f5e49b Touching up GtkCellArea docs. 2010-11-29 11:02:29 +09:00
Tristan Van Berkom
9ee9081405 Added initial detailed docs for GtkCellArea. 2010-11-29 10:55:50 +09:00
Tristan Van Berkom
2dd2c7ce05 Added gtk_cell_renderer_get_aligned_area() and class vfunc.
Since a cell renderer might use more space than the natural
size when recieving expand space it's impossible to know how
much space is actually used to render content.

Adding this virtual method to allow text renderers to implement
it, the base default method uses height-for-width apis and aligns
the cell assuming the renderer uses a fixed size.

This commit removes the similar code from gtkcellarea and
subclasses.
2010-11-25 17:41:26 +09:00
Tristan Van Berkom
e53dc3479f Added GtkCellAreaClass->apply_attributes()
Made gtk_cell_area_apply_attributes use a vfunc & signal so that
subclasses might do specialized things picking up attributes from the
model possibly for embedding widgets, and as specially for GtkTreeMenu
to connect to the signal and synchronize the menu sensitivity states
in a more convenient way than going through the GtkCellLayoutDataFunc.
2010-11-23 23:37:58 +09:00
Tristan Van Berkom
d56babefb4 Removed cell margin apis and now deal with "focus-line-width". 2010-11-23 16:26:46 +09:00
Tristan Van Berkom
4ceb25e011 More documentation in gtkcellarea.c 2010-11-15 11:23:55 +09:00
Tristan Van Berkom
92dc7f31d4 Cleaned up cell editing api in GtkCellArea
Now layouting widgets need only concern themselves with
the "add-editable" and "remove-editable" signals, also added
lots of gtk-doc comments.
2010-11-14 23:33:26 +09:00
Tristan Van Berkom
1bca6349fb Mass rename GtkCellAreaIter --> GtkCellAreaContext 2010-11-13 16:23:01 +09:00
Tristan Van Berkom
51b75ef44b Added tests to reflect proper treatment of background area.
CellAreaScaffold now also reflects how cell_area should be
passed to gtk_cell_area_activate() and gtk_cell_area_event()
and how the background area for gtk_cell_area_renderer() should
be created.
2010-11-12 21:55:28 +09:00
Tristan Van Berkom
38666b406f Ironed out the kinks in editing apis for GtkCellArea
- Added gtk_cell_area_aligned_cell_area() to get the aligned
   internal area use by a cell (for focus painting and for
   event areas).

 - Provide the event area in "editing-started" signal

 - Fire "remove-editable" when editing is canceled by the user,
   an implementing layouting widget need only catch "editing-started"
   and "remove-editable" now.

 - CellAreaScaffold/testcellarea now edit textrenderers.
2010-11-12 19:25:07 +09:00
Tristan Van Berkom
7e821aa980 Distribute portions of GtkCellArea:render() background_area argument to cells
Also added gtk_cell_area_get/set_style_detail() to set the string to be
used by the area in gtk_paint_* functions.
2010-11-12 14:06:00 +09:00
Tristan Van Berkom
33db66e728 Added event handling to GtkCellAreaBox
Now GtkCellAreaBox handles the click event to activate renderers
and checks if the area is in a sibling of a focus renderer, possibly
activating the proper focus sibling renderer.

Also GtkCellArea gains a "focus-changed" signal to allow it to
change the currently focused row according to the button events.
2010-11-11 18:13:54 +09:00
Tristan Van Berkom
f330b40521 GtkCellArea now paints focus on cells
Added concept of "Focus Siblings" to GtkCellArea so that some
static text/icon may be included in the focus/click area of
an activatable or editable cell, implemented focus drawing
as well, updated testcellarea to reflect the changes.
2010-11-11 16:13:06 +09:00