Compare commits

..

665 Commits

Author SHA1 Message Date
Alexander Larsson
90bcb52293 css: Add debug output for the css rules tree 2012-11-23 16:15:29 +01:00
Alexander Larsson
3b48e562dd css: Make gtk_css_style_provider_get_change use the new rules tree 2012-11-23 16:13:27 +01:00
Alexander Larsson
fc12246758 css: Make gtk_css_style_provider_lookup use the new rule tree 2012-11-23 16:13:26 +01:00
Alexander Larsson
ae194d14d1 css: Calculate tree for faster ruleset matching
When matching a widget against the set of rules we currently iterate
over *all* rules in the theme, trying to match them until we fullfill
our needs. This takes a pretty long time since themes have a lot of rules.

This is the first step towards making this faster. Every time the
ruleset changes we pre-calculate a decision tree where the nodes are either
list of rules to match against, or checks, such that if the check fails
we can ignore a whole subset of the tree.

The tree is built up in two levels, first we check if certain states must
be set, ignoring whole branches if not. Then in the level below we look
for css classes which are used by many rules.

At the leaf nodes we store references to the full list rulesets. These are
stored as array offset, which are sorted in index order, which means css prio
order, as the rulesets are sorted by that.

With this in place we can quickly prune large parts of the tree and then
merge the non-pruned result into a much smaller list of rules that we
need to do full checking on.
2012-11-23 16:13:21 +01:00
Alexander Larsson
c55a492ad3 css: Add some methods for getting selector state
This adds the following private methods:
_gtk_css_selector_get_primary_state_flags
_gtk_css_selector_get_primary_classes
_gtk_css_selector_has_primary_class

They get state and classes for the primary selector (i.e. the rightmost
simple selector). This will be used for some css optimizations.
2012-11-23 15:53:49 +01:00
Alexander Larsson
b70d8c477d CSS: Join multiple adjacent pseudoclass selectors
Its pretty common to have a selector like :selected:active where
two or more state flags appear in a row. Right now we save
these as multiple GtkCssSelectors, but as state is a bitfield we
can easily join them. We do this in the simple case where the
state matchers are directly adjacent by just piggybacking on
a previous pseudoclass if there is one.
2012-11-23 09:42:10 +01:00
David King
73c436f43e docs: Fix typo in gtk_tree_view_set_tooltip_column comment
https://bugzilla.gnome.org/show_bug.cgi?id=688884
2012-11-22 22:25:51 +00:00
David King
c627b22126 docs: Improve GtkTreeModel iteration pattern
Iterating over the model in this way means that use of continue is less
error-prone, as the increment is part of the loop construct.

https://bugzilla.gnome.org/show_bug.cgi?id=548793
2012-11-22 21:36:46 +00:00
David King
e677cee28f docs: Correct GtkWidget::scroll-event mask documentation
Since GTK+ 3.3.18, GDK_SCROLL_MASK has been used as the mask for scroll
events. Update the documentation to reflect this.

https://bugzilla.gnome.org/show_bug.cgi?id=677339
2012-11-22 21:36:40 +00:00
Martin Pitt
2927383b5f aboutdialog: Fix add_credit_section() annotations
The people argument is an array.

https://mail.gnome.org/archives/python-hackers-list/2012-November/msg00010.html
2012-11-22 14:51:52 +01:00
Michael Natterer
2d9454363f gtk: don't let insensitive children eat scroll events when bubbling down
When event capturing is enabled, stop propagating scroll events
at insensitive widgets, but don't handle them (don't return TRUE),
so they can bubble up again and reach their handling widgets.
2012-11-22 13:53:33 +01:00
Wouter Bolsterlee
eb7bf0a2f4 Updated Dutch translation 2012-11-22 12:04:31 +01:00
Camillo Lugaresi
4f6e1fdf16 Bug 688710 - splashscreen shouldn't be always on top on OS X
Activate the "hides on deactivate" behavior for splashscreens,
torn-off menus, utility windows, tooltips and notifications: when
another application is brought to the front, these windows are hidden
so as not to obscure it. This is the expected behavior for
application-specific floating windows on OS X.
(cherry picked from commit 0596f5591f)
2012-11-20 22:03:40 +01:00
Cosimo Cecchi
ddceddaa84 tree-view: don't use gtk_style_context_set_background()
Render a background with gtk_render_background() in draw() instead.
Note that we still use gtk_style_context_set_background() for the header
window.

https://bugzilla.gnome.org/show_bug.cgi?id=688744
2012-11-20 13:41:39 -05:00
Cosimo Cecchi
da09447914 iconview: don't use gtk_style_context_set_background()
Render a background with gtk_render_background() during draw instead.

https://bugzilla.gnome.org/show_bug.cgi?id=688744
2012-11-20 13:41:39 -05:00
Michael Natterer
d0af25f12c quartz: fix the mapping of GDK_KP_Enter in known_numeric_keys[]
so it will actually be used, instead of delivering GDK_Return
when it should be GDK_KP_Enter.
(cherry picked from commit 27f3fcf12c)
2012-11-20 19:14:43 +01:00
Matthias Clasen
6e3d687386 Post-release version bump 2012-11-20 07:00:53 -05:00
Matthias Clasen
6333cd8e83 Update expected output for the entries a11y test
This change is due to entry icons now being accessible.
2012-11-20 06:28:59 -05:00
Benjamin Otte
8d28e2d8e9 reftests: Fix linear-gradient reftest (again)
Make it so that the repeating vs normal test only uses sharp color
cutoffs instead of real gradients. That removes rounding errors and
makes the test pass.
2012-11-20 12:21:03 +01:00
Benjamin Otte
e5948f5713 cssvalue: Fix copy/paste error
Introduced in e3f407a7.
2012-11-20 12:11:07 +01:00
Matthias Clasen
d967500c92 Fix parser tests for color changes 2012-11-20 05:54:53 -05:00
Matthias Clasen
4be82195e4 3.7.2 2012-11-20 05:32:19 -05:00
Michael Natterer
455a0ecc1c quartz: always send GDK_NOTIFY_NONLINEAR crossing events
so GtkMenu works properly. This is not right, but not more
wrong than always sending GDK_NOTIFY_ANCESTOR either.
(cherry picked from commit 35a9322e45)
2012-11-20 10:35:40 +01:00
Michael Natterer
2d5ad5f54e Bug 672193 - windows (including menus) shown multiple times don't...
Based on a patch from Paul Davis, inject synthetic enter events directly
into the Quartz event stream, instead of trying to synthesize them in GDK.

This seems to magically fix most combo box popup weirdness, I guess
some code is relying on a specfic order of events, or any other state
imposed by the "proper" code path of events coming in the usual way.

The patch also removes _gdk_quartz_events_send_enter_notify_event()
which is now obsolete.

(sortof cherry-pixked from 979e5061a0
but needed manual editing because GdkQuartzWindow.c was renamed
and apparently earlier patches not picked correctly/completely)
2012-11-20 10:28:58 +01:00
Matthias Clasen
352c7f5120 Avoid infinite recursion in the ime input module 2012-11-19 09:30:44 -05:00
Benjamin Otte
c3f3a82db9 stylecontext: Split out a function
The function is used in multiple places, so split it out. In particular
because I'm about to change it.
2012-11-18 21:55:43 +01:00
Michael Natterer
b55724e3a7 quartz: use the real current event time for generated motion events
(cherry picked from commit b4a30877a9)
2012-11-18 20:17:22 +01:00
Michael Natterer
f2e05e2b41 quartz: move tooltips window to the topmost level
so they can appear on top of popup menus. Also, reorder the switch()
statement in window_type_hint_to_level() so it resembles the stacking
order, to avoid confision like this in the future. Fixes bug 688512.
(cherry picked from commit 1a2509a6ab)
2012-11-18 17:47:33 +01:00
Kjartan Maraas
bfbb9a58ae Updated Norwegian bokmål translation 2012-11-17 16:42:44 +01:00
Kjartan Maraas
870657d57b Updated Norwegian bokmål translation 2012-11-17 16:14:38 +01:00
Benjamin Otte
4bc264a514 cssprovider: Handle non-existing section
Otherwise we'll get warnings on errors when CSS debug is disabled.
2012-11-15 19:25:14 +01:00
Michael Natterer
18fdc975be quartz: GdkQuartzWindow -> GdkQuartzNSWindow was forgotten in one place 2012-11-15 13:17:31 +01:00
Michael Natterer
ed5d7fed89 quartz: filter out button press events on the window frame
Don't try to handle button press events on the window frame, they
have out-of-window coordinates. Also, break grabs on such events
so popup menus go away.
Patch from Kristian Rietveld, fixes bug 684419.
(cherry picked from commit 43e1354b71)
2012-11-15 12:35:58 +01:00
Jonny Lamb
2f8c2a3244 filechooser: remember sidebar width
https://bugzilla.gnome.org/show_bug.cgi?id=524295

Signed-off-by: Jonny Lamb <jonnylamb@gnome.org>
2012-11-14 20:03:23 -06:00
Benjamin Otte
5671a869c2 Revert parts of "window: Remove useless functions"
This reverts the size_allocate removal from commit
8449e05865. That code was using
_gtk_window_set_allocation() instead of gtk_widget_set_allocation(). And
that broke glade.
2012-11-14 20:12:30 +01:00
Piotr Drąg
f9b2edff39 Updated POTFILES.skip 2012-11-14 16:15:27 +01:00
Benjamin Otte
53262cf7a6 sizerequest: Optimize CONSTANT_SIZE better
We can set for_size to -1 earlier than we did. Doing so makes sure we
only cache one value (as we should in the first place). In GTK 3.6, this
worked properly, but with Previously, this check was moved further up to
avoid interacting with size groups. But after recent refactorings, size
groups are handled way earlier anyway.
2012-11-14 14:03:47 +01:00
Benjamin Otte
6d3b4d9382 stylecontext: Add a flag to force style_updated() emission
This is used in gtk_widget_reset_style() (via GTK_CSS_CHANGE_ANY) now,
and that makes GtkSettings font related changes work again.
2012-11-14 13:25:44 +01:00
Benjamin Otte
d3143779d2 sizerequestcache: Move rest of code to array
... of orientation. Reduces more duplicate if branches.
2012-11-14 01:55:29 +01:00
Benjamin Otte
43fc428cf0 sizerequestcache: Make code an array
We can use orientation as the index into an array. That way we can
delete half the code. Do it for the base request first in this patch.
2012-11-14 01:55:29 +01:00
Benjamin Otte
70ba973d1d sizegroup: Simplify comparison 2012-11-14 01:55:29 +01:00
Benjamin Otte
fd6ea42319 sizerequest: Use GtkOrientation
... instead of GtkSizeGroupMode. Orientation is what we're interested in
after all. When we need a GtkSizeGroupMode, we can do the translation
where we need it.
2012-11-14 01:55:29 +01:00
Benjamin Otte
0e0ee480d3 sizerequestcache: Move lookup function
...and clean up its API.
2012-11-14 01:55:29 +01:00
Benjamin Otte
78d0ef1d0b sizerequestcache: Move commit function 2012-11-14 01:55:28 +01:00
Benjamin Otte
14c8e33ab9 widget: Get rid of unused flags
Now that we clear the cache immediately, there's no need anymore to
track if a request has been queued.
2012-11-14 01:55:28 +01:00
Benjamin Otte
c08efb2b32 sizerequest: Cache the request mode
... in the GtkSizeRequestCache. That way, we only need to query it once,
and can remove the caching code from GtkContainer.
2012-11-14 01:55:28 +01:00
Benjamin Otte
c98ee1ec39 sizerequestcache: Make clear_cache clear all the cache 2012-11-14 01:55:28 +01:00
Benjamin Otte
4366f80aab sizerequestcache: Move functions
... into the sizerequestcache.c file.
2012-11-14 01:55:28 +01:00
Benjamin Otte
15570dd63d reftests: Turns out, green changed color
What used to be "green" is now "lime"
2012-11-14 01:55:28 +01:00
Benjamin Otte
10c47c0226 reftests: Update named colors reftest
Make reftest conform with correct colors. Pango has been updated to
these colors in commit d2c319b9ded8cce864914d9f1fd704a7aff3112f
2012-11-14 01:55:28 +01:00
Benjamin Otte
0a1a2ac148 sizerequest: Split out size request cache code into separate header 2012-11-14 01:55:28 +01:00
Michael Natterer
aa989a637a quartz: move SPLASHSCREEN-hinted windows to NSStatusWindowLevel
which does not really have a different effect than the previously
used NSPopUpMenuWindowLevel, but is what all code examples I found
are using, and it does make more sense.
(cherry picked from commit 47f0e3f1e1)
2012-11-13 20:05:33 +01:00
Timothy Arceri
50a09957a4 Remove bookmark duplicate of shortcut
Application code can set shortcut folders that are already bookmarks.
This code causes the bookmarks to be refreshed after the shortcut is
added removing any possible bookmark duplicates

https://bugzilla.gnome.org/show_bug.cgi?id=577806
2012-11-13 12:54:15 -06:00
Chun-wei Fan
e57ecafb6b Visual C++ property sheets: Update GtkBinaryVersion
This should now be 3.0.0 like the autotools builds...
2012-11-13 14:26:08 +08:00
Mike Gorse
b7743430aa Add accessibles for GtkEntry icons
Expose GtkEntry icons as child accessibles of a GtkEntry, and provide
actions to simulate clicking them. Also, refactor the a11y children test
slightly to add a test.

https://bugzilla.gnome.org/show_bug.cgi?id=686347
2012-11-12 09:21:27 -06:00
Mike Gorse
77c0f9d8e6 Send a notification when a GtkEntry icon's tooltip text changes 2012-11-12 09:15:46 -06:00
Benjamin Otte
872097603f reftests: Add a test for border-width problems 2012-11-11 20:26:28 +01:00
Benjamin Otte
5e01a05b30 bin: Handle border width if we have to
Some bin subclasses call gtk_container_handle_border_width(), some
don't. So work with both cases.
2012-11-11 20:26:28 +01:00
Benjamin Otte
a08eb4d58a container: Simplify code
We will never get allocated a too small size, so no need to handle that
case.
2012-11-11 20:26:28 +01:00
Benjamin Otte
8449e05865 window: Remove useless functions
Now that GtkBin implements sizing functionality, there's no need to do
the same in GtkWindow
2012-11-11 20:26:28 +01:00
Benjamin Otte
b0f3aa82b7 bin: Only handle size for the child if it is visible 2012-11-11 20:26:27 +01:00
Piotr Drąg
4950f68a87 Updated POTFILES.skip 2012-11-10 20:21:33 +01:00
Benjamin Otte
5f20d909e6 tests: Add an intersection test for the recent bug
Just using the hardcoded bitmasks triggered the bug fixed in commit
e8f2eeac92 - so just do that as the test.
2012-11-10 18:55:14 +01:00
Benjamin Otte
c59e8de533 tests: Add some bitmasks to the hardcoded list
The bitmasks with the 31st, 32nd and 63rd bit set are added. The make up
the largest bitmasks on 32bit/64bit that can be represented without
allocating and the smallest bitmask on 32bit that must be allocated.
2012-11-10 18:53:34 +01:00
Benjamin Otte
e8f2eeac92 bitmask: Fix intersection code
With the fix in 77912a65e2, another bug
got visible: booleans are 32 bits, so if the intersection between the 2
bitmasks happened in higher bits, the return value would be truncated to
FALSE.

This actually made slider handles disappear, so it was pretty visible.
2012-11-10 18:35:37 +01:00
Benjamin Otte
aae2bf91cb cssvalue: Make shade() work properly again
In a previous commit, I accidentally scaled the hue instead of the
saturation. Ooops.
2012-11-10 14:25:18 +01:00
Benjamin Otte
10c3a66e40 reftests: Add a test for all the color names
BIG NOTE: We fail on some of these to give the colors defined in the CSS
specs. This is not good, but I'm not sure how to best fix it.
For those cases, I've kept the correct color in the CSS file but added
the correct one next to it.
2012-11-10 14:25:17 +01:00
Piotr Drąg
42fc6ab5d3 Updated POTFILES.skip 2012-11-10 00:38:13 +01:00
Stef Walter
c8de9abe98 icon-theme: Add some preconditions for NULL arguments
Related to this crash: https://bugzilla.gnome.org/show_bug.cgi?id=687967

https://bugzilla.gnome.org/show_bug.cgi?id=687977
2012-11-09 11:59:09 +01:00
Alexander Larsson
e60c9219f1 Make _gtk_css_lookup_get_missing inline
This is called a lot in the loop in gtk_css_style_provider_lookup which
actually showed up on profiles.
2012-11-09 10:16:23 +01:00
Alexander Larsson
1c4158a649 gtk_css_style_provider_lookup: minor loop optimiziation
This is a minor performance improvement but this loop
is run a lot so it actually matters in large state
changes.
2012-11-09 10:16:18 +01:00
Alexander Larsson
55d65571f3 Exit early in gtk_style_context_update_cache codepaths
If lookup->missing is empty we don't need to continue looking.
We short circuit in several places as this can happen
after iteratively makeign lookup->missing smaller.
2012-11-09 10:15:23 +01:00
Alexander Larsson
77912a65e2 Fix cnp bug in _gtk_bitmask_intersects
We need to use the allocated codepath if *any* argument is
allocated, not if one arg is not allocated.
This bug caused unnecessary calls to _gtk_bitmask_is_allocated,
as well as return completely wrong result if both bitmask are
allocated.
2012-11-09 10:11:47 +01:00
Alexander Larsson
8a40d8fe2a gdk: Add gdk_window_has_alpha helper
This centralizes the current checks for has_alpha_bg, which
lets us extend the check later.

https://bugzilla.gnome.org/show_bug.cgi?id=687842
2012-11-09 10:08:22 +01:00
Alexander Larsson
c94002f8c0 Add "parent widget" button to test property editor
Without this its hard to access the properties of container
widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=687842
2012-11-09 10:08:22 +01:00
Jasper St. Pierre
f4438a1ffc gtkbin: Remove the silliest code on earth
What is this bin doing with all these crazy deltas? Company does:

<Company> that can safely be removed
<Company> in general, code that isn't obvious can either be understood
<Company> with a bit of thinking or it can be removed
<Company> if in doubt, go for the 2nd of those :)

Most GtkBin subclasses override this strange garbage anyway, so it's
not like this code is ever *run*, per se. Just make it proxy directly
to the child, and hope nothing goes wrong.
2012-11-08 19:19:53 -05:00
Jasper St. Pierre
3563d11fc6 gtkbin: Complete more of a base implementation for GtkBin subclasses
Implement get_preferred_width, get_preferred_height, and size_allocate.
This allows GtkBin subclasses to be quick and easy, without the
author doing the subclassing to have to do much work.
2012-11-08 19:19:46 -05:00
Jasper St. Pierre
7b950944b0 gtkversion.h.in: Put the documentation inside the header guards
This fixes a warning with gobject-introspecion scanning
2012-11-08 19:19:00 -05:00
Benjamin Otte
ffeef28dbc reftests: Add test for recent fix 2012-11-08 23:34:30 +01:00
Benjamin Otte
0d9a45d460 label: Fix another sizing corner case causing segfaults
If the "wider" label is the smaller one, use the wider size for both
cases. This can happen when ellipsizing a single character, which is
often smaller than the ellipsizing glpyph(s).
2012-11-08 23:34:30 +01:00
Benjamin Otte
947fed0961 stylecontext: Fix a memleak 2012-11-08 23:34:30 +01:00
Benjamin Otte
ba88174614 stylecontext: Remove unused function 2012-11-08 23:34:29 +01:00
Benjamin Otte
598f86eaf3 cssvalue: Convert shadows to GtkCssColorValue 2012-11-08 23:34:29 +01:00
Benjamin Otte
3cb6ae3df3 cssimage: Use GtkCssColorValue 2012-11-08 23:34:29 +01:00
Benjamin Otte
bd31bd6d63 cssstyleproperty: Replace symbolic colors with GtkCssColorValue 2012-11-08 23:34:29 +01:00
Benjamin Otte
e3f407a71d cssvalue: Add GtkCssColorValue
This is mostly copy/paste from GtkSymbolicColor and is indeed intended
to replace it.
2012-11-08 23:34:06 +01:00
Benjamin Otte
1a213679bd symboliccolor: Change the print output
Functions should not have a space before the opening parenthesis. So
change output like
  alpha (@color, 0.5)
to
  alpha(@color, 0.5)
and do the same for "shade" and "mix".

Tests have been updated accordingly.
2012-11-08 23:34:06 +01:00
Benjamin Otte
e063a0fdf1 symboliccolor: Split out HSLA code 2012-11-08 23:34:05 +01:00
Matthias Clasen
cff4718e91 Update a11y test results
These are expected changes, since a11y class name show up in the
dumps.
2012-11-07 20:21:50 -05:00
Matthias Clasen
ffa42cb5bb Nuke GtkBoxAccessible
It didn't contain anything useful.
2012-11-07 20:17:30 -05:00
Cosimo Cecchi
f9db800713 text-cell-accessible: fix a double unref
We're unreffing the GtkCellRenderer object twice, causing the
application to crash when trying to access the renderer later.

https://bugzilla.gnome.org/show_bug.cgi?id=687872
2012-11-07 15:46:16 -05:00
Cheng-Chia Tseng
178e072e8a Updated Traditional Chinese translation(Hong Kong and Taiwan) 2012-11-07 02:35:44 +08:00
Benjamin Otte
b42a4e2276 gradient: Add color stops to the right gradient
This was causing an infinite loop happily eating up memory.

https://bugzilla.gnome.org/show_bug.cgi?id=687467
2012-11-06 21:29:58 +01:00
Benjamin Otte
5e59033eb3 tests: Include config.h 2012-11-06 21:29:58 +01:00
Benjamin Otte
58021c9e98 Disable deprecation checks for all libraries we depend on on stable branches.
This is so newer versions of those libraries don't cause more warnings
with a stable GTK version.
We don't ever want to turn off deprecation warnings for master however,
because that's where we get rid of deprecated API we use.

Note that only glib allows use to easily do this, so nothing is done for
Pango, gdk-pixbuf or Cairo here.
2012-11-06 21:29:58 +01:00
Benjamin Otte
e9dc0e391d cssimage: Fix huge memleak
When transitioning gradients, we were leaking the gradient structs. Not
good.

https://bugzilla.gnome.org/show_bug.cgi?id=687467
2012-11-06 18:04:10 +01:00
Cosimo Cecchi
9876fc4f17 css: Fix copy/paste error
Benjamin replaced start with end in a bunch of locations, but not all of
them apparently.
2012-11-06 18:04:10 +01:00
Piotr Drąg
aa534812f5 Updated POTFILES.skip 2012-11-05 23:04:55 +01:00
Benjamin Otte
959bfbb66e reftests: Add a reftest for latest fix 2012-11-05 19:34:23 +01:00
Benjamin Otte
debe81b1ea label: Handle crazy corner cases
With ellipsizing, the ellipsized text can have a smaller height than the
non-ellipsized text. So the wider text is also higher. Example:
  .<big>TEXT</big>
will ellipsize to the small text.

Reported-By: Rico Tzschichholz <ricotz@t-online.de>
2012-11-05 19:34:23 +01:00
Adorilson Bezerra
cdadbb069f Fixed Brazilian Portuguese Translation 2012-11-05 12:12:32 -02:00
Matthias Clasen
9ebeb4e68a Bump GLib dependency to 2.35
And drop deprecated g_type_init() calls.
2012-11-04 13:01:38 -05:00
Benjamin Otte
8bdc2aa228 reftests: Add test for recent fix
This test checks the fix in a46368dede
2012-11-04 17:58:18 +01:00
Benjamin Otte
075667e927 reftests: Mark windows as popup
This makes the tests run faster and should always be done.
2012-11-04 17:58:06 +01:00
Stefano Facchini
a46368dede sizerequest: do not derefence NULL pointers 2012-11-04 17:48:02 +01:00
Paolo Borelli
1beb9db7b0 gtkmenubutton: remove weak pointer when needed
We must make sure to remove the weak pointer when disposing the widget
or when resetting the align widget otherwise glib will try to nullify
invalid memory.
2012-11-04 17:12:14 +01:00
Paolo Borelli
5830363787 gtkmenubutton: set menu to NULL in dispose.
Prevent menu to be detached multiple times.
2012-11-04 17:12:14 +01:00
Benjamin Otte
7f870abf17 sizerequest: Restructure code
Make the compute_size_request() function take into account size groups
itself instead of doing a weird "bump_requisition" call.
2012-11-04 16:10:20 +01:00
Benjamin Otte
7501f9770f sizerequest: Move sizegroups function to different source file 2012-11-04 16:02:14 +01:00
Benjamin Otte
8bdff7a564 sizegroup: Construct the set of sizegroup peers as a hash table
This way we don't need a marker on GtkWidgetParivate that needs to be
unset later, so we have all our data in the same place and can avoid
problems with reentrancy and shenanigans like that.

But the main reason I wrote that is cleaner code.
2012-11-04 15:47:03 +01:00
Benjamin Otte
1ef057f983 reftests: Add a test from evolution
This was used in a bug report.

https://bugzilla.gnome.org/show_bug.cgi?id=677609
2012-11-04 15:28:43 +01:00
Benjamin Otte
756ebea036 reftests: Add a test for all the recent sizegroup hackery 2012-11-04 15:28:43 +01:00
Benjamin Otte
dd6931d1ba sizegroup: Use _gtk_widget_compute_size_for_orientation()
With this function now available, we can do size computation in 2
ways:
(1) Compute size with size groups
(2) Compute size without size groups

And have (1) use (2) instead of setting flags on widgets. This patch
does exactly that.
2012-11-04 15:28:43 +01:00
Benjamin Otte
c3148a81d2 sizerequest: Move optimization
With size groups now doing hfw, doing the optimization for CONSTANT_SIZE
was done too early. Size groups need to know that it's a hfw request, so
the other widgets in the size group get the correct behavior.
2012-11-04 15:28:43 +01:00
Benjamin Otte
aba0c5cc3b label: Redo get_preferred_width/height()
This is important for size groups mostly, but also has some small fixes.
The label-sizing reftest as been updated accordingly.
2012-11-04 15:28:43 +01:00
Benjamin Otte
f55fe7e20b label: Fix ellipsize and wrap being set
The label code assumed that Pango treats this as "wrap to as much space
as possible and then ellipsize all the lines", but for Pango, ellipsize
takes precedence over wrap. So do the same thing in GtkLabel.

Also updated is the reftest that checked this behavior.
2012-11-04 15:28:43 +01:00
Benjamin Otte
035e55d1ab reftests: Improve reftest performance
Get rid of all the event boxes in this test. Event boxes need GDK
windows which cost a lot of performance when running the test and they
clip the label output.

Getting rid of the clipping also shows 2 bugs in this test that weren't
visible before. Those will be fixed in a followup patch.
2012-11-04 15:28:42 +01:00
Benjamin Otte
f48b30c13a reftests: Make label-sizing tests use better CSS
ow that labels can have backgrounds, just use label backgrounds
2012-11-04 15:28:42 +01:00
Benjamin Otte
02bc589583 sizerequest: Export _gtk_widget_compute_size_for_orientation()
and add an "ignore_size_groups" flag to it. This way we can use it for
size group shenanigans.
2012-11-04 15:24:18 +01:00
Benjamin Otte
1d6e896fef sizegroup: Move GtkSizeGroupMode to gtkenums.h
This is in preparation for the next patch, which would otherwise lead to
conflicts.
2012-11-04 15:24:18 +01:00
Benjamin Otte
62f5414742 sizerequest: Cache sizes without size groups
We compute on-demand for size groups anyway, so we can (in theory, this
patch doesn't do that yet) get around costly cache blowing when
invalidating single widgets of a size group this way.
2012-11-04 15:24:17 +01:00
Benjamin Otte
be1bde9111 sizegroups: Use is_visible() instead of get_mapped() for visibility
The current approach of using gtk_widget_get_mapped() is broken:
The usual steps taken when showing a window are:
(1) request the sizes
(2) allocate the sizes
(3) show the window in the allocated size

Showing the window with a random size between steps (1) and (2) would of
course
result in extra work and potential flickering when the widgets get
resized to
their proper sizes.

However, as GtkSizeGroup::ignore-hidden uses gtk_widget_get_mapped() to
determine visibility for a widget, the following will happen:
(1) the widget will request a 0 size
(2) the widget will be allocated a 0 size
(3) the widget will be too small when it is shown

gtk_widget_get_visible() however is set in advance. Note that toggling
visibility also causes a gtk-widget_queue_resize() call already so we
take care of changes in here automatically.
2012-11-04 15:24:17 +01:00
Benjamin Otte
48ff2fc7ed API: Add gtk_widget_is_visible()
This is a recursive gtk_widget_get_visible(): Returns TRUE if the widget
and all its parents are visible.
2012-11-04 15:24:17 +01:00
Benjamin Otte
9f6067a804 sizegroup: Handle hfw in size groups 2012-11-04 15:24:17 +01:00
Benjamin Otte
c8f2328337 sizegroup: Add a function for clarity
... and restructure code to accomodate that function.
2012-11-04 15:24:17 +01:00
Benjamin Otte
dbbdefe4e0 sizegroup: Don't keep groups around everywhere
The code is only interested in the actual widgets that belong together,
not in the groups. So just don't return the groups.
2012-11-04 15:24:17 +01:00
Benjamin Otte
dfea266e1f sizegroup: Check ignore_hidden flag when adding groups
Instead of only checking the ignore_hidden flag when getting the
preferred sizes, respect it already when constructing the list of
widgets. This way, widgets don't queue resizes for groups they're
ignored in anyway.
2012-11-04 15:24:17 +01:00
Benjamin Otte
a1f6887f17 sizegroup: Use for loops
For loops to loop over lists look nicer and actually do the right thing
with "break" and "continue" statements. So they are vastly preferred to
while loops.
2012-11-04 15:24:17 +01:00
Benjamin Otte
8796fe6d1c sizegroups: Restructure code
This way, we do the checks at the start of the effected function, not
before calling it.
2012-11-04 15:24:16 +01:00
Benjamin Otte
8710d97945 sizegroup: Don't cache the sizes anymore
This simplifies code and because sizes are cached by the widgets
themselves, it's not a large performance problem (unless people use huge
amounts of widgets in a single size group, but who does that?
2012-11-04 15:24:16 +01:00
Federico Mena Quintero
9c6e560819 Merge branch 'bgo687196-filesystemmodel-crash' 2012-11-02 14:13:02 -06:00
Federico Mena Quintero
ea3a750f13 bgo#687196 - Fix model corruption during file removal
The main problem is that we were emitting the row-deleted signal for the model in the middle
of the process that actually deletes the row from the model (remove the row from the array,
update the model->file_lookup hash table, etc.).  In the model's caller, one of the row-deleted
callbacks was requesting an iter, which caused the model to revalidate itself - but it did
this while it was in an inconsistent state.  This led to an assertion failure later when the
model resorted itself.

The fix in remove_file() is like this:

* The filteredness/visibility of the deleted node is not updated.  The
  node will simply be gone; we don't need to update those values at
  all.

* We invalidate just the node that is being deleted.

* The model->file_lookup hash table is not completely nuked; instead,
  we carefully adjust its indices.

* The row-deleted signal is only emitted at the very end, when
  deletion is complete and the model is consistent.

Many thanks to William Hua for doing the detective work on this bug!

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-11-02 14:09:01 -06:00
Federico Mena Quintero
94e3d7faf1 Make freeze_updates() and thaw_updates() static functions
They were in the semi-public API of GtkFileSystemModel, but never actually used outside of it.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-11-01 17:21:47 -06:00
Federico Mena Quintero
1cee5ff0dd Comments on how the filtering and sorting processes work
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-11-01 17:19:10 -06:00
Benjamin Otte
0306278145 sizegroup: Always at least use widget's size
When widgets were hidden, they were otherwise assigned a 0 size.
2012-11-01 20:22:35 +01:00
Benjamin Otte
4067a45aff settings: Reset all styles when the enable-animations settings changes
https://bugzilla.gnome.org/show_bug.cgi?id=686021
2012-11-01 12:27:31 +01:00
Benjamin Otte
625f8a6dd3 Raleigh: Fix spinners with disabled animations
When animations are disabled, active and inactive spinners should look
different.

https://bugzilla.gnome.org/show_bug.cgi?id=686021
2012-11-01 12:27:31 +01:00
Benjamin Otte
0bfbf39306 cssimage: Implement some equal functions 2012-11-01 12:27:31 +01:00
Federico Mena Quintero
f39f574914 Remove argument to _gtk_file_system_model_update_file() that should not be part of the internal API
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-10-31 20:54:02 -06:00
Federico Mena Quintero
281c592ea9 Rename gtk_tree_path_new_from_node() to tree_path_new_from_node()
This is a function internal to the file system model; let's not pollute the gtk_tree_path namespace.

Also, make the 'i' variable into 'r' as it refers to a row index, not a file-array index (for
consistency with the docs and the rest of the code).

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-10-31 20:21:47 -06:00
Cosimo Cecchi
86ecf54139 icon-theme: support loading symbolic GFileIcons from generic URIs
Right now we support loading and recoloring symbolic GFileIcons, but
only if the underlying GFile has a local path. This breaks when the
GFileIcon is loaded from a GResource, which is a reasonable option for an
application that wants to ship a custom symbolic icon.

This patch changes GtkIconInfo to store a GFile together with the file
path, and changes the symbolic icon lookup code to use the GFile URI,
which transparently makes the code work also for GResources.

https://bugzilla.gnome.org/show_bug.cgi?id=687059
2012-10-31 11:53:50 -04:00
Benjamin Otte
2e287576b4 themingbackground: Remove struct members
... and put them in the only function they are used in.
2012-10-31 11:09:12 +01:00
Benjamin Otte
762e2d9322 reftests: Add reftest for fractional border sizes 2012-10-31 11:09:12 +01:00
Benjamin Otte
fd73c1f8d9 themingengine: Draw fradctional border sizes 2012-10-31 11:09:12 +01:00
Benjamin Otte
1e08fe8646 reftests: Fix linear-gradient reftest
... and add it to the Makefile
2012-10-31 11:09:12 +01:00
Benjamin Otte
6821a8f7b2 themingbackground: Remove GtkThemingBackgroundLayer
The struct was just the index. So just pass the index around instead of
a full struct.
2012-10-31 11:09:11 +01:00
Benjamin Otte
5e7949c47b themingbackground: Use get_box() for background image size 2012-10-31 11:09:11 +01:00
Benjamin Otte
ba96c34787 themingbackground: Introduce gtk_theming_background_get_box()
to query the different clip boxes used by the background drawing code.
Use this function to query these boxes when clipping.
2012-10-31 11:09:11 +01:00
Benjamin Otte
12dec5279e themingbackground: Add content_box variable
... to go with border_box and padding_box.
2012-10-31 11:09:11 +01:00
Benjamin Otte
e9dbfc0e06 themingbackground: Get rid of flags variable 2012-10-31 11:09:11 +01:00
Benjamin Otte
0ccb7db245 themingbackground: Move image variable
... from the Layer struct onto the stack of the only function using it.
2012-10-31 11:09:11 +01:00
Benjamin Otte
ccaf1c2c67 themingbackground: Restructure code some more
Move variable initialization outside the first code with side effects.
This allows adding some more early returns, including one for code that
used to trigger g_return_if_fail() in certain corner cases.
2012-10-31 11:09:11 +01:00
Benjamin Otte
ce56248930 themingbackground: Restructure code
Make if statements encompassing the whole function into early returns.
The rest of the diff is reindenting.
2012-10-31 11:09:11 +01:00
Benjamin Otte
016647edb1 cssimage: Add a warning for drawing empty images
width and height of an image must be > 0 for the image to get drawn.
It's up to the code further up to ensure that this is not happening.
2012-10-31 11:09:10 +01:00
Benjamin Otte
a68e76e058 reftests: Add a reftest for recent commit
Check that a computed background-size of 0 is treated as 0.
2012-10-31 11:09:10 +01:00
Benjamin Otte
67302c5ee0 cssvalue: Compute "background-size: 0 0" properly
Previously a computed value of 0 was treated as "auto", which is wrong.
2012-10-31 11:09:10 +01:00
Benjamin Otte
16677bb85a stylecontext: Don't use bg image in gtk_style_context_set_background()
Old code tried to use the "background-image" proeprty for setting the
default image background. While this used to work in the early days of
GTK3, today it is grossly misleading as the backgronud image may be
resized, repositioned and semi-translucent which causes very weird
artifacts when rendering.

So we use the background-color only instead.
2012-10-31 11:09:10 +01:00
Benjamin Otte
c13efbf8b0 cssimage: Add an equal vfunc
No implementations for it exist yet.
2012-10-31 11:09:10 +01:00
Benjamin Otte
73fe9a2acf menuitem: Draw background unconditionally 2012-10-31 11:09:10 +01:00
Benjamin Otte
b1ad5c8abc settings: Use _gtk_css_provider_load_named()
This way we create one provider per settings object instead of stuffing
it into a global unchanging never-deleting hash table.
Also, we now reload the theme when instructed instead of keeping the old
loaded (and possibly stale) data forever.

https://bugzilla.gnome.org/show_bug.cgi?id=683896
2012-10-31 11:09:10 +01:00
Benjamin Otte
b41215bdea cssprovider: Move fallback code into _gtk_css_provider_load_named()
This makes sure the full theme loading logic resides in one function and
isn't scattered around.

As a side-effect, the hash table kept by gtk_css_provider_get_named()
will now be populated with fallback themes. This will not be a problem
after the next commit though.
2012-10-31 11:09:09 +01:00
Benjamin Otte
738b453c66 cssprovider: Export gtk_css_provider_load_named) function
... and document it.
For now, the function is only exported internally.
2012-10-31 11:09:09 +01:00
Benjamin Otte
9c9d82f1a9 cssprovider: Split out theme loading function
Split maintaining the global themes hash table and the theme loading
code into two functions.
This also fixes leaking the provider when loading a theme from a builtin
resource.
2012-10-31 11:09:09 +01:00
Fran Diéguez
bae55eaa80 Updated Galician translations 2012-10-31 10:52:47 +01:00
Sandeep Sheshrao Shedmake
beb02a5b4b Updated Marathi Translations 2012-10-31 10:39:01 +05:30
Wolfgang Stoeggl
840855d401 Updated German translation 2012-10-30 19:45:59 +01:00
Mattias Põldaru
c9d035bde3 [l10n] Updated Estonian translation 2012-10-30 15:38:09 +02:00
Matej Urbančič
128437cc76 Updated Slovenian translation 2012-10-29 22:33:43 +01:00
Aurimas Černius
e903ff8f86 Updated Lithuanian translation 2012-10-29 22:07:22 +02:00
Ran Benita
21cf5a7e00 wayland: update to work with stable libxkbcommon
libxkbcommon has had some changes to its API. However, it now has a
stable release (0.2.0), so this makes the necessary changes, and
replaces all uses of the deprecated API.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-29 15:45:31 +00:00
Daniel Mustieles
3338f6cb5b Updated Spanish translation 2012-10-29 13:07:29 +01:00
Andika Triwidada
249d2a8030 Updated Indonesian translation 2012-10-29 18:45:22 +07:00
Sweta Kothari
dc85125737 Updated gujarati file 2012-10-29 16:28:55 +05:30
Мирослав Николић
11825afc3e Updated Serbian translation 2012-10-29 11:48:33 +01:00
Hib Eris
99e194e7cc Fix compiling for win32
https://bugzilla.gnome.org/show_bug.cgi?id=687066
2012-10-29 09:36:41 +01:00
Carlos Garnacho
63c75a2384 texthandles: Add an extra style class to the cursor-mode handle
Themes may want to render handles differently depending on whether
the widget is in selection mode (2 handles enclosing a selection) or
cursor mode (one handle pointing out the insertion cursor).
2012-10-26 18:38:38 +02:00
Carlos Garnacho
0eb09ac0f2 texthandles: set input shape on handles' window
This improves both interaction and theming, as it allows
arbitrary handle shapes while just being draggable from
the visible areas.

This way themes can set up handles with the hotspot visually
displaced from the horizontal center, as long as the hotspot
lies centered in the image/svg asset.
2012-10-26 18:35:24 +02:00
Carlos Garnacho
f6952ceb82 texthandle: Fix shape setup on non-composited environments
The check on the handle to be drawn on the mask was based on the yet to
be set priv->windows pointers, pass explicitly the handle position to
have the shape correctly initialized on non-composited environments
2012-10-26 17:46:40 +02:00
Nilamdyuti Goswami
237e984a52 Assamese translation updatedas.po 2012-10-26 14:23:33 +05:30
John Ralls
41f29032d2 Fix typo from f2ab3af 2012-10-25 10:58:56 -07:00
Rūdolfs Mazurs
019bb37dd3 Updated Latvian translation 2012-10-24 15:14:37 +03:00
Kristian Høgsberg
ca0662dba4 configure.ac: Look for wayland-client 1.0.0 2012-10-23 22:37:02 -04:00
Matthias Clasen
5aff66f391 Add GDK_VERSION_3_8
This macro is needed for the new AVAILABLE_IN and DEPRECATED_IN
macros.
2012-10-23 17:36:17 -04:00
Tom Tryfonidis
6245362a52 Updated Greek translation 2012-10-23 19:54:51 +03:00
Matthias Clasen
2b7ebd93f2 Bump version 2012-10-22 20:45:25 -04:00
Matthias Clasen
b5495cd7da 3.7.0 2012-10-22 20:44:24 -04:00
Matthias Clasen
bec6b260b4 Be robust against unrealized windows in GtkWindowAccessible
Based on a patch by Albert Astals Cid,
https://bugzilla.gnome.org/show_bug.cgi?id=686152
2012-10-22 19:42:41 -04:00
Matthias Clasen
c51157d437 Forgotten fixup
This was meant to be included in the previous commit :-(
2012-10-22 19:41:14 -04:00
Stefano Facchini
4e42bd055d treeview: Add support for styling the dragged header
https://bugzilla.gnome.org/show_bug.cgi?id=684980
2012-10-22 19:05:00 -04:00
Stefano Facchini
f67273c579 treeview: Move the dragged header in the headers window
https://bugzilla.gnome.org/show_bug.cgi?id=684980
2012-10-22 19:04:12 -04:00
Matthias Clasen
5a497e9fb8 Use named union for _GtkSymbolicColor in gtk/gtksymboliccolor.c
Patch by Richard Lloyd,
https://bugzilla.gnome.org/show_bug.cgi?id=686366
2012-10-22 18:59:42 -04:00
Cosimo Cecchi
288ed1f920 scrollbar: remove unused variable
My bad.
2012-10-22 18:41:00 -04:00
Cosimo Cecchi
852d4d618c notebook: return TRUE for drag-motion event when over tabs
The GtkNotebook drag-motion event handler may install a timeout when
hovering over a tab, in order to switch to it.
On the other hand it's desirable for applications to use the empty tab
area as a drop target, so the drag-motion handler returns FALSE
(also in case it installs the switch tab timeout), as explained in
https://bugzilla.gnome.org/show_bug.cgi?id=350665.

Unfortunately, applications can use the tab label widget (or a child
of it) as a different drop target area, and install their own
drag-motion handler there.
In this scenario, the timeout will still be installed by GtkNotebook's
handler, but since it returns FALSE, it will never get the matching
drag-leave event, causing it to trigger also when the mouse pointer
moved elsewhere before it expired.

Fix this by returning TRUE from drag-motion when the event is over a
tab. Note that this makes automatic tab switching not work anymore when
drag and drop is handled in the tab label widget; applications are
expected to also handle tab switching if desired in such a case.

https://bugzilla.gnome.org/show_bug.cgi?id=684415
2012-10-22 18:39:37 -04:00
Cosimo Cecchi
42da600eb1 notebook: consolidate code to remove the switch tab timer
https://bugzilla.gnome.org/show_bug.cgi?id=684415
2012-10-22 18:37:47 -04:00
Mattias Põldaru
67fec32d27 [l10n] Updated Estonian translation 2012-10-22 22:01:01 +03:00
Cosimo Cecchi
ad22a1faf6 scale: update style properties on GtkRange at init
Same fix as in ef027c93d4, but for
the GtkScale subclass of GtkRange.

https://bugzilla.gnome.org/show_bug.cgi?id=686280
2012-10-22 13:13:11 -04:00
Cosimo Cecchi
ef027c93d4 scrollbar: update style properties on GtkRange at init
GtkScrollbar used to rely on style-updated being emitted every time
after the widget was created in order to set the right values from its
style properties on GtkRange.
Nowadays we try to be smarter and avoid emitting style-updated at
creation time, so we need to manually initialize the GtkRange values.

This fixes a regression from 35e36b9fe5.

https://bugzilla.gnome.org/show_bug.cgi?id=686280
2012-10-22 11:48:04 -04:00
Jean Parpaillon
247bc3ad69 Fix out of source tree building for gdk/broadway
This patch fix compilation when building out of source tree (gdk/broadway dir).

Signed-off-by: Colin Walters <walters@verbum.org>
2012-10-22 11:30:37 -04:00
Pavol Šimo
aa81b0db2c Updated Slovak translation 2012-10-20 19:46:03 +01:00
Fran Diéguez
c2032dec6d Updated Galician translations 2012-10-20 13:09:24 +02:00
Tim-Philipp Müller
f8c81ad788 docs: fix typo on 'Getting Started with Gtk+' page 2012-10-20 11:25:02 +01:00
Aurimas Černius
488e124f6a Updated Lithuanian translation 2012-10-19 20:45:59 +03:00
Petr Kovar
f0a211a1df Update Czech translation 2012-10-19 13:26:21 +02:00
Scott Moreau
e5b88f1bdd wayland: Update to reflect protocol changes 2012-10-19 12:21:35 +01:00
Fran Diéguez
7151b1a28a Update Galician translations 2012-10-18 10:53:55 +02:00
Matej Urbančič
f75498d8e1 Updated Slovenian translation 2012-10-18 08:16:39 +02:00
Matthias Clasen
eda0d9ba10 Fix duplicate columns in filechooser entry completion
This partically reverts commit
331bba1ad6, which broke documented
behaviour.
2012-10-17 21:27:26 -04:00
Cosimo Cecchi
15fe3038be menubutton: don't refer to the non-existant menu property
7c6454246e removed the property, but
forgot to change the name in a g_object_notify().
2012-10-17 17:05:22 -04:00
Мирослав Николић
9d1b576af6 Updated Serbian translation 2012-10-17 22:24:36 +02:00
Andika Triwidada
2ad31feaaa Updated Indonesian translation 2012-10-17 23:53:50 +07:00
Daniel Mustieles
2216a6f658 Updated Spanish translation 2012-10-17 18:05:57 +02:00
Stefano Facchini
fa2ed6b8a2 level-bar: Fix typo 2012-10-17 16:09:22 +02:00
Cosimo Cecchi
4c9db15212 scrolledwindow: set GDK_EXPOSURE_MASK on the overshoot window
Currently we use gtk_style_context_set_background() when the state flags
change in order to propagate the background color to the overshoot
window, but this is actually only needed because the window doesn't get
expose events, since we always draw a full background in draw().
This also fixes some problems when the GdkWindow of the scrolled
window's child is composited, as seen in oxygen-gtk3.

https://bugzilla.gnome.org/show_bug.cgi?id=686265
2012-10-17 09:56:49 -04:00
Stefano Facchini
5e55bf1d53 level-bar: add support for RTL locales
https://bugzilla.gnome.org/show_bug.cgi?id=684288
2012-10-17 14:12:57 +02:00
Stefano Facchini
e5de18cbf9 level-bar: add an "inverted" property like GtkProgressBar
https://bugzilla.gnome.org/show_bug.cgi?id=684288
2012-10-17 14:12:57 +02:00
Stefano Facchini
0f36b16733 Add gdk version macros for 3.8
https://bugzilla.gnome.org/show_bug.cgi?id=684288
2012-10-17 14:12:57 +02:00
Ignacio Casal Quinteiro
7c6454246e GtkMenuButton: remove menu property as it is replaced by popup.
See that it was already announced to be removed before 3.6.0
but we forgot.
2012-10-17 14:07:31 +02:00
Cosimo Cecchi
a021b72c71 cssshadowsvalue: handle gtk_css_value_transition returning NULL
The implementation of transition for GtkCssShadowValue can return NULL
at least when the two values have a different inset; all other parts of
the GTK/CSS machinery (e.g. GtkCssArrayValue) handle this by returning
NULL too. Instead, GtkCssShadowsValue was returning an invalid value,
where "len" was set, but some values in the array were NULL, which would
lead to a segfault when this value is later evaluated by the compute
function.

Fix this by making GtkCssShadowsValue return NULL if a shadow transition
fails, like GtkCssArrayValue does.

https://bugzilla.gnome.org/show_bug.cgi?id=686013
2012-10-16 14:22:24 -04:00
Cosimo Cecchi
6b3416a2d7 reftests: fix the linear-gradient reftest
Don't use a repeating linear gradient, since it can't be easily
reftested against a non-repeating one for the reasons described in the
test header.
Instead, add a separate test for repeating gradients (against another
repeating gradient).

This makes the test pass, so it can be added to the Makefile now.
2012-10-16 13:12:00 -04:00
Cosimo Cecchi
17760bd2eb cssshadow: plug a cairo_surface_t leak
We were never destroying the cairo surface we use for blurring, which
would lead to a huge leak.

https://bugzilla.gnome.org/show_bug.cgi?id=686209
2012-10-16 13:07:51 -04:00
Cosimo Cecchi
97f49c681b csskeyframes: unref GtkCssValues when free-ing
We assume a reference to all the GtkCssValues we store, so we need to
release it when free-ing.
2012-10-16 13:07:51 -04:00
Cosimo Cecchi
6fb66261ca gradient: plug a GtkCssValue refleak
Since _gtk_symbolic_color_resolve_full() returns a reference to a
GtkCssValue.
2012-10-16 13:07:51 -04:00
Cosimo Cecchi
3b7e390484 csscomputedvalues: plug a refleak
_gtk_css_keyframes_compute() returns a reference to a GtkCssKeyframes,
and _gtk_css_animation_new() takes another reference.
2012-10-16 13:07:50 -04:00
Matthias Clasen
d08dfbd390 bump version 2012-10-16 06:42:49 -04:00
Matthias Clasen
1b51f50ce0 3.6.1 2012-10-16 06:02:03 -04:00
Matthias Clasen
4e09e180e4 Fix css parser tests
Parsing a shorthand background property was running into unexpected
errors when trying position values where there were none. To fix this,
introduce a try_parse variant of the position parse function that
silently returns NULL.
2012-10-16 06:02:03 -04:00
Matthias Clasen
f9dae1d526 Fix 'make check' 2012-10-16 06:02:03 -04:00
Cosimo Cecchi
84922d3317 appchooserwidget: check for g_app_info_should_show()
This ensures NoDisplay=true or NotShowIn/OnlyShowIn values in the
desktop file are respected.
2012-10-15 18:45:49 -04:00
Cosimo Cecchi
9208588771 a11y: fix private strict regression
Commit 0bbfcc2491 added a private struct
for GtkImageAccessible, but forgot to call g_type_class_add_private().
2012-10-15 17:09:04 -04:00
Cosimo Cecchi
10ead8a9d7 a11y: fix the build
Fix a typo introduced in 0ad379708f
2012-10-15 11:32:56 -04:00
Matthias Clasen
5465d89380 Add private structs to all remaining headers
These are not used currently. Just put them in now in
case we need them in the future.
2012-10-15 06:25:01 -04:00
Matthias Clasen
d83294d313 GtkWidgetAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
This also required removing access to GtkWidgetAccessible innards
from several accessible implementations.
2012-10-15 06:04:11 -04:00
Matthias Clasen
19fc090354 GtkTreeViewAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-15 05:56:41 -04:00
Matthias Clasen
dad727d41c GtkToplevelAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
This also required removing access to GtkToplevelAccessible innards
from the GtkWindowAccessible implementation.
2012-10-15 05:52:04 -04:00
Matthias Clasen
f1594c39be GtkTextViewAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-15 05:31:09 -04:00
Matthias Clasen
d13b70f779 GtkTextCellAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 21:21:34 -04:00
Matthias Clasen
8b667e006a GtkRendererCellAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
This also required removing access to GtkRendererCellAccessible innards
from various cell accessible implementations.
2012-10-14 21:07:46 -04:00
Matthias Clasen
06542b2b59 GtkRadioMenuItemAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 20:48:30 -04:00
Matthias Clasen
8b6e962811 GtkRadioButtonAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 20:18:57 -04:00
Matthias Clasen
0ea0293356 GtkNotebookPageAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 20:15:28 -04:00
Matthias Clasen
c86628b41e GtkNotebookAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 20:09:58 -04:00
Matthias Clasen
f44c9dff3d GtkMenuItemAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 20:01:37 -04:00
Matthias Clasen
9a41636988 GtkLinkButtonAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 19:55:59 -04:00
Matthias Clasen
b8e4543ff3 GtkLabelAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 19:51:14 -04:00
Matthias Clasen
1ea3979864 GtkImageCellAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 19:43:47 -04:00
Matthias Clasen
0bbfcc2491 GtkImageAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 19:38:08 -04:00
Matthias Clasen
538c241951 GtkIconViewAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 16:06:08 -04:00
Matthias Clasen
4745adaeff GtkEntryAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 15:59:58 -04:00
Matthias Clasen
0ad379708f GtkContainerCellAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
This also required removing access to GtkContainerCellAccessible
innards from the GtkCellAccessible implementation.
2012-10-14 15:56:51 -04:00
Matthias Clasen
978f336aa4 GtkContainerAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
This also required removing access to GtkContainerAccessible innards
from the GtkMenuItemAccessible implementation.
2012-10-14 15:56:46 -04:00
Stefano Facchini
95f3fadcbd Remove leftover from commit 7264a996fe 2012-10-14 11:57:58 +02:00
Matthias Clasen
1dc4d2c621 GtkComboBoxAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 02:47:22 -04:00
Matthias Clasen
5226327e11 GtkBooleanCellAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 02:40:20 -04:00
Matthias Clasen
7264a996fe GtkArrowAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 02:39:32 -04:00
Yuri Myasoedov
1cb322e870 Fixed Russian translation: Bug 646221 2012-10-13 14:32:58 +04:00
Benjamin Otte
861a031132 tests: Add test for latest bugfix 2012-10-12 17:45:46 +02:00
Benjamin Otte
a81ccff4f5 cssvalue: Print an error when failing to parse background-position
... in the case where a completely invalid value was used.
2012-10-12 17:45:45 +02:00
Patrick Welche
661f0f547b test(1) uses '=' to test if strings are identical
https://bugzilla.gnome.org/show_bug.cgi?id=685996
2012-10-12 14:40:07 +01:00
Kjartan Maraas
1e2e9e2b34 Updated Norwegian bokmål translation. 2012-10-11 20:52:47 +02:00
Piotr Drąg
e9583d850a Updated POTFILES.skip 2012-10-10 22:40:58 +02:00
Cosimo Cecchi
4f0ac15343 Add a visual test for vertical inline toolbars 2012-10-10 13:43:17 -04:00
Cosimo Cecchi
a5ddbaf1f8 toolbar: don't forget to set orientable style classes
So that themes can select for vertical toolbars.
2012-10-10 11:37:16 -04:00
Pavol Klačanský
04b412079a Updated Slovak translation 2012-10-10 12:41:11 +01:00
OKANO Takayoshi
b1198c0f09 [l10n] Update Japanese translation 2012-10-10 14:23:36 +09:00
Kristian Rietveld
c7ce4b6b3d quartz: Actually use the window background PATTERN color
Before we used a window's background color, which resulted in corrupted
display in some cases, presumably because we didn't reset the active
pattern. This patch seems to eliminate the observed corruption.
(cherry picked from commit 0e42cf81f1)
2012-10-09 16:19:29 +02:00
Cosimo Cecchi
e09cf6978e gdk: only emit display-opened after the default display has been set
This avoids a case where the display has been opened, but calling
gdk_display_get_default() in the callback doesn't work.

Reviewed-by: Benjamin Otte <otte@redhat.com>
2012-10-08 18:44:09 -04:00
Luca Ferretti
7cf19c8e4a l10n: Updated Italian translation 2012-10-07 21:18:05 +02:00
Yuri Myasoedov
2a03d59623 Fixed Russian translation 2012-10-07 17:16:09 +04:00
Benjamin Otte
588ee411ad cssimage: Fix gradient start/end computation
This computation is only supposed to happen for repeating gradients, not
for all of them.
2012-10-06 15:56:08 -04:00
Benjamin Otte
b454fc50ed animations: Start transitions from the current value
... instead of from the intrinsic value. This way, we respect running
animations.

Note that the concept of "reversing" transitions is not implemented yet.
2012-10-06 15:55:53 -04:00
Benjamin Otte
55ade04e11 animations: Don't set animated values for finished transitions
Otherwise, that value will never get reset and remain frozen in time.
This is problematic for example when the value is inherited and the
parent changes the value.
2012-10-06 15:55:31 -04:00
Benjamin Otte
f9ddfa28b8 x11: Put function in header, don't declare them extern 2012-10-06 15:55:30 -04:00
Benjamin Otte
dd3c56d783 gdk: Ignore headers for declared functions 2012-10-06 15:55:30 -04:00
Cosimo Cecchi
1a1361c4b3 scrolledwindow: fix wrong allocation of padding and borders
When positioning the scrollbar we were doing several miscalculations
when accounting for CSS paddings and borders. This also fixes a number
of problems with RTL and when scrollbars-within-bevel is FALSE.

https://bugzilla.gnome.org/show_bug.cgi?id=685449
2012-10-04 09:19:30 -04:00
Khoem Sokhem
dd9392a58c [l10n] Added Khmer translation 2012-10-03 17:47:46 +02:00
Benjamin Otte
1037398041 gtk/tests: Fix for -Wmissing-declarations
I'm adding a bunch of fixes for gcc complaining about
-Wmissing-declarations after finding a bunch of cases today where I
had forgotten to make functions static in the CSS code.

This patch fixes the tests in gtk/tests.

After this last patch, the gtk/ subdir should now compile without
warnings when this flag is enabled.
2012-10-02 19:32:53 +02:00
Benjamin Otte
03f5ff20de cssimage: Add transition code for linear-gradient()
This ensures feature-parity with the CSS spec and the -gtk-gradient()
notation.
2012-10-02 19:32:52 +02:00
Benjamin Otte
dd99577691 gtk: Put private functions in headers and include those
This is part of a bunch of fixes for gcc complaining about
-Wmissing-declarations.

It puts functions into headers and includes those headers both where the
functions are defined and where they function are used.
2012-10-02 19:32:52 +02:00
Benjamin Otte
101c6a05a9 gtk: Move gtk_menu_is_empty() function to only user
The function was private and only used by gtkmenuitem.c.

Part of a bunch of fixes for gcc complaining about
-Wmissing-declarations.
2012-10-02 19:32:51 +02:00
Benjamin Otte
12683da8f7 gtk: Make functions static that don't need to be non-static
Also remove the starting underscore from function names where
appropriate, as those functions are static now and not exported anymore.

This is part of a bunch of fixes for gcc complaining about
-Wmissing-declarations.
2012-10-02 19:32:51 +02:00
Benjamin Otte
48c6b3b4f4 gtk: Add get_type() function declarations for private objects
I'm adding a bunch of fixes for gcc complaining about
-Wmissing-declarations.

This set of patches makes private classes in gtk/*.c that use
G_DEFINE_TYPE() safe by adding definitions for the get_type() function
that can't be made static.
2012-10-02 19:32:38 +02:00
Benjamin Otte
9e486139ca a11y: Fix for -Wmissing-declarations
I'll add a bunch of fixes for gcc complaining about
-Wmissing-declarations after finding a bunch of cases today where I had
forgotten to make functions static in the CSS code.

A thorn in those patches is G_DEFINE_TYPE() which doesn't allow making
the get_type() function static, so I added definitions for that function
above the G_DEFINE_TYPE().

After those patches, GTK should compile without warnings when this flag
is enabled.
2012-10-02 19:32:38 +02:00
Benjamin Otte
eddac4911f tests: Remove gdk-pixbuf hacks
The code used to check for uninstalled gdk-pixbuf. Since gdk-pixbuf is
an external library these days, those checks aren't necessary anymore.
2012-10-02 19:32:37 +02:00
Rui Matos
1b5dabac8b window: Delay showing auto mnemonics on focus in
Just as in ed7a417dcb we don't want to
show auto mnemonics immediately but only after a short delay. In
particular this allows to capture screenshots without visible
mnemonics.

https://bugzilla.gnome.org/show_bug.cgi?id=684517
2012-10-02 16:41:40 +02:00
Tristan Van Berkom
8705c59f8c Amended documentation for gtk_widget_set_size_request().
It seems we missed updating this since GTK+3, widgets cannot be
allocated less than the size they requested in thier request
phase, and explicit sizes are used only to grow the size request.
2012-10-02 23:11:39 +09:00
Benjamin Otte
4f6a55d689 cssimage: Implement proper cross-fades for gradients
This is intended mainly to speed up the current situation with spinners
on debug kernels. Because we now don't use a cross-fade to draw the
transition but instead have a real gradient that we draw, we don't need
to use the slow cross-fade code.

https://bugzilla.gnome.org/show_bug.cgi?id=684639
2012-10-02 14:16:37 +02:00
Benjamin Otte
046d004725 gradient: Add a private header file 2012-10-02 14:16:36 +02:00
Benjamin Otte
a67bf5fde4 cssimage: Only create fades if we are actually fading 2012-10-02 14:16:36 +02:00
Benjamin Otte
558ffc24c2 cssimage: Make image transition a vfunc 2012-10-02 14:16:36 +02:00
Benjamin Otte
25271fe781 css: Move special case code for border widths
We need to store the border widths independant of them being set to 0 by
border styles, because otherwise we'd need to track that dependency and
recompute on changes, and I don't want to add more entries to
GtkCssDependencies just for this special case.

By moving the code that does the setting to 0 from the compute stage to
the query stage, we can achieve this.

Now we need to just be aware that the actual value stored is not set to
0 when we use gtk_css_computed_values_get_value().
2012-10-02 14:16:35 +02:00
Alexander Larsson
83c66c9c2c Make process_all_updates draw synchronously
By calling XSync in _gdk_x11_display_after_process_all_updates we
effectively make gdk rendering sync, which avoids problems with the
client animations running faster than the Xserver rendering, thus
filling up the X rendering pipes and essentially "locking up" the
Xserver (i.e. you can't even close the offending window because the
WM is starved too).

I verified this worked by making GtkSpinner paint multiple times on my
intel driver (which has some issue making this rendering slow atm),
and without this patch i get severe lag where even window dragging
stops for 5 seconds when i drag the mouse around. However, with the
patch everything is smooth.

https://bugzilla.gnome.org/show_bug.cgi?id=684639
2012-10-02 13:12:49 +02:00
Matthias Clasen
d6809d050a XIM: Don't force random windows to become native
GDK_WINDOW_XID() has the side-effect of turning a window native;
this in turn can have unexpected effects such as black backgrounds.
Avoid this by using the XID of the toplevel.
https://bugzilla.gnome.org/show_bug.cgi?id=682395
2012-10-01 22:12:07 -04:00
Matthias Clasen
307a1dc638 Trivial typo fix 2012-10-01 22:12:06 -04:00
Benjamin Otte
9a88a47d33 gtk-demo: Beautify a demo
Use auto for the background size instead of 100% to avoid uglyfying the
background byt blurring it when the window gets larger.
2012-10-01 16:06:33 +02:00
Benjamin Otte
f1bae7f1ff gtk-demo: Use explicit resource:// urls in CSS
... because we load the data from a GtkTreeView::changed callback, the
relative directory is cwd. And we want the resources...
2012-10-01 15:53:18 +02:00
Benjamin Otte
ec829be39f gtk-demo: Add missing file to resources 2012-10-01 15:53:17 +02:00
Benjamin Otte
1e0fe40560 widget: Move style context update out of vfunc
Otherwise the evil widgets that don't chain up their map and unmap
vfuncs will not get updated style contexts. This is in particular true
for GtkWindow and the CSS Theming / animated backgrounds demo in
gtk-demo.
2012-10-01 15:53:17 +02:00
Alexander Larsson
db374a0a87 broadway: Use binary websockets if available 2012-10-01 14:58:57 +02:00
Alexander Larsson
86bcd1c22c broadway: Output message data directly to buffer
This cleans up the code, as well as allows later format
changes for e.g. binary websockets
2012-10-01 14:58:57 +02:00
Alexander Larsson
17aea12417 broadway: Encode urls directly into message buffer
No need for a temporary buffer
2012-10-01 14:58:56 +02:00
Alexander Larsson
95d9b17f35 broadway: Restructure output
Now we queue all output commands in a single buffer, to
ensure we send everything in a single op even for v7plus.
2012-10-01 14:58:56 +02:00
Alexander Larsson
203dd8bf7a broadway: Fix indentation 2012-10-01 14:58:56 +02:00
Alexander Larsson
96e7ff73dd broadway: Detect binary websockets support 2012-10-01 14:58:56 +02:00
Alexander Larsson
7c87684629 broadway: Centralize cmd parsing
This clean up things, as well as prepares for new message formats
such as binary websockets.
2012-10-01 14:58:56 +02:00
Benjamin Otte
4943cc4c12 stylecontext: Actually use superset matcher
... when looking up the needed changes.

This is what that matcher was actually written for, but it seems I never
hooked it in.
2012-10-01 14:23:15 +02:00
Benjamin Otte
a31d5379a0 css: Add forgotten enum value
This broke compilation in a7d2138544.
2012-10-01 13:11:11 +02:00
Benjamin Otte
9138fc11cf cssanimation: Don't store the end value in a CSS transition
Instead, query the intrinsic value at runtime.
2012-10-01 13:09:49 +02:00
Benjamin Otte
a7d2138544 treeview: Invalidate children properly
GtkTreeView still uses regions (yay!), so we need to invalidate the
regions when hiding/showing children, and not their siblings.
2012-10-01 11:54:18 +02:00
Benjamin Otte
f1ad9051bd treeview: Fix computing child paths
We were adding the GtkButton class twice.
2012-10-01 11:48:50 +02:00
Benjamin Otte
2f89505b54 csscomputedvalues: Unset the section when setting a new value
Otherwise we end up with the wrong section if no new one is specified.
2012-10-01 10:32:59 +02:00
Cosimo Cecchi
a2bef8ca51 symboliccolor: fix a critical warning
This was introduced in 0cc32eae62
2012-09-28 12:49:22 -04:00
Benjamin Otte
1454ba15ba css: Huge refactoring to avoid computing wrong values
Here's the shortest description of the bug I can come up with:
When computing values, we have 3 kinds of dependencies:
(1) other properties ("currentColor" or em values)
(2) inherited properties ("inherit")
(3) generic things from the theme (@keyframes or @define-color)
Previously, we passed the GtkStyleContext as an argument, because it
provided these 3 things using:
(1) _gtk_style_context_peek_property()
(2) _gtk_style_context_peek_property(gtk_style_context_get_parent())
(3) context->priv->cascade

However, this makes it impossible to lookup values other than the ones
accessible via _gtk_style_context_peek_property(). And this is exactly
what we are doing in gtk_style_context_update_cache(). So when the cache
updates encountered case (1), they were looking up the values from the
wrong style data.

So this large patch essentially does nothing but replace the
context argument in all compute functions with new arguments for the 3
cases above:
(1) values
(2) parent_values
(3) provider

We apparently have a lot of computing code.
2012-09-28 18:27:49 +02:00
Benjamin Otte
0cc32eae62 symboliccolor: Change prototype of _gtk_symbolic_color_resolve_full()
We can juts pass a GtkStyleProviderPrivate, that one has the vfunc we
want already. So no need to pass vfuncs anymore.
2012-09-28 18:27:49 +02:00
Benjamin Otte
448cdb0737 css: Move declaration
... for future changes. This is just to check that compilation still
succeeds.
2012-09-28 18:27:49 +02:00
Benjamin Otte
e2ec13c5d2 cssvalue: Remove unnecessary include 2012-09-28 18:27:49 +02:00
Benjamin Otte
5c4fc16cd4 css: Don't crash when printing gradients
... in the fallback code. Instead print a FIXME.
2012-09-28 18:27:49 +02:00
Benjamin Otte
94c0c1542b cssvalue: Don't crash when printing NULL strings
A NULL string should be printed as "none".
2012-09-28 18:27:49 +02:00
Benjamin Otte
5e1ae36b2f section: Add _gtk_css_section_to_string()
Mostly for debugging pruposes, but use it for printing CSS errors in
GtkCssProvider, too.
2012-09-28 18:27:49 +02:00
Benjamin Otte
8f96966178 window: Fail if the parent window and the visual don't match
They must be on the same screen.
2012-09-28 18:27:49 +02:00
Benjamin Otte
fbb4c61665 stylecontext: Rebuild cached styles with correct classes/regions
Previously, we were using the default classes and regions. That's
obviously wrong.
2012-09-28 18:27:48 +02:00
Kristian Rietveld
4ccf8609ab quartz: Fix garbage content when windows are initially mapped
The garbage would be visible if any widget enabled the toplevel
NSView's CALayer in order to do custom native rendering.
(cherry picked from commit 92ea94af5f)
2012-09-28 10:11:16 +02:00
Cosimo Cecchi
ed3f5a5db4 tests: fix testtreecolumns not to segfault at startup
The class/object definitions have the wrong size, and we're not using
G_DEFINE_TYPE. This fixes the test segfaulting when opening it.
2012-09-27 16:54:40 -04:00
Alexander Larsson
ecd84fac48 iconview: Render focus even in non-selected items
This is needed for the SELECTION_NONE mode where nothing is ever
selected, but its also needed for CTRL-<key> keynav that moves the
focus without changing the selection.

https://bugzilla.gnome.org/show_bug.cgi?id=684984
2012-09-27 19:43:50 +02:00
Stefano Facchini
3c7a6581dc treeview: fix size of the dragged column header
Currently the GdkWindow used for dragging is created once when
the first drag starts, and the reused identical each time.
Instead, just recreate it for each drag, with the correct size.
2012-09-27 17:09:55 +02:00
Alexander Larsson
f9d77959a4 Don't create GdkWindows with NULL parents
This is not multi-display safe, you always need to pick the right
parent based on which screen your widget is at.
2012-09-27 13:46:26 +02:00
Chun-wei Fan
cd6023cd7f Update Visual C++ property sheets
-Make up for the missed headers to "install"
-"Install" the gtk3-demo program and data files more like the way it is
 done with the autotools builds
2012-09-27 17:37:01 +08:00
Chun-wei Fan
5bbf7ac102 Update gtk3-demo Visual C++ projects
Include the missed source files...
2012-09-27 17:21:03 +08:00
Carles Ferrando
ec163b1457 [l10n] Updated Catalan (Valencian) translation 2012-09-26 01:37:47 +02:00
Gil Forcada
dcf55ec040 [l10n] Updated Catalan translation 2012-09-26 01:37:36 +02:00
Matthias Clasen
d6a1c9f209 Bump version 2012-09-24 19:22:12 -04:00
Matthias Clasen
02dba79cf2 Update installation instructions for 3.6 2012-09-24 18:53:03 -04:00
Matthias Clasen
1ab0ce6401 Update release notes for 3.6 2012-09-24 18:51:51 -04:00
Matthias Clasen
a5ef604ce5 Update expected output of colorchooser a11y test 2012-09-24 18:39:17 -04:00
Matthias Clasen
f8fe097fc0 Update expected output of entries a11y test 2012-09-24 18:38:29 -04:00
Matthias Clasen
f25b5c056e 3.6.0 2012-09-24 16:51:57 -04:00
Petr Kovar
ee4ed40815 Update Czech translation 2012-09-24 22:34:53 +02:00
Petr Kovar
2640ff5727 Update Czech translation 2012-09-24 17:18:39 +02:00
Timur Zhamakeev
325297ea98 Updated LINGUAS for Kyrgyz translation 2012-09-24 15:50:24 +06:00
Timur Zhamakeev
da2c37442b Added Kyrgyz translation 2012-09-24 15:49:45 +06:00
Timur Zhamakeev
f4c24968ed Added Kyrgyz translation of po-properties 2012-09-24 15:40:12 +06:00
Matthias Clasen
4b5db54fa7 Remove gtk_menu_button_[sg]et_menu
These functions were never in a stable release, and have
been renamed to gtk_menu_button_[sg]et_popup.
2012-09-24 00:08:30 -04:00
Matthias Clasen
0b11e08f87 Straigthen includes in gtkmenubutton.[hc]
Don't include gtk.h, but just include whats needed.
2012-09-24 00:01:39 -04:00
Matthias Clasen
31698e718c Fix the build 2012-09-23 23:57:34 -04:00
Matthias Clasen
f9ed513361 Add a missing GDK_AVAILABLE_IN annotation 2012-09-23 23:38:04 -04:00
Matthias Clasen
563a874f0f Typo fix 2012-09-23 23:37:46 -04:00
Matthias Clasen
67303a151e Add missing symbols to the docs 2012-09-23 23:37:27 -04:00
Matthias Clasen
b1f3f9d6a0 Small updates to RELEASE-HOWTO 2012-09-23 23:00:38 -04:00
Matthias Clasen
cfb6da9b55 Document gtk_application_get_window_by_id 2012-09-23 21:15:27 -04:00
Matthias Clasen
1bfa58951c Remove empty doc comments
These confuse gtk-doc. All these functions are documented
in gtkclipboard.c
2012-09-23 21:14:46 -04:00
Matthias Clasen
26680176ab Update links for gtk2 docs 2012-09-23 19:47:08 -04:00
Rafael Ferreira
c160d89156 Updated Brazilian Portuguese Translation 2012-09-23 20:34:51 -03:00
Yuri Myasoedov
855881f574 Updated Russian translation 2012-09-23 20:27:29 +04:00
Mario Blättermann
bc331b802c [l10n] Updated German translation 2012-09-23 14:10:08 +02:00
Mario Blättermann
81c0d11551 [l10n] Updated German translation 2012-09-23 14:04:59 +02:00
Shankar Prasad
af4e7d69c7 Updated kn translation 2012-09-23 01:53:24 +05:30
Shankar Prasad
95a75fc925 Updated kn translation 2012-09-23 01:53:24 +05:30
Rūdolfs Mazurs
34ad030645 Updated Latvian translation 2012-09-22 20:00:25 +03:00
Yaron Shahrabani
b0831691ea Updated Hebrew translation. 2012-09-22 15:23:05 +03:00
Carles Ferrando
711b423230 [l10n]Updated Catalan (Valencian) translation 2012-09-22 13:30:20 +02:00
Gil Forcada
b72ca33a9d [l10n] Updated Catalan translation 2012-09-22 13:30:10 +02:00
Alexander Shopov
a2b84f1f28 Updated Bulgarian translation 2012-09-22 12:02:42 +03:00
Matthias Clasen
d03ceb8b2c GtkMenuButton: improve rtl support
Show the menu at the side the arrow points to,
also in rtl locales.
https://bugzilla.gnome.org/show_bug.cgi?id=684606
2012-09-21 23:53:11 -04:00
Matthias Clasen
72d8deb606 GtkSearchEntry: add rtl support
Flip the clear icon in rtl locales.
https://bugzilla.gnome.org/show_bug.cgi?id=684607
2012-09-21 23:41:28 -04:00
Benjamin Otte
cca8cd2b21 Revert "blur: Use recording surface for capturing things to blur"
This reverts commit f2cb8f1270.

The patch actually didn't work for at least text. I currently have no
clue why, but I suspect it requires investigating Cairo code and
recording surfaces, and I'll not do that right now.
2012-09-21 18:51:46 +02:00
Benjamin Otte
c6a78d76bd gtk-demo: Add a CSS shadows demo 2012-09-21 18:50:50 +02:00
Fran Diéguez
0c16058bc6 Updated Galician translations 2012-09-21 13:26:50 +02:00
Sweta Kothari
2a67436640 Updated gujarati file 2012-09-21 13:05:27 +05:30
Sweta Kothari
efc90c730e Updated gujarati file 2012-09-21 12:56:48 +05:30
Pavel Vasin
71d2b68da0 GtkMenuItem: fix leaked action_helper 2012-09-20 15:17:20 -04:00
Мирослав Николић
de5bfaab1f Updated Serbian translation 2012-09-20 20:42:09 +02:00
Ryan Lortie
85700627aa gtkapplication: fix some crashing "leak fixes"
https://bugzilla.gnome.org/show_bug.cgi?id=684258
2012-09-20 14:22:52 -04:00
Runa Bhattacharjee
f83c79b665 Updated Bengali Translation 2012-09-20 19:47:41 +05:30
Ignacio Casal Quinteiro
d39977878e colobutton: skip set_rgba as it is already in the choosercolor interface 2012-09-20 12:51:10 +02:00
Krishnababu Krothapalli
324c74ad20 Updated Telugu Translations 2012-09-20 16:17:42 +05:30
Krishnababu Krothapalli
2e75a12d6e Updated Telugu Translations 2012-09-20 16:17:09 +05:30
Benjamin Otte
f2cb8f1270 blur: Use recording surface for capturing things to blur
This gets around clipping issues quite nicely and provides us with a
(mostly theoretical) performance boost.
2012-09-20 02:45:42 +02:00
Andrea Cimitan
3377271ef0 shadow: add blur to icon-shadow (spinner) 2012-09-20 02:45:42 +02:00
Andrea Cimitan
10e2684870 shadow: add blur to icon-shadow (icon) 2012-09-20 02:45:42 +02:00
Andrea Cimitan
7c3864ba79 shadow: add blur to box-shadow 2012-09-20 02:45:42 +02:00
Andrea Cimitan
59eb3ef30e shadow: add blur to text-shadow 2012-09-20 02:45:41 +02:00
Cosimo Cecchi
b609686133 shadow: add code to render blurred shadows
Split out the blurred shadow rendering in three steps:
- creation of a surface of the appropriate size - we use the clip
  rectangle as a good measurement for the size, since we won't render
  out of it anyway
- painting the unblurred shape on the surface - this is responsibility
  of the single shadow implementations
- blur the surface and compose the result back on the original cairo_t

This means we can share code between the implementations for the first
and third steps; it also makes the code independent of the rendered
size, so we can avoid passing down a cairo_rectangle_t with e.g. the
icon coordinates.
2012-09-20 02:45:41 +02:00
Benjamin Otte
a239f2e8b0 blur: Do the same thing for rows and cols 2012-09-20 02:45:41 +02:00
Benjamin Otte
502a2bf625 blur: Use rowstride 2012-09-20 02:45:41 +02:00
Benjamin Otte
65ba8901aa blur: Simplify code
It's always the same code, so there's no need for switch statements.
2012-09-20 02:45:41 +02:00
Benjamin Otte
267d1793c6 blur: Fix pixel sizes
The code accesses pixels in a chunks of 4 bytes, so we must only support
formats where the size of a single pixel is 4 bytes.
Fix RGB24 to be 4 bytes (the alpha channel is ignored) and disallow A8.
2012-09-20 02:45:41 +02:00
Benjamin Otte
1cecaf6d7e blur: Take the radius as a double parameter
It's only ever used like that
2012-09-20 02:45:41 +02:00
Andrea Cimitan
43673dafdc Add code for blurring (original code from Unico, copyright fine for Gtk+) 2012-09-20 02:45:41 +02:00
Ani Peter
75e746f9ef Updated Malayalam file 2012-09-20 02:28:21 +05:30
Ani Peter
02e8e6bd45 Updated Malayalam file 2012-09-20 02:26:53 +05:30
Cosimo Cecchi
2d5fa78528 spinbutton: fix style context path for internal buttons
We were adding one child too much to the style context path when
generating it for the internal buttons, which in turn caused sibling
selectors from the theme such as :first-child to apply to both buttons
under certain circumstances. Spotted by Lapo Calamandrei.
2012-09-19 15:41:19 -04:00
Cosimo Cecchi
67e44e6a4e Revert "levelbar: start filling from the bottom"
This reverts commit 4b3ed75f7d.

I didn't see https://bugzilla.gnome.org/show_bug.cgi?id=684288 - it
makes more sense to properly fix this for the next cycle.
2012-09-19 15:23:43 -04:00
Stefano Facchini
4b3ed75f7d levelbar: start filling from the bottom
As long as we don't have an API for explicitly inverting the bar, it
makes more sense for the progress in vertical orientation to fill from
the bottom.
2012-09-19 15:18:45 -04:00
Praveen Illa
7af52ba222 Updated Telugu Translation 2012-09-20 00:09:18 +05:30
Marek Kasik
be7752183e printing: Add "Custom." prefix only once to paper size
Check whether "Custom." prefix is already present in the name
of selected paper size. (#679883)
2012-09-19 18:03:41 +02:00
A S Alam
2d3aee2132 update Punjabi Translation 2012-09-19 19:18:39 +05:30
Benjamin Otte
6696aa2128 cssprovider: Remove another path that can't be reached
... because the return value of a function is always TRUE.
2012-09-19 15:32:38 +02:00
Benjamin Otte
697ed544dd docs: Clarify GtkCssProvider loading return values 2012-09-19 15:30:21 +02:00
Benjamin Otte
ee91f22086 cssprovider: Get rid of return value
... that is always TRUE.
2012-09-19 15:18:51 +02:00
Rajesh Ranjan
30a52ab1f4 hindi update 2012-09-19 17:28:41 +05:30
Rajesh Ranjan
eecbaaf90a hindi update 2012-09-19 17:21:34 +05:30
Murray Cumming
1c366eb75e GtkSettings: Fix small typo in docs. 2012-09-19 09:54:47 +02:00
Fran Diéguez
760f9f55ea Updated Galician translations 2012-09-19 03:05:38 +02:00
Matthias Clasen
a54b43ad4f bump version 2012-09-18 18:36:33 -04:00
Matthias Clasen
890891796a 3.5.18 2012-09-18 18:35:16 -04:00
Matthias Clasen
b016822f3b Prepare for 3.5.18 2012-09-18 17:35:16 -04:00
Matthias Clasen
b46ef0eb87 Fix distcheck
A mention of gtkmodelmenu.h was leftover in Makefile.am.
2012-09-18 15:10:55 -04:00
Matthias Clasen
e0f2492ce8 Avoid an unintented export
GtkStyleCascade is entirely private, so don't leak any symbols.
2012-09-18 13:54:22 -04:00
Matthias Clasen
5f9b010b94 Fix gdk docs build
This took far too long: The actual problem turned out to
be an unclosed <SECTION> in gdk3-sections.txt.
2012-09-18 13:54:22 -04:00
Matthias Clasen
e95490c15e GdkWindow: remove reference to a long-removed example 2012-09-18 13:54:22 -04:00
Cosimo Cecchi
5addd8cbe6 mountoperation: fix previous commit
We don't want to call this method if there's no shell agent.
2012-09-18 13:48:07 -04:00
Cosimo Cecchi
a67e885531 mountoperation: don't timeout proxied mount operation dialogs
When we proxy mount operation dialogs to the Shell agent, don't use a
timeout for the remote calls, since we will be waiting on user
interaction.
2012-09-18 13:46:14 -04:00
Daniel Mustieles
9cc918b642 Updated Spanish translation 2012-09-18 16:37:16 +02:00
Benjamin Otte
4ff9b07490 Raleigh: Improve the spinner animation
Make it closer to how it was previously.
2012-09-18 15:28:42 +02:00
Ryan Lortie
99a53112ec GtkAccelLabel: adjust recent accel changes
In the event that a GtkAccelKey was present for the closure but it
contained a keyval of 0 the previous code would show "".  After the
recent adjustments, "-/-" would be shown in this case.

It turns out to be a pretty common case, so fix the logic to stop using
'0' as a magic value to mean "don't have an accel" and add a separate
boolean for that purpose.
2012-09-18 08:57:53 -04:00
Benjamin Otte
8c3caae33f cssimage: Add a hack to get antialiased circles
We like to draw circles in themes, and as radial gradients are the only
okayish way to do that, at least make them antialiased.
2012-09-18 13:26:20 +02:00
Sandeep Sheshrao Shedmake
db089f4b8a Updated Marathi Translations 2012-09-18 13:19:41 +05:30
Bruce Cowan
6af7d82c90 Updated British English translation 2012-09-18 08:24:49 +01:00
Matthias Clasen
bf2cf23262 Force spinners to be square 2012-09-17 22:47:36 -04:00
Matthias Clasen
6210e7fb80 GtkSettings: Properly clean up style providers 2012-09-17 22:31:25 -04:00
Matthias Clasen
ab3d6a0b0a Revert "Bind the themes to the livecycle of the screen"
This reverts commit 1f5dea9eba,
since it was causeing noticable behaviour changes.

Previously, GTK_DATA_PREFIX=/ ./gtk3-demo would start
gtk3-demo with the Raleigh theme. With that change, it
was starting with no theme at all (i.e. all black).
2012-09-17 22:31:25 -04:00
Gabor Kelemen
9bd037aafe Updated Hungarian translation 2012-09-18 01:10:20 +02:00
Matthias Clasen
fc1169279e gtk-demo: fancier css demo
Thanks to Lapo Calamandrei.
2012-09-17 17:41:50 -04:00
Rafael Ferreira
e56f73c32b Updated header for Brazilian Portuguese. 2012-09-17 15:40:58 -04:00
Og B. Maciel
da69e09d63 Updated Brazilian Portuguese translation. 2012-09-17 15:40:58 -04:00
Benjamin Otte
047b6b7194 css: Add a spinner animation to the default theme 2012-09-17 20:40:01 +02:00
Benjamin Otte
0cecf315fd cssanimation: Implement pausing the animation 2012-09-17 20:40:01 +02:00
Benjamin Otte
d74e1b9ac9 stylecontext: Always create animations
Even when there is no current values, do create animations. This ensures
that animations do exist for unmapped widgets when they get mapped
later.
2012-09-17 20:40:01 +02:00
Benjamin Otte
4a281edc87 stylecontext: Only create transitions conditionally
While regular animations should always be created, transitions should
not. This patch allows to express this by passing NULL as the values to
transition from.

It also adds a gtk_style_context_should_create_transitions() function
that returns TRUE when transitions should be created.
2012-09-17 20:40:01 +02:00
Benjamin Otte
7712d41b5e stylecontext: Refactor the way animations are started and stopped
We now create animation objects unconditionally, but we only run the
animation loop when gtk_style_context_should_animate() return TRUE.
2012-09-17 20:40:01 +02:00
Benjamin Otte
13cbd22d17 stylecontext: Clear animations for values kept in cache 2012-09-17 20:40:01 +02:00
Benjamin Otte
37dac2a481 stylecontext: Remove leftover debugging
... that actually was both wrong, a performance failure and has been
there since the original checkin.

Updating the cached style data absolutely does not mean clearing all
cached style data first. There's nothing to update then.
2012-09-17 20:39:14 +02:00
Benjamin Otte
e2cc9f3afc csscomputedvalues: Handle starting animations differently 2012-09-17 20:39:14 +02:00
Benjamin Otte
bf19d89510 animation: Don't set the changed properties anymore
The code is not needed anymore. And it looked wrong, too, so I'm glad
it's gone.
2012-09-17 20:39:13 +02:00
Benjamin Otte
2147473131 csscomputedvalues: Compute the changes by animations ourselves
Instead of letting the animation set a bitmask unconditionally, actually
compare the before and after values for changes.
2012-09-17 20:39:13 +02:00
Benjamin Otte
ee6f886434 cssimage: Make cross-fade code safe for non-integer sizes
This includes sizes < 1px, which previously caused a SEGV.
2012-09-17 20:39:13 +02:00
Benjamin Otte
f77f6f3322 cssvalue: Fix out-of-bounds in array transition code 2012-09-17 20:39:13 +02:00
Cosimo Cecchi
ebf9e9db42 themingengine: animate spinners again
Using the animation specified with CSS by the theme.
2012-09-17 20:39:13 +02:00
Benjamin Otte
7cf2adfec4 cssvalue: Always consider values equal to themselves 2012-09-17 20:39:13 +02:00
Cosimo Cecchi
bdd64dc055 csseasevalue: fix wrong priority in steps easing transformation
We need to add parentheses around the ternary operator, or it will be
applied to the whole expression.
2012-09-17 20:39:13 +02:00
Benjamin Otte
23cc1e9528 tests: Add a simple CSS test for cross-fade 2012-09-17 20:39:13 +02:00
Benjamin Otte
eb6ad3562e cssimage: Implement (most of) current cross-fade syntax
The CSS4 spec adapted their cross-fade syntax again. Yay!
(The previous parser was completely broken anyway...)
2012-09-17 20:39:13 +02:00
Benjamin Otte
a7ec3ba53f csscomputedvalues: Get rid of animated values
Merge the animated values code into the computed values code. This
should get rid of various bugs related to animated->computed updating.
2012-09-17 20:39:12 +02:00
Benjamin Otte
7248c19037 csscomputedvalues: Store animated values here
Actually use the GtkCssComputedValues to store the computed values here
instead of putting them into the GtkCssAnimatedValues separately.
2012-09-17 20:39:12 +02:00
Benjamin Otte
94a3bd21e5 csscomputedvalues: Allow storing animated values here
It's not used yet, but that will come in the next patch(es). This is a
separate patch to make sure we didn't mess up anything.
2012-09-17 20:39:12 +02:00
Benjamin Otte
89d6d34bee csscomputedvalues: Inline function 2012-09-17 20:39:12 +02:00
Benjamin Otte
7224f897d6 animation: Add _gtk_style_animation_is_static()
This will be useful to not trigger updates all the time when nothing is
happening (ie due to animations being paused or due to them having
reached their final value).
2012-09-17 20:39:12 +02:00
Benjamin Otte
229b6fe17a css: Add animation support
This adds the GtkCssAnimation class and the code needed to hook it into
GtkStyleContext. It takes the values out of the CSS "animation"
properties and does animations. See
  http://dev.w3.org/csswg/css3-animations/
for details.

Note that the code for starting and stopping animations with widget
visibility doesn't work yet.
2012-09-17 20:39:12 +02:00
Benjamin Otte
206aa209ae widget: Use gtk_widget_queue_draw() for queueing redraws
This change is necessary because the old code did not accound for corner
cases (like translucent child windows), which could stop
gtk_widget_queue_resize() to not trigger redraws.
2012-09-17 20:39:12 +02:00
Benjamin Otte
554002028c stylecontext: Provide a function for getting the style provider
This will be necessary for creating the computed values for keyframes.
2012-09-17 20:39:12 +02:00
Benjamin Otte
e1e9dec1b2 window: Add the .background class to windows unconditionally 2012-09-17 20:39:11 +02:00
Benjamin Otte
854585e770 css: Implement 'animation' shorthand parsing 2012-09-17 20:39:11 +02:00
Benjamin Otte
677941dc48 gtk-demo: Add animated pixbufs example 2012-09-17 20:39:11 +02:00
Benjamin Otte
c5551e55ce tests: Add test for last commit 2012-09-17 20:39:11 +02:00
Benjamin Otte
c69e30d65a cssparser: Don't use a free'd string in error messages 2012-09-17 20:39:11 +02:00
Benjamin Otte
5510bef70a cssstyleproperty: Add animation properties 2012-09-17 20:39:11 +02:00
Benjamin Otte
0185e323db cssvalue: Add animation enum properties 2012-09-17 20:39:11 +02:00
Benjamin Otte
e6c951a303 styleprovider: Add query function for keyframes 2012-09-17 20:39:11 +02:00
Benjamin Otte
cdbc6f48bb tests: Add parsing test for keyframe parsing
Ensure we order properly when printing
2012-09-17 20:39:11 +02:00
Benjamin Otte
1bbd3235db tests: Add tests for keyframe parsing
Ensure we parse empty keyframes correctly
2012-09-17 20:39:10 +02:00
Benjamin Otte
c4cdb33b32 cssprovider: Add parsing support for @keyframes 2012-09-17 20:39:10 +02:00
Ryan Lortie
3ee837564e gtk.symbols fixup 2012-09-17 12:34:33 -04:00
Ryan Lortie
dd143479fe gtkmodelmenu: simplify logic, expose bind API
Make the main (and only) entry-point to gtkmodelmenu.c the now-public
gtk_menu_shell_bind_model().

Move the convenience constructors (gtk_menu_new_from_model() and
gtk_menu_bar_new_from_model()) to their proper files.

Remove the private header file.

Simplify the code a bit by making the initial populate part of the
bind() call.

https://bugzilla.gnome.org/show_bug.cgi?id=682831
2012-09-17 12:31:22 -04:00
Ryan Lortie
778aa7ade0 GtkAccelLabel: add manual accel API
Add an API to GtkAccelLabel for hardcoding the accel key to be displayed
(ie: allowing us to bypass the GtkAccelGroup lookup).

Use that from the GMenuModel-based GtkMenu construction code instead of
passing around the accel group.

This makes accel labels work in bloatpad again.

This patch effectively removes any hope of automatic runtime accel
changes in GMenuModel-based menus without additional application
support but it leaves the door open for this to be supported again in
the future (if we decide that it's important).

https://bugzilla.gnome.org/show_bug.cgi?id=683738
2012-09-17 12:31:22 -04:00
Ryan Lortie
338b5f6c2d GtkModelMenuItem: add a submenu action attribute
Add support for a stateful action associated with a submenu.  The action
state is set to TRUE when the menu is shown and FALSE when it is
unshown.

This is useful to avoid unnecessary processing for menus that have
frequently-changing content.

A possible future feature is to add support for asynchronously filling
the initial state of the menu by waiting until the action actually emits
its state-change signal to TRUE before showing the menu.

A silly example has been added to Bloatpad to demonstrate the new
feature.

https://bugzilla.gnome.org/show_bug.cgi?id=682630
2012-09-17 12:31:21 -04:00
Lars Uebernickel
9480e21506 Add example for "action-namespace" attribute 2012-09-17 12:31:21 -04:00
Theppitak Karoonboonyanan
722081a9ef Updated Thai translation. 2012-09-17 22:38:35 +07:00
William Jon McCann
b05224b059 Add back gtk_css_provider_get_named
Was in the original patch but was not in 1f5dea9 probably due to
a bad rebase.

https://bugzilla.gnome.org/show_bug.cgi?id=683896
2012-09-17 09:54:26 -04:00
Cosimo Cecchi
e34467a375 menubutton: set DROPDOWN_MENU hint on the menu toplevel
Restore the behavior introduced in
598163e526, which regressed in commit
5a3442bf9c.
2012-09-17 09:50:03 -04:00
Ignacio Casal Quinteiro
50e5323e51 Do not introspect gtk_color_button_get_rgba.
This method is deprecated so it gets in the way of the
implemented gtk_color_chooser_get_rgba.
2012-09-17 14:52:08 +02:00
Matthias Clasen
70384941fb Preserve gtk_widget_get_default_style semantics
Make sure that we return a GtkStyle even if there's no screen yet.
2012-09-17 07:53:44 -04:00
Nilamdyuti Goswami
74f011d24e Assamese translation updated 2012-09-17 13:19:25 +05:30
Matthias Clasen
bc17073a25 Move the gtk_shadow_type check down to gtk_render_frame
In gtk_menu_bar_draw, the check for shadow type != none
disables rendering of the background instead of the frame.
The check should be moved down to gtk_render_frame.
Patch by Peter de Ridder,
http://bugzilla.gnome.org/show_bug.cgi?id=670390
2012-09-16 23:28:06 -04:00
Sébastien Granjoux
af5ecd77e3 button: Clear highlight when a button is removed from a container
A button is highlighted if the private variable in_button is TRUE.
This variable is set when the pointer is over the button and cleared when
it left the button. When a button is hidden while there is the pointer over
it, GTK generates a leave notification event, in_button is set to FALSE.
But when a button is removed from a container but not destroyed, it is
unrealized and loose its window. It cannot receive the leave notification
event and in_button stay TRUE. So when the button get a new parent it is still
highlighted.

https://bugzilla.gnome.org/show_bug.cgi?id=676890
2012-09-16 23:28:02 -04:00
Sébastien Granjoux
f9e435df43 GtkAssistant: bgo#658694 - Unable to change current page in prepare handler 2012-09-16 23:27:57 -04:00
William Jon McCann
e044676584 Destroy the legacy style with the screen
https://bugzilla.gnome.org/show_bug.cgi?id=683896
2012-09-16 21:36:18 -04:00
William Jon McCann
92ddf14457 Don't leak a ref to the tooltip window
https://bugzilla.gnome.org/show_bug.cgi?id=683896
2012-09-16 21:36:18 -04:00
William Jon McCann
9bd408a58f Destroy the icon factory with the screen
https://bugzilla.gnome.org/show_bug.cgi?id=683896
2012-09-16 21:35:58 -04:00
William Jon McCann
8a9a3949dd Don't leak a ref to the settings
https://bugzilla.gnome.org/show_bug.cgi?id=683896
2012-09-16 20:21:06 -04:00
William Jon McCann
1f5dea9eba Bind the themes to the lifecycle of the screen
https://bugzilla.gnome.org/show_bug.cgi?id=683896
2012-09-16 20:20:44 -04:00
William Jon McCann
5debed5ae2 Shut down a11y when an app shuts down
https://bugzilla.gnome.org/show_bug.cgi?id=684076
2012-09-16 19:31:23 -04:00
Colomban Wendling
5b8d67a0aa fontchooserwidget: scroll to the currently selected row
Scroll to the selection when setting it so the selected font is
visible on screen.  This is especially useful if an initial font is
set for the user to see it.

https://bugzilla.gnome.org/show_bug.cgi?id=684156
2012-09-16 19:09:45 -04:00
Ignacio Casal Quinteiro
909873bc6f Load settings.ini also from XDG_CONFIG_DIRS
https://bugzilla.gnome.org/show_bug.cgi?id=683874
2012-09-16 19:04:14 -04:00
Matthias Clasen
e64317f8e1 Add missing argument in GTK_SPINNER_GET_CLASS 2012-09-16 19:02:29 -04:00
Aurimas Černius
775dbccd58 Updated Lithuanian properties translation 2012-09-16 23:13:43 +03:00
Ignacio Casal Quinteiro
f981fb08b3 gtkoverlay: fix get-child-position annotation 2012-09-16 19:03:14 +02:00
Daniel Mustieles
1187d8fbae Updated Spanish translation 2012-09-16 13:22:54 +02:00
Daniel Mustieles
102aeffa6d Updated Spanish translation 2012-09-16 13:22:41 +02:00
Matthias Clasen
01cfe1b595 Plug a leak 2012-09-16 00:49:04 -04:00
Matthias Clasen
5b13b72287 gtk-demo: Plug 2 small memleaks 2012-09-16 00:49:04 -04:00
Chao-Hsiung Liao
3ea03735cf Updated Traditional Chinese translation(Hong Kong and Taiwan) 2012-09-16 12:39:07 +08:00
Ask H. Larsen
9df54873e4 Updated Danish translation 2012-09-15 23:41:30 +02:00
Ask H. Larsen
33655d556f Updated Danish translation 2012-09-15 23:40:17 +02:00
Matthias Clasen
78c44d31d3 Small tweaks to the DND docs
As pointed out by Columban Wendling in
https://bugzilla.gnome.org/show_bug.cgi?id=684096,
the GtkWidget DND docs were referring to several drag context
members that are private, nowadays.
2012-09-15 16:17:03 -04:00
Matthias Clasen
98ca019c74 Fix a memory leak in GtkCssStringValue 2012-09-15 16:17:03 -04:00
Matthias Clasen
d9c2f40a5d gtk-demo: Plug another small memleak 2012-09-15 16:17:02 -04:00
Matej Urbančič
6e86a5f413 Updated Slovenian translation 2012-09-15 20:51:38 +02:00
Duarte Loreto
0dca4827e1 Updated Portuguese translation 2012-09-15 19:32:37 +01:00
Yuri Myasoedov
8b30cf2386 Updated Russian translation 2012-09-15 19:36:51 +04:00
Alexandre Franke
5be1fb056b Update French translation 2012-09-15 17:34:48 +02:00
Andika Triwidada
8fb339c7ab Updated Indonesian translation 2012-09-15 17:44:42 +07:00
Tom Tryfonidis
9e46137d1c Updated Greek translation 2012-09-15 12:17:22 +03:00
Fran Diéguez
10114eadf7 Updated Galician translations 2012-09-15 01:59:20 +02:00
Piotr Drąg
95d82e68df Updated Polish translation 2012-09-14 23:50:52 +02:00
Piotr Drąg
30a28a0c81 Updated Polish translation 2012-09-14 23:49:34 +02:00
Benjamin Otte
ea9081ae3b cssimage: Make cross-fades cross-fade properly
We need to use OPERATOR_SOURCE to properly fade out the start image
when the end image contains transparency.
2012-09-14 17:33:02 -04:00
Juan Pablo Ugarte
2064987e31 Added GtkActionGroup:accel-group property.
Fixes bug #671786 "Glade XML files cannot set an ImageMenuItem accelerator key from an Action"
2012-09-14 17:58:51 -03:00
Cosimo Cecchi
52ea721551 togglebutton: always set PRELIGHT state when in_button = TRUE
Previously, we would avoid setting the prelight state flag when
button_down was TRUE and draw_indicator = FALSE, which is the normal
case of a GtkToggleButton during a mouse press.
It looks like this behavior was introduced a long time ago with commit
b94e6c0a80. I believe the reason was that
a widget in GTK2 couldn't have more than a single state (e.g.
hover+active) at a given moment.

https://bugzilla.gnome.org/show_bug.cgi?id=684038
2012-09-14 13:38:15 -04:00
Michael Natterer
1ad25dfb81 quartz: Bug 674108 - Hard crash due to wrong NSAutoreleasePool stacking
Apply patch from Kristian Rietveld which addresses two issues
in gdkeventloop-quartz.c:

This patch moves the autorelease pool drain and introduces protection against
the invalidated ufds. Basically, when we suspect ufds has been invalidated by a
recursive main loop instance, we refrain from calling the collect function.
(cherry picked from commit 79b3326eaa)
2012-09-14 15:22:18 +02:00
Мирослав Николић
e181ae84b8 Updated Serbian translation 2012-09-14 09:34:36 +02:00
A S Alam
691b976593 update Punjabi Translation 2012-09-14 07:36:15 +05:30
Matthias Clasen
1bf656f25f gtk-demo: Plug a small memleak 2012-09-13 20:04:38 -04:00
Cosimo Cecchi
f57778e71e stylecontext: fix a StyleData refleak
We were failing to unref the style data in some code paths.

https://bugzilla.gnome.org/show_bug.cgi?id=683627
2012-09-13 17:00:20 -04:00
Aurimas Černius
ee189efbc4 Updated Lithuanian properties translation 2012-09-13 22:55:30 +03:00
Alexandre Franke
da86813bf8 Update French translation 2012-09-13 12:20:05 +02:00
Matthias Clasen
ba2e43111e Plug a small memory leak 2012-09-13 00:14:16 -04:00
Matthias Clasen
357db76c62 Fix doc comment
The setting was only introduced in 3.6.
2012-09-13 00:10:50 -04:00
Tom Tryfonidis
00b4354f85 Updated Greek translation 2012-09-13 03:13:55 +03:00
Duarte Loreto
33d45e138f Updated Portuguese translation 2012-09-12 23:23:32 +01:00
Alejandro Piñeiro
5ff328d21f a11y: Solved leak on gtk_widget_accessible_get_description
https://bugzilla.gnome.org/show_bug.cgi?id=643611
2012-09-12 21:15:59 +02:00
Bastien Nocera
634ebb593c tests: Add accelerator example to testmenubutton
https://bugzilla.gnome.org/show_bug.cgi?id=680962
2012-09-12 18:14:50 +01:00
Timo Jyrinki
97912acbee Finnish translation update by Jiri Grönroos 2012-09-12 18:50:07 +03:00
Adrian Johnson
dd7e8e9414 Don't rotate pdf landscape output 2012-09-12 15:38:37 +02:00
Sandeep Sheshrao Shedmake
2971446d58 Updated Marathi Translations 2012-09-12 18:30:50 +05:30
Daniel Mustieles
b70f556231 Updated Spanish translation 2012-09-12 11:22:23 +02:00
Stefano Facchini
fb18145c06 box: Fix typo
https://bugzilla.gnome.org/show_bug.cgi?id=683718
2012-09-11 21:40:46 +02:00
Andika Triwidada
986e78a2ea Updated Indonesian translation 2012-09-11 23:57:07 +07:00
Matej Urbančič
74236fecfd Updated Slovenian translation 2012-09-11 18:52:18 +02:00
Piotr Drąg
0ca068f831 Updated Polish translation 2012-09-11 16:41:17 +02:00
Nilamdyuti Goswami
4812d7d8ee Assamese translation updated 2012-09-11 19:47:35 +05:30
Nilamdyuti Goswami
ccea63d1cc Assamese translation updated 2012-09-11 19:39:09 +05:30
Kristian Rietveld
64324a5da0 Implement gtk-primary-button-warps-slider GtkSetting
Make GtkRange honor the setting and implement it in the
quartz backend, it proxies the "click in the scroll bar to"
property from the OS X PrefPane.
2012-09-11 11:19:09 +02:00
Bastien Nocera
4519fb53fc tests: Add test for mnemonics in GtkMenuButton
To check https://bugzilla.gnome.org/show_bug.cgi?id=680962
2012-09-10 17:39:27 +01:00
Bastien Nocera
42f953eead gdk: s/availible/available/ 2012-09-10 17:39:27 +01:00
Fran Diéguez
5d539c8800 Updated Galician translations
Signed-off-by: Fran Diéguez <fran.dieguez@mabishu.com>
2012-09-10 15:12:40 +02:00
Daiki Ueno
7937b5d9f1 gdk: fix GI annotation and document for {map,add}_virtual_modifiers
https://bugzilla.gnome.org/show_bug.cgi?id=677559
2012-09-10 15:03:25 +02:00
Matthias Clasen
eb9223c008 Be more strict in ignoring ineffective modifiers
After my recent fix for this, nautilus was still having problems
telling keeping F10 and Shift-F10 apart. With this change, we are
treating levels with the same symbol like inactive levels, ignoring
them entirely.
2012-09-09 18:28:48 -04:00
Matthias Clasen
1c9f52038b widget-factory: Add a second page
The widget-factory was pretty much overflowing, so I've
made it page, and started to fill the second page with
vertical spin buttons. New examples and widgets should
be added to page 2 now.
2012-09-09 16:03:43 -04:00
Alexandre Franke
26f1c08d75 Update French translation 2012-09-09 20:49:05 +02:00
Duarte Loreto
d219565292 Updated Portuguese translation 2012-09-09 01:36:18 +01:00
Duarte Loreto
531c128954 Updated Portuguese translation 2012-09-09 01:33:37 +01:00
Changwoo Ryu
0582d9cfd3 Updated Korean translation 2012-09-09 05:20:59 +09:00
Martin Srebotnjak
dc9cdbd1da Updated Slovenian translation 2012-09-08 21:31:21 +02:00
Arash Mousavi
c3862b18a0 l10n: Updated Persian translation 2012-09-08 15:39:49 +04:30
Aurimas Černius
7a193b82ff Updated properties Lithuanian translation 2012-09-07 20:14:27 +03:00
Ihar Hrachyshka
e7cf6051c4 Updated Belarusian translation. 2012-09-07 18:22:32 +03:00
Yaron Shahrabani
647cd664b0 Updated Hebrew translation. 2012-09-07 16:51:05 +03:00
Yaron Shahrabani
0c6b579db4 Updated Hebrew translation. 2012-09-07 16:49:39 +03:00
Мирослав Николић
a19e5a197c Updated Serbian translation 2012-09-07 08:20:47 +02:00
Мирослав Николић
a2e8d4974c Updated Serbian translation 2012-09-07 08:05:46 +02:00
Matej Urbančič
a3902c2473 Updated Slovenian translation 2012-09-06 21:05:47 +02:00
Gabor Kelemen
2bb72abf67 Updated Hungarian translation 2012-09-06 15:16:50 +02:00
Marek Kasik
1d7ab22099 printing: Don't load custom paper sizes in file backend
Resolves #683474.
2012-09-06 14:32:31 +02:00
Gabor Kelemen
71c3cc8f09 Updated Hungarian translation 2012-09-06 14:02:23 +02:00
Dirgita
b3630a3074 Updated Indonesian translation 2012-09-06 10:57:03 +07:00
Tom Tryfonidis
fb3ba7c4ec Updated Greek translations 2012-09-06 02:55:10 +03:00
Bruce Cowan
ce03f114f2 Updated British English translation 2012-09-05 14:11:55 +01:00
Chao-Hsiung Liao
4b28471137 Updated Traditional Chinese translation(Hong Kong and Taiwan) 2012-09-05 20:11:59 +08:00
Khaled Hosny
a6a940c680 Updated Arabic translation 2012-09-05 09:05:48 +02:00
Matthias Clasen
22b326bb61 Bump version 2012-09-04 23:16:31 -04:00
Matthias Clasen
591c1a8584 3.5.16 2012-09-04 22:24:06 -04:00
Cosimo Cecchi
143a600466 menubutton: clear arrow_widget on remove()
So that we clear its pointer also in case somebody else calls
gtk_container_remove() on the button.
Fixes criticals at startup in e.g. Nautilus.
2012-09-04 09:38:28 -04:00
John Ralls
f2ab3af20a Protect sectond call of nsevent hasPreciseScrollingDeltas from pre-Lion 2012-09-03 16:56:46 -07:00
Matthias Clasen
fa029fd787 Bump version 2012-09-03 19:51:27 -04:00
Matthias Clasen
0ad4846793 3.5.14 2012-09-03 16:04:51 -04:00
Chun-wei Fan
a866ed7378 gtkimcontexttime.c: Check context_ime->client_window is not NULL
Be a bit more careful in get_pango_attr_list() and
get_utf8_preedit_string() to ensure that the client_window is properly
created before proceeding, to avoid access violation/segfault crashes on
Windows with IME installed, especially when running the pickers demo.

https://bugzilla.gnome.org/show_bug.cgi?id=682919
2012-09-03 16:03:58 -04:00
Cosimo Cecchi
d05191a010 entry: fix requisition width/height to use the current pango layout
This way, we can ensure that width/height changes due to the use of
gtk_entry_set_attributes() are correctly reflected in the size request.

https://bugzilla.gnome.org/show_bug.cgi?id=683168
2012-09-03 11:45:51 -04:00
Paolo Borelli
afd99d3579 Make spinbutton orientable
https://bugzilla.gnome.org/show_bug.cgi?id=683168
2012-09-03 11:45:51 -04:00
Carlos Garnacho
daddcbff3e Remove leftover from text selection handles style update
GTK_STYLE_CLASS_INVERTED_CURSOR_HANDLE is no longer defined
as it was left unused by commit 81045779f6
2012-09-03 17:15:28 +02:00
Carlos Garnacho
81045779f6 Improve CSS styling of touch text selection handles
Don't hook on the widget style context and set up instead
a widget path for itself. Also use a common style class
for both handles, with an extra top/bottom class for each
handle.
2012-09-03 17:08:02 +02:00
Daniel Mustieles
28bc9c4525 Updated Spanish translation 2012-09-03 16:07:06 +02:00
Daniel Mustieles
6f7611b438 Updated Spanish translation 2012-09-03 15:59:53 +02:00
Daniel Mustieles
0790aaf011 Updated Spanish translation 2012-09-03 15:59:43 +02:00
Piotr Drąg
a79a7aa5ca Updated Polish translation 2012-09-03 15:58:59 +02:00
Piotr Drąg
e235420aec Updated POTFILES.in 2012-09-03 15:51:38 +02:00
Benjamin Otte
260b587c9c cssvalue: Implement transitioning arrays
Or rather: Implement it for backgrounds, as the animation rules for
arrays vary by property.
2012-09-03 12:54:14 +02:00
Benjamin Otte
e3fc081c5d cssvalue: Pass property ID to transition function
This is to allow animating arrays properly. I'm not really thrilled
about this solution (we leak propertys into the values again...), but
it's the best I can come up with - I prefer it to having N different
array types...
2012-09-03 12:54:14 +02:00
Benjamin Otte
fd7668bfb5 cssvalue: Don't allow empty arrays anymore
CSS arrays aren't empty, even the ones that appear empty contain one
"none" element.
2012-09-03 12:54:14 +02:00
Benjamin Otte
912d5a5c23 cssvalue: Make the array parser no longer parse "none"
Arrays that support it, handle it themselves.
2012-09-03 12:54:14 +02:00
Benjamin Otte
44ba5d253f css: Redo bindings parsing
I want to get away from the ability to have 0-length arrays, all css
arrays are single element.
Even if the element is "none", it is still a "none" element.
2012-09-03 12:54:14 +02:00
Claudio Saavedra
21d0db8254 gtkliststore: fix documentation typo 2012-09-03 11:00:15 +03:00
Matthias Clasen
8c3a668d52 Add a way to test touch features
The GTK_TEST_TOUCHSCREEN envvar is now checked in entries
and textviews to allow testing of text handles with other
kinds of devices.
2012-09-03 00:19:46 -04:00
Carlos Garnacho
5bda3a001d Implement touch text selection in GtkTextView
GtkTextHandle is used to indicate both the cursor position
and the selection bound, dragging the handles will modify
the selection and scroll if necessary.

Backwards text selection is also blocked for touch devices,
so the handles don't get inverted positions and possibly
obscure portions of the selected text.
2012-09-03 00:19:46 -04:00
Carlos Garnacho
d38efb1713 Implement touch text selection in GtkEntry
GtkTextHandle is used to indicate both the cursor position
and the selection bound, dragging the handles will modify
the selection and scroll if necessary.

Backwards text selection is also blocked for touch devices,
so the handles don't get inverted positions (This is more
important though on GtkTextView, as inverted handles may
obscure portions of the selected text, good for consistence
though)
2012-09-03 00:19:46 -04:00
Carlos Garnacho
1f7e375c33 Add GtkTextHandle
This is a helper object to allow text widgets to implement
text selection on touch devices. It allows for both cursor
placement and text selection, displaying draggable handles
on/around the cursor and selection bound positions.

Currently, this is private to GTK+, and only available to
GtkEntry and GtkTextView.
2012-09-03 00:19:03 -04:00
Carlos Garnacho
8c632417c4 scrolledwindow: don't capture events meant for non-child windows
GtkTextHandle creates temporary override redirect windows, but still
hook to the text widget for events, so those are effectively captured
by GtkScrolledWindow if a text widget is within it
2012-09-02 20:30:53 -04:00
Aurimas Černius
3c99587b5d Updated Lithuanian translation 2012-09-02 15:41:45 +03:00
A S Alam
b2b4f397ff update Punjabi Translation for gtk module 2012-09-02 10:20:22 +05:30
Matthias Clasen
314b6abbe8 Try harder to discriminate Shift-F10 and F10
A change in xkeyboard-config 2.4.1 made it so that function keys
now have a shift level which has the same symbol, but 'eats' the
shift modifier. This would ordinarily make it impossible for us
to discriminate between these key combinations.

This commit tries harder to discriminate in 2 ways:
- XKB has a mechanism to tell us when a modifier should not be
  consumed even though it was used in determining the level.
  We now respect such 'preserved' modifiers. This does not fix
  the Shift-F10 vs F10 problem yet, since xkeyboard-config does
  not currently mark Shift as preserved for function keys.
- Don't consume modifiers that do not change the symbol. For
  the function keys, the symbol on the shift level is the same
  as the base level, so we don't consider Shift consumed.

For more background on the xkeyboard-config change, see
https://bugs.freedesktop.org/show_bug.cgi?id=45008

https://bugzilla.gnome.org/show_bug.cgi?id=661973
2012-09-01 23:25:18 -04:00
Rūdolfs Mazurs
0388c05b2f :qUpdated Latvian translation 2012-09-02 00:41:32 +03:00
Piotr Drąg
76b6188ac4 Updated Polish translation 2012-09-01 21:03:42 +02:00
Piotr Drąg
da28cda1b9 Updated Polish translation
Also restore missing copyrights.
2012-09-01 19:36:35 +02:00
Fran Diéguez
8c0f0e9bdc Updated Galician translations 2012-09-01 11:43:32 +02:00
Kjartan Maraas
3efb83946d Updated Norwegian bokmål translation 2012-09-01 10:43:02 +02:00
Nguyễn Thái Ngọc Duy
da945c37ee Updated Vietnamese translation 2012-09-01 13:09:03 +07:00
Nguyễn Thái Ngọc Duy
0ce4707335 po/vi: import from Damned Lies 2012-09-01 13:08:38 +07:00
Matthias Clasen
95f64a4d4d Revert "menubutton: make it work with custom content in .ui file"
This reverts commit 6e6487b461.
2012-08-31 23:10:30 -04:00
Matthias Clasen
9e4b550c98 GtkMenuButton: Override add
By removing an existing child in add, if it is our own arrow,
we can make things work better in GtkBuilder.

https://bugzilla.gnome.org/show_bug.cgi?id=682291
2012-08-31 22:58:25 -04:00
David Zeuthen
6e6487b461 menubutton: make it work with custom content in .ui file
This was reported in bug 682291.

https://bugzilla.gnome.org/show_bug.cgi?id=682291

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
2012-08-31 22:58:10 -04:00
Rui Matos
ed7a417dcb window: Add a delay before automatically showing mnemonics
Showing mnemonics immediately on modifier press can be annoying and
distracting when the user is just trying to Alt+Tab into another
application/window since the mnemonic will show up and quickly vanish
again when we receive the focus out event.

https://bugzilla.gnome.org/show_bug.cgi?id=672431
2012-08-31 22:53:23 -04:00
Matthias Clasen
adcd3a039e Fix positioning of file format radios
When the file name changes, the file format radios were dancing
around. This commit keeps them flush right.
2012-08-31 22:50:29 -04:00
Matthias Clasen
97ee5efb4b Fix mnemonic activation for some printer option widgets
The file type radio group has a mnemonic on its label, but
activating it did not work, since GtkPrinterOptionWidget did
not know to forward the activation to one of the buttons.
2012-08-31 22:50:28 -04:00
Sebastian Geiger
4c67e71c63 Improve print to file options in print dialog
* This patch gets rid of the separated
   fields for selecting a print to file
   target by removing the folder selection
   button and the entry. It is replaced by
   a browse button,  which opens a file
   selection dialog, that can select both
   the path AND the filename.
 * If the filename is relativ to the home
   folder it will substitute ~/ instead of
   the home folder. Additionally if the
   resulting filename is longer than 30
   characters, it cut of the first part
   and replace it by '...' so that
   the button text never gets too long.

https://bugzilla.gnome.org/show_bug.cgi?id=682129
2012-08-31 22:50:28 -04:00
Arash Mousavi
3e656f36b8 l10n: Updated Persian translation 2012-08-31 23:47:31 +04:30
Matthias Clasen
1ac2982265 Allow setting Pango attributes on entries
This is useful to adjust the weight or scale of the text.
2012-08-31 15:09:55 -04:00
Fran Diéguez
2458f4e594 Updated Galician translations 2012-08-31 21:06:05 +02:00
Piotr Drąg
ff54f93741 Updated Polish translation 2012-08-31 20:48:12 +02:00
Sebastian Geiger
afc7466dfd [GtkFileChooserButton] bgo#645065 - Restore the previously-selected file when the button's GtkFileChooserDialog is canceled
The file chooser is asynchronous, so doing 'select_file (old_file)' and subsequently querying
the file for updating the labels is not going to work.  However, the underlying file chooser
will emit 'selection-changed' as appropriate when it finishes restoring the old file.  So,
we only need to update the labels when the file chooser dialog is confirmed, not cancelled.
2012-08-31 12:02:00 -05:00
Matthias Clasen
e5b2ca5d89 Move entry completion code where it belongs
This commit moves all the entry completion implementation
into gtkentrycompletion.c. It also gets rid of an unnecessary
completion_device member in GtkEntryPrivate.
2012-08-31 10:47:23 -04:00
Matthias Clasen
ee2ad441ca GtkEntry: pack GtkEntryPrivate a bit better 2012-08-30 22:14:23 -04:00
Erik van Pienbroek
9d3c8122f1 Also compile gtkdbusgenerated.c on non-UNIX environments
When compiling gtk on Win32 then the file gtkdbusgenerated.c also needs to be
compiled and linked into the gtk library as it's needed for GtkMountOperation

https://bugzilla.gnome.org/show_bug.cgi?id=682825
2012-08-30 21:19:13 -04:00
William Jon McCann
9fa1b4f65f Always make primary headings bold in message dialogs
Unless they have markup. But only use big text if there is
secondary text.

https://bugzilla.gnome.org/show_bug.cgi?id=683001
2012-08-30 14:09:42 -04:00
Baurzhan Muftakhidinov
b25109fbbf Updated Kazakh translation 2012-08-30 23:04:39 +06:00
Matthias Clasen
df40ba521b Remove unintentional symbol export
Just a forgotten static.
2012-08-29 18:16:34 -04:00
Matthias Clasen
3d591ef112 Revert "gtk: Fix exports for new symbols"
This reverts commit 07b33586e2.
2012-08-29 18:15:46 -04:00
Rico Tzschichholz
07b33586e2 gtk: Fix exports for new symbols 2012-08-29 08:17:36 +02:00
Chun-wei Fan
28f30a1374 Update config.h.win32.in
Make the entries more in line with those given in the generated
config.h.in.
2012-08-29 12:19:56 +08:00
Fran Diéguez
3ba2fe9e18 Updated Galician translations 2012-08-29 00:08:53 +02:00
Aurimas Černius
f6ae08c423 Updated Lithuanian translation 2012-08-28 22:17:30 +03:00
Cosimo Cecchi
582a3a3193 scrolled-window: fix rendering of scrolled window background
- don't poke at the children's background pattern at draw time, but just
  call gtk_render_background()
- we should propagate rendering of the background to the overshoot
  window when the state flags or the style changes, or it won't respond
  to e.g. focused/backdrop changes correctly

https://bugzilla.gnome.org/show_bug.cgi?id=682854
2012-08-28 11:51:18 -04:00
Benjamin Otte
fe026b3b2f css: Remove unused macro
GTK_CSS_DEPENDS_ON_EVERYTHING was used as a placeholder when
implementing dependencies. Now that dependencies are completely
implemented, it's no longer necessary.
2012-08-28 15:42:25 +02:00
Benjamin Otte
e1a1432bd3 cssimage: Implement dependencies for images 2012-08-28 15:42:25 +02:00
Benjamin Otte
3a65fbfc13 cssvalue: Implement dependency tracking for gradients 2012-08-28 15:42:25 +02:00
Benjamin Otte
3cf6db8b1a cssvalue: Handle dependencies for typed values 2012-08-28 15:42:24 +02:00
Benjamin Otte
11d0f9e408 css: Make color lookup handle dependencies 2012-08-28 15:42:24 +02:00
Matthias Clasen
27fd3fdf81 css: Handle some more simple cases of dependencies 2012-08-28 15:42:24 +02:00
Benjamin Otte
012526241a cssvalue: First step of proper dependency tracking
Instead of using the EVERYTHING aka FIXME value for tdependencies,
actually compute the dependencies in a bunch of simple cases.
2012-08-28 15:42:24 +02:00
Benjamin Otte
8ff08e7c5e stylecontext: Update computed values when dependencies change
This fixes the longstanding bug where GTK would not update styles when
parent styles would change.

https://bugzilla.gnome.org/show_bug.cgi?id=672046
2012-08-28 15:42:24 +02:00
Benjamin Otte
a770f0c3eb stylecontext: Refactor some code
This just changes the arguments passed to build_properties() and moves
that function around in the source file. No functional changes are
happening.
2012-08-28 15:42:24 +02:00
Benjamin Otte
1d7b23845f css: Pass relevant properties to css lookup code
This is not used yet in this patch.
2012-08-28 15:42:24 +02:00
Benjamin Otte
6fbd8b0003 computedvalues: Pass dependencies to set_value()
This simplifies the code.
2012-08-28 15:42:24 +02:00
Benjamin Otte
8874a06ba0 stylecontext: Compute correct changes
... in the case where no change of the DOM tree actually happened.

We don't do anything yet with that information, this patch just
correctly computes it.
2012-08-28 15:42:24 +02:00
Benjamin Otte
5d2acb1fe9 stylecontext: Split out a function for simplicity 2012-08-28 15:42:23 +02:00
Benjamin Otte
9b228c59d5 cssomputedvalues: Track dependencies
We now track what values have dependencies on what other values so that
we could in theory recompute them when we need to.
2012-08-28 15:42:23 +02:00
Benjamin Otte
2cb9dac14c stylecontext: Pass the changes in the parent to validation function
This way, inherited properties can be updated.
2012-08-28 15:42:23 +02:00
Benjamin Otte
0e2f35ed88 css: Introduce dependencies for value computations
When values are computed, they might depend on various other values and
we need to track this so we can update the values when those other
values change. This is the first step in making that happen.

This patch does not do any dependency tracking at all, instead it uses
GTK_CSS_DEPENDS_ON_EVERYTHING as a sort of FIXME.
2012-08-28 15:42:23 +02:00
Benjamin Otte
9e7e65ca6e css: Move computing of initial and inherit values
... to the compute vfunc. Simplifies code quite a bit. But makes the
code no longer a simple step-by-step implementation of the spec.
2012-08-28 15:40:57 +02:00
Benjamin Otte
6dc3113edc cssstyleproperty: Get rid of unused API
Both _gtk_css_style_property_print_value() and
_gtk_css_style_property_compute_value() aren't necessary anymore and are
replaced by _gtk_css_value_print() and _gtk_css_value_comptue()
respectively.
2012-08-28 15:40:57 +02:00
Benjamin Otte
36c79712a1 csscustomproperty: Move compute code to GtkCssTypedValue
This way, we don't need the print_value vfunc anymore.
2012-08-28 15:40:57 +02:00
Benjamin Otte
c9b918b70f cssstyleproperty: Don't set print or compute vfuncs anymore
Nobody does that these days.
2012-08-28 15:40:57 +02:00
Benjamin Otte
ec4c1e5682 cssstyleproperty: Remove all useless compute vfuncs
Now that we call _compute() by default, we don't need any special cases
anymore that do the same thing.
2012-08-28 15:40:57 +02:00
Benjamin Otte
bc5d383b9d cssstyleproperty: Call _compute() in the compute function
... instead pof just reffing the value.
2012-08-28 15:40:57 +02:00
Benjamin Otte
c0df9067dc css: Move special case for 0px borders
This is in preparation for the next commits.
2012-08-28 15:40:56 +02:00
Benjamin Otte
09f9fd42b4 css: Fold color value computation into gtksymboliccolor.c
This gets rid of the public function
_gtk_css_rgba_value_compute_from_symbolic().
The fallback is now handled using a switch statement instead of letting
the caller pass the function.
2012-08-28 15:40:56 +02:00
Benjamin Otte
9b4ed66218 css: Pass property_id to compute function
This is a reorganization of how value computing should be done.
Previously the GtkCssStyleProperty.compute vfunc was supposed to take
care of special cases when it needed those for computation. However,
this proved to be very complicated in cases where values were nested and
only the last value (of a common type) needed to be special cased.

A common example for this was the fallback handling for unresolvable
colors.

Now, we pass the property's ID along with all compute functions so we
can do the special casing where it's necessary.
Note that no actual changes happen in this commit. This will happen in
follow-ups.
2012-08-28 15:40:56 +02:00
Benjamin Otte
9b953829fb css: Introduce _gtk_css_value_compute()
This commit is essentially a large reorganization. Instead of all value
subtypes having their own compute function, there is the general
_gtk_css_value_compute() function that then calls a vfunc on the
subtype.
2012-08-28 15:40:56 +02:00
Nilamdyuti Goswami
3f00801e9a Implemented FUEL entries to Assamese translation 2012-08-28 00:25:52 +05:30
Nilamdyuti Goswami
d70ccc67dd Implemented FUEL entries to Assamese translation 2012-08-28 00:25:52 +05:30
Jiro Matsuzawa
6bd45f9503 [l10n] Update Japanese translation 2012-08-28 00:03:02 +09:00
Kjartan Maraas
5ccf7913b2 Updated Norwegian bokmål translation 2012-08-27 10:24:01 +02:00
Adel Gadllah
13a821e70b gkimmulticontext: Remove left over debug print
Remove the g_print debug statement from propagate_purpose.

https://bugzilla.gnome.org/show_bug.cgi?id=682747
2012-08-26 22:26:23 -04:00
Tom Tryfonidis
7bc85458cc Updated Greek translations 2012-08-26 23:05:07 +03:00
Nilamdyuti Goswami
488305d2b4 Assamese translation updated 2012-08-26 22:06:09 +05:30
Nilamdyuti Goswami
322a1e72f9 Assamese translation updated 2012-08-26 22:00:31 +05:30
William Jon McCann
b3a65248f5 Fix a typo in the the comments
https://bugzilla.gnome.org/show_bug.cgi?id=682724
2012-08-26 22:54:55 +08:00
Piotr Drąg
45cc254431 Updated Polish translation 2012-08-26 14:52:56 +02:00
Thomas Hindoe Paaboel Andersen
3e7b66fcee Docs: GtkAspectFrame: use top/bottom for vertical alignment
Before left/right was used.

https://bugzilla.gnome.org/show_bug.cgi?id=682662
2012-08-26 01:01:59 +02:00
Timothy Arceri
2ab8e75319 Use new printer setting to reduce code required by application
Updated demo to use new setting that allows an application to change the
output filename without the need to create the uri itself.

https://bugzilla.gnome.org/show_bug.cgi?id=676787
2012-08-25 17:47:55 -04:00
Matthias Clasen
870c39fafe GtkIMMultcontext: Propagate input purpose and hints
The lack of this was pointed out by Carlos Garnacho in
https://bugzilla.gnome.org/show_bug.cgi?id=651244
2012-08-25 15:42:42 -04:00
Carlos Garnacho
8d4487b0be Add GTK_INPUT_HINT_INHIBIT_OSK to GtkInputHints
This hint may be used in text widgets to inhibit their
input methods. The most compelling usecase is calculator
applications, which already have a builtin and better
suited onscreen keyboard.

https://bugzilla.gnome.org/show_bug.cgi?id=651244
2012-08-25 15:42:30 -04:00
Matthias Clasen
0cb56312b9 Trivial: Fix a whitespace messup
Pointed out by Carlos Garnacho in bug 651244.
2012-08-25 14:24:20 -04:00
Daniel Mustieles
3b495daccc Updated Spanish translation 2012-08-25 12:08:08 +02:00
Nguyễn Thái Ngọc Duy
ac0c937d2c Updated Vietnamese translation 2012-08-25 11:19:37 +07:00
Nguyễn Thái Ngọc Duy
f98b501b12 po/vi: import from Damned Lies 2012-08-25 11:17:02 +07:00
Piotr Drąg
4c36ba89a2 Updated Polish translation 2012-08-25 00:29:48 +02:00
William Jon McCann
e296bff85f Improve the layout of the mount operation dialog
This improves the layout of the mount operations dialog to:
 * Make primary labels bold in all cases
 * Lay out the widgets in a grid
 * Put space between the two radio groups to distinguish them

https://bugzilla.gnome.org/show_bug.cgi?id=682552
2012-08-24 18:10:39 -04:00
567 changed files with 245539 additions and 77841 deletions

View File

@@ -18,12 +18,12 @@ GTK+ requires the following packages:
Simple install procedure Simple install procedure
======================== ========================
% gzip -cd gtk+-@GTK_VERSION@.tar.gz | tar xvf - # unpack the sources % tar xf gtk+-@GTK_VERSION@.tar.xz # unpack the sources
% cd gtk+-@GTK_VERSION@ # change to the toplevel directory % cd gtk+-@GTK_VERSION@ # change to the toplevel directory
% ./configure # run the `configure' script % ./configure # run the `configure' script
% make # build GTK+ % make # build GTK+
[ Become root if necessary ] [ Become root if necessary ]
% make install # install GTK+ % make install # install GTK+
The Details The Details
=========== ===========

275
NEWS
View File

@@ -1,3 +1,278 @@
Overview of Changes in GTK+ 3.7.2
=================================
* Theming:
- Improve touch text handle theming
- Always draw background of menuitems
* Geometry management
- Size groups now handle height-for-width
- Fix corner cases in label size allocation
* Accessibility
- Make entry icons accessible
* Filechooser
- Don't add duplicate bookmarks
- Remember sidebar width
* Wayland: Build against wayland-client 1.0
* Bugs fixed:
524295 remember the file chooser side pane's position
577806 gtk_file_chooser_add_shortcut_folder adds duplicates...
677609 GtkSizeGroup regression in GTK+ 3.3.20
683896 Clean up global resources when the display is closed
686021 spinner animation should not be subject to enable-an...
686347 Clickable icons are not accessible as children of te...
687059 icon-theme: support loading symbolic GFileIcons from...
687196 filesystemmodel: invalidate nodes on file remove
687467 Commit "Implement proper cross-fades for gradients" ...
687842 Support partially transparent widgets
687872 Segfault when attempting to get character extents fo...
687977 icon-theme: Add some preconditions for NULL arguments
* Translation updates:
Assamese
Brazilian Portuguese
Estonian
Galician
German
Greek
Gujarati
Indonesian
Latvian
Lithuanian
Marathi
Norwegian bokmål
Serbian
Slovenian
Spanish
Traditional Chinese
Overview of Changes in GTK+ 3.7.0
=================================
* Add an "inverted" property to GtkLevelBar
* Support RTL flipping in GtkLevelBar
* Various memory leak fixes
* Wayland: Update for protocol changes
* Bugs fixed:
684288 level-bar: add an "inverted" property like GtkProgr...
684415 Fix drag-motion event handling
684980 Improve the appearance of the dragged header
686013 CSS: crash drawing a GtkEntry in gedit
686152 Calls gdk_window_get_frame_extents with a potential...
686209 memleak with "text-shadow" css
686265 scrolledwindow: set GDK_EXPOSURE_MASK on the oversh...
686280 GtkScrollbar and GtkScale rendering broken in gtk 3.6
686366 Use named union for _GtkSymbolicColor in gtk/gtksym...
* Translation updates:
Czech
Estonian
Galician
Indonesian
Lithuanian
Serbian
Slovak
Slovenian
Spanish
Overview of Changes in GTK+ 3.6.1
=================================
* CSS:
- huge refactoring to avoid computing wrong values
- treeview: Invalidate children properly
- treeview: Fix computing child paths
* Broadway:
- use binary websockets when available
* Bugs fixed:
646221 Imperfect Russian translation of 'Print preview'...
682395 Nautilus tabs have black background
684517 window: Delay showing auto mnemonics on focus in
684639 GTK+ 3.5.18 makes Epiphany unusable
684984 No focus rendering for Icon Views in SELECTION_N...
685449 Non-uniform borders on GtkScrolledWindow break c...
685996 trivial build fix: test uses = not ==
Fix a multi-display problem in touch handle code
App chooser: respect NoDisplay
* Translation updates:
Catalan
Catalan (Valencian)
Italian
Japanese
Khmer
Norwegian bokmål
Russian
Slovak
Overview of Changes in GTK+ 3.6.0
=================================
* Add support for blur to CSS shadows
* Bugs fixed:
679883 When printing Custom paper sizes GTK Print Dialog...
684258 Crash when calling gtk_application_set_menubar twice
684606 GtkMenuButton: implement rtl flipping
684607 GtkSearchEntry: flip the clear icon in rtl
Fix style context path for internal buttons
* Translation updates:
Bengali
Brazilian Portuguese
Bulgarian
Catalan
Catalan (Valencian)
Czech
Galician
German
Gujarati
Hebrew
Hindi
Kannada
Kyrgyz
Latvian
Malayalam
Punjabi
Russian
Serbian
Telugu
Overview of Changes in GTK+ 3.5.18
==================================
* GMenu:
- Support namespaces for actions
- Allow submenus to have actions for opening
- New function: gtk_menu_shell_bind_model
* CSS:
- Parse and support CSS animations
- Support cross-fading and transitions
* OS X:
- Adjust scrollbar and scale behavior according to platform
* Bugs fixed
643611 Leak on gail_widget_get_description
658694 GtkAssistant: Unable to change current page in prepare...
670390 -GtkMenuBar-shadow-type: none disables background inst...
671786 Glade XML files cannot set an ImageMenuItem accelerato...
674108 Hard crash due to wrong NSAutoreleasePool stacking
676890 GtkButton are still highlighted after removing them fr...
677559 argument of Gdk.Keymap.map_virtual_modifiers is not co...
680962 GtkMenuButton doesn't display accelerators when used w...
682630 GMenuModel attribute for an action to toggle on submen...
682831 gtkmodelmenu: expose API for action namespace
683474 Print dialog lists custom paper sizes twice for "Print...
683627 Memory leak in style_data_lookup
683718 box: Fix typo
683738 Simplify GtkApplicationWindow accel handling
683874 Load settings.ini also from XDG_CONFIG_DIRS
683896 Clean up global resources when the display is closed
684038 togglebutton: always set PRELIGHT state when in_button...
684076 clean up a11y on shutdown
684096 GtkWidget:drag-data-received code sample refers to rem...
684156 fontchooserwidget: scroll to the currently selected row
* Translation updates
Arabic
Assamese
Belarusian
Brazilian Portuguese
British English
Danish
Finnish
French
Galician
Greek
Hebrew
Hungarian
Indonesian
Korean
Lithuanian
Persian
Polish
Portuguese
Punjabi
Serbian
Slovenian
Thai
Spanish
Russian
Traditional Chinese
Overview of Changes in GTK+ 3.5.16
==================================
* Fix critical warnings on startup in nautilus
Overview of Changes in GTK+ 3.5.14
==================================
* Input method support
- Propagate input purpose and hints to individual IMs
- Add a hint to suppress on-screen keyboards
* GtkEntry can now set Pango attributes for its text
* GtkEntry and GtkTextView show 'selection handles' when
used with touch devices
* GtkSpinButton can be oriented vertically
* Bugs fixed
645065 GtkFileChooserButton doesn't handle closing its dialo...
661973 gtk+ reacts on F10 press incorrectly with xkeyboard-c...
672046 Issues with widget state propagation
672431 the alt+tab app switch makes mnemonics flash
676787 Update printing demo to use new print setting
679144 Gdk doesn't properly find the child area with alpha
681617 radio button text isn't centered when draw indicator ...
682129 Print Dialog / Improving "Print to file" option
682291 GtkMenuButton .ui issues
682552 Improve the layout of the mount operations dialog
682662 GtkAspectFrame: vertical alignment should be top/bott...
682724 Fix a typo in the the comments
682825 Also compile gtkdbusgenerated.c on non-UNIX environme...
682919 Crash in GTK+-3.x (3.0.x-3.5.12+) on Windows with CJK...
683001 Make headings bold in message dialogs by default
683168 Make spinbutton orientable
* Translation updates
Assamese
French
Galician
Greek
Indonesian
Japanese
Kazakh
Latvian
Lithuanian
Norwegian bokmål
Persian
Polish
Punjabi
Spanish
Vietnamese
Overview of Changes in GTK+ 3.5.12 Overview of Changes in GTK+ 3.5.12
================================== ==================================

View File

@@ -75,8 +75,17 @@ Patches should be in unified diff form. (The -up option to GNU diff.)
Release notes for 3.6 Release notes for 3.6
===================== =====================
* Now follows the XDG Base Directory specification for user * The accessibility bridge code that exports accessible objects
configuration and data files. In detail, on the bus is now used by default; atk-bridge has been converted
into a library that GTK+ links against. To void the linking,
pass --without-atk-bridge when configuring GTK+.
* GDK threading support has been deprecated. It is recommended to
use g_idle_add(), g_main_context_invoke() and similar funtions
to make all GTK+ calls from the main thread.
* GTK+ now follows the XDG Base Directory specification for
user configuration and data files. In detail,
* $XDG_CONFIG_HOME/gtk-3.0/custom-papers is the new location * $XDG_CONFIG_HOME/gtk-3.0/custom-papers is the new location
for $HOME/.gtk-custom-papers for $HOME/.gtk-custom-papers
* $XDG_CONFIG_HOME/gtk-3.0/bookmarks is the new location * $XDG_CONFIG_HOME/gtk-3.0/bookmarks is the new location

View File

@@ -5,7 +5,7 @@
<CopyDir>$(GlibEtcInstallRoot)</CopyDir> <CopyDir>$(GlibEtcInstallRoot)</CopyDir>
<DefDir>$(SolutionDir)$(Configuration)\$(Platform)\obj\$(ProjectName)</DefDir> <DefDir>$(SolutionDir)$(Configuration)\$(Platform)\obj\$(ProjectName)</DefDir>
<GtkApiVersion>3.0</GtkApiVersion> <GtkApiVersion>3.0</GtkApiVersion>
<GtkBinaryVersion>2.10.0</GtkBinaryVersion> <GtkBinaryVersion>3.0.0</GtkBinaryVersion>
<GtkDummyPrefix>\"/dummy\"</GtkDummyPrefix> <GtkDummyPrefix>\"/dummy\"</GtkDummyPrefix>
<GtkPrefixDefine>GTK_PREFIX="\"$(GtkDummyPrefix)\""</GtkPrefixDefine> <GtkPrefixDefine>GTK_PREFIX="\"$(GtkDummyPrefix)\""</GtkPrefixDefine>
<GdkDefines>GDK_COMPILATION;G_LOG_DOMAIN="\"Gdk\""</GdkDefines> <GdkDefines>GDK_COMPILATION;G_LOG_DOMAIN="\"Gdk\""</GdkDefines>
@@ -18,24 +18,24 @@ mkdir $(CopyDir)\bin
copy $(Configuration)\$(Platform)\bin\*.dll $(CopyDir)\bin copy $(Configuration)\$(Platform)\bin\*.dll $(CopyDir)\bin
copy $(Configuration)\$(Platform)\bin\*.exe $(CopyDir)\bin
mkdir $(CopyDir)\bin\gtk3-demo
copy $(Configuration)\$(Platform)\bin\*.exe $(CopyDir)\bin\gtk3-demo mkdir $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
copy ..\..\..\demos\gtk-demo\*.c $(CopyDir)\bin\gtk3-demo copy ..\..\..\demos\gtk-demo\*.c $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
copy ..\..\..\demos\gtk-demo\*.css $(CopyDir)\bin\gtk3-demo copy ..\..\..\demos\gtk-demo\*.css $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
copy ..\..\..\demos\gtk-demo\*.h $(CopyDir)\bin\gtk3-demo copy ..\..\..\demos\gtk-demo\*.h $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
copy ..\..\..\demos\gtk-demo\*.ui $(CopyDir)\bin\gtk3-demo copy ..\..\..\demos\gtk-demo\*.ui $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
copy ..\..\..\demos\gtk-demo\*.jpg $(CopyDir)\bin\gtk3-demo copy ..\..\..\demos\gtk-demo\*.jpg $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
copy ..\..\..\demos\gtk-demo\*.png $(CopyDir)\bin\gtk3-demo copy ..\..\..\demos\gtk-demo\*.png $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
copy ..\..\..\demos\gtk-demo\*.gif $(CopyDir)\bin\gtk3-demo copy ..\..\..\demos\gtk-demo\*.gif $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
mkdir $(CopyDir)\lib mkdir $(CopyDir)\lib
@@ -319,6 +319,8 @@ copy ..\..\..\gtk\gtklabel.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtklayout.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk copy ..\..\..\gtk\gtklayout.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtklevelbar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtklinkbutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk copy ..\..\..\gtk\gtklinkbutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkliststore.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk copy ..\..\..\gtk\gtkliststore.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
@@ -331,6 +333,8 @@ copy ..\..\..\gtk\gtkmenu.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkmenubar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk copy ..\..\..\gtk\gtkmenubar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkmenubutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkmenuitem.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk copy ..\..\..\gtk\gtkmenuitem.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkmenushell.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk copy ..\..\..\gtk\gtkmenushell.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
@@ -411,6 +415,8 @@ copy ..\..\..\gtk\gtkscrollbar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkscrolledwindow.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk copy ..\..\..\gtk\gtkscrolledwindow.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtksearchentry.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkselection.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk copy ..\..\..\gtk\gtkselection.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkseparator.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk copy ..\..\..\gtk\gtkseparator.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

View File

@@ -176,6 +176,8 @@
<ClCompile Include="..\..\..\demos\gtk-demo\css_accordion.c" /> <ClCompile Include="..\..\..\demos\gtk-demo\css_accordion.c" />
<ClCompile Include="..\..\..\demos\gtk-demo\css_basics.c" /> <ClCompile Include="..\..\..\demos\gtk-demo\css_basics.c" />
<ClCompile Include="..\..\..\demos\gtk-demo\css_multiplebgs.c" /> <ClCompile Include="..\..\..\demos\gtk-demo\css_multiplebgs.c" />
<ClCompile Include="..\..\..\demos\gtk-demo\css_pixbufs.c" />
<ClCompile Include="..\..\..\demos\gtk-demo\css_shadows.c" />
<ClCompile Include="..\..\..\demos\gtk-demo\demo_resources.c" /> <ClCompile Include="..\..\..\demos\gtk-demo\demo_resources.c" />
<ClCompile Include="..\..\..\demos\gtk-demo\dialog.c" /> <ClCompile Include="..\..\..\demos\gtk-demo\dialog.c" />
<ClCompile Include="..\..\..\demos\gtk-demo\drawingarea.c" /> <ClCompile Include="..\..\..\demos\gtk-demo\drawingarea.c" />

View File

@@ -47,6 +47,12 @@
<ClCompile Include="..\..\..\demos\gtk-demo\css_multiplebgs.c"> <ClCompile Include="..\..\..\demos\gtk-demo\css_multiplebgs.c">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\..\demos\gtk-demo\css_pixbufs.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\demos\gtk-demo\css_shadows.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\demos\gtk-demo\demo_resources.c"> <ClCompile Include="..\..\..\demos\gtk-demo\demo_resources.c">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>

View File

@@ -41,7 +41,7 @@ copy ..\..\..\gdk\gdkconfig.h.win32 ..\..\..\gdk\gdkconfig.h&#x0D;&#x0A;
/> />
<UserMacro <UserMacro
Name="GtkBinaryVersion" Name="GtkBinaryVersion"
Value="2.10.0" Value="3.0.0"
/> />
<UserMacro <UserMacro
Name="GtkDummyPrefix" Name="GtkDummyPrefix"
@@ -69,16 +69,17 @@ copy ..\..\..\gdk\gdkconfig.h.win32 ..\..\..\gdk\gdkconfig.h&#x0D;&#x0A;
echo on&#x0D;&#x0A; echo on&#x0D;&#x0A;
mkdir $(CopyDir)\bin&#x0D;&#x0A; mkdir $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\*.dll $(CopyDir)\bin&#x0D;&#x0A; copy $(ConfigurationName)\$(PlatformName)\bin\*.dll $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\*.exe $(CopyDir)\bin&#x0D;&#x0A;
mkdir $(CopyDir)\bin\gtk3-demo&#x0D;&#x0A; mkdir $(CopyDir)\share\gtk-$(GtkApiVersion)\demo&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\*.exe $(CopyDir)\bin\gtk3-demo&#x0D;&#x0A;
copy ..\..\..\demos\gtk-demo\*.c $(CopyDir)\bin\gtk3-demo&#x0D;&#x0A; copy ..\..\..\demos\gtk-demo\*.c $(CopyDir)\share\gtk-$(GtkApiVersion)\demo&#x0D;&#x0A;
copy ..\..\..\demos\gtk-demo\*.css $(CopyDir)\bin\gtk3-demo&#x0D;&#x0A; copy ..\..\..\demos\gtk-demo\*.css $(CopyDir)\share\gtk-$(GtkApiVersion)\demo&#x0D;&#x0A;
copy ..\..\..\demos\gtk-demo\*.h $(CopyDir)\bin\gtk3-demo&#x0D;&#x0A; copy ..\..\..\demos\gtk-demo\*.h $(CopyDir)\share\gtk-$(GtkApiVersion)\demo&#x0D;&#x0A;
copy ..\..\..\demos\gtk-demo\*.ui $(CopyDir)\bin\gtk3-demo&#x0D;&#x0A; copy ..\..\..\demos\gtk-demo\*.ui $(CopyDir)\share\gtk-$(GtkApiVersion)\demo&#x0D;&#x0A;
copy ..\..\..\demos\gtk-demo\*.jpg $(CopyDir)\bin\gtk3-demo&#x0D;&#x0A; copy ..\..\..\demos\gtk-demo\*.jpg $(CopyDir)\share\gtk-$(GtkApiVersion)\demo&#x0D;&#x0A;
copy ..\..\..\demos\gtk-demo\*.png $(CopyDir)\bin\gtk3-demo&#x0D;&#x0A; copy ..\..\..\demos\gtk-demo\*.png $(CopyDir)\share\gtk-$(GtkApiVersion)\demo&#x0D;&#x0A;
copy ..\..\..\demos\gtk-demo\*.gif $(CopyDir)\bin\gtk3-demo&#x0D;&#x0A; copy ..\..\..\demos\gtk-demo\*.gif $(CopyDir)\share\gtk-$(GtkApiVersion)\demo&#x0D;&#x0A;
mkdir $(CopyDir)\lib&#x0D;&#x0A; mkdir $(CopyDir)\lib&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\*-$(GtkApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A; copy $(ConfigurationName)\$(PlatformName)\bin\*-$(GtkApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
@@ -222,12 +223,14 @@ copy ..\..\..\gtk\gtkinfobar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;
copy ..\..\..\gtk\gtkinvisible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A; copy ..\..\..\gtk\gtkinvisible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtklabel.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A; copy ..\..\..\gtk\gtklabel.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtklayout.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A; copy ..\..\..\gtk\gtklayout.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtklevelbar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtklinkbutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A; copy ..\..\..\gtk\gtklinkbutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkliststore.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A; copy ..\..\..\gtk\gtkliststore.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtklockbutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A; copy ..\..\..\gtk\gtklockbutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkmain.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A; copy ..\..\..\gtk\gtkmain.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkmenu.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A; copy ..\..\..\gtk\gtkmenu.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkmenubar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A; copy ..\..\..\gtk\gtkmenubar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkmenubutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkmenuitem.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A; copy ..\..\..\gtk\gtkmenuitem.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkmenushell.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A; copy ..\..\..\gtk\gtkmenushell.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkmenutoolbutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A; copy ..\..\..\gtk\gtkmenutoolbutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
@@ -268,6 +271,7 @@ copy ..\..\..\gtk\gtkscalebutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#
copy ..\..\..\gtk\gtkscrollable.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A; copy ..\..\..\gtk\gtkscrollable.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkscrollbar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A; copy ..\..\..\gtk\gtkscrollbar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkscrolledwindow.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A; copy ..\..\..\gtk\gtkscrolledwindow.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtksearchentry.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkselection.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A; copy ..\..\..\gtk\gtkselection.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkseparator.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A; copy ..\..\..\gtk\gtkseparator.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkseparatormenuitem.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A; copy ..\..\..\gtk\gtkseparatormenuitem.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;

View File

@@ -171,6 +171,8 @@
<File RelativePath="..\..\..\demos\gtk-demo\combobox.c" /> <File RelativePath="..\..\..\demos\gtk-demo\combobox.c" />
<File RelativePath="..\..\..\demos\gtk-demo\css_accordion.c" /> <File RelativePath="..\..\..\demos\gtk-demo\css_accordion.c" />
<File RelativePath="..\..\..\demos\gtk-demo\css_basics.c" /> <File RelativePath="..\..\..\demos\gtk-demo\css_basics.c" />
<File RelativePath="..\..\..\demos\gtk-demo\css_pixbufs.c" />
<File RelativePath="..\..\..\demos\gtk-demo\css_shadows.c" />
<File RelativePath="..\..\..\demos\gtk-demo\css_multiplebgs.c" /> <File RelativePath="..\..\..\demos\gtk-demo\css_multiplebgs.c" />
<File RelativePath="..\..\..\demos\gtk-demo\demo_resources.c" /> <File RelativePath="..\..\..\demos\gtk-demo\demo_resources.c" />
<File RelativePath="..\..\..\demos\gtk-demo\dialog.c" /> <File RelativePath="..\..\..\demos\gtk-demo\dialog.c" />

View File

@@ -20,9 +20,6 @@
/* Define the location where the catalogs will be installed */ /* Define the location where the catalogs will be installed */
#define GTK_LOCALEDIR "NONE/share/locale" #define GTK_LOCALEDIR "NONE/share/locale"
/* Define if we're using atk-bridge-2.0 */
/* #undef HAVE_ATK_BRIDGE */
/* Define to 1 if you have the `bind_textdomain_codeset' function. */ /* Define to 1 if you have the `bind_textdomain_codeset' function. */
#define HAVE_BIND_TEXTDOMAIN_CODESET 1 #define HAVE_BIND_TEXTDOMAIN_CODESET 1
@@ -299,6 +296,11 @@
/* Define to 1 if the X Window System is missing or not being used. */ /* Define to 1 if the X Window System is missing or not being used. */
/* #undef X_DISPLAY_MISSING */ /* #undef X_DISPLAY_MISSING */
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
# define _DARWIN_USE_64_BIT_INODE 1
#endif
/* Number of bits in a file offset, on hosts where this is settable. */ /* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */ /* #undef _FILE_OFFSET_BITS */

View File

@@ -9,8 +9,8 @@
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0. # set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
m4_define([gtk_major_version], [3]) m4_define([gtk_major_version], [3])
m4_define([gtk_minor_version], [5]) m4_define([gtk_minor_version], [7])
m4_define([gtk_micro_version], [13]) m4_define([gtk_micro_version], [3])
m4_define([gtk_interface_age], [0]) m4_define([gtk_interface_age], [0])
m4_define([gtk_binary_age], m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)]) [m4_eval(100 * gtk_minor_version + gtk_micro_version)])
@@ -39,7 +39,7 @@ AC_CONFIG_AUX_DIR([build-aux])
m4_define([gtk_binary_version], [3.0.0]) m4_define([gtk_binary_version], [3.0.0])
# required versions of other packages # required versions of other packages
m4_define([glib_required_version], [2.33.1]) m4_define([glib_required_version], [2.35.0])
m4_define([pango_required_version], [1.30.0]) m4_define([pango_required_version], [1.30.0])
m4_define([atk_required_version], [2.5.3]) m4_define([atk_required_version], [2.5.3])
m4_define([cairo_required_version], [1.10.0]) m4_define([cairo_required_version], [1.10.0])
@@ -383,7 +383,7 @@ else
fi fi
AC_SUBST(DISABLE_ON_QUARTZ) AC_SUBST(DISABLE_ON_QUARTZ)
if test "x$enable_broadway_backend" == xyes; then if test "x$enable_broadway_backend" = xyes; then
GDK_BACKENDS="$GDK_BACKENDS broadway" GDK_BACKENDS="$GDK_BACKENDS broadway"
cairo_backends="$cairo_backends cairo" cairo_backends="$cairo_backends cairo"
GDK_WINDOWING="$GDK_WINDOWING GDK_WINDOWING="$GDK_WINDOWING
@@ -394,8 +394,8 @@ else
AM_CONDITIONAL(USE_BROADWAY, false) AM_CONDITIONAL(USE_BROADWAY, false)
fi fi
if test "x$enable_wayland_backend" == "xyes"; then if test "x$enable_wayland_backend" = "xyes"; then
if test "x$enable_wayland_cairo_gl" == "xyes"; then if test "x$enable_wayland_cairo_gl" = "xyes"; then
# Wayland can use cairo-gl # Wayland can use cairo-gl
cairo_backends="$cairo_backends cairo-gl" cairo_backends="$cairo_backends cairo-gl"
AC_DEFINE(GDK_WAYLAND_USE_EGL, [1], [Whether to use EGL in Wayland backend]) AC_DEFINE(GDK_WAYLAND_USE_EGL, [1], [Whether to use EGL in Wayland backend])
@@ -407,8 +407,8 @@ if test "x$enable_wayland_backend" == "xyes"; then
have_gio_unix=yes have_gio_unix=yes
GDK_WINDOWING="$GDK_WINDOWING GDK_WINDOWING="$GDK_WINDOWING
#define GDK_WINDOWING_WAYLAND" #define GDK_WINDOWING_WAYLAND"
WAYLAND_PACKAGES="wayland-client xkbcommon wayland-cursor" WAYLAND_PACKAGES="wayland-client >= 1.0.0 xkbcommon >= 0.2.0 wayland-cursor"
if test "x$enable_wayland_cairo_gl" == "xyes"; then if test "x$enable_wayland_cairo_gl" = "xyes"; then
WAYLAND_PACKAGES="$WAYLAND_PACKAGES wayland-egl egl" WAYLAND_PACKAGES="$WAYLAND_PACKAGES wayland-egl egl"
fi fi
AM_CONDITIONAL(USE_WAYLAND, true) AM_CONDITIONAL(USE_WAYLAND, true)
@@ -714,7 +714,6 @@ AM_PATH_GLIB_2_0(glib_required_version, :,
*** GLIB is always available from ftp://ftp.gtk.org/pub/gtk/.]), *** GLIB is always available from ftp://ftp.gtk.org/pub/gtk/.]),
gobject gmodule-no-export) gobject gmodule-no-export)
dnl
dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in. dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
dnl dnl
gtk_save_LIBS=$LIBS gtk_save_LIBS=$LIBS
@@ -748,6 +747,19 @@ else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
fi fi
#
# Disable deprecation checks for all libraries we depend on on stable branches.
# This is so newer versions of those libraries don't cause more warnings with
# a stable GTK version.
# We don't ever want to turn off deprecation warnings for master however, because
# that's where we get rid of deprecated API we use.
#
if test m4_eval(gtk_minor_version % 2) = 0 ; then
AC_DEFINE_UNQUOTED(GLIB_DISABLE_DEPRECATION_WARNINGS, 1,
[Disable deprecation warnings from glib])
fi
dnl
saved_cflags="$CFLAGS" saved_cflags="$CFLAGS"
saved_ldflags="$LDFLAGS" saved_ldflags="$LDFLAGS"

View File

@@ -18,6 +18,8 @@ demos = \
css_accordion.c \ css_accordion.c \
css_basics.c \ css_basics.c \
css_multiplebgs.c \ css_multiplebgs.c \
css_pixbufs.c \
css_shadows.c \
dialog.c \ dialog.c \
drawingarea.c \ drawingarea.c \
editable_cells.c \ editable_cells.c \
@@ -118,6 +120,8 @@ RESOURCES= application.ui \
css_accordion.css \ css_accordion.css \
css_basics.css \ css_basics.css \
css_multiplebgs.css \ css_multiplebgs.css \
css_pixbufs.css \
css_shadows.css \
cssview.css \ cssview.css \
fancy.css \ fancy.css \
reset.css reset.css

View File

@@ -61,6 +61,7 @@ do_css_accordion (GtkWidget *do_widget)
data = g_bytes_get_data (bytes, &data_size); data = g_bytes_get_data (bytes, &data_size);
gtk_css_provider_load_from_data (GTK_CSS_PROVIDER (provider), (gchar *)data, data_size, NULL); gtk_css_provider_load_from_data (GTK_CSS_PROVIDER (provider), (gchar *)data, data_size, NULL);
g_bytes_unref (bytes);
apply_css (window, provider); apply_css (window, provider);
} }

View File

@@ -1,4 +1,4 @@
@import url("reset.css"); @import url("resource:///reset.css");
* { * {
transition-property: color, background-color, border-color, background-image, padding, border-width; transition-property: color, background-color, border-color, background-image, padding, border-width;
@@ -49,4 +49,4 @@ GtkWindow {
.button:hover:active, .button:hover:active,
.button:active { .button:active {
background-color: #993401; background-color: #993401;
} }

View File

@@ -100,6 +100,7 @@ do_css_basics (GtkWidget *do_widget)
bytes = g_resources_lookup_data ("/css_basics/gtk.css", 0, NULL); bytes = g_resources_lookup_data ("/css_basics/gtk.css", 0, NULL);
gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes)); gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes));
g_bytes_unref (bytes);
g_signal_connect (provider, g_signal_connect (provider,
"parsing-error", "parsing-error",

View File

@@ -6,7 +6,7 @@
/* This CSS resets all properties to their defaults values /* This CSS resets all properties to their defaults values
* and overrides all user settings and the theme in use */ * and overrides all user settings and the theme in use */
@import url("reset.css"); @import url("resource:///reset.css");
/* Set a very futuristic style by default */ /* Set a very futuristic style by default */
* { * {

View File

@@ -149,6 +149,7 @@ do_css_multiplebgs (GtkWidget *do_widget)
bytes = g_resources_lookup_data ("/css_multiplebgs/gtk.css", 0, NULL); bytes = g_resources_lookup_data ("/css_multiplebgs/gtk.css", 0, NULL);
gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes)); gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes));
g_bytes_unref (bytes);
g_signal_connect (provider, g_signal_connect (provider,
"parsing-error", "parsing-error",

View File

@@ -6,8 +6,8 @@
/* This CSS resets all properties to their defaults values /* This CSS resets all properties to their defaults values
* and overrides all user settings and the theme in use */ * and overrides all user settings and the theme in use */
@import url("reset.css"); @import url("resource:///reset.css");
@import url("cssview.css"); @import url("resource:///cssview.css");
#canvas { #canvas {
transition-property: background-color, background-image; transition-property: background-color, background-image;
@@ -56,7 +56,7 @@
/* /*
#bricks-button { #bricks-button {
background-color: #eef; background-color: #eef;
background-image: url('brick.png'); background-image: url('resource:///css_multiplebgs/brick.png');
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
} }
@@ -133,4 +133,4 @@
background-image: linear-gradient(90deg, transparent 79px, alpha(#999, 0.40) 79px, #999 80px, alpha(#999, 0.40) 81px, transparent 81px), background-image: linear-gradient(90deg, transparent 79px, alpha(#999, 0.40) 79px, #999 80px, alpha(#999, 0.40) 81px, transparent 81px),
linear-gradient(alpha(#bbb, 0.60), alpha(#bbb, 0.60) 1px, transparent 1px); linear-gradient(alpha(#bbb, 0.60), alpha(#bbb, 0.60) 1px, transparent 1px);
} }
*/ */

View File

@@ -0,0 +1,127 @@
/* CSS Theming/Animated backgrounds
*
* This demo is done in honour of the Pixbufs demo further down. It is done exclusively
* with CSS as the background of the window.
*/
#include <gtk/gtk.h>
static GtkWidget *window = NULL;
static void
show_parsing_error (GtkCssProvider *provider,
GtkCssSection *section,
const GError *error,
GtkTextBuffer *buffer)
{
GtkTextIter start, end;
const char *tag_name;
gtk_text_buffer_get_iter_at_line_index (buffer,
&start,
gtk_css_section_get_start_line (section),
gtk_css_section_get_start_position (section));
gtk_text_buffer_get_iter_at_line_index (buffer,
&end,
gtk_css_section_get_end_line (section),
gtk_css_section_get_end_position (section));
if (g_error_matches (error, GTK_CSS_PROVIDER_ERROR, GTK_CSS_PROVIDER_ERROR_DEPRECATED))
tag_name = "warning";
else
tag_name = "error";
gtk_text_buffer_apply_tag_by_name (buffer, tag_name, &start, &end);
}
static void
css_text_changed (GtkTextBuffer *buffer,
GtkCssProvider *provider)
{
GtkTextIter start, end;
char *text;
gtk_text_buffer_get_start_iter (buffer, &start);
gtk_text_buffer_get_end_iter (buffer, &end);
gtk_text_buffer_remove_all_tags (buffer, &start, &end);
text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
gtk_css_provider_load_from_data (provider, text, -1, NULL);
g_free (text);
gtk_style_context_reset_widgets (gdk_screen_get_default ());
}
static void
apply_css (GtkWidget *widget, GtkStyleProvider *provider)
{
gtk_style_context_add_provider (gtk_widget_get_style_context (widget), provider, G_MAXUINT);
if (GTK_IS_CONTAINER (widget))
gtk_container_forall (GTK_CONTAINER (widget), (GtkCallback) apply_css, provider);
}
GtkWidget *
do_css_pixbufs (GtkWidget *do_widget)
{
if (!window)
{
GtkWidget *paned, *container, *child;
GtkStyleProvider *provider;
GtkTextBuffer *text;
GBytes *bytes;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
paned = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
gtk_container_add (GTK_CONTAINER (window), paned);
/* Need a filler so we get a handle */
child = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (paned), child);
text = gtk_text_buffer_new (NULL);
gtk_text_buffer_create_tag (text,
"warning",
"underline", PANGO_UNDERLINE_SINGLE,
NULL);
gtk_text_buffer_create_tag (text,
"error",
"underline", PANGO_UNDERLINE_ERROR,
NULL);
provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
container = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (paned), container);
child = gtk_text_view_new_with_buffer (text);
gtk_container_add (GTK_CONTAINER (container), child);
g_signal_connect (text,
"changed",
G_CALLBACK (css_text_changed),
provider);
bytes = g_resources_lookup_data ("/css_pixbufs/gtk.css", 0, NULL);
gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes));
g_signal_connect (provider,
"parsing-error",
G_CALLBACK (show_parsing_error),
gtk_text_view_get_buffer (GTK_TEXT_VIEW (child)));
apply_css (window, provider);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show_all (window);
else
{
gtk_widget_destroy (window);
window = NULL;
}
return window;
}

View File

@@ -6,8 +6,8 @@
/* This CSS resets all properties to their defaults values /* This CSS resets all properties to their defaults values
* and overrides all user settings and the theme in use */ * and overrides all user settings and the theme in use */
@import url("reset.css"); @import url("resource:///reset.css");
@import url("cssview.css"); @import url("resource:///cssview.css");
@keyframes move-the-image { @keyframes move-the-image {
0% { background-position: 50.00% 75.00%, 67.68% 67.68%, 75.00% 50.00%, 67.68% 32.32%, 50.00% 25.00%, 32.32% 32.32%, 25.00% 50.00%, 32.32% 67.68%, 0% 0%; } 0% { background-position: 50.00% 75.00%, 67.68% 67.68%, 75.00% 50.00%, 67.68% 32.32%, 50.00% 25.00%, 32.32% 32.32%, 25.00% 50.00%, 32.32% 67.68%, 0% 0%; }
@@ -46,21 +46,31 @@
} }
@keyframes size-the-image { @keyframes size-the-image {
0% { background-size: 96px, 12px, 96px, 12px, 96px, 12px, 96px, 12px, 100% } 0% { background-size: 96px, 12px, 96px, 12px, 96px, 12px, 96px, 12px, auto }
100% { background-size: 12px, 96px, 12px, 96px, 12px, 96px, 12px, 96px, 100% } 100% { background-size: 12px, 96px, 12px, 96px, 12px, 96px, 12px, 96px, auto }
} }
GtkWindow { GtkWindow {
background-image: url("apple-red.png"), background-image: url("resource:///css_pixbufs/apple-red.png"),
url("gnome-applets.png"), url("resource:///css_pixbufs/gnome-applets.png"),
url("gnome-calendar.png"), url("resource:///css_pixbufs/gnome-calendar.png"),
url("gnome-foot.png"), url("resource:///css_pixbufs/gnome-foot.png"),
url("gnome-gmush.png"), url("resource:///css_pixbufs/gnome-gmush.png"),
url("gnome-gimp.png"), url("resource:///css_pixbufs/gnome-gimp.png"),
url("gnome-gsame.png"), url("resource:///css_pixbufs/gnome-gsame.png"),
url("gnu-keys.png"), url("resource:///css_pixbufs/gnu-keys.png"),
url("background.jpg"); url("resource:///css_pixbufs/background.jpg");
background-position: 50.00% 75.00%, 67.68% 67.68%, 75.00% 50.00%, 67.68% 32.32%, 50.00% 25.00%, 32.32% 32.32%, 25.00% 50.00%, 32.32% 67.68%, 0% 0%; background-position: 50.00% 75.00%, 67.68% 67.68%, 75.00% 50.00%, 67.68% 32.32%, 50.00% 25.00%, 32.32% 32.32%, 25.00% 50.00%, 32.32% 67.68%, 0% 0%;
background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat; background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat;
animation: move-the-image infinite linear 3s, size-the-image infinite alternate ease-in-out 0.75s; animation: move-the-image infinite linear 3s, size-the-image infinite alternate ease-in-out 0.75s;
} }
/* Make the text editor has a nice style */
.view, .scrollbar, .pane-separator {
color: black;
background-color: rgba(255,255,255,0.5);
}
.view:selected {
background-color: rgba(127,127,255,0.5);
}

View File

@@ -0,0 +1,147 @@
/* CSS Theming/Shadows
*
* This demo shows how to use CSS shadows.
*/
#include <gtk/gtk.h>
static GtkWidget *window = NULL;
static void
show_parsing_error (GtkCssProvider *provider,
GtkCssSection *section,
const GError *error,
GtkTextBuffer *buffer)
{
GtkTextIter start, end;
const char *tag_name;
gtk_text_buffer_get_iter_at_line_index (buffer,
&start,
gtk_css_section_get_start_line (section),
gtk_css_section_get_start_position (section));
gtk_text_buffer_get_iter_at_line_index (buffer,
&end,
gtk_css_section_get_end_line (section),
gtk_css_section_get_end_position (section));
if (g_error_matches (error, GTK_CSS_PROVIDER_ERROR, GTK_CSS_PROVIDER_ERROR_DEPRECATED))
tag_name = "warning";
else
tag_name = "error";
gtk_text_buffer_apply_tag_by_name (buffer, tag_name, &start, &end);
}
static void
css_text_changed (GtkTextBuffer *buffer,
GtkCssProvider *provider)
{
GtkTextIter start, end;
char *text;
gtk_text_buffer_get_start_iter (buffer, &start);
gtk_text_buffer_get_end_iter (buffer, &end);
gtk_text_buffer_remove_all_tags (buffer, &start, &end);
text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
gtk_css_provider_load_from_data (provider, text, -1, NULL);
g_free (text);
gtk_style_context_reset_widgets (gdk_screen_get_default ());
}
static void
apply_css (GtkWidget *widget, GtkStyleProvider *provider)
{
gtk_style_context_add_provider (gtk_widget_get_style_context (widget), provider, G_MAXUINT);
if (GTK_IS_CONTAINER (widget))
gtk_container_forall (GTK_CONTAINER (widget), (GtkCallback) apply_css, provider);
}
GtkWidget *
create_toolbar (void)
{
GtkWidget *toolbar;
GtkToolItem *item;
toolbar = gtk_toolbar_new ();
gtk_widget_set_valign (toolbar, GTK_ALIGN_CENTER);
item = gtk_tool_button_new_from_stock (GTK_STOCK_GO_FORWARD);
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
item = gtk_tool_button_new_from_stock (GTK_STOCK_GO_BACK);
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
item = gtk_tool_button_new (NULL, "Hello World");
gtk_tool_item_set_is_important (item, TRUE);
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
return toolbar;
}
GtkWidget *
do_css_shadows (GtkWidget *do_widget)
{
if (!window)
{
GtkWidget *paned, *container, *child;
GtkStyleProvider *provider;
GtkTextBuffer *text;
GBytes *bytes;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
paned = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
gtk_container_add (GTK_CONTAINER (window), paned);
child = create_toolbar ();
gtk_container_add (GTK_CONTAINER (paned), child);
text = gtk_text_buffer_new (NULL);
gtk_text_buffer_create_tag (text,
"warning",
"underline", PANGO_UNDERLINE_SINGLE,
NULL);
gtk_text_buffer_create_tag (text,
"error",
"underline", PANGO_UNDERLINE_ERROR,
NULL);
provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
container = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (paned), container);
child = gtk_text_view_new_with_buffer (text);
gtk_container_add (GTK_CONTAINER (container), child);
g_signal_connect (text,
"changed",
G_CALLBACK (css_text_changed),
provider);
bytes = g_resources_lookup_data ("/css_shadows/gtk.css", 0, NULL);
gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes));
g_signal_connect (provider,
"parsing-error",
G_CALLBACK (show_parsing_error),
gtk_text_view_get_buffer (GTK_TEXT_VIEW (child)));
apply_css (window, provider);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show_all (window);
else
{
gtk_widget_destroy (window);
window = NULL;
}
return window;
}

View File

@@ -0,0 +1,44 @@
/* You can edit the text in this window to change the
* appearance of this Window.
* Be careful, if you screw it up, nothing might be visible
* anymore. :)
*/
/* This CSS resets all properties to their defaults values
* and overrides all user settings and the theme in use */
@import url("resource:///reset.css");
@import url("resource:///cssview.css");
/* Get a nice background for the window */
.background {
background-color: #4870bc;
background-image: linear-gradient(to left, transparent, rgba(255,255,255,.07) 50%, transparent 50%),
linear-gradient(to left, transparent, rgba(255,255,255,.13) 50%, transparent 50%),
linear-gradient(to left, transparent, transparent 50%, rgba(255,255,255,.17) 50%),
linear-gradient(to left, transparent, transparent 50%, rgba(255,255,255,.19) 50%);
background-size: 29px, 59px, 73px, 109px;
}
.button {
color: black;
padding: 10px;
border-radius: 5px;
transition: all 250ms ease-in;
border: 1px transparent solid;
}
.button:hover {
text-shadow: 3px 3px 5px alpha(black, 0.75);
icon-shadow: 3px 3px 5px alpha(black, 0.75);
box-shadow: 3px 3px 5px alpha(black, 0.5) inset;
border: solid 1px alpha(black, 0.75);
}
.button:active {
padding: 11px 9px 9px 11px;
text-shadow: 1px 1px 2.5px alpha(black, 0.6);
icon-shadow: 1px 1px 2.5px alpha(black, 0.6);
}

View File

@@ -20,6 +20,7 @@
</gresource> </gresource>
<gresource prefix="/css_multiplebgs"> <gresource prefix="/css_multiplebgs">
<file alias="gtk.css">css_multiplebgs.css</file> <file alias="gtk.css">css_multiplebgs.css</file>
<file>brick.png</file>
</gresource> </gresource>
<gresource prefix="/theming_custom_css"> <gresource prefix="/theming_custom_css">
<file alias="gtk.css">fancy.css</file> <file alias="gtk.css">fancy.css</file>
@@ -27,4 +28,19 @@
<gresource prefix="/theming_style_classes"> <gresource prefix="/theming_style_classes">
<file preprocess="xml-stripblanks">theming.ui</file> <file preprocess="xml-stripblanks">theming.ui</file>
</gresource> </gresource>
<gresource prefix="/css_pixbufs">
<file alias="gtk.css">css_pixbufs.css</file>
<file>background.jpg</file>
<file>apple-red.png</file>
<file>gnome-applets.png</file>
<file>gnome-calendar.png</file>
<file>gnome-foot.png</file>
<file>gnome-gmush.png</file>
<file>gnome-gimp.png</file>
<file>gnome-gsame.png</file>
<file>gnu-keys.png</file>
</gresource>
<gresource prefix="/css_shadows">
<file alias="gtk.css">css_shadows.css</file>
</gresource>
</gresources> </gresources>

View File

@@ -1,24 +1,65 @@
GtkButton#fancy { GtkButton#fancy {
font-weight: bold; transition: none;
background-image: linear-gradient(135deg, yellow, blue); background-image: linear-gradient(to bottom,
border-radius: 20px; alpha(white, 0.7),
color: white; alpha(white, 0) 30%),
linear-gradient(to top,
alpha(#babdb6, 0.4),
alpha(#babdb6, 0) 50%),
linear-gradient(135deg,
#eeeeec,
white 20%,
#d3d7cf,
white 80%,
#babdb6);
color: #3465a4;
font-weight: bold;
text-shadow: 0 1px white;
} }
GtkButton#fancy:hover { GtkButton#fancy:hover {
font-weight: bold; transition: all 250ms linear;
background-image: linear-gradient(135deg, blue, yellow); background-image: linear-gradient(to bottom,
border-radius: 20px; alpha(white, 1),
color: white; alpha(white, 0)),
linear-gradient(135deg,
#eeeeec 10%,
white 40%,
#d3d7cf,
white 70%,
#babdb6);
color: #204a87;
} }
GtkButton#fancy:active { GtkButton#fancy:active,
font-weight: bold; GtkButton#fancy:active:hover {
background-image: linear-gradient(yellow, yellow); transition: none;
border-radius: 20px; background-image: linear-gradient(to bottom,
color: black; alpha(#555753, 0.5),
alpha(#babdb6, 0.3)),
linear-gradient(135deg,
#eeeeec,
white 20%,
#d3d7cf,
white 80%,
#babdb6);
color: white;
text-shadow: 0 1px black;
}
GtkButton#fancy:backdrop,
GtkButton#fancy:backdrop:hover {
transition: none;
background-image: linear-gradient(135deg,
alpha(#eeeeec, 0.5) 10%,
alpha(white, 0.5) 40%,
alpha(#d3d7cf, 0.5),
alpha(white, 0.5) 70%,
alpha(#babdb6, 0.5));
color: #babdb6;
} }
GtkButton#fancy * { GtkButton#fancy * {
color: inherit; /* Yeah this should be inherited by default */
color: inherit;
} }

View File

@@ -579,10 +579,7 @@ load_file (const gchar *filename)
} }
if (current_file && !strcmp (current_file, names[0])) if (current_file && !strcmp (current_file, names[0]))
{ goto out;
g_string_free (buffer, TRUE);
return;
}
g_free (current_file); g_free (current_file);
current_file = g_strdup (names[0]); current_file = g_strdup (names[0]);
@@ -598,7 +595,7 @@ load_file (const gchar *filename)
{ {
g_warning ("%s", err->message); g_warning ("%s", err->message);
g_error_free (err); g_error_free (err);
return; goto out;
} }
file = g_fopen (full_filename, "r"); file = g_fopen (full_filename, "r");
@@ -609,7 +606,7 @@ load_file (const gchar *filename)
g_free (full_filename); g_free (full_filename);
if (!file) if (!file)
return; goto out;
gtk_text_buffer_get_iter_at_offset (info_buffer, &start, 0); gtk_text_buffer_get_iter_at_offset (info_buffer, &start, 0);
while (read_line (file, buffer)) while (read_line (file, buffer))
@@ -725,6 +722,7 @@ load_file (const gchar *filename)
fontify (); fontify ();
out:
g_string_free (buffer, TRUE); g_string_free (buffer, TRUE);
g_strfreev (names); g_strfreev (names);

View File

@@ -149,8 +149,6 @@ do_printing (GtkWidget *do_widget)
GtkPrintOperation *operation; GtkPrintOperation *operation;
GtkPrintSettings *settings; GtkPrintSettings *settings;
PrintData *data; PrintData *data;
gchar *uri, *ext;
const gchar *dir;
GError *error = NULL; GError *error = NULL;
operation = gtk_print_operation_new (); operation = gtk_print_operation_new ();
@@ -170,25 +168,14 @@ do_printing (GtkWidget *do_widget)
gtk_print_operation_set_embed_page_setup (operation, TRUE); gtk_print_operation_set_embed_page_setup (operation, TRUE);
settings = gtk_print_settings_new (); settings = gtk_print_settings_new ();
dir = g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS);
if (dir == NULL)
dir = g_get_home_dir ();
if (g_strcmp0 (gtk_print_settings_get (settings, GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT), "ps") == 0)
ext = ".ps";
else if (g_strcmp0 (gtk_print_settings_get (settings, GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT), "svg") == 0)
ext = ".svg";
else
ext = ".pdf";
uri = g_strconcat ("file://", dir, "/", "gtk-demo", ext, NULL); gtk_print_settings_set (settings, GTK_PRINT_SETTINGS_OUTPUT_BASENAME, "gtk-demo");
gtk_print_settings_set (settings, GTK_PRINT_SETTINGS_OUTPUT_URI, uri);
gtk_print_operation_set_print_settings (operation, settings); gtk_print_operation_set_print_settings (operation, settings);
gtk_print_operation_run (operation, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, GTK_WINDOW (do_widget), &error); gtk_print_operation_run (operation, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, GTK_WINDOW (do_widget), &error);
g_object_unref (operation); g_object_unref (operation);
g_object_unref (settings); g_object_unref (settings);
g_free (uri);
if (error) if (error)
{ {

View File

@@ -65,12 +65,26 @@ show_about (GtkMenuItem *item, GtkWidget *window)
g_object_unref (pixbuf); g_object_unref (pixbuf);
} }
static void
on_page_toggled (GtkToggleButton *button,
GtkNotebook *pages)
{
gint page;
if (!gtk_toggle_button_get_active (button))
return;
page = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), "page"));
gtk_notebook_set_current_page (pages, page);
}
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
GtkBuilder *builder; GtkBuilder *builder;
GtkWidget *window; GtkWidget *window;
GtkWidget *widget; GtkWidget *widget;
GtkWidget *notebook;
gboolean dark = FALSE; gboolean dark = FALSE;
gtk_init (&argc, &argv); gtk_init (&argc, &argv);
@@ -88,6 +102,15 @@ main (int argc, char *argv[])
g_signal_connect (widget, "toggled", G_CALLBACK (dark_toggled), NULL); g_signal_connect (widget, "toggled", G_CALLBACK (dark_toggled), NULL);
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (widget), dark); gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (widget), dark);
notebook = (GtkWidget*) gtk_builder_get_object (builder, "toplevel_notebook");
widget = (GtkWidget*) gtk_builder_get_object (builder, "togglepage1");
g_object_set_data (G_OBJECT (widget), "page", GINT_TO_POINTER (0));
g_signal_connect (widget, "toggled", G_CALLBACK (on_page_toggled), notebook);
widget = (GtkWidget*) gtk_builder_get_object (builder, "togglepage2");
g_object_set_data (G_OBJECT (widget), "page", GINT_TO_POINTER (1));
g_signal_connect (widget, "toggled", G_CALLBACK (on_page_toggled), notebook);
widget = (GtkWidget*) gtk_builder_get_object (builder, "aboutmenuitem"); widget = (GtkWidget*) gtk_builder_get_object (builder, "aboutmenuitem");
g_signal_connect (widget, "activate", G_CALLBACK (show_about), window); g_signal_connect (widget, "activate", G_CALLBACK (show_about), window);

File diff suppressed because it is too large Load Diff

View File

@@ -89,25 +89,20 @@ Make sure that gtk-doc is the latest released version.
it to download.gnome.org. If you don't have an account on master.gnome.org, it to download.gnome.org. If you don't have an account on master.gnome.org,
find someone who can do it for you. The command for this looks like find someone who can do it for you. The command for this looks like
scp gtk+-2.12.10.tar.gz matthiasc@master.gnome.org: scp gtk+-2.12.10.tar.xz matthiasc@master.gnome.org:
ssh matthiasc@master.gnome.org ssh matthiasc@master.gnome.org ftpadmin install gtk+-2.12.10.tar.xz
install-module gtk+-2.12.10.tar.gz
15) Get the .bz2 tarball and the .md5sum files back from master.gnome.org 15) Upload the tarball and checksum to ftp.gtk.org and put them in the right
You can probably also create it locally, but I've experienced md5 directory below /ftp/pub. Pay attention to correct ownership, and don't
mismatches when doing so. forget to update the LATEST file in the directory.
16) Upload the .gz and .bz2 tarballs and checksums to ftp.gtk.org and put 16) Go to the gnome-announce list archives, find the last announce message,
them in the right directory below /ftp/pub. Pay attention to correct
ownership, and don't forget to update the LATEST file in the directory.
17) Go to the gnome-announce list archives, find the last announce message,
create a new message in the same form, replacing version numbers, create a new message in the same form, replacing version numbers,
commentary at the top about "what this release is about" and the commentary at the top about "what this release is about" and the
summary of changes. summary of changes.
18) Send it to gnome-announce-list, gtk-list, gtk-app-devel-list and 17) Send it to gnome-announce-list, gtk-list, gtk-app-devel-list and
gtk-devel-list. Set reply-to to desktop-devel-list. gtk-devel-list. Set reply-to to desktop-devel-list.
19) Add a link to the release announcement to www.gtk.org which lives 18) Add a link to the release announcement to www.gtk.org which lives
in the gtk-web git module. in the gtk-web git module.

View File

@@ -12,7 +12,7 @@
The latest versions can be found online at The latest versions can be found online at
<ulink role="online-location" url="http://developer.gnome.org/gdk3/">http://developer.gnome.org/gdk3/</ulink>. <ulink role="online-location" url="http://developer.gnome.org/gdk3/">http://developer.gnome.org/gdk3/</ulink>.
If you are looking for the older GDK 2 series of libraries, If you are looking for the older GDK 2 series of libraries,
see <ulink role="online-location" url="http://developer.gnome.org/gdk/">http://developer.gnome.org/gdk/</ulink>. see <ulink role="online-location" url="http://developer.gnome.org/gdk2/">http://developer.gnome.org/gdk2/</ulink>.
</releaseinfo> </releaseinfo>
</bookinfo> </bookinfo>
@@ -42,7 +42,7 @@
<xi:include href="xml/cairo_interaction.xml" /> <xi:include href="xml/cairo_interaction.xml" />
<xi:include href="xml/x_interaction.xml" /> <xi:include href="xml/x_interaction.xml" />
<xi:include href="xml/gdkapplaunchcontext.xml" /> <xi:include href="xml/gdkapplaunchcontext.xml" />
<xi:include href="xml/gdktesting.xml" /> <xi:include href="xml/gdktestutils.xml" />
</reference> </reference>
<index id="api-index-full"> <index id="api-index-full">

View File

@@ -1145,8 +1145,8 @@ gdk_app_launch_context_get_type
<SECTION> <SECTION>
<TITLE>Testing</TITLE> <TITLE>Testing</TITLE>
<FILE>gdktesting</FILE> <FILE>gdktestutils</FILE>
gdk_test_render_sync gdk_test_render_sync
gdk_test_simulate_button gdk_test_simulate_button
gdk_test_simulate_key gdk_test_simulate_key
</SECTION>

View File

@@ -5,7 +5,7 @@
<chapter id="gtk-getting-started" xmlns:xi="http://www.w3.org/2003/XInclude"> <chapter id="gtk-getting-started" xmlns:xi="http://www.w3.org/2003/XInclude">
<title>Getting Started with GTK+</title> <title>Getting Started with GTK+</title>
<para>This chapter is contains some tutorial information to get you <para>This chapter contains some tutorial information to get you
started with GTK+ programming. It assumes that you have GTK+, its started with GTK+ programming. It assumes that you have GTK+, its
dependencies and a C compiler installed and ready to use. If you dependencies and a C compiler installed and ready to use. If you
need to build GTK+ itself first, refer to the need to build GTK+ itself first, refer to the

View File

@@ -14,7 +14,7 @@
The latest versions can be found online at The latest versions can be found online at
<ulink role="online-location" url="http://developer.gnome.org/gtk3/">http://developer.gnome.org/gtk3/</ulink>. <ulink role="online-location" url="http://developer.gnome.org/gtk3/">http://developer.gnome.org/gtk3/</ulink>.
If you are looking for the older GTK+ 2 series of libraries, If you are looking for the older GTK+ 2 series of libraries,
see <ulink role="online-location" url="http://developer.gnome.org/gtk/">http://developer.gnome.org/gtk/</ulink>. see <ulink role="online-location" url="http://developer.gnome.org/gtk2/">http://developer.gnome.org/gtk2/</ulink>.
</releaseinfo> </releaseinfo>
</bookinfo> </bookinfo>

View File

@@ -139,6 +139,7 @@ gtk_accel_label_set_accel_closure
gtk_accel_label_get_accel_widget gtk_accel_label_get_accel_widget
gtk_accel_label_set_accel_widget gtk_accel_label_set_accel_widget
gtk_accel_label_get_accel_width gtk_accel_label_get_accel_width
gtk_accel_label_set_accel
gtk_accel_label_refetch gtk_accel_label_refetch
<SUBSECTION Standard> <SUBSECTION Standard>
GTK_ACCEL_LABEL GTK_ACCEL_LABEL
@@ -263,6 +264,8 @@ gtk_action_group_get_sensitive
gtk_action_group_set_sensitive gtk_action_group_set_sensitive
gtk_action_group_get_visible gtk_action_group_get_visible
gtk_action_group_set_visible gtk_action_group_set_visible
gtk_action_group_get_accel_group
gtk_action_group_set_accel_group
gtk_action_group_get_action gtk_action_group_get_action
gtk_action_group_list_actions gtk_action_group_list_actions
gtk_action_group_add_action gtk_action_group_add_action
@@ -530,6 +533,7 @@ gtk_builder_add_from_resource
gtk_builder_add_from_string gtk_builder_add_from_string
gtk_builder_add_objects_from_file gtk_builder_add_objects_from_file
gtk_builder_add_objects_from_string gtk_builder_add_objects_from_string
gtk_builder_add_objects_from_resource
gtk_builder_get_object gtk_builder_get_object
gtk_builder_get_objects gtk_builder_get_objects
gtk_builder_connect_signals gtk_builder_connect_signals
@@ -583,6 +587,8 @@ gtk_button_set_image
gtk_button_get_image gtk_button_get_image
gtk_button_set_image_position gtk_button_set_image_position
gtk_button_get_image_position gtk_button_get_image_position
gtk_button_set_always_show_image
gtk_button_get_always_show_image
gtk_button_get_event_window gtk_button_get_event_window
<SUBSECTION Standard> <SUBSECTION Standard>
@@ -1046,6 +1052,8 @@ gtk_entry_get_layout
gtk_entry_get_layout_offsets gtk_entry_get_layout_offsets
gtk_entry_layout_index_to_text_index gtk_entry_layout_index_to_text_index
gtk_entry_text_index_to_layout_index gtk_entry_text_index_to_layout_index
gtk_entry_set_attributes
gtk_entry_get_attributes
gtk_entry_get_max_length gtk_entry_get_max_length
gtk_entry_get_visibility gtk_entry_get_visibility
gtk_entry_set_completion gtk_entry_set_completion
@@ -1808,6 +1816,7 @@ gtk_image_new_from_stock
gtk_image_new_from_animation gtk_image_new_from_animation
gtk_image_new_from_icon_name gtk_image_new_from_icon_name
gtk_image_new_from_gicon gtk_image_new_from_gicon
gtk_image_new_from_resource
gtk_image_set_from_file gtk_image_set_from_file
gtk_image_set_from_icon_set gtk_image_set_from_icon_set
gtk_image_set_from_pixbuf gtk_image_set_from_pixbuf
@@ -1815,6 +1824,7 @@ gtk_image_set_from_stock
gtk_image_set_from_animation gtk_image_set_from_animation
gtk_image_set_from_icon_name gtk_image_set_from_icon_name
gtk_image_set_from_gicon gtk_image_set_from_gicon
gtk_image_set_from_resource
gtk_image_clear gtk_image_clear
gtk_image_new gtk_image_new
gtk_image_set_pixel_size gtk_image_set_pixel_size
@@ -2244,6 +2254,7 @@ gtk_menu_shell_set_take_focus
gtk_menu_shell_get_take_focus gtk_menu_shell_get_take_focus
gtk_menu_shell_get_selected_item gtk_menu_shell_get_selected_item
gtk_menu_shell_get_parent_shell gtk_menu_shell_get_parent_shell
gtk_menu_shell_bind_model
GtkMenuDirectionType GtkMenuDirectionType
<SUBSECTION Standard> <SUBSECTION Standard>
GTK_MENU_SHELL GTK_MENU_SHELL
@@ -3270,6 +3281,8 @@ gtk_level_bar_set_min_value
gtk_level_bar_get_min_value gtk_level_bar_get_min_value
gtk_level_bar_set_max_value gtk_level_bar_set_max_value
gtk_level_bar_get_max_value gtk_level_bar_get_max_value
gtk_level_bar_set_inverted
gtk_level_bar_get_inverted
gtk_level_bar_add_offset_value gtk_level_bar_add_offset_value
gtk_level_bar_remove_offset_value gtk_level_bar_remove_offset_value
gtk_level_bar_get_offset_value gtk_level_bar_get_offset_value
@@ -5278,6 +5291,7 @@ gtk_widget_get_sensitive
gtk_widget_is_sensitive gtk_widget_is_sensitive
gtk_widget_get_state gtk_widget_get_state
gtk_widget_get_visible gtk_widget_get_visible
gtk_widget_is_visible
gtk_widget_set_visible gtk_widget_set_visible
gtk_widget_set_state_flags gtk_widget_set_state_flags
gtk_widget_unset_state_flags gtk_widget_unset_state_flags
@@ -5765,6 +5779,8 @@ GTK_STYLE_CLASS_LINKED
GTK_STYLE_CLASS_ARROW GTK_STYLE_CLASS_ARROW
GTK_STYLE_CLASS_OSD GTK_STYLE_CLASS_OSD
GTK_STYLE_CLASS_LEVEL_BAR GTK_STYLE_CLASS_LEVEL_BAR
GTK_STYLE_CLASS_CURSOR_HANDLE
GTK_STYLE_CLASS_INSERTION_CURSOR
GTK_STYLE_REGION_COLUMN GTK_STYLE_REGION_COLUMN
GTK_STYLE_REGION_COLUMN_HEADER GTK_STYLE_REGION_COLUMN_HEADER
GTK_STYLE_REGION_ROW GTK_STYLE_REGION_ROW
@@ -5974,6 +5990,7 @@ gtk_gradient_add_color_stop
gtk_gradient_ref gtk_gradient_ref
gtk_gradient_unref gtk_gradient_unref
gtk_gradient_resolve gtk_gradient_resolve
gtk_gradient_resolve_for_context
gtk_gradient_to_string gtk_gradient_to_string
<SUBSECTION Standard> <SUBSECTION Standard>
@@ -7106,6 +7123,7 @@ gtk_application_add_window
gtk_application_remove_window gtk_application_remove_window
gtk_application_get_windows gtk_application_get_windows
gtk_application_get_window_by_id gtk_application_get_window_by_id
gtk_application_get_active_window
<SUBSECTION> <SUBSECTION>
GtkApplicationInhibitFlags GtkApplicationInhibitFlags

View File

@@ -55,6 +55,7 @@ noinst_PROGRAMS = \
bloatpad \ bloatpad \
plugman \ plugman \
sunny \ sunny \
action-namespace \
grid-packing \ grid-packing \
drawing \ drawing \
builder builder

134
examples/action-namespace.c Normal file
View File

@@ -0,0 +1,134 @@
#include <gtk/gtk.h>
static void
action_activated (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GtkWindow *parent = user_data;
GtkWidget *dialog;
dialog = gtk_message_dialog_new (parent,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_INFO,
GTK_BUTTONS_CLOSE,
"Activated action `%s`",
g_action_get_name (G_ACTION (action)));
g_signal_connect_swapped (dialog, "response",
G_CALLBACK (gtk_widget_destroy), dialog);
gtk_widget_show_all (dialog);
}
static GActionEntry doc_entries[] = {
{ "save", action_activated },
{ "print", action_activated },
{ "share", action_activated }
};
static GActionEntry win_entries[] = {
{ "fullscreen", action_activated },
{ "close", action_activated },
};
const gchar *menu_ui =
"<interface>"
" <menu id='doc-menu'>"
" <section>"
" <item>"
" <attribute name='label'>_Save</attribute>"
" <attribute name='action'>save</attribute>"
" </item>"
" <item>"
" <attribute name='label'>_Print</attribute>"
" <attribute name='action'>print</attribute>"
" </item>"
" <item>"
" <attribute name='label'>_Share</attribute>"
" <attribute name='action'>share</attribute>"
" </item>"
" </section>"
" </menu>"
" <menu id='win-menu'>"
" <section>"
" <item>"
" <attribute name='label'>_Fullscreen</attribute>"
" <attribute name='action'>fullscreen</attribute>"
" </item>"
" <item>"
" <attribute name='label'>_Close</attribute>"
" <attribute name='action'>close</attribute>"
" </item>"
" </section>"
" </menu>"
"</interface>";
static void
activate (GApplication *app,
gpointer user_data)
{
GtkWidget *win;
GtkWidget *button;
GSimpleActionGroup *doc_actions;
GtkBuilder *builder;
GMenuModel *doc_menu;
GMenuModel *win_menu;
GMenu *button_menu;
GMenuItem *section;
if (gtk_application_get_windows (GTK_APPLICATION (app)) != NULL)
return;
win = gtk_application_window_new (GTK_APPLICATION (app));
doc_actions = g_simple_action_group_new ();
g_simple_action_group_add_entries (doc_actions, doc_entries,
G_N_ELEMENTS (doc_entries), win);
g_action_map_add_action_entries (G_ACTION_MAP (win), win_entries,
G_N_ELEMENTS (win_entries), win);
builder = gtk_builder_new ();
gtk_builder_add_from_string (builder, menu_ui, -1, NULL);
doc_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "doc-menu"));
win_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "win-menu"));
button_menu = g_menu_new ();
section = g_menu_item_new_section (NULL, doc_menu);
g_menu_item_set_attribute (section, "action-namespace", "s", "doc");
g_menu_append_item (button_menu, section);
g_object_unref (section);
section = g_menu_item_new_section (NULL, win_menu);
g_menu_item_set_attribute (section, "action-namespace", "s", "win");
g_menu_append_item (button_menu, section);
g_object_unref (section);
button = gtk_menu_button_new ();
gtk_button_set_label (GTK_BUTTON (button), "Menu");
gtk_widget_insert_action_group (button, "doc", G_ACTION_GROUP (doc_actions));
gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (button), G_MENU_MODEL (button_menu));
gtk_container_add (GTK_CONTAINER (win), button);
gtk_container_set_border_width (GTK_CONTAINER (win), 12);
gtk_widget_show_all (win);
g_object_unref (button_menu);
g_object_unref (doc_actions);
g_object_unref (builder);
}
int
main(int argc,
char **argv)
{
GtkApplication *app;
app = gtk_application_new ("org.gtk.Example", 0);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
return g_application_run (G_APPLICATION (app), argc, argv);
}

View File

@@ -191,7 +191,14 @@ bloat_pad_open (GApplication *application,
new_window (application, files[i]); new_window (application, files[i]);
} }
typedef GtkApplication BloatPad; typedef struct
{
GtkApplication parent_instance;
GMenu *time;
guint timeout;
} BloatPad;
typedef GtkApplicationClass BloatPadClass; typedef GtkApplicationClass BloatPadClass;
G_DEFINE_TYPE (BloatPad, bloat_pad, GTK_TYPE_APPLICATION) G_DEFINE_TYPE (BloatPad, bloat_pad, GTK_TYPE_APPLICATION)
@@ -234,15 +241,65 @@ quit_activated (GSimpleAction *action,
g_application_quit (app); g_application_quit (app);
} }
static gboolean
update_time (gpointer user_data)
{
BloatPad *bloatpad = user_data;
GDateTime *now;
gchar *time;
while (g_menu_model_get_n_items (G_MENU_MODEL (bloatpad->time)))
g_menu_remove (bloatpad->time, 0);
g_message ("Updating the time menu (which should be open now)...");
now = g_date_time_new_now_local ();
time = g_date_time_format (now, "%c");
g_menu_append (bloatpad->time, time, NULL);
g_date_time_unref (now);
g_free (time);
return G_SOURCE_CONTINUE;
}
static void
time_active_changed (GSimpleAction *action,
GVariant *state,
gpointer user_data)
{
BloatPad *bloatpad = user_data;
if (g_variant_get_boolean (state))
{
if (!bloatpad->timeout)
{
bloatpad->timeout = g_timeout_add (1000, update_time, bloatpad);
update_time (bloatpad);
}
}
else
{
if (bloatpad->timeout)
{
g_source_remove (bloatpad->timeout);
bloatpad->timeout = 0;
}
}
g_simple_action_set_state (action, state);
}
static GActionEntry app_entries[] = { static GActionEntry app_entries[] = {
{ "new", new_activated, NULL, NULL, NULL }, { "new", new_activated, NULL, NULL, NULL },
{ "about", about_activated, NULL, NULL, NULL }, { "about", about_activated, NULL, NULL, NULL },
{ "quit", quit_activated, NULL, NULL, NULL }, { "quit", quit_activated, NULL, NULL, NULL },
{ "time-active", NULL, NULL, "false", time_active_changed }
}; };
static void static void
bloat_pad_startup (GApplication *application) bloat_pad_startup (GApplication *application)
{ {
BloatPad *bloatpad = (BloatPad*) application;
GtkBuilder *builder; GtkBuilder *builder;
G_APPLICATION_CLASS (bloat_pad_parent_class) G_APPLICATION_CLASS (bloat_pad_parent_class)
@@ -301,13 +358,34 @@ bloat_pad_startup (GApplication *application)
" </item>" " </item>"
" </section>" " </section>"
" </submenu>" " </submenu>"
" <submenu id='time-menu'>"
" <attribute name='label' translatable='yes'>Time</attribute>"
" <attribute name='submenu-action'>app.time-active</attribute>"
" </submenu>"
" </menu>" " </menu>"
"</interface>", -1, NULL); "</interface>", -1, NULL);
gtk_application_set_app_menu (GTK_APPLICATION (application), G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu"))); gtk_application_set_app_menu (GTK_APPLICATION (application), G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu")));
gtk_application_set_menubar (GTK_APPLICATION (application), G_MENU_MODEL (gtk_builder_get_object (builder, "menubar"))); gtk_application_set_menubar (GTK_APPLICATION (application), G_MENU_MODEL (gtk_builder_get_object (builder, "menubar")));
//gtk_application_set_menubar (GTK_APPLICATION (application), G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu")));
bloatpad->time = G_MENU (gtk_builder_get_object (builder, "time-menu"));
g_object_unref (builder); g_object_unref (builder);
} }
static void
bloat_pad_shutdown (GApplication *application)
{
BloatPad *bloatpad = (BloatPad *) application;
if (bloatpad->timeout)
{
g_source_remove (bloatpad->timeout);
bloatpad->timeout = 0;
}
G_APPLICATION_CLASS (bloat_pad_parent_class)
->shutdown (application);
}
static void static void
bloat_pad_init (BloatPad *app) bloat_pad_init (BloatPad *app)
{ {
@@ -320,6 +398,7 @@ bloat_pad_class_init (BloatPadClass *class)
GObjectClass *object_class = G_OBJECT_CLASS (class); GObjectClass *object_class = G_OBJECT_CLASS (class);
application_class->startup = bloat_pad_startup; application_class->startup = bloat_pad_startup;
application_class->shutdown = bloat_pad_shutdown;
application_class->activate = bloat_pad_activate; application_class->activate = bloat_pad_activate;
application_class->open = bloat_pad_open; application_class->open = bloat_pad_open;
@@ -330,9 +409,7 @@ bloat_pad_class_init (BloatPadClass *class)
BloatPad * BloatPad *
bloat_pad_new (void) bloat_pad_new (void)
{ {
GtkApplication *bloat_pad; BloatPad *bloat_pad;
g_type_init ();
g_set_application_name ("Bloatpad"); g_set_application_name ("Bloatpad");

View File

@@ -465,8 +465,6 @@ plug_man_class_init (PlugManClass *class)
PlugMan * PlugMan *
plug_man_new (void) plug_man_new (void)
{ {
g_type_init ();
return g_object_new (plug_man_get_type (), return g_object_new (plug_man_get_type (),
"application-id", "org.gtk.Test.plugman", "application-id", "org.gtk.Test.plugman",
"flags", G_APPLICATION_HANDLES_OPEN, "flags", G_APPLICATION_HANDLES_OPEN,

View File

@@ -191,8 +191,6 @@ menu_button_class_init (MenuButtonClass *class)
MenuButton * MenuButton *
menu_button_new (void) menu_button_new (void)
{ {
g_type_init ();
return g_object_new (menu_button_get_type (), return g_object_new (menu_button_get_type (),
"application-id", "org.gtk.Test.Sunny", "application-id", "org.gtk.Test.Sunny",
"flags", G_APPLICATION_HANDLES_OPEN, "flags", G_APPLICATION_HANDLES_OPEN,

View File

@@ -341,7 +341,8 @@ gdkmarshalers.h: @REBUILD@ gdkmarshalers.list
&& mv gdkmarshalers-h.tmp gdkmarshalers.h \ && mv gdkmarshalers-h.tmp gdkmarshalers.h \
|| ( rm -f gdkmarshalers-h.tmp && exit 1) || ( rm -f gdkmarshalers-h.tmp && exit 1)
gdkmarshalers.c: @REBUILD@ gdkmarshalers.list gdkmarshalers.c: @REBUILD@ gdkmarshalers.list
$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --body > gdkmarshalers-c.tmp \ $(AM_V_GEN) (echo "#include \"gdkmarshalers.h\""; \
$(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --body) > gdkmarshalers-c.tmp \
&& mv gdkmarshalers-c.tmp gdkmarshalers.c \ && mv gdkmarshalers-c.tmp gdkmarshalers.c \
|| ( rm -f gdkmarshalers-c.tmp && exit 1 ) || ( rm -f gdkmarshalers-c.tmp && exit 1 )

View File

@@ -31,12 +31,12 @@ libbroadway_la_SOURCES = \
broadway.c broadway.c
clienthtml.h: client.html clienthtml.h: client.html
$(PERL) ./toarray.pl client.html client_html > $@ $(PERL) $(srcdir)/toarray.pl $(srcdir)/client.html client_html > $@
EXTRA_DIST += client.html EXTRA_DIST += client.html
broadwayjs.h: broadway.js broadwayjs.h: broadway.js
$(PERL) ./toarray.pl broadway.js broadway_js > $@ $(PERL) $(srcdir)/toarray.pl $(srcdir)/broadway.js broadway_js > $@
EXTRA_DIST += broadway.js EXTRA_DIST += broadway.js

View File

@@ -57,8 +57,44 @@ base64_uint32 (guint32 v, char *c)
* conversion of raw image data to png data: uris * * conversion of raw image data to png data: uris *
***********************************************************/ ***********************************************************/
static cairo_status_t
write_png_data (void *closure,
const unsigned char *data,
unsigned int data_len)
{
GString *buf = closure;
g_string_append_len (buf, (char *)data, data_len);
return CAIRO_STATUS_SUCCESS;
}
static void
to_png_rgb (GString *buf, int w, int h, int byte_stride, guint32 *data)
{
cairo_surface_t *surface;
surface = cairo_image_surface_create_for_data ((guchar *)data,
CAIRO_FORMAT_RGB24, w, h, byte_stride);
cairo_surface_write_to_png_stream (surface, write_png_data, buf);
cairo_surface_destroy (surface);
}
static void
to_png_rgba (GString *buf, int w, int h, int byte_stride, guint32 *data)
{
cairo_surface_t *surface;
surface = cairo_image_surface_create_for_data ((guchar *)data,
CAIRO_FORMAT_ARGB32, w, h, byte_stride);
cairo_surface_write_to_png_stream (surface, write_png_data, buf);
cairo_surface_destroy (surface);
}
struct PngTarget { struct PngTarget {
GString *url; GString *buf;
int state; int state;
int save; int save;
}; };
@@ -71,71 +107,73 @@ write_png_url (void *closure,
struct PngTarget *target = closure; struct PngTarget *target = closure;
gsize res, old_len; gsize res, old_len;
old_len = target->url->len; old_len = target->buf->len;
g_string_set_size (target->url, g_string_set_size (target->buf,
old_len + (data_len / 3 + 1) * 4 + 4); old_len + (data_len / 3 + 1) * 4 + 4);
res = g_base64_encode_step (data, data_len, FALSE, res = g_base64_encode_step (data, data_len, FALSE,
target->url->str + old_len, target->buf->str + old_len,
&target->state, &target->save); &target->state, &target->save);
g_string_set_size (target->url, old_len + res); g_string_set_size (target->buf, old_len + res);
return CAIRO_STATUS_SUCCESS; return CAIRO_STATUS_SUCCESS;
} }
static char * static void
to_png_rgb (int w, int h, int byte_stride, guint32 *data) to_png_url_rgb (GString *buf, int w, int h, int byte_stride, guint32 *data)
{ {
cairo_surface_t *surface; cairo_surface_t *surface;
struct PngTarget target; struct PngTarget target;
gsize res, old_len; gsize res, old_len;
target.url = g_string_new ("data:image/png;base64,"); target.buf = buf;
target.state = 0; target.state = 0;
target.save = 0; target.save = 0;
g_string_append (buf, "data:image/png;base64,");
surface = cairo_image_surface_create_for_data ((guchar *)data, surface = cairo_image_surface_create_for_data ((guchar *)data,
CAIRO_FORMAT_RGB24, w, h, byte_stride); CAIRO_FORMAT_RGB24, w, h, byte_stride);
cairo_surface_write_to_png_stream (surface, write_png_url, &target); cairo_surface_write_to_png_stream (surface, write_png_url, &target);
cairo_surface_destroy (surface);
old_len = target.url->len; old_len = buf->len;
g_string_set_size (target.url, old_len + 4); g_string_set_size (buf, old_len + 4);
res = g_base64_encode_close (FALSE, res = g_base64_encode_close (FALSE,
target.url->str + old_len, buf->str + old_len,
&target.state, &target.save); &target.state, &target.save);
g_string_set_size (target.url, old_len + res); g_string_set_size (buf, old_len + res);
return g_string_free (target.url, FALSE);
} }
static char * static void
to_png_rgba (int w, int h, int byte_stride, guint32 *data) to_png_url_rgba (GString *buf, int w, int h, int byte_stride, guint32 *data)
{ {
cairo_surface_t *surface; cairo_surface_t *surface;
struct PngTarget target; struct PngTarget target;
gsize res, old_len; gsize res, old_len;
target.url = g_string_new ("data:image/png;base64,"); target.buf = buf;
target.state = 0; target.state = 0;
target.save = 0; target.save = 0;
g_string_append (buf, "data:image/png;base64,");
surface = cairo_image_surface_create_for_data ((guchar *)data, surface = cairo_image_surface_create_for_data ((guchar *)data,
CAIRO_FORMAT_ARGB32, w, h, byte_stride); CAIRO_FORMAT_ARGB32, w, h, byte_stride);
cairo_surface_write_to_png_stream (surface, write_png_url, &target); cairo_surface_write_to_png_stream (surface, write_png_url, &target);
cairo_surface_destroy (surface);
old_len = target.url->len; old_len = buf->len;
g_string_set_size (target.url, old_len + 4); g_string_set_size (buf, old_len + 4);
res = g_base64_encode_close (FALSE, res = g_base64_encode_close (FALSE,
target.url->str + old_len, buf->str + old_len,
&target.state, &target.save); &target.state, &target.save);
g_string_set_size (target.url, old_len + res); g_string_set_size (buf, old_len + res);
return g_string_free (target.url, FALSE);
} }
#if 0 #if 0
@@ -173,9 +211,11 @@ to_png_a (int w, int h, int byte_stride, guint8 *data)
struct BroadwayOutput { struct BroadwayOutput {
GOutputStream *out; GOutputStream *out;
GString *buf;
int error; int error;
guint32 serial; guint32 serial;
gboolean proto_v7_plus; gboolean proto_v7_plus;
gboolean binary;
}; };
static void static void
@@ -212,13 +252,12 @@ broadway_output_send_cmd (BroadwayOutput *output,
} }
static void static void
broadway_output_sendmsg (BroadwayOutput *output, broadway_output_send_cmd_pre_v7 (BroadwayOutput *output,
const void *buf, gsize count) const void *buf, gsize count)
{ {
if (!output->proto_v7_plus) g_output_stream_write_all (output->out, "\0", 1, NULL, NULL, NULL);
g_output_stream_write_all (output->out, buf, count, NULL, NULL, NULL); g_output_stream_write_all (output->out, buf, count, NULL, NULL, NULL);
else g_output_stream_write_all (output->out, "\xff", 1, NULL, NULL, NULL);
broadway_output_send_cmd (output, TRUE, BROADWAY_WS_TEXT, buf, count);
} }
void broadway_output_pong (BroadwayOutput *output) void broadway_output_pong (BroadwayOutput *output)
@@ -227,42 +266,40 @@ void broadway_output_pong (BroadwayOutput *output)
broadway_output_send_cmd (output, TRUE, BROADWAY_WS_CNX_PONG, NULL, 0); broadway_output_send_cmd (output, TRUE, BROADWAY_WS_CNX_PONG, NULL, 0);
} }
static void
broadway_output_sendmsg_initiate (BroadwayOutput *output)
{
if (!output->proto_v7_plus)
g_output_stream_write (output->out, "\0", 1, NULL, NULL);
else
{
}
}
int int
broadway_output_flush (BroadwayOutput *output) broadway_output_flush (BroadwayOutput *output)
{ {
if (output->buf->len == 0)
return TRUE;
if (!output->proto_v7_plus) if (!output->proto_v7_plus)
{ broadway_output_send_cmd_pre_v7 (output, output->buf->str, output->buf->len);
broadway_output_sendmsg (output, "\xff", 1); else if (output->binary)
broadway_output_sendmsg (output, "\0", 1); broadway_output_send_cmd (output, TRUE, BROADWAY_WS_BINARY,
return !output->error; output->buf->str, output->buf->len);
} else
else /* no need to flush */ broadway_output_send_cmd (output, TRUE, BROADWAY_WS_TEXT,
return !output->error; output->buf->str, output->buf->len);
g_string_set_size (output->buf, 0);
return !output->error;
} }
BroadwayOutput * BroadwayOutput *
broadway_output_new(GOutputStream *out, guint32 serial, broadway_output_new (GOutputStream *out, guint32 serial,
gboolean proto_v7_plus) gboolean proto_v7_plus, gboolean binary)
{ {
BroadwayOutput *output; BroadwayOutput *output;
output = g_new0 (BroadwayOutput, 1); output = g_new0 (BroadwayOutput, 1);
output->out = g_object_ref (out); output->out = g_object_ref (out);
output->buf = g_string_new ("");
output->serial = serial; output->serial = serial;
output->proto_v7_plus = proto_v7_plus; output->proto_v7_plus = proto_v7_plus;
output->binary = binary;
broadway_output_sendmsg_initiate (output);
return output; return output;
} }
@@ -285,32 +322,97 @@ broadway_output_get_next_serial (BroadwayOutput *output)
* Core rendering operations * * Core rendering operations *
************************************************************************/ ************************************************************************/
#define HEADER_LEN (1+6)
static void static void
append_uint16 (guint32 v, char *buf, int *p) append_char (BroadwayOutput *output, char c)
{ {
base64_uint16 (v, &buf[*p]); g_string_append_c (output->buf, c);
*p += 3;
} }
static void static void
append_uint32 (guint32 v, char *buf, int *p) append_bool (BroadwayOutput *output, gboolean val)
{ {
base64_uint32 (v, &buf[*p]); if (output->binary)
*p += 6; g_string_append_c (output->buf, val ? 1: 0);
else
g_string_append_c (output->buf, val ? '1': '0');
} }
static int static void
write_header(BroadwayOutput *output, char *buf, char op) append_flags (BroadwayOutput *output, guint32 val)
{ {
int p; if (output->binary)
g_string_append_c (output->buf, val);
else
g_string_append_c (output->buf, val + '0');
}
p = 0;
buf[p++] = op;
append_uint32 (output->serial++, buf, &p);
return p; static void
append_uint16 (BroadwayOutput *output, guint32 v)
{
gsize old_len = output->buf->len;
if (output->binary)
{
guint8 *buf = (guint8 *)output->buf->str + old_len;
g_string_set_size (output->buf, old_len + 2);
buf[0] = (v >> 0) & 0xff;
buf[1] = (v >> 8) & 0xff;
}
else
{
g_string_set_size (output->buf, old_len + 3);
base64_uint16 (v, output->buf->str + old_len);
}
}
static void
append_uint32 (BroadwayOutput *output, guint32 v)
{
gsize old_len = output->buf->len;
if (output->binary)
{
guint8 *buf = (guint8 *)output->buf->str + old_len;
g_string_set_size (output->buf, old_len + 4);
buf[0] = (v >> 0) & 0xff;
buf[1] = (v >> 8) & 0xff;
buf[2] = (v >> 16) & 0xff;
buf[3] = (v >> 24) & 0xff;
}
else
{
g_string_set_size (output->buf, old_len + 6);
base64_uint32 (v, output->buf->str + old_len);
}
}
static void
overwrite_uint32 (BroadwayOutput *output, gsize pos, guint32 v)
{
if (output->binary)
{
guint8 *buf = (guint8 *)output->buf->str + pos;
buf[0] = (v >> 0) & 0xff;
buf[1] = (v >> 8) & 0xff;
buf[2] = (v >> 16) & 0xff;
buf[3] = (v >> 24) & 0xff;
}
else
{
base64_uint32 (v, output->buf->str + pos);
}
}
static void
write_header(BroadwayOutput *output, char op)
{
append_char (output, op);
append_uint32 (output, output->serial++);
} }
void void
@@ -318,29 +420,20 @@ broadway_output_copy_rectangles (BroadwayOutput *output, int id,
BroadwayRect *rects, int n_rects, BroadwayRect *rects, int n_rects,
int dx, int dy) int dx, int dy)
{ {
char *buf; int i;
int len, i, p;
len = HEADER_LEN + 3 + 3 + 3*4*n_rects + 3 + 3; write_header (output, 'b');
append_uint16 (output, id);
buf = g_malloc (len); append_uint16 (output, n_rects);
p = write_header (output, buf, 'b');
append_uint16 (id, buf, &p);
append_uint16 (n_rects, buf, &p);
for (i = 0; i < n_rects; i++) for (i = 0; i < n_rects; i++)
{ {
append_uint16 (rects[i].x, buf, &p); append_uint16 (output, rects[i].x);
append_uint16 (rects[i].y, buf, &p); append_uint16 (output, rects[i].y);
append_uint16 (rects[i].width, buf, &p); append_uint16 (output, rects[i].width);
append_uint16 (rects[i].height, buf, &p); append_uint16 (output, rects[i].height);
} }
append_uint16 (dx, buf, &p); append_uint16 (output, dx);
append_uint16 (dy, buf, &p); append_uint16 (output, dy);
assert (p == len);
broadway_output_sendmsg (output, buf, len);
free (buf);
} }
void void
@@ -348,31 +441,18 @@ broadway_output_grab_pointer (BroadwayOutput *output,
int id, int id,
gboolean owner_event) gboolean owner_event)
{ {
char buf[HEADER_LEN + 3 + 1]; write_header (output, 'g');
int p; append_uint16 (output, id);
append_bool (output, owner_event);
p = write_header (output, buf, 'g');
append_uint16 (id, buf, &p);
buf[p++] = owner_event ? '1': '0';
assert (p == sizeof (buf));
broadway_output_sendmsg (output, buf, sizeof (buf));
} }
guint32 guint32
broadway_output_ungrab_pointer (BroadwayOutput *output) broadway_output_ungrab_pointer (BroadwayOutput *output)
{ {
char buf[HEADER_LEN];
guint32 serial; guint32 serial;
int p;
serial = output->serial; serial = output->serial;
p = write_header (output, buf, 'u'); write_header (output, 'u');
assert (p == sizeof (buf));
broadway_output_sendmsg (output, buf, sizeof (buf));
return serial; return serial;
} }
@@ -382,62 +462,34 @@ broadway_output_new_surface(BroadwayOutput *output,
int id, int x, int y, int w, int h, int id, int x, int y, int w, int h,
gboolean is_temp) gboolean is_temp)
{ {
char buf[HEADER_LEN + 16]; write_header (output, 's');
int p; append_uint16 (output, id);
append_uint16 (output, x);
p = write_header (output, buf, 's'); append_uint16 (output, y);
append_uint16 (id, buf, &p); append_uint16 (output, w);
append_uint16 (x, buf, &p); append_uint16 (output, h);
append_uint16 (y, buf, &p); append_bool (output, is_temp);
append_uint16 (w, buf, &p);
append_uint16 (h, buf, &p);
buf[p++] = is_temp ? '1' : '0';
assert (p == sizeof (buf));
broadway_output_sendmsg (output, buf, sizeof (buf));
} }
void void
broadway_output_show_surface(BroadwayOutput *output, int id) broadway_output_show_surface(BroadwayOutput *output, int id)
{ {
char buf[HEADER_LEN + 3]; write_header (output, 'S');
int p; append_uint16 (output, id);
p = write_header (output, buf, 'S');
append_uint16 (id, buf, &p);
assert (p == sizeof (buf));
broadway_output_sendmsg (output, buf, sizeof (buf));
} }
void void
broadway_output_hide_surface(BroadwayOutput *output, int id) broadway_output_hide_surface(BroadwayOutput *output, int id)
{ {
char buf[HEADER_LEN + 3]; write_header (output, 'H');
int p; append_uint16 (output, id);
p = write_header (output, buf, 'H');
append_uint16 (id, buf, &p);
assert (p == sizeof (buf));
broadway_output_sendmsg (output, buf, sizeof (buf));
} }
void void
broadway_output_destroy_surface(BroadwayOutput *output, int id) broadway_output_destroy_surface(BroadwayOutput *output, int id)
{ {
char buf[HEADER_LEN + 3]; write_header (output, 'd');
int p; append_uint16 (output, id);
p = write_header (output, buf, 'd');
append_uint16 (id, buf, &p);
assert (p == sizeof (buf));
broadway_output_sendmsg (output, buf, sizeof (buf));
} }
@@ -451,31 +503,25 @@ broadway_output_move_resize_surface (BroadwayOutput *output,
int w, int w,
int h) int h)
{ {
char buf[HEADER_LEN+3+1+6+6];
int p;
int val; int val;
if (!has_pos && !has_size) if (!has_pos && !has_size)
return; return;
p = write_header (output, buf, 'm'); write_header (output, 'm');
val = (!!has_pos) | ((!!has_size) << 1); val = (!!has_pos) | ((!!has_size) << 1);
append_uint16 (id, buf, &p); append_uint16 (output, id);
buf[p++] = val + '0'; append_flags (output, val);
if (has_pos) if (has_pos)
{ {
append_uint16 (x, buf, &p); append_uint16 (output, x);
append_uint16 (y, buf, &p); append_uint16 (output, y);
} }
if (has_size) if (has_size)
{ {
append_uint16 (w, buf, &p); append_uint16 (output, w);
append_uint16 (h, buf, &p); append_uint16 (output, h);
} }
assert (p <= sizeof (buf));
broadway_output_sendmsg (output, buf, p);
} }
void void
@@ -483,17 +529,9 @@ broadway_output_set_transient_for (BroadwayOutput *output,
int id, int id,
int parent_id) int parent_id)
{ {
char buf[HEADER_LEN + 6]; write_header (output, 'p');
int p; append_uint16 (output, id);
append_uint16 (output, parent_id);
p = write_header (output, buf, 'p');
append_uint16 (id, buf, &p);
append_uint16 (parent_id, buf, &p);
assert (p == sizeof (buf));
broadway_output_sendmsg (output, buf, sizeof (buf));
} }
@@ -501,32 +539,26 @@ void
broadway_output_put_rgb (BroadwayOutput *output, int id, int x, int y, broadway_output_put_rgb (BroadwayOutput *output, int id, int x, int y,
int w, int h, int byte_stride, void *data) int w, int h, int byte_stride, void *data)
{ {
gsize buf_size; gsize size_start, image_start, len;
gsize url_len;
char *url, *buf;
int p;
url = to_png_rgb (w, h, byte_stride, (guint32*)data); write_header (output, 'i');
url_len = strlen (url);
buf_size = HEADER_LEN + 15 + url_len; append_uint16 (output, id);
buf = g_malloc (buf_size); append_uint16 (output, x);
append_uint16 (output, y);
p = write_header (output, buf, 'i'); size_start = output->buf->len;
append_uint32 (output, 0);
append_uint16 (id, buf, &p); image_start = output->buf->len;
append_uint16 (x, buf, &p); if (output->binary)
append_uint16 (y, buf, &p); to_png_rgb (output->buf, w, h, byte_stride, (guint32*)data);
else
to_png_url_rgb (output->buf, w, h, byte_stride, (guint32*)data);
append_uint32 (url_len, buf, &p); len = output->buf->len - image_start;
g_assert (p == HEADER_LEN + 15); overwrite_uint32 (output, size_start, len);
strncpy (buf + p, url, url_len);
broadway_output_sendmsg (output, buf, buf_size);
g_free (buf);
free (url);
} }
typedef struct { typedef struct {
@@ -757,39 +789,38 @@ broadway_output_put_rgba (BroadwayOutput *output, int id, int x, int y,
int w, int h, int byte_stride, void *data) int w, int h, int byte_stride, void *data)
{ {
BroadwayBox *rects; BroadwayBox *rects;
int p, i, n_rects; int i, n_rects;
gsize size_start, image_start, len;
rects = rgba_find_rects (data, w, h, byte_stride, &n_rects); rects = rgba_find_rects (data, w, h, byte_stride, &n_rects);
for (i = 0; i < n_rects; i++) for (i = 0; i < n_rects; i++)
{ {
gsize url_len, buf_size;
char *buf, *url;
guint8 *subdata; guint8 *subdata;
write_header (output, 'i');
append_uint16 (output, id);
append_uint16 (output, x + rects[i].x1);
append_uint16 (output, y + rects[i].y1);
size_start = output->buf->len;
append_uint32 (output, 0);
image_start = output->buf->len;
subdata = (guint8 *)data + rects[i].x1 * 4 + rects[i].y1 * byte_stride; subdata = (guint8 *)data + rects[i].x1 * 4 + rects[i].y1 * byte_stride;
url = to_png_rgba (rects[i].x2 - rects[i].x1, if (output->binary)
to_png_rgba (output->buf, rects[i].x2 - rects[i].x1,
rects[i].y2 - rects[i].y1,
byte_stride, (guint32*)subdata);
else
to_png_url_rgba (output->buf, rects[i].x2 - rects[i].x1,
rects[i].y2 - rects[i].y1, rects[i].y2 - rects[i].y1,
byte_stride, (guint32*)subdata); byte_stride, (guint32*)subdata);
url_len = strlen (url); len = output->buf->len - image_start;
buf_size = HEADER_LEN + 15 + url_len;
buf = g_malloc (buf_size);
overwrite_uint32 (output, size_start, len);
p = write_header (output, buf, 'i');
append_uint16 (id, buf, &p);
append_uint16 (x + rects[i].x1, buf, &p);
append_uint16 (y + rects[i].y1, buf, &p);
append_uint32 (url_len, buf, &p);
g_assert (p == HEADER_LEN + 15);
strncpy (buf + p, url, url_len);
broadway_output_sendmsg (output, buf, buf_size);
free (url);
g_free (buf);
} }
free (rects); free (rects);
@@ -799,13 +830,6 @@ void
broadway_output_surface_flush (BroadwayOutput *output, broadway_output_surface_flush (BroadwayOutput *output,
int id) int id)
{ {
char buf[HEADER_LEN + 3]; write_header (output, 'f');
int p; append_uint16 (output, id);
p = write_header (output, buf, 'f');
append_uint16 (id, buf, &p);
g_assert (p == sizeof (buf));
broadway_output_sendmsg (output, buf, sizeof (buf));
} }

View File

@@ -19,7 +19,8 @@ typedef enum {
BroadwayOutput *broadway_output_new (GOutputStream *out, BroadwayOutput *broadway_output_new (GOutputStream *out,
guint32 serial, guint32 serial,
gboolean proto_v7_plus); gboolean proto_v7_plus,
gboolean binary);
void broadway_output_free (BroadwayOutput *output); void broadway_output_free (BroadwayOutput *output);
int broadway_output_flush (BroadwayOutput *output); int broadway_output_flush (BroadwayOutput *output);
int broadway_output_has_error (BroadwayOutput *output); int broadway_output_has_error (BroadwayOutput *output);

View File

@@ -725,76 +725,56 @@ function cmdUngrabPointer()
doUngrab(); doUngrab();
} }
function handleCommands(cmdObj) function handleCommands(cmd)
{ {
var cmd = cmdObj.data; while (cmd.pos < cmd.length) {
var i = cmdObj.pos;
while (i < cmd.length) {
var id, x, y, w, h, q; var id, x, y, w, h, q;
var command = cmd[i++]; var command = cmd.get_char();
lastSerial = base64_32(cmd, i); lastSerial = cmd.get_32();
i = i + 6;
switch (command) { switch (command) {
case 's': // create new surface case 's': // create new surface
id = base64_16(cmd, i); id = cmd.get_16();
i = i + 3; x = cmd.get_16s();
x = base64_16s(cmd, i); y = cmd.get_16s();
i = i + 3; w = cmd.get_16();
y = base64_16s(cmd, i); h = cmd.get_16();
i = i + 3; var isTemp = cmd.get_bool();
w = base64_16(cmd, i);
i = i + 3;
h = base64_16(cmd, i);
i = i + 3;
var isTemp = cmd[i] == '1';
i = i + 1;
cmdCreateSurface(id, x, y, w, h, isTemp); cmdCreateSurface(id, x, y, w, h, isTemp);
break; break;
case 'S': // Show a surface case 'S': // Show a surface
id = base64_16(cmd, i); id = cmd.get_16();
i = i + 3;
cmdShowSurface(id); cmdShowSurface(id);
break; break;
case 'H': // Hide a surface case 'H': // Hide a surface
id = base64_16(cmd, i); id = cmd.get_16();
i = i + 3;
cmdHideSurface(id); cmdHideSurface(id);
break; break;
case 'p': // Set transient parent case 'p': // Set transient parent
id = base64_16(cmd, i); id = cmd.get_16();
i = i + 3; var parentId = cmd.get_16();
var parentId = base64_16(cmd, i);
i = i + 3;
cmdSetTransientFor(id, parentId); cmdSetTransientFor(id, parentId);
break; break;
case 'd': // Delete surface case 'd': // Delete surface
id = base64_16(cmd, i); id = cmd.get_16();
i = i + 3;
cmdDeleteSurface(id); cmdDeleteSurface(id);
break; break;
case 'm': // Move a surface case 'm': // Move a surface
id = base64_16(cmd, i); id = cmd.get_16();
i = i + 3; var ops = cmd.get_flags();
var ops = cmd.charCodeAt(i++) - 48;
var has_pos = ops & 1; var has_pos = ops & 1;
if (has_pos) { if (has_pos) {
x = base64_16s(cmd, i); x = cmd.get_16s();
i = i + 3; y = cmd.get_16s();
y = base64_16s(cmd, i);
i = i + 3;
} }
var has_size = ops & 2; var has_size = ops & 2;
if (has_size) { if (has_size) {
w = base64_16(cmd, i); w = cmd.get_16();
i = i + 3; h = cmd.get_16();
h = base64_16(cmd, i);
i = i + 3;
} }
cmdMoveResizeSurface(id, has_pos, x, y, has_size, w, h); cmdMoveResizeSurface(id, has_pos, x, y, has_size, w, h);
break; break;
@@ -802,67 +782,50 @@ function handleCommands(cmdObj)
case 'i': // Put image data surface case 'i': // Put image data surface
q = new Object(); q = new Object();
q.op = 'i'; q.op = 'i';
q.id = base64_16(cmd, i); q.id = cmd.get_16();
i = i + 3; q.x = cmd.get_16();
q.x = base64_16(cmd, i); q.y = cmd.get_16();
i = i + 3; var url = cmd.get_image_url ();
q.y = base64_16(cmd, i);
i = i + 3;
var size = base64_32(cmd, i);
i = i + 6;
var url = cmd.slice(i, i + size);
i = i + size;
q.img = new Image(); q.img = new Image();
q.img.src = url; q.img.src = url;
surfaces[q.id].drawQueue.push(q); surfaces[q.id].drawQueue.push(q);
if (!q.img.complete) { if (!q.img.complete) {
cmdObj.pos = i; q.img.onload = function() { cmd.free_image_url (url); handleOutstanding(); };
q.img.onload = function() { handleOutstanding(); };
return false; return false;
} }
cmd.free_image_url (url);
break; break;
case 'b': // Copy rects case 'b': // Copy rects
q = new Object(); q = new Object();
q.op = 'b'; q.op = 'b';
q.id = base64_16(cmd, i); q.id = cmd.get_16();
i = i + 3; var nrects = cmd.get_16();
var nrects = base64_16(cmd, i);
i = i + 3;
q.rects = []; q.rects = [];
for (var r = 0; r < nrects; r++) { for (var r = 0; r < nrects; r++) {
var rect = new Object(); var rect = new Object();
rect.x = base64_16(cmd, i); rect.x = cmd.get_16();
i = i + 3; rect.y = cmd.get_16();
rect.y = base64_16(cmd, i); rect.w = cmd.get_16();
i = i + 3; rect.h = cmd.get_16();
rect.w = base64_16(cmd, i);
i = i + 3;
rect.h = base64_16(cmd, i);
i = i + 3;
q.rects.push (rect); q.rects.push (rect);
} }
q.dx = base64_16s(cmd, i); q.dx = cmd.get_16s();
i = i + 3; q.dy = cmd.get_16s();
q.dy = base64_16s(cmd, i);
i = i + 3;
surfaces[q.id].drawQueue.push(q); surfaces[q.id].drawQueue.push(q);
break; break;
case 'f': // Flush surface case 'f': // Flush surface
id = base64_16(cmd, i); id = cmd.get_16();
i = i + 3;
cmdFlushSurface(id); cmdFlushSurface(id);
break; break;
case 'g': // Grab case 'g': // Grab
id = base64_16(cmd, i); id = cmd.get_16();
i = i + 3; var ownerEvents = cmd.get_bool ();
var ownerEvents = cmd[i++] == '1';
cmdGrabPointer(id, ownerEvents); cmdGrabPointer(id, ownerEvents);
break; break;
@@ -888,13 +851,103 @@ function handleOutstanding()
} }
} }
function TextCommands(message) {
this.data = message;
this.length = message.length;
this.pos = 0;
}
TextCommands.prototype.get_char = function() {
return this.data[this.pos++];
};
TextCommands.prototype.get_bool = function() {
return this.get_char() == '1';
};
TextCommands.prototype.get_flags = function() {
return this.get_char() - 48;
}
TextCommands.prototype.get_16 = function() {
var n = base64_16(this.data, this.pos);
this.pos = this.pos + 3;
return n;
};
TextCommands.prototype.get_16s = function() {
var n = base64_16s(this.data, this.pos);
this.pos = this.pos + 3;
return n;
};
TextCommands.prototype.get_32 = function() {
var n = base64_32(this.data, this.pos);
this.pos = this.pos + 6;
return n;
};
TextCommands.prototype.get_image_url = function() {
var size = this.get_32();
var url = this.data.slice(this.pos, this.pos + size);
this.pos = this.pos + size;
return url;
};
TextCommands.prototype.free_image_url = function(url) {
};
function BinCommands(message) {
this.arraybuffer = message;
this.u8 = new Uint8Array(message);
this.length = this.u8.length;
this.pos = 0;
}
BinCommands.prototype.get_char = function() {
return String.fromCharCode(this.u8[this.pos++]);
};
BinCommands.prototype.get_bool = function() {
return this.u8[this.pos++] != 0;
};
BinCommands.prototype.get_flags = function() {
return this.u8[this.pos++];
}
BinCommands.prototype.get_16 = function() {
var v =
this.u8[this.pos] +
(this.u8[this.pos+1] << 8);
this.pos = this.pos + 2;
return v;
};
BinCommands.prototype.get_16s = function() {
var v = this.get_16 ();
if (v > 32767)
return v - 65536;
else
return v;
};
BinCommands.prototype.get_32 = function() {
var v =
this.u8[this.pos] +
(this.u8[this.pos+1] << 8) +
(this.u8[this.pos+2] << 16) +
(this.u8[this.pos+3] << 24);
this.pos = this.pos + 4;
return v;
};
BinCommands.prototype.get_image_url = function() {
var size = this.get_32();
var png_blob = new Blob ([this.arraybuffer.slice (this.pos, this.pos + size)], {type:"image/png"});
var url = URL.createObjectURL(png_blob, {oneTimeOnly: true});
this.pos = this.pos + size;
return url;
};
BinCommands.prototype.free_image_url = function(url) {
URL.revokeObjectURL(url);
};
function handleMessage(message) function handleMessage(message)
{ {
var cmdObj = {}; var cmd;
cmdObj.data = message; if (message instanceof ArrayBuffer)
cmdObj.pos = 0; cmd = new BinCommands(message);
else
outstandingCommands.push(cmdObj); cmd = new TextCommands(message);
outstandingCommands.push(cmd);
if (outstandingCommands.length == 1) { if (outstandingCommands.length == 1) {
handleOutstanding(); handleOutstanding();
} }
@@ -2759,6 +2812,18 @@ function setupDocument(document)
} }
} }
function newWS(loc) {
var ws = null;
if ("WebSocket" in window) {
ws = new WebSocket(loc, "broadway");
} else if ("MozWebSocket" in window) { // Firefox 6
ws = new MozWebSocket(loc);
} else {
alert("WebSocket not supported, broadway will not work!");
}
return ws;
}
function connect() function connect()
{ {
var url = window.location.toString(); var url = window.location.toString();
@@ -2771,41 +2836,39 @@ function connect()
var loc = window.location.toString().replace("http:", "ws:"); var loc = window.location.toString().replace("http:", "ws:");
loc = loc.substr(0, loc.lastIndexOf('/')) + "/socket"; loc = loc.substr(0, loc.lastIndexOf('/')) + "/socket";
var ws = null;
if ("WebSocket" in window) { var supports_binary = newWS (loc + "-test").binaryType == "blob";
ws = new WebSocket(loc, "broadway"); if (supports_binary) {
} else if ("MozWebSocket" in window) { // Firefox 6 ws = newWS (loc + "-bin");
ws = new MozWebSocket(loc); ws.binaryType = "arraybuffer";
} else { } else {
alert("WebSocket not supported, input will not work!"); ws = newWS (loc);
return;
} }
ws.onopen = function() { ws.onopen = function() {
inputSocket = ws; inputSocket = ws;
var w, h; var w, h;
if (useToplevelWindows) { if (useToplevelWindows) {
w = window.screen.width; w = window.screen.width;
h = window.screen.height; h = window.screen.height;
} else { } else {
w = window.innerWidth;
h = window.innerHeight;
window.onresize = function(ev) {
var w, h;
w = window.innerWidth; w = window.innerWidth;
h = window.innerHeight; h = window.innerHeight;
window.onresize = function(ev) { sendInput ("d", [w, h]);
var w, h; };
w = window.innerWidth; }
h = window.innerHeight; sendInput ("d", [w, h]);
sendInput ("d", [w, h]); };
}; ws.onclose = function() {
} inputSocket = null;
sendInput ("d", [w, h]); };
}; ws.onmessage = function(event) {
ws.onclose = function() { handleMessage(event.data);
inputSocket = null; };
};
ws.onmessage = function(event) {
handleMessage(event.data);
};
setupDocument(document); setupDocument(document);
window.onunload = function (ev) { window.onunload = function (ev) {

View File

@@ -130,7 +130,7 @@ typedef struct HttpRequest {
GString *request; GString *request;
} HttpRequest; } HttpRequest;
static void start_output (HttpRequest *request, gboolean proto_v7_plus); static void start_output (HttpRequest *request, gboolean proto_v7_plus, gboolean binary);
static void static void
http_request_free (HttpRequest *request) http_request_free (HttpRequest *request)
@@ -149,6 +149,7 @@ struct BroadwayInput {
gboolean seen_time; gboolean seen_time;
gint64 time_base; gint64 time_base;
gboolean proto_v7_plus; gboolean proto_v7_plus;
gboolean binary;
}; };
static void static void
@@ -691,7 +692,7 @@ generate_handshake_response_wsietf_v7 (const gchar *key)
} }
static void static void
start_input (HttpRequest *request) start_input (HttpRequest *request, gboolean binary)
{ {
char **lines; char **lines;
char *p; char *p;
@@ -867,6 +868,7 @@ start_input (HttpRequest *request)
input->display = request->display; input->display = request->display;
input->connection = g_object_ref (request->connection); input->connection = g_object_ref (request->connection);
input->proto_v7_plus = proto_v7_plus; input->proto_v7_plus = proto_v7_plus;
input->binary = binary;
data_buffer = g_buffered_input_stream_peek_buffer (G_BUFFERED_INPUT_STREAM (request->data), &data_buffer_size); data_buffer = g_buffered_input_stream_peek_buffer (G_BUFFERED_INPUT_STREAM (request->data), &data_buffer_size);
input->buffer = g_byte_array_sized_new (data_buffer_size); input->buffer = g_byte_array_sized_new (data_buffer_size);
@@ -874,7 +876,7 @@ start_input (HttpRequest *request)
broadway_display->input = input; broadway_display->input = input;
start_output (request, proto_v7_plus); start_output (request, proto_v7_plus, binary);
/* This will free and close the data input stream, but we got all the buffered content already */ /* This will free and close the data input stream, but we got all the buffered content already */
http_request_free (request); http_request_free (request);
@@ -892,7 +894,7 @@ start_input (HttpRequest *request)
} }
static void static void
start_output (HttpRequest *request, gboolean proto_v7_plus) start_output (HttpRequest *request, gboolean proto_v7_plus, gboolean binary)
{ {
GSocket *socket; GSocket *socket;
GdkBroadwayDisplay *broadway_display; GdkBroadwayDisplay *broadway_display;
@@ -912,7 +914,7 @@ start_output (HttpRequest *request, gboolean proto_v7_plus)
broadway_display->output = broadway_display->output =
broadway_output_new (g_io_stream_get_output_stream (G_IO_STREAM (request->connection)), broadway_output_new (g_io_stream_get_output_stream (G_IO_STREAM (request->connection)),
broadway_display->saved_serial, proto_v7_plus); broadway_display->saved_serial, proto_v7_plus, binary);
_gdk_broadway_resync_windows (); _gdk_broadway_resync_windows ();
@@ -985,7 +987,9 @@ got_request (HttpRequest *request)
else if (strcmp (escaped, "/broadway.js") == 0) else if (strcmp (escaped, "/broadway.js") == 0)
send_data (request, "text/javascript", broadway_js, G_N_ELEMENTS(broadway_js) - 1); send_data (request, "text/javascript", broadway_js, G_N_ELEMENTS(broadway_js) - 1);
else if (strcmp (escaped, "/socket") == 0) else if (strcmp (escaped, "/socket") == 0)
start_input (request); start_input (request, FALSE);
else if (strcmp (escaped, "/socket-bin") == 0)
start_input (request, TRUE);
else else
send_error (request, 404, "File not found"); send_error (request, 404, "File not found");

View File

@@ -274,8 +274,6 @@ gdk_pre_parse_libgtk_only (void)
_gdk_rendering_mode = GDK_RENDERING_MODE_RECORDING; _gdk_rendering_mode = GDK_RENDERING_MODE_RECORDING;
} }
g_type_init ();
/* Do any setup particular to the windowing system */ /* Do any setup particular to the windowing system */
gdk_display_manager_get (); gdk_display_manager_get ();
} }

View File

@@ -24,6 +24,8 @@
#include "config.h" #include "config.h"
#include "gdkdisplay.h" #include "gdkdisplay.h"
#include "gdkmain.h"
#include "gdkwindow.h"
/** /**
* gdk_pointer_ungrab: * gdk_pointer_ungrab:

View File

@@ -584,12 +584,11 @@ gdk_keymap_translate_keyboard_state (GdkKeymap *keymap,
/** /**
* gdk_keymap_add_virtual_modifiers: * gdk_keymap_add_virtual_modifiers:
* @keymap: a #GdkKeymap * @keymap: a #GdkKeymap
* @state: (out): pointer to the modifier mask to change * @state: (inout): pointer to the modifier mask to change
* *
* Adds virtual modifiers (i.e. Super, Hyper and Meta) which correspond * Maps the non-virtual modifiers (i.e Mod2, Mod3, ...) which are set
* to the real modifiers (i.e Mod2, Mod3, ...) in @modifiers. * in @state to the virtual modifiers (i.e. Super, Hyper and Meta) and
* are set in @state to their non-virtual counterparts (i.e. Mod2, * set the corresponding bits in @state.
* Mod3,...) and set the corresponding bits in @state.
* *
* GDK already does this before delivering key events, but for * GDK already does this before delivering key events, but for
* compatibility reasons, it only sets the first virtual modifier * compatibility reasons, it only sets the first virtual modifier
@@ -612,7 +611,7 @@ gdk_keymap_add_virtual_modifiers (GdkKeymap *keymap,
/** /**
* gdk_keymap_map_virtual_modifiers: * gdk_keymap_map_virtual_modifiers:
* @keymap: a #GdkKeymap * @keymap: a #GdkKeymap
* @state: (out): pointer to the modifier state to map * @state: (inout): pointer to the modifier state to map
* *
* Maps the virtual modifiers (i.e. Super, Hyper and Meta) which * Maps the virtual modifiers (i.e. Super, Hyper and Meta) which
* are set in @state to their non-virtual counterparts (i.e. Mod2, * are set in @state to their non-virtual counterparts (i.e. Mod2,

View File

@@ -24,6 +24,7 @@
#include "config.h" #include "config.h"
#include "gdkkeys.h"
#include "gdktypes.h" #include "gdktypes.h"

View File

@@ -21,6 +21,7 @@
#include "config.h" #include "config.h"
#include "gdkinternals.h"
#include "gdkscreenprivate.h" #include "gdkscreenprivate.h"
#include "gdkrectangle.h" #include "gdkrectangle.h"
#include "gdkwindow.h" #include "gdkwindow.h"

View File

@@ -29,7 +29,7 @@ G_BEGIN_DECLS
/** /**
* SECTION:gdktesting * SECTION:gdktestutils
* @Short_description: Test utilities * @Short_description: Test utilities
* @Title: Testing * @Title: Testing
* *

View File

@@ -90,6 +90,16 @@
*/ */
#define GDK_VERSION_3_6 (G_ENCODE_VERSION (3, 6)) #define GDK_VERSION_3_6 (G_ENCODE_VERSION (3, 6))
/**
* GDK_VERSION_3_8:
*
* A macro that evaluates to the 3.8 version of GDK, in a format
* that can be used by the C pre-processor.
*
* Since: 3.8
*/
#define GDK_VERSION_3_8 (G_ENCODE_VERSION (3, 8))
/* evaluates to the current stable version; for development cycles, /* evaluates to the current stable version; for development cycles,
* this means the next stable target * this means the next stable target
@@ -217,4 +227,18 @@
# define GDK_AVAILABLE_IN_3_6 # define GDK_AVAILABLE_IN_3_6
#endif #endif
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_8
# define GDK_DEPRECATED_IN_3_8 GDK_DEPRECATED
# define GDK_DEPRECATED_IN_3_8_FOR(f) GDK_DEPRECATED_FOR(f)
#else
# define GDK_DEPRECATED_IN_3_8
# define GDK_DEPRECATED_IN_3_8_FOR(f)
#endif
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_8
# define GDK_AVAILABLE_IN_3_8 GDK_UNAVAILABLE(3, 8)
#else
# define GDK_AVAILABLE_IN_3_8
#endif
#endif /* __GDK_VERSION_MACROS_H__ */ #endif /* __GDK_VERSION_MACROS_H__ */

View File

@@ -65,25 +65,6 @@
* <firstterm>composited</firstterm> window it is the responsibility of the * <firstterm>composited</firstterm> window it is the responsibility of the
* application to render the window contents at the right spot. * application to render the window contents at the right spot.
* </para> * </para>
* <example id="composited-window-example">
* <title>Composited windows</title>
* <programlisting>
* <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../examples/gdk/composited-window-example.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include>
* </programlisting></example>
* <para>
* In the example <xref linkend="composited-window-example"/>, a button is
* placed inside of an event box inside of a window. The event box is set as
* composited and therefore is no longer automatically drawn to the screen.
*
* When the contents of the event box change, an expose event is generated on
* its parent window (which, in this case, belongs to the toplevel #GtkWindow).
* The expose handler for this widget is responsible for merging the changes
* back on the screen in the way that it wishes.
*
* In our case, we merge the contents with a 50% transparency. We also set the
* background colour of the window to red. The effect is that the background
* shows through the button.
* </para>
* </refsect2> * </refsect2>
* <refsect2 id="OFFSCREEN-WINDOWS"> * <refsect2 id="OFFSCREEN-WINDOWS">
* <title>Offscreen Windows</title> * <title>Offscreen Windows</title>
@@ -112,7 +93,7 @@
* be it a toplevel window or a child window. In this setup the * be it a toplevel window or a child window. In this setup the
* GdkWindow (and other GdkDrawables) were platform independent classes, * GdkWindow (and other GdkDrawables) were platform independent classes,
* and the actual platform specific implementation was in a delegate * and the actual platform specific implementation was in a delegate
* object availible as "impl" in the window object. * object available as "impl" in the window object.
* *
* With the addition of client side windows and offscreen windows this * With the addition of client side windows and offscreen windows this
* changes a bit. The application-visible GdkWindow object behaves as * changes a bit. The application-visible GdkWindow object behaves as
@@ -687,6 +668,13 @@ gdk_window_has_no_impl (GdkWindow *window)
return window->impl_window != window; return window->impl_window != window;
} }
static gboolean
gdk_window_has_alpha (GdkWindow *window)
{
return !gdk_window_has_impl (window) &&
window->has_alpha_background;
}
static void static void
remove_layered_child_area (GdkWindow *window, remove_layered_child_area (GdkWindow *window,
cairo_region_t *region) cairo_region_t *region)
@@ -714,7 +702,7 @@ remove_layered_child_area (GdkWindow *window,
continue; continue;
/* Only non-impl children with alpha add to the layered region */ /* Only non-impl children with alpha add to the layered region */
if (!child->has_alpha_background && gdk_window_has_impl (child)) if (!gdk_window_has_alpha (child))
continue; continue;
r.x = child->x; r.x = child->x;
@@ -816,7 +804,7 @@ remove_child_area (GdkWindow *window,
} }
} }
if (child->has_alpha_background) if (gdk_window_has_alpha (child))
{ {
if (layered_region != NULL) if (layered_region != NULL)
cairo_region_union (layered_region, child_region); cairo_region_union (layered_region, child_region);
@@ -1382,6 +1370,11 @@ gdk_window_new (GdkWindow *parent,
return NULL; return NULL;
} }
if (attributes_mask & GDK_WA_VISUAL)
{
g_return_val_if_fail (gdk_visual_get_screen (attributes->visual) == screen, NULL);
}
display = gdk_screen_get_display (screen); display = gdk_screen_get_display (screen);
window = _gdk_display_create_window (display); window = _gdk_display_create_window (display);
@@ -3003,8 +2996,7 @@ gdk_window_begin_paint_region (GdkWindow *window,
by being drawn in back to front order. However, if implicit paints are not used, for by being drawn in back to front order. However, if implicit paints are not used, for
instance if it was flushed due to a non-double-buffered paint in the middle of the instance if it was flushed due to a non-double-buffered paint in the middle of the
expose we need to copy in the existing data here. */ expose we need to copy in the existing data here. */
if (!gdk_window_has_impl (window) && if (gdk_window_has_alpha (window) &&
window->has_alpha_background &&
(!implicit_paint || (!implicit_paint ||
(implicit_paint && implicit_paint->flushed != NULL && !cairo_region_is_empty (implicit_paint->flushed)))) (implicit_paint && implicit_paint->flushed != NULL && !cairo_region_is_empty (implicit_paint->flushed))))
{ {
@@ -6175,7 +6167,7 @@ gdk_window_move_resize_internal (GdkWindow *window,
* Everything in the old and new regions that is not copied must be * Everything in the old and new regions that is not copied must be
* invalidated (including children) as this is newly exposed * invalidated (including children) as this is newly exposed
*/ */
if (window->has_alpha_background) if (gdk_window_has_alpha (window))
copy_area = cairo_region_create (); /* Copy nothing for alpha windows */ copy_area = cairo_region_create (); /* Copy nothing for alpha windows */
else else
copy_area = cairo_region_copy (new_region); copy_area = cairo_region_copy (new_region);
@@ -6399,7 +6391,7 @@ gdk_window_scroll (GdkWindow *window,
impl_window = gdk_window_get_impl_window (window); impl_window = gdk_window_get_impl_window (window);
/* Calculate the area that can be gotten by copying the old area */ /* Calculate the area that can be gotten by copying the old area */
if (window->has_alpha_background) if (gdk_window_has_alpha (window))
copy_area = cairo_region_create (); /* Copy nothing for alpha windows */ copy_area = cairo_region_create (); /* Copy nothing for alpha windows */
else else
copy_area = cairo_region_copy (window->clip_region); copy_area = cairo_region_copy (window->clip_region);
@@ -6487,7 +6479,7 @@ gdk_window_move_region (GdkWindow *window,
impl_window = gdk_window_get_impl_window (window); impl_window = gdk_window_get_impl_window (window);
/* compute source regions */ /* compute source regions */
if (window->has_alpha_background) if (gdk_window_has_alpha (window))
copy_area = cairo_region_create (); /* Copy nothing for alpha windows */ copy_area = cairo_region_create (); /* Copy nothing for alpha windows */
else else
copy_area = cairo_region_copy (region); copy_area = cairo_region_copy (region);

View File

@@ -141,6 +141,38 @@
return inMove; return inMove;
} }
-(void)checkSendEnterNotify
{
GdkWindow *window = [[self contentView] gdkWindow];
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
/* When a new window has been created, and the mouse
* is in the window area, we will not receive an NSMouseEntered
* event. Therefore, we synthesize an enter notify event manually.
*/
if (!initialPositionKnown)
{
initialPositionKnown = YES;
if (NSPointInRect ([NSEvent mouseLocation], [self frame]))
{
NSEvent *event;
event = [NSEvent enterExitEventWithType: NSMouseEntered
location: [self mouseLocationOutsideOfEventStream]
modifierFlags: 0
timestamp: [[NSApp currentEvent] timestamp]
windowNumber: [impl->toplevel windowNumber]
context: NULL
eventNumber: 0
trackingNumber: [impl->view trackingRect]
userData: nil];
[NSApp postEvent:event atStart:NO];
}
}
}
-(void)windowDidMove:(NSNotification *)aNotification -(void)windowDidMove:(NSNotification *)aNotification
{ {
GdkWindow *window = [[self contentView] gdkWindow]; GdkWindow *window = [[self contentView] gdkWindow];
@@ -157,6 +189,8 @@
event->configure.height = window->height; event->configure.height = window->height;
_gdk_event_queue_append (gdk_display_get_default (), event); _gdk_event_queue_append (gdk_display_get_default (), event);
[self checkSendEnterNotify];
} }
-(void)windowDidResize:(NSNotification *)aNotification -(void)windowDidResize:(NSNotification *)aNotification
@@ -186,6 +220,8 @@
event->configure.height = window->height; event->configure.height = window->height;
_gdk_event_queue_append (gdk_display_get_default (), event); _gdk_event_queue_append (gdk_display_get_default (), event);
[self checkSendEnterNotify];
} }
-(id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask backing:(NSBackingStoreType)backingType defer:(BOOL)flag screen:(NSScreen *)screen -(id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask backing:(NSBackingStoreType)backingType defer:(BOOL)flag screen:(NSScreen *)screen
@@ -283,6 +319,8 @@
[impl->toplevel orderFront:nil]; [impl->toplevel orderFront:nil];
inShowOrHide = NO; inShowOrHide = NO;
[self checkSendEnterNotify];
} }
- (void)hide - (void)hide
@@ -293,6 +331,8 @@
inShowOrHide = YES; inShowOrHide = YES;
[impl->toplevel orderOut:nil]; [impl->toplevel orderOut:nil];
inShowOrHide = NO; inShowOrHide = NO;
initialPositionKnown = NO;
} }
- (BOOL)trackManualMove - (BOOL)trackManualMove

View File

@@ -23,6 +23,7 @@
@interface GdkQuartzNSWindow : NSWindow { @interface GdkQuartzNSWindow : NSWindow {
BOOL inMove; BOOL inMove;
BOOL inShowOrHide; BOOL inShowOrHide;
BOOL initialPositionKnown;
/* Manually triggered move/resize (not by the window manager) */ /* Manually triggered move/resize (not by the window manager) */
BOOL inManualMove; BOOL inManualMove;

View File

@@ -81,6 +81,25 @@
if (NSEqualRects (rect, NSZeroRect)) if (NSEqualRects (rect, NSZeroRect))
return; return;
if (!GDK_WINDOW_IS_MAPPED (gdk_window))
{
/* If the window is not yet mapped, clip_region_with_children
* will be empty causing the usual code below to draw nothing.
* To not see garbage on the screen, we draw an aesthetic color
* here. The garbage would be visible if any widget enabled
* the NSView's CALayer in order to add sublayers for custom
* native rendering.
*/
[NSGraphicsContext saveGraphicsState];
[[NSColor windowBackgroundColor] setFill];
[NSBezierPath fillRect:rect];
[NSGraphicsContext restoreGraphicsState];
return;
}
/* Clear our own bookkeeping of regions that need display */ /* Clear our own bookkeeping of regions that need display */
if (impl->needs_display_region) if (impl->needs_display_region)
{ {
@@ -148,15 +167,6 @@
owner:self owner:self
userData:nil userData:nil
assumeInside:NO]; assumeInside:NO];
if (NSPointInRect ([[self window] convertScreenToBase:[NSEvent mouseLocation]], rect))
{
/* When a new window (and thus view) has been created, and the mouse
* is in the window area, we will not receive an NSMouseEntered
* event. Therefore, we synthesize an enter notify event manually.
*/
_gdk_quartz_events_send_enter_notify_event (gdk_window);
}
} }
-(void)viewDidMoveToWindow -(void)viewDidMoveToWindow

View File

@@ -635,21 +635,6 @@ gdk_event_check (GSource *source)
gdk_threads_enter (); gdk_threads_enter ();
/* Refresh the autorelease pool if we're at the base CFRunLoop level
* (indicated by current_loop_level) and the base g_main_loop level
* (indicated by g_main_depth()). Messing with the autorelease pool at
* any level of nesting can cause access to deallocated memory because
* autorelease_pool is static and releasing a pool will cause all pools
* allocated inside of it to be released as well.
*/
if (current_loop_level == 0 && g_main_depth() == 0)
{
if (autorelease_pool)
[autorelease_pool drain];
autorelease_pool = [[NSAutoreleasePool alloc] init];
}
retval = (_gdk_event_queue_find_first (_gdk_display) != NULL || retval = (_gdk_event_queue_find_first (_gdk_display) != NULL ||
_gdk_quartz_event_loop_check_pending ()); _gdk_quartz_event_loop_check_pending ());
@@ -667,6 +652,21 @@ gdk_event_dispatch (GSource *source,
gdk_threads_enter (); gdk_threads_enter ();
/* Refresh the autorelease pool if we're at the base CFRunLoop level
* (indicated by current_loop_level) and the base g_main_loop level
* (indicated by g_main_depth()). Messing with the autorelease pool at
* any level of nesting can cause access to deallocated memory because
* autorelease_pool is static and releasing a pool will cause all pools
* allocated inside of it to be released as well.
*/
if (current_loop_level == 0 && g_main_depth() == 0)
{
if (autorelease_pool)
[autorelease_pool drain];
autorelease_pool = [[NSAutoreleasePool alloc] init];
}
_gdk_quartz_display_queue_events (_gdk_display); _gdk_quartz_display_queue_events (_gdk_display);
event = _gdk_event_unqueue (_gdk_display); event = _gdk_event_unqueue (_gdk_display);
@@ -703,6 +703,10 @@ poll_func (GPollFD *ufds,
NSDate *limit_date; NSDate *limit_date;
gint n_ready; gint n_ready;
static GPollFD *last_ufds;
last_ufds = ufds;
n_ready = select_thread_start_poll (ufds, nfds, timeout_); n_ready = select_thread_start_poll (ufds, nfds, timeout_);
if (n_ready > 0) if (n_ready > 0)
timeout_ = 0; timeout_ = 0;
@@ -721,7 +725,16 @@ poll_func (GPollFD *ufds,
dequeue: YES]; dequeue: YES];
getting_events--; getting_events--;
if (n_ready < 0) /* We check if last_ufds did not change since the time this function was
* called. It is possible that a recursive main loop (and thus recursive
* invocation of this poll function) is triggered while in
* nextEventMatchingMask:. If during that time new fds are added,
* the cached fds array might be replaced in g_main_context_iterate().
* So, we should avoid accessing the old fd array (still pointed at by
* ufds) here in that case, since it might have been freed. We avoid this
* by not calling the collect stage.
*/
if (last_ufds == ufds && n_ready < 0)
n_ready = select_thread_collect_poll (ufds, nfds); n_ready = select_thread_collect_poll (ufds, nfds);
if (event && if (event &&

View File

@@ -58,10 +58,62 @@ static GdkWindow *find_toplevel_under_pointer (GdkDisplay *display,
gint *y); gint *y);
static void
gdk_quartz_ns_notification_callback (CFNotificationCenterRef center,
void *observer,
CFStringRef name,
const void *object,
CFDictionaryRef userInfo)
{
GdkEvent new_event;
new_event.type = GDK_SETTING;
new_event.setting.window = gdk_screen_get_root_window (_gdk_screen);
new_event.setting.send_event = FALSE;
new_event.setting.action = GDK_SETTING_ACTION_CHANGED;
new_event.setting.name = NULL;
/* Translate name */
if (CFStringCompare (name,
CFSTR("AppleNoRedisplayAppearancePreferenceChanged"),
0) == kCFCompareEqualTo)
new_event.setting.name = "gtk-primary-button-warps-slider";
if (!new_event.setting.name)
return;
gdk_event_put (&new_event);
}
static void
gdk_quartz_events_init_notifications (void)
{
static gboolean notifications_initialized = FALSE;
if (notifications_initialized)
return;
notifications_initialized = TRUE;
/* Initialize any handlers for notifications we want to push to GTK
* through GdkEventSettings.
*/
/* This is an undocumented *distributed* notification to listen for changes
* in scrollbar jump behavior. It is used by LibreOffice and WebKit as well.
*/
CFNotificationCenterAddObserver (CFNotificationCenterGetDistributedCenter (),
NULL,
&gdk_quartz_ns_notification_callback,
CFSTR ("AppleNoRedisplayAppearancePreferenceChanged"),
NULL,
CFNotificationSuspensionBehaviorDeliverImmediately);
}
void void
_gdk_quartz_events_init (void) _gdk_quartz_events_init (void)
{ {
_gdk_quartz_event_loop_init (); _gdk_quartz_event_loop_init ();
gdk_quartz_events_init_notifications ();
current_keyboard_window = g_object_ref (_gdk_root); current_keyboard_window = g_object_ref (_gdk_root);
} }
@@ -349,34 +401,89 @@ get_window_point_from_screen_point (GdkWindow *window,
*y = window->height - point.y; *y = window->height - point.y;
} }
static gboolean
is_mouse_button_press_event (NSEventType type)
{
switch (type)
{
case NSLeftMouseDown:
case NSRightMouseDown:
case NSOtherMouseDown:
return TRUE;
}
return FALSE;
}
static GdkWindow * static GdkWindow *
get_toplevel_from_ns_event (NSEvent *nsevent, get_toplevel_from_ns_event (NSEvent *nsevent,
NSPoint *screen_point, NSPoint *screen_point,
gint *x, gint *x,
gint *y) gint *y)
{ {
GdkWindow *toplevel; GdkWindow *toplevel = NULL;
if ([nsevent window]) if ([nsevent window])
{ {
GdkQuartzView *view; GdkQuartzView *view;
NSPoint point; NSPoint point, view_point;
NSRect view_frame;
view = (GdkQuartzView *)[[nsevent window] contentView]; view = (GdkQuartzView *)[[nsevent window] contentView];
toplevel = [view gdkWindow]; toplevel = [view gdkWindow];
point = [nsevent locationInWindow]; point = [nsevent locationInWindow];
*screen_point = [[nsevent window] convertBaseToScreen:point]; view_point = [view convertPoint:point fromView:nil];
view_frame = [view frame];
*x = point.x; /* NSEvents come in with a window set, but with window coordinates
*y = toplevel->height - point.y; * out of window bounds. For e.g. moved events this is fine, we use
* this information to properly handle enter/leave notify and motion
* events. For mouse button press/release, we want to avoid forwarding
* these events however, because the window they relate to is not the
* window set in the event. This situation appears to occur when button
* presses come in just before (or just after?) a window is resized and
* also when a button press occurs on the OS X window titlebar.
*
* By setting toplevel to NULL, we do another attempt to get the right
* toplevel window below.
*/
if (is_mouse_button_press_event ([nsevent type]) &&
(view_point.x < view_frame.origin.x ||
view_point.x >= view_frame.origin.x + view_frame.size.width ||
view_point.y < view_frame.origin.y ||
view_point.y >= view_frame.origin.y + view_frame.size.height))
{
toplevel = NULL;
/* This is a hack for button presses to break all grabs. E.g. if
* a menu is open and one clicks on the title bar (or anywhere
* out of window bounds), we really want to pop down the menu (by
* breaking the grabs) before OS X handles the action of the title
* bar button.
*
* Because we cannot ingest this event into GDK, we have to do it
* here, not very nice.
*/
_gdk_quartz_events_break_all_grabs (get_time_from_ns_event (nsevent));
}
else
{
*screen_point = [[nsevent window] convertBaseToScreen:point];
*x = point.x;
*y = toplevel->height - point.y;
}
} }
else
if (!toplevel)
{ {
/* Fallback used when no NSWindow set. This happens e.g. when /* Fallback used when no NSWindow set. This happens e.g. when
* we allow motion events without a window set in gdk_event_translate() * we allow motion events without a window set in gdk_event_translate()
* that occur immediately after the main menu bar was clicked/used. * that occur immediately after the main menu bar was clicked/used.
* This fallback will not return coordinates contained in a window's
* titlebar.
*/ */
*screen_point = [NSEvent mouseLocation]; *screen_point = [NSEvent mouseLocation];
toplevel = find_toplevel_under_pointer (_gdk_display, toplevel = find_toplevel_under_pointer (_gdk_display,
@@ -423,7 +530,7 @@ generate_motion_event (GdkWindow *window)
event->any.type = GDK_MOTION_NOTIFY; event->any.type = GDK_MOTION_NOTIFY;
event->motion.window = window; event->motion.window = window;
event->motion.time = GDK_CURRENT_TIME; event->motion.time = get_time_from_ns_event ([NSApp currentEvent]);
event->motion.x = x; event->motion.x = x;
event->motion.y = y; event->motion.y = y;
event->motion.x_root = x_root; event->motion.x_root = x_root;
@@ -482,39 +589,6 @@ _gdk_quartz_events_update_focus_window (GdkWindow *window,
} }
} }
void
_gdk_quartz_events_send_enter_notify_event (GdkWindow *window)
{
NSPoint screen_point;
GdkEvent *event;
gint x, y, x_root, y_root;
event = gdk_event_new (GDK_ENTER_NOTIFY);
event->any.window = NULL;
event->any.send_event = FALSE;
screen_point = [NSEvent mouseLocation];
_gdk_quartz_window_nspoint_to_gdk_xy (screen_point, &x_root, &y_root);
get_window_point_from_screen_point (window, screen_point, &x, &y);
event->crossing.window = window;
event->crossing.subwindow = NULL;
event->crossing.time = GDK_CURRENT_TIME;
event->crossing.x = x;
event->crossing.y = y;
event->crossing.x_root = x_root;
event->crossing.y_root = y_root;
event->crossing.mode = GDK_CROSSING_NORMAL;
event->crossing.detail = GDK_NOTIFY_ANCESTOR;
event->crossing.state = _gdk_quartz_events_get_current_keyboard_modifiers () |
_gdk_quartz_events_get_current_mouse_modifiers ();
gdk_event_set_device (event, _gdk_display->core_pointer);
append_event (event, TRUE);
}
void void
_gdk_quartz_events_send_map_event (GdkWindow *window) _gdk_quartz_events_send_map_event (GdkWindow *window)
{ {
@@ -548,6 +622,18 @@ find_toplevel_under_pointer (GdkDisplay *display,
if (toplevel && WINDOW_IS_TOPLEVEL (toplevel)) if (toplevel && WINDOW_IS_TOPLEVEL (toplevel))
get_window_point_from_screen_point (toplevel, screen_point, x, y); get_window_point_from_screen_point (toplevel, screen_point, x, y);
if (toplevel)
{
/* If the coordinates are out of window bounds, this toplevel is not
* under the pointer and we thus return NULL. This can occur when
* toplevel under pointer has not yet been updated due to a very recent
* window resize. Alternatively, we should no longer be relying on
* the toplevel_under_pointer value which is maintained in gdkwindow.c.
*/
if (*x < 0 || *y < 0 || *x >= toplevel->width || *y >= toplevel->height)
return NULL;
}
return toplevel; return toplevel;
} }
@@ -720,6 +806,8 @@ find_window_for_ns_event (NSEvent *nsevent,
view = (GdkQuartzView *)[[nsevent window] contentView]; view = (GdkQuartzView *)[[nsevent window] contentView];
toplevel = get_toplevel_from_ns_event (nsevent, &screen_point, x, y); toplevel = get_toplevel_from_ns_event (nsevent, &screen_point, x, y);
if (!toplevel)
return NULL;
_gdk_quartz_window_nspoint_to_gdk_xy (screen_point, x_root, y_root); _gdk_quartz_window_nspoint_to_gdk_xy (screen_point, x_root, y_root);
event_type = [nsevent type]; event_type = [nsevent type];
@@ -1033,8 +1121,9 @@ synthesize_crossing_event (GdkWindow *window,
switch ([nsevent type]) switch ([nsevent type])
{ {
case NSMouseEntered: case NSMouseEntered:
/* Enter events are considered always to be from the root window as we /* Enter events are considered always to be from another toplevel
* can't know for sure from what window we enter. * window, this shouldn't negatively affect any app or gtk code,
* and is the only way to make GtkMenu work. EEK EEK EEK.
*/ */
if (!(window->event_mask & GDK_ENTER_NOTIFY_MASK)) if (!(window->event_mask & GDK_ENTER_NOTIFY_MASK))
return FALSE; return FALSE;
@@ -1044,14 +1133,11 @@ synthesize_crossing_event (GdkWindow *window,
x_root, y_root, x_root, y_root,
GDK_ENTER_NOTIFY, GDK_ENTER_NOTIFY,
GDK_CROSSING_NORMAL, GDK_CROSSING_NORMAL,
GDK_NOTIFY_ANCESTOR); GDK_NOTIFY_NONLINEAR);
return TRUE; return TRUE;
case NSMouseExited: case NSMouseExited:
/* Exited always is to the root window as far as we are concerned, /* See above */
* since there is no way to reliably get information about what new
* window is entered when exiting one.
*/
if (!(window->event_mask & GDK_LEAVE_NOTIFY_MASK)) if (!(window->event_mask & GDK_LEAVE_NOTIFY_MASK))
return FALSE; return FALSE;
@@ -1060,7 +1146,7 @@ synthesize_crossing_event (GdkWindow *window,
x_root, y_root, x_root, y_root,
GDK_LEAVE_NOTIFY, GDK_LEAVE_NOTIFY,
GDK_CROSSING_NORMAL, GDK_CROSSING_NORMAL,
GDK_NOTIFY_ANCESTOR); GDK_NOTIFY_NONLINEAR);
return TRUE; return TRUE;
default: default:
@@ -1257,9 +1343,9 @@ gdk_event_translate (GdkEvent *event,
} }
/* Also when in a manual resize, we ignore events so that these are /* Also when in a manual resize, we ignore events so that these are
* pushed to GdkQuartzWindow's sendEvent handler. * pushed to GdkQuartzNSWindow's sendEvent handler.
*/ */
if ([(GdkQuartzWindow *)nswindow isInManualResize]) if ([(GdkQuartzNSWindow *)nswindow isInManualResize])
return FALSE; return FALSE;
/* Find the right GDK window to send the event to, taking grabs and /* Find the right GDK window to send the event to, taking grabs and
@@ -1386,7 +1472,9 @@ gdk_event_translate (GdkEvent *event,
if (dx != 0.0 || dy != 0.0) if (dx != 0.0 || dy != 0.0)
{ {
if ([nsevent hasPreciseScrollingDeltas]) #ifdef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
if (gdk_quartz_osx_version() >= GDK_OSX_LION &&
[nsevent hasPreciseScrollingDeltas])
{ {
GdkEvent *emulated_event; GdkEvent *emulated_event;
@@ -1398,6 +1486,7 @@ gdk_event_translate (GdkEvent *event,
append_event (emulated_event, TRUE); append_event (emulated_event, TRUE);
} }
else else
#endif
fill_scroll_event (window, event, nsevent, fill_scroll_event (window, event, nsevent,
x, y, x_root, y_root, x, y, x_root, y_root,
dx, dy, direction); dx, dy, direction);
@@ -1548,6 +1637,19 @@ _gdk_quartz_screen_get_setting (GdkScreen *screen,
GDK_QUARTZ_RELEASE_POOL; GDK_QUARTZ_RELEASE_POOL;
return TRUE;
}
else if (strcmp (name, "gtk-primary-button-warps-slider") == 0)
{
GDK_QUARTZ_ALLOC_POOL;
BOOL setting = [[NSUserDefaults standardUserDefaults] boolForKey:@"AppleScrollerPagingBehavior"];
/* If the Apple property is YES, it means "warp" */
g_value_set_boolean (value, setting == YES);
GDK_QUARTZ_RELEASE_POOL;
return TRUE; return TRUE;
} }

View File

@@ -176,7 +176,7 @@ const static struct {
{ 67, GDK_KEY_asterisk, GDK_KEY_KP_Multiply }, { 67, GDK_KEY_asterisk, GDK_KEY_KP_Multiply },
{ 69, GDK_KEY_plus, GDK_KEY_KP_Add }, { 69, GDK_KEY_plus, GDK_KEY_KP_Add },
{ 75, GDK_KEY_slash, GDK_KEY_KP_Divide }, { 75, GDK_KEY_slash, GDK_KEY_KP_Divide },
{ 76, 0x01000003, GDK_KEY_KP_Enter }, { 76, GDK_KEY_Return, GDK_KEY_KP_Enter },
{ 78, GDK_KEY_minus, GDK_KEY_KP_Subtract }, { 78, GDK_KEY_minus, GDK_KEY_KP_Subtract },
{ 81, GDK_KEY_equal, GDK_KEY_KP_Equal }, { 81, GDK_KEY_equal, GDK_KEY_KP_Equal },
{ 82, GDK_KEY_0, GDK_KEY_KP_0 }, { 82, GDK_KEY_0, GDK_KEY_KP_0 },

View File

@@ -64,7 +64,6 @@ void _gdk_quartz_events_send_map_event (GdkWindow *window);
GdkModifierType _gdk_quartz_events_get_current_keyboard_modifiers (void); GdkModifierType _gdk_quartz_events_get_current_keyboard_modifiers (void);
GdkModifierType _gdk_quartz_events_get_current_mouse_modifiers (void); GdkModifierType _gdk_quartz_events_get_current_mouse_modifiers (void);
void _gdk_quartz_events_send_enter_notify_event (GdkWindow *window);
void _gdk_quartz_events_break_all_grabs (guint32 time); void _gdk_quartz_events_break_all_grabs (guint32 time);
/* Event loop */ /* Event loop */

View File

@@ -2315,28 +2315,31 @@ gdk_quartz_window_focus (GdkWindow *window,
} }
} }
static static gint
gint window_type_hint_to_level (GdkWindowTypeHint hint) window_type_hint_to_level (GdkWindowTypeHint hint)
{ {
/* the order in this switch statement corresponds to the actual
* stacking order: the first group is top, the last group is bottom
*/
switch (hint) switch (hint)
{ {
case GDK_WINDOW_TYPE_HINT_DOCK: case GDK_WINDOW_TYPE_HINT_POPUP_MENU:
case GDK_WINDOW_TYPE_HINT_UTILITY: case GDK_WINDOW_TYPE_HINT_COMBO:
return NSFloatingWindowLevel; case GDK_WINDOW_TYPE_HINT_DND:
case GDK_WINDOW_TYPE_HINT_TOOLTIP:
return NSPopUpMenuWindowLevel;
case GDK_WINDOW_TYPE_HINT_NOTIFICATION:
case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
return NSStatusWindowLevel;
case GDK_WINDOW_TYPE_HINT_MENU: /* Torn-off menu */ case GDK_WINDOW_TYPE_HINT_MENU: /* Torn-off menu */
case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU: /* Menu from menubar */ case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU: /* Menu from menubar */
return NSTornOffMenuWindowLevel; return NSTornOffMenuWindowLevel;
case GDK_WINDOW_TYPE_HINT_NOTIFICATION: case GDK_WINDOW_TYPE_HINT_DOCK:
case GDK_WINDOW_TYPE_HINT_TOOLTIP: case GDK_WINDOW_TYPE_HINT_UTILITY:
return NSStatusWindowLevel; return NSFloatingWindowLevel;
case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
case GDK_WINDOW_TYPE_HINT_POPUP_MENU:
case GDK_WINDOW_TYPE_HINT_COMBO:
case GDK_WINDOW_TYPE_HINT_DND:
return NSPopUpMenuWindowLevel;
case GDK_WINDOW_TYPE_HINT_NORMAL: /* Normal toplevel window */ case GDK_WINDOW_TYPE_HINT_NORMAL: /* Normal toplevel window */
case GDK_WINDOW_TYPE_HINT_DIALOG: /* Dialog window */ case GDK_WINDOW_TYPE_HINT_DIALOG: /* Dialog window */
@@ -2351,7 +2354,7 @@ gint window_type_hint_to_level (GdkWindowTypeHint hint)
return NSNormalWindowLevel; return NSNormalWindowLevel;
} }
static gboolean static gboolean
window_type_hint_to_shadow (GdkWindowTypeHint hint) window_type_hint_to_shadow (GdkWindowTypeHint hint)
{ {
switch (hint) switch (hint)
@@ -2381,13 +2384,31 @@ window_type_hint_to_shadow (GdkWindowTypeHint hint)
return FALSE; return FALSE;
} }
static gboolean
window_type_hint_to_hides_on_deactivate (GdkWindowTypeHint hint)
{
switch (hint)
{
case GDK_WINDOW_TYPE_HINT_UTILITY:
case GDK_WINDOW_TYPE_HINT_MENU: /* Torn-off menu */
case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
case GDK_WINDOW_TYPE_HINT_NOTIFICATION:
case GDK_WINDOW_TYPE_HINT_TOOLTIP:
return TRUE;
default:
break;
}
return FALSE;
}
static void static void
gdk_quartz_window_set_type_hint (GdkWindow *window, gdk_quartz_window_set_type_hint (GdkWindow *window,
GdkWindowTypeHint hint) GdkWindowTypeHint hint)
{ {
GdkWindowImplQuartz *impl; GdkWindowImplQuartz *impl;
if (GDK_WINDOW_DESTROYED (window) || if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL (window)) !WINDOW_IS_TOPLEVEL (window))
return; return;
@@ -2402,6 +2423,7 @@ gdk_quartz_window_set_type_hint (GdkWindow *window,
[impl->toplevel setHasShadow: window_type_hint_to_shadow (hint)]; [impl->toplevel setHasShadow: window_type_hint_to_shadow (hint)];
[impl->toplevel setLevel: window_type_hint_to_level (hint)]; [impl->toplevel setLevel: window_type_hint_to_level (hint)];
[impl->toplevel setHidesOnDeactivate: window_type_hint_to_hides_on_deactivate (hint)];
} }
static GdkWindowTypeHint static GdkWindowTypeHint
@@ -2619,6 +2641,7 @@ gdk_quartz_window_set_decorations (GdkWindow *window,
defer:NO]; defer:NO];
[impl->toplevel setHasShadow: window_type_hint_to_shadow (impl->type_hint)]; [impl->toplevel setHasShadow: window_type_hint_to_shadow (impl->type_hint)];
[impl->toplevel setLevel: window_type_hint_to_level (impl->type_hint)]; [impl->toplevel setLevel: window_type_hint_to_level (impl->type_hint)];
[impl->toplevel setHidesOnDeactivate: window_type_hint_to_hides_on_deactivate (impl->type_hint)];
[impl->toplevel setContentView:old_view]; [impl->toplevel setContentView:old_view];
} }

View File

@@ -183,6 +183,7 @@ gdk_device_core_set_window_cursor (GdkDevice *device,
x, y); x, y);
wl_surface_attach (wd->pointer_surface, buffer, 0, 0); wl_surface_attach (wd->pointer_surface, buffer, 0, 0);
wl_surface_damage (wd->pointer_surface, 0, 0, w, h); wl_surface_damage (wd->pointer_surface, 0, 0, w, h);
wl_surface_commit(wd->pointer_surface);
g_object_unref (cursor); g_object_unref (cursor);
} }
@@ -1240,14 +1241,14 @@ static GdkModifierType
get_modifier (struct xkb_state *state) get_modifier (struct xkb_state *state)
{ {
GdkModifierType modifiers = 0; GdkModifierType modifiers = 0;
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_SHIFT, XKB_STATE_EFFECTIVE) > 0)?GDK_SHIFT_MASK:0; modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_SHIFT, XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_SHIFT_MASK:0;
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_CAPS, XKB_STATE_EFFECTIVE) > 0)?GDK_LOCK_MASK:0; modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_CAPS, XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_LOCK_MASK:0;
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_CTRL, XKB_STATE_EFFECTIVE) > 0)?GDK_CONTROL_MASK:0; modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_CTRL, XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_CONTROL_MASK:0;
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_ALT, XKB_STATE_EFFECTIVE) > 0)?GDK_MOD1_MASK:0; modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_ALT, XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_MOD1_MASK:0;
modifiers |= (xkb_state_mod_name_is_active (state, "Mod2", XKB_STATE_EFFECTIVE) > 0)?GDK_MOD2_MASK:0; modifiers |= (xkb_state_mod_name_is_active (state, "Mod2", XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_MOD2_MASK:0;
modifiers |= (xkb_state_mod_name_is_active (state, "Mod3", XKB_STATE_EFFECTIVE) > 0)?GDK_MOD3_MASK:0; modifiers |= (xkb_state_mod_name_is_active (state, "Mod3", XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_MOD3_MASK:0;
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_LOGO, XKB_STATE_EFFECTIVE) > 0)?GDK_MOD4_MASK:0; modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_LOGO, XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_MOD4_MASK:0;
modifiers |= (xkb_state_mod_name_is_active (state, "Mod5", XKB_STATE_EFFECTIVE) > 0)?GDK_MOD5_MASK:0; modifiers |= (xkb_state_mod_name_is_active (state, "Mod5", XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_MOD5_MASK:0;
return modifiers; return modifiers;
} }
@@ -1324,16 +1325,11 @@ deliver_key_event(GdkWaylandDevice *device,
struct xkb_state *xkb_state; struct xkb_state *xkb_state;
GdkKeymap *keymap; GdkKeymap *keymap;
xkb_keysym_t sym; xkb_keysym_t sym;
uint32_t num_syms;
const xkb_keysym_t *syms;
keymap = device->keymap; keymap = device->keymap;
xkb_state = _gdk_wayland_keymap_get_xkb_state (keymap); xkb_state = _gdk_wayland_keymap_get_xkb_state (keymap);
num_syms = xkb_key_get_syms (xkb_state, key, &syms); sym = xkb_state_key_get_one_sym (xkb_state, key);
sym = XKB_KEY_NoSymbol;
if (num_syms == 1)
sym = syms[0];
device->time = time; device->time = time;
device->modifiers = get_modifier (xkb_state); device->modifiers = get_modifier (xkb_state);

View File

@@ -96,7 +96,8 @@ static void
output_handle_geometry(void *data, output_handle_geometry(void *data,
struct wl_output *wl_output, struct wl_output *wl_output,
int x, int y, int physical_width, int physical_height, int x, int y, int physical_width, int physical_height,
int subpixel, const char *make, const char *model) int subpixel, const char *make, const char *model,
int32_t transform)
{ {
/* /*
g_signal_emit_by_name (screen, "monitors-changed"); g_signal_emit_by_name (screen, "monitors-changed");
@@ -119,8 +120,8 @@ static const struct wl_output_listener output_listener = {
}; };
static void static void
gdk_display_handle_global(struct wl_display *display, uint32_t id, gdk_registry_handle_global(void *data, struct wl_registry *registry, uint32_t id,
const char *interface, uint32_t version, void *data) const char *interface, uint32_t version)
{ {
GdkWaylandDisplay *display_wayland = data; GdkWaylandDisplay *display_wayland = data;
GdkDisplay *gdk_display = GDK_DISPLAY_OBJECT (data); GdkDisplay *gdk_display = GDK_DISPLAY_OBJECT (data);
@@ -128,27 +129,29 @@ gdk_display_handle_global(struct wl_display *display, uint32_t id,
if (strcmp(interface, "wl_compositor") == 0) { if (strcmp(interface, "wl_compositor") == 0) {
display_wayland->compositor = display_wayland->compositor =
wl_display_bind(display, id, &wl_compositor_interface); wl_registry_bind(display_wayland->wl_registry, id, &wl_compositor_interface, 1);
} else if (strcmp(interface, "wl_shm") == 0) { } else if (strcmp(interface, "wl_shm") == 0) {
display_wayland->shm = wl_display_bind(display, id, &wl_shm_interface); display_wayland->shm =
wl_registry_bind(display_wayland->wl_registry, id, &wl_shm_interface, 1);
/* SHM interface is prerequisite */ /* SHM interface is prerequisite */
_gdk_wayland_display_load_cursor_theme(display_wayland); _gdk_wayland_display_load_cursor_theme(display_wayland);
} else if (strcmp(interface, "wl_shell") == 0) { } else if (strcmp(interface, "wl_shell") == 0) {
display_wayland->shell = wl_display_bind(display, id, &wl_shell_interface); display_wayland->shell =
wl_registry_bind(display_wayland->wl_registry, id, &wl_shell_interface, 1);
} else if (strcmp(interface, "wl_output") == 0) { } else if (strcmp(interface, "wl_output") == 0) {
display_wayland->output = display_wayland->output =
wl_display_bind(display, id, &wl_output_interface); wl_registry_bind(display_wayland->wl_registry, id, &wl_output_interface, 1);
wl_output_add_listener(display_wayland->output, wl_output_add_listener(display_wayland->output,
&output_listener, display_wayland); &output_listener, display_wayland);
} else if (strcmp(interface, "wl_seat") == 0) { } else if (strcmp(interface, "wl_seat") == 0) {
seat = wl_display_bind (display, id, &wl_seat_interface); seat = wl_registry_bind(display_wayland->wl_registry, id, &wl_seat_interface, 1);
_gdk_wayland_device_manager_add_device (gdk_display->device_manager, _gdk_wayland_device_manager_add_device (gdk_display->device_manager,
seat); seat);
} else if (strcmp(interface, "wl_data_device_manager") == 0) { } else if (strcmp(interface, "wl_data_device_manager") == 0) {
display_wayland->data_device_manager = display_wayland->data_device_manager =
wl_display_bind(display, id, wl_registry_bind(display_wayland->wl_registry, id,
&wl_data_device_manager_interface); &wl_data_device_manager_interface, 1);
} }
} }
@@ -210,6 +213,10 @@ gdk_display_init_egl(GdkDisplay *display)
} }
#endif #endif
static const struct wl_registry_listener registry_listener = {
gdk_registry_handle_global
};
GdkDisplay * GdkDisplay *
_gdk_wayland_display_open (const gchar *display_name) _gdk_wayland_display_open (const gchar *display_name)
{ {
@@ -231,14 +238,13 @@ _gdk_wayland_display_open (const gchar *display_name)
display->device_manager = _gdk_wayland_device_manager_new (display); display->device_manager = _gdk_wayland_device_manager_new (display);
/* Set up listener so we'll catch all events. */ /* Set up listener so we'll catch all events. */
wl_display_add_global_listener(display_wayland->wl_display, display_wayland->wl_registry = wl_display_get_registry(display_wayland->wl_display);
gdk_display_handle_global, display_wayland); wl_registry_add_listener(display_wayland->wl_registry, &registry_listener, display_wayland);
#ifdef GDK_WAYLAND_USE_EGL #ifdef GDK_WAYLAND_USE_EGL
gdk_display_init_egl(display); gdk_display_init_egl(display);
#else #else
wl_display_iterate(wl_display, WL_DISPLAY_READABLE); wl_display_dispatch(display_wayland->wl_display);
wl_display_roundtrip(wl_display);
#endif #endif
display_wayland->event_source = display_wayland->event_source =
@@ -351,8 +357,7 @@ gdk_wayland_display_flush (GdkDisplay *display)
g_return_if_fail (GDK_IS_DISPLAY (display)); g_return_if_fail (GDK_IS_DISPLAY (display));
if (!display->closed) if (!display->closed)
_gdk_wayland_display_flush (display, wl_display_flush(GDK_WAYLAND_DISPLAY (display)->wl_display);;
GDK_WAYLAND_DISPLAY (display)->event_source);
} }
static gboolean static gboolean

View File

@@ -76,6 +76,7 @@ struct _GdkWaylandDisplay
/* Wayland fields below */ /* Wayland fields below */
struct wl_display *wl_display; struct wl_display *wl_display;
struct wl_registry *wl_registry;
struct wl_compositor *compositor; struct wl_compositor *compositor;
struct wl_shm *shm; struct wl_shm *shm;
struct wl_shell *shell; struct wl_shell *shell;

View File

@@ -136,7 +136,7 @@ gdk_wayland_display_manager_lookup_keyval (GdkDisplayManager *manager,
{ {
g_return_val_if_fail (keyval_name != NULL, 0); g_return_val_if_fail (keyval_name != NULL, 0);
return xkb_keysym_from_name(keyval_name); return xkb_keysym_from_name (keyval_name, 0);
} }
static gchar * static gchar *

View File

@@ -44,8 +44,7 @@ gdk_event_source_prepare(GSource *base, gint *timeout)
if (_gdk_event_queue_find_first (source->display) != NULL) if (_gdk_event_queue_find_first (source->display) != NULL)
return TRUE; return TRUE;
while (source->mask & WL_DISPLAY_WRITABLE) wl_display_flush(display->wl_display);
wl_display_iterate(display->wl_display, WL_DISPLAY_WRITABLE);
return FALSE; return FALSE;
} }
@@ -97,16 +96,6 @@ static GSourceFuncs wl_glib_source_funcs = {
gdk_event_source_finalize gdk_event_source_finalize
}; };
static int
gdk_event_source_update(uint32_t mask, void *data)
{
GdkWaylandEventSource *source = data;
source->mask = mask;
return 0;
}
void void
_gdk_wayland_display_deliver_event (GdkDisplay *display, GdkEvent *event) _gdk_wayland_display_deliver_event (GdkDisplay *display, GdkEvent *event)
{ {
@@ -134,8 +123,7 @@ _gdk_wayland_display_event_source_new (GdkDisplay *display)
display_wayland = GDK_WAYLAND_DISPLAY (display); display_wayland = GDK_WAYLAND_DISPLAY (display);
wl_source->display = display; wl_source->display = display;
wl_source->pfd.fd = wl_display_get_fd(display_wayland->wl_display, wl_source->pfd.fd = wl_display_get_fd(display_wayland->wl_display);
gdk_event_source_update, source);
wl_source->pfd.events = G_IO_IN | G_IO_ERR; wl_source->pfd.events = G_IO_IN | G_IO_ERR;
g_source_add_poll(source, &wl_source->pfd); g_source_add_poll(source, &wl_source->pfd);
@@ -148,16 +136,6 @@ _gdk_wayland_display_event_source_new (GdkDisplay *display)
return source; return source;
} }
void
_gdk_wayland_display_flush (GdkDisplay *display, GSource *source)
{
GdkWaylandEventSource *wayland_source = (GdkWaylandEventSource *) source;
while (wayland_source->mask & WL_DISPLAY_WRITABLE)
wl_display_iterate(GDK_WAYLAND_DISPLAY (display)->wl_display,
WL_DISPLAY_WRITABLE);
}
void void
_gdk_wayland_display_queue_events (GdkDisplay *display) _gdk_wayland_display_queue_events (GdkDisplay *display)
{ {
@@ -166,10 +144,9 @@ _gdk_wayland_display_queue_events (GdkDisplay *display)
display_wayland = GDK_WAYLAND_DISPLAY (display); display_wayland = GDK_WAYLAND_DISPLAY (display);
source = (GdkWaylandEventSource *) display_wayland->event_source; source = (GdkWaylandEventSource *) display_wayland->event_source;
if (source->pfd.revents) if (source->pfd.revents)
{ {
wl_display_iterate(display_wayland->wl_display, WL_DISPLAY_READABLE); wl_display_dispatch(display_wayland->wl_display);
source->pfd.revents = 0; source->pfd.revents = 0;
} }
} }

View File

@@ -221,7 +221,7 @@ _gdk_wayland_keymap_new ()
names.layout = "us"; names.layout = "us";
names.variant = ""; names.variant = "";
names.options = ""; names.options = "";
keymap->xkb_keymap = xkb_map_new_from_names(context, &names, XKB_MAP_COMPILE_PLACEHOLDER); keymap->xkb_keymap = xkb_keymap_new_from_names (context, &names, 0);
keymap->xkb_state = xkb_state_new (keymap->xkb_keymap); keymap->xkb_state = xkb_state_new (keymap->xkb_keymap);
xkb_context_unref (context); xkb_context_unref (context);
@@ -246,7 +246,7 @@ _gdk_wayland_keymap_new_from_fd (uint32_t format,
return NULL; return NULL;
} }
keymap->xkb_keymap = xkb_map_new_from_string (context, map_str, format, XKB_MAP_COMPILE_PLACEHOLDER); keymap->xkb_keymap = xkb_keymap_new_from_string (context, map_str, format, 0);
munmap (map_str, size); munmap (map_str, size);
close (fd); close (fd);
keymap->xkb_state = xkb_state_new (keymap->xkb_keymap); keymap->xkb_state = xkb_state_new (keymap->xkb_keymap);

View File

@@ -137,7 +137,6 @@ GdkKeymap *_gdk_wayland_device_get_keymap (GdkDevice *device);
void _gdk_wayland_display_deliver_event (GdkDisplay *display, GdkEvent *event); void _gdk_wayland_display_deliver_event (GdkDisplay *display, GdkEvent *event);
GSource *_gdk_wayland_display_event_source_new (GdkDisplay *display); GSource *_gdk_wayland_display_event_source_new (GdkDisplay *display);
void _gdk_wayland_display_queue_events (GdkDisplay *display); void _gdk_wayland_display_queue_events (GdkDisplay *display);
void _gdk_wayland_display_flush (GdkDisplay *display, GSource *source);
GdkAppLaunchContext *_gdk_wayland_display_get_app_launch_context (GdkDisplay *display); GdkAppLaunchContext *_gdk_wayland_display_get_app_launch_context (GdkDisplay *display);

View File

@@ -1563,6 +1563,7 @@ gdk_wayland_window_process_updates_recurse (GdkWindow *window,
cairo_region_get_rectangle (region, i, &rect); cairo_region_get_rectangle (region, i, &rect);
wl_surface_damage (impl->surface, wl_surface_damage (impl->surface,
rect.x, rect.y, rect.width, rect.height); rect.x, rect.y, rect.width, rect.height);
wl_surface_commit(impl->surface);
} }
_gdk_window_process_updates_recurse (window, region); _gdk_window_process_updates_recurse (window, region);

View File

@@ -1459,7 +1459,6 @@ _gdk_x11_display_open (const gchar *display_name)
_gdk_x11_screen_setup (display_x11->screens[i]); _gdk_x11_screen_setup (display_x11->screens[i]);
g_signal_emit_by_name (display, "opened"); g_signal_emit_by_name (display, "opened");
g_signal_emit_by_name (gdk_display_manager_get (), "display-opened", display);
return display; return display;
} }

View File

@@ -51,8 +51,13 @@ gdk_x11_display_manager_open_display (GdkDisplayManager *manager,
GdkDisplay *display; GdkDisplay *display;
display = _gdk_x11_display_open (name); display = _gdk_x11_display_open (name);
if (manager_x11->default_display == NULL && display != NULL) if (display != NULL)
gdk_display_manager_set_default_display (manager, display); {
if (manager_x11->default_display == NULL)
gdk_display_manager_set_default_display (manager, display);
g_signal_emit_by_name (manager, "display-opened", display);
}
return display; return display;
} }

View File

@@ -1113,6 +1113,8 @@ MyEnhancedXkbTranslateKeyCode(register XkbDescPtr xkb,
int found = 0; int found = 0;
for (i=0,entry=type->map;i<type->map_count;i++,entry++) { for (i=0,entry=type->map;i<type->map_count;i++,entry++) {
if (!entry->active || syms[col+entry->level] == syms[col])
continue;
if (mods_rtrn) { if (mods_rtrn) {
int bits = 0; int bits = 0;
unsigned long tmp = entry->mods.mask; unsigned long tmp = entry->mods.mask;
@@ -1123,14 +1125,22 @@ MyEnhancedXkbTranslateKeyCode(register XkbDescPtr xkb,
} }
/* We always add one-modifiers levels to mods_rtrn since /* We always add one-modifiers levels to mods_rtrn since
* they can't wipe out bits in the state unless the * they can't wipe out bits in the state unless the
* level would be triggered. But return other modifiers * level would be triggered. But not if they don't change
* * the symbol (otherwise we can't discriminate Shift-F10
* and F10 anymore). And don't add modifiers that are
* explicitly marked as preserved, either.
*/ */
if (bits == 1 || (mods&type->mods.mask)==entry->mods.mask) if (bits == 1 ||
*mods_rtrn |= entry->mods.mask; (mods&type->mods.mask) == entry->mods.mask)
{
if (type->preserve)
*mods_rtrn |= (entry->mods.mask & ~type->preserve[i].mask);
else
*mods_rtrn |= entry->mods.mask;
}
} }
if (!found&&entry->active&&((mods&type->mods.mask)==entry->mods.mask)) { if (!found && ((mods&type->mods.mask) == entry->mods.mask)) {
col+= entry->level; col+= entry->level;
if (type->preserve) if (type->preserve)
preserve= type->preserve[i].mask; preserve= type->preserve[i].mask;

View File

@@ -311,6 +311,10 @@ void _gdk_x11_cursor_display_finalize (GdkDisplay *display);
void _gdk_x11_window_register_dnd (GdkWindow *window); void _gdk_x11_window_register_dnd (GdkWindow *window);
GdkDragContext * _gdk_x11_window_drag_begin (GdkWindow *window,
GdkDevice *device,
GList *targets);
gboolean _gdk_x11_get_xft_setting (GdkScreen *screen, gboolean _gdk_x11_get_xft_setting (GdkScreen *screen,
const gchar *name, const gchar *name,
GValue *value); GValue *value);

View File

@@ -4858,6 +4858,11 @@ _gdk_x11_display_before_process_all_updates (GdkDisplay *display)
void void
_gdk_x11_display_after_process_all_updates (GdkDisplay *display) _gdk_x11_display_after_process_all_updates (GdkDisplay *display)
{ {
/* Sync after all drawing, otherwise the client can get "ahead" of
the server rendering during animations, such that we fill up
the Xserver pipes with sync rendering ops not letting other
clients (including the VM) do anything. */
XSync (GDK_DISPLAY_XDISPLAY (display), FALSE);
} }
static Bool static Bool
@@ -4948,10 +4953,6 @@ gdk_x11_window_get_xid (GdkWindow *window)
return GDK_WINDOW_IMPL_X11 (window->impl)->xid; return GDK_WINDOW_IMPL_X11 (window->impl)->xid;
} }
extern GdkDragContext * _gdk_x11_window_drag_begin (GdkWindow *window,
GdkDevice *device,
GList *targets);
static void static void
gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass) gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
{ {

View File

@@ -419,6 +419,7 @@ gtk_private_h_sources = \
gtkboxprivate.h \ gtkboxprivate.h \
gtkbuilderprivate.h \ gtkbuilderprivate.h \
gtkbuttonprivate.h \ gtkbuttonprivate.h \
gtkcairoblurprivate.h \
gtkcellareaboxcontextprivate.h \ gtkcellareaboxcontextprivate.h \
gtkcolorswatchprivate.h \ gtkcolorswatchprivate.h \
gtkcoloreditorprivate.h \ gtkcoloreditorprivate.h \
@@ -426,10 +427,11 @@ gtk_private_h_sources = \
gtkcolorscaleprivate.h \ gtkcolorscaleprivate.h \
gtkcolorchooserprivate.h \ gtkcolorchooserprivate.h \
gtkcontainerprivate.h \ gtkcontainerprivate.h \
gtkcssanimatedvaluesprivate.h \ gtkcssanimationprivate.h \
gtkcssarrayvalueprivate.h \ gtkcssarrayvalueprivate.h \
gtkcssbgsizevalueprivate.h \ gtkcssbgsizevalueprivate.h \
gtkcssbordervalueprivate.h \ gtkcssbordervalueprivate.h \
gtkcsscolorvalueprivate.h \
gtkcsscomputedvaluesprivate.h \ gtkcsscomputedvaluesprivate.h \
gtkcsscornervalueprivate.h \ gtkcsscornervalueprivate.h \
gtkcsscustompropertyprivate.h \ gtkcsscustompropertyprivate.h \
@@ -445,6 +447,7 @@ gtk_private_h_sources = \
gtkcssimagewin32private.h \ gtkcssimagewin32private.h \
gtkcssinheritvalueprivate.h \ gtkcssinheritvalueprivate.h \
gtkcssinitialvalueprivate.h \ gtkcssinitialvalueprivate.h \
gtkcsskeyframesprivate.h \
gtkcsslookupprivate.h \ gtkcsslookupprivate.h \
gtkcssmatcherprivate.h \ gtkcssmatcherprivate.h \
gtkcssnumbervalueprivate.h \ gtkcssnumbervalueprivate.h \
@@ -475,6 +478,8 @@ gtk_private_h_sources = \
gtkfilesystemmodel.h \ gtkfilesystemmodel.h \
gtkfontchooserprivate.h \ gtkfontchooserprivate.h \
gtkfontchooserutils.h \ gtkfontchooserutils.h \
gtkgradientprivate.h \
gtkhslaprivate.h \
gtkiconcache.h \ gtkiconcache.h \
gtkiconhelperprivate.h \ gtkiconhelperprivate.h \
gtkiconviewprivate.h \ gtkiconviewprivate.h \
@@ -489,7 +494,6 @@ gtk_private_h_sources = \
gtkmenuitemprivate.h \ gtkmenuitemprivate.h \
gtkmenushellprivate.h \ gtkmenushellprivate.h \
gtkmnemonichash.h \ gtkmnemonichash.h \
gtkmodelmenu.h \
gtkmodelmenuitem.h \ gtkmodelmenuitem.h \
gtkmodifierstyle.h \ gtkmodifierstyle.h \
gtkmodulesprivate.h \ gtkmodulesprivate.h \
@@ -515,6 +519,7 @@ gtk_private_h_sources = \
gtkselectionprivate.h \ gtkselectionprivate.h \
gtksettingsprivate.h \ gtksettingsprivate.h \
gtksizegroup-private.h \ gtksizegroup-private.h \
gtksizerequestcacheprivate.h \
gtksocketprivate.h \ gtksocketprivate.h \
gtkstyleanimationprivate.h \ gtkstyleanimationprivate.h \
gtkstylecascadeprivate.h \ gtkstylecascadeprivate.h \
@@ -615,6 +620,7 @@ gtk_base_c_sources = \
gtkbuilderparser.c \ gtkbuilderparser.c \
gtkbuilder-menus.c \ gtkbuilder-menus.c \
gtkbutton.c \ gtkbutton.c \
gtkcairoblur.c \
gtkcalendar.c \ gtkcalendar.c \
gtkcellarea.c \ gtkcellarea.c \
gtkcellareabox.c \ gtkcellareabox.c \
@@ -646,10 +652,11 @@ gtk_base_c_sources = \
gtkcombobox.c \ gtkcombobox.c \
gtkcomboboxtext.c \ gtkcomboboxtext.c \
gtkcontainer.c \ gtkcontainer.c \
gtkcssanimatedvalues.c \ gtkcssanimation.c \
gtkcssarrayvalue.c \ gtkcssarrayvalue.c \
gtkcssbgsizevalue.c \ gtkcssbgsizevalue.c \
gtkcssbordervalue.c \ gtkcssbordervalue.c \
gtkcsscolorvalue.c \
gtkcsscomputedvalues.c \ gtkcsscomputedvalues.c \
gtkcsscornervalue.c \ gtkcsscornervalue.c \
gtkcsscustomproperty.c \ gtkcsscustomproperty.c \
@@ -665,6 +672,7 @@ gtk_base_c_sources = \
gtkcssimagewin32.c \ gtkcssimagewin32.c \
gtkcssinheritvalue.c \ gtkcssinheritvalue.c \
gtkcssinitialvalue.c \ gtkcssinitialvalue.c \
gtkcsskeyframes.c \
gtkcsslookup.c \ gtkcsslookup.c \
gtkcssmatcher.c \ gtkcssmatcher.c \
gtkcssnumbervalue.c \ gtkcssnumbervalue.c \
@@ -715,6 +723,7 @@ gtk_base_c_sources = \
gtkframe.c \ gtkframe.c \
gtkgradient.c \ gtkgradient.c \
gtkgrid.c \ gtkgrid.c \
gtkhsla.c \
gtkiconcache.c \ gtkiconcache.c \
gtkiconcachevalidator.c \ gtkiconcachevalidator.c \
gtkiconfactory.c \ gtkiconfactory.c \
@@ -800,6 +809,7 @@ gtk_base_c_sources = \
gtksettings.c \ gtksettings.c \
gtksizegroup.c \ gtksizegroup.c \
gtksizerequest.c \ gtksizerequest.c \
gtksizerequestcache.c \
gtkshow.c \ gtkshow.c \
gtkspinbutton.c \ gtkspinbutton.c \
gtkspinner.c \ gtkspinner.c \
@@ -903,6 +913,8 @@ gtk_private_h_sources += \
gtkprinteroptionwidget.h \ gtkprinteroptionwidget.h \
gtksearchenginetracker.h gtksearchenginetracker.h
gtk_c_sources += $(gtk_os_unix_c_sources) gtk_c_sources += $(gtk_os_unix_c_sources)
else
gtk_c_sources += $(gtk_dbus_built_sources)
endif endif
gtk_os_win32_c_sources = \ gtk_os_win32_c_sources = \

View File

@@ -6,7 +6,6 @@ gail_c_sources = \
gail.c \ gail.c \
gtkarrowaccessible.c \ gtkarrowaccessible.c \
gtkbooleancellaccessible.c \ gtkbooleancellaccessible.c \
gtkboxaccessible.c \
gtkbuttonaccessible.c \ gtkbuttonaccessible.c \
gtkcellaccessible.c \ gtkcellaccessible.c \
gtkcellaccessibleparent.c \ gtkcellaccessibleparent.c \
@@ -54,9 +53,9 @@ gail_c_sources = \
gailmisc.c gailmisc.c
gail_private_h_sources = \ gail_private_h_sources = \
gail.h \
gtkarrowaccessible.h \ gtkarrowaccessible.h \
gtkbooleancellaccessible.h \ gtkbooleancellaccessible.h \
gtkboxaccessible.h \
gtkbuttonaccessible.h \ gtkbuttonaccessible.h \
gtkcellaccessible.h \ gtkcellaccessible.h \
gtkcellaccessibleparent.h \ gtkcellaccessibleparent.h \

View File

@@ -17,6 +17,8 @@
#include "config.h" #include "config.h"
#include "gail.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@@ -76,6 +78,7 @@ static GtkWidget* focus_before_menu = NULL;
static guint focus_notify_handler = 0; static guint focus_notify_handler = 0;
static guint focus_tracker_id = 0; static guint focus_tracker_id = 0;
static GQuark quark_focus_object = 0; static GQuark quark_focus_object = 0;
static int initialized = FALSE;
static AtkObject* static AtkObject*
gail_get_accessible_for_widget (GtkWidget *widget, gail_get_accessible_for_widget (GtkWidget *widget,
@@ -794,10 +797,25 @@ gail_set_focus_object (AtkObject *focus_obj,
} }
} }
void
_gtk_accessibility_shutdown (void)
{
if (!initialized)
return;
initialized = FALSE;
g_clear_object (&atk_misc_instance);
#ifdef GDK_WINDOWING_X11
atk_bridge_adaptor_cleanup ();
#endif
_gail_util_uninstall ();
}
void void
_gtk_accessibility_init (void) _gtk_accessibility_init (void)
{ {
static int initialized = FALSE;
if (initialized) if (initialized)
return; return;

View File

@@ -1,5 +1,5 @@
/* GAIL - The GNOME Accessibility Implementation Library /* GAIL - The GNOME Accessibility Implementation Library
* Copyright 2004 Sun Microsystems Inc. * Copyright 2001 Sun Microsystems Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@@ -15,31 +15,16 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "config.h" #ifndef __GTK_GAIL_H__
#define __GTK_GAIL_H__
#include <gtk/gtk.h> #include <glib.h>
#include "gtkboxaccessible.h"
G_BEGIN_DECLS
G_DEFINE_TYPE (GtkBoxAccessible, _gtk_box_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE) void _gtk_accessibility_shutdown (void);
void _gtk_accessibility_init (void);
static void G_END_DECLS
gtk_box_accessible_initialize (AtkObject *accessible,
gpointer data)
{
ATK_OBJECT_CLASS (_gtk_box_accessible_parent_class)->initialize (accessible, data);
accessible->role = ATK_ROLE_FILLER;
}
static void #endif /* __GTK_GAIL_H__ */
_gtk_box_accessible_class_init (GtkBoxAccessibleClass *klass)
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
class->initialize = gtk_box_accessible_initialize;
}
static void
_gtk_box_accessible_init (GtkBoxAccessible *scale)
{
}

View File

@@ -206,6 +206,17 @@ do_window_event_initialization (void)
(GCallback) window_removed, NULL); (GCallback) window_removed, NULL);
} }
static void
undo_window_event_initialization (void)
{
AtkObject *root;
root = atk_get_root ();
g_signal_handlers_disconnect_by_func (root, (GCallback) window_added, NULL);
g_signal_handlers_disconnect_by_func (root, (GCallback) window_removed, NULL);
}
static AtkKeyEventStruct * static AtkKeyEventStruct *
atk_key_event_from_gdk_event_key (GdkEventKey *key) atk_key_event_from_gdk_event_key (GdkEventKey *key)
{ {
@@ -341,6 +352,12 @@ gail_util_get_toolkit_version (void)
return GTK_VERSION; return GTK_VERSION;
} }
void
_gail_util_uninstall (void)
{
undo_window_event_initialization ();
}
void void
_gail_util_install (void) _gail_util_install (void)
{ {

View File

@@ -22,7 +22,8 @@
G_BEGIN_DECLS G_BEGIN_DECLS
void _gail_util_install (void); void _gail_util_install (void);
void _gail_util_uninstall (void);
gboolean _gail_util_key_snooper (GtkWidget *the_widget, gboolean _gail_util_key_snooper (GtkWidget *the_widget,
GdkEventKey *event); GdkEventKey *event);

View File

@@ -20,6 +20,10 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "gtkarrowaccessible.h" #include "gtkarrowaccessible.h"
struct _GtkArrowAccessiblePrivate
{
gchar *image_description;
};
static void atk_image_interface_init (AtkImageIface *iface); static void atk_image_interface_init (AtkImageIface *iface);
@@ -40,7 +44,7 @@ gtk_arrow_accessible_finalize (GObject *object)
{ {
GtkArrowAccessible *arrow = GTK_ARROW_ACCESSIBLE (object); GtkArrowAccessible *arrow = GTK_ARROW_ACCESSIBLE (object);
g_free (arrow->image_description); g_free (arrow->priv->image_description);
G_OBJECT_CLASS (_gtk_arrow_accessible_parent_class)->finalize (object); G_OBJECT_CLASS (_gtk_arrow_accessible_parent_class)->finalize (object);
} }
@@ -54,12 +58,16 @@ _gtk_arrow_accessible_class_init (GtkArrowAccessibleClass *klass)
atk_object_class->initialize = gtk_arrow_accessible_initialize; atk_object_class->initialize = gtk_arrow_accessible_initialize;
gobject_class->finalize = gtk_arrow_accessible_finalize; gobject_class->finalize = gtk_arrow_accessible_finalize;
g_type_class_add_private (klass, sizeof (GtkArrowAccessiblePrivate));
} }
static void static void
_gtk_arrow_accessible_init (GtkArrowAccessible *arrow) _gtk_arrow_accessible_init (GtkArrowAccessible *arrow)
{ {
arrow->image_description = NULL; arrow->priv = G_TYPE_INSTANCE_GET_PRIVATE (arrow,
GTK_TYPE_ARROW_ACCESSIBLE,
GtkArrowAccessiblePrivate);
} }
static const gchar * static const gchar *
@@ -67,7 +75,7 @@ gtk_arrow_accessible_get_image_description (AtkImage *obj)
{ {
GtkArrowAccessible *arrow = GTK_ARROW_ACCESSIBLE (obj); GtkArrowAccessible *arrow = GTK_ARROW_ACCESSIBLE (obj);
return arrow->image_description; return arrow->priv->image_description;
} }
static gboolean static gboolean
@@ -76,8 +84,8 @@ gtk_arrow_accessible_set_image_description (AtkImage *obj,
{ {
GtkArrowAccessible *arrow = GTK_ARROW_ACCESSIBLE (obj); GtkArrowAccessible *arrow = GTK_ARROW_ACCESSIBLE (obj);
g_free (arrow->image_description); g_free (arrow->priv->image_description);
arrow->image_description = g_strdup (description); arrow->priv->image_description = g_strdup (description);
return TRUE; return TRUE;

View File

@@ -29,14 +29,15 @@ G_BEGIN_DECLS
#define GTK_IS_ARROW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ARROW_ACCESSIBLE)) #define GTK_IS_ARROW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ARROW_ACCESSIBLE))
#define GTK_ARROW_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ARROW_ACCESSIBLE, GtkArrowAccessibleClass)) #define GTK_ARROW_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ARROW_ACCESSIBLE, GtkArrowAccessibleClass))
typedef struct _GtkArrowAccessible GtkArrowAccessible; typedef struct _GtkArrowAccessible GtkArrowAccessible;
typedef struct _GtkArrowAccessibleClass GtkArrowAccessibleClass; typedef struct _GtkArrowAccessibleClass GtkArrowAccessibleClass;
typedef struct _GtkArrowAccessiblePrivate GtkArrowAccessiblePrivate;
struct _GtkArrowAccessible struct _GtkArrowAccessible
{ {
GtkWidgetAccessible parent; GtkWidgetAccessible parent;
gchar *image_description; GtkArrowAccessiblePrivate *priv;
}; };
struct _GtkArrowAccessibleClass struct _GtkArrowAccessibleClass

View File

@@ -20,6 +20,12 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "gtkbooleancellaccessible.h" #include "gtkbooleancellaccessible.h"
struct _GtkBooleanCellAccessiblePrivate
{
gboolean cell_value;
gboolean cell_sensitive;
};
static AtkActionIface *parent_action_iface; static AtkActionIface *parent_action_iface;
static gint static gint
@@ -82,10 +88,10 @@ gtk_boolean_cell_accessible_ref_state_set (AtkObject *accessible)
state_set = ATK_OBJECT_CLASS (_gtk_boolean_cell_accessible_parent_class)->ref_state_set (accessible); state_set = ATK_OBJECT_CLASS (_gtk_boolean_cell_accessible_parent_class)->ref_state_set (accessible);
if (cell->cell_value) if (cell->priv->cell_value)
atk_state_set_add_state (state_set, ATK_STATE_CHECKED); atk_state_set_add_state (state_set, ATK_STATE_CHECKED);
if (cell->cell_sensitive) if (cell->priv->cell_sensitive)
atk_state_set_add_state (state_set, ATK_STATE_SENSITIVE); atk_state_set_add_state (state_set, ATK_STATE_SENSITIVE);
else else
atk_state_set_remove_state (state_set, ATK_STATE_SENSITIVE); atk_state_set_remove_state (state_set, ATK_STATE_SENSITIVE);
@@ -99,22 +105,25 @@ gtk_boolean_cell_accessible_update_cache (GtkCellAccessible *cell)
GtkBooleanCellAccessible *boolean_cell = GTK_BOOLEAN_CELL_ACCESSIBLE (cell); GtkBooleanCellAccessible *boolean_cell = GTK_BOOLEAN_CELL_ACCESSIBLE (cell);
gboolean active; gboolean active;
gboolean sensitive; gboolean sensitive;
GtkCellRenderer *renderer;
g_object_get (G_OBJECT (GTK_RENDERER_CELL_ACCESSIBLE (cell)->renderer), g_object_get (cell, "renderer", &renderer, NULL);
g_object_get (renderer,
"active", &active, "active", &active,
"sensitive", &sensitive, "sensitive", &sensitive,
NULL); NULL);
g_object_unref (renderer);
if (boolean_cell->cell_value != active) if (boolean_cell->priv->cell_value != active)
{ {
boolean_cell->cell_value = !boolean_cell->cell_value; boolean_cell->priv->cell_value = !boolean_cell->priv->cell_value;
atk_object_notify_state_change (ATK_OBJECT (cell), ATK_STATE_CHECKED, active); atk_object_notify_state_change (ATK_OBJECT (cell), ATK_STATE_CHECKED, active);
} }
if (boolean_cell->cell_sensitive != sensitive) if (boolean_cell->priv->cell_sensitive != sensitive)
{ {
boolean_cell->cell_sensitive = !boolean_cell->cell_sensitive; boolean_cell->priv->cell_sensitive = !boolean_cell->priv->cell_sensitive;
atk_object_notify_state_change (ATK_OBJECT (cell), ATK_STATE_CHECKED, sensitive); atk_object_notify_state_change (ATK_OBJECT (cell), ATK_STATE_CHECKED, sensitive);
} }
@@ -129,10 +138,15 @@ _gtk_boolean_cell_accessible_class_init (GtkBooleanCellAccessibleClass *klass)
atkobject_class->ref_state_set = gtk_boolean_cell_accessible_ref_state_set; atkobject_class->ref_state_set = gtk_boolean_cell_accessible_ref_state_set;
cell_class->update_cache = gtk_boolean_cell_accessible_update_cache; cell_class->update_cache = gtk_boolean_cell_accessible_update_cache;
g_type_class_add_private (klass, sizeof (GtkBooleanCellAccessiblePrivate));
} }
static void static void
_gtk_boolean_cell_accessible_init (GtkBooleanCellAccessible *cell) _gtk_boolean_cell_accessible_init (GtkBooleanCellAccessible *cell)
{ {
cell->priv = G_TYPE_INSTANCE_GET_PRIVATE (cell,
GTK_TYPE_BOOLEAN_CELL_ACCESSIBLE,
GtkBooleanCellAccessiblePrivate);
} }

View File

@@ -30,14 +30,15 @@ G_BEGIN_DECLS
#define GTK_IS_BOOLEAN_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BOOLEAN_CELL_ACCESSIBLE)) #define GTK_IS_BOOLEAN_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BOOLEAN_CELL_ACCESSIBLE))
#define GTK_BOOLEAN_CELL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BOOLEAN_CELL_ACCESSIBLE, GtkBooleanCellAccessibleClass)) #define GTK_BOOLEAN_CELL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BOOLEAN_CELL_ACCESSIBLE, GtkBooleanCellAccessibleClass))
typedef struct _GtkBooleanCellAccessible GtkBooleanCellAccessible; typedef struct _GtkBooleanCellAccessible GtkBooleanCellAccessible;
typedef struct _GtkBooleanCellAccessibleClass GtkBooleanCellAccessibleClass; typedef struct _GtkBooleanCellAccessibleClass GtkBooleanCellAccessibleClass;
typedef struct _GtkBooleanCellAccessiblePrivate GtkBooleanCellAccessiblePrivate;
struct _GtkBooleanCellAccessible struct _GtkBooleanCellAccessible
{ {
GtkRendererCellAccessible parent; GtkRendererCellAccessible parent;
gboolean cell_value;
gboolean cell_sensitive; GtkBooleanCellAccessiblePrivate *priv;
}; };
struct _GtkBooleanCellAccessibleClass struct _GtkBooleanCellAccessibleClass

View File

@@ -1,49 +0,0 @@
/* GAIL - The GNOME Accessibility Implementation Library
* Copyright 2004 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GTK_BOX_ACCESSIBLE_H__
#define __GTK_BOX_ACCESSIBLE_H__
#include "gtkcontaineraccessible.h"
G_BEGIN_DECLS
#define GTK_TYPE_BOX_ACCESSIBLE (_gtk_box_accessible_get_type ())
#define GTK_BOX_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BOX_ACCESSIBLE, GtkBoxAccessible))
#define GTK_BOX_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_BOX_ACCESSIBLE, GtkBoxAccessibleClass))
#define GTK_IS_BOX_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_BOX_ACCESSIBLE))
#define GTK_IS_BOX_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BOX_ACCESSIBLE))
#define GTK_BOX_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BOX_ACCESSIBLE, GtkBoxAccessibleClass))
typedef struct _GtkBoxAccessible GtkBoxAccessible;
typedef struct _GtkBoxAccessibleClass GtkBoxAccessibleClass;
struct _GtkBoxAccessible
{
GtkContainerAccessible parent;
};
struct _GtkBoxAccessibleClass
{
GtkContainerAccessibleClass parent_class;
};
GType _gtk_box_accessible_get_type (void);
G_END_DECLS
#endif /* __GTK_BOX_ACCESSIBLE_H__ */

View File

@@ -29,12 +29,15 @@ G_BEGIN_DECLS
#define GTK_IS_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BUTTON_ACCESSIBLE)) #define GTK_IS_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BUTTON_ACCESSIBLE))
#define GTK_BUTTON_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BUTTON_ACCESSIBLE, GtkButtonAccessibleClass)) #define GTK_BUTTON_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BUTTON_ACCESSIBLE, GtkButtonAccessibleClass))
typedef struct _GtkButtonAccessible GtkButtonAccessible; typedef struct _GtkButtonAccessible GtkButtonAccessible;
typedef struct _GtkButtonAccessibleClass GtkButtonAccessibleClass; typedef struct _GtkButtonAccessibleClass GtkButtonAccessibleClass;
typedef struct _GtkButtonAccessiblePrivate GtkButtonAccessiblePrivate;
struct _GtkButtonAccessible struct _GtkButtonAccessible
{ {
GtkContainerAccessible parent; GtkContainerAccessible parent;
GtkButtonAccessiblePrivate *priv;
}; };
struct _GtkButtonAccessibleClass struct _GtkButtonAccessibleClass

View File

@@ -83,7 +83,7 @@ gtk_cell_accessible_get_index_in_parent (AtkObject *obj)
parent = atk_object_get_parent (obj); parent = atk_object_get_parent (obj);
if (GTK_IS_CONTAINER_CELL_ACCESSIBLE (parent)) if (GTK_IS_CONTAINER_CELL_ACCESSIBLE (parent))
return g_list_index (GTK_CONTAINER_CELL_ACCESSIBLE (parent)->children, obj); return g_list_index (_gtk_container_cell_accessible_get_children (GTK_CONTAINER_CELL_ACCESSIBLE (parent)), obj);
parent = gtk_widget_get_accessible (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell))); parent = gtk_widget_get_accessible (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell)));
if (parent == NULL) if (parent == NULL)

View File

@@ -30,12 +30,15 @@ G_BEGIN_DECLS
#define GTK_IS_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CELL_ACCESSIBLE)) #define GTK_IS_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CELL_ACCESSIBLE))
#define GTK_CELL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CELL_ACCESSIBLE, GtkCellAccessibleClass)) #define GTK_CELL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CELL_ACCESSIBLE, GtkCellAccessibleClass))
typedef struct _GtkCellAccessible GtkCellAccessible; typedef struct _GtkCellAccessible GtkCellAccessible;
typedef struct _GtkCellAccessibleClass GtkCellAccessibleClass; typedef struct _GtkCellAccessibleClass GtkCellAccessibleClass;
typedef struct _GtkCellAccessiblePrivate GtkCellAccessiblePrivate;
struct _GtkCellAccessible struct _GtkCellAccessible
{ {
GtkAccessible parent; GtkAccessible parent;
GtkCellAccessiblePrivate *priv;
}; };
struct _GtkCellAccessibleClass struct _GtkCellAccessibleClass

View File

@@ -29,12 +29,15 @@ G_BEGIN_DECLS
#define GTK_IS_CHECK_MENU_ITEM_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CHECK_MENU_ITEM_ACCESSIBLE)) #define GTK_IS_CHECK_MENU_ITEM_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CHECK_MENU_ITEM_ACCESSIBLE))
#define GTK_CHECK_MENU_ITEM_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CHECK_MENU_ITEM_ACCESSIBLE, GtkCheckMenuItemAccessibleClass)) #define GTK_CHECK_MENU_ITEM_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CHECK_MENU_ITEM_ACCESSIBLE, GtkCheckMenuItemAccessibleClass))
typedef struct _GtkCheckMenuItemAccessible GtkCheckMenuItemAccessible; typedef struct _GtkCheckMenuItemAccessible GtkCheckMenuItemAccessible;
typedef struct _GtkCheckMenuItemAccessibleClass GtkCheckMenuItemAccessibleClass; typedef struct _GtkCheckMenuItemAccessibleClass GtkCheckMenuItemAccessibleClass;
typedef struct _GtkCheckMenuItemAccessiblePrivate GtkCheckMenuItemAccessiblePrivate;
struct _GtkCheckMenuItemAccessible struct _GtkCheckMenuItemAccessible
{ {
GtkMenuItemAccessible parent; GtkMenuItemAccessible parent;
GtkCheckMenuItemAccessiblePrivate *priv;
}; };
struct _GtkCheckMenuItemAccessibleClass struct _GtkCheckMenuItemAccessibleClass

View File

@@ -29,12 +29,15 @@ G_BEGIN_DECLS
#define GTK_IS_COLOR_SWATCH_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COLOR_SWATCH_ACCESSIBLE)) #define GTK_IS_COLOR_SWATCH_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COLOR_SWATCH_ACCESSIBLE))
#define GTK_COLOR_SWATCH_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_COLOR_SWATCH_ACCESSIBLE, GtkColorSwatchAccessibleClass)) #define GTK_COLOR_SWATCH_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_COLOR_SWATCH_ACCESSIBLE, GtkColorSwatchAccessibleClass))
typedef struct _GtkColorSwatchAccessible GtkColorSwatchAccessible; typedef struct _GtkColorSwatchAccessible GtkColorSwatchAccessible;
typedef struct _GtkColorSwatchAccessibleClass GtkColorSwatchAccessibleClass; typedef struct _GtkColorSwatchAccessibleClass GtkColorSwatchAccessibleClass;
typedef struct _GtkColorSwatchAccessiblePrivate GtkColorSwatchAccessiblePrivate;
struct _GtkColorSwatchAccessible struct _GtkColorSwatchAccessible
{ {
GtkWidgetAccessible parent; GtkWidgetAccessible parent;
GtkColorSwatchAccessiblePrivate *priv;
}; };
struct _GtkColorSwatchAccessibleClass struct _GtkColorSwatchAccessibleClass

View File

@@ -20,6 +20,12 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "gtkcomboboxaccessible.h" #include "gtkcomboboxaccessible.h"
struct _GtkComboBoxAccessiblePrivate
{
gchar *name;
gint old_selection;
gboolean popup_set;
};
static void atk_action_interface_init (AtkActionIface *iface); static void atk_action_interface_init (AtkActionIface *iface);
static void atk_selection_interface_init (AtkSelectionIface *iface); static void atk_selection_interface_init (AtkSelectionIface *iface);
@@ -41,9 +47,9 @@ changed_cb (GtkWidget *widget)
index = gtk_combo_box_get_active (combo_box); index = gtk_combo_box_get_active (combo_box);
obj = gtk_widget_get_accessible (widget); obj = gtk_widget_get_accessible (widget);
accessible = GTK_COMBO_BOX_ACCESSIBLE (obj); accessible = GTK_COMBO_BOX_ACCESSIBLE (obj);
if (accessible->old_selection != index) if (accessible->priv->old_selection != index)
{ {
accessible->old_selection = index; accessible->priv->old_selection = index;
g_object_notify (G_OBJECT (obj), "accessible-name"); g_object_notify (G_OBJECT (obj), "accessible-name");
g_signal_emit_by_name (obj, "selection-changed"); g_signal_emit_by_name (obj, "selection-changed");
} }
@@ -63,13 +69,13 @@ gtk_combo_box_accessible_initialize (AtkObject *obj,
accessible = GTK_COMBO_BOX_ACCESSIBLE (obj); accessible = GTK_COMBO_BOX_ACCESSIBLE (obj);
g_signal_connect (combo_box, "changed", G_CALLBACK (changed_cb), NULL); g_signal_connect (combo_box, "changed", G_CALLBACK (changed_cb), NULL);
accessible->old_selection = gtk_combo_box_get_active (combo_box); accessible->priv->old_selection = gtk_combo_box_get_active (combo_box);
popup = gtk_combo_box_get_popup_accessible (combo_box); popup = gtk_combo_box_get_popup_accessible (combo_box);
if (popup) if (popup)
{ {
atk_object_set_parent (popup, obj); atk_object_set_parent (popup, obj);
accessible->popup_set = TRUE; accessible->priv->popup_set = TRUE;
} }
if (gtk_combo_box_get_has_entry (combo_box)) if (gtk_combo_box_get_has_entry (combo_box))
atk_object_set_parent (gtk_widget_get_accessible (gtk_bin_get_child (GTK_BIN (combo_box))), obj); atk_object_set_parent (gtk_widget_get_accessible (gtk_bin_get_child (GTK_BIN (combo_box))), obj);
@@ -82,7 +88,7 @@ gtk_combo_box_accessible_finalize (GObject *object)
{ {
GtkComboBoxAccessible *combo_box = GTK_COMBO_BOX_ACCESSIBLE (object); GtkComboBoxAccessible *combo_box = GTK_COMBO_BOX_ACCESSIBLE (object);
g_free (combo_box->name); g_free (combo_box->priv->name);
G_OBJECT_CLASS (_gtk_combo_box_accessible_parent_class)->finalize (object); G_OBJECT_CLASS (_gtk_combo_box_accessible_parent_class)->finalize (object);
} }
@@ -120,8 +126,8 @@ gtk_combo_box_accessible_get_name (AtkObject *obj)
gtk_tree_model_get_value (model, &iter, i, &value); gtk_tree_model_get_value (model, &iter, i, &value);
if (G_VALUE_HOLDS_STRING (&value)) if (G_VALUE_HOLDS_STRING (&value))
{ {
g_free (accessible->name); g_free (accessible->priv->name);
accessible->name = g_strdup (g_value_get_string (&value)); accessible->priv->name = g_strdup (g_value_get_string (&value));
g_value_unset (&value); g_value_unset (&value);
break; break;
} }
@@ -129,7 +135,7 @@ gtk_combo_box_accessible_get_name (AtkObject *obj)
g_value_unset (&value); g_value_unset (&value);
} }
} }
return accessible->name; return accessible->priv->name;
} }
static gint static gint
@@ -165,10 +171,10 @@ gtk_combo_box_accessible_ref_child (AtkObject *obj,
{ {
child = gtk_combo_box_get_popup_accessible (GTK_COMBO_BOX (widget)); child = gtk_combo_box_get_popup_accessible (GTK_COMBO_BOX (widget));
box = GTK_COMBO_BOX_ACCESSIBLE (obj); box = GTK_COMBO_BOX_ACCESSIBLE (obj);
if (box->popup_set == FALSE) if (!box->priv->popup_set)
{ {
atk_object_set_parent (child, obj); atk_object_set_parent (child, obj);
box->popup_set = TRUE; box->priv->popup_set = TRUE;
} }
} }
else if (i == 1 && gtk_combo_box_get_has_entry (GTK_COMBO_BOX (widget))) else if (i == 1 && gtk_combo_box_get_has_entry (GTK_COMBO_BOX (widget)))
@@ -195,14 +201,19 @@ _gtk_combo_box_accessible_class_init (GtkComboBoxAccessibleClass *klass)
class->get_n_children = gtk_combo_box_accessible_get_n_children; class->get_n_children = gtk_combo_box_accessible_get_n_children;
class->ref_child = gtk_combo_box_accessible_ref_child; class->ref_child = gtk_combo_box_accessible_ref_child;
class->initialize = gtk_combo_box_accessible_initialize; class->initialize = gtk_combo_box_accessible_initialize;
g_type_class_add_private (klass, sizeof (GtkComboBoxAccessiblePrivate));
} }
static void static void
_gtk_combo_box_accessible_init (GtkComboBoxAccessible *combo_box) _gtk_combo_box_accessible_init (GtkComboBoxAccessible *combo_box)
{ {
combo_box->old_selection = -1; combo_box->priv = G_TYPE_INSTANCE_GET_PRIVATE (combo_box,
combo_box->name = NULL; GTK_TYPE_COMBO_BOX_ACCESSIBLE,
combo_box->popup_set = FALSE; GtkComboBoxAccessiblePrivate);
combo_box->priv->old_selection = -1;
combo_box->priv->name = NULL;
combo_box->priv->popup_set = FALSE;
} }
static gboolean static gboolean

View File

@@ -29,16 +29,15 @@ G_BEGIN_DECLS
#define GTK_IS_COMBO_BOX_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COMBO_BOX_ACCESSIBLE)) #define GTK_IS_COMBO_BOX_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COMBO_BOX_ACCESSIBLE))
#define GTK_COMBO_BOX_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_COMBO_BOX_ACCESSIBLE, GtkComboBoxAccessibleClass)) #define GTK_COMBO_BOX_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_COMBO_BOX_ACCESSIBLE, GtkComboBoxAccessibleClass))
typedef struct _GtkComboBoxAccessible GtkComboBoxAccessible; typedef struct _GtkComboBoxAccessible GtkComboBoxAccessible;
typedef struct _GtkComboBoxAccessibleClass GtkComboBoxAccessibleClass; typedef struct _GtkComboBoxAccessibleClass GtkComboBoxAccessibleClass;
typedef struct _GtkComboBoxAccessiblePrivate GtkComboBoxAccessiblePrivate;
struct _GtkComboBoxAccessible struct _GtkComboBoxAccessible
{ {
GtkContainerAccessible parent; GtkContainerAccessible parent;
gchar *name; GtkComboBoxAccessiblePrivate *priv;
gint old_selection;
gboolean popup_set;
}; };
struct _GtkComboBoxAccessibleClass struct _GtkComboBoxAccessibleClass

View File

@@ -20,6 +20,10 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "gtkcontaineraccessible.h" #include "gtkcontaineraccessible.h"
struct _GtkContainerAccessiblePrivate
{
GList *children;
};
G_DEFINE_TYPE (GtkContainerAccessible, _gtk_container_accessible, GTK_TYPE_WIDGET_ACCESSIBLE) G_DEFINE_TYPE (GtkContainerAccessible, _gtk_container_accessible, GTK_TYPE_WIDGET_ACCESSIBLE)
@@ -34,7 +38,7 @@ gtk_container_accessible_get_n_children (AtkObject* obj)
if (widget == NULL) if (widget == NULL)
return 0; return 0;
children = gtk_container_get_children (GTK_CONTAINER(widget)); children = gtk_container_get_children (GTK_CONTAINER (widget));
count = g_list_length (children); count = g_list_length (children);
g_list_free (children); g_list_free (children);
@@ -115,9 +119,9 @@ gtk_container_accessible_real_add_gtk (GtkContainer *container,
accessible = GTK_CONTAINER_ACCESSIBLE (atk_parent); accessible = GTK_CONTAINER_ACCESSIBLE (atk_parent);
g_object_notify (G_OBJECT (atk_child), "accessible-parent"); g_object_notify (G_OBJECT (atk_child), "accessible-parent");
g_list_free (accessible->children); g_list_free (accessible->priv->children);
accessible->children = gtk_container_get_children (container); accessible->priv->children = gtk_container_get_children (container);
index = g_list_index (accessible->children, widget); index = g_list_index (accessible->priv->children, widget);
g_signal_emit_by_name (atk_parent, "children-changed::add", index, atk_child, NULL); g_signal_emit_by_name (atk_parent, "children-changed::add", index, atk_child, NULL);
return 1; return 1;
@@ -140,10 +144,10 @@ gtk_container_accessible_real_remove_gtk (GtkContainer *container,
accessible = GTK_CONTAINER_ACCESSIBLE (atk_parent); accessible = GTK_CONTAINER_ACCESSIBLE (atk_parent);
g_object_notify (G_OBJECT (atk_child), "accessible-parent"); g_object_notify (G_OBJECT (atk_child), "accessible-parent");
index = g_list_index (accessible->children, widget); index = g_list_index (accessible->priv->children, widget);
g_list_free (accessible->children); g_list_free (accessible->priv->children);
accessible->children = gtk_container_get_children (container); accessible->priv->children = gtk_container_get_children (container);
if (index >= 0 && index <= g_list_length (accessible->children)) if (index >= 0 && index <= g_list_length (accessible->priv->children))
g_signal_emit_by_name (atk_parent, "children-changed::remove", index, atk_child, NULL); g_signal_emit_by_name (atk_parent, "children-changed::remove", index, atk_child, NULL);
return 1; return 1;
@@ -157,7 +161,7 @@ gtk_container_accessible_real_initialize (AtkObject *obj,
ATK_OBJECT_CLASS (_gtk_container_accessible_parent_class)->initialize (obj, data); ATK_OBJECT_CLASS (_gtk_container_accessible_parent_class)->initialize (obj, data);
accessible->children = gtk_container_get_children (GTK_CONTAINER (data)); accessible->priv->children = gtk_container_get_children (GTK_CONTAINER (data));
g_signal_connect (data, "add", G_CALLBACK (gtk_container_accessible_add_gtk), obj); g_signal_connect (data, "add", G_CALLBACK (gtk_container_accessible_add_gtk), obj);
g_signal_connect (data, "remove", G_CALLBACK (gtk_container_accessible_remove_gtk), obj); g_signal_connect (data, "remove", G_CALLBACK (gtk_container_accessible_remove_gtk), obj);
@@ -170,7 +174,7 @@ gtk_container_accessible_finalize (GObject *object)
{ {
GtkContainerAccessible *accessible = GTK_CONTAINER_ACCESSIBLE (object); GtkContainerAccessible *accessible = GTK_CONTAINER_ACCESSIBLE (object);
g_list_free (accessible->children); g_list_free (accessible->priv->children);
G_OBJECT_CLASS (_gtk_container_accessible_parent_class)->finalize (object); G_OBJECT_CLASS (_gtk_container_accessible_parent_class)->finalize (object);
} }
@@ -189,10 +193,14 @@ _gtk_container_accessible_class_init (GtkContainerAccessibleClass *klass)
klass->add_gtk = gtk_container_accessible_real_add_gtk; klass->add_gtk = gtk_container_accessible_real_add_gtk;
klass->remove_gtk = gtk_container_accessible_real_remove_gtk; klass->remove_gtk = gtk_container_accessible_real_remove_gtk;
g_type_class_add_private (klass, sizeof (GtkContainerAccessiblePrivate));
} }
static void static void
_gtk_container_accessible_init (GtkContainerAccessible *container) _gtk_container_accessible_init (GtkContainerAccessible *container)
{ {
container->priv = G_TYPE_INSTANCE_GET_PRIVATE (container,
GTK_TYPE_CONTAINER_ACCESSIBLE,
GtkContainerAccessiblePrivate);
} }

View File

@@ -30,14 +30,15 @@ G_BEGIN_DECLS
#define GTK_IS_CONTAINER_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CONTAINER_ACCESSIBLE)) #define GTK_IS_CONTAINER_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CONTAINER_ACCESSIBLE))
#define GTK_CONTAINER_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CONTAINER_ACCESSIBLE, GtkContainerAccessibleClass)) #define GTK_CONTAINER_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CONTAINER_ACCESSIBLE, GtkContainerAccessibleClass))
typedef struct _GtkContainerAccessible GtkContainerAccessible; typedef struct _GtkContainerAccessible GtkContainerAccessible;
typedef struct _GtkContainerAccessibleClass GtkContainerAccessibleClass; typedef struct _GtkContainerAccessibleClass GtkContainerAccessibleClass;
typedef struct _GtkContainerAccessiblePrivate GtkContainerAccessiblePrivate;
struct _GtkContainerAccessible struct _GtkContainerAccessible
{ {
GtkWidgetAccessible parent; GtkWidgetAccessible parent;
GList *children; GtkContainerAccessiblePrivate *priv;
}; };
struct _GtkContainerAccessibleClass struct _GtkContainerAccessibleClass

View File

@@ -20,6 +20,11 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "gtkcontainercellaccessible.h" #include "gtkcontainercellaccessible.h"
struct _GtkContainerCellAccessiblePrivate
{
GList *children;
gint n_children;
};
G_DEFINE_TYPE (GtkContainerCellAccessible, _gtk_container_cell_accessible, GTK_TYPE_CELL_ACCESSIBLE) G_DEFINE_TYPE (GtkContainerCellAccessible, _gtk_container_cell_accessible, GTK_TYPE_CELL_ACCESSIBLE)
@@ -29,7 +34,7 @@ gtk_container_cell_accessible_finalize (GObject *obj)
{ {
GtkContainerCellAccessible *container = GTK_CONTAINER_CELL_ACCESSIBLE (obj); GtkContainerCellAccessible *container = GTK_CONTAINER_CELL_ACCESSIBLE (obj);
g_list_free_full (container->children, g_object_unref); g_list_free_full (container->priv->children, g_object_unref);
G_OBJECT_CLASS (_gtk_container_cell_accessible_parent_class)->finalize (obj); G_OBJECT_CLASS (_gtk_container_cell_accessible_parent_class)->finalize (obj);
} }
@@ -40,7 +45,7 @@ gtk_container_cell_accessible_get_n_children (AtkObject *obj)
{ {
GtkContainerCellAccessible *cell = GTK_CONTAINER_CELL_ACCESSIBLE (obj); GtkContainerCellAccessible *cell = GTK_CONTAINER_CELL_ACCESSIBLE (obj);
return cell->NChildren; return cell->priv->n_children;
} }
static AtkObject * static AtkObject *
@@ -50,7 +55,7 @@ gtk_container_cell_accessible_ref_child (AtkObject *obj,
GtkContainerCellAccessible *cell = GTK_CONTAINER_CELL_ACCESSIBLE (obj); GtkContainerCellAccessible *cell = GTK_CONTAINER_CELL_ACCESSIBLE (obj);
GList *l; GList *l;
l = g_list_nth (cell->children, child); l = g_list_nth (cell->priv->children, child);
if (l == NULL) if (l == NULL)
return NULL; return NULL;
@@ -63,7 +68,7 @@ gtk_container_cell_accessible_update_cache (GtkCellAccessible *cell)
GtkContainerCellAccessible *container = GTK_CONTAINER_CELL_ACCESSIBLE (cell); GtkContainerCellAccessible *container = GTK_CONTAINER_CELL_ACCESSIBLE (cell);
GList *l; GList *l;
for (l = container->children; l; l = l->next) for (l = container->priv->children; l; l = l->next)
{ {
_gtk_cell_accessible_update_cache (l->data); _gtk_cell_accessible_update_cache (l->data);
} }
@@ -75,7 +80,7 @@ gtk_container_cell_widget_set (GtkAccessible *accessible)
GtkContainerCellAccessible *container = GTK_CONTAINER_CELL_ACCESSIBLE (accessible); GtkContainerCellAccessible *container = GTK_CONTAINER_CELL_ACCESSIBLE (accessible);
GList *l; GList *l;
for (l = container->children; l; l = l->next) for (l = container->priv->children; l; l = l->next)
{ {
gtk_accessible_set_widget (l->data, gtk_accessible_get_widget (accessible)); gtk_accessible_set_widget (l->data, gtk_accessible_get_widget (accessible));
} }
@@ -89,7 +94,7 @@ gtk_container_cell_widget_unset (GtkAccessible *accessible)
GtkContainerCellAccessible *container = GTK_CONTAINER_CELL_ACCESSIBLE (accessible); GtkContainerCellAccessible *container = GTK_CONTAINER_CELL_ACCESSIBLE (accessible);
GList *l; GList *l;
for (l = container->children; l; l = l->next) for (l = container->priv->children; l; l = l->next)
{ {
gtk_accessible_set_widget (l->data, NULL); gtk_accessible_set_widget (l->data, NULL);
} }
@@ -114,31 +119,28 @@ _gtk_container_cell_accessible_class_init (GtkContainerCellAccessibleClass *klas
accessible_class->widget_unset = gtk_container_cell_widget_unset; accessible_class->widget_unset = gtk_container_cell_widget_unset;
cell_class->update_cache = gtk_container_cell_accessible_update_cache; cell_class->update_cache = gtk_container_cell_accessible_update_cache;
g_type_class_add_private (g_object_class, sizeof (GtkContainerCellAccessiblePrivate));
} }
static void static void
_gtk_container_cell_accessible_init (GtkContainerCellAccessible *cell) _gtk_container_cell_accessible_init (GtkContainerCellAccessible *cell)
{ {
cell->priv = G_TYPE_INSTANCE_GET_PRIVATE (cell,
GTK_TYPE_CONTAINER_CELL_ACCESSIBLE,
GtkContainerCellAccessiblePrivate);
} }
GtkContainerCellAccessible * GtkContainerCellAccessible *
_gtk_container_cell_accessible_new (void) _gtk_container_cell_accessible_new (void)
{ {
GObject *object; GObject *object;
AtkObject *atk_object;
GtkContainerCellAccessible *container;
object = g_object_new (GTK_TYPE_CONTAINER_CELL_ACCESSIBLE, NULL); object = g_object_new (GTK_TYPE_CONTAINER_CELL_ACCESSIBLE, NULL);
g_return_val_if_fail (object != NULL, NULL); ATK_OBJECT (object)->role = ATK_ROLE_TABLE_CELL;
atk_object = ATK_OBJECT (object); return GTK_CONTAINER_CELL_ACCESSIBLE (object);
atk_object->role = ATK_ROLE_TABLE_CELL;
container = GTK_CONTAINER_CELL_ACCESSIBLE (object);
container->children = NULL;
container->NChildren = 0;
return container;
} }
void void
@@ -148,8 +150,8 @@ _gtk_container_cell_accessible_add_child (GtkContainerCellAccessible *container,
g_return_if_fail (GTK_IS_CONTAINER_CELL_ACCESSIBLE (container)); g_return_if_fail (GTK_IS_CONTAINER_CELL_ACCESSIBLE (container));
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (child)); g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (child));
container->NChildren++; container->priv->n_children++;
container->children = g_list_append (container->children, child); container->priv->children = g_list_append (container->priv->children, child);
atk_object_set_parent (ATK_OBJECT (child), ATK_OBJECT (container)); atk_object_set_parent (ATK_OBJECT (child), ATK_OBJECT (container));
} }
@@ -159,8 +161,16 @@ _gtk_container_cell_accessible_remove_child (GtkContainerCellAccessible *contain
{ {
g_return_if_fail (GTK_IS_CONTAINER_CELL_ACCESSIBLE (container)); g_return_if_fail (GTK_IS_CONTAINER_CELL_ACCESSIBLE (container));
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (child)); g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (child));
g_return_if_fail (container->NChildren > 0); g_return_if_fail (container->priv->n_children > 0);
container->children = g_list_remove (container->children, child); container->priv->children = g_list_remove (container->priv->children, child);
container->NChildren--; container->priv->n_children--;
}
GList *
_gtk_container_cell_accessible_get_children (GtkContainerCellAccessible *container)
{
g_return_val_if_fail (GTK_IS_CONTAINER_CELL_ACCESSIBLE (container), NULL);
return container->priv->children;
} }

View File

@@ -30,14 +30,15 @@ G_BEGIN_DECLS
#define GTK_IS_CONTAINER_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CONTAINER_CELL_ACCESSIBLE)) #define GTK_IS_CONTAINER_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CONTAINER_CELL_ACCESSIBLE))
#define GTK_CONTAINER_CELL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CONTAINER_CELL_ACCESSIBLE, GtkContainerCellAccessibleClass)) #define GTK_CONTAINER_CELL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CONTAINER_CELL_ACCESSIBLE, GtkContainerCellAccessibleClass))
typedef struct _GtkContainerCellAccessible GtkContainerCellAccessible; typedef struct _GtkContainerCellAccessible GtkContainerCellAccessible;
typedef struct _GtkContainerCellAccessibleClass GtkContainerCellAccessibleClass; typedef struct _GtkContainerCellAccessibleClass GtkContainerCellAccessibleClass;
typedef struct _GtkContainerCellAccessiblePrivate GtkContainerCellAccessiblePrivate;
struct _GtkContainerCellAccessible struct _GtkContainerCellAccessible
{ {
GtkCellAccessible parent; GtkCellAccessible parent;
GList *children;
gint NChildren; GtkContainerCellAccessiblePrivate *priv;
}; };
struct _GtkContainerCellAccessibleClass struct _GtkContainerCellAccessibleClass
@@ -52,6 +53,7 @@ void _gtk_container_cell_accessible_add_child (GtkCont
GtkCellAccessible *child); GtkCellAccessible *child);
void _gtk_container_cell_accessible_remove_child (GtkContainerCellAccessible *container, void _gtk_container_cell_accessible_remove_child (GtkContainerCellAccessible *container,
GtkCellAccessible *child); GtkCellAccessible *child);
GList *_gtk_container_cell_accessible_get_children (GtkContainerCellAccessible *container);
G_END_DECLS G_END_DECLS

View File

@@ -17,12 +17,351 @@
#include "config.h" #include "config.h"
#include <string.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "gtkpango.h" #include "gtkpango.h"
#include "gtkentryaccessible.h" #include "gtkentryaccessible.h"
#include "gtkentryprivate.h" #include "gtkentryprivate.h"
#include "gtkcomboboxaccessible.h" #include "gtkcomboboxaccessible.h"
#define GTK_TYPE_ENTRY_ICON_ACCESSIBLE (_gtk_entry_icon_accessible_get_type ())
#define GTK_ENTRY_ICON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ENTRY_ICON_ACCESSIBLE, GtkEntryIconAccessible))
#define GTK_IS_ENTRY_ICON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ENTRY_ICON_ACCESSIBLE))
struct _GtkEntryAccessiblePrivate
{
gint cursor_position;
gint selection_bound;
AtkObject *icons[2];
};
typedef struct _GtkEntryIconAccessible GtkEntryIconAccessible;
typedef struct _GtkEntryIconAccessibleClass GtkEntryIconAccessibleClass;
struct _GtkEntryIconAccessible
{
AtkObject parent;
GtkEntryAccessible *entry;
GtkEntryIconPosition pos;
};
struct _GtkEntryIconAccessibleClass
{
AtkObjectClass parent_class;
};
static void atk_action_interface_init (AtkActionIface *iface);
static void icon_atk_action_interface_init (AtkActionIface *iface);
static void icon_atk_component_interface_init (AtkComponentIface *iface);
GType _gtk_entry_icon_accessible_get_type (void);
G_DEFINE_TYPE_WITH_CODE (GtkEntryIconAccessible, _gtk_entry_icon_accessible, ATK_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, icon_atk_action_interface_init)
G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, icon_atk_component_interface_init))
static void
gtk_entry_icon_accessible_remove_entry (gpointer data, GObject *obj)
{
GtkEntryIconAccessible *icon = data;
if (icon->entry)
{
icon->entry = NULL;
g_object_notify (G_OBJECT (icon), "accessible-parent");
atk_object_notify_state_change (ATK_OBJECT (icon), ATK_STATE_DEFUNCT, TRUE);
}
}
static AtkObject *
gtk_entry_icon_accessible_new (GtkEntryAccessible *entry,
GtkEntryIconPosition pos)
{
GtkEntryIconAccessible *icon;
AtkObject *accessible;
icon = g_object_new (_gtk_entry_icon_accessible_get_type (), NULL);
icon->entry = entry;
g_object_weak_ref (G_OBJECT (entry),
gtk_entry_icon_accessible_remove_entry,
icon);
icon->pos = pos;
accessible = ATK_OBJECT (icon);
atk_object_initialize (accessible, NULL);
return accessible;
}
static void
_gtk_entry_icon_accessible_init (GtkEntryIconAccessible *icon)
{
}
static void
gtk_entry_icon_accessible_initialize (AtkObject *obj,
gpointer data)
{
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (obj);
GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
GtkEntry *gtk_entry = GTK_ENTRY (widget);
const gchar *name;
gchar *text;
ATK_OBJECT_CLASS (_gtk_entry_icon_accessible_parent_class)->initialize (obj, data);
atk_object_set_role (obj, ATK_ROLE_ICON);
name = gtk_entry_get_icon_name (gtk_entry, icon->pos);
if (name)
atk_object_set_name (obj, name);
text = gtk_entry_get_icon_tooltip_text (gtk_entry, icon->pos);
if (text)
{
atk_object_set_description (obj, text);
g_free (text);
}
atk_object_set_parent (obj, ATK_OBJECT (icon->entry));
}
static AtkObject *
gtk_entry_icon_accessible_get_parent (AtkObject *accessible)
{
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (accessible);
return ATK_OBJECT (icon->entry);
}
static AtkStateSet *
gtk_entry_icon_accessible_ref_state_set (AtkObject *accessible)
{
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (accessible);
AtkStateSet *set = atk_state_set_new ();
AtkStateSet *entry_set;
GtkWidget *widget;
GtkEntry *gtk_entry;
if (!icon->entry)
{
atk_state_set_add_state (set, ATK_STATE_DEFUNCT);
return set;
}
entry_set = atk_object_ref_state_set (ATK_OBJECT (icon->entry));
if (!entry_set || atk_state_set_contains_state (entry_set, ATK_STATE_DEFUNCT))
{
atk_state_set_add_state (set, ATK_STATE_DEFUNCT);
g_clear_object (&entry_set);
return set;
}
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
gtk_entry = GTK_ENTRY (widget);
if (atk_state_set_contains_state (entry_set, ATK_STATE_ENABLED))
atk_state_set_add_state (set, ATK_STATE_ENABLED);
if (atk_state_set_contains_state (entry_set, ATK_STATE_SENSITIVE))
atk_state_set_add_state (set, ATK_STATE_SENSITIVE);
if (atk_state_set_contains_state (entry_set, ATK_STATE_SHOWING))
atk_state_set_add_state (set, ATK_STATE_SHOWING);
if (atk_state_set_contains_state (entry_set, ATK_STATE_VISIBLE))
atk_state_set_add_state (set, ATK_STATE_VISIBLE);
if (!gtk_entry_get_icon_sensitive (gtk_entry, icon->pos))
atk_state_set_remove_state (set, ATK_STATE_SENSITIVE);
if (!gtk_entry_get_icon_activatable (gtk_entry, icon->pos))
atk_state_set_remove_state (set, ATK_STATE_ENABLED);
g_object_unref (entry_set);
return set;
}
static void
gtk_entry_icon_accessible_invalidate (GtkEntryIconAccessible *icon)
{
if (!icon->entry)
return;
g_object_weak_unref (G_OBJECT (icon->entry),
gtk_entry_icon_accessible_remove_entry,
icon);
gtk_entry_icon_accessible_remove_entry (icon, NULL);
}
static void
gtk_entry_icon_accessible_finalize (GObject *object)
{
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (object);
gtk_entry_icon_accessible_invalidate (icon);
G_OBJECT_CLASS (_gtk_entry_icon_accessible_parent_class)->finalize (object);
}
static void
_gtk_entry_icon_accessible_class_init (GtkEntryIconAccessibleClass *klass)
{
AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
atk_class->initialize = gtk_entry_icon_accessible_initialize;
atk_class->get_parent = gtk_entry_icon_accessible_get_parent;
atk_class->ref_state_set = gtk_entry_icon_accessible_ref_state_set;
gobject_class->finalize = gtk_entry_icon_accessible_finalize;
}
static gboolean
gtk_entry_icon_accessible_do_action (AtkAction *action,
gint i)
{
GtkEntryIconAccessible *icon = (GtkEntryIconAccessible *)action;
GtkWidget *widget;
GtkEntry *gtk_entry;
GdkEvent event;
GdkRectangle icon_area;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
if (widget == NULL)
return FALSE;
if (i != 0)
return FALSE;
if (!gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
return FALSE;
gtk_entry = GTK_ENTRY (widget);
if (!gtk_entry_get_icon_sensitive (gtk_entry, icon->pos) ||
!gtk_entry_get_icon_activatable (gtk_entry, icon->pos))
return FALSE;
gtk_entry_get_icon_area (gtk_entry, icon->pos, &icon_area);
memset (&event, 0, sizeof (event));
event.button.type = GDK_BUTTON_PRESS;
event.button.window = gtk_widget_get_window (widget);
event.button.button = 1;
event.button.send_event = TRUE;
event.button.time = GDK_CURRENT_TIME;
event.button.x = icon_area.x;
event.button.y = icon_area.y;
g_signal_emit_by_name (widget, "icon-press", 0, icon->pos, &event);
return TRUE;
}
static gint
gtk_entry_icon_accessible_get_n_actions (AtkAction *action)
{
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (action);
GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
GtkEntry *gtk_entry = GTK_ENTRY (widget);
return (gtk_entry_get_icon_activatable (gtk_entry, icon->pos) ? 1 : 0);
}
static const gchar *
gtk_entry_icon_accessible_get_name (AtkAction *action,
gint i)
{
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (action);
GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
GtkEntry *gtk_entry = GTK_ENTRY (widget);
if (i != 0)
return NULL;
if (!gtk_entry_get_icon_activatable (gtk_entry, icon->pos))
return NULL;
return "activate";
}
static void
icon_atk_action_interface_init (AtkActionIface *iface)
{
iface->do_action = gtk_entry_icon_accessible_do_action;
iface->get_n_actions = gtk_entry_icon_accessible_get_n_actions;
iface->get_name = gtk_entry_icon_accessible_get_name;
}
static void
gtk_entry_icon_accessible_get_extents (AtkComponent *component,
gint *x,
gint *y,
gint *width,
gint *height,
AtkCoordType coord_type)
{
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (component);
GdkRectangle icon_area;
GtkEntry *gtk_entry;
GtkWidget *widget;
*x = G_MININT;
atk_component_get_extents (ATK_COMPONENT (icon->entry), x, y, width, height,
coord_type);
if (*x == G_MININT)
return;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
gtk_entry = GTK_ENTRY (widget);
gtk_entry_get_icon_area (gtk_entry, icon->pos, &icon_area);
*width = icon_area.width;
*height = icon_area.height;
*x += icon_area.x;
*y += icon_area.y;
}
static void
gtk_entry_icon_accessible_get_position (AtkComponent *component,
gint *x,
gint *y,
AtkCoordType coord_type)
{
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (component);
GdkRectangle icon_area;
GtkEntry *gtk_entry;
GtkWidget *widget;
*x = G_MININT;
atk_component_get_position (ATK_COMPONENT (icon->entry), x, y, coord_type);
if (*x == G_MININT)
return;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
gtk_entry = GTK_ENTRY (widget);
gtk_entry_get_icon_area (gtk_entry, icon->pos, &icon_area);
*x += icon_area.x;
*y += icon_area.y;
}
static void
gtk_entry_icon_accessible_get_size (AtkComponent *component,
gint *width,
gint *height)
{
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (component);
GdkRectangle icon_area;
GtkEntry *gtk_entry;
GtkWidget *widget;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
gtk_entry = GTK_ENTRY (widget);
gtk_entry_get_icon_area (gtk_entry, icon->pos, &icon_area);
*width = icon_area.width;
*height = icon_area.height;
}
static void
icon_atk_component_interface_init (AtkComponentIface *iface)
{
iface->get_extents = gtk_entry_icon_accessible_get_extents;
iface->get_size = gtk_entry_icon_accessible_get_size;
iface->get_position = gtk_entry_icon_accessible_get_position;
}
/* Callbacks */ /* Callbacks */
static void insert_text_cb (GtkEditable *editable, static void insert_text_cb (GtkEditable *editable,
@@ -109,10 +448,9 @@ gtk_entry_accessible_initialize (AtkObject *obj,
gtk_entry_accessible = GTK_ENTRY_ACCESSIBLE (obj); gtk_entry_accessible = GTK_ENTRY_ACCESSIBLE (obj);
entry = GTK_ENTRY (data); entry = GTK_ENTRY (data);
gtk_editable_get_selection_bounds (GTK_EDITABLE (entry), gtk_editable_get_selection_bounds (GTK_EDITABLE (entry), &start_pos, &end_pos);
&start_pos, &end_pos); gtk_entry_accessible->priv->cursor_position = end_pos;
gtk_entry_accessible->cursor_position = end_pos; gtk_entry_accessible->priv->selection_bound = start_pos;
gtk_entry_accessible->selection_bound = start_pos;
/* Set up signal callbacks */ /* Set up signal callbacks */
g_signal_connect (entry, "insert-text", G_CALLBACK (insert_text_cb), NULL); g_signal_connect (entry, "insert-text", G_CALLBACK (insert_text_cb), NULL);
@@ -132,11 +470,13 @@ gtk_entry_accessible_notify_gtk (GObject *obj,
AtkObject* atk_obj; AtkObject* atk_obj;
GtkEntry* gtk_entry; GtkEntry* gtk_entry;
GtkEntryAccessible* entry; GtkEntryAccessible* entry;
GtkEntryAccessiblePrivate *priv;
widget = GTK_WIDGET (obj); widget = GTK_WIDGET (obj);
atk_obj = gtk_widget_get_accessible (widget); atk_obj = gtk_widget_get_accessible (widget);
gtk_entry = GTK_ENTRY (widget); gtk_entry = GTK_ENTRY (widget);
entry = GTK_ENTRY_ACCESSIBLE (atk_obj); entry = GTK_ENTRY_ACCESSIBLE (atk_obj);
priv = entry->priv;
if (g_strcmp0 (pspec->name, "cursor-position") == 0) if (g_strcmp0 (pspec->name, "cursor-position") == 0)
{ {
@@ -146,7 +486,7 @@ gtk_entry_accessible_notify_gtk (GObject *obj,
* The entry cursor position has moved so generate the signal. * The entry cursor position has moved so generate the signal.
*/ */
g_signal_emit_by_name (atk_obj, "text-caret-moved", g_signal_emit_by_name (atk_obj, "text-caret-moved",
entry->cursor_position); entry->priv->cursor_position);
} }
else if (g_strcmp0 (pspec->name, "selection-bound") == 0) else if (g_strcmp0 (pspec->name, "selection-bound") == 0)
{ {
@@ -169,6 +509,119 @@ gtk_entry_accessible_notify_gtk (GObject *obj,
new_role = visibility ? ATK_ROLE_TEXT : ATK_ROLE_PASSWORD_TEXT; new_role = visibility ? ATK_ROLE_TEXT : ATK_ROLE_PASSWORD_TEXT;
atk_object_set_role (atk_obj, new_role); atk_object_set_role (atk_obj, new_role);
} }
else if (g_strcmp0 (pspec->name, "primary-icon-storage-type") == 0)
{
if (gtk_entry_get_icon_storage_type (gtk_entry, GTK_ENTRY_ICON_PRIMARY) != GTK_IMAGE_EMPTY && !priv->icons[GTK_ENTRY_ICON_PRIMARY])
{
priv->icons[GTK_ENTRY_ICON_PRIMARY] = gtk_entry_icon_accessible_new (entry, GTK_ENTRY_ICON_PRIMARY);
g_signal_emit_by_name (entry, "children-changed::add", 0,
priv->icons[GTK_ENTRY_ICON_PRIMARY], NULL);
}
else if (gtk_entry_get_icon_storage_type (gtk_entry, GTK_ENTRY_ICON_PRIMARY) == GTK_IMAGE_EMPTY && priv->icons[GTK_ENTRY_ICON_PRIMARY])
{
gtk_entry_icon_accessible_invalidate (GTK_ENTRY_ICON_ACCESSIBLE (priv->icons[GTK_ENTRY_ICON_PRIMARY]));
g_signal_emit_by_name (entry, "children-changed::remove", 0,
priv->icons[GTK_ENTRY_ICON_PRIMARY], NULL);
g_clear_object (&priv->icons[GTK_ENTRY_ICON_PRIMARY]);
}
}
else if (g_strcmp0 (pspec->name, "secondary-icon-storage-type") == 0)
{
gint index = (priv->icons[GTK_ENTRY_ICON_PRIMARY] ? 1 : 0);
if (gtk_entry_get_icon_storage_type (gtk_entry, GTK_ENTRY_ICON_SECONDARY) != GTK_IMAGE_EMPTY && !priv->icons[GTK_ENTRY_ICON_SECONDARY])
{
priv->icons[GTK_ENTRY_ICON_SECONDARY] = gtk_entry_icon_accessible_new (entry, GTK_ENTRY_ICON_SECONDARY);
g_signal_emit_by_name (entry, "children-changed::add", index,
priv->icons[GTK_ENTRY_ICON_SECONDARY], NULL);
}
else if (gtk_entry_get_icon_storage_type (gtk_entry, GTK_ENTRY_ICON_SECONDARY) == GTK_IMAGE_EMPTY && priv->icons[GTK_ENTRY_ICON_SECONDARY])
{
gtk_entry_icon_accessible_invalidate (GTK_ENTRY_ICON_ACCESSIBLE (priv->icons[GTK_ENTRY_ICON_SECONDARY]));
g_signal_emit_by_name (entry, "children-changed::remove", index,
priv->icons[GTK_ENTRY_ICON_SECONDARY], NULL);
g_clear_object (&priv->icons[GTK_ENTRY_ICON_SECONDARY]);
}
}
else if (g_strcmp0 (pspec->name, "primary-icon-name") == 0)
{
if (priv->icons[GTK_ENTRY_ICON_PRIMARY])
{
const gchar *name;
name = gtk_entry_get_icon_name (gtk_entry,
GTK_ENTRY_ICON_PRIMARY);
atk_object_set_name (priv->icons[GTK_ENTRY_ICON_PRIMARY], name);
}
}
else if (g_strcmp0 (pspec->name, "secondary-icon-name") == 0)
{
if (priv->icons[GTK_ENTRY_ICON_SECONDARY])
{
const gchar *name;
name = gtk_entry_get_icon_name (gtk_entry,
GTK_ENTRY_ICON_SECONDARY);
atk_object_set_name (priv->icons[GTK_ENTRY_ICON_SECONDARY], name);
}
}
else if (g_strcmp0 (pspec->name, "primary-icon-tooltip-text") == 0)
{
if (priv->icons[GTK_ENTRY_ICON_PRIMARY])
{
gchar *text;
text = gtk_entry_get_icon_tooltip_text (gtk_entry,
GTK_ENTRY_ICON_PRIMARY);
atk_object_set_description (priv->icons[GTK_ENTRY_ICON_PRIMARY],
text);
g_free (text);
}
}
else if (g_strcmp0 (pspec->name, "secondary-icon-tooltip-text") == 0)
{
if (priv->icons[GTK_ENTRY_ICON_SECONDARY])
{
gchar *text;
text = gtk_entry_get_icon_tooltip_text (gtk_entry,
GTK_ENTRY_ICON_SECONDARY);
atk_object_set_description (priv->icons[GTK_ENTRY_ICON_SECONDARY],
text);
g_free (text);
}
}
else if (g_strcmp0 (pspec->name, "primary-icon-activatable") == 0)
{
if (priv->icons[GTK_ENTRY_ICON_PRIMARY])
{
gboolean on = gtk_entry_get_icon_activatable (gtk_entry, GTK_ENTRY_ICON_PRIMARY);
atk_object_notify_state_change (priv->icons[GTK_ENTRY_ICON_PRIMARY],
ATK_STATE_ENABLED, on);
}
}
else if (g_strcmp0 (pspec->name, "secondary-icon-activatable") == 0)
{
if (priv->icons[GTK_ENTRY_ICON_SECONDARY])
{
gboolean on = gtk_entry_get_icon_activatable (gtk_entry, GTK_ENTRY_ICON_SECONDARY);
atk_object_notify_state_change (priv->icons[GTK_ENTRY_ICON_SECONDARY],
ATK_STATE_ENABLED, on);
}
}
else if (g_strcmp0 (pspec->name, "primary-icon-sensitive") == 0)
{
if (priv->icons[GTK_ENTRY_ICON_PRIMARY])
{
gboolean on = gtk_entry_get_icon_sensitive (gtk_entry, GTK_ENTRY_ICON_PRIMARY);
atk_object_notify_state_change (priv->icons[GTK_ENTRY_ICON_PRIMARY],
ATK_STATE_SENSITIVE, on);
}
}
else if (g_strcmp0 (pspec->name, "secondary-icon-sensitive") == 0)
{
if (priv->icons[GTK_ENTRY_ICON_SECONDARY])
{
gboolean on = gtk_entry_get_icon_sensitive (gtk_entry, GTK_ENTRY_ICON_SECONDARY);
atk_object_notify_state_change (priv->icons[GTK_ENTRY_ICON_SECONDARY],
ATK_STATE_SENSITIVE, on);
}
}
else else
GTK_WIDGET_ACCESSIBLE_CLASS (_gtk_entry_accessible_parent_class)->notify_gtk (obj, pspec); GTK_WIDGET_ACCESSIBLE_CLASS (_gtk_entry_accessible_parent_class)->notify_gtk (obj, pspec);
} }
@@ -187,25 +640,109 @@ gtk_entry_accessible_get_index_in_parent (AtkObject *accessible)
return ATK_OBJECT_CLASS (_gtk_entry_accessible_parent_class)->get_index_in_parent (accessible); return ATK_OBJECT_CLASS (_gtk_entry_accessible_parent_class)->get_index_in_parent (accessible);
} }
static gint
gtk_entry_accessible_get_n_children (AtkObject* obj)
{
GtkWidget *widget;
GtkEntry *entry;
gint count = 0;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
if (widget == NULL)
return 0;
entry = GTK_ENTRY (widget);
if (gtk_entry_get_icon_storage_type (entry, GTK_ENTRY_ICON_PRIMARY) != GTK_IMAGE_EMPTY)
count++;
if (gtk_entry_get_icon_storage_type (entry, GTK_ENTRY_ICON_SECONDARY) != GTK_IMAGE_EMPTY)
count++;
return count;
}
static AtkObject *
gtk_entry_accessible_ref_child (AtkObject *obj,
gint i)
{
GtkEntryAccessible *accessible = GTK_ENTRY_ACCESSIBLE (obj);
GtkEntryAccessiblePrivate *priv = accessible->priv;
GtkWidget *widget;
GtkEntry *entry;
GtkEntryIconPosition pos;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
if (widget == NULL)
return NULL;
entry = GTK_ENTRY (widget);
switch (i)
{
case 0:
if (gtk_entry_get_icon_storage_type (entry, GTK_ENTRY_ICON_PRIMARY) != GTK_IMAGE_EMPTY)
pos = GTK_ENTRY_ICON_PRIMARY;
else if (gtk_entry_get_icon_storage_type (entry, GTK_ENTRY_ICON_SECONDARY) != GTK_IMAGE_EMPTY)
pos = GTK_ENTRY_ICON_SECONDARY;
else
return NULL;
break;
case 1:
if (gtk_entry_get_icon_storage_type (entry, GTK_ENTRY_ICON_PRIMARY) == GTK_IMAGE_EMPTY)
return NULL;
if (gtk_entry_get_icon_storage_type (entry, GTK_ENTRY_ICON_SECONDARY) == GTK_IMAGE_EMPTY)
return NULL;
pos = GTK_ENTRY_ICON_SECONDARY;
break;
default:
return NULL;
}
if (!priv->icons[pos])
priv->icons[pos] = gtk_entry_icon_accessible_new (accessible, pos);
return g_object_ref (priv->icons[pos]);
}
static void
gtk_entry_accessible_finalize (GObject *object)
{
GtkEntryAccessible *entry = GTK_ENTRY_ACCESSIBLE (object);
GtkEntryAccessiblePrivate *priv = entry->priv;
g_clear_object (&priv->icons[GTK_ENTRY_ICON_PRIMARY]);
g_clear_object (&priv->icons[GTK_ENTRY_ICON_SECONDARY]);
G_OBJECT_CLASS (_gtk_entry_accessible_parent_class)->finalize (object);
}
static void static void
_gtk_entry_accessible_class_init (GtkEntryAccessibleClass *klass) _gtk_entry_accessible_class_init (GtkEntryAccessibleClass *klass)
{ {
AtkObjectClass *class = ATK_OBJECT_CLASS (klass); AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
GtkWidgetAccessibleClass *widget_class = (GtkWidgetAccessibleClass*)klass; GtkWidgetAccessibleClass *widget_class = (GtkWidgetAccessibleClass*)klass;
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
class->ref_state_set = gtk_entry_accessible_ref_state_set; class->ref_state_set = gtk_entry_accessible_ref_state_set;
class->get_index_in_parent = gtk_entry_accessible_get_index_in_parent; class->get_index_in_parent = gtk_entry_accessible_get_index_in_parent;
class->initialize = gtk_entry_accessible_initialize; class->initialize = gtk_entry_accessible_initialize;
class->get_attributes = gtk_entry_accessible_get_attributes; class->get_attributes = gtk_entry_accessible_get_attributes;
class->get_n_children = gtk_entry_accessible_get_n_children;
class->ref_child = gtk_entry_accessible_ref_child;
widget_class->notify_gtk = gtk_entry_accessible_notify_gtk; widget_class->notify_gtk = gtk_entry_accessible_notify_gtk;
gobject_class->finalize = gtk_entry_accessible_finalize;
g_type_class_add_private (klass, sizeof (GtkEntryAccessiblePrivate));
} }
static void static void
_gtk_entry_accessible_init (GtkEntryAccessible *entry) _gtk_entry_accessible_init (GtkEntryAccessible *entry)
{ {
entry->cursor_position = 0; entry->priv = G_TYPE_INSTANCE_GET_PRIVATE (entry,
entry->selection_bound = 0; GTK_TYPE_ENTRY_ACCESSIBLE,
GtkEntryAccessiblePrivate);
entry->priv->cursor_position = 0;
entry->priv->selection_bound = 0;
} }
static gchar * static gchar *
@@ -889,8 +1426,8 @@ check_for_selection_change (GtkEntryAccessible *accessible,
if (gtk_editable_get_selection_bounds (GTK_EDITABLE (entry), &start, &end)) if (gtk_editable_get_selection_bounds (GTK_EDITABLE (entry), &start, &end))
{ {
if (end != accessible->cursor_position || if (end != accessible->priv->cursor_position ||
start != accessible->selection_bound) start != accessible->priv->selection_bound)
/* /*
* This check is here as this function can be called * This check is here as this function can be called
* for notification of selection_bound and current_pos. * for notification of selection_bound and current_pos.
@@ -903,11 +1440,11 @@ check_for_selection_change (GtkEntryAccessible *accessible,
else else
{ {
/* We had a selection */ /* We had a selection */
ret_val = (accessible->cursor_position != accessible->selection_bound); ret_val = (accessible->priv->cursor_position != accessible->priv->selection_bound);
} }
accessible->cursor_position = end; accessible->priv->cursor_position = end;
accessible->selection_bound = start; accessible->priv->selection_bound = start;
return ret_val; return ret_val;
} }

View File

@@ -29,15 +29,15 @@ G_BEGIN_DECLS
#define GTK_IS_ENTRY_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ENTRY_ACCESSIBLE)) #define GTK_IS_ENTRY_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ENTRY_ACCESSIBLE))
#define GTK_ENTRY_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ENTRY_ACCESSIBLE, GtkEntryAccessibleClass)) #define GTK_ENTRY_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ENTRY_ACCESSIBLE, GtkEntryAccessibleClass))
typedef struct _GtkEntryAccessible GtkEntryAccessible; typedef struct _GtkEntryAccessible GtkEntryAccessible;
typedef struct _GtkEntryAccessibleClass GtkEntryAccessibleClass; typedef struct _GtkEntryAccessibleClass GtkEntryAccessibleClass;
typedef struct _GtkEntryAccessiblePrivate GtkEntryAccessiblePrivate;
struct _GtkEntryAccessible struct _GtkEntryAccessible
{ {
GtkWidgetAccessible parent; GtkWidgetAccessible parent;
gint cursor_position; GtkEntryAccessiblePrivate *priv;
gint selection_bound;
}; };
struct _GtkEntryAccessibleClass struct _GtkEntryAccessibleClass

View File

@@ -29,12 +29,15 @@ G_BEGIN_DECLS
#define GTK_IS_EXPANDER_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_EXPANDER_ACCESSIBLE)) #define GTK_IS_EXPANDER_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_EXPANDER_ACCESSIBLE))
#define GTK_EXPANDER_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_EXPANDER_ACCESSIBLE, GtkExpanderAccessibleClass)) #define GTK_EXPANDER_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_EXPANDER_ACCESSIBLE, GtkExpanderAccessibleClass))
typedef struct _GtkExpanderAccessible GtkExpanderAccessible; typedef struct _GtkExpanderAccessible GtkExpanderAccessible;
typedef struct _GtkExpanderAccessibleClass GtkExpanderAccessibleClass; typedef struct _GtkExpanderAccessibleClass GtkExpanderAccessibleClass;
typedef struct _GtkExpanderAccessiblePrivate GtkExpanderAccessiblePrivate;
struct _GtkExpanderAccessible struct _GtkExpanderAccessible
{ {
GtkContainerAccessible parent; GtkContainerAccessible parent;
GtkExpanderAccessiblePrivate *priv;
}; };
struct _GtkExpanderAccessibleClass struct _GtkExpanderAccessibleClass

View File

@@ -29,12 +29,15 @@ G_BEGIN_DECLS
#define GTK_IS_FRAME_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FRAME_ACCESSIBLE)) #define GTK_IS_FRAME_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FRAME_ACCESSIBLE))
#define GTK_FRAME_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FRAME_ACCESSIBLE, GtkFrameAccessibleClass)) #define GTK_FRAME_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FRAME_ACCESSIBLE, GtkFrameAccessibleClass))
typedef struct _GtkFrameAccessible GtkFrameAccessible; typedef struct _GtkFrameAccessible GtkFrameAccessible;
typedef struct _GtkFrameAccessibleClass GtkFrameAccessibleClass; typedef struct _GtkFrameAccessibleClass GtkFrameAccessibleClass;
typedef struct _GtkFrameAccessiblePrivate GtkFrameAccessiblePrivate;
struct _GtkFrameAccessible struct _GtkFrameAccessible
{ {
GtkContainerAccessible parent; GtkContainerAccessible parent;
GtkFrameAccessiblePrivate *priv;
}; };
struct _GtkFrameAccessibleClass struct _GtkFrameAccessibleClass

View File

@@ -32,6 +32,12 @@
#define GTK_ICON_VIEW_ITEM_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ICON_VIEW_ITEM_ACCESSIBLE, GtkIconViewItemAccessible)) #define GTK_ICON_VIEW_ITEM_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ICON_VIEW_ITEM_ACCESSIBLE, GtkIconViewItemAccessible))
#define GTK_IS_ICON_VIEW_ITEM_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ICON_VIEW_ITEM_ACCESSIBLE)) #define GTK_IS_ICON_VIEW_ITEM_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ICON_VIEW_ITEM_ACCESSIBLE))
struct _GtkIconViewAccessiblePrivate
{
GList *items;
GtkTreeModel *model;
};
typedef struct typedef struct
{ {
AtkObject parent; AtkObject parent;
@@ -51,6 +57,8 @@ typedef struct
} GtkIconViewItemAccessibleClass; } GtkIconViewItemAccessibleClass;
GType _gtk_icon_view_item_accessible_get_type (void);
static gboolean gtk_icon_view_item_accessible_is_showing (GtkIconViewItemAccessible *item); static gboolean gtk_icon_view_item_accessible_is_showing (GtkIconViewItemAccessible *item);
static void atk_component_item_interface_init (AtkComponentIface *iface); static void atk_component_item_interface_init (AtkComponentIface *iface);
@@ -866,7 +874,7 @@ gtk_icon_view_item_accessible_info_new (AtkObject *accessible,
info->item = item; info->item = item;
info->index = index; info->index = index;
items = view->items; items = view->priv->items;
while (items) while (items)
{ {
tmp_info = items->data; tmp_info = items->data;
@@ -874,7 +882,7 @@ gtk_icon_view_item_accessible_info_new (AtkObject *accessible,
break; break;
items = items->next; items = items->next;
} }
view->items = g_list_insert_before (view->items, items, info); view->priv->items = g_list_insert_before (view->priv->items, items, info);
} }
static gint static gint
@@ -900,7 +908,7 @@ gtk_icon_view_accessible_find_child (AtkObject *accessible,
GtkIconViewItemAccessibleInfo *info; GtkIconViewItemAccessibleInfo *info;
GList *items; GList *items;
items = view->items; items = view->priv->items;
while (items) while (items)
{ {
@@ -964,7 +972,7 @@ gtk_icon_view_accessible_traverse_items (GtkIconViewAccessible *view,
GtkIconViewItemAccessible *item; GtkIconViewItemAccessible *item;
GList *items; GList *items;
if (view->items) if (view->priv->items)
{ {
GtkWidget *widget; GtkWidget *widget;
gboolean act_on_item; gboolean act_on_item;
@@ -973,7 +981,7 @@ gtk_icon_view_accessible_traverse_items (GtkIconViewAccessible *view,
if (widget == NULL) if (widget == NULL)
return; return;
items = view->items; items = view->priv->items;
act_on_item = (list == NULL); act_on_item = (list == NULL);
@@ -1062,7 +1070,7 @@ gtk_icon_view_accessible_model_row_inserted (GtkTreeModel *tree_model,
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (user_data)); atk_obj = gtk_widget_get_accessible (GTK_WIDGET (user_data));
view = GTK_ICON_VIEW_ACCESSIBLE (atk_obj); view = GTK_ICON_VIEW_ACCESSIBLE (atk_obj);
items = view->items; items = view->priv->items;
tmp_list = NULL; tmp_list = NULL;
while (items) while (items)
{ {
@@ -1105,7 +1113,7 @@ gtk_icon_view_accessible_model_row_deleted (GtkTreeModel *tree_model,
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (user_data)); atk_obj = gtk_widget_get_accessible (GTK_WIDGET (user_data));
view = GTK_ICON_VIEW_ACCESSIBLE (atk_obj); view = GTK_ICON_VIEW_ACCESSIBLE (atk_obj);
items = view->items; items = view->priv->items;
tmp_list = NULL; tmp_list = NULL;
deleted_item = NULL; deleted_item = NULL;
info = NULL; info = NULL;
@@ -1134,7 +1142,7 @@ gtk_icon_view_accessible_model_row_deleted (GtkTreeModel *tree_model,
gtk_icon_view_item_accessible_add_state (GTK_ICON_VIEW_ITEM_ACCESSIBLE (info->item), ATK_STATE_DEFUNCT, TRUE); gtk_icon_view_item_accessible_add_state (GTK_ICON_VIEW_ITEM_ACCESSIBLE (info->item), ATK_STATE_DEFUNCT, TRUE);
g_signal_emit_by_name (atk_obj, "children-changed::remove", g_signal_emit_by_name (atk_obj, "children-changed::remove",
index, NULL, NULL); index, NULL, NULL);
view->items = g_list_remove_link (view->items, deleted_item); view->priv->items = g_list_remove_link (view->priv->items, deleted_item);
g_free (info); g_free (info);
} }
@@ -1174,7 +1182,7 @@ gtk_icon_view_accessible_model_rows_reordered (GtkTreeModel *tree_model,
for (i = 0; i < length; i++) for (i = 0; i < length; i++)
order [new_order[i]] = i; order [new_order[i]] = i;
items = view->items; items = view->priv->items;
while (items) while (items)
{ {
info = items->data; info = items->data;
@@ -1184,8 +1192,8 @@ gtk_icon_view_accessible_model_rows_reordered (GtkTreeModel *tree_model,
items = items->next; items = items->next;
} }
g_free (order); g_free (order);
view->items = g_list_sort (view->items, view->priv->items = g_list_sort (view->priv->items,
(GCompareFunc)gtk_icon_view_accessible_item_compare); (GCompareFunc)gtk_icon_view_accessible_item_compare);
return; return;
} }
@@ -1229,7 +1237,7 @@ gtk_icon_view_accessible_clear_cache (GtkIconViewAccessible *view)
GtkIconViewItemAccessibleInfo *info; GtkIconViewItemAccessibleInfo *info;
GList *items; GList *items;
items = view->items; items = view->priv->items;
while (items) while (items)
{ {
info = (GtkIconViewItemAccessibleInfo *) items->data; info = (GtkIconViewItemAccessibleInfo *) items->data;
@@ -1237,8 +1245,8 @@ gtk_icon_view_accessible_clear_cache (GtkIconViewAccessible *view)
g_free (items->data); g_free (items->data);
items = items->next; items = items->next;
} }
g_list_free (view->items); g_list_free (view->priv->items);
view->items = NULL; view->priv->items = NULL;
} }
static void static void
@@ -1255,20 +1263,20 @@ gtk_icon_view_accessible_notify_gtk (GObject *obj,
widget = GTK_WIDGET (obj); widget = GTK_WIDGET (obj);
atk_obj = gtk_widget_get_accessible (widget); atk_obj = gtk_widget_get_accessible (widget);
view = (GtkIconViewAccessible*)atk_obj; view = (GtkIconViewAccessible*)atk_obj;
if (view->model) if (view->priv->model)
{ {
g_object_remove_weak_pointer (G_OBJECT (view->model), g_object_remove_weak_pointer (G_OBJECT (view->priv->model),
(gpointer *)&view->model); (gpointer *)&view->priv->model);
gtk_icon_view_accessible_disconnect_model_signals (view->model, widget); gtk_icon_view_accessible_disconnect_model_signals (view->priv->model, widget);
} }
gtk_icon_view_accessible_clear_cache (view); gtk_icon_view_accessible_clear_cache (view);
icon_view = GTK_ICON_VIEW (obj); icon_view = GTK_ICON_VIEW (obj);
view->model = icon_view->priv->model; view->priv->model = icon_view->priv->model;
/* If there is no model the GtkIconView is probably being destroyed */ /* If there is no model the GtkIconView is probably being destroyed */
if (view->model) if (view->priv->model)
{ {
g_object_add_weak_pointer (G_OBJECT (view->model), (gpointer *)&view->model); g_object_add_weak_pointer (G_OBJECT (view->priv->model), (gpointer *)&view->priv->model);
gtk_icon_view_accessible_connect_model_signals (icon_view); gtk_icon_view_accessible_connect_model_signals (icon_view);
} }
} }
@@ -1292,10 +1300,10 @@ gtk_icon_view_accessible_initialize (AtkObject *accessible,
g_signal_connect (data, "notify", g_signal_connect (data, "notify",
G_CALLBACK (gtk_icon_view_accessible_notify_gtk), NULL); G_CALLBACK (gtk_icon_view_accessible_notify_gtk), NULL);
view->model = icon_view->priv->model; view->priv->model = icon_view->priv->model;
if (view->model) if (view->priv->model)
{ {
g_object_add_weak_pointer (G_OBJECT (view->model), (gpointer *)&view->model); g_object_add_weak_pointer (G_OBJECT (view->priv->model), (gpointer *)&view->priv->model);
gtk_icon_view_accessible_connect_model_signals (icon_view); gtk_icon_view_accessible_connect_model_signals (icon_view);
} }
@@ -1326,11 +1334,16 @@ _gtk_icon_view_accessible_class_init (GtkIconViewAccessibleClass *klass)
atk_class->get_n_children = gtk_icon_view_accessible_get_n_children; atk_class->get_n_children = gtk_icon_view_accessible_get_n_children;
atk_class->ref_child = gtk_icon_view_accessible_ref_child; atk_class->ref_child = gtk_icon_view_accessible_ref_child;
atk_class->initialize = gtk_icon_view_accessible_initialize; atk_class->initialize = gtk_icon_view_accessible_initialize;
g_type_class_add_private (klass, sizeof (GtkIconViewAccessiblePrivate));
} }
static void static void
_gtk_icon_view_accessible_init (GtkIconViewAccessible *accessible) _gtk_icon_view_accessible_init (GtkIconViewAccessible *accessible)
{ {
accessible->priv = G_TYPE_INSTANCE_GET_PRIVATE (accessible,
GTK_TYPE_ICON_VIEW_ACCESSIBLE,
GtkIconViewAccessiblePrivate);
} }
static AtkObject* static AtkObject*

Some files were not shown because too many files have changed in this diff Show More