Commit Graph

29535 Commits

Author SHA1 Message Date
Benjamin Otte
a890a61253 treeview: Add _gtk_rbtree_node_get_index()
.. as a replacement for _gtk_rbtree_node_find_parity(). Instead of 1 or
0, the function now returns the index of node in the complete tree
(counting from the root). And this is of course identical to the row
number.
2011-11-16 04:39:24 +01:00
Benjamin Otte
b8dec90f3a a11y: Compute index the easy way
index is row_index * n_columns + column_index

We use it everywhere, why not here?
2011-11-16 04:39:24 +01:00
Benjamin Otte
acc5627e39 a11y: Redo indexing
We now index rows by actual expanded row number and don't count them
ourselves no more.
2011-11-16 04:39:24 +01:00
Benjamin Otte
92a2284bb2 tests: Ensure the treeview is expanded
Otherwise the test code might ignore collapsed rows, which makes it go
rather fast.
2011-11-16 04:39:23 +01:00
Benjamin Otte
e927a5b2c7 treeview: Redo row tracking
Track the RBNode/RBTree instead of keeping a TreeRowReference. This is a
whole lot faster and less error-prone.

Also, notify the accessible of removal of rows before actually removing
them, so we have a chance to clean up.
2011-11-16 04:39:23 +01:00
Benjamin Otte
0b716e77ea widget: Add _gtk_widget_peek_accessible()
This function returns the accessible if it already exists. This way we
can call functions on the accessible from the widget itself instead of
having to rely on signals.
2011-11-16 04:39:23 +01:00
Benjamin Otte
24e4a03af2 a11y: Remove needless checks
The cell_row_ref and cell_col_ref variables are always non-NULL, so
there's no need to check it.
2011-11-16 04:39:23 +01:00
Benjamin Otte
918a9d0e3a a11y: Add a cell_info_get_path() function
Reads better and we only need to change it in one place.
2011-11-16 04:39:23 +01:00
Benjamin Otte
5096df14c3 treeview: Remove unnecessary variable
tmptree has the same value as tree everywhere, so just use tree instead.
2011-11-16 04:39:23 +01:00
Benjamin Otte
9f91405d6c a11y: Mark object as defunct in destroy notify
Instead of requiring a special functio to be called before just removing
from the hash table. This simplifies code a lot that used to remove from
the hash table.
2011-11-16 04:39:23 +01:00
Benjamin Otte
bd1bc88ed2 a11y: Remove in_use member
After the latest changes, it is now always TRUE, so adjust the code
accordingly.
2011-11-16 04:39:23 +01:00
Benjamin Otte
40b7e3044e a11y: Don't garbage collect anymore
Instead, remove cell infos immediately from the hash table.
2011-11-16 04:39:23 +01:00
Benjamin Otte
64b825b87b a11y: Improve cell_infos table
- Name it properly
- Make it just a set of cell_infos

Currently it's using direct hash, but as long as we don't actually
lookup stuff from it, who cares...
2011-11-16 04:39:23 +01:00
Benjamin Otte
71011f3e1e a11y: Implement find_cell_info() using qdata lookup
That should be orders of magnitude faster then iterating over a hash
table.
2011-11-16 04:39:23 +01:00
Benjamin Otte
331a4c92b0 a11y: Store the cellinfo in the cell's qdata 2011-11-16 04:39:22 +01:00
Benjamin Otte
d265636526 a11y: Remove index from cellaccessible
That way we also get rid of the refresh_index function.
2011-11-16 04:39:22 +01:00
Benjamin Otte
f05d3f66b1 a11y: Don't use the cell's index anymore
We implement get_cell_index() now, so it's no longer necessary.
As a side effect, we need a different index for our hash table (which
now has a wrong name, but that will soon change).
2011-11-16 04:39:22 +01:00
Benjamin Otte
35b667a409 a11y: Implement get_child_index in treeview 2011-11-16 04:39:22 +01:00
Benjamin Otte
d5b52ae3b1 a11y: Implement get_child_index in treeviewaccessible 2011-11-16 04:39:22 +01:00
Benjamin Otte
b526375e8f gtk: Fix compiler warnings from include fixes 2011-11-16 04:31:06 +01:00
Benjamin Otte
a9dd3e559a a11y: Make the cache lookup function inefficient
Ahem.

