From the css docs at http://www.w3.org/TR/CSS2/box.html:
8.5.1 Border width: 'border-top-width', 'border-right-width', 'border-bottom-width',
'border-left-width', and 'border-width'
Computed value: absolute length; '0' if the border style is 'none' or 'hidden'
This is a private type, and the CSS default value is "stretch", which
is how we were parsing and printing NONE anyway.
With this fix we can use the enum stuff for printing/parsing
Various tiny semantic changes in here.
The big fix is that we consider every cell as visible and as showing if
the treeview is mapped.
This was also fixed in the tree dump test.
Also, *do* add the file to the recently-used list, even if the file does not
exist yet. This is used from the Save dialog, so even shitty apps which don't
add the file to GtkRecentManager, will get the file added from the Save dialog.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
_gtk_rbtree_reorder() was moving the node's data while reordering. As we
use the node pointer in the a11y code as a hash key, this didn't work.
So this rewrite changes that. As a bonus, it is less code and faster.
Woohoo!
- Make sure the rotated nodes aren't nil
- Use existing functions for complex computations
- Don't use NULL checks for variables guaranteed to not be NULL/nil
This has one major caveat: The new value is const, so read-only memory.
Any attempt to write to it will cause a crash. Note that we are not ever
supposed to write to it, but bugs happen...
The code used to set nil->parent, which could cause segfaults. Don't do
that. We also need to pass the parent explicitly to the fixup code,
because the node during fixup may be the nil node.
So instead of copying the children and height to the new node, we keep
the old node and copy all the old stuff to it.
This is necessary so the accessibility code can use the node as a key in
the hash table or store the node as a reference to the row instead of
GtkTreeRowReference. And because it already does that (oops), this fixes
a bunch of segfaults with a11y enabled.
gtk_rbtree_adjust() will adjust the summed values of a node and all its
parents in the tree. Currently only implemented by splitting out the
function from gtk_rbtree_free().
Instead of taking the first page and trying to adjust the rect with
random padding values, take the current page, as it's always guaranteed
to be at least as tall as inactive tabs.
This fixes some annoying 1px drawing artifacts while switching tabs when
the theme disables notebook padding.
https://bugzilla.gnome.org/show_bug.cgi?id=664494
Similar to GtkNotebook, GtkFrame was only allocating space for the
padding width, and not the border.
This could be seen by just running tests/testframe. With a theme that
renders frame borders, setting xthickness = 0 in the test draws the
button border over the frame border, which is wrong.
https://bugzilla.gnome.org/show_bug.cgi?id=664342
Turned assertion into silent return.
This assertion is only hit when dragging from an empty tree view. In
this case, gtk_tree_view_begin_drag() is triggered from gtkdnd.c and not
from gtk_tree_view_maybe_begin_dragging_row(). We actually want to
cancel the drag at this point, but that is not possible with the GTK+
API as far as I can see.
The alternative is to not allowing the drag to start. This could be
done by simply unsetting the tree view as drag source when it is empty
and setting it as drag source again when rows are added. I didn't
choose to go with this for now, since this will likely break third party
code.
There was some regressions from the recent display line fix;
while fixing it improve the test coverage and make GtkEntry
and GtkTextView return identical results.
gdk_cairo_region_create_from_surface doesn't work correctly on PPC.
This is most prominently seen with the GTK window resize grip, the
shape of which is mirrored every eight pixels horizontally.
At the same time, use an A1 surface for the resize grip shape to
eliminates an A8->A1 surface conversion.
Add GDK_MODIFIER_INTENT_SHIFT_GROUP to enum GdkModifierIntent
and handle it in gdk_keymap_get_modifier_mask(). Add an X11
impl of the method and return keymap_x11->group_switch_mask.
Return 0 from the default impl because we don't know.
If the keyboard group shifting modifier is *also* a normal
accelerator modifier, we need to special case it when calling
gdk_keymap_translate_keyboard_state(), so we get the right
key symbol for accelerators (for example we want Option-O,
not Option-Ø displayed in menu items). This patch should only
affect quartz where the Alt key both shifts the group and can
be used as accel modifier, and not X11 or Win32 where AltGr
is not used for accelerators.
- fix quartz' gdk_keymap_translate_keyboard_state() to return
the right consumed_modifiers
- add _gtk_translate_keyboard_accel_state() which does the
special casing
- use it everywhere instead of gdk_keymap_translate_keyboard_state()
The default theme engine draws a fallback check/radio image, but
doesn't let you replace this. We now check if a background image
is set and if so render that instead of the default fallbacks.
We now support -gtk-win32-theme-part(class,part,state) in background
and border-image CSS properties. This renders the corresponding
theme part using DrawThemeBackground() and acts as a base for a
CSS based windows theme.
Note that we build the parsing code even on non-win32 so that
all themese will parse the same on all arches. We draw pink instead
of the actual theme parts on non-win32 though.
We want to move to a world where getting style properties can
allocate a new value, depending on the style property context.
In this world we can't expose "peeking" a property, as we neet
to return a ref to the property that is newly created.
So, we move the peek code into get_property and use get_property
from get_valist.
At the toplevel we have _gtk_theming_engine_get, which lets us pass
in a property context with (atm) the size to get the property for.
Then there is a lot of plumbing to push this down into the lower
layers of the style property code until finally hitting
the property resolvers.
I need this because I will be adding a property resolver for win32
theme parts, and they render differently depending on the size
(i.e. they don't scale linearly). The idea is that the code
to get the background properties will pass in the final size
and we will resolve the theme part specification to that particular
size.
If the old non-context calls are used we just hardcode a size
of 100x100.
We used to special handle gradient, but we want to be able to store
other sources (that will eventually resolve to cairo patterns).
For instance, this is needed to handle win32 theme part sources.
In gtk_tree_view_state_flags_changed() we were setting the background on
the bin_window without the necessary "view" style class, making the
treeview render with the wrong color in some circumstances (such as when
adding an empty treeview in a window, as spotted by Brian Smith).
We used to explicitly map and unmap the child GtkRecentChooserWidget when
mapping and unmapping the dialog, respectively. Now that GtkContainer actually
unmaps child widgets (instead of avoiding that), we can assume that the
child GtkRecentChooserWidget will be unmapped when we want it to be.
This fixes a warning from gtk_widget_verify_invariants(), as we were mapping
our child widget before calling our parent class' ::map() handler. Bug #659257.
Try to find keycodes for keysyms at level-0 in the keymap, but don't
fail to parse if we can find those in level-1. This fixes the
parsing of numerical keys on the keypad, which require a shift level
through Num-Lock.
https://bugzilla.gnome.org/show_bug.cgi?id=606727
This way, the a11y code knows if a column was reordered, added or
removed and can do the right things instead of trying to guess and
getting it wrong.
Also, this patch finalizes the changes so that only visible columns
exist to the accessibility interface.
In fact, invent our own function get_n_columns() which actually only
counts the visible functions, because that's the only ones we care
about.
The places where it's not used yet will be changed in the coming
patches.
.. 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.
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.
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.
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.
- 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...
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).
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.
I could have tried to make GtkContainerCellAccessible implement
GtkCellAccessibleParent, but the current implementation of that
interface doesn't make sense for it.
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.
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
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.
This way, we can include them without accidentally including deprecated
code. Which means we can still use the recently added turning-off tricks
for deprecation warnings.
Move the remaining struct definition into gtkimcontextinfo.h and include
that header in gtk.h. gtkimmodule.h is now an empty header. We should
probably deprecate it somehow.
This is also necessary so headers used in gtk .c files don't include
gtk.h which in turn includes all the deprecated headers which we want to
avoid so we can include them with deprecation warnings turned off.
Make includes not rely on gtkimmodule.h including gtk.h. This will be
important once we remove gtkimmodule from the include files.
That way, we can achieve not pulling deprecated headers automatically.
By default, a background image is stretched. Instead, it is worth to
have a tiled background.
This patch allows background surfaces to be repeated or not, and should
be compatible with future extensions and CSS.
https://bugzilla.gnome.org/show_bug.cgi?id=663522
If a zero-sized NSImage calls lockfocus it throws an exception. Make sure that the image isn't zero-sized before calling lockfocus, and log a warning and return NULL if it is zero-sized.
Have the quartz version of gtk_drag_begin_idle return FALSE if the returned image is NULL.
If _gtk_quartz_create_image_from_pixbuf is given a pixbuf with size 0, 0
or which produces an NSImage with size 0.0, 0.0, it throws an exception
which Gtk doesn't handle.
your changes. Lines starting
Since constructors like gtk_radio_button_new_from_widget take an
instance of their type as the first argument, the gi scanner interprets
them as methods.
https://bugzilla.gnome.org/show_bug.cgi?id=661858
Submenus are not actually attached to a menubar, but styling them
as if they were imposes some problems (at least with Adwaita).
Just using GDK_WINDOW_TYPE_HINT_POPUP_MENU for submenus instead
fixes the issue.
https://bugzilla.gnome.org/show_bug.cgi?id=662691
When multiple pointers are in play, we need to be careful
not to loose track of the device between receiving a button
press and popping up a menu.
https://bugzilla.gnome.org/show_bug.cgi?id=663396
We have an event, so the correct thing to do is to pass
the device into the function that we are calling. GDK
just grew a variant that takes a device, for this purpose.
https://bugzilla.gnome.org/show_bug.cgi?id=663444
Which handle accelerators with keycodes as well as keyvals,
so we can use it in applications that use GtkCellRendererAccel's
"Other" mode of operations (namely gnome-control-center and
gnome-settings-daemon).
https://bugzilla.gnome.org/show_bug.cgi?id=662755
I was trying to avoid including gtk.h here, but this breaks
some of our tests, and there's a good chance that 3rd party
code also relies on this include.