This is in preparation for future changes and is not meant to stay this
way. But I want to change the hash table's keys and this is way easier
when nobody is using them.
2011-11-16 04:31:06 +01:00
Benjamin Otte
ac29108586 a11y: Change function declaration
Returning an int seems way easier than having an int out argument to a
void function. Also, it doesn't lead to uninitialized memory, what a
concept!
2011-11-16 04:31:06 +01:00
Benjamin Otte
533ee181de a11y: Add a special-case for cell index querying
I could have tried to make GtkContainerCellAccessible implement
GtkCellAccessibleParent, but the current implementation of that
interface doesn't make sense for it.
2011-11-16 04:31:06 +01:00
Benjamin Otte
02fd1e5a62 a11y: Add _gtk_cell_accessible_parent_get_child_index()
This will soon replace the shenanigans we do to keep the index of cells
current.
2011-11-16 04:31:06 +01:00
Benjamin Otte
2bd69cbf8c a11y: Remove idle handler for focus notifications 2011-11-16 04:31:06 +01:00
Benjamin Otte
0c2f454b41 a11y: Re-implement gtk_tree_view_accessible_get_n_rows()
... using the new _gtk_rbtree_find_index().
2011-11-16 04:31:06 +01:00
Benjamin Otte
635e53433d treeview: Add _gtk_rbtree_find_index()
Uses the parity to do an O(log N) search for the nth element in the
tree in display order of the treeview.
2011-11-16 04:31:06 +01:00
Benjamin Otte
59097ecef4 treeview: Rename "parity" to "total_count"
Now that we use it to actually count the rows instead of just even/odd,
it's better to reflect that in the variable name.
2011-11-16 04:31:06 +01:00
Benjamin Otte
320df163a2 treeview: Make the parity actually store the row number
Instead of just storing the least significant bit of the row number,
store the full row number. This will soon be useful for accessibility.
But CSS could like it, too.
2011-11-16 04:31:06 +01:00
Benjamin Otte
c8e2cd27e9 treeview: Remove special cases when computing parity
The parity of the nil npode is always 0, so no need to check for the nil
node first.
2011-11-16 04:31:06 +01:00
Benjamin Otte
1a241f2348 treeview: Only compute parity once when rendering
This shouldn't affect performance too much, but it I just found it so I
fixed it.
2011-11-16 04:31:05 +01:00
Stef Walter
5b6f0b9893 GtkSpinButton: Clarify clamping behavior in gtk_spin_button_set_range doc
* If the current value is outside the range, it will be adjusted
   to fit within the range, otherwise it will remain unchanged.

https://bugzilla.gnome.org/show_bug.cgi?id=664021
2011-11-15 07:47:35 +01:00
Matthias Clasen
9ad67a3186 Avoid double inclusion of a migration chapter 2011-11-15 00:47:16 -05:00
Matthias Clasen
4904a2f45b GtkTextViewAccessible: Respect display lines
This special tweak was lost when porting from GailTextUtil.

https://bugzilla.gnome.org/show_bug.cgi?id=663994
2011-11-15 00:25:18 -05:00
Martin Pitt
76cd14410c Fix GDK linking for Gtk typelib and example builds
Add missing GDK linking to GIR build and examples:

  GISCAN Gtk-3.0.gir
  CCLD   gtk-query-immodules-3.0
./.libs/libgtk-3.so: undefined reference to `gdk_keymap_get_modifier_mask'
./.libs/libgtk-3.so: undefined reference to `gdk_modifier_intent_get_type'
./.libs/libgtk-3.so: undefined reference to `gdk_window_begin_resize_drag_for_device'
./.libs/libgtk-3.so: undefined reference to `gdk_event_triggers_context_menu'
collect2: ld returned 1 exit status

  CCLD   grid-packing
../gtk/.libs/libgtk-3.so: undefined reference to `gdk_keymap_get_modifier_mask'
[...]

https://bugzilla.gnome.org/show_bug.cgi?id=664027
2011-11-15 06:18:18 +01:00
Yuri Kozlov
90e171e6f9 Fixed Russian translation 2011-11-14 23:50:52 +04:00
Matthias Clasen
005451e3f3 GtkComboBoxAccessible: Make keybindings work
https://bugzilla.gnome.org/show_bug.cgi?id=659151
2011-11-14 09:26:15 -05:00
Matthias Clasen
2777078e21 Add combobox a11y tests 2011-11-14 09:26:15 -05:00
Matthias Clasen
a6cb6c6d39 Add some keybindings to the a11y entries test 2011-11-14 09:26:15 -05:00
Martin Pitt
1c222372d9 Fix gtk_tree_view_get_tooltip_context() transfer annotation
The default (out) transfer mode is "full", but the passed "model" pointer gets
set to gtk_tree_view_get_model() which is "transfer none". This caused Python
programs to free the model after calling this, causing crashes.
2011-11-14 14:33:51 +01:00
Matthias Clasen
6ae78c3cf1 Add a link to the Windows port wiki page 2011-11-14 08:01:23 -05:00
C. Scott Ananian
981efc90b4 Fix uninitialized digest_len field, causing WebSocket handshake to g_assert.
g_checksum_get_digest checks to ensure that the passed digest_len is long
enough to hold the digest, before setting it to the actual length of the
digest returned.  Digest_len is uninitialized in the code, so if you're
lucky it will be larger than 20 and everything will work fine.  If you're
unlucky, g_checksum_get_digest will return either -1 or some number less
than 20, and the g_assert(digest_len==20) will fail.
2011-11-14 09:55:19 +01:00
Michael Natterer
e19cbd7a04 quartz: fix a race condition when waking up the CGRunLoop
Wake up the run loop unconditionally (don't check if it is waiting) because
it might go into waiting state right after we checked for it. Fixes GIMP
startup (which has a lot of GIOChannel I/O but zero NSEvents) from several
minutes to a few seconds.
(cherry picked from commit 0729cdc9a1)
2011-11-11 23:58:43 +01:00
Matthias Clasen
242b1f12f8 GtkProgressbar: respect the range of 'fraction'
The setter should not set the property to values outside the allowed
range.

https://bugzilla.gnome.org/show_bug.cgi?id=663825
2011-11-11 10:36:09 -05:00
Rico Tzschichholz
4a43c062ac Fix some implicit declaration warnings
There were some includes of gtkmain.h missing
2011-11-11 13:06:56 +01:00
Alexander Larsson
a2b879fe53 win32: Make grab cursors work again 2011-11-10 21:32:50 +01:00
Alexander Larsson
2f14732b1d win32: Fix gdk_win32_window_translate
We now do proper handling of existing invalid regions, and
we use ScrollDC which allows us to specify the right clip
region rather than just the bounding rect.
2011-11-10 17:41:13 +01:00
Dieter Verfaillie
68d28aad97 win32: fix pasting screenshots taken with PrintScreen or Alt+PrintScreen
These are found on the clipboard in the biCompression == BI_BITFIELDS &&
biBitCount >= 16 format. In this case the BITMAPINFOHEADER is followed
by three DWORD specifying the masks of the red green and blue components,
but bfOffBits was not being adjusted accordingly.

Based on Massimo's comment on bug 631384 and verified on
http://msdn.microsoft.com/en-us/library/dd183386%28v=VS.85%29.aspx

https://bugzilla.gnome.org/show_bug.cgi?id=631384
2011-11-10 17:41:12 +01:00
Dieter Verfaillie
4e10d9604b win32: fix some typos 2011-11-10 17:41:12 +01:00
Alexander Larsson
52be8cb9e9 win32: Fix some warnings 2011-11-10 17:41:11 +01:00