Compare commits

..

902 Commits

Author SHA1 Message Date
Benjamin Otte
1af58dc4ee entry: Use cssnodeutils for the widget node 2015-03-22 02:44:41 +01:00
Benjamin Otte
cb1cf06744 cssnodeutils: Implement margins 2015-03-20 18:55:27 +01:00
Benjamin Otte
c5d00ae119 css: Add min-width/height CSS properties
Use them for the minimum size during size requests.
2015-03-20 14:59:36 +01:00
Benjamin Otte
15582ef9c1 entry: Make progressbar a CssNode 2015-03-20 14:59:28 +01:00
Benjamin Otte
0e57785af7 entry: Set insensitive state on icon css node
... instead of doing it on-demand.
2015-03-20 14:59:28 +01:00
Benjamin Otte
52f58f1637 entry: Use the :active state for pressed icons 2015-03-20 14:59:28 +01:00
Benjamin Otte
cd87252130 entry: Set the prelight flag on the CSS node 2015-03-20 14:59:28 +01:00
Benjamin Otte
85d86d61de cssnode: Add gtk_css_node_add/remove_state() API
This mirrors gtk_css_node_add/remove_class() APIs and allows you to
specify a (set of) state(s) to set or unset.

These functions are purely convenience.
2015-03-20 14:59:28 +01:00
Benjamin Otte
0d01ceb415 entry: Prelight icons when pressed
There's no reason to not keep them in the prelight state, theme authors
can override a prelight effect in :active if they want.
2015-03-20 14:59:28 +01:00
Benjamin Otte
aa005486de entry: Ignore the "icon-prelight" style property
Always prelight icons. CSS is powerful enough to let people keep the
appearance the same upon prelight.
2015-03-20 14:59:27 +01:00
Benjamin Otte
cdd26d0d01 entry: Set style classes on entry icons upon state change 2015-03-20 14:59:27 +01:00
Benjamin Otte
f408c59869 entry: Add a cssnode for icons 2015-03-20 14:59:27 +01:00
Benjamin Otte
4326e38b90 cssnode: Make classes APIs string-based
Using quarks is a bad idea now that we are calling the CssNode API
directly.
2015-03-20 14:59:27 +01:00
Benjamin Otte
0f488064a2 box: Port to cssnodeutils 2015-03-20 14:59:27 +01:00
Benjamin Otte
e6c7e038c8 switch: Port to cssnodeutils 2015-03-20 14:59:27 +01:00
Benjamin Otte
18bd973014 cssnodeutils: Add a bunch of utility functions for using nodes
The idea is to wrap size request, size allocation and drawing each into
a function that takes care of the CSS box and then calls a callback to
request/allocate/draw the contents.

The idea is that complex widgets then nest these calls for all the css
nodes they need to handle.
2015-03-20 14:59:27 +01:00
Benjamin Otte
dae2d9ec27 switch: Port to GtkCssNode
This is a simple port, no code modifications so far other than replacing
gtk_style_context_save() with gtk_style_context_save_to_node().
2015-03-20 14:59:27 +01:00
Benjamin Otte
c0c79eee03 stylecontext: Add gtk_style_context_save_to_node()
To be used instead of gtk_style_context_save() with persistent nodes.
2015-03-20 14:59:27 +01:00
Jakub Steiner
3f13349f27 fix insensitive and backdrop states
- checkboxes, labels and buttons were a mixed bag for
  :insensitive and :backdrop

https://bugzilla.gnome.org/show_bug.cgi?id=746188
2015-03-20 13:25:52 +01:00
Matthias Clasen
d6bfc2b9c9 HighContrast: fix insensitive labels
Make insensitive labels differerent from regular labels.

https://bugzilla.gnome.org/show_bug.cgi?id=746493
2015-03-20 06:20:30 -04:00
Matthias Clasen
fa1bb8972a gtk-demo: Plug a memory leak 2015-03-19 22:57:10 -04:00
Matthias Clasen
8e82d0fba2 widget-factory: Fix toolbar on page 3
Set toolbar-style to 'icons' to avoid rectangular buttons.
2015-03-19 19:11:39 -04:00
Kjartan Maraas
7b1ff7c215 Updated Norwegian bokmål translation. 2015-03-19 21:13:10 +01:00
Vadim Rutkovsky
3211e82b59 inspector: show accessible name and description 2015-03-19 17:01:23 +01:00
Carlos Garnacho
6c8c37abbb wayland: Silence warnings on clipboard data sending cancellation
During copy/paste, it may be common that we receive several property changes
around the selection atom, this results in warnings when cancelling the previous
write attempt. We already honor the last request properly, so we should just
cancel silently.
2015-03-19 16:05:04 +01:00
Carlos Garnacho
d5160bb950 wayland: Ensure we re-request the target if the fd changes
If we receive wl_data_source.target before .send, the target would already
be cached, but we'd take no action on the new fd.
2015-03-19 16:05:04 +01:00
Carlos Garnacho
a59fd4a9ad wayland: Don't accept the "TARGETS" target on the wl_data_offer
This is handled separately through the data already cached from the
wl_data_offer.offer handler, we can avoid this request entirely then.
2015-03-19 16:05:04 +01:00
Милош Поповић
4d0e1e0b88 Updated Serbian translation 2015-03-19 13:20:12 +00:00
Benjamin Otte
d48ba486ee Adwaita: Fix context menu shadows not showing up 2015-03-19 03:55:06 +01:00
Bastien Nocera
7dac38f841 inspector: Make it easier to cut'n'paste advice message
The message says "Enable statistics with GOBJECT_DEBUG=instance-count"
but the message itself isn't selectable, making it hard to cut'n'paste.

https://bugzilla.gnome.org/show_bug.cgi?id=746391
2015-03-18 22:05:46 -04:00
Benjamin Otte
ec57c6c10b csspathnode: Handle context going away
Sometimes path nodes can survive longer than the style context that
created them. Don't crash in those cases.

Fixes startup of mutter.

Testcase included.

https://bugzilla.gnome.org/show_bug.cgi?id=746407
2015-03-18 18:24:45 +01:00
Benjamin Otte
d55c261079 inspector: Add a new page that lists the CSS node tree 2015-03-18 15:23:33 +01:00
Benjamin Otte
8640bc47b1 cssnode: Add properties 2015-03-18 15:23:33 +01:00
Benjamin Otte
d0d9f5a302 csswidgetnode: Use style_changed signal instead of update_style vfunc 2015-03-18 15:23:33 +01:00
Benjamin Otte
10d39171d9 cssnode: Add a style-changed signal
The signal gets emitted whenever the style needs to be changed.
2015-03-18 15:23:33 +01:00
Benjamin Otte
6988f9b818 cssnode: Add node-added and node-removed signal
This allows monitoring the CSS tree. For now, moving a child to a
different position relative to its siblings while keeping the same
parent will cause a child-added + child-removed emission.
2015-03-18 15:23:33 +01:00
Benjamin Otte
c7fba52a36 cssnode: Track invalid children
We need to properly track if a node needs to propagate invalidation
state information to its children. We didn't do this properly before and
that could lead to us forgetting to invalidate nodes in corner cases.
2015-03-18 15:23:33 +01:00
Benjamin Otte
7395dddd47 csswidgetnode: Avoid creating a stylecontext
If the widget doesn't have a style context, don't create one. Instead,
call functions on the widget directly.
2015-03-18 15:23:33 +01:00
Benjamin Otte
d785820c53 cssnode: Change the way we invalidate timestamps
Do not propagate the TIMESTAMP change through the node tree, as that
causes lots of uneeded markings of nodes as invalid.

Instead, walk the node tree and find the nodes that have a non-static
style and only invalidate timestamps on those.
2015-03-18 15:23:33 +01:00
Benjamin Otte
759d8dafd9 cssstyle: Add gtk_css_style_is_static()
Gets rid of the need to do

  if (ANIMATED_STYLE() &&
      animated_style_is_static(ANIMATED_STYLE(style))
2015-03-18 15:23:33 +01:00
Benjamin Otte
d9727290cf cssnode: Special-case TIMESTAMP invalidations
Only invalidate timestamps if the node is marked as invalid. We overload
the meaning of "invalid" as "tracks timestamps".

While I don't like the way this is written, it is an important
optimization because 95+% of nodes don't animate so timestamps don't
matter to them. But timestamps are invalidated 60x per second.
2015-03-18 15:23:33 +01:00
Benjamin Otte
68b8f792d6 cssnode: Redo style changed tracking
We don't return a NULL style to mean "no changes" anymore, instead
we check new_style == old_style to mean that.

Make sure the code reflects this, otherwise we'll send
GTK_CSS_CHANGE_PARENT_STYLE invalidations everywhere and screw up
performance.
2015-03-18 15:23:32 +01:00
Benjamin Otte
776d99ac51 stylecontext: Call get_style(), not create_style()
We want to ensure that the style is created properly.

This also allows making the create_Style() function private.
2015-03-18 15:23:32 +01:00
Benjamin Otte
092ff983f7 cssnode: Merge the 2 places that compute styles
Now that the widget node recomputes styles on update_style() we can just
call it during validate(). That way, we don't need the widget node to
manually compute its style.
2015-03-18 15:23:32 +01:00
Benjamin Otte
df51bc836b cssnode: Always return correct style values
If CSS values are queried from a widget, recompute them if necessary. Do
not emit style-updated until the validation phase however.

This way, we don't run into performance traps when style-update causes
invalidations that cause new style-updated to be emitted.
2015-03-18 15:23:32 +01:00
Benjamin Otte
3d1e2a0558 cssstyle: Add optimization
There is no difference between a style and itself.
2015-03-18 15:23:32 +01:00
Benjamin Otte
399df06d19 stylecontext: Refactor gtk_style_context_invalidate()
There's no need anymore to recreate styles, nodes do that automagically
now.

This allows making gtk_css_node_set_style() private.
2015-03-18 15:23:32 +01:00
Benjamin Otte
6dd19306eb cssnode: Create animated styles by default
... and hardcode transient and path nodes to never create animated
styles.
2015-03-18 15:23:32 +01:00
Benjamin Otte
f43543165b cssnode: Add optimization
Don't even try to propagate changes when we know there are none.
2015-03-18 15:23:32 +01:00
Benjamin Otte
2954417335 cssnode: Change the way we start animations
We now have a flag for "invalidate animations", use that to restart
animations and decide if we want to start transitions.
2015-03-18 15:23:32 +01:00
Benjamin Otte
172f345d01 cssnode: Return NULL as frame clock when animations are disabled
This is a crude hack, but it works.

FIXME: Hook it up to the GtkSettings so that we properly update when the
setting changes.
2015-03-18 15:23:32 +01:00
Benjamin Otte
fbe796f293 cssstyle: Handle 0 timestamp to mean "don't animate" 2015-03-18 15:23:32 +01:00
Benjamin Otte
2ec26cd9b5 cssnode: Move style context function to only user 2015-03-18 15:23:32 +01:00
Benjamin Otte
4b2cdb37fb cssnode: Remove timestamp from gtk_css_node_validate()
GtkCssNode knows its own timestamp.
2015-03-18 15:23:32 +01:00
Benjamin Otte
dbe5058b86 cssnode: Add API to query the timestamp
... and pass it to the API that computes new styles.

A special timestamp of 0 means "please don't animate" and is used when
no frame clock is available for a node.
2015-03-18 15:23:32 +01:00
Benjamin Otte
5833858abf cssnode: Make parent style change part of GtkCssNode 2015-03-18 15:23:32 +01:00
Benjamin Otte
ceaa594fa4 cssnode: Propagate pending changes after recomputing new style
This way we can propagate if the new style actually changed anything.
2015-03-18 15:23:32 +01:00
Benjamin Otte
cadf6a9d3c cssnode: Add gtk_css_node_invalidate_style_provider()
This function not just invalidates the current node, but also all
children.
2015-03-18 15:23:32 +01:00
Benjamin Otte
16b8972bee cssnode: Change get_style_provider() vfunc
Instead of always returning a provider, allow the vfunc to return NULL
to mane "use same provider as parent". This allows a bunch of
optimizations.
2015-03-18 15:23:32 +01:00
Benjamin Otte
c0f6e746a0 cssnode: Implement a way to properly track invalidations
See the comment in gtkcssnodeprivate.h for how this works.
2015-03-18 15:23:32 +01:00
Benjamin Otte
13fd368781 cssnode: Change vfunc
This is mainly an attempt to merge the update_style() and validte()
vfuncs. Code is not there yet, but that's the idea.

Also, gtk_css_node_set_style() should not be public. And this gets
closer to that goal, too.
2015-03-18 15:23:31 +01:00
Benjamin Otte
75b633ae08 cssnode: Only pass a boolean for parent changes
Nobody cares what changed in the parent, so don't track it.
2015-03-18 15:23:31 +01:00
Benjamin Otte
da25771e58 cssvalue: Remove GtkCssDependencies
They are not used anymore.
2015-03-18 15:23:31 +01:00
Benjamin Otte
e95985da26 cssstyle: Remove unused optimization
After measuring it, I realized the optimization never triggers for
Adwaita and rarely ever triggers for simple themes. So it is not
useful to keep it around.
2015-03-18 15:23:31 +01:00
Benjamin Otte
6f9969f4fe csswidgetnode: Always return a valid style 2015-03-18 15:23:31 +01:00
Benjamin Otte
b827725ace csspathnode: Call gtk_style_context_validate()
Don't call gtk_style_context_invalidate(), that function does too much
work.
2015-03-18 15:23:31 +01:00
Benjamin Otte
6c00eba7fb testsuite: Add another random stylecontext test 2015-03-18 15:23:31 +01:00
Benjamin Otte
d3471508a0 cssnode: Use the frame clock's time
... nstead of the monotonic time when validating a cssnode.
2015-03-18 15:23:31 +01:00
Benjamin Otte
9b73b39f9a cssnode: Treat transient nodes as invisible nodes
Making transient nodes invisible allows us to remove special cases
without any bad side effects and they continue working just like they
did before.
2015-03-18 15:23:31 +01:00
Benjamin Otte
2670ae4436 reftests: Add a reftest for box sibling ordering 2015-03-18 15:23:31 +01:00
Benjamin Otte
2694545468 cssnode: Add visibility concept
This allows hiding nodes of invisible widgets.
And that in turn makes sure :nth-child() works as expected.
2015-03-18 15:23:31 +01:00
Benjamin Otte
ee91fb71ca box: Use CSS nodes instead of widget paths
This is a very simple patch that causes a bunch of overhead. But it
works.
2015-03-18 15:23:31 +01:00
Benjamin Otte
b92fe2fa85 widget: Add gtk_widget_get_css_node()
and replace gtk_style_context_get_root() with it.
2015-03-18 15:23:31 +01:00
Benjamin Otte
507016cafc cssnode: Refactor node tree modification code
This allows adding more API for it.

It also includes code that tracks modifications and invalidates siblings
and their positions whenever nodes get added or removed.
2015-03-18 15:23:31 +01:00
Benjamin Otte
310f9f40da cssnode: Add hackery to allow bypassing widget paths
If we know the parent's get_path_for_child() implementation is safe to
be used with GtkCssNode because it doesn't do anything special, we do
that. Unfortunately that requires whitelisting vfuncs because the vfunc
is public API so anyone can override it.
2015-03-18 15:23:31 +01:00
Benjamin Otte
ee6d081ed9 cssnode: Remove now unused arg from vfunc 2015-03-18 15:23:31 +01:00
Benjamin Otte
89115be3cb cssnode: Add a matcher for nodes
... and use that matcher by default - ie for transient nodes.
2015-03-18 15:23:31 +01:00
Benjamin Otte
2a5194b635 cssnode: Make widget node not copy the path
Instead, use gtk_widget_get_path() which makes GtkWidget cache the path.
This is a temporary solution until we can get rid of widget paths.

This increases memory usage quite noticably.
2015-03-18 15:23:30 +01:00
Benjamin Otte
2143abe5ee cssnode: Make widget node use new matcher 2015-03-18 15:23:30 +01:00
Benjamin Otte
76ca9a9181 cssnode: Make path node create matcher without copying
... the WidgetPath. This uses the functionality introduced in the
previous commits.
2015-03-18 15:23:30 +01:00
Benjamin Otte
2bf7bdd651 cssmatcher: Allow widget path matcher to take a node declaration
The node declaration has the same functionality as
gtk_css_node_declaration_add_to_widget_path(). So instead of using that
function on a path, you can use the original path and the declaration in
a matcher.
2015-03-18 15:23:30 +01:00
Benjamin Otte
630f0f199e cssnode: Split out a function
So far the vfunc is kinda quirky (the path argument is an out argument
for something you have to free when you're done with the matcher), but
  I'm about to change that.
2015-03-18 15:23:30 +01:00
Benjamin Otte
5df01f9244 widget: Create widget path classes from proper style
We don't want to add the current classes to the widget path - which
might potentially be different after a gtk_style_context_save() - but
the root node's ones. So what better thing to do than actually using the
root node?
2015-03-18 15:23:30 +01:00
Benjamin Otte
5edc6d94d1 widget: Use correct type for widgetpath creation
This is relevant when the widget path is created while the widget is
still constructing. G_OBJECT_TYPE(widget) might not point to the final
type yet.
2015-03-18 15:23:30 +01:00
Benjamin Otte
ffb410f11e widget: Create the CssNode
... and pass it to the style context instead of having the style context
create it for us.
2015-03-18 15:23:30 +01:00
Benjamin Otte
28043f0a92 cssnode: Refactor invalidation propagation
We want to be sure to gtk_css_node_invalidate() all potential changes.
2015-03-18 15:23:30 +01:00
Benjamin Otte
efda30c495 stylecontext: Don't queue animate tick callbacks anymore
Instead, just mark nodes permanently as invalid.
2015-03-18 15:23:30 +01:00
Benjamin Otte
020f3f11c8 cssnode: Handle invalidate queueing differently
Instead of directly requesting the layout phase, register a tick
callback. This is what the docs suggest for animations and it's what we
need for the next commit.
2015-03-18 15:23:30 +01:00
Benjamin Otte
cdd964a3af cssnode: Change way invalidation is handled
Have a queue_validate() vfunc and a dequeue_validate() vfunc that are
called only on root nodes so they can queue a validation on their frame
clocks.
2015-03-18 15:23:30 +01:00
Benjamin Otte
5f19f09ac3 cssnode: Refactor gtk_css_widget_node_validate()
Makes it clearer what actually happens in that function.
2015-03-18 15:23:30 +01:00
Benjamin Otte
caf2fc9a10 cssnode: Only recreate styles when needed 2015-03-18 15:23:30 +01:00
Benjamin Otte
219e52f7e1 cssnode: Automatically recreate style on get_style() call
When the style is invalid, redo it.

Make this a vfunc, so the widget nodes can opt out.
2015-03-18 15:23:30 +01:00
Benjamin Otte
71813671ef cssnode: Track pending changes here
... instead of GtkCssWidgetNode.
2015-03-18 15:23:30 +01:00
Benjamin Otte
c550cf122a stylecontext: Move gtk_style_context_validate() to GtkCssWidgetNode 2015-03-18 15:23:30 +01:00
Benjamin Otte
649edbe2fc stylecontext: Move style creation functions to CssNode code 2015-03-18 15:23:30 +01:00
Benjamin Otte
c4b88e05fd stylecontext: Redo handling of differing state
Instead of passing an "override_state" flag, create a new CssNode just
for this simple lookup.
2015-03-18 15:23:30 +01:00
Benjamin Otte
637a4bda5c stylecontext: Get rid of stylecontext argument
... to a bunch of functions.

This requires a tiny change to the heuristics for the style cache - we
now cache styles when they have the same style provider as their parent
instead of when they have the default provider - but that change doesn't
have any effect in practice.
2015-03-18 15:23:29 +01:00
Benjamin Otte
03ac5f310b cssnode: Add gtk_style_context_get_style_provider()
... and use it when looking up properties.
2015-03-18 15:23:29 +01:00
Benjamin Otte
6dc6af674c stylecontext: Remove children list
It's not needed.
2015-03-18 15:23:29 +01:00
Benjamin Otte
4cc2af2db1 stylecontext: Move validation into GtkCssNode 2015-03-18 15:23:29 +01:00
Benjamin Otte
8e1017db35 stylecontext: Export gtk_style_context_get_root()
.. in the private header. This avoids tiny wrapper functions.
2015-03-18 15:23:29 +01:00
Benjamin Otte
55e68bc2ea cssnode: Track invalid flag
Remove it from GtkStyleContext.
2015-03-18 15:23:29 +01:00
Benjamin Otte
a589f98821 cssnode: Implement refcounting
The parent refs the child, so gtk_css_node_set_parent() adds/removes a
reference.

We should probably refactor this so that we name the function
parent.add(node) instead of node.set_parent(parent) - makes the
refcounting more clear.
2015-03-18 15:23:29 +01:00
Benjamin Otte
721dce73e0 stylecontext: Handle parent in CssNode code
Make CssNode a real tree with a DOM-like API.
2015-03-18 15:23:29 +01:00
Benjamin Otte
8c73799ca8 stylecontext: Move relevant_changes tracking to GtkCssWidgetNode 2015-03-18 15:23:29 +01:00
Benjamin Otte
7bafb63ec3 cssnode: Handle invalidation
Handle invalidation of node inside the CssNode code, don't do it in the
stylecontext.
2015-03-18 15:23:29 +01:00
Benjamin Otte
d79a44c1af stylecontext: Get rid of create_query_path()
Move that functionality into GtkCssNode.
2015-03-18 15:23:29 +01:00
Benjamin Otte
6f99a3cdb0 stylecontext: Change arguments for build_properties
Instead of passing the style declaration, take the node's style
declaration. Add arguments to allow overriding the state for the one
case where this didn't work.
2015-03-18 15:23:29 +01:00
Benjamin Otte
0e3da2f7cf stylecontext: Compute rootness of CssNode
.. instead of passing it as an argument.
2015-03-18 15:23:29 +01:00
Benjamin Otte
b9f1f8aa38 stylecontext: Pass cssnode to build_properties 2015-03-18 15:23:29 +01:00
Benjamin Otte
21c3b13596 stylecontext: Simplify a function 2015-03-18 15:23:29 +01:00
Benjamin Otte
40d94fcd38 stylecontext: Remove values cache
The code is confusing the stylecontext=>node transition, so I'll remove
it.

WIth the recent introduction of the parent style cachen, I'm not sure
it's worth it at all. Some crude benchmarking suggests a slight speedup
when removing the cache.

So no guarantees about adding it back later.
2015-03-18 15:23:29 +01:00
Benjamin Otte
e2f6d4db43 cssnode: Split into 3 objects
- GtkCssWidgetNode
  for style contexts owned by a widget
- GtkCssPathNode
  for style contexts using a GtkWidgetPath
- GtkCssTransientNode
  for nodes created with gtk_style_context_save()/restore()
2015-03-18 15:23:29 +01:00
Benjamin Otte
726d8abb7d cssnode: Turn into a GObject
This will allow us to use subclasses.
2015-03-18 15:23:28 +01:00
Benjamin Otte
cf6d9edc12 stylecontext: Turn CssNode accesses into getters/setters
That way we can hide the struct in the source file.
2015-03-18 15:23:28 +01:00
Benjamin Otte
be596f3967 stylecontext: Split out GtkCssNode into own file
The functionality of it is supposed to grow, so better put it in a
custom file early.

This is just a naive split so far, the next patches will split things
further.
2015-03-18 15:23:28 +01:00
Benjamin Otte
99c4f2dd39 render: Make image effect not depend on state
Instead rely on -gtk-image-effect only. Adwaita should already work this
way.

Relying on state was a leftover feature from the GTK 2 days.
2015-03-18 15:22:09 +01:00
Benjamin Otte
0529e15d61 notebook: Protect against invalid allocations
A widget can be mapped but not have a size allocated yet. In that case
avoid computing a broken rectangle.

https://bugzilla.gnome.org/show_bug.cgi?id=746301
2015-03-18 15:14:47 +01:00
Carlos Garnacho
dcfa55ac7e wayland: Fix thinko in wl_data_source.cancelled handler
The wl_data_source may be the clipboard's. Looking up the drag context in
order to get the display isn't going to fare well there. So, just use the
default display, and only look up the drag context when we know we need it.

https://bugzilla.gnome.org/show_bug.cgi?id=746386
2015-03-18 11:21:40 +01:00
Christian Hergert
28063ee2e4 textview: add support for underline and strikethrough colors
This commit adds the GtkTextTag:underline-rgba and :strikethrough-rgba
properties and the necessary plumbing to apply these colors in GtkTextLayout.
With this change, you can alter the color of underlines including those
of type PANGO_UNDERLINE_ERROR.

You might want to alter the underline color to differentiate between
spelling and grammer mistakes. In code editors, it is convenient to
differentiate between errors and warnings.

Note that the GtkTextAppearance struct is public ABI and has no spare
room for new fields, so we are resorting to some tricky packing to store
the colors in the unused pixel field of the fg_color and bg_color structs.
This packing is accomplished by the macros in gtktextattributesprivate.h.

Signed-off-by: Christian Hergert <christian@hergert.me>

https://bugzilla.gnome.org/show_bug.cgi?id=402168
2015-03-17 23:24:13 -04:00
Matthias Clasen
416c370da1 GtkRange: Fix scroll wheel direction for horizontal ranges
The expected behavior here is that scrolling up goes towards
larger values, ie to the right. This matches e.g. volume
sliders in gnome-shell.

https://bugzilla.gnome.org/show_bug.cgi?id=737175
2015-03-17 22:02:35 -04:00
Matthias Clasen
d823c39caf scrolled window: Use shift to modify scroll direction
It has been a long-standing request to interpret scroll events
with Shift held down as horizontal instead of vertical, and
some applications are already doing this on their own.

https://bugzilla.gnome.org/show_bug.cgi?id=132197
2015-03-17 20:50:24 -04:00
Matthias Clasen
00544e9090 HighContrast: Fix calendar selection
The selected day was not differentiated from other
days at all. Render it white on black instead.

https://bugzilla.gnome.org/show_bug.cgi?id=746369
2015-03-17 19:38:18 -04:00
Matthias Clasen
3d3591e873 HighContrast: Fix color chooser marks
The checkmark for the selected color was always black,
making it more or less invisible on dark colors.

https://bugzilla.gnome.org/show_bug.cgi?id=746368
2015-03-17 19:34:15 -04:00
Jakub Steiner
49b6be4e06 HighContrast: catch backdrop:insensitive:active of GtkSwitch
https://bugzilla.gnome.org/show_bug.cgi?id=746358
2015-03-17 23:55:10 +01:00
Jakub Steiner
557f5d5c7c HighContrast: unbreak GtkExpander
- the open state is checked, not active now

https://bugzilla.gnome.org/show_bug.cgi?id=746370
2015-03-17 23:43:20 +01:00
Anders Jonsson
bcddf68858 Updated Swedish translation 2015-03-17 21:24:09 +00:00
Zahari Yurukov
75105f94f0 Updated Bulgarian translation 2015-03-17 23:05:08 +02:00
Jakub Steiner
f671cd6296 HightContrast: make tab buttons not shift size
- only 1px stroke for close buttons in notebook tabs

https://bugzilla.gnome.org/show_bug.cgi?id=746149
2015-03-17 18:18:18 +01:00
Jakub Steiner
9b5fa0860f HighContrast: OSD fixes
- buttons
- labels
- scale trough/slider

https://bugzilla.gnome.org/show_bug.cgi?id=746148
2015-03-17 18:09:28 +01:00
Matthias Clasen
390dd37656 Add to release notes
Mention that GtkSearchEntry now 'eats' some keys.
2015-03-17 06:53:37 -04:00
Matthias Clasen
88a5959b22 3.15.12 2015-03-16 22:35:45 -04:00
Milo Casagrande
27164484cd Updated Italian translation 2015-03-16 20:37:06 +00:00
Jakub Steiner
6f478db2fa Adwaita: desaturate selected color for backdrop
https://bugzilla.gnome.org/show_bug.cgi?id=746202
2015-03-16 19:41:19 +01:00
Matthias Clasen
d5d28a5062 widget factory: Add an example for an insensitive model button
This will make it easier to make insensitive model buttons
appear properly in other themes.
2015-03-16 14:05:48 -04:00
Jonas Ådahl
4e930ada32 wayland: Move gtk-shell compatibility version define too
https://bugzilla.gnome.org/show_bug.cgi?id=745721
2015-03-16 13:58:14 -04:00
Matthias Clasen
c7672699e9 Don't pass invalid rectangles to cairo
This causes pixman warnings, or worse.
Clearly, something is not quite right here, if we end up
redrawing tabs at a time when the allocation is set to (1, 1).
For now, avoid straining the error handling in the lower layers.

https://bugzilla.gnome.org/show_bug.cgi?id=746301
2015-03-16 12:51:56 -04:00
Matthias Clasen
855c4dc0ce unrealize: Don't ref twice
After the recent change to add an outermost ref/unref pair,
we can do away with the inner one.
2015-03-16 11:54:38 -04:00
Carlos Garnacho
70e7b4c848 inspector: Remove flash timeout from widgets being unmapped
Otherwise the timeout can keep running, even if the widget is being
destroyed.
2015-03-16 16:29:37 +01:00
Carlos Garnacho
b4b23580a6 window: Protect against popover destruction on ::unmap
On popover_unmap(), perform the gtk_widget_unmap() call last, so the
GtkWindowPopover data is ensured to be alive throughout the function
if the popover widget is destroyed right on ::unmap.

https://bugzilla.gnome.org/show_bug.cgi?id=745829
2015-03-16 16:27:06 +01:00
Carlos Garnacho
b4e61b759b widget: Take a ref during ::unrealize emission
In order to prevent invalid memory access/crashes if the widget is
destroyed in a callback of that signal.

https://bugzilla.gnome.org/show_bug.cgi?id=745829
2015-03-16 16:27:06 +01:00
Carlos Garnacho
f5f6ad9981 widget: Take a ref during ::unmap emission
This ensures the widget data stays live long enough to perform invariants
check after emission if the widget happens to be destroyed on a callback.

https://bugzilla.gnome.org/show_bug.cgi?id=745829
2015-03-16 16:22:25 +01:00
Zahari Yurukov
2e272106ef Updated Bulgarian translation 2015-03-16 17:18:26 +02:00
Benjamin Otte
2d013a739a reftests: Fix test on HighContrast theme
We are testing -gtk-icon-style and assume the theme doesn't touch it.
But HighContrast forces symbolic icons. And that breaks the reference
images.

So explicitly set "requested" for everything.
2015-03-16 15:44:42 +01:00
Benjamin Otte
a24aee6bb2 spinbutton: Fix get_text_area_size for vertical spinbuttons
Commit c5905b13b9 changed the semantics of
this vfunc and get_entry_size but I only fixed one of them in the
spinbutton subclass.

https://bugzilla.gnome.org/show_bug.cgi?id=746282
2015-03-16 15:24:16 +01:00
Jonas Ådahl
225c10bc5a wayland: Don't set the wl_surface user_data twice
wl_surface_add_listener already sets the user data pointer, so no need
to do it separately before.

https://bugzilla.gnome.org/show_bug.cgi?id=746141
2015-03-16 19:53:37 +08:00
Jonas Ådahl
7372ddd2a1 wayland: Ignore setting the same cursor theme as was already set
If the name and size of the theme is identical to the current
configuration, do nothing.

https://bugzilla.gnome.org/show_bug.cgi?id=746141
2015-03-16 19:53:37 +08:00
Jonas Ådahl
465647e964 wayland: Support scaling of theme based cursors
Support scaling of cursors created from themes. The default scale is
always 1, but if the pointer cursor surface enters an output with a
higher scale, load the larger version of the cursor theme and use the
image from that theme.

This assumes the theme size is set to one that fits with an output scale
= 1.

https://bugzilla.gnome.org/show_bug.cgi?id=746141
2015-03-16 19:53:37 +08:00
Jonas Ådahl
7b2cdabc2e wayland: Put interface version defines in a common place
So far only one, but put it somewhere all files can see it.

https://bugzilla.gnome.org/show_bug.cgi?id=746141
2015-03-16 19:53:37 +08:00
Jonas Ådahl
c7be8fd398 wayland: Don't set cursor surface scale when we don't have a surface
The setting of the the surface scale even when the surface is not
created from a surface was introduced due to a crash when getting the
buffers when dividing by the scale. The only reason I can see this is
that we get the buffer from a non-existing surface when the wl_cursor
has not yet been set.

Instead, use the name field to avoid trying to use the non-existing
surface, effectively avoiding the division-by-zero that way.

https://bugzilla.gnome.org/show_bug.cgi?id=746141
2015-03-16 19:53:37 +08:00
Jakub Steiner
6675b9639c HC: no border for insensitive backdrop buttons
https://bugzilla.gnome.org/show_bug.cgi?id=746192
2015-03-16 12:37:54 +01:00
Trần Ngọc Quân
49cd3c8232 Updated Vietnamese translation
Signed-off-by: Trần Ngọc Quân <vnwildman@gmail.com>
2015-03-16 14:45:46 +07:00
Matthias Clasen
25b610ef5e widget-factory: Add an insensitive toolbutton
This will help getting their theming right in HighContrast.
2015-03-15 22:54:02 -04:00
Matthias Clasen
de239ca31b widget-factory: Add tab close buttons
This will make it easier to fix issues with such buttons
in HighContrast.
2015-03-15 22:44:33 -04:00
Matthias Clasen
5dfbeb978f gtk3-demo: Stop using follow-state
It is no longer needed.
2015-03-15 22:44:33 -04:00
Matthias Clasen
e98b096ca8 print dialog: Stop using follow-state
It is no longer needed.
2015-03-15 22:44:33 -04:00
Matthias Clasen
399d2c1389 app chooser widget: Stop using follow-state
It is no longer needed.
2015-03-15 22:44:33 -04:00
Matthias Clasen
59a901e285 places sidebar: Stop using follow-state
It is no longer needed.
2015-03-15 22:44:33 -04:00
Matthias Clasen
8d58b64c28 widget-factory: Stop using follow-state
The property is no longer needed, cell renderers now
always follow state.
2015-03-15 22:44:33 -04:00
Josef Andersson
0df9b59dfc Updated Swedish translation 2015-03-15 21:30:20 +00:00
Matej Urbančič
17a221dba9 Updated Slovenian translation 2015-03-15 21:39:22 +01:00
Ask Hjorth Larsen
e6f9c49c22 Updated Danish translation 2015-03-15 14:46:54 +01:00
Nelson Benítez León
11096885ae gemfile: needs add source rubygems.org
`bundle install` command on fedora 21 was failing
with following message:

Your Gemfile has no gem server sources. If you need
gems that are not already on your machine, add a line
like this to your Gemfile:
source 'https://rubygems.org'

After adding that line it worked again.

https://bugzilla.gnome.org/show_bug.cgi?id=746205
2015-03-14 23:48:21 +01:00
Piotr Drąg
838c9a0d98 Updated POTFILES.in and POTFILES.skip 2015-03-14 17:59:27 +01:00
Benjamin Otte
c5905b13b9 entry: Make code do what it's meant to do
With the 3.0 transition, this code went from just querying the entry's
height request to doing a full size request.
Then it got code to revert the features that a full size request does.
And then it grew code that manually computed the baseline.

Avoid this and just do what happened back in the days: Do a regular
height request.

This changes the semantics of the get_frame_size() vfunc wrt its
behavior towards subclasses overwriting the get_height() vfuncs, but I'm
happy to live with that.
2015-03-14 15:46:13 +01:00
Benjamin Otte
d2881d901b cellrendererpixbuf: Always follow state
Applications forget to set the follow-state property and then some
themes used a style where normal symbolic icons have the same color as
prelit or selected backgrounds and that suddenly made icons invisible
and who wants that?

https://bugzilla.gnome.org/show_bug.cgi?id=746201
2015-03-14 15:46:13 +01:00
Carlos Soriano
7ef7873b23 gtkstacksidebar: fix missing macro
commit e41cadd835 forgot to change some macros.
2015-03-14 13:41:57 +01:00
Samir Ribic
10ea4d81e6 Updated Bosnian translation 2015-03-14 09:08:02 +00:00
Matthias Clasen
2026efb981 More documentation fixes
With this commit, gtk3-unused.txt is empty (for the first
time in a looong time).
2015-03-13 23:24:53 -04:00
Matthias Clasen
e41cadd835 GtkStackSidebar: Fix incomplete renaming
Some of the boilerplate macros were missing. Oops
2015-03-13 23:24:53 -04:00
Matthias Clasen
0ddb5d729c More documentation fixes 2015-03-13 23:24:53 -04:00
Matthias Clasen
bb3ae47477 Docs: Update ignored header list
This reduces the warning spam somewhat.
2015-03-13 23:24:53 -04:00
Matthias Clasen
a744a67f42 Documentation fixes
Add a few missing symbols.
2015-03-13 23:24:53 -04:00
Matthias Clasen
c93d66c8a7 Fix a typo in the docs
gtk-doc complains about parameter name mismatches.
2015-03-13 23:24:53 -04:00
A S Alam
a7ef117b4a Translation pa updated for Gnome 2015-03-13 21:23:03 -05:00
Ask Hjorth Larsen
f0609a5142 updated Danish translation 2015-03-13 23:52:58 +01:00
Ask Hjorth Larsen
d89bd0040c updated Danish translation 2015-03-13 23:51:51 +01:00
Matthias Clasen
fec8a1ee7f menu button: Improve accessibility
Rework the way we assign an accessible name to menu buttons,
to make sure we pick up a label, should the button contain
one, and only override the name with "Menu" as a fallback.
2015-03-13 18:38:18 -04:00
Matthias Clasen
98730f71f9 testsuite: Set some environment variables
These were set manually in some tests, but not consistently.
2015-03-13 17:51:42 -04:00
Matthias Clasen
b756fd42a0 testsuite: Drop test bus
It seems to be buggy in ways that make the test fail
with a critical when the test bus is brought down.
At the same time, drop manual settings of environment
variables that we can set globally.
2015-03-13 17:51:32 -04:00
Samir Ribic
4d889ccc42 Updated Bosnian translation 2015-03-13 20:44:00 +00:00
Samir Ribic
5f8e054a9d Updated Bosnian translation 2015-03-13 20:43:23 +00:00
Jordi Mas
fe13fb841b Update Catalan translation 2015-03-13 02:26:58 -04:00
Matthias Clasen
1349b0f72d 3.15.11 2015-03-12 08:11:03 -04:00
Matthias Clasen
b974ced51b Fix make dist
Add a missing quote.
2015-03-12 08:11:03 -04:00
Matthias Clasen
c9faea04c5 Drop unused files 2015-03-12 07:41:52 -04:00
Dušan Kazik
171d4305f4 Updated Slovak translation 2015-03-12 10:20:08 +00:00
Milo Casagrande
d96cbb3b59 Updated Italian translation 2015-03-12 08:57:43 +00:00
Jordi Mas
e944525596 Update Catalan translation 2015-03-11 23:37:54 -04:00
Benjamin Otte
49881eebbb Revert "iconhelper: Don't check states"
This reverts commit 63f59dde3a.

It turns out, the state was not just necessary for style computation,
but also for tracking RTL and LTR. And so it broke the reftests.
2015-03-12 04:31:45 +01:00
Matthias Clasen
8615a52ca3 Add some reftests related to textview tags
This test shows that a) tags override the text view style and
b) tags override each other in the expected way.
2015-03-11 22:04:29 -04:00
Benjamin Otte
7ad203732f iconhelper: Use the screen's icon theme
... and not the default one.
2015-03-12 01:15:38 +01:00
Benjamin Otte
93f8966bd9 iconhelper: Replace function
The old one just calls the other one.
2015-03-12 01:15:38 +01:00
Benjamin Otte
181e58e402 iconhelper: Move function from style context into only user 2015-03-12 01:15:38 +01:00
Benjamin Otte
63f59dde3a iconhelper: Don't check states
This is the wrong thing to do in today's world.
2015-03-12 01:15:38 +01:00
Matthias Clasen
b2d40afdf5 App Chooser: Fix app icons in HighContrast
We need to follow-state here as well, to make sure the
icons are visible on selected rows.
2015-03-11 15:32:47 -04:00
Changwoo Ryu
f82341d1d3 Updated Korean translation 2015-03-12 02:52:52 +09:00
Philip Withnall
80013436d0 gtkentry: Document vfuncs in GtkEntryClass
Clarify that the signal handler vfuncs can be NULL, nothing else can,
and that they all have default implementations.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-11 11:24:29 +00:00
Philip Withnall
52858f709c gtktreeselection: Fix an abort on selecting an invalid range
gtk_tree_selection_real_modify_range() has a g_return_if_fail() if the
start or end paths passed to it do not correspond to real tree nodes.
However, GtkTreePaths inherently do not have to be valid, so it should
be acceptable to call gtk_tree_selection_select_range() with
non-existent paths. Replace the g_return_if_fail() by a silent return,
and add a unit test.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-11 11:24:29 +00:00
Philip Withnall
d65ccf96ee gtknotebook: Add more non-NULL checks for cur_page
These were not spotted by scan-build, but from some brief mental
reasoning could potentially be problem areas.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-11 11:24:29 +00:00
Matthias Clasen
3b45be94e8 Gestures: Properly handle weak references
Every call to g_object_add_weak_pointer must be matched with
a g_object_remove_weak_pointer call, or we will get invalid
writes inside GObject.

https://bugzilla.gnome.org/show_bug.cgi?id=746013
2015-03-11 06:47:04 -04:00
Jonas Ådahl
b4344861a0 wayland: Only bind to supported gtk-shell versions
The gtk-shell Wayland protocol extension is not meant to be backward
compatible right now, so avoid binding to any version that is not the
one supported.

https://bugzilla.gnome.org/show_bug.cgi?id=745721
2015-03-11 11:37:37 +08:00
Emmanuele Bassi
a52ff2f66e build: Fix generating introspection on MacOS
We need to filter out platform-specific sources from the files that we
use with the introspection scanner.

In this specific case I could have moved the gtkclipboard-quartz.c and
the gtkdnd-quartz.c files out of the $(gtk_base_c_sources) variable, but
doing a filter-out on the variable itself is more resilient in case we
eventually add files and we forget about the result.
2015-03-10 22:15:56 +00:00
Matthias Clasen
073a9c9cd5 inspector: Add some margin to css editor
Requested in
https://bugzilla.gnome.org/show_bug.cgi?id=745918
2015-03-10 14:07:27 -04:00
Carlos Garnacho
622a930c5a window: reset both press/drag gestures when move/resize drag starts
Now that this is split in two separate gestures, both must be reset
when the WM grabs the pointer. Also, do on resize drags like on move
drags, and claim the gesture before resetting, so the ownership is
properly transferred across any other widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=745969
2015-03-10 16:48:16 +01:00
Anders Jonsson
2f8938cf23 Updated Swedish translation 2015-03-10 12:28:37 +00:00
Anders Jonsson
1cc35cdc6d Updated Swedish translation 2015-03-10 12:27:18 +00:00
Benjamin Otte
9e2cdce58e notebook: Fix boolean check
Commit c352093bde swapped the condition
when turning it into a return_if_fail().
2015-03-10 13:23:06 +01:00
Carlos Garnacho
94ec6b4418 entrycompletion: Ensure transient_for is set before showing window
gtk_entry_set_completion() (and _gtk_entry_completion_connect underneath)
may happen when the entry has no toplevel yet. This window acts as the
"parent" for subsurface windows on wayland, and is indispensable to create
its backing wl_subsurface, so this resulted in non-visible popups there.
Fix this by ensuring transient_for is set before showing the popup.

https://bugzilla.gnome.org/show_bug.cgi?id=745463
2015-03-10 11:15:04 +01:00
Philip Withnall
c352093bde gtknotebook: Fix potential use of uninitialised variables
Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-10 07:32:19 +00:00
Philip Withnall
ac4da770e1 gtkprintunixdialog: Fix a potential g_object_unref(NULL) call
The code above checks whether (printer == NULL), so we’d better do so
here as well.

Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-10 07:32:19 +00:00
Matthias Clasen
5ced234144 Revert "csd: Drop the GTK_FRAME_EXTENTS requirement"
This reverts commit fb9a6bb6d8.

In a recent test, I've found that Xfce and Mate now support
this, so they will not be affected by this requirement. And
adding the check back will solve the 'client-side shadow'
problem in KDE.
2015-03-09 20:48:47 -04:00
Benjamin Otte
9ec2804775 stylecontext: Store the right style in the cache
Store the newly computed style, not the old and wrong one.

Fixes HighContrast menuitem color sometimes being black-on-black for
selected items.
2015-03-09 23:54:41 +01:00
Philip Withnall
f8eac08a0a gtkclipboard: Fix a potential g_signal_handler_disconnect(NULL) call
Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-09 13:41:37 +00:00
Philip Withnall
af36220bca gtkprintcontext: Fix several potential g_object_[un]ref(NULL) calls
The page_setup of a GtkPrintContext or GtkPrintUnixDialog is nullable,
so all reference count changes to it have to be guarded against NULL
values.

Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-09 13:41:37 +00:00
Philip Withnall
8e3b499699 gtktreeselection: Fix a potential use of uninitialised variables
Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-09 13:41:37 +00:00
Philip Withnall
968780d8da gtktreeselection: Fix potential NULL pointer dereferences
_gtk_rbtree_first() can potentially return NULL if the RB tree is empty,
which would result in NULL pointer dereferences in the GtkTreeSelection
code. Gracefully handle them.

Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-09 13:41:37 +00:00
Philip Withnall
4fc6880d83 gtktextview: Fix a definite use of an uninitialised variable
This seems to have been a typo in the original code, and allowed access
to virtual_cursor_y when it was uninitialised.

Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-09 13:41:37 +00:00
Philip Withnall
51971d56bc gtknotebook: Remove dead variable assignments
Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-09 13:41:37 +00:00
Philip Withnall
c7f5f10853 gtknotebook: Fix a potential NULL pointer dereference
Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-09 13:41:37 +00:00
Philip Withnall
61c46d911f gtkentry: Return early from gtk_entry_clear() if no icon info exists
This helps scan-build avoid some false positive potential NULL pointer
dereference warnings.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-09 13:41:37 +00:00
Philip Withnall
19222a6364 gtkentry: Remove dead assignments
Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-09 13:41:37 +00:00
Philip Withnall
7479133753 gtkentry: Call get_*_size() vfuncs unconditionally
These vfuncs cannot be NULL: implementations are provided by GtkEntry,
and subclasses should not set them to NULL. Instead of conditionalising
the calls to the vfuncs, assert that they’re set and call them
unconditionally.

This prevents the possibility of a subclass setting the vfunc to NULL
and then a gtk_entry_get_*_size() call returning undefined values in its
out variables.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-09 13:41:37 +00:00
Philip Withnall
0282714d86 gtkentry: Fix potential use of uninitialised variables
Found with scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-09 13:41:37 +00:00
Philip Withnall
586240d2f8 gdkwindow: Fix potential NULL pointer dereference
gdk_window_ensure_native() can end up with a NULL parent pointer, which
it passes to find_native_parent_above()…but that expects a non-NULL
parent.

Found with scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-09 13:41:37 +00:00
Andre Heinecke
e99e282b5a Prevent empty password request popup for kerberos
If auth_info_required is only set to "negotiate" the
    request password dialog is shown anyway for each print
    job without any input fields. As the request_password
    dialog only handles username, password and domain.

    https://bugzilla.gnome.org/show_bug.cgi?id=669008
2015-03-09 14:19:57 +01:00
Bastian Ilsø
52f5a78c6d Update hello-world.c to GtkApplication, document 2015-03-09 12:17:31 +01:00
Matthias Clasen
01d76b7701 Print dialog: Fix printer icons in HighContrast
We need to make the cell renderer follow the state,
for recoloring to work.
2015-03-08 22:05:37 -04:00
Matthias Clasen
59d12be94f HighContrast: Some formatting fixes 2015-03-08 21:32:38 -04:00
Matthias Clasen
9b18deee1f Add a missing word in the docs 2015-03-08 18:16:11 -04:00
Aurimas Černius
7385784ded Updated Lithuanian translation 2015-03-08 20:22:54 +02:00
Emmanuele Bassi
6950116678 docs: Reword the deprecation notice for gtk_widget_override_*
They are a bit terse, and they should point to the preferred way of
overriding the theme, i.e. using a GtkStyleProvider for your
application, and custom style classes.
2015-03-08 14:39:18 +00:00
Emmanuele Bassi
247e62390b docs: Clarify replacement for gtk_style_context_get_background_color()
It seems odd that a getter function for the style context state is
replaced by a rendering call, but it makes sense in context.
2015-03-08 14:29:04 +00:00
Matthias Clasen
ec567e5fad Add a test for builder-constructed file filters 2015-03-08 09:12:21 -04:00
Matthias Clasen
6b23c44056 GtkFileFilter: Set name from builder id
Suggested in https://bugzilla.gnome.org/show_bug.cgi?id=577862
as a way to make file filters constructed with GtkBuilder more
useful.
2015-03-08 09:12:21 -04:00
Baurzhan Muftakhidinov
f6d0b9e9a9 Updated Kazakh translation 2015-03-08 11:17:09 +00:00
Frédéric Péters
70775e1985 docs: fix reference to GTK+ 2 index of deprecated symbols 2015-03-08 09:43:04 +01:00
Eric Le Bihan
8ecc51ad8a Fix undefined reference to get_xkb()
When configuring Gtk+ with --disable-xkb, the build fails because of an
undefined reference to get_xkb().

This patch fixes this issue.

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>

https://bugzilla.gnome.org/show_bug.cgi?id=739070
2015-03-07 18:42:27 -05:00
Matthias Clasen
4938aa9c6b Modernize the xReply check
Using AC_CHECK_TYPE instead of AC_TRY_COMPILE avoids compiler
warnings from -Werror.

https://bugzilla.gnome.org/show_bug.cgi?id=535929
2015-03-07 18:25:57 -05:00
Matthias Clasen
1f3328c096 Avoid calling g_object_ref on NULL
gtk_widget_set_visual() allows NULL for the visual, so be
careful ot to ref it unconditionally.
2015-03-07 17:48:11 -05:00
Matthias Clasen
6e7ad732fc scrolled window: Fix size requisition with overlay scrolling
When the scrollbars are overlayed, the size requisition of the
scrolled window should not depend on whether the scrollbars are
visible or not. This was not quite the case, because we forgot
one case where scrollbar size was still added to the requisition.
2015-03-07 14:18:13 -05:00
Matthias Clasen
cbf5b49cb8 Add an example for accelerators with manual image menuitems
This is somewhat tricky to work out, so put some example
code here for future reference. The tricky part is that
GtkAccelLabel tries to be smart about hiding the accel
if there's not enough space, so we have to make sure to
pack the label with expand=TRUE and set align=GTK_ALIGN_FILL,
or things won't work.
2015-03-06 20:36:11 -05:00
Chun-wei Fan
b3725a455d test/gtkgears.c: Fix on C89 Compilers
Make sure that variables are declared at the top of the block.

Break up one of the sincos() calls into individual calls to sin() and cos()
so that we do not have to complicate the initialization of the following
GLfloat array.
2015-03-06 23:47:35 +08:00
Changwoo Ryu
9c545ac2e8 Updated Korean translation 2015-03-06 22:14:22 +09:00
Niels Nesse
b87715973f gl: Warn the user if they request a GL context version less than 3.2
If the user requests a version less than 3.2 the version is forced to 3.2.
Previous checking code have an inconsistent behavior depending on which
minor version number was specified. This is avoided now by temporarily
converting the major/minor pair into a single integer.

https://bugzilla.gnome.org/show_bug.cgi?id=744288
2015-03-06 14:02:55 +01:00
Chun-wei Fan
064f4db012 Update config.h.win32.in for sincos()
There was an added check in configure.ac for sincos() for gtkgears.c, where
that function is actually a GCC- and glibc-specific extension, which is
not available on Windows.  Reflect on this in config.h.win32.in for the
Visual Studio/Windows builds.
2015-03-06 10:49:25 +08:00
Chun-wei Fan
45da8bf045 MSVC Builds: "Install" .pdb Files
"Install" the .pdb files that were generated along with the build, to make
it easier for people to develop and debug GTK+, especially when used as a
stack, and as the .pdb files are already generated with all builds.

Also make the copy of the .dll, .lib and .exe files more selective so that
we do not accidently copy files that are not meant to be "installed", or
end up making extra copies of plugin DLLs in the wrong places, when the
projects here are included as a part of a grand solution that is used to
build the entire GTK+ stack, for example.
2015-03-06 10:40:46 +08:00
Chun-wei Fan
91bc414360 MSVC 2010+ Builds: Fix .pdb Generation
For Visual Studio 2010 and later, the .pdb filename needs to be explicitly
specified so that it will match the filename of the target, if the project
name differs from the filename of the target.  Make sure that is the case
for the 3 DLLs that we build for Visual Studio 2010 and later.
2015-03-06 10:25:18 +08:00
Piotr Drąg
e2190d7a01 Updated Polish translation 2015-03-05 23:48:19 +01:00
Matthias Clasen
7fbbf850c3 Improve some GtkStock deprecation notes
Point at edit-delete and edit-paste as available icons.
2015-03-05 16:07:30 -05:00
Dušan Kazik
1fb172011c Updated Slovak translation 2015-03-05 13:17:37 +00:00
Dušan Kazik
4691049f9e Updated Slovak translation 2015-03-05 12:14:18 +00:00
Carlos Garnacho
40c8d8bcf4 window: Add comment documenting the target widget checks during window drag
Was suggested during review of
https://bugzilla.gnome.org/show_bug.cgi?id=745562#c2
2015-03-05 11:52:24 +01:00
Claude Paroz
08b5de7836 Updated French translation 2015-03-05 08:49:50 +01:00
Matthias Clasen
6ac3ec0b53 HighContrast: Make sure selections are visible in infobars
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=745622
2015-03-04 21:56:02 -05:00
Matthias Clasen
2b7eaaf86e Adwaita: Make sure selections are visible in infobars
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=745622
2015-03-04 21:55:11 -05:00
Carlos Garnacho
08494f86a0 widget: Improve hack to ignore drags from widgets using motion events
Postpone until the last moment whether the target widget still
potentially uses updates from this sequence, or window dragging
actually applies because all gestures on the target went to denied
state.

This fixes window dragging on empty space in a headerbar that is
contained in a paned (as in e.g. gedit).

https://bugzilla.gnome.org/show_bug.cgi?id=745562
2015-03-04 21:20:29 -05:00
Matthias Clasen
768e6a4579 Ensure print-related types are registered
These types are not covered by g_test_register_all_types,
and having the types registered when a print dialog is used
helps in cases where GTK+ is dlopened.

https://bugzilla.gnome.org/show_bug.cgi?id=745065
2015-03-04 20:37:01 -05:00
Georges Basile Stavracas Neto
ce9a5a3fec places sidebar: compare bookmarks by index
GtkPlacesSidebar applies a sorting function on
the tree model that does not consider the case
of bookmarks, which are sorted by their indexes.

By adding the bookmarks corner case and comparing
then by their indexes, GtkPlacesSidebar can sort
the bookmarks properly in the order they're saved.

https://bugzilla.gnome.org/show_bug.cgi?id=744589
2015-03-04 17:20:40 -03:00
Matthias Clasen
17bc7aaefd Check for existence of sincos
It apparently doesn't exist everywhere.

https://bugzilla.gnome.org/show_bug.cgi?id=745578
2015-03-04 06:30:13 -05:00
Matthias Clasen
71bd1c7e2c file chooser: Really stop typeahead search popups
GtkTreeView is a bad widget and constantly resets the search-column
behind our back. We need to re-unset it every time a model is set :-(
2015-03-03 18:03:26 -05:00
Fran Dieguez
b92573e42e Updated Galician translations 2015-03-03 23:44:15 +01:00
Matthias Clasen
76c66ef2ed make-pot: Document variables
Damn-lies will have to use one of these to override the name
of the generated file. Lets document them all, while I still
remember this.
2015-03-03 15:01:15 -05:00
Carlos Garnacho
5751d4f66e filechooser: Only do search_start_query() while we are in search mode
This signal can be emitted by GtkSearchEntry after search has been
cancelled, and other operation mode is set. It doesn't make sense to
populate the search model in that state anymore, so just avoid doing it.

https://bugzilla.gnome.org/show_bug.cgi?id=745479
2015-03-03 17:57:08 +01:00
Carlos Garnacho
b2f3b67494 searchenginetracker: Keep a reference on the search engine while querying
The object might be destroyed when mid operation, causing crashes as the
query callback still expects the object pointer to be valid. Also, remove
the gdk_threads_enter/leave pairs, the callback will be executed on the
caller (UI) thread, so this is not necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=745479
2015-03-03 17:57:08 +01:00
Carlos Garnacho
a994f4edfb filechooser: Disconnect signal handlers from search engine before destroying
The search engine might stay alive longer due to extra temporary refs, so
the signal handlers should be removed for the filechooser to ignore these
properly.

https://bugzilla.gnome.org/show_bug.cgi?id=745479
2015-03-03 17:57:08 +01:00
Matthias Clasen
79321c0d8a Make a pot generating command available
Translators don't want to run autogen before generating pot,
so give them a script.
2015-03-03 07:22:41 -05:00
Chun-wei Fan
48c93fb347 MSVC 2008 Builds: Speed Up Release Builds
Use the /MP compiler option, where the build time for release builds can
be cut down by quite a bit.  This will however cause a brief warning with
debug builds due to the use of /Gm, but the code will otherwise build
normally.  Unlike the Visual Studio 2010+ builds, we can't use /d2Zi+ as
Visual Studio 2008 does not support that, so we can't get a better
debugging experience for release builds here.
2015-03-03 18:40:32 +08:00
Chun-wei Fan
163f7e75bf Fix "MSVC Builds: Update icon-browser Projects"
The Visual Studio 2008 Project was not updated correctly, so fix that.
2015-03-03 18:37:26 +08:00
Stefan Sauer
bb78a39103 tooltip: remove unused variable and related g_object_set
We never use the value of has_tooltip. This is a left-over from the refactoring
of gtk_tooltip_run_requery().
2015-03-03 09:59:53 +01:00
Chun-wei Fan
05ef31362d MSVC Builds: Update icon-browser Projects
There is a new source file that needs to be built, so fix the projects...
2015-03-03 14:08:51 +08:00
Chun-wei Fan
a4f69408ac MSVC Builds: Improve Build Speed and Debugging
Use Multiprocessor compilation which can cut down build times by quite a
bit and use the /d2Zi+ flag to have better debugging info being logged to
the .pdb for release builds.

These are only applicable for Visual Studio 2010/2012 and later.
2015-03-03 14:07:26 +08:00
Chun-wei Fan
e31a936e3e gtkswitch.c: Fix Build on C89 Compilers
This file now uses round(), which was not available until C99, so include
fallback-c89.c instead of math.h, which includes math.h and does a fallback
implementation of round().
2015-03-03 12:14:24 +08:00
Matthias Clasen
32c0c6fee0 3.15.10 2015-03-02 20:58:01 -05:00
Matthias Clasen
238cdd5e37 Avoid stray output from configure
The new xgettext check was leaving a messages.po file behind.
2015-03-02 20:58:01 -05:00
Matthias Clasen
3569d373a2 Fix 7c4bf742e8
The objects-finalize test constructs gestures with NULL as
a widget. The recent addition of weak references was not
ready for that.
2015-03-02 20:18:15 -05:00
Emmanuele Bassi
0019eb7bf9 gears: Update to slightly more modern OpenGL
Instead of using glxgears, which still uses OpenGL 2.1 and the fixed
pipeline, we use a slightly modified es2gears, OpenGL 3.2, and the
programmable pipeline.
2015-03-03 00:06:35 +00:00
Matthias Clasen
209c5c37f3 file chooser: Avoid animated scrolling for editing
Avoid scrolling animation when scrolling to where we want
to insert the new folder, since adding the entry doesn't
do the right thing if the treeview is still scrolling.

An alternative would be to wait for the animated scrolling
to reach its target before starting the editing, but this
is easier.

https://bugzilla.gnome.org/show_bug.cgi?id=729366
2015-03-02 16:25:30 -05:00
Matthias Clasen
18de5e6547 file chooser: Avoid triggering assertions
cairo surfaces are boxed types, so don't try to set them
with g_value_set_object().
2015-03-02 16:25:30 -05:00
Matthias Clasen
d2fe45ab57 file chooser: Avoid warnings from the location column
Avoid criticals that would come out of this code if file is / or NULL.
2015-03-02 16:25:30 -05:00
Claude Paroz
65b55938ca Updated French translation 2015-03-02 18:32:07 +00:00
Carlos Garnacho
4cae9bdd05 x11: Store last axes from device
And use these for the missing axes if the valuator mask is incomplete.
This used to work fine on tablets because the Wacom driver ensures all
valuators are sent, which is not true if using the evdev driver.

https://bugzilla.gnome.org/show_bug.cgi?id=703610
2015-03-02 18:57:04 +01:00
Carlos Garnacho
3ccfcf5b9f scrolledwindow: Cancel kinetic/overshoot animation on captured scroll events
This ensures the animation is cancelled if the child widget happens to
GDK_EVENT_STOP scroll events.

https://bugzilla.gnome.org/show_bug.cgi?id=745315
2015-03-02 17:42:04 +01:00
Matthias Clasen
da679f3866 Updates 2015-03-02 11:11:24 -05:00
Carlos Garnacho
1feaa6f301 scrolledwindow: Add motion mask to the widget window
This is not specified specifically by the attached controllers, so let
the scrolledwindow set the mask, as motion events with no buttons pressed
are interesting to it.

https://bugzilla.gnome.org/show_bug.cgi?id=745344
2015-03-02 15:49:40 +01:00
Yosef Or Boczko
22c83e5ea7 Updated Hebrew translation 2015-03-02 15:39:40 +02:00
Carlos Garnacho
eaebc2cb4b wayland: Delay wl_subsurface interface creation until the window is shown
It isn't really necessary anytime before, so just make sure it's there only
when the window is visible.

https://bugzilla.gnome.org/show_bug.cgi?id=743427
2015-03-02 12:11:59 +01:00
Carlos Garnacho
d070e4c742 gtkwindow: Do not show subsurface windows for hidden popover widgets
This is really just necessary when we have a visible widget, otherwise
the window would temporarily linger with odd size and surface.

https://bugzilla.gnome.org/show_bug.cgi?id=743427
2015-03-02 12:11:59 +01:00
Carlos Garnacho
c55fcd35fe wayland: Thaw the clock if we hide a GdkWindow mid-frame
When a window is hidden, its surface and all its roles are destroyed,
if this happens when we already issued a wl_surface_commit and are
awaiting for a frame callback, the clock will remain frozen for the
next time the window is shown.

To avoid this, keep track of the wl_surface_frame() calls issued,
and ensure the clock is thawed after hiding. If we happen to receive
the frame callback, it is just ignored.

https://bugzilla.gnome.org/show_bug.cgi?id=743427
2015-03-02 12:11:59 +01:00
Carlos Garnacho
13e22e2030 gtkwindow: Move window dragging to a standalone drag gesture
The gesture is hooked to the capture phase, so it works for buttons in
header bars and whatnot. In order to be friendly to the widget it is
capturing events from, an ugly hack is in place to avoid capturing
events when the target widget has a gesture that would consume motion
events.
2015-03-02 12:03:39 +01:00
Carlos Garnacho
0796d7b6ff gtkmenubutton: Popup menu/popover on GtkButton:clicked
This happens on button release, which is more convenient if the gesture
can be consumed by something else (eg. window dragging), and already behaves
correctly wrt cancelled gestures, broken grabs, etc.

This also allows us to unify pointer and keyboard behavior, popping up the
menu widget in a single place.
2015-03-02 12:01:07 +01:00
Carlos Garnacho
2e52e9964b gesture: On cancel, remove touchpoint before checking the recognized state
Otherwise the touch being removed doesn't account in recognition.
2015-03-02 12:01:07 +01:00
Carlos Garnacho
a4e0de1839 button: Ensure the button is "left" when a gesture is cancelled
This prevents from stale widget states if the gesture happens to be
cancelled mid-press.
2015-03-02 12:01:07 +01:00
Debarshi Ray
0910eaf6fe eventcontroller: Chain up on constructed
https://bugzilla.gnome.org/show_bug.cgi?id=745225
2015-03-02 11:53:56 +01:00
Debarshi Ray
7c4bf742e8 eventcontroller, widget: Don't crash if destroyed before the other
There are two scenarios. A widget sub-class owns a GtkEventController
and passes itself to it, or a controller owned by something else is
passed a widget.

In the second case, if the widget is destroyed before the controller,
we will have a crash when destructing the controller because we will
be accessing invalid memory. Adding a weak reference on the widget
addresses that problem.

This leads to a crash in the first case. When the widget is getting
destroyed, it will drop the reference to its own controller. The
controller will skip touching the widget because the weak reference
would have turned it to NULL. However, when the widget sub-class chains
up to GtkWidget it will try to free all the controllers in its list.
Unfortunately, all these controllers have already been destroyed. So
we need to guard against this too.

https://bugzilla.gnome.org/show_bug.cgi?id=745225
2015-03-02 11:53:52 +01:00
Murray Cumming
66d25c4a06 gtk_label_set_yalign(): Fix xalign/yalign typo in parameter name. 2015-03-02 10:58:53 +01:00
Marek Kasik
c2aff4ab6e printing: Set printer state correctly
Consider NULL printer state message as empty too.
Printer state IPP_PRINTER_STOPPED can be considered as paused state.

https://bugzilla.gnome.org/show_bug.cgi?id=743323
2015-03-02 10:51:07 +01:00
Murray Cumming
bc77408e3c gtk_misc_set_alignment(): Improve the deprecation documenation.
To link to GtkWidget.halign/valign and to mention
GtkLabel.xalign/yalign.
2015-03-02 09:46:49 +01:00
Ryan Lortie
c91076f64c gdkglcontext-win32: fix variable names in GDK_NOTE
These probably weren't caught because GDK_NOTE was disabled when the
change was tested.

https://bugzilla.gnome.org/show_bug.cgi?id=745400
2015-03-01 21:38:19 -05:00
Ryan Lortie
4f0ab5656b gdkglcontext-win32: remove unused variables
https://bugzilla.gnome.org/show_bug.cgi?id=745400
2015-03-01 21:38:19 -05:00
Marek Černocký
9ba4bed117 Updated Czech translation 2015-03-01 18:54:56 +01:00
Carlos Garnacho
fc838cefbf searchenginetracker: Unify fts/non-fts query
This makes sure we use location_uri for both types of query, and the fts
query has been made more similar to the one used by nautilus.
2015-02-28 21:19:47 -05:00
Matthias Clasen
d87041bfe3 tracker: Turn on fts
We want to match what nautilus does, and the non-fts query
ignores the location, which yields somewhat broken UI in
the file chooser.
2015-02-28 16:44:21 -05:00
Matthias Clasen
8a0d02c548 Formatting fixes 2015-02-28 16:44:21 -05:00
Matthias Clasen
f126157bfa file chooser: Don't start search too eagerly
We were trying to start search when the user types anything,
but this is annoying more often than helpful, and interferes
with the location entry. So, stick with explicitly enabled
search (via the search button or Alt-S) for now.
2015-02-28 16:44:21 -05:00
Dušan Kazik
6ed479e71c Updated Slovak translation 2015-02-28 20:21:13 +00:00
Peter Bloomfield
5611cf2096 Do not return NULL AtkStateSet
https://bugzilla.gnome.org/show_bug.cgi?id=741511
2015-02-28 13:52:22 -05:00
Friedel Wolff
2a3f1a49de Updated translation for Afrikaans (af) 2015-02-28 19:32:23 +02:00
Trần Ngọc Quân
a764e343c7 Updated Vietnamese translation
Signed-off-by: Trần Ngọc Quân <vnwildman@gmail.com>
2015-02-28 14:23:14 +07:00
Matthias Clasen
af86bc58b9 wayland: Add debug spew 2015-02-28 00:58:05 -05:00
Matthias Clasen
94c5d691df wayland: Formatting fixes 2015-02-28 00:02:30 -05:00
Matthias Clasen
a0eb0e2346 wayland: Apply maximized and fullscreen state
We were just throwing the request away if the app asks to
fullscreen or maximize a window before it has been mapped.
This is something the GdkWindow API explicitly supports,
so make it work by saving the state until the surface exists.

This fixes things under weston. There are bugs in mutter
that keep this from working correctly with gnome-shell.

https://bugzilla.gnome.org/show_bug.cgi?id=745303
2015-02-27 19:09:03 -05:00
Matthias Clasen
3d205a2037 wayland: Drop some pointless lines
No need for these parameter checks, really.
2015-02-27 19:09:03 -05:00
Aurimas Černius
3b10269a12 Updated Lithuanian translation 2015-02-28 00:02:57 +02:00
Matthias Clasen
6ccef21d49 Fix a typo
Follow-up fix for commit 7cee6c5cc6.
2015-02-27 17:00:08 -05:00
Olivier Fourdan
53028ff3bb wayland: Don't use g_error() on connection lost
When the Wayland compositor vanishes, all applications connected will
receive a SIGPIPE as soon as they try to use wl_display_dispatch().

Do not use g_error() to terminate the applications when this occurs,
g_error() means an error in the application while here it's not truly
the case.

Use g_warning() and exit() instead.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=745289
2015-02-27 16:26:39 -05:00
Balázs Úr
ff85f6ce3f Updated Hungarian translation 2015-02-27 21:18:14 +00:00
Balázs Úr
0507a4d39a Updated Hungarian translation 2015-02-27 21:13:55 +00:00
Emmanuele Bassi
7cee6c5cc6 gdk: Use a better error message
Having "Assertion failed: success" on the console is not going to help
anyone.
2015-02-27 21:02:16 +00:00
Piotr Drąg
ab3084b714 Updated POTFILES.in and POTFILES.skip 2015-02-27 19:46:55 +01:00
Piotr Drąg
00f4c070f4 Updated Polish translation 2015-02-27 19:37:40 +01:00
Yosef Or Boczko
668df30b60 Updated Hebrew translation 2015-02-27 16:47:30 +02:00
Rafal Luzynski
3ce3593ebf GtkListBoxRow: add g_return_if_fail to grab_focus, don't crash
Although gtk_list_box_row_grab_focus() is not a public function
it can be easily called by gtk_widget_grab_focus() with a row argument
which has been removed from the list box and has box == NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=744879
2015-02-27 06:31:06 -05:00
Efstathios Iosifidis
45210d5835 Updated Greek translation 2015-02-27 11:20:42 +00:00
Matthias Clasen
f96f69996a file chooser dialog: Prevent uneven button heights
The height of the text buttons depends on the font height,
whereas the search button has a fixed-size icon in it...
Prevent unevent heights by putting them all in a size group.

https://bugzilla.gnome.org/show_bug.cgi?id=745263
2015-02-26 21:17:06 -05:00
Matthias Clasen
6855e1eec3 app chooser dialog: Prevent uneven button heights
The height of the text buttons depends on the font height,
whereas the search button has a fixed-size icon in it...
Prevent unevent heights by putting them all in a size group.
2015-02-26 21:16:58 -05:00
Matthias Clasen
c951740cf9 Add a configure check for new enough gettext
Check that xgettext understands glade files.
2015-02-26 19:00:24 -05:00
Matthias Clasen
5840c931b3 Stop building extract-strings
It is no longer needed.
2015-02-26 16:54:16 -05:00
Matthias Clasen
b08015371b Stop using extract-headers
Since 0.18.3, xgettext can extract strings from ui files.
2015-02-26 16:54:16 -05:00
Dušan Kazik
b3a5d86d5d Updated Slovak translation 2015-02-26 11:59:18 +00:00
Efstathios Iosifidis
b618256a4c Updated Greek translation 2015-02-26 11:23:48 +00:00
Baurzhan Muftakhidinov
6a0290145d Updated Kazakh translation 2015-02-26 07:11:37 +00:00
Marek Kasik
f74067dda2 printing: Always get details of Avahi printers via IPP
Request details of Avahi browsed printers even when
we've got their PPDs already. Some options are not
present in PPD.

https://bugzilla.gnome.org/show_bug.cgi?id=743323
2015-02-25 15:58:23 +01:00
Marek Kasik
979a4c1b08 printing: Get covers for each printer individually
Since we combine Avahi browsed printers and
printers of local CUPS in one backend we need to
get covers for each printer separately.

https://bugzilla.gnome.org/show_bug.cgi?id=743323
2015-02-25 15:58:19 +01:00
Daniel Mustieles
7fa9089196 Updated Spanish translation 2015-02-25 12:34:02 +01:00
Matthias Clasen
ff0aabe576 3.15.9 2015-02-24 20:38:33 -05:00
Jonas Ådahl
f13157f4bb wayland: Don't allocate a full size SHM buffer when drawing using OpenGL
Before this patch, we'd always allocate a full size SHM buffer via
the wl_shm_pool, even though it would never be used. Instead allocate a
logical 1x1 cairo image surface.

https://bugzilla.gnome.org/show_bug.cgi?id=745076
2015-02-24 20:22:03 -05:00
Jonas Ådahl
aa81262f11 wayland: Scale up wl_egl_window according to window scale
In order to support window scales for EGL windows, resize the
wl_egl_window to the window dimension multiplied with the window scale,
just as with SHM window buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=745076
2015-02-24 20:22:03 -05:00
Jonas Ådahl
56c9eac16e wayland: Properly support changing of surface scale
When the preferred surface scale changes, for example when entering a
wl_output with a higher scale than any previous entered output, recreate
the shm surface and redraw the window content with the new window scale.

Before this patch, the internal scale would be changed, but the shm
surface would not be recreated given the new scale, i.e. we'd attach a
buffer for a different scale than wl_surface.set_scale specified.

https://bugzilla.gnome.org/show_bug.cgi?id=745076
2015-02-24 20:22:02 -05:00
Jonas Ådahl
a70b478a5c wayland: Don't ever try to set surface buffer scale when not supported
If the compositor is too old for handling surface buffer scales, never
tyr to set change it. This will effectively always leave it to its
initial state, i.e. 1.

https://bugzilla.gnome.org/show_bug.cgi?id=745076
2015-02-24 20:22:02 -05:00
Benjamin Otte
40f2af665d gdkcairo: Bail if surface is in error
Don't try to paint onto an error surface. This happens for example when
gdk_cairo_set_source_pixbuf() is called with a pixbuf that is too big
for Cairo to handle.

Spotted by Christian Boxdörfer
2015-02-25 01:55:28 +01:00
Benjamin Otte
0ab48fcc42 css: Fix _gtk_bitmask_subtract()
We were doing the wrong thing *and* writing uninitialized memory while
doing so. BAD.

Also added tests exposing these.

https://bugzilla.redhat.com/show_bug.cgi?id=1185585
2015-02-25 01:55:28 +01:00
Fran Dieguez
9e50fe0aeb Updated Galician translations 2015-02-24 22:43:36 +01:00
Piotr Drąg
e86cad1006 Updated POTFILES.in 2015-02-24 22:09:30 +01:00
Daniel Mustieles
1b578ef33a Updated Spanish translation 2015-02-24 19:21:02 +01:00
Matej Urbančič
02774f9fd5 Updated Slovenian translation 2015-02-24 19:18:22 +01:00
Matej Urbančič
d582e71ba8 Updated Slovenian translation 2015-02-24 19:04:49 +01:00
Yosef Or Boczko
f986730c14 Updated Hebrew properties translation 2015-02-24 19:31:13 +02:00
Carlos Garnacho
0c903156ef scrolledwindow: Only start fade animation on "visible" scrollbars
If a scrollbar is not shown (because of policies, or because it isn't
necessary), it doesn't make sense to start fade animations on its window
on captured motion events.
2015-02-24 14:55:23 +01:00
Yosef Or Boczko
b06908ad52 Updated Hebrew translation 2015-02-24 15:05:00 +02:00
Matthias Clasen
913e10fe3b Fix the previous commit
The C_() macro only takes string literals.
Use g_dpgettext2() instead
2015-02-23 22:25:11 -05:00
Matthias Clasen
b0b38c106d Make gtk-im-context-none work
This was added a few years ago, as a way to have _no_ im context
at all. But it didn't actually work. Make it work, and streamline
the handling of none by moving it all to gtkimmodule.c.

As part of this, add context to the translated names of all
im modules we ship.
2015-02-23 22:06:02 -05:00
Daniel Drake
aba2de3443 icontheme: allow directories with mtime 0
In order to provide a constant mtime between OS build and deploy time,
while also maintaining a hardlink content-addressed model independent of
timestamps, ostree sets all mtimes to 0.

The icon cache code currently ignores directories with mtime 0, assuming
they don't exist.

Track directory existence in a more precise way.

https://bugzilla.gnome.org/show_bug.cgi?id=745052
2015-02-23 15:09:15 -06:00
Bastian Ilsø
761c781168 getting-started: move Drawing section to bottom. 2015-02-23 21:42:56 +01:00
Daniel Mustieles
b85fc8045c Updated Spanish translation 2015-02-23 19:15:08 +01:00
Cosimo Cecchi
eddaf01676 icontheme: use desired size instead of negative for DIR_UNTHEMED SVGs
When loading SVGs from ICON_THEME_DIR_UNTHEMED GtkIconInfos,
such as those created for a GLoadableIcon, the size of the pixbuf to
load is set as a product of icon_info->scale.
But a few lines above, icon_info->scale is set to -1 for
ICON_THEME_DIR_UNTHEMED GtkIconInfos, so we'll end up always passing a
negative size to the GdkPixbuf loader, which is interpreted as the
nominal size of the image file.
Instead load the SVG at the desired scaled size in that case.

This fixes blurry icon in the notification panel in gnome-shell.

https://bugzilla.gnome.org/show_bug.cgi?id=744991
2015-02-23 09:56:06 -08:00
Cosimo Cecchi
acd72ffabe icontheme: fill correct information when loading GResource-backed GIcons
When loading a GResource-backed GFileIcon into a GtkIconInfo we
currently fail to populate the is_resource private field.
Also, since is_svg is set by looking at the filename, and
g_file_get_path() returns NULL for a GResourceFile, is_svg was always
FALSE.

https://bugzilla.gnome.org/show_bug.cgi?id=744991
2015-02-23 09:56:06 -08:00
Piotr Drąg
e7a2fc2d01 Updated POTFILES.in 2015-02-23 17:41:30 +01:00
Bastian Ilsø
ec07987a90 Getting-started: port drawing.c to GtkApplication 2015-02-23 16:00:36 +01:00
Matthias Clasen
c73ab94d3f range: Make steppers use smooth autoscrolling
This makes them work much nicer than the old timer-based
implementation.
2015-02-23 08:38:38 -05:00
Matthias Clasen
3222de2f91 range: Make zoom scrolling less sensitive
Use the new long press delay factor to make the zoom
scrolling less easy to trigger accidentally.
2015-02-23 08:38:25 -05:00
Matthias Clasen
2b6376248d long press: Add a delay-factor property
Add a way to set a delay factor that can be used
to make the long press more or less sensitive.
Making this a factor instead of exposing the delay
itself preserves the value of the setting as an
overall 'slow down long press' setting.
2015-02-23 08:37:26 -05:00
Matthias Clasen
c060d93e3d zoom scrolling: Improve the previous fix
As Sebastian pointed out, just resetting the initial slider
position was an incomplete fix, because it does not cause the
delta to be recomputed, which is important in this scenario,
because you've likely travelled some distance over the slider
before the long press kicks in.
Instead, explicitly record both the slider position and the
delta.
2015-02-23 07:28:40 -05:00
Matthias Clasen
8726c6d5d2 zoom scrolling: avoid 'jumping back'
We record the starting position on button press, but only
start the zoom mode when the long press timeout kicks in.
Depending on circumstances, this can cause a noticable jump.

Avoid this by resetting the recorded starting position after
the long press timeout. Suggested by Sebastian Keller.
2015-02-23 06:46:21 -05:00
Chao-Hsiung Liao
1402e22862 Updated Chinese (Taiwan) translation 2015-02-23 07:32:08 +00:00
Chao-Hsiung Liao
5a0ad907b4 Updated Chinese (Taiwan) translation 2015-02-23 07:30:34 +00:00
Matthias Clasen
25308477e7 Silence a compiler warning 2015-02-22 17:01:52 -05:00
Balázs Úr
44d3b71678 Updated Hungarian translation 2015-02-22 21:19:26 +00:00
Matthias Clasen
1ffcdfcc32 icon browser: Set up dnd from the detail popup
Allow dragging the various icon sizes as images.
2015-02-22 14:44:10 -05:00
Matthias Clasen
ae63b21c61 icon browser: Add some dnd support
Use a custom tree model and enable dragging from the icon view.
Currently, we just support dropping the icon name as text.
2015-02-22 14:44:10 -05:00
Matthias Clasen
967ba60303 icon browser: Activate on single-click
We want to get away from double-clicks everywhere.
2015-02-22 14:44:10 -05:00
Matthias Clasen
ee857cd261 icon browser: stop selecting
We don't need the selection here.
2015-02-22 14:44:09 -05:00
Thibault Saunier
fb581a1084 gdk/quartz: Fix mixup in attributes usage creating window implementation
First, attributes can be NULL (which is always the case when calling
gdk_window_ensure_native) so do not unconditionally dereference it.

Then the window_type should be taken directly from the GdkWindow as
in other backends (such as the X11 one for example).

https://bugzilla.gnome.org/show_bug.cgi?id=744942
2015-02-22 15:50:39 +01:00
Dušan Kazik
77c982ed3f Updated Slovak translation 2015-02-21 16:13:03 +00:00
Ignacio Casal Quinteiro
486b56e179 statusicon: missed setting one uID 2015-02-21 16:00:31 +01:00
Arnav Singh
f07677c105 statusicon: fix crash storing pointer in UINT
https://bugzilla.gnome.org/show_bug.cgi?id=696505
2015-02-21 15:49:15 +01:00
Chao-Hsiung Liao
851d784f6d Updated Chinese (Taiwan) translation 2015-02-21 11:06:35 +00:00
Chao-Hsiung Liao
178d9bd84c Updated Chinese (Taiwan) translation 2015-02-21 11:06:14 +00:00
Efstathios Iosifidis
09daf9b916 Updated Greek translation 2015-02-20 21:18:20 +00:00
Matthias Clasen
415ab252f4 3.15.8 2015-02-20 09:14:41 -05:00
Carlos Garnacho
fa48b42ef1 menubutton: Fix possible button/popover state inconsistences
While a popover is hiding, the modal grab is already gone and the toggle
button is clickable again, but clicking again at that time will result in
gtk_widget_show() trying to show an already shown widget (although fading
out and hidden soon) and the toggle button activated.

So let the menubutton set the active status only if the menu/popover
widget wasn't already shown, and ensure this doesn't get triggered by
double/triple button press events.
2015-02-20 14:44:17 +01:00
Carlos Garnacho
85ad434290 inspector: Destroy popovers on unmap
As an implementation detail, the popover hooks the fade out animation
on ::hide. Destroying the popover right away here is not a problem, but
prevents the animation from actually running. ::unmap will be run after
the animation is finished, so destroy the popover there.
2015-02-20 14:44:17 +01:00
Carlos Garnacho
cff1694c99 popover: Add show/hide transitions
These have the same visual effect and timing than the gnome-shell ones.
During the hide animation, the popover has been made to take focus
elsewhere, and refuse to take any pointer/keyboard input until the popover
is shown again.

This has been based on work from Timm Bäder.

https://bugzilla.gnome.org/show_bug.cgi?id=741405
2015-02-20 14:44:17 +01:00
Matthias Clasen
3a671994d4 scrolled window: Avoid a crash
gtk_scrolled_window_allocate_scrollbar was calling
gtk_scrolled_window_allocate_child just to get the relative
allocation, overlooking the fact that that function is only
safe to call if the scrolled window _has_ a child. Unfortunately,
gtk_scrolled_window_allocate_scrollbar will sometimes get called
when that is not the case. Since we are really only interested
in the relative allocation, just get that directly. This
fixes a segfault in the style-properties-nth-child reftest.
2015-02-20 08:28:58 -05:00
Matthias Clasen
4fc98ae345 scrolled window: Drop dead code
The allocation is never used in this function, so don't bother
getting it.
2015-02-20 08:28:58 -05:00
Marek Kasik
00f9f1cc6b printing: Use correct units for margins taken via IPP
cups_printer_get_hard_margins() returned margins in millimeters
for margins taken via IPP request instead of Units used before.
2015-02-20 12:27:12 +01:00
Carlos Garnacho
cc780116a2 dnd: Set the parent DnD wayland surface on gtk_drag_set_icon_window()
This is a better place to call this, both lets us remove all other calls,
and additionally handles the gtk_drag_set_icon_widget() entry point.
2015-02-19 20:54:25 +01:00
Ignacio Casal Quinteiro
4a7da1e143 Do not return on void functions 2015-02-19 14:46:32 +01:00
Ignacio Casal Quinteiro
b8005f4de9 pathbar: use the same parameter as in the declaration 2015-02-19 14:46:32 +01:00
Philip Withnall
8b4863f0c4 docs: Add extra symbol links to input handling documentation
Cross-reference to the API documentation more consistently.

https://bugzilla.gnome.org/show_bug.cgi?id=744054
2015-02-19 12:48:42 +00:00
Philip Withnall
09bb109f01 docs: Expand input handling documentation to cover event masks
Also try and clarify a few things about event propagation. Move
input-handling.xml into gtk-doc’s expand_content_files variable so it
automatically links to widget documentation. Add links from
gtk_widget_add_events() and friends to the new documentation.

https://bugzilla.gnome.org/show_bug.cgi?id=744054
2015-02-19 12:48:42 +00:00
Philip Withnall
668d5d8665 docs: Mention events in the input handling documentation title
Make it a little easier to find these docs when searching for ‘event’.

https://bugzilla.gnome.org/show_bug.cgi?id=744054
2015-02-19 12:48:42 +00:00
Philip Withnall
b397dd04c4 gtk: Remove documentation references to the GTK_NO_WINDOW flag
It has been removed entirely, and replaced by
gtk_widget_get_has_window().

https://bugzilla.gnome.org/show_bug.cgi?id=744054
2015-02-19 12:48:41 +00:00
Fran Dieguez
5091ae5e04 Updated Galician translations 2015-02-19 09:56:49 +01:00
Matthias Clasen
c85e32d56e color scale: simplify code a bit
It is not necessary to call gtk_widget_get_accessible repeatedly.
2015-02-18 17:28:08 -05:00
Matthias Clasen
50c848a992 Explicitly set the a11y role of tooltip windows
This seems better than trying to identify the 'tooltipness'
of the window on the other side.

https://bugzilla.gnome.org/show_bug.cgi?id=744683
2015-02-18 17:28:08 -05:00
Matthias Clasen
7624418ddf Drop nonworking code to set a11y roles of tooltips
This code relied on widget names, and we don't set those anymore.
2015-02-18 17:28:07 -05:00
Matthias Clasen
e1100813e6 widget factory: Don't make file chooser local-only
There's no reason to.
2015-02-18 17:28:07 -05:00
Balázs Úr
11960fa916 Updated Hungarian translation 2015-02-18 22:20:45 +00:00
Ting-Wei Lan
359fc25aad build: Don't use shopt in the build command
shopt command only works in bash, so we should not use it in gtk/Makefile.am.

https://bugzilla.gnome.org/show_bug.cgi?id=743647
2015-02-19 01:27:44 +08:00
Philip Withnall
3d88899072 gtk: Fix various tiny typos in documentation comments
e.g. Invalid syntax in introspection annotations, typos in object names,
accidentally using a gtk-doc comment for an internal function.
2015-02-18 11:38:37 +00:00
Philip Withnall
e160befdf8 docs: Remove non-existent symbols from gtk3-sections.txt
Eliminate a couple of gtk-doc warnings.
2015-02-18 11:38:37 +00:00
Philip Withnall
8c32f403fb docs: Ignore generated files when building documentation 2015-02-18 11:38:37 +00:00
Rico Tzschichholz
a0a1ea10a8 AppChooserDialog: Fix memleak 2015-02-18 11:38:29 +01:00
Daniel Mustieles
7233281d05 Updated Spanish translation 2015-02-18 10:55:57 +01:00
Milo Casagrande
eb995ce453 Updated Italian translation 2015-02-18 08:14:48 +00:00
Carlos Garnacho
e43ec48e83 wayland: Use display from GdkDragContext device
It will be useless to check the source window on the destination side,
it's at the moment always NULL. Fetch the display from the device instead,
which will be set for every GdkDragContext.
2015-02-17 19:50:05 +01:00
Daniel Mustieles
4162fccaa2 Updated Spanish translation 2015-02-17 18:36:57 +01:00
Daniel Mustieles
bf22ac8337 Updated Spanish translation 2015-02-17 18:36:41 +01:00
Carlos Garnacho
5a907cc094 scrolledwindow: Ensure indicator windows are created at the right place
At the time of creating the indicator window, the scrollbar allocation is
poked and reused as the initial window dimensions. This usually happens
on two circumstances, either initially (so a ::size-allocate is emitted,
relocating the windows in the right places), or post-initialization when
calling set_overlay_scrolling() (so the scrollbars already have a valid
size allocation)

However, if the scrolledwindow is unrealized, and later re-realized again,
the scrollbars will already have a valid allocation, although 0,0 based
due to being contained in the previous indicator window. This comes out
wrong then, and the indicator window is given 0,0 based coordinates too.

Fix this by refactoring the scrollbar allocation code out of size_allocate,
and also use that given size at the time of creating the indicator windows,
this will provide the right widget-relative allocation anytime.
2015-02-17 16:32:36 +01:00
Carlos Garnacho
c473afbdc9 scrolledwindow: Fully reset indicators' state on unrealize
This avoids timers to run after realize(), and inconsistent initial states
if the scrolledwindow is just realized again.
2015-02-17 16:32:36 +01:00
Matthias Clasen
b3043e429b Avoid a crash in the inspector under wayland
The Wayland-specific popover code in GtkWindow was not doing the
right thing with the separate display connection we use for the
inspector.
2015-02-17 09:37:18 -05:00
Paolo Borelli
f4510c93b7 Do not use "return" when chaining up to a void function 2015-02-17 14:54:51 +01:00
Milo Casagrande
0cf63ec892 Updated Italian translation 2015-02-17 13:43:52 +00:00
Emmanuele Bassi
0a4879b9ac glarea: Better error handling
Currently, GtkGLArea will leak GError instances set during the context
creation, if an error is set.

If any error is set post-context creation, it should be displayed even
in the case a GL context exists; for instance, we can use the error
display facility for shader compilation errors.
2015-02-17 10:21:41 +00:00
Benjamin Otte
da559c08f9 switch: Have a priv varibale in the constructor 2015-02-16 23:57:04 +01:00
Benjamin Otte
e1081bc471 switch: Change handle_x to handle_pos
Make that variable go from 0.0 to 1.0 where 0.0 means inactive (slider
is on the left) and 1.0 means active (slider is on the right).

The math is simpler that way and most importantly the value is
independent of size.
2015-02-16 23:57:04 +01:00
Benjamin Otte
86a41b108e switch: Get rid of offset member variable
We can compute it on-demand whereever we need it.
2015-02-16 23:57:04 +01:00
Benjamin Otte
1b171e812e switch: Remove unused variables from private struct 2015-02-16 23:57:03 +01:00
Benjamin Otte
295b8aab0c css: Implement animations for font-weight property 2015-02-16 23:57:03 +01:00
Benjamin Otte
0c4a42e629 css: Implement "bolder" and "lighter" font weights 2015-02-16 23:57:03 +01:00
Yosef Or Boczko
a414faa997 Updated Hebrew Property translation 2015-02-16 22:22:57 +02:00
Yosef Or Boczko
36fcd7327c Updated Hebrew translation 2015-02-16 22:21:51 +02:00
A S Alam
1500626d44 update Punjabi Translation 2015-02-16 14:15:28 -06:00
Matej Urbančič
978c364847 Updated Slovenian translation 2015-02-16 20:54:10 +01:00
Matej Urbančič
26cc941a9e Updated Slovenian translation 2015-02-16 20:41:39 +01:00
Kjartan Maraas
0550ba4208 Updated Norwegian bokmål translation. 2015-02-16 18:33:56 +01:00
Matthias Clasen
0d57d21192 Fix a misleading condition
gcc5 rightfully complains about this condition being unclear.
2015-02-15 22:00:49 -05:00
Matthias Clasen
f8961facb2 Improve two strings
Make two property blurbs better.

https://bugzilla.gnome.org/show_bug.cgi?id=744574
2015-02-15 19:55:54 -05:00
Matthias Clasen
a5d6fe4124 Updates 2015-02-15 19:49:37 -05:00
Bastian Ilsø
0080224fdb Updated grid-packing to GtkApplication. 2015-02-15 22:57:57 +01:00
Matthias Clasen
b187773053 Add style classes to the title buttons
This will let themes treat close/min/max buttons differently,
if they so desire.

https://bugzilla.gnome.org/show_bug.cgi?id=744400
2015-02-15 13:03:29 -05:00
Balázs Úr
2b31a35792 Updated Hungarian translation 2015-02-15 12:36:26 +00:00
Balázs Úr
305ecc4e82 Updated Hungarian translation 2015-02-15 12:34:39 +00:00
Emmanuele Bassi
5a6264ef5d docs: Fix "shadres" → "shaders" typo
https://bugzilla.gnome.org/show_bug.cgi?id=744394
2015-02-15 11:23:30 +00:00
Christian Hergert
bb53f893e2 stack: check for widget before calling is_ancestor()
We can hit this path during the destruction case, where widget has
been released.

This fixes a lot of superfluous error messages on console.
2015-02-14 18:11:54 -08:00
Jonas Ådahl
5889905d1d wayland: Update to xdg-shell unstable v5
Only trivial changes needed.

https://bugzilla.gnome.org/show_bug.cgi?id=744455
2015-02-14 20:54:47 -05:00
Matej Urbančič
00327eb509 Updated Slovenian translation 2015-02-14 20:58:40 +01:00
Muhammet Kara
a9930ba302 Updated Turkish translation 2015-02-14 17:08:13 +00:00
Matthias Clasen
b3abfaf9ee GtkSearchEngine: Add debug spew
This lets us find out which search engine implementation is
in use.
2015-02-14 01:03:38 -05:00
Matthias Clasen
ff87c6516b file chooser: Allow to limit search
Add a button to allow restricting search to the current
folder (and subdirectories). This makes the search more
useful, and makes the file chooser more similar to
nautilus.
2015-02-14 01:03:38 -05:00
Matthias Clasen
2c5ea0dd45 file chooser: Add a location column for search
In search, we show files from differnt locations, and it makes
sense to show where they come from. This makes the file chooser
more similar to nautilus, too.
2015-02-14 01:03:38 -05:00
Matthias Clasen
61012f3efe file chooser: Don't open folders unexpectedly
Folders that show up among search results were unexpectedly
returned even for GTK_FILE_CHOOSER_ACTION_OPEN. Change things
around so that we switch to the folder instead, which is the
behavior we had in GTK+ 2.x.

https://bugzilla.gnome.org/show_bug.cgi?id=744204
2015-02-14 01:03:38 -05:00
Jasper St. Pierre
a34a0224e4 gtkwindow: Don't set the background if the window is app-paintable
This fixes transparent DND windows.
2015-02-13 18:22:34 -08:00
Pier Luigi Fiorini
6ae521bb32 wayland: Do not require latest wl_seat
Some compositors might not offer wl_seat 4 resulting in GTK+ clients not
working on that compositor.

wl_seat 4 introduces keyboard repeat information, but when that information
is missing it is retrieved from settings, hence there's no reason to
require wl_seat 4.

This patch was tested against QtCompositor (5.5, dev branch)
and Weston 1.6.1.

Reviewed-by: Daniel Stone <daniels@collabora.com>

https://bugzilla.gnome.org/show_bug.cgi?id=744172
2015-02-13 19:05:32 -05:00
Lars Uebernickel
f3110e4103 Rename GtkSidebar to GtkStackSidebar
GtkSidebar is too generic and doesn't fully convey what the widget does.

https://bugzilla.gnome.org/show_bug.cgi?id=744094
2015-02-13 18:01:56 +01:00
Matthias Clasen
ac497c6e8f csd: Always raise on primary titlebar click
This matches more closely what typical window managers do.
Pointed out in
https://bugzilla.redhat.com/show_bug.cgi?id=1158472
2015-02-13 08:51:28 -05:00
Matthias Clasen
eeb7bff0bb Forgotten file 2015-02-13 08:51:28 -05:00
Matthias Clasen
99a6495d6c Bump version
So apps can require 3.15.7 for new api.
2015-02-13 08:51:28 -05:00
Chun-wei Fan
933ee3af56 gdkglcontext-win32.c: Fix Build on C89 Compilers
Make sure variables are declared at the top of the block.
2015-02-13 18:36:34 +08:00
Matthias Clasen
8d7a235a04 notebook: Add api to complete tab dnd from the outside
This is necessary to avoid unwanted drag cancel animations,
now that GtkNotebook is careful about cancelling a drag
when the dragged tab disappears unexpectedly.
2015-02-12 17:33:10 -05:00
Piotr Drąg
1bf02fd773 Updated POTFILES.in 2015-02-12 18:53:41 +01:00
Emmanuele Bassi
d066e7541e Remove GdkGLProfile
The existence of OpenGL implementations that do not provide the full
core profile compatibility because of reasons beyond the technical, like
llvmpipe not implementing floating point buffers, makes the existence of
GdkGLProfile and documenting the fact that we use core profiles a bit
harder.

Since we do not have any existing profile except the default, we can
remove the GdkGLProfile and its related API from GDK and GTK+, and sweep
the whole thing under the carpet, while we wait for an extension that
lets us ask for the most compatible profile possible.

https://bugzilla.gnome.org/show_bug.cgi?id=744407
2015-02-12 17:51:31 +00:00
Daniel Mustieles
ccc0eafbc3 Updated Spanish translation 2015-02-12 18:40:56 +01:00
Emmanuele Bassi
390a42fa60 gl: Add gdk_gl_context_get_version()
Store the OpenGL version when we first do the extensions check; this
allows client code to check the available GL version without requiring a
call to gdk_gl_context_make_current() and epoxy_gl_version().
2015-02-12 14:29:44 +00:00
Emmanuele Bassi
f52a59d414 docs: Specify the minimum version of GL provided by the core profile
When using GDK_GL_PROFILE_3_2_CORE, we are not only specifying that the
GDK should create a core profile; we are also specifying that the
minimum required version of OpenGL is set to 3.2.

We should also specify that the GDK_GL_PROFILE_DEFAULT profile is an
alias for GDK_GL_PROFILE_3_2_CORE.
2015-02-12 13:32:02 +00:00
Emmanuele Bassi
c372f95a41 glarea: Add accessors for the required GL version
Specifying the version of OpenGL is enough of a common operation that it
should not require overriding the creation of the GdkGLContext.
2015-02-12 13:25:12 +00:00
Emmanuele Bassi
ec112a772b glarea: Update documentation
Drop the fixed pipeline example code.

https://bugzilla.gnome.org/show_bug.cgi?id=744394
2015-02-12 13:19:21 +00:00
Emmanuele Bassi
59679daeae glarea: Clean up the header 2015-02-12 12:44:01 +00:00
Emmanuele Bassi
c115c479dc docs: Add missing GdkGLContext symbols 2015-02-12 12:40:03 +00:00
Emmanuele Bassi
022724aa69 gl: Drop profile for gdk_window_create_gl_context()
Now that we have a two-stages GL context creation sequence, we can move
the profile to a pre-realize option, like the debug and forward
compatibility bits, or the GL version to use.
2015-02-12 12:34:28 +00:00
Lionel Landwerlin
015bf99816 gtk: x: fix compilation without x11 backend
https://bugzilla.gnome.org/show_bug.cgi?id=744148
2015-02-12 10:55:52 +00:00
Bastien Nocera
973060deb5 main: Make gtk_get_option_group() available to bindings
Now that GOptionGroup is registered as a boxed type [1], don't skip it
in gobject-introspection.

[1]: See https://bugzilla.gnome.org/show_bug.cgi?id=743349

https://bugzilla.gnome.org/show_bug.cgi?id=743350
2015-02-12 11:53:26 +01:00
Lars Uebernickel
d825249b42 gtklistbox: add bind_model()
gtk_list_box_bind_model() binds a GListModel to a GtkListBox.

This is a first step towards having GListModel support in Gtk. It's not
useful for large models, because GtkListBox always creates all widgets
for all rows.
2015-02-12 11:22:07 +01:00
Timm Bäder
9141eeb60e GtkListBoxRow: Update the listbox's cursor row when focusing
https://bugzilla.gnome.org/show_bug.cgi?id=708320
2015-02-12 09:58:29 +01:00
Matthias Clasen
b876e036b2 file chooser: Allow opening folders in the file manager
This has been suggested in
https://bugzilla.gnome.org/show_bug.cgi?id=325150#c2
2015-02-11 23:34:04 -05:00
Armin K
6886f479fe wayland: Implement minimize support
Use the existing xdg_surface API for minimization.

https://bugzilla.gnome.org/show_bug.cgi?id=695945
2015-02-11 22:01:38 -05:00
Marco Trevisan (Treviño)
c82ad2c129 mir, gl: Ensure we use the 3.2 core profile
Emit an error if the profile is different.
2015-02-12 03:34:05 +01:00
Marco Trevisan (Treviño)
ce31df3238 mir: Switch GDK_GL_PROFILE_DEFAULT to mean 3_2_CORE
Instead of LEGACY.
2015-02-12 03:32:11 +01:00
Marco Trevisan (Treviño)
f9503ac189 mir, GL: Split GL context creation in two phases
Move egl_context initialization in gdk_gl_context_realize

 • gdk_window_create_gl_context() creates a GdkGLContext
 • gdk_gl_context_realize() creates the underlying resources

https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-12 03:03:18 +01:00
Marco Trevisan (Treviño)
8a52ace8de configure.ac: bump mirclient dependency to 0.11 2015-02-12 02:20:24 +01:00
Matthias Clasen
278fa902e2 Revert "image: Optimize non-resize changes"
This reverts commit 6276b9cda0.

This change was causing problems in gnome-mines. Revert it
until we can figure out what exactly is going wrong there.
See https://bugzilla.redhat.com/show_bug.cgi?id=1190887
2015-02-11 12:07:32 -05:00
Kjartan Maraas
879956e2f5 Updated Norwegian bokmål translation. 2015-02-11 16:46:00 +01:00
Kjartan Maraas
c72a8a538c Updated Norwegian bokmål translation. 2015-02-11 16:37:34 +01:00
Matthias Clasen
b9f710217f Bump glib requirement
Needed for g_autoptr.
2015-02-10 20:15:58 -05:00
Matthias Clasen
295ac9135f Bump version 2015-02-10 18:04:15 -05:00
Benjamin Otte
b763bb0594 stylecontext: Don't use cache when unsaved
Fixes image-load-from-file reftest
2015-02-10 23:49:40 +01:00
Matthias Clasen
9e96461aa5 Updates 2015-02-10 11:29:59 -05:00
Matthias Clasen
4dee1646a1 Fix annotations
The function gtk_label_set_attributes() is also used to
unset attributes, by passing %NULL. Reflect that in the
argument annotations.
2015-02-10 06:59:01 -05:00
Emmanuele Bassi
5666522ab3 gl: Fix the required version setter
We don't allow a version tuple to be lower than (3, 2), but we should
allow versions above that.

https://bugzilla.gnome.org/show_bug.cgi?id=744212
2015-02-10 10:16:53 +00:00
Chun-wei Fan
60195ab021 win32/gl: Ensure we use the 3.2 core profile
Emit an error if the profile is different.

This is a follow-up commit to commits cc45e82 (x11/gl: Ensure we use the
3.2 core profile) and 2d9081d (wayland/gl: Ensure we use the 3.2 core
profile), so that we do the same on GDK-Win32.  Update variable names and
comments so that the code is clearer to people, as we still need a
temporary legacy WGL context first before we can use
wglCreateContextAttribsARB() to create a WGL core (3.2+) context.

https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-10 16:21:29 +08:00
Emmanuele Bassi
03f5d5a5e4 gl: Put shaders in static storage
We are not changing the shader code.

The compiler will hopefully put them in the .rodata section.
2015-02-10 03:33:02 +00:00
Niels Nesse
50187ae86d gdkgl should use shader version 1.50
Using version 1.20 with a forward compatible 3.2 core context is incorrect
since OpenGL 3.2 deprecates shader version 1.20 (See section E.2). The latest
fglrx drivers will not compile these shaders.

https://bugzilla.gnome.org/show_bug.cgi?id=744203
2015-02-10 03:30:09 +00:00
Aurimas Černius
ab919deeef Updated Lithuanian translation 2015-02-09 22:59:13 +02:00
Emmanuele Bassi
6bf55142ee demo: Change the resource path for the shaders
We need to use the same name as the "plugin" so that the main UI will
display the resources inside a notebook tab.
2015-02-09 19:32:38 +00:00
Emmanuele Bassi
843475bd2e gl: Drop GdkGLContextClass.upload_texture()
It's unnecessary to allow per-backend overrides.
2015-02-09 19:10:31 +00:00
Emmanuele Bassi
3b4bf963f6 demo: Move the GLSL shaders to resources
It's easier to use them or modify them as separate files, instead of
inlined inside the C source.

https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:31 +00:00
Emmanuele Bassi
2d35053d97 gl: Clean up the required version accessors
We can simplify the code, since we only have core GL profiles in GDK.

https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:30 +00:00
Emmanuele Bassi
4ad887f4bf docs: We do not support non-core GL profiles
No need to mention that some API only works on core GL profiles in the
GdkGLContext docs.

https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:30 +00:00
Emmanuele Bassi
601c49ef39 gl: Clean up pre-requisite checks for GdkGLContext setters
We don't support non-core profiles.

https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:30 +00:00
Emmanuele Bassi
2d9081d117 wayland/gl: Ensure we use the 3.2 core profile
Emit an error if the profile is different.

https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:30 +00:00
Emmanuele Bassi
cc45e828df x11/gl: Ensure we use the 3.2 core profile
Drop the dead code for the legacy profile, and return an error when
realizing if the profile is incorrect.

https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:30 +00:00
Emmanuele Bassi
01d1cdc76c demos: Update the GtkGLArea demo code
Same way we updated the testglarea test code.

https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:30 +00:00
Emmanuele Bassi
b87034a985 tests: Update testglarea
Since we dropped the legacy OpenGL compatibility profile, we need to use
recent OpenGL APi and concepts. This also means that the example code
gets a tad more complicated.

https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:30 +00:00
Emmanuele Bassi
1d3cc65e89 gl: Add more debugging notes
https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:30 +00:00
Emmanuele Bassi
5a3b28aaf1 glarea: Do not use extension API
We are using GL contexts with Core GL profiles, so we need to use the
proper API, not the one provided by extensions.

https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:30 +00:00
Emmanuele Bassi
395125bcfb gl: Do not use the extension API for core GL
Since we are using a Core GL profile, we need to drop the
extension-based API.

https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:30 +00:00
Emmanuele Bassi
4b8b3b431b gl: Drop OpenGL legacy profile
We simply don't want to care about legacy OpenGL.

All supported platforms also have support for OpenGL ≥ 3.2; it would
complicate the internal code; and would force us to use legacy GL
contexts internally if the first context created by the user is a legacy
GL context, and disable creation of core-3.2 contexts after that.

We will need to fix all our code examples to use the Core 3.2 profile.

https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:30 +00:00
Emmanuele Bassi
6aaa6c337b gl: Move getters for context options to the public API
They can be useful for third party code as well.

https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:30 +00:00
Emmanuele Bassi
f7497daee9 Switch GDK_GL_PROFILE_DEFAULT to mean 3_2_CORE
Instead of LEGACY.

https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:30 +00:00
Chun-wei Fan
4c091db6c2 win32/gl: Use the GdkGLContext options
https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:30 +00:00
Chun-wei Fan
ba56f11702 GDK-Win32: Split GL context creation in two phases
Like what is being done in the X11 and Wayland backends, create the
GdkWin32GLContext in 2 steps, where we only create the actual WGL context
in _gdk_win32_gl_context_realize().

https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:28 +00:00
Emmanuele Bassi
42a895e85e wayland/gl: Use the GdkGLContext options
https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:05 +00:00
Emmanuele Bassi
3425f7fe5a x11/gl: Use the GdkGLContext options
When creating an OpenGL context using the glXCreateContextAttribs()
function.

https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:05 +00:00
Emmanuele Bassi
fa90052299 gl: Add context options
Users of the GdkGLContext API should be allowed to set properties on the
shim GdkGLContext instance prior to realization, so that the
backend-specific implementation can use the value of those properties
when creating the windowing system specific resources.

The main three options are:

 • a major/minor version tuple, to request a specific GL version
 • a debug bit, to request a "debug context", which provides additional
   validation and run time checking
 • a forward compatibility bit, to request a context that does not
   have deprecated functionality

See also:
 - https://www.opengl.org/registry/specs/ARB/glx_create_context.txt

https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:05 +00:00
Emmanuele Bassi
22e6f37c9c GL: Split GL context creation in two phases
One of the major requests by OpenGL users has been the ability to
specify settings when creating a GL context, like the version to use
or whether the debug support should be enabled.

We have a couple of requirements in terms of API:

 • avoid, if at all possible, the "C arrays of integers with
   attribute, value pairs", which are hard to write and hard
   to bind in non-C languages.
 • allow failing in a recoverable way.
 • do not make the GL context creation API a mess of arguments.

Looking at prior art, it seems that a common pattern is to split the
construction phase in two:

 • a first phase that creates a GL context wrapper object and
   does preliminary checks on the environment.
 • a second phase that creates the backend-specific GL object.

We adopted a similar pattern:

 • gdk_window_create_gl_context() creates a GdkGLContext
 • gdk_gl_context_realize() creates the underlying resources

Calling gdk_gl_context_make_current() also realizes the context, so
simple GL users do not need to care. Advanced users will want to
call gdk_window_create_gl_context(), set up the optional requirements,
and then call gdk_gl_context_realize(). If either of these two steps
fails, it's possible to recover by changing the requirements, or simply
creating a new GdkGLContext instance.

https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:04 +00:00
Stas Solovey
8f50148a34 Updated Russian translation 2015-02-08 22:14:05 +00:00
Kjartan Maraas
614556180a Updated Norwegian bokmål translation 2015-02-08 19:34:46 +01:00
Piotr Drąg
87480d7d1c Updated POTFILES.skip 2015-02-07 17:06:58 +01:00
Benjamin Otte
1116914ea0 css: Move scale to GtkStyleProviderPrivate
This way, we can remove it as a separate argument from
gtk_css_value_compute() and allow computation to only depend on one
thing: the style provider.
2015-02-06 11:26:31 +01:00
Benjamin Otte
808bfe0a98 settings: Provide a default style cascade per scale
This guarantees we only create 1 extra style cascade in total for hidpi
and not one per style context.

Style cascades are now nested like this:

GtkSettings root cascade (scale == 1)
 |
 +-- GtkSettings per scale cascade (for any scale, no custom providers)
 |
 +-- GtkStyleContext custom cascade (for any scale, custom providers)

This requires a bunch of care when changing cascade-related properties
inside GtkStyleContext, so that it ends up with a properly setup
cascade, but I think I got those cases right.

The only thing we don't do yet is reverting to a GtkSettings cascade
when the last custom provider is removed from a custom cascade.
2015-02-06 11:26:31 +01:00
Benjamin Otte
9209c4ea41 stylecontext: Store the scale value in the cascade
This is in preparation for the next commits.
2015-02-06 11:26:31 +01:00
Chun-wei Fan
0b06b1e3f7 gdkglcontext-win32.h: Clean Up a Bit
We don't have a Win32-specific ->upload_texture() anymore, so don't
indicate so.  Left out this part from my previous commit.
2015-02-06 13:00:59 +08:00
Chun-wei Fan
24e6bda264 GDK-Win32: Drop Win32-specific ->upload_texture()
The default ->upload_texture() works also for Windows since commit 27cf0fa,
as some of the problems described in 742953 also applied for GL core
contexts on Windows as well before 27cf0fa.  Clean up the GDK-Win32 code a
little bit as a result.
2015-02-06 12:41:38 +08:00
Benjamin Otte
93c3b90f6a treeview: Fix copy/paste bug
Introduced in 7eecb16404
2015-02-06 03:13:59 +01:00
Benjamin Otte
89f635fee1 css: Add -gtk-dpi CSS property hack
This property is necessary to ensure widgets automatically update after
the text scale factor is changed desktop-wide.

And if I'm already doing a property like this, I can make it
overridable. So now you can override the dpi per-widget with CSS like
GtkSwitch {
  -gtk-dpi: 48;
}
if you want to debug things.

Long-term, we want to get rid of this property and insist on dpi being
96 everywhere and people can change the font size to get larger fonts.
2015-02-05 18:57:29 +01:00
Benjamin Otte
7eecb16404 treeview: Don't create an overly large pixel cache
GPUs generally have problems when you create a 35000px wide surface.
Luckily X catches this and sends a BadAlloc. Which GTK immediately
abort()s on.

Testcase included.

https://bugzilla.redhat.com/show_bug.cgi?id=1163579
2015-02-05 18:57:29 +01:00
Benjamin Otte
98ee594f73 blur: Simplify return_if_fail() 2015-02-05 18:57:29 +01:00
William Hua
0a64a4f3c0 mir: release surface before rendering parent
We should remove the mir and cairo surface before rendering the
transient_for, which will regenerate the cairo surface anyways.
Otherwise, we end up releasing both, when we only really want to get rid
of the mir surface.
2015-02-05 17:26:19 +01:00
William Hua
85c5f6058a mir: don't always request mir surfaces
Some child window behaviour is faked by painting in the parent, so we
don't bother creating the Mir surface in that case.
2015-02-05 17:26:19 +01:00
William Hua
bee39d2251 mir: reconstruct surface if window is moved 2015-02-05 17:26:19 +01:00
William Hua
16b250f9bb mir: stop using deprecated surface api 2015-02-05 17:26:19 +01:00
William Hua
5eacc92ba7 mir: fix issues with mouse over parent menu
Mouse over a parent menu[bar] didn't work while the menu was open.
The fix was to correct the behaviour of pointer crossing events so that
the pointer appears to be only inside one window at a time.

See: http://tronche.com/gui/x/xlib/events/window-entry-exit/normal.html
2015-02-05 17:26:19 +01:00
William Hua
6a3904cf0c mir: add back window hierarchy functions 2015-02-05 17:26:19 +01:00
William Hua
c2afa674e2 mir: stop forwarding motion events to subwindows 2015-02-05 17:26:19 +01:00
William Hua
901bc2957d mir: generate leave events for transient children 2015-02-05 17:26:19 +01:00
Marco Trevisan (Treviño)
737e598a17 mir: use monitor plug names more similar to the ones used in Xmir 2015-02-05 17:26:18 +01:00
Marco Trevisan (Treviño)
9a84c3e0f5 mir: only paint background if window has one 2015-02-05 17:26:18 +01:00
Marco Trevisan (Treviño)
38d46aacae mir: use old scrolling system if we get simple integer values 2015-02-05 17:26:18 +01:00
William Hua
584cfff90a mir: end the current grab on ungrab 2015-02-05 17:26:18 +01:00
William Hua
e843d94405 mir: only render non-top-level transients. 2015-02-05 17:26:18 +01:00
Marco Trevisan (Treviño)
9abf990656 mir: handle new MirCloseSurfaceEvent 2015-02-05 17:26:18 +01:00
William Hua
5ac5f6f81a mir: reset cursor_inside on hide/withdraw
Without this, we generate incorrect crossing events for transient
windows.
2015-02-05 17:26:18 +01:00
William Hua
8e0abb4bac mir: disable some debug output 2015-02-05 17:26:18 +01:00
William Hua
4f19be1c82 mir: skip windows that aren't visible 2015-02-05 17:26:18 +01:00
Marco Trevisan (Treviño)
05de5b02cb mir: fix IsModifierKey definition 2015-02-05 17:26:18 +01:00
Marco Trevisan (Treviño)
345140008e mir: check the log events env variable just once 2015-02-05 17:26:18 +01:00
Marco Trevisan (Treviño)
7e5b216511 mir: set event source device as well 2015-02-05 17:26:18 +01:00
William Hua
7c2e3a812a mir: fix time conversion macro 2015-02-05 17:26:17 +01:00
Marco Trevisan (Treviño)
54f9263f19 mir: implement stub _gdk_mir_keymap_key_is_modifier
Using IsModifierKey for now
2015-02-05 17:26:17 +01:00
Marco Trevisan (Treviño)
a8b1e81816 mir: check (using simple keycode checking) if we're handling a modifier key 2015-02-05 17:26:17 +01:00
Marco Trevisan (Treviño)
9e2eb5d2f6 mir: compute the modifiers using the saved button_state on key events 2015-02-05 17:26:17 +01:00
Marco Trevisan (Treviño)
7d4066de41 mir: add a NANO_TO_MILLI conversion macro 2015-02-05 17:26:17 +01:00
Marco Trevisan (Treviño)
6b6af59b9b mir: properly converts mir nanoseconds timestamps to milliseconds 2015-02-05 17:26:17 +01:00
Marco Trevisan (Treviño)
cb19fd50cb mir: use actual events time 2015-02-05 17:26:17 +01:00
William Hua
948afc68f6 mir: add timestamps to generated GdkEvents
We need this because it fixes menu activation. The menu activation code
looks at the time between events to determine if mouse clicks happen too
quickly.
2015-02-05 17:26:17 +01:00
William Hua
f1cfd23cd2 mir: pass motion events down to transient children 2015-02-05 17:26:17 +01:00
William Hua
e2320678ae mir: use parent_window's impl for GDK_INPUT_ONLY windows
Fixes a crash that occurs when the user selects text.
2015-02-05 17:26:17 +01:00
Carlos Garnacho
6b82ad48f6 scrolledwindow: Don't hover the scrollbars while a button is being pressed
This avoids showing the scrollbars if we are positive the child widget
is being manipulated, regardless of the pointer being close to any of these.
On the next motion event after finishing the operation, the scrollbar will
be shown if necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=743894
2015-02-05 17:24:29 +01:00
Carlos Garnacho
4ba2c9ad87 popover: Unset the grab when the popover loses its parent
This ensures the grab and signal handlers are removed if the parent goes
NULL.
2015-02-05 15:09:51 +01:00
Carlos Garnacho
d053db289e window: Unparent popover before unmapping/unrealizing
Otherwise spurious invariants warnings may happen before the popover
is removed from the window.
2015-02-05 15:09:35 +01:00
Carlos Garnacho
cc511268a0 window: call gtk_widget_unmap() on popover widgets unconditionally
is_visible() wasn't the right check to perform here before unmapping,
and gtk_widget_unmap() already avoids being doubly called by checking
gtk_widget_get_mapped() anyway.
2015-02-05 15:09:28 +01:00
Carlos Garnacho
5837c1c710 popover: Keep a ref on the parent scrollable
This ensures the scrollable is still alive on dispose(), and properly unset
after disconnecting all signal handlers.
2015-02-05 15:08:12 +01:00
Matthias Clasen
b15193943a GtkStatusIcon: Expand deprecation docs
https://bugzilla.gnome.org/show_bug.cgi?id=743975
2015-02-05 10:42:57 +01:00
Benjamin Otte
edec64cda3 stylecontext: Don't crah when invalidate() is called on saved context
We need to invalidate the root node, not the current one.
Fixes crashes on startup of eclipse.

Testcase included.

https://bugzilla.redhat.com/show_bug.cgi?id=1185828
2015-02-04 21:20:29 +01:00
Benjamin Otte
473ab791ff stylecontext: Do not have a default style
A bunch of applications expect the style to be as close to the actual
style as possible even during creation of the widget. Try to accomodate
these apps.

This reverses the effects of 27285f1f0f

https://bugzilla.gnome.org/show_bug.cgi?id=743395
https://bugzilla.redhat.com/show_bug.cgi?id=1185999
2015-02-04 18:36:11 +01:00
Benjamin Otte
7281419341 css: Having a static style per screen isn't useful
Just have one static style for everything.
2015-02-04 18:36:10 +01:00
Lars Uebernickel
3e81653bd3 Add support for loading gtk3-only modules
Introduce GTK3_MODULES environment variable for modules that don't work
in gtk3. The list of modules is now $GTK3_MODULES:$GTK_MODULES.

https://bugzilla.gnome.org/show_bug.cgi?id=743917
2015-02-04 13:42:39 +01:00
Chun-wei Fan
2820c342f6 MSVC Builds: Rename "install" Projects
Rename the "install" projects as "gtk-install" as we are planning to have a
grand solution file that incorporates all project files of the GTK+ stack
with their dependencies, to make it easier for people to build GTK+ from
scratch from a stock installation of Visual Studio 2008 and later.
2015-02-04 13:06:16 +08:00
Chun-wei Fan
8f3bd8ef0c MSVC Builds: "Install" autocleanup headers
These are public headers that are needed in the package, although the
macros are essentially no-ops for Visual Studio builds currently.
2015-02-04 12:42:24 +08:00
Bastian Ilsø
9c49144cbe Add reference to HowDoI and getting-started 2015-02-02 20:52:35 +01:00
Emmanuele Bassi
4b173fcde9 Bump version to 3.15.5
We need the bump in order to allow projects to depend on newly added
API.
2015-02-02 16:51:14 +00:00
Carlos Garnacho
6f07d5e761 x11: Detect libinput touchpads
These aren't reported as XIDependentTouch devices, so make it poke a
property that's specific to touchpads managed by the libinput driver.
2015-02-02 13:55:38 +01:00
Víctor Manuel Jáquez Leal
64f26db038 gtkx: add missing header
The header file gdk/x11/gdkx-autocleanups.h is not installed, but
it is required by gdkx.h

https://bugzilla.gnome.org/show_bug.cgi?id=743640
2015-02-02 13:47:06 +01:00
Carlos Garnacho
93ae728cc6 scrolledwindow: Don't hide indicators if leaving towards a child
In that case the scrolledwindow still gets events through the captured
handler, and can thus still control visibility, so hiding the indicators
in this case can only lead to flashing.
2015-02-02 13:01:52 +01:00
Daniel Mustieles
e82d471c55 Updated Spanish translation 2015-02-02 11:58:00 +01:00
Alexander Larsson
6aec79cbaa gtkx: Add support for g_autoptr()
https://bugzilla.gnome.org/show_bug.cgi?id=743640
2015-02-02 09:36:09 +01:00
Alexander Larsson
88d166d8cc gtkunixprint: Add support for g_autoptr()
https://bugzilla.gnome.org/show_bug.cgi?id=743640
2015-02-02 09:32:59 +01:00
Alexander Larsson
8c361fd7e2 gtk: Add support for g_autoptr()
https://bugzilla.gnome.org/show_bug.cgi?id=743640
2015-02-02 09:31:27 +01:00
Alexander Larsson
a71ff33266 gdk: Add support for g_autoptr()
https://bugzilla.gnome.org/show_bug.cgi?id=743640
2015-02-02 09:28:22 +01:00
Chun-wei Fan
eacfad7ed6 gtkstylecontext.c: Include fallback-c89.c
round() is now being used in the function, so that compilers without
round() in their math.h is supported.
2015-02-02 15:00:45 +08:00
Matthias Clasen
31d3be96e4 Be safe against stray booleans
Since gboolean is a typedef for int, the compiler won't complain
about gdk_window_set_event_compression (w, 2). So, make it work.

https://bugzilla.gnome.org/show_bug.cgi?id=742566
2015-02-01 17:30:10 -05:00
Matthias Clasen
4a531ec6ab Plug another memory leak in plugman 2015-02-01 11:07:12 -05:00
Felix Riemann
f780370499 plugman: Fix leaking attribute string
https://bugzilla.gnome.org/show_bug.cgi?id=743770
2015-02-01 11:06:21 -05:00
Cosimo Cecchi
404e2753c4 scrolledwindow: add a new edge-reached signal
This will be used to just detect when an edge of the scrollable area is
reached - as opposed to the edge-overshot signal that is emitted when
the user scrolls past the edge.

https://bugzilla.gnome.org/show_bug.cgi?id=742848
2015-01-31 23:08:17 +00:00
Matthias Clasen
48a41b0119 Reduce symbolic icon warnings to a debug message
These icons are out there in the wild, and the warning causes
distcheck to fail. So, reduce it to a debug message.
2015-01-31 14:32:17 -05:00
Dušan Kazik
5f977deb4f Updated Slovak translation 2015-01-31 11:07:59 +00:00
Matthias Clasen
6276b9cda0 image: Optimize non-resize changes
Suggested by Owen in

https://bugzilla.gnome.org/show_bug.cgi?id=613833
2015-01-30 23:32:50 -05:00
Benjamin Otte
bece876f8e stylecontext: Use old rounding for get_padding/border/margin()
610f7e8f70 changed the way we query those
values for performance reasons but didn't copy the rounding used.

Fixes border-half-pixel reftest.
2015-01-31 02:25:18 +01:00
Benjamin Otte
3575df8ee2 glarea: Remove useless function
The function should have been gone in
27cf0fa34c
2015-01-31 01:55:04 +01:00
Benjamin Otte
f1ec76a9c1 roundedbox: Treat path segments differently
If a side of the box is 0px wide, make the corners owned by the adjacent
sides. This avoids spilling over of unwanted colors from the 0-width
side into the corner.

This is the fix that should actually have been part of
7e5ac3a58d but my amazing amending skills
got rid of it when amending the test.
2015-01-31 01:49:37 +01:00
Matthias Clasen
65dadd37fc Updates for 3.15.5 2015-01-30 19:34:25 -05:00
Matthias Clasen
561ff51abb Fix an oversight
Commit ff256956b2 introduced a frame_clock_events_paused
flag, but only ever set it to TRUE, instead of unsetting it when
events are resumed. This was leading to assertion failures in
_gdk_display_unpause_events().
2015-01-30 18:42:06 -05:00
Matias De lellis
7ff3ef3e68 GtkSettings: Consider default settings for font hinting and antialias
Arrange things so that gtk-xdg-hinting==-1 and gtk-xfg-antialias==-1
end up as CAIRO_HINT_STYLE_DEFAULT and CAIRO_ANTIALIAS_DEFAULT in the
cairo font options.

This will not change anything on Linux desktops where xsettings will
always provide values different from -1. But on other platforms, we
can benefit from getting the platform-specific defaults in cairo.

Based on the first patch in:
https://bugzilla.gnome.org/show_bug.cgi?id=735316
2015-01-30 18:29:53 -05:00
Bastian Ilsø
a1f8ffce4e Getting started: BIG update of basics section
https://bugzilla.gnome.org/show_bug.cgi?id=743680
2015-01-30 17:38:08 -05:00
Tom Hughes
ff256956b2 Resume events when disconnecting from a frame clock
If we are disconnecting from a frame clock that has paused event
processing and hasn't issued a resume yet make sure we resume the
events or they will stay blocked forever.

https://bugzilla.gnome.org/show_bug.cgi?id=742636
2015-01-30 17:32:58 -05:00
Balázs Úr
d86d406c99 Updated Hungarian translation 2015-01-30 21:29:35 +00:00
Balázs Úr
71f5eec2e0 Updated Hungarian translation 2015-01-30 21:26:29 +00:00
Matthias Clasen
4f1780c782 Robustness fixes for drag cancel animation
gtk_widget_get_frame_clock() can return NULL. Deal with that
by silently stopping the drag cancel animation in this case.
2015-01-30 10:13:29 -05:00
Matthias Clasen
34c29d8d3c testnotebookdnd: Defer deletion to an idle
The code here was always a bit buggy: We removed the tab from
the notebook in a ::drag-data-received handler. But with
GTK_DEST_DEFAULT_DROP, that signal is emitted before we inform
the source side that the drag is finished. With its improved drag
handling, GtkNotebook now interprets this as a 'spontaneous'
removal of the tab being dragged, and cancels the drag, leading
to an unwanted cancel animation.

The easiest fix is to just defer the tab removal to an idle.
2015-01-30 10:13:28 -05:00
Matthias Clasen
3fc21b4f3f notebook: Protect removal-from-within
When a tab is dropped, we have to remove it from the notebook to
insert it elsewhere. This is expected part of the tab dnd operation,
and we need to differentiate it from 'spontaneous' removals which
cause us to cancel the drag operation.
2015-01-30 10:13:28 -05:00
Matthias Clasen
63104944a3 notebook: Make dnd safe against tab disappearance
when the dragged tab is being removed during the drag operation,
we need to cancel the drag. To do so, we have to keep around
a reference to the drag context.

This should fix
https://bugzilla.gnome.org/show_bug.cgi?id=732051
2015-01-30 10:13:15 -05:00
Matthias Clasen
3a05d9b5a0 notebook: Make reordering safe for tab disappearance
If the dragged tab is removed during reordering, we need to
call gtk_notebook_stop_reorder(), to clean up and bring the
remaining tabs back in order.
2015-01-30 09:39:26 -05:00
Matthias Clasen
c160ba0696 dnd: Allow programmatic drag cancellation
Add a gtk_drag_cancel() function that can be used on the
source side to cancel an ongoing drag operation. This can
be useful, e.g. if the data that is being dragged becomes
unavailable.
2015-01-30 09:38:41 -05:00
Matthias Clasen
f2cfe9ed74 dnd: Make dest side safe against destroy
Use a weak pointer to clean up when the current drag destination
gets destroyed.
2015-01-30 00:05:33 -05:00
Matthias Clasen
0367f785ef file chooser button: Make dnd work as expected
Update the button contents when accepting a drop.

https://bugzilla.gnome.org/show_bug.cgi?id=743451
2015-01-29 21:29:22 -05:00
Sveinn í Felli
1c8b77637a Updated Icelandic translation 2015-01-29 15:37:35 +00:00
Lapo Calamandrei
4188069db9 Adwaita: add comments 2015-01-29 11:34:01 +01:00
Lapo Calamandrei
c6eb926e4a Adwaita: undershoot simplification and tweaks 2015-01-29 10:49:59 +01:00
Matthias Clasen
99b17488dd file chooser: Unset sidebar during search
It is a bit misleading to have one of the places in the sidebar
selected while in search mode, since the search is not relative
to any location. So, unset the sidebar selection when we enter
search mode.
2015-01-28 18:26:42 -05:00
Matthias Clasen
f211031a9f places sidebar: Make a function NULL-safe
gtk_places_sidebar_set_location's location argument is documented
as allow-none, but if one actually passes NULL, a warning results.
Fix that.
2015-01-28 18:25:32 -05:00
Matthias Clasen
e31e88582f file chooser: Unify search mode leaving
Make all ways to get out of search mode go through the same
code path, so we always populate the list.
2015-01-28 18:21:18 -05:00
Matthias Clasen
a385ca1bb7 file chooser: Fix key bindings
Key press handlers must chain up for key bindings to work.
2015-01-28 18:17:51 -05:00
Matthias Clasen
59c04d5184 file chooser: Load a directory when leaving search
Ensure that some folder contents are shown in
the list when we leave search mode.

https://bugzilla.gnome.org/show_bug.cgi?id=743659
2015-01-28 18:15:19 -05:00
Matthias Clasen
696129d83c file chooser: Don't switch too eagerly to search mode
If the search entry doesn't consume the key event, don't
change to search mode. Otherwise, we interfere e.g. with
Ctrl and Shift keys for selection.

https://bugzilla.gnome.org/show_bug.cgi?id=743660
2015-01-28 17:01:30 -05:00
Garrett Regier
9cbf764bcd Fix VA marshaller for GtkWidget's "event-after" signal
Just a copy and paste typo from the "event" signal.

https://bugzilla.gnome.org/show_bug.cgi?id=743593
Signed-off-by: Garrett Regier <garrettregier@gmail.com>
2015-01-28 16:40:59 -05:00
Bastian Ilsø
e9ddff907f Get started: port example-0.c to GtkApplication
https://bugzilla.gnome.org/show_bug.cgi?id=743638
2015-01-28 16:31:12 -05:00
Christian Persch
066646c96d GtkAboutDialog: Fix crash on link click
https://bugzilla.gnome.org/show_bug.cgi?id=743592
2015-01-28 16:28:51 -05:00
Matthias Clasen
86eefc7609 file chooser: Make Escape go out of search mode
This works in most other places where we have search,
and is the expected behavior.
2015-01-28 16:07:51 -05:00
Matthias Clasen
1d64175c4b file chooser: Simplify search entry callback 2015-01-28 16:07:51 -05:00
Matthias Clasen
d270c5524f file chooser: Drop unused callbacks 2015-01-28 16:07:51 -05:00
Matthias Clasen
4ac57d4d4c file chooser: Remove the search/browse buttons
Enabling search is now handled in the file chooser dialog,
so we don't need these buttons anymore.
2015-01-28 16:07:51 -05:00
Matthias Clasen
7c51e60b86 file chooser dialog: Add a search button to the header
This is where we put similar search buttons in applications
and in other dialogs, such as the GtkAppChooserDialog.
2015-01-28 16:07:51 -05:00
Matthias Clasen
de4427304c file chooser: Add a search-mode property
This will be used to control search from the dialog.
2015-01-28 16:07:51 -05:00
Matthias Clasen
76b674f3b6 file chooser: Clean up includes 2015-01-28 16:07:51 -05:00
Lapo Calamandrei
f029a2230d Adwaita: undershoot tweaks 2015-01-28 20:22:05 +01:00
Lapo Calamandrei
5f1fb0e4fc Adwaita: undershoot teeth removal 2015-01-28 20:05:03 +01:00
Jakub Steiner
201134b9df Adwaita: shade content-view
https://bugzilla.gnome.org/show_bug.cgi?id=740336
2015-01-28 18:35:52 +01:00
Lapo Calamandrei
f07ac793fe Adwaita: set the right background color for message dialogs 2015-01-28 18:20:05 +01:00
Carlos Garnacho
3f4df0644c window: Only claim the sequence if keeping the grab
If the grab belongs elsewhere, the window won't claim the sequence right
away. The sequence may still be claimed afterwards when window dragging
starts, but simple clicks won't be consumed this way.

This makes it possible to close popovers when clicking on the title region,
while still permitting touch/button 1 interaction for every other purpose.

https://bugzilla.gnome.org/show_bug.cgi?id=743257
2015-01-28 17:11:12 +00:00
Carlos Garnacho
ea983404ec win32: Don't check the position of a NULL device
This function is given a barely setup GdkEvent, so the GdkDevice field
is still unset, causing warnings and misbehaviors when the position
is queried for it.

Given that the wintab GTK+ code seems to rely somewhat hard on the wintab
device managing the pointer cursor, query the pointer position from the
pointer itself.

https://bugzilla.gnome.org/show_bug.cgi?id=743330
2015-01-28 16:59:29 +00:00
Carlos Garnacho
1543890569 win32: Ensure we can create a window for wintab
The window used NULL as a parent window, which defaults internally to
using the root window of the default screen. But at the time wintab is
initialized, there is no default display/screen yet.

Fix this by retrieving this information from the given GdkDeviceManager,
so we don't have to wait for the display to be in place before
initialization.

https://bugzilla.gnome.org/show_bug.cgi?id=743330
2015-01-28 16:59:29 +00:00
Rui Matos
2dd07f346a gdkscreen-wayland: Don't leak wl_output objects
https://bugzilla.gnome.org/show_bug.cgi?id=743633
2015-01-28 17:17:09 +01:00
Lapo Calamandrei
f717d98458 Adwaita: another approach at the undershoot styling 2015-01-28 17:11:34 +01:00
Matthias Clasen
1aee4f0384 Fix a typo
commit aa1b7fab9c introduced a misuse of G_UNLIKELY in
several places. Fix all those.
2015-01-28 10:08:13 -05:00
Lars Uebernickel
8e8a94bc23 Also bundle icons in status/ as resources
https://bugzilla.gnome.org/show_bug.cgi?id=743647
2015-01-28 14:26:46 +00:00
Bastian Ilsø
f3d95d05eb Introduction explaining widget toolkit 2015-01-28 12:17:45 +00:00
Niels Nesse
00834786be GDK GL context's should associate with "window->impl_window" not "window"
In some layouts this inconsistency results in crashes in
gdk_gl_texture_from_surface() since it uses gdk_gl_context_get_window() but
the returned window is not the same as the one that is being painted so
"window->current_paint.surface" is NULL. I saw this problem when packing a
GdkGLArea into a GtkPaned.

https://bugzilla.gnome.org/show_bug.cgi?id=743146
2015-01-28 12:00:30 +00:00
Niels Nesse
27cf0fa34c Fix core context creation in GdkGLContext
- Specifically request GL version when creating context. Just specifying core
profile bit results in the requested version defaulting to 1.0 which causes
the core profile bit to be ignored and an arbitrary compatability context to be
returned.

- Fix GL painting by removing GL calls that have been depricated by the 3.2 core
profile.

- Additionally remove glInvalidateFramebuffer() call, it is not supported by 3.2
core.

https://bugzilla.gnome.org/show_bug.cgi?id=742953
2015-01-28 12:00:30 +00:00
Bastian Ilsø
9e85fcbe7c Paragraph explaining casting conventions via macro 2015-01-27 21:40:19 +00:00
Alexander Larsson
a1e4ba0dd4 gtktreeview: Fix horizontal grid lines
The clipping was wrong so it was not drawing grid lines
outside the visible area, which broke due to the pixel cache.
2015-01-27 17:16:03 +00:00
Jonas Danielsson
1442299b48 clipboard: Add get_default() helper
Add helper for getting the main clipboard. This makes
the API usable for bindings (as GdkAtoms aren't usable through
gobject-introspection), and easier to use in C.

https://bugzilla.gnome.org/show_bug.cgi?id=712752
2015-01-27 18:09:31 +01:00
Sveinn í Felli
46b10f1d92 Updated Icelandic translation 2015-01-27 14:32:27 +00:00
Benjamin Otte
aa1b7fab9c css: Remove _gtk_css_style_property_changes_affect_size()
... and _gtk_css_style_property_changes_affect_font().

Replace it with _gtk_css_style_property_get_mask_affecting().
2015-01-27 05:04:34 +01:00
Benjamin Otte
488ea44a59 image: Use _gtk_css_style_property_get_mask_affecting()
... to avoid recomputing the cached surface all the time.
2015-01-27 05:04:34 +01:00
Benjamin Otte
c42e54e949 css: Add _gtk_css_style_property_get_mask_affecting()
Computes a bitmask for all properties that affect the given flags.
2015-01-27 05:04:34 +01:00
Benjamin Otte
ffff7b055b css: Remove GtkCssStyleProperty::affects-size
... and GtkCssStyleProperty::affects-font properties. Code now uses
GtkCssStyleProperty::affects instead.
2015-01-27 05:04:34 +01:00
Benjamin Otte
c0650057c1 css: Add GtkCssStyleProperty::affects property 2015-01-27 05:04:34 +01:00
Benjamin Otte
11d70f1ac3 css: Add a -gtk-icon-theme CSS property
The property is useless to set (it only allows 'initial', 'inherit' and
'unset' as values), but it is used to track changes to the icon theme.
And as such, it can ensure that widgets can track when they need to
reload icons.

https://bugzilla.gnome.org/show_bug.cgi?id=743341
2015-01-27 05:04:34 +01:00
Mike Gorse
9cbf04c1d2 A11y: fix typo when initializing a container cell accessible
Gtk_container_cell_widget_set should chain up to its parent's set
function, not its parent's unset function. This was resulting in
accessibles being erroneously marked defunct after being created.
2015-01-26 15:03:10 -06:00
Yosef Or Boczko
8cb444147c Updated Properties Hebrew translation 2015-01-26 22:13:52 +02:00
Yosef Or Boczko
daad650a9c Updated Hebrew translation 2015-01-26 22:12:48 +02:00
Matthias Clasen
5fc8cf4331 x11: Handle obsolete selection requests without crashing
The ICCCM says:

If the specified property is None, the requestor is an obsolete client.
Owners are encouraged to support these clients by using the specified
target atom as the property name to be used for the reply.

Lets do that, instead of crashing.

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

The previous fix for this issue in 732af31424 was incomplete.
2015-01-24 19:32:52 -05:00
Matthias Clasen
542c824c71 Trivial doc fixes
Remove two erroneous quotation marks.
2015-01-24 19:25:50 -05:00
Christoph Reiter
8fc920144b GtkFileChooserWidget: Fix a crash for when the widget was unrefed right after setting a current folder.
Keep a reference to the widget while the async operation is ongoing.

https://bugzilla.gnome.org/show_bug.cgi?id=725164
2015-01-24 17:28:28 -05:00
Christoph Reiter
c235747847 GtkFileChooserWidget: remove unused fields and cleanup code.
These fields are never set, so we don't need the code to clean them up.

https://bugzilla.gnome.org/show_bug.cgi?id=725164
2015-01-24 17:28:28 -05:00
Matthias Clasen
95fad690d2 wayland: Don't claim to support selection notification
We don't support selection notification, so don't claim
we do, only to fail later.

https://bugzilla.gnome.org/show_bug.cgi?id=743229
2015-01-24 17:25:43 -05:00
Matthias Clasen
b6551c84c9 Initialize variables
No need to risk valgrind complaints about initialized
values.

https://bugzilla.gnome.org/show_bug.cgi?id=743422
2015-01-24 16:45:04 -05:00
Debarshi Ray
aa0811d320 GtkTreeModel: Documentation fix
https://bugzilla.gnome.org/show_bug.cgi?id=743286
2015-01-24 16:16:35 -05:00
Christoph Reiter
f4dee9b682 Fix transfer annotation for tree_model parameter of gtk_tree_get_row_drag_data() and add nullable, optional
The GtkSelectionData does not own the model set with
gtk_tree_set_row_drag_data so change the out param to "transfer none".
This fixes a crash after multiple DnD actions due to the bindings
stealing a reference each time this function is called.

This also adds nullable and optional annotations for tree_model and path while at it.

https://bugzilla.gnome.org/show_bug.cgi?id=743193
2015-01-24 16:11:51 -05:00
Timm Bäder
9668962da1 gtkdnd: Set the dnd window's screen before its visual
This makes dnd icons work for widgets on a !default screen.

https://bugzilla.gnome.org/show_bug.cgi?id=743393
2015-01-24 15:57:46 -05:00
Matthias Clasen
b3c28e14fe file chooser: search improvements
Make it so that typing switches to search unless we have a better
use for the key events, and stop search if the entry is emptied.
2015-01-24 13:32:31 -05:00
Matthias Clasen
8f9c8120b9 file chooser: Turn off typeahead search
It is the third kind of navigation entry in the file chooser after
the location entry and search, and it interacts badly with both
of the others.
2015-01-24 08:44:30 -05:00
Matthias Clasen
a0ecb44b41 gtk-demo: Show search entry signals 2015-01-24 08:44:30 -05:00
Matthias Clasen
3bf12c44e2 Use the new API in GtkSearchBar if we can
Sadly, GtkSearchBar allows connecting plain entries, so we have
to keep the old code around.
2015-01-24 08:44:30 -05:00
Matthias Clasen
354536d464 inspector: Use some of the new GtkSearchEntry API
Avoid repetitive, manual event handling in various places
in GtkInspector.
2015-01-24 08:44:30 -05:00
Matthias Clasen
500c8d82fc GtkSearchEntry: Add more API
Add ::next-match, ::previous-match and ::stop-search keybinding
signals that are bound to Ctrl-g, Ctrl-Shift-g and Escape. Also
add a gtk_search_entry_handle_event() function to handle key events.
2015-01-24 08:44:30 -05:00
Sveinn í Felli
82a5edceca Updated Icelandic translation 2015-01-23 13:37:21 +00:00
Timm Bäder
ad180c4335 inspector: Make gl extension rows unactivatable 2015-01-22 21:18:25 +01:00
Piotr Drąg
2e71fbacbf Updated POTFILES.skip 2015-01-22 20:20:43 +01:00
Benjamin Otte
7e5ac3a58d roundedbox: Treat path segments differently
If a side of the box is 0px wide, make the corners owned by the adjacent
sides. This avoids spilling over of unwanted colors from the 0-width
side into the corner.

New test for this case is included.
2015-01-22 16:25:54 +01:00
Benjamin Otte
3a9bf0fe1d widget: Compute clip of children properly
For widgets with a window, we need to adjust the allocation of their
children.
2015-01-22 16:25:43 +01:00
Benjamin Otte
d879a13600 widget: Correctly handle which widgets to include in the clip
Previously, we would not include any child widget on the first
allocation, which happens right after realize(), but before map(). No
widget is drawable at that point.
2015-01-22 16:25:35 +01:00
Benjamin Otte
bd31310c40 widget: Add debug spew for setting the clip 2015-01-22 16:25:30 +01:00
Benjamin Otte
3fcb892831 headerbar: Implement clipping 2015-01-22 16:25:24 +01:00
Benjamin Otte
ba06066158 border: Don't special case according to border styles
This is now done (as it should) in the compute code.
2015-01-21 16:22:30 +01:00
Sebastian Keller
728bce2cf8 css: Move "border-style: none" special case to CssValueNumber
This fixes the background being shifted by the border-width even though
the border-style was none.
2015-01-21 16:20:42 +01:00
Benjamin Otte
610f7e8f70 stylecontext: Don't do unnecessary workarounds
when calling get_padding/border/margin, there is no need to go through
the fallback API.

This is a huge speedup for certain benchmarks.
2015-01-21 02:16:44 +01:00
Sebastian Keller
8836a0d6ce render: fix arrow orientation
The rotation code in the draw_arrow function was assuming that the arrow
would be drawn pointing upwards but it was pointing to the right
resulting in the rotated arrows pointing in the wrong direction.

The recent refactoring caused a pi/2 rotation to be lost. Rather than
adding that back somehwere (to lose it again in the future), we just
draw the arrow pointing upwards as it is expected to do with a 0 angle.
2015-01-21 01:38:51 +01:00
Matthias Clasen
da163469f9 3.15.4 2015-01-20 08:18:03 -05:00
Matthias Clasen
c7efbeddd0 More updates 2015-01-20 06:46:58 -05:00
Benjamin Otte
22967f1612 image: Compute clip properly
Use the helper function we have for this, don't do it manually. This has
the side effect of also supporting icon transforms.
2015-01-20 06:30:20 +01:00
Benjamin Otte
f7433557ab render: Implement -gtk-icon-transform for icon surfaces
Yes, I like playing around. To enjoy, add this CSS to your application
of choice (preferrably glade or something with lots of images):

GtkImage { animation: spin 2s linear infinite; }

You can thank me later.
2015-01-20 06:30:20 +01:00
Benjamin Otte
8c745088d5 render: Split icon surface rendering out
Just like normal icons, icon surfaces belong into gtkrendericon.c.
2015-01-20 06:30:20 +01:00
Benjamin Otte
f6d64f6591 render: Split icon rendering into its own file 2015-01-20 06:30:19 +01:00
Benjamin Otte
e697213b35 render: Remove spinner special-cases
The spinner is a regular builtin image now. There is no need to go
through the shadows code manually anymore as regular items do get
shadows automatically.

This also allows simplifying the actual spinner drawing code so that it
actually works.
2015-01-20 06:30:19 +01:00
Benjamin Otte
cc4d34e688 render: Render builtin images as regular CSS images
This not only reduces code, but also allows for builtin images to have
shadows or be transformed using -gtk-icon-transform.
2015-01-20 06:30:19 +01:00
Benjamin Otte
45541cbf10 render: Don't require passing CSS properties to builtin images
Instead, make the buiultin image get those properties itself in the
compute vfunc.
2015-01-20 06:30:19 +01:00
Benjamin Otte
9ce8ce1198 css: Move icon properties to the end
The order in which properties are defined depends on the order in which
they are computed. And that means that properties can only depend on
other properties that are defined before them.

The next patches will need this reordering.
2015-01-20 06:30:19 +01:00
Benjamin Otte
fe028e2789 render: Only render 4 different arrows
Instead of supporting every angle, just support top, right, bottom and
left and round the angle to one of those directions.

Adwaita overrides arrows anyway and doesn't even look at the angle, so
this should not be a problem.
2015-01-20 06:30:19 +01:00
Benjamin Otte
118c887656 render: Don't pass junction sides to builtin image
Instead, split the grip into 8 different builtin images (one for each
side and corner).
2015-01-20 06:30:19 +01:00
Benjamin Otte
e6b228f12a render: Extend builtin images to account for states
We add to the enum to account for the images generated for different
states.
2015-01-20 06:30:19 +01:00
Benjamin Otte
1c3dd5d46b render: Move code for rendering builtin images
Also, make it have a generic entry point with
gtk_css_image_builtin_draw().

The only feature lost so is the drawing of shadows for spinners, but
that will come back later.
2015-01-20 06:30:19 +01:00
Benjamin Otte
ebb64c2288 inspector: Remove unused hash table 2015-01-20 06:30:19 +01:00
Benjamin Otte
7ba7dff69e inspector: Remove unused treemodel properties
As a side effect, we can use _gtk_css_section_to_string() to format the
section and save a lot of code.
2015-01-20 06:30:19 +01:00
Benjamin Otte
4ba710ea30 inspector: Use GtkCssStyle and gtk_css_value_to_string() 2015-01-20 06:30:19 +01:00
Benjamin Otte
8b6d419e02 render: Move border rendering into its own file
gtkrenderborder.c now contains the implementation for
  gtk_css_style_render_border
  gtk_css_style_render_outline
2015-01-20 06:30:19 +01:00
Benjamin Otte
5ec97f6144 render: Remove unused header 2015-01-20 06:30:19 +01:00
Benjamin Otte
717877dff2 render: Rename gtkborderimage.[ch]
I want the gtkrender prefix for all filenames about rendering.
2015-01-20 06:30:18 +01:00
Benjamin Otte
cb0ca9a804 render: Use a GtkCssStyle instead of GtkStyleContext for focus 2015-01-20 06:30:18 +01:00
Benjamin Otte
5cc0cae4b7 render: Rename gtkthemingbackground.[ch]
I want the gtkrender prefix for all filenames about rendering.
2015-01-20 06:30:18 +01:00
Benjamin Otte
d25b4105d6 render: Take a GtkCssStyle for rendering frames
... and move the whole function into gtkthemingbackground.c
2015-01-20 01:23:19 +01:00
Benjamin Otte
d0a12d477e borderimage: Use a GtkCssStyle instead of GtkStyleContext 2015-01-20 01:23:19 +01:00
Benjamin Otte
dd2202288a themingbackground: Use a GtkCssStyle instead of GtkStyleContext 2015-01-20 01:23:19 +01:00
Benjamin Otte
8d94140da9 roundedbox: Take a GtkCssStyle instead of a GtkStyleContext
This is in preparation for iusing GtkCssStyle instead of GtkStyleContext
in render functions.
2015-01-20 01:23:18 +01:00
Benjamin Otte
73b3b9ee94 stylecontext: Rename function and export it.
The name now better reflects what it does, since GtkCssComputedValues
was renamed to GtkCssStyle, too.
2015-01-20 01:23:18 +01:00
Benjamin Otte
f313a8235b reftests: Fix border-style-none reftest
Unset all CSS; Adwaita was messing up things.
2015-01-20 01:15:04 +01:00
Benjamin Otte
8c534fefca dnd: Draw dnd icon with regular code
Overriding the window background is ugly because the window background
is owned by GTK and can be reset at any time.

https://bugzilla.gnome.org/show_bug.cgi?id=742646
2015-01-20 01:07:13 +01:00
Benjamin Otte
dbb8d1dd07 stylecontext: Keep track of the CSS ID
This is necessary since we do the new caching and need to distinguish
between styles with different IDs.

Fixes various test cases.
2015-01-20 01:07:13 +01:00
Aurimas Černius
39d6ec167e Updated Lithuanian translation 2015-01-19 23:00:55 +02:00
Daniel Mustieles
c1a013fe4a Updated Spanish translation 2015-01-19 18:26:58 +01:00
Daniel Mustieles
07e9385bab Updated Spanish translation 2015-01-19 18:26:39 +01:00
Matthias Clasen
63bc3542ce path bar: Don't segfault if we get disposed quickly
The file chooser code now calls into the path bar in init,
starting an async operation. This unveiled that the path bar
code was not safe against being disposed early, by causing
a crahsh of the objects-finalize test.
Fix this by making the callback check for CANCELLED.
2015-01-19 11:57:10 -05:00
Matthias Clasen
cb63fe042e Updates for 3.15.4 2015-01-19 11:02:36 -05:00
Matthias Clasen
00e08a0159 places sidebar: Drop the top margin
This looks odd in combination with the top underflow.
2015-01-19 09:37:04 -05:00
Carlos Garnacho
121fddc4d2 x11: Fetch vendor/product identifiers for input devices
These are retrieved from XInput device properties.

https://bugzilla.gnome.org/show_bug.cgi?id=740758
2015-01-19 15:09:19 +01:00
Carlos Garnacho
5e53676b46 device: Add property/getters for vendor/product identifiers
These are a construct only properties, expected to be filled in from
platform specific code.

https://bugzilla.gnome.org/show_bug.cgi?id=740758
2015-01-19 15:09:19 +01:00
Matthias Clasen
531fa78601 gtk-demo: Make editable cells demo more robust
When removing all rows, trying to add rows would not work
and throw criticals. This is fallout from a recent change
to insert rows at the right position. Fix this by handling
the 'empty model' case separately.

https://bugzilla.gnome.org/show_bug.cgi?id=743157
2015-01-19 07:36:08 -05:00
Carlos Garnacho
dc952e3d94 scrolledwindow: Don't displace invalidation by the widget allocation
This was left unmodified when GtkScrolledWindow was made a windowed widget.
Displacing here by the widget allocation is not necessary anymore, since
we are invalidating the window set at these coordinates.

This patch is a simplification of a previous one by Timm Bäder.

https://bugzilla.gnome.org/show_bug.cgi?id=742243
2015-01-19 13:06:27 +01:00
Benjamin Otte
cbabb2e6ff stylecontext: Fix FALSE/TRUE mixup
Introduced in e649c8773f. It's obviously
the root node right there.
2015-01-19 02:19:59 +01:00
Matthias Clasen
9e1f870680 scrolled window: Reduce the hover proximity distance further 2015-01-18 20:01:55 -05:00
Matthias Clasen
82e324f8ac file chooser: Fix up some focus issues
Better to switch the visible stack child early, since GtkStack
has its own focus handling now.
2015-01-18 19:45:13 -05:00
Lars Uebernickel
931a479da9 gtkimagemenuitem: create widget for action icons lazily
GtkImageMenuItem always packs a GtkImage when it is synced with a
related action. This is unnecessary when the action doesn't have an icon
set and results in excess padding when a GtkImageMenuItem is put in a
menu bar (GtkUIManager does this).

Fix this by not creating the GtkImage for icon-less actions.

https://bugzilla.gnome.org/show_bug.cgi?id=742181
2015-01-18 19:45:13 -05:00
Benjamin Otte
858c80f33e render: Replace gtk_style_context_get_border/padding()
Use _gtk_style_context_peek_property() instead.
2015-01-19 01:15:20 +01:00
Benjamin Otte
8b11e93a2d render: Get rid of gtk_style_context_get_color()
Use _gtk_style_context_peek_property() instead.
2015-01-19 01:15:19 +01:00
Benjamin Otte
4bffb6aff5 Adwaita: Make :active button gradient have 3 stops
Just add a 3rd stop in the place where the gradients for the other
states have a 3rd stop. When running transitions between states, this
avoids cross-fades and instead uses the much faster gradient
transitioning code.
2015-01-19 01:12:50 +01:00
Benjamin Otte
0fef59b486 stylecontext: Be more graceful when save() isn't matched with restore()
Instead of asserting, just print a g_warning() and try to work around
the problem.
I hope that g_warning() isn't too spammy for people that are hit with
it.

Also clarify the docs that not restore()ing after a save() is a bad
idea.

https://bugzilla.gnome.org/show_bug.cgi?id=743101
2015-01-19 01:12:50 +01:00
Benjamin Otte
e649c8773f stylecontext: Explicitly specify root node
When creating the query path, explicitly specify if it's for a root node
or for a child. Relying on gtk_style_context_is_saved() is unreliable
(for example when updating the cache).
2015-01-19 01:12:50 +01:00
Matthias Clasen
1a38c4d066 file chooser: Make search work again
The last round of filechooser redesign work had left
search somewhat dysfunctional. This commit fixes things
up enough that search is once again a working feature
of the file chooser.
2015-01-18 18:59:43 -05:00
Matthias Clasen
dcd3d15380 file chooser: Drop the location label
Bringing us close to the new design.
2015-01-18 17:57:12 -05:00
Matthias Clasen
4b47c5a649 file chooser: Don't show 'Enter Location' in save modes
In these modes, the entry is permanently visible anyway.
2015-01-18 17:39:05 -05:00
Matthias Clasen
a8cb7352c5 file chooser: Make Ctrl-L work in recent
Just switch to browse mode when we see Ctrl-L in recent mode.
https://bugzilla.gnome.org/show_bug.cgi?id=660450
2015-01-18 17:35:22 -05:00
Matthias Clasen
8133e7e624 file chooser: Ensure the path bar is initialized
There are some cases where we can end up showing the path
bar without ever setting a file on it. One example is:
1) Open file chooser
2) Hit ~
3) Hit Ctrl-L
While this is a bit of a workaround, at least it makes sure
that we never end up with an empty space where the path bar
is supposed to be.
2015-01-18 17:13:12 -05:00
Matthias Clasen
6a7b549608 trivial refactoring 2015-01-18 16:57:21 -05:00
Matthias Clasen
dfe6399de8 file chooser: Make ~ and / work in recent
Complained about in
https://bugzilla.gnome.org/show_bug.cgi?id=743117
2015-01-18 16:18:12 -05:00
Matthias Clasen
47e5e1c72d Fix a typo in the docs
https://bugzilla.gnome.org/show_bug.cgi?id=743037
2015-01-18 15:26:49 -05:00
Matthias Clasen
9c1063f602 broadway: Only use abstract sockets when they are supported
GIO has a function to check whether abstract sockets are
supported, so use it. This should make broadway work on
Freebsd again.

https://bugzilla.gnome.org/show_bug.cgi?id=742980
2015-01-18 15:24:30 -05:00
Matthias Clasen
811d602842 Make Broadway work on freebsd
It seems that posix_fallocate gives an ENODEV error when
called on an fd opened with shm_open on freebsd. Fix up
the error check to only trigger if we get ENOSPC.

https://bugzilla.gnome.org/show_bug.cgi?id=742980
2015-01-18 15:15:37 -05:00
Matthias Clasen
9fde44ac10 Fine-tune the proximity hovering for scrollbars
Reduce the distance at which we expand the scrollbar,
and add some hysteresis.
2015-01-18 14:28:47 -05:00
Dimitris Spingos
ff2390f550 Updated Greek translation 2015-01-18 22:21:29 +02:00
Matthias Clasen
cf277fabb5 Remove some outdated references
We shouldn't recommend gtk_widget_modify_bg() or
gtk_style_set_background() anymore.
2015-01-18 12:41:07 -05:00
Christoph Reiter
500bd60873 Adjust gtk_status_icon_position_menu() annotation to match GtkMenuPositionFunc again
https://bugzilla.gnome.org/show_bug.cgi?id=674537

https://bugzilla.gnome.org/show_bug.cgi?id=742940
2015-01-17 16:31:26 -05:00
Maks Naumov
6113504495 Fix event->button.y_root when using mouse buttons and dnd canceled
Signed-off-by: Maks Naumov <maksqwe1@ukr.net>

https://bugzilla.gnome.org/show_bug.cgi?id=742785
2015-01-17 16:29:17 -05:00
Maks Naumov
9f51d8948f Fix save_hot_y init in gtk_drag_get_icon()
Signed-off-by: Maks Naumov <maksqwe1@ukr.net>

https://bugzilla.gnome.org/show_bug.cgi?id=742786
2015-01-17 16:24:45 -05:00
Inaki Larranaga Murgoitio
1b03f08938 Updated Basque language 2015-01-17 17:25:30 +01:00
Matthias Clasen
48865fb9d9 Prefer the Wayland backend
This does not affect X11 sessions, but has the advantage that
we get much more testing of the Wayland backend in Wayland
sessions.
2015-01-17 01:03:10 -05:00
Benjamin Otte
ad8d30ad86 inspector: Remove a bunch of unused variables 2015-01-17 02:37:36 +01:00
Benjamin Otte
d0ed29d58d stylecontext: Remove a bunch of return_if_fail()s
They're gonna be in the way when refactoring and we can live without
them.
2015-01-17 02:25:40 +01:00
Benjamin Otte
63f7a36ae0 stylecontext: Do not transition from the default style
This gets rid of a bunch of awkward transitions. It's not a perfect
solution to the problem of "should we transition from this state" but it
gets rid of the ugliest offenders.
2015-01-17 02:25:40 +01:00
Lapo Calamandrei
03d4e270c2 Adwaita: scrollbar style refactoring...
...making overlay indicator slider visible on any backgroung
in the process.
2015-01-16 18:32:16 +01:00
Marek Černocký
de3e0f1453 Updated Czech translation 2015-01-14 22:50:26 +01:00
Carlos Garnacho
b8e87d4762 widget: Free the controller list on finalize()
If this is done on dispose(), the widget may be destroyed (and its
controllers list NULLified) within _gtk_widget_run_controllers(),
causing warnings/crashes when it just tried to hop on the next
controllers.

Freeing the controllers here should be a safety net for implementations,
so it also makes sense to do this late. The widgets that choose to
free their controllers on dispose can still do so, and get
_gtk_widget_remove_controller() called for these as an indirect result.
2015-01-14 17:11:25 +01:00
Carlos Garnacho
594de00cad listbox: Free the multipress gesture on finalize 2015-01-14 17:11:25 +01:00
Sveinn í Felli
93d343d339 Updated Icelandic translation 2015-01-14 16:07:37 +01:00
Carlos Garnacho
7daa2a1eba event-controller: Chain up on dispose 2015-01-14 16:03:10 +01:00
Stas Solovey
711fea11b5 Updated Russian translation 2015-01-14 12:05:57 +00:00
Nelson Benítez León
f26986a50a gtkplacessidebar: insert bookmark by dnd in correct position
Add needed COLUMN INDEX to "new bookmark" row based on previous
bookmark index plus one.

Fixes bug 742727
2015-01-13 19:01:46 -05:00
Maks Naumov
54806d1295 Fix accessible_class->widget_set initialization
Signed-off-by: Maks Naumov <maksqwe1@ukr.net>

https://bugzilla.gnome.org/show_bug.cgi?id=742778
2015-01-13 19:01:01 -05:00
Fran Dieguez
0d85e26571 Updated Galician translations 2015-01-12 22:53:40 +01:00
Daniel Mustieles
7314826de2 Updated Spanish translation 2015-01-12 12:20:26 +01:00
Maks Naumov
87d36885ac Properly check result of g_utf8_get_char_validated()
g_utf8_get_char_validated() may return -1 or -2
return type is gunichar(guint32)

Therefore such checks like 'gunichar < 0' or 'gunichar > 0'
are always 'false' or 'true'(except when gunichar == 0).

Signed-off-by: Maks Naumov <maksqwe1@ukr.net>

https://bugzilla.gnome.org/show_bug.cgi?id=742774
2015-01-11 15:46:06 -05:00
Maks Naumov
07cf489d2d Fix check for 'y' padding in gtk_cell_renderer_set_padding()
Signed-off-by: Maks Naumov <maksqwe1@ukr.net>

https://bugzilla.gnome.org/show_bug.cgi?id=742764
2015-01-11 15:34:20 -05:00
Matthias Clasen
a29c831f3c Remove an unused define 2015-01-11 15:14:55 -05:00
Maks Naumov
430ea2fff6 Properly ignore BadWindow and BadDrawable in get_child_info_handler()
Signed-off-by: Maks Naumov <maksqwe1@ukr.net>

https://bugzilla.gnome.org/show_bug.cgi?id=742771
2015-01-11 14:33:10 -05:00
Matthias Clasen
f120ae7b4d Forgotten file 2015-01-10 21:16:21 -05:00
Matthias Clasen
838e982877 HighContrast: Don't set nonexisting style properties
These don't exist, so setting them can't do any good.
2015-01-10 21:14:56 -05:00
Matthias Clasen
e15152c837 Adwaita: Don't set nonexisting style properties
These don't exist, so setting them can't do any good.
2015-01-10 21:14:02 -05:00
Matthias Clasen
604704a3f0 HighContrast: Also fix separators in file chooser buttons
Same fix as for combo box separators.
2015-01-10 21:12:08 -05:00
Matthias Clasen
88567295f6 Adwaita: Also fix separators in file chooser buttons
Same fix as for combo box separators.
2015-01-10 21:09:30 -05:00
Iain Lane
8c5094c22c gtkfilechooserwidget: When using an extra widget, show or hide the filter combo as appropriate
https://bugzilla.gnome.org/show_bug.cgi?id=742653
2015-01-10 20:37:39 -05:00
Matthias Clasen
0b50e1fff6 HighContrast: draw combo box separators
Same fix as the previous commit.
2015-01-10 20:28:45 -05:00
Matthias Clasen
9c4d478dc7 Adwaita: draw combo box separators
Killing the separator in the button had the unintended side effect
of also killing separators in the popup.

https://bugzilla.gnome.org/show_bug.cgi?id=742704
2015-01-10 20:25:56 -05:00
Matthias Clasen
35a8d3d770 widget-factory: Add a combo box separator example
This shows that combo box separators are currently broken
in Adwaita.
2015-01-10 20:14:24 -05:00
Nelson Benitez Leon
885b36a6d5 GtkTextView: allow to extend text selection with mouse scrollwheel
Fixes bug 710612
2015-01-10 14:36:17 -05:00
Matthias Clasen
5d9710cc7f file chooser: Add some padidng
https://bugzilla.gnome.org/show_bug.cgi?id=742631
2015-01-10 14:35:56 -05:00
Matthias Clasen
b0e4273325 Forgotten files 2015-01-10 14:35:56 -05:00
Matthias Clasen
366527c2d0 Adwaita: Fix treeview separators in backdrop
https://bugzilla.gnome.org/show_bug.cgi?id=742702
2015-01-10 13:07:55 -05:00
Benjamin Otte
cec5815a0d stylecontext: Stop animations on manual invalidation
If a gtk_style_context_invalidate() is called on a widget's style
context (which nobody should ever do, sheesh!) and we're animating, stop
the animations.

Fixes crashers in Nautilus.
2015-01-10 14:25:40 +01:00
Matthias Clasen
9fcbae2d85 GtkScrolledWindow: Don't start fading right away
When we get a leave event, we need to remove the over bit,
since we may not get motion events that tell us when we lose
proximity, but we don't have to fade out right away - that
will happen on its on due to inactivity a bit later. Having
the indicator stay visible for a bit feels more relaxed.
2015-01-09 21:15:07 -05:00
Matthias Clasen
206f0bbf7f GtkScrolledWindow: Factor out a constant
Define INDICATOR_CLOSE_DISTANCE instead of hardcoding the same
number of pixels in 4 different places.
2015-01-09 21:15:06 -05:00
Matthias Clasen
11eb64a2b6 GtkScrolledWindow: Don't require proximity for track points
These are hard to navigate precisely, so show wide scrollbars
right away.
2015-01-09 21:15:06 -05:00
Matthias Clasen
2a3a7306ef GtkScrolledWindow: Drop device manager complications
We no longer use the presence or absence of particular device
types to determine which scrolling to use.
2015-01-09 21:15:06 -05:00
Matthias Clasen
96fcdebefb GtkScrolledWindow: Drop a redundant field
The Indicator.enabled field was not carrying any extra information,
so just use priv->use_indicators instead.
2015-01-09 21:15:06 -05:00
Matthias Clasen
1c6eca04db GtkScrolledWindow: Rename a private field
touch_mode -> use_indicators, more to the point.
2015-01-09 21:15:06 -05:00
Emmanuele Bassi
a834078804 x11/gl: Do not specify the GLX context version
If we use GDK_GL_PROFILE_3_2_CORE we are asking for a core profile
according to the GLX_ARB_create_context_profile extension. For that,
we pass the GLX_CONTEXT_CORE_PROFILE_BIT_ARB value for the
GLX_CONTEXT_PROFILE_MASK_ARB attribute.

The specification for the extension says that:

  If the requested OpenGL version is less than 3.2,
  GLX_CONTEXT_PROFILE_MASK_ARB is ignored and the functionality
  of the context is determined solely by the requested version.

Since we're asking for a core profile, we assume a GL version greater
than or equal to 3.2; thus, we don't need to specify the
GLX_CONTEXT_MAJOR_VERSION_ARB or the GLX_CONTEXT_MINOR_VERSION_ARB
attributes, and instead just rely on whatever version GLX gives us.

This seems to work around a strange issue in Mesa; if we ask for a core
profile and any version > 3.0, we get broken rendering on any shared
context we create.
2015-01-10 00:07:51 +00:00
Matthias Clasen
6384167054 inspector: Don't use GSettings directly
It is not necessary here, and using GtkSettings gives us
a greater chance to not fail e.g. on Windows.

https://bugzilla.gnome.org/show_bug.cgi?id=742664
2015-01-09 15:29:34 -05:00
Matthias Clasen
c2ff89bbe3 inspector: be careful about gsize vs guint64
Since gsize doesn't work as a typename in a ui file,
we have to be careful not to pass pointers to wrongly
sized variables when getting the guint64 values out
of the model.

https://bugzilla.gnome.org/show_bug.cgi?id=742664
2015-01-09 14:44:26 -05:00
Emmanuele Bassi
9a38fb79e5 docs: Add missing quote
The missing " breaks the syntax highlighting of the GtkImageMenuItem
example.
2015-01-09 16:42:55 +00:00
David King
a7638d5ecb docs: Add Since for GtkCellRendererPixbuf:surface 2015-01-09 14:51:21 +00:00
David King
9a50203408 docs: Fix some old live.gnome.org URLs 2015-01-09 14:08:20 +00:00
Piotr Drąg
4adb3f4033 Updated POTFILES.skip 2015-01-09 14:16:03 +01:00
Matthias Clasen
885b3c704f Fix GTK_OVERLAY_SCROLLING=0
This was broken by the recent more dynamic approach.
2015-01-09 06:45:51 -05:00
Matthias Clasen
d5afaa07d3 Fix comment typo 2015-01-09 06:21:37 -05:00
Matthias Clasen
80969e34bc inspector: Show object address
This is useful information when running the application
in a debugger.
https://bugzilla.gnome.org/show_bug.cgi?id=742518
2015-01-09 00:07:01 -05:00
Emmanuele Bassi
79f806fdab Point to copy/cut/delete named icons in the stock item deprecations
We still use symbolic icons for Copy, Cut, and Delete operations inside
toolbars and some menus, so it's worth pointing to the symbolic icon
names in the deprecation notices.

https://bugzilla.gnome.org/show_bug.cgi?id=741969
2015-01-08 23:50:22 -05:00
Matthias Clasen
08f69c53a5 file chooser: Don't force a scrollbar
No point in showing the scrollbar when it is not needed.
https://bugzilla.gnome.org/show_bug.cgi?id=742343
2015-01-08 22:27:47 -05:00
Timm Bäder
57714b9774 gtklabel: Don't accept unhandled mouse buttons
If the pressed mouse button neither triggers a context menu nor
activates a link, set the sequence's state to DENIED.

https://bugzilla.gnome.org/show_bug.cgi?id=742010
2015-01-08 21:52:26 -05:00
Benjamin Otte
9474215a43 cssimage: Fix angle computation for gradients to corners 2015-01-08 19:30:59 +01:00
Inaki Larranaga Murgoitio
0d5acf2a05 Updated Basque language 2015-01-08 18:32:00 +01:00
Inaki Larranaga Murgoitio
b0d0a2b5e5 Updated Basque language 2015-01-08 15:41:15 +01:00
Benjamin Otte
29984c5282 stylecontext: Handle theme changes for cached styles
We need to clear the cache manually on full revalidates because
_gtk_css_change_for_child() will clear the full revalidation flags.
And then gtk_style_context_update_cache() will not do the right thing
(which is to clear itself).
2015-01-07 18:06:59 +01:00
Benjamin Otte
bc07a540c7 stylecontext: Rename GtkStyleInfo to GtkCssNode 2015-01-07 15:44:53 +01:00
Benjamin Otte
2664082549 stylecontext: update_animating() properly
Because we can switch from animating to non-animating pretty much
anywhere, do the check for animations unconditionally instead of trying
to cram it into the correct if path (and failing).
2015-01-07 14:26:48 +01:00
Benjamin Otte
059cd3e51f stack: Remove commented out line
It always shows up in my greps and confuses me.
2015-01-07 14:26:48 +01:00
Benjamin Otte
fe33ee426a stylecontext: Add a parent style cache
We now cache the results of lookups on the parent GtkCssStyle. This
allows sharing styles between widgets (recursively). However, this
only works if the styles can't potentially depend on siblings -
neither directly via sibling selectors or via position pseudo-classes
like :first-child.
Unfortunately, Adwaita currently uses first-child a lot, and in
particular for labels, which are the most common widgets.

The big benefits of this change are both less CPU - due to not needing
to compute styles again - and less memory usage - due to sharing of
the styles between widgets. Here's some nonscientific numbers I
collected while pondering the usefulness of this patch:

                    glade   glade   widget
                    demo    demo    factory
                    runtime styles  styles
Adwaita before      19.1s   5800    1150
Adwaita now         18.9s   3800     970
Adwaita hacked now  14.5s   3100     910
simple before       11.3s   5800    1150
simple now          10.8s   1300     590

Adwaita: Adwaita as provided by GTK
Adwaita hacked: Adwaita with the first/last-child for GtkLabel removed
simple: A 250 lines simple GTK theme I use for testing
before: This patch not applied
now: this patch applied

glade demo runtime: Starting glade opening a large file and closing it
glade demo styles: GtkCssStaticStyle objects after opening glade with
                   the large file as per inspector
widget factory styles: GtkCssStaticStyle objects after startup as per
                       inspector
2015-01-07 14:26:48 +01:00
Benjamin Otte
27285f1f0f cssstyle: Have a default style
This way we can initialize the default style info with a style and
ddon't need to special case NULL everywhere.
2015-01-07 14:26:48 +01:00
Benjamin Otte
ef9aa8b0ae stylecontext: Use correct parent on updates
Previously we looked at the save/restore state when determining the
parent. This is wrong in the case where we're updating the cache though.

So we now save the parent in the style info.
2015-01-07 14:26:48 +01:00
Benjamin Otte
89b5d15415 stylecontext: Fix cache updating
After the parent changes in commit
3a337156d1 we need to refresh the cached
styles after the current style. After all, they now depend on the base
style.
2015-01-07 14:26:48 +01:00
Benjamin Otte
730f429168 cssstaticstyle: Handle relevant change
Relevant change is returned from style lookups, so keep is with the
object that holds those values.
2015-01-07 14:26:48 +01:00
Benjamin Otte
ad199e4cf9 stylecontext: Use correct parent style for lookups
After 3a337156d1 style lookups still used
the parent context's style as the parent style, even though after a
gtk_style_context_save() the root style of the style context is the
proper parent.

Testcase attached.
2015-01-07 14:26:48 +01:00
Benjamin Otte
26f36ef8ae cssnodedeclaration: Store the GType of the node 2015-01-07 14:26:48 +01:00
Benjamin Otte
9645daf48f cssstyle: Move function from vfunc to static func
compute_dependencies() is only used internally by GtkCssStaticStyle,
so there's no need to have it elsewhere.
2015-01-07 14:26:47 +01:00
Benjamin Otte
cd056adb2f cssstaticstyle: Move function
And with that move, GtkCssStaticStyle is immutable.
2015-01-07 14:26:47 +01:00
Benjamin Otte
8b823d7e13 cssstaticstyle: Move function
We want the new() return values to be immutable, so we have to move the
code that modifes them.
2015-01-07 14:26:47 +01:00
Benjamin Otte
b7be202089 stylecontext: Refactor update_properties()
It now always returns a new instance.
2015-01-07 14:26:47 +01:00
Benjamin Otte
7406ec84bc stylecontext: Simplify function
Instead of computing the changes manually everywhere from the parent
changes, just pass in the parent changes.
2015-01-07 14:26:47 +01:00
Benjamin Otte
c0af2d6fa6 stylecontext: Simplify code
Compute the differences only once and not in both if branches.
2015-01-07 14:26:47 +01:00
Benjamin Otte
7493e814a9 cssanimatedstyle: Apply animation values after creation
This makes GtkCssAnimatedStyle immutable.
2015-01-07 14:26:47 +01:00
Benjamin Otte
a3bf910585 cssanimatedstyle: Make advancing the style return a new style
This is another step towards making CssStyles immutable.
2015-01-07 14:26:47 +01:00
Benjamin Otte
b53d5d0643 stylecontext: Fold a function into only caller 2015-01-07 14:26:47 +01:00
Benjamin Otte
f3f021106d cssanimatedstyle: Avoid creating animation
... when no animation exists.

This makes the function name kinda wrong, but I'm not sure what else to
call it.
2015-01-07 14:26:47 +01:00
Benjamin Otte
682abc345f cssanimatedstyle: Remove unused function 2015-01-07 14:26:47 +01:00
Benjamin Otte
980923c761 cssanimatedstyle: Merge two functions 2015-01-07 14:26:47 +01:00
Benjamin Otte
0bab285fe0 stylecontext: Make build_properties create the style 2015-01-07 14:26:47 +01:00
Benjamin Otte
79f7392109 stylecontext: Make static styles static
Instead of keeping an animated style everywhere, we replace it with the
static style when nothing gets animated.

Apart from making the code cleaner, this gets rid of a bunch of animated
style values that do nothing but wrap a static style.
2015-01-07 14:26:47 +01:00
Benjamin Otte
db36ee36a6 stylecontext: Split function 2015-01-07 14:26:47 +01:00
Benjamin Otte
85dd685b3f stylecontext: Only look up stuff in the cache that can be in the cache
Only saved styles are stored in the cache so we should look only those
up there.
2015-01-07 14:26:47 +01:00
Benjamin Otte
77b876fad3 stylecontext: don't unset the current style info when clearing cache
Instead, do it manually.
2015-01-07 14:26:47 +01:00
Benjamin Otte
270e73bfcc stylecontext: Always pass the static style
... to build_properties.
There is always one available, so we can insist on that one.

This simplifies a bunch of code.
2015-01-07 14:26:47 +01:00
Benjamin Otte
c7e9489e3e stylecontext: Use a static style when saved
The only style that is animated is the style of the unsaved primary
node. So there's no need to create animated style objects for the other
ones.

There is a bunch of ugliness in the code currently. Further commits are
expected to fix them.
2015-01-07 14:26:47 +01:00
Benjamin Otte
ac215ffc8f cssstyle: Add GtkCssStaticStyle
For now, this is only an implementation detail of the animated style.

The idea is to use GtkCssStaticStyle as the result of CSS queries and
then put a GtkCssAnimatedStyle on top that manages the animations. The
neat thing about this is that you can cache the static values.
2015-01-07 14:26:47 +01:00
Benjamin Otte
4168e0385e cssstyle: Split into GtkCssStyle and GtkCssAnimatedStyle
GtkCssStyle is the base class to be used for all types of styles that do
exist.

GtkCssAnimatedStyle is the only implementation so far, that is exactly a
copy/paste of the old GtkCssStyle code.
2015-01-07 14:26:46 +01:00
Benjamin Otte
572f46067f cssstyle: Rename GtkCssComputedValues => GtkCssStyle
This is literally just renaming of the object (and the associated source
files). No other changes are in there.
2015-01-07 14:26:46 +01:00
Benjamin Otte
f51419adb0 cssstylefuncs: Rename functions
This is in preaparation for the big GtkCssComputedValues => GtkCssStyle
rename
2015-01-07 14:26:46 +01:00
Christian Kirbach
314a168916 Updated German translation 2015-01-06 22:42:35 +00:00
Bruce Cowan
bb2be84af0 Updated British English translation 2015-01-05 20:41:18 +00:00
Benjamin Otte
78223932c5 cssselector: Reintroduce GOT_MATCH
I removed it in 14f5ce7108 because I
thought it was unnecessary, but it wasn't. When we build a tree like
this:

.matches ─┬─ .doesntmatch
          └─ .alsodoesntmatch

We would get the changes for the .matches part returned. This is however
only right if that node of the tree contains results. If results only
exist with the child nodes (all of which don't match), then this part
should not match either.
2015-01-05 21:20:26 +01:00
Benjamin Otte
506639add1 cssselector: The if was the wrong way around
We want to keep matching as long as selectors are simple. Otherwise we'd
never be matching, because the first selector is always simple. Oops.
2015-01-05 21:20:26 +01:00
Sebastien Lafargue
43d6ebf9fb cellrenderertext: notify inverted
The notify for "size" and "size-points" properties
are inverted.

https://bugzilla.gnome.org/show_bug.cgi?id=742311
2015-01-04 12:48:14 +01:00
Emmanuele Bassi
b46fdb2d13 calendar: Handle invalid dates
GtkCalendar can have an invalid date — mostly at initialization. This
means that GDateTime construction may fail. We need to handle that case
gracefully, like the old code did.

This fixes the `notify` test suite, which started failing with:

/Notification/GtkCalendar:
GLib-CRITICAL **: g_date_time_get_day_of_week: assertion 'datetime != NULL' failed

inside the Continuous builder.
2015-01-02 23:15:55 +00:00
Christian Hergert
21360a453c textview: fix duplicated binding entries. use kp variants instead.
This appears to have accidentally used the normal keypresses twice instead
of the KP variants. This resulted in shift+insert pasting twice.

https://bugzilla.gnome.org/show_bug.cgi?id=742170
2014-12-31 23:27:55 -08:00
Inaki Larranaga Murgoitio
bf3b0ea641 Updated Basque language 2014-12-31 17:46:21 +01:00
Balázs Úr
cfcb43e3ca Updated Hungarian translation 2014-12-31 13:29:14 +00:00
Gábor Kelemen
dce50674c0 Updated Hungarian translation 2014-12-31 13:02:56 +00:00
Balázs Úr
c0e26aad56 Updated Hungarian translation 2014-12-31 12:03:47 +00:00
Trần Ngọc Quân
38f9e4bf11 Updated Vietnamese translation
Signed-off-by: Trần Ngọc Quân <vnwildman@gmail.com>
2014-12-31 15:50:54 +07:00
Ignacio Casal Quinteiro
23fa0e341f Fix typos in documentation 2014-12-30 13:46:11 +01:00
Jasper St. Pierre
5a41f63426 gtkstylecontext: Don't try to emit a signal when finalizing 2014-12-28 18:13:34 -08:00
Jasper St. Pierre
ecc64f63e4 gdkeventsource-wayland: Fix style 2014-12-28 18:13:34 -08:00
Jasper St. Pierre
915e4c6dd7 inspector: Update translations .ui.h file 2014-12-28 18:13:34 -08:00
Matthias Clasen
b4375cde48 Inspector: Show some X display characteristics
This helps diagnose e.g. csd problems.
2014-12-28 11:36:10 -05:00
Matthias Clasen
20f1c06eed Restore a missing file
No wonder nobody has tried my awesome magnifier yet...
2014-12-28 11:14:39 -05:00
Rico Tzschichholz
07efae7288 mir: Add missing reference to gdkmir-private.h 2014-12-28 13:34:16 +01:00
Trần Ngọc Quân
049ec56107 Updated vi translation for gtk+properties
Signed-off-by: Trần Ngọc Quân <vnwildman@gmail.com>
2014-12-28 09:20:14 +07:00
Christian Hergert
4d4883f010 scrolledwindow: fix spurious warnings from previous scrollbar commits 2014-12-26 14:19:55 -08:00
Emmanuele Bassi
5d42c55f28 x11/gl: Set the correct minor version
The major version is set twice.

https://bugzilla.gnome.org/show_bug.cgi?id=741954
2014-12-25 11:49:58 +00:00
Philip Chimento
ec37fbe2e2 quartz: NSWindow NULL check in get_scale_factor
Sending backingScaleFactor to a NULL NSWindow will silently give the
value 0 for the scale factor, causing insidious divide-by-zero bugs down
the line. This checks if the NSWindow is NULL first, as seems to happen
throughout the rest of the file.

Note that I don't have a hi-DPI OS X machine to test this on, though.

https://bugzilla.gnome.org/show_bug.cgi?id=738338
2014-12-24 14:57:40 -08:00
John Ralls
4bd787f2af Prevent double-free after 8b5d30d43. 2014-12-24 12:50:57 -08:00
Carlos Garnacho
7f28077b5a scrolledwindow: Enable "hover" mode in scrollbars after a timeout
This way transient mouse movements over scrollbars don't cause flickering,
and more spaced movements have it enabled shortly.
2014-12-24 09:26:43 -05:00
Carlos Garnacho
d2b2b34ae5 scrolledwindow: improve v/hscrollbar proximity detection
Only horizontal coordinates are checked for the vertical scrollbar, and
vice versa.
2014-12-24 09:26:43 -05:00
Carlos Garnacho
8b85db08e5 scrolledwindow: fade out scrollbars on leave notify 2014-12-24 09:26:43 -05:00
Carlos Garnacho
fdf367e868 scrolledwindow: make it a windowed widget again
This is so we can detect crossing events on the scrolledwindow widget,
which can be useful for toggling certain behaviors or not depending on
whether the mouse is on the widget.
2014-12-24 09:26:43 -05:00
Carlos Garnacho
3bcf5e2863 scrolledwindow: Show scrollbars upon captured motion events
On mice, scrollbars are always triggered temporarily. On proximity to an
scrollbar, it will be switched to full-width.
2014-12-24 09:26:43 -05:00
Ting-Wei Lan
2c6ac1fa3e popover: Add a missing #ifdef 2014-12-24 21:59:49 +08:00
Matthias Clasen
d216d89d6f GtkCalendar: Slightly change overflow behaviour
If the first of the month was falling on a Sunday, we would not
render any days of the previous month, and instead show two weeks
of the next month at the bottom. Improve this by showing one week
of each.

https://bugzilla.gnome.org/show_bug.cgi?id=301835
2014-12-23 21:49:21 -05:00
Matthias Clasen
7b9065c2ee Avoid a crash in testcalendar
When changing between months, we can get into a situation like
'February 30", which GDate doesn't accept. Don't crash in that
case.
2014-12-23 21:47:50 -05:00
Matthias Clasen
31f502a9ae css: Handle font-size changes properly
Changing font size does not cause widgets to update their size
properly anymore, since we forgot an invalidation flag. The
problem can be observed e.g. by running gtk3-demo and calling

gsettings set org.gnome.desktop.interface font-name "Cantarell 22"
2014-12-23 21:11:00 -05:00
Matthias Clasen
c763e73497 Adwaita: Bring back 'other month' coloring
The days that are not in the current month used to be rendered
in a ligher color. This was lost at some point. Bring it back.
2014-12-23 20:36:30 -05:00
Matthias Clasen
6ae93f5c46 GtkCalendar: Use GDateTime for calculations
Instead of old copy-paste code, use GDateTime to determine week
numbers and days of week.
2014-12-23 20:28:49 -05:00
Matthias Clasen
a7cf67f201 Formatting fixes 2014-12-23 18:54:11 -05:00
Matthias Clasen
79ada68f8c Formatting fixes 2014-12-23 14:30:10 -05:00
Matthias Clasen
0a54ad1187 GtkRecentManager: Formatting fixes 2014-12-23 14:30:10 -05:00
Stas Solovey
ea9f5e2273 Updated Russian translation 2014-12-23 14:09:52 +00:00
Carlos Garnacho
96f7c11f48 window: Use subsurfaces for popovers on wayland
On the wayland backend, set up GDK_WINDOW_SUBSURFACE windows
for popovers. In the popover code, the popover-relative-to-parent
calculation had to be tweaked, and it's been made to always prefer
the given popover position, since there's no sizing limitations.

https://bugzilla.gnome.org/show_bug.cgi?id=738891
2014-12-23 13:55:24 +01:00
Patrick Welche
5e9bf518a3 GtkApplicationWindow: Documentation fix
gtk_builder_add_from_string takes more than 2 parameters.

https://bugzilla.gnome.org/show_bug.cgi?id=741897
2014-12-23 10:40:51 +00:00
Florian Müllner
3a0ced32bf Adwaita: Special-case server-side window decorations
The WM already adds the window shadow in that case, so just use the
box-shadow to add the border here.
2014-12-22 22:33:22 +01:00
Matthias Clasen
5127136723 GtkNotebook: Be a bit more safe against cur_page being NULL
https://bugzilla.gnome.org/show_bug.cgi?id=477454
2014-12-22 10:52:54 -05:00
Matthias Clasen
ea36b7bfb0 GtkRecentManager: Survive without a filename
We were asserting priv->filename != NULL in various places,
which leads to apps refusing to work when HOME is set to a
nonexisting or nonwritable value. Since it isn't hard, just
make GtkRecentManager survive without a filename. We won't
save or read any recently used files in this state, but
thats ok.
https://bugzilla.gnome.org/show_bug.cgi?id=739038
2014-12-22 08:24:13 -05:00
Daniel Mustieles
84b0b45465 Updated Spanish translation 2014-12-22 13:08:37 +01:00
Daniel Mustieles
cc5a586ceb Updated Spanish translation 2014-12-22 13:08:20 +01:00
Ryan Lortie
6b26664c41 GtkMenuTracker: add hidden-when='macos-menubar'
Provide a mechanism for hiding the "Quit", "About" and "Preferences"
menu items from the normal places in a traditional menubar layout (in
the File and Edit menus) when the menu is being rendered in the Mac OS
menubar.

These items can already be found in the application menu.

With this feature, applications can now define a single menu to use in
all 'traditional' scenarios.

Use this new attribute in Bloatpad.

https://bugzilla.gnome.org/show_bug.cgi?id=741610
2014-12-22 06:22:26 -05:00
Matthias Clasen
4bc3f02d51 GtkRecentManager: Allow instantiating with gtk_init
This apparently used to work, and it doesn't do harm to allow it.

https://bugzilla.gnome.org/show_bug.cgi?id=705582
2014-12-21 23:14:02 -05:00
Matthias Clasen
53c388b724 Some formatting cleanups 2014-12-21 22:58:23 -05:00
Chun-wei Fan
36245b7058 GDK-Win32: Drop Some Unused Items
There were a bit of unused items from the GDK-Win32 work on GL support, so
drop them.
2014-12-22 11:25:49 +08:00
Ting-Wei Lan
ef57ac6bf1 reftests: Fix typo
It causes build failure on MinGW.

https://bugzilla.gnome.org/show_bug.cgi?id=741827
2014-12-22 11:14:17 +08:00
Ryan Lortie
ef2c68462b GtkMenuTracker: add missing documentation fragment
https://bugzilla.gnome.org/show_bug.cgi?id=741610
2014-12-20 21:24:34 -05:00
Matthias Clasen
1e1c5c65d1 inspector: Remove an errant shadow 2014-12-20 19:39:09 -05:00
Matthias Clasen
2b07b6c069 inspector: Add a magnifier
Add a magnifier that shows the selected widget up to 5 times
enlarged.
2014-12-20 19:24:08 -05:00
Matthias Clasen
52b3b4207f GtkTextView: disconnect the magifier on destroy
This prevents warnings that would otherwise happen when
the magifier is finalized.
2014-12-20 19:19:24 -05:00
Matthias Clasen
10d0ca0a3d GtkMagnifier: Add a resizing mode
In addition to the fixed-size mode that is used by the text view,
add a mode in which the magnifier requests enough size to render
the entire inspected widget at the current magnification. In this
mode, the magnifier will update its size when the size of the
inspected widget changes. Also, make the magnifier redraw on its
own whenever the inspected widget draws.
2014-12-20 19:16:46 -05:00
Benjamin Otte
42a6ae6c6c widget: Set the allocation via gtk_widget_set_allocation()
There is no good reason to assign the value directly.

Also, this fixes d23f3254b7
where widgets that chained up instead of calling
gtk_widget_set_allocation() would not draw becaues of empty clip.
2014-12-20 20:41:18 +01:00
Benjamin Otte
631688cf64 csstransform: Fix comparisons crashing
Transforms of different type are not equal.
2014-12-19 19:20:56 +01:00
Benjamin Otte
d23f3254b7 widget: Handle setting clip differently
(1) Get rid of supports_clip flag. All widgets (implicitly) support
clip.

(2) Don't reset the clip to { 0, 0, 0, 0 } before the "size-allocate"
signal.

(3) Make gtk_widget_set_allocation() set the clip (to the allocation).
This ensures that eveyr widget has a clip set.
Note: It overrides previous calls to gtk_widget_set_clip(), while in
3.14 this didn't happen.

(4) As the clip is set by gtk_widget_set_allocation() now, don't set
it after the "size-allocate" signal anymore.

This fixes calls to gtk_widget_queue_draw() from inside the
size_allocate vfunc.
2014-12-19 19:20:07 +01:00
Benjamin Otte
f0a40b1a23 widget-factory: Don't pulse dead widgets
Causes crashes at cleanup and we don't want those.

Also, code gets simpler.
2014-12-19 19:20:06 +01:00
Matthias Clasen
1dbc6d91f0 Don't initialize GL if it has been disabled
We've observed hangs of mutter when it initializes GTK+, which
are caused by initializing GL, which in turn makes xwayland
call back into mutter. With this change, mutter should just
disable GL support in GDK, and things will work.
2014-12-19 12:27:31 -05:00
Matthias Clasen
ac5ffd847b GtkApplication: Try to cope with ssh situations better
Override the gtk-shell-shows-app-menu and gtk-shell-shows-menubar
settings to FALSE, if we can detect that we are not on the same
session bus as the xsettings provider that we got these settings
from.

We determine this by comparing the bus ID of 'our' session
bus with the one reported in the Gtk/SessionBusId xsetting.
If they are different, then it very likely that we are in an ssh
situation where we see the forwarded X display, but not the
session bus. The D-Bus based menu exporting will not work
in this situation.

https://bugzilla.gnome.org/show_bug.cgi?id=671802
2014-12-18 23:26:23 -05:00
Matthias Clasen
57d034ce9f Add an XSetting for the session bus ID
This will allow us to identify situations where we are not on
the same session bus as the xsettings provider.

https://bugzilla.gnome.org/show_bug.cgi?id=671802
2014-12-18 23:26:11 -05:00
Christian Kirbach
583d612c9f Updated German translation 2014-12-18 22:49:08 +00:00
Carlos Garnacho
51e1e3b416 textview: make magnifier size dependent on text size
The magnifier is now set enough height to show the line being currently
manipulated, which makes it just big enough to show the layout height at
that size and magnification.
2014-12-18 21:21:33 +01:00
Carlos Garnacho
97137da6e5 Adwaita: Make text handles a bit larger
This improves visibility, and interaction, as the invisible rect around is
dependent on the visible handle size
2014-12-18 21:20:18 +01:00
Carlos Garnacho
025340bfc4 textview: Implement friendlier touch selection
- It is not possible anymore to trigger text DnD through touch, pressing
  and dragging from within the selection will instead extend it. Text
  shrinking is still available through the handles
- The selection mode for touch is per-word, char-level manipulation is
  still available through the handles.
- Tapping within the selection will bring in text handles, and toggle
  text selection popover.
2014-12-18 21:20:18 +01:00
Carlos Garnacho
8c091d1484 textview: Make "extend selection" only extend
This mode could also shrink the selection, plus the starting point would
seem somewhat arbitrary (actually dependent on the dragging direction of
the last selection).

Made this mode more consistent by only allowing it to extend the selection,
only in one direction for each operation, and so it keeps the current
selection as a minimum.
2014-12-18 21:20:18 +01:00
Carlos Garnacho
a2e71203c2 textview: Pass a boolean telling whether a selection drag should extend
Instead of passing a GdkEvent and let the function figure out whether the
selection should be extended, let that to the caller and just pass a
boolean here.
2014-12-18 21:20:17 +01:00
Carlos Garnacho
ccdebb6aa0 textview: Show magnifier on top of current line
The X coordinate is dependent on touch position, but Y is stepped.
2014-12-18 21:20:17 +01:00
Carlos Garnacho
79f8db1c0d texthandle: Use active state when handles are being dragged
The active state flags is set on both handles when this happens.
2014-12-18 21:20:17 +01:00
Carlos Garnacho
e0b9330880 texthandle: Use the handle widget style context for rendering
Using the parent widget context is a leftover of the pre-popover
implementation, which used GdkWindows directly. This will make the context
reflect widget state, at the expense of changing the selector paths
that used to match the handles.
2014-12-18 21:20:17 +01:00
Carlos Garnacho
dca2f4386d gesturesingle: check for the sequence being handled, not just the event
Checking the return value was valid for most gestures, but
GtkGestureLongPress, where the first press triggers internally an action,
but does nothing for the sequence to be claimed/denied, FALSE was eventually
returned, and the button/sequence functions would be incorrect when
::pressed is emitted.

So check that the sequence is being handled by the gesture, this is more
desirable than the return value as it's independent of sequence state,
and still will be FALSE for the cases we want to catch here.
2014-12-18 21:20:17 +01:00
Sebastien Lafargue
ce8dc51861 gtktextlayout: fix to quiet a warning
Gcc complains about a possible use of a not initialised
widget ref ( which can't happen in reality )

https://bugzilla.gnome.org/show_bug.cgi?id=741702
2014-12-18 21:00:45 +01:00
Sebastien Lafargue
73c8f30928 gtktextlayout: fix for right margin with RTL text
When a RTL paragraph is not set to wrap, the right margin is not respected
because of the margins counted twice so we replace
display->width by PIXEL_BOUND (extents.width), the same quantity
without the margins.

https://bugzilla.gnome.org/show_bug.cgi?id=741702
2014-12-18 20:52:58 +01:00
Erick Pérez Castellanos
ed1fb8d2af Minor documentation fix 2014-12-18 10:43:13 -05:00
Marek Kasik
779faafa22 printing: Translate context to correct position
Use correct margins of given page setup when translating context
to imageable area.

https://bugzilla.gnome.org/show_bug.cgi?id=671895
2014-12-18 16:29:48 +01:00
Marek Kasik
9ac9769f36 printing: Return correct width and height of page setup
Use correct margins when computing width and height returned by
gtk_page_setup_get_page_width() and
gtk_page_setup_get_page_height().

https://bugzilla.gnome.org/show_bug.cgi?id=671895
2014-12-18 16:29:44 +01:00
524 changed files with 134486 additions and 106233 deletions

View File

@@ -17,7 +17,7 @@ can be found here:
Information about using git with GNOME can be found here: Information about using git with GNOME can be found here:
http://live.gnome.org/Git https://wiki.gnome.org/Git
In order to get GIT GTK+ installed on your system, you need to have In order to get GIT GTK+ installed on your system, you need to have
the most recent GIT versions of GLib, Pango, and ATK installed as well. the most recent GIT versions of GLib, Pango, and ATK installed as well.

View File

@@ -1,7 +1,7 @@
## Makefile.am for GTK+ ## Makefile.am for GTK+
include $(top_srcdir)/Makefile.decl include $(top_srcdir)/Makefile.decl
SRC_SUBDIRS = util gdk gtk libgail-util modules demos tests testsuite examples SRC_SUBDIRS = gdk gtk libgail-util modules demos tests testsuite examples
SUBDIRS = po po-properties $(SRC_SUBDIRS) docs m4macros build SUBDIRS = po po-properties $(SRC_SUBDIRS) docs m4macros build
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
@@ -21,7 +21,8 @@ EXTRA_DIST += \
gtk-zip.sh.in \ gtk-zip.sh.in \
sanitize-la.sh \ sanitize-la.sh \
po/README.translators \ po/README.translators \
po/po2tbl.sed.in po/po2tbl.sed.in \
make-pot
MAINTAINERCLEANFILES = \ MAINTAINERCLEANFILES = \
$(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \ $(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \

426
NEWS
View File

@@ -1,3 +1,429 @@
Overview of Changes in GTK+ 3.15.12
===================================
* GtkMenuButton:
- Improve accessible names
* GtkCellRendererPixbuf:
- Always follow state changes, the ::follow-state property
is now ignored. This is necessary to make HighContrast
and symbolic icons remain visible e.g. in selected rows.
* GtkEntry:
- Rework the size allocation code to be less arcane. This
changed the semantics of the get_frame_size() vfunc. GtkEntry
subclasses that override this vfunc may need adjustment.
* Wayland:
- Support hi-dpi cursors
* Bugs fixed:
745829 crash when double-clicking close button while popover...
746141 wayland: Support HiDPI pointer cursors
746192 Insensitive backdrop ToolButtons are not drawn correctly
746201 Sidebar icons are black on black in HighContrast theme
746202 use insensitive color for unfocused selected items
746205 gemfile: needs add source rubygems.org
746282 pixman warnings after recent changes
746301 Opening "Sound" panel generates pixman error
* Translation updates:
Bosnian
Bulgarian
Catalan
Danish
Punjabi
Slovenian
Swedish
Vietnamese
Overview of Changes in GTK+ 3.15.11
===================================
* Go back to requiring GTK_FRAME_EXTENTS support for CSD,
to fix shadow problems in KDE.
* Bug fixes:
535929 Fix warnings from xReply test in configure.in
577862 FileFilter name not set
669008 Kerberos authentication popup
712760 Clang static analysis fixes
739070 Undefined reference to get_xkb() when building with --disable-xkb
744288 gdk_gl_context_set_required_version() handles version requests...
744589 nautilus bookmarks changing places randomly
745065 GtkPrintOperation dialog creation fails when GTK is locally loaded
745463 Search suggestions are not shown in Clocks / Weather
745479 Tracker search in file chooser causes a crash
745562 gedit titlebar is no longer draggable
745578 sincos is not portable
745622 Selected text not highlighted in GtkInfoBar
745721 wayland: Add support for gtk_window_set_modal
745918 add padding to textview in CSS section of GtkInspector
745969 CSD windows cannot be moved immediately after being resized
746013 Invalid write of size 8
Print dialog: Fix icons in HighContrast
Fix selected menu items in HighContrast
App chooser: Fix icons in HighContrast
* Translation updates:
French
Galician
Kazakh
Korean
Lithuanian
Polish
Slovak
Swedish
Overview of Changes in GTK+ 3.15.10
===================================
* GtkFileChooser:
- Don't start search too eagerly
- Use fts with tracker
- Make tracker queries more similar to nautilus
GtkWindow:
- Improve window dragging on header bars
* Printing:
- Make avahi-browsed printers work
- Set printer state correctly
* Wayland
- Exit cleanly if the compositor goes away
- Don't ignore early maximization/fullscreening
- Make subsurface popovers work under Weston
* GL
- Port GdkGears example to modern OpenGL
* Bugs fixed:
741511 Critical message: NULL is passed to g_object_unref() in spi_...
743323 avahi-discovered CUPS printers don't work
743427 subsurface-using popovers don't work on Weston
744879 Another core dump when clicking the Back button
745225 eventcontroller: Don't crash if the widget is destroyed first
745263 The Open button in the new file chooser is too low/thin
745289 wayland: do not use g_error() on connection errors
745303 Wayland: Initial setup window is not maximised
745344 overlay scrollbar fail
745400 fix a couple of issues in gdkglcontext-win32
703610 Problems with UC-Logic WA60 tablet
729366 Changes to folder name are not shown when creating new fol...
745315 Overshoot deceleration causes WebKitGTK1 web view to jump ...
* Translation updates
Afrikaans
Czech
French
Greek
Hebrew
Hungarian
Kazakh
Lithuanian
Polish
Slovak
Spanish
Vietnamese
Overview of Changes in GTK+ 3.15.9
==================================
* GtkScrolledWindow
- Avoid 'jumping' when zoom scrolling kicks in
- Make zoom scrolling less easy to trigger
- Make steppers use smooth autoscrolling
* Input methods can now be turned off entirely, which
can be useful to free up the Ctrl-Shift-u shortcut
* Add some DND support to gtk3-icon-browser
* Bugs fixed:
696505 Segfault on Windows x64: gtkstatusicon.c tries to put 64-bit...
744942 quartz: Avoid segfaulting when calling gdk_window_ensure_native
744991 Fix loading of GResource SVGs
745052 Icon theme code assumes directories with mtime 0 don't exist
745076 Various DPI and OpenGL related fixes in the Wayland backend
Fix crash and miscalculation in css bitmask manipulation
Fix a crash due to too large surfaces
* Translation updates
Chinese (Taiwan)
Hebrew
Hungarian
Galician
Greek
Slovak
Spanish
Overview of Changes in GTK+ 3.15.8
==================================
* CSS
- Support animated font weight changes
* GtkScrolledWindow:
- Ensure indicators appear in the correct place
* Wayland:
- DND fixes
* GtkPopover:
- has a map/unmap animation now
* Bugs fixed:
743647 image-missing is missing from libgtk's resources
744054 Clarify documentation for event propagation a...
744683 Tooltips should have ATK_ROLE_TOOL_TIP (like ...
* Translation updates
Galician
Hebrew
Hungarian
Italian
Norwegian bokmål
Punjabi
Slovenian
Spanish
Overview of Changes in GTK+ 3.15.7
==================================
* GtkListBox now supports models with gtk_list_box_bind_model
* GtkNotebook has a new function to support tab dnd
* GtkSidebar was renamed to GtkStackSidebar to better convey what it does
* GtkFileChooser now has a location column for search
* GdkGLProfile has been removed
* Bugs
695945 implement minimize / maximize functionality
708320 listbox: Update the cursor row when the row's child gets focus
741946 OpenGL context should allow for GL attribute selection
743350 main: Make gtk_get_option_group() available to bindings
744148 gtk: x: fix compilation without x11 backend
744172 Wayland: Clients won't work on compositors that support wl_seat < 4
744204 File chooser in gedit try to open directory instead of navigatin...
744394 GtkGLArea documentation does not reflect changes in the api
744400 Add specific CSS class for the close/minimize/maximize button
744407 Can't support core 3.2 gl context on llvmpipe
744455 wayland: Update to xdg-shell unstable v5
* Translation updates:
Hungarian
Norwegian bokmål
Slovenian
Spanish
Turkish
Overview of Changes in GTK+ 3.15.5
==================================
* GTK+ types now support the GLib g_autoptr() facility for
automatic cleanup of automatic variables. GTK+ itself does
not use g_autoptr() internally.
* GtkSearchEntry has gained ::next-match, ::previous-match
and ::stop-search signals and a gtk_search_entry_handle_event()
function, which help in providing a richer search experience
and make search entries usable outside of GtkSearchBar.
* GtkFileChooser:
- The search has been reintegrated in the UI, there is now
a toggle button on the header bar to go to search mode,
in addition to the Alt-S shortcut.
- The file chooser button now accepts files by drag-and-drop properly.
* GtkScrolledWindow has gained a new ::edge-reached signal, which
triggers when the edge of the scrollable area is reached.
* CSS:
- Performance improvements
* OpenGL:
- It is now possible to specify the required GL version, as well
as some other options (debug, forward compatible) when creating
a GdkGLContext
- Support for the OpenGL legacy profile has been dropped. Most examples
have been updated, with the exception of gdkgears, which will be fixed
in the next snapshot
- Use shader version 1.50
* Mir backend: Many improvements
* Bugs fixed:
712752 GtkClipboard: add _get_default and _get_primary
725164 [crash] update_current_folder_get_info_cb at gtkfilechooserwidget.c
732051 Crash can result if a child widget is destroyed while its tab is...
735316 Default font antialiasing results in wrong behavior on OS X
740336 Wrong (white) background colour in notes grid
740613 XConvertSelection crashes Gtk+ apps
742636 Freeze if window closed while resume-events pending
742953 GdkGLContext will not create a core context
743146 Crash in gdk_gl_texture_from_surface() when a GtkGLArea is packe...
743193 Fix transfer annotation for tree_model parameter of gtk_tree_get...
743229 clipboard: support selection notification on wayland
743257 Popover not dismissed on clicking the header bar
743286 Mention that the path returned by gtk_tree_row_reference_get_pat...
743330 Wintab initialization glitches
743341 GtkImage does not correctly reflect icon theme changes.
743393 DND icons don't work in the inspector
743422 valgrind: Conditional jump or move depends on uninitialised valu...
743451 Drag and drop on GtkFileChooserButton doesn't work
743592 crash on link click in about dialogue
743593 GtkWidget's va_marshaller for "event-after" signal is incorrect
743633 gdkscreen-wayland: Don't leak wl_output objects
743638 getting-started: Update example-0.c to use GtkApplication
743647 image-missing is missing from libgtk's resources
743659 All folders hidden after returning from search mode in GtkFileCh...
743660 Pressing Ctrl should not start a search in the file chooser
743680 getting-started: update Basics section to correspond to example-...
613833 Unnecessary queue_resize() for GtkImage
741946 OpenGL context should allow for GL attribute selection
742566 Bitfield structure members used for booleans
742848 scrolledwindow: should emit edge-overshot when scrollbar reaches end
743395 Regression in gnome-terminal starting with gtk commit 27285f1 ' ...
743640 add __attribute__((cleanup)) support
743770 Memory leak in plugman example
743894 don't trigger interactive overlay scrollbar when drag-selecting
743917 Gtk modules must be compatible with both gtk 2 and 3
743975 Better deprecation information for GtkStatusIcon
744203 gdkgl shaders use depricated GLSL version
744212 gdk_gl_context_set_required_version() interprets requests for 4...
* Translation updates:
Hebrew
Hungarian
Icelandic
Lithuanian
Norwegian bokmål
Russian
Slovak
Spanish
Overview of Changes in GTK+ 3.15.4
==================================
* GtkTextView
- Allow to customize multi-click behaviors, using the new
::extend-selection signal
- Selection can now be extended by scrolling
- Better behavior and appearance for text selection with touch
* GtkApplication:
- Use app menu fallback with ssh connections
- Provide a mechanism to hide unnecessary app menu items
on OS X, so a single menu file can be used across platforms
* GtkCalendar:
- Show other months in a different color under Adwaita again
- Ensure we always show a bit of the other month on both ends
* GtkScrolledWindow
- Make overlay scrollbars more dynamic
* GtkFileChooser:
- Make bookmark DND insert at the right location
- Make '~' and '/' work in recent mode
- Make Ctrl-L work in recent mode
- Re-integrate search
* CSS:
- Introduce immutable style nodes
- Performance improvements
- Reduced memory consumption
* GtkInspector:
- Add a magnifier for the selected widget
- Show more display information
- Show memory address of objects
* Wayland:
- Use subsurfaces for popovers, so popovers can extend beyond the
window boundaries
- Prefer the Wayland backend over X11 if both are available
* GL:
- Fix interaction with hi-dpi
- Add OpenGL support to the Windows backend
* Bugs:
111503 Customization of text selection bounds on double click
301835 should the calendar start on the 1st of month?
477454 libgtk crashed in gtk_notebook_button_release
671802 no menu fallback with ssh -X or sudo
671895 gtk_print_context_get_hard_margins needs to take into account page...
674537 GtkMenuPositionFunc: x and y should be "inout"
705582 gtk_recent_manager_init fails to check settings==NULL
710612 [PATCH] Allow to extend selection with mouse scrollwheel
738338 quartz: NSWindow NULL check in get_scale_factor
738891 Use GDK_WINDOW_SUBSURFACE for popovers
739038 gtk_recent_manager_set_filename: assertion failed: (priv->filename...
740758 Add getters for device vendor/product IDs
740795 GDK: Add OpenGL Support for Windows
741259 gtkmodelmenuitem: force icon scaling
741569 Minor theme bug: square progress bars
741610 Finish up support for macos menubar
741652 Leaking menus when attaching to a button
741702 Right margin not respected with RTL text in non-wrapping mode only
741827 typo in testsuite/reftests/Makefile.am causes build failure on Min...
741897 documentation fix
741969 GTK_STOCK_COPY
742010 GtkLabel eats thumb-button clicks
742170 cut/copy/paste binding entries are registered 2x
742181 "show images in menus" causes weird padding outside GNOME
742243 GtkScrolledWindow draws overshoot at the wrong position
742311 On cellrenderertext, notify for "size" and "size-points" propertie...
742343 Hide scrollbar in GtkFileChooser if appropriate
742518 object overview should include the pointer to the object in memory
742631 Left padding on File Chooser List
742653 gtkfilechooserwidget: When using an extra widget, show or hide the...
742664 Portabilitiy issues with GTK-Inspector 32-bit and non-gnome3 desktop
742702 GtkTreeView separator has wrong color if not active
742704 GtkComboBox: Separators not visible with Adwaita
742727 nautilus adding bookmark by dragging appear always at top
742764 Fix check for 'y' padding in gtk_cell_renderer_set_padding()
742771 Properly ignore BadWindow and BadDrawable in get_child_info_handler()
742774 Properly check result of g_utf8_get_char_validated()
742778 Fix accessible_class->widget_set initialization
742785 Fix event->button.y_root when using mouse buttons and dnd canceled
742786 Fix save_hot_y init in gtk_drag_get_icon()
742940 Adjust annotations of gtk_status_icon_position_menu to match GtkMe...
742980 cannot start broadway on FreeBSD
743037 Typo in gdk_window_get_root_coords documentation
743101 commit 77b876fa breaks zathura
743117 / and ~ Don't work in filechooser's recent mode
743157 gtk3-demo editable cells treeview problem
742646 DnD images not shown
* Translation updates:
Basque
British English
Czech
Galician
German
Greek
Hebrew
Hungarian
Icelandic
Lithuanian
Russian
Spanish
Vietnamese
Overview of Changes in GTK+ 3.15.3 Overview of Changes in GTK+ 3.15.3
================================== ==================================

View File

@@ -99,6 +99,11 @@ Release notes for 3.16
has non-scrolling parts similar to treeview headers, there is no need has non-scrolling parts similar to treeview headers, there is no need
to implement this vfunc. to implement this vfunc.
* The GtkSearchEntry widget has gained a number of new signal that
are emitted when certain key sequences are seen. In particular, it
now handles the Escape key and emits ::stop-search. Applications that
expect to handle Escape themselves will need to be updated.
Release notes for 3.14 Release notes for 3.14
====================== ======================

View File

@@ -166,7 +166,7 @@ Please refer to the following GNOME Live! page for a more detailed ouline
on the process of building the GTK+ stack and its dependencies with Visual on the process of building the GTK+ stack and its dependencies with Visual
C++: C++:
https://live.gnome.org/GTK%2B/Win32/MSVCCompilationOfGTKStack https://wiki.gnome.org/Projects/GTK+/Win32/MSVCCompilationOfGTKStack
Alternative 1 also generates Microsoft import libraries (.lib), if you Alternative 1 also generates Microsoft import libraries (.lib), if you
have lib.exe available. It might also work for cross-compilation from have lib.exe available. It might also work for cross-compilation from

View File

@@ -24,7 +24,7 @@ EXTRA_DIST += \
gtk3-icon-browser.vcxproj.filters \ gtk3-icon-browser.vcxproj.filters \
gailutil.vcxproj \ gailutil.vcxproj \
gailutil.vcxproj.filters \ gailutil.vcxproj.filters \
install.vcxproj \ gtk-install.vcxproj \
broadwayd.vcxproj \ broadwayd.vcxproj \
broadwayd.vcxproj.filters \ broadwayd.vcxproj.filters \
gdk-broadway.vcxproj \ gdk-broadway.vcxproj \

View File

@@ -5,7 +5,7 @@ the use of the library.
A more detailed outline for instructions on building the GTK+ with Visual A more detailed outline for instructions on building the GTK+ with Visual
C++ can be found in the following GNOME Live! page: C++ can be found in the following GNOME Live! page:
https://live.gnome.org/GTK%2B/Win32/MSVCCompilationOfGTKStack https://wiki.gnome.org/Projects/GTK+/Win32/MSVCCompilationOfGTKStack
This VS10 solution and the projects it includes are intented to be used This VS10 solution and the projects it includes are intented to be used
in a GTK+ source tree unpacked from a tarball. In a git checkout you in a GTK+ source tree unpacked from a tarball. In a git checkout you

View File

@@ -89,6 +89,7 @@
<AdditionalDependencies>atk-1.0.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>atk-1.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile> <OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile> <ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary> <ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
@@ -113,6 +114,7 @@
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile> <OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile> <ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary> <ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine> <TargetMachine>MachineX64</TargetMachine>
@@ -135,6 +137,7 @@
<AdditionalDependencies>atk-1.0.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>atk-1.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile> <OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile> <ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary> <ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
@@ -158,6 +161,7 @@
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile> <OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile> <ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>

View File

@@ -147,6 +147,7 @@
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile> <OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary> <ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
@@ -169,6 +170,7 @@
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile> <OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary> <ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
@@ -188,6 +190,7 @@
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile> <OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -209,6 +212,7 @@
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile> <OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -233,6 +237,7 @@
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile> <OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary> <ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine> <TargetMachine>MachineX64</TargetMachine>
@@ -255,6 +260,7 @@
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile> <OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary> <ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine> <TargetMachine>MachineX64</TargetMachine>
@@ -274,6 +280,7 @@
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile> <OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -295,6 +302,7 @@
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile> <OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>

View File

@@ -22,7 +22,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtk-encode-symbolic-svg", "
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gailutil", "gailutil.vcxproj", "{29E3E814-1BA3-4AD7-A3A7-3669CB80A942}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gailutil", "gailutil.vcxproj", "{29E3E814-1BA3-4AD7-A3A7-3669CB80A942}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "install", "install.vcxproj", "{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtk-install", "gtk-install.vcxproj", "{2093D218-190E-4194-9421-3BA7CBF33B15}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -156,22 +156,22 @@ Global
{29E3E814-1BA3-4AD7-A3A7-3669CB80A942}.Release_Broadway|Win32.Build.0 = Release|Win32 {29E3E814-1BA3-4AD7-A3A7-3669CB80A942}.Release_Broadway|Win32.Build.0 = Release|Win32
{29E3E814-1BA3-4AD7-A3A7-3669CB80A942}.Release_Broadway|x64.ActiveCfg = Release|x64 {29E3E814-1BA3-4AD7-A3A7-3669CB80A942}.Release_Broadway|x64.ActiveCfg = Release|x64
{29E3E814-1BA3-4AD7-A3A7-3669CB80A942}.Release_Broadway|x64.Build.0 = Release|x64 {29E3E814-1BA3-4AD7-A3A7-3669CB80A942}.Release_Broadway|x64.Build.0 = Release|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.ActiveCfg = Debug|Win32 {2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|Win32.ActiveCfg = Debug|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.Build.0 = Debug|Win32 {2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|Win32.Build.0 = Debug|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.ActiveCfg = Debug|x64 {2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|x64.ActiveCfg = Debug|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.Build.0 = Debug|x64 {2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|x64.Build.0 = Debug|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.ActiveCfg = Release|Win32 {2093D218-190E-4194-9421-3BA7CBF33B15}.Release|Win32.ActiveCfg = Release|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.Build.0 = Release|Win32 {2093D218-190E-4194-9421-3BA7CBF33B15}.Release|Win32.Build.0 = Release|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.ActiveCfg = Release|x64 {2093D218-190E-4194-9421-3BA7CBF33B15}.Release|x64.ActiveCfg = Release|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.Build.0 = Release|x64 {2093D218-190E-4194-9421-3BA7CBF33B15}.Release|x64.Build.0 = Release|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|Win32.ActiveCfg = Debug_Broadway|Win32 {2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|Win32.ActiveCfg = Debug_Broadway|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|Win32.Build.0 = Debug_Broadway|Win32 {2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|Win32.Build.0 = Debug_Broadway|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|x64.ActiveCfg = Debug_Broadway|x64 {2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|x64.ActiveCfg = Debug_Broadway|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|x64.Build.0 = Debug_Broadway|x64 {2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|x64.Build.0 = Debug_Broadway|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|Win32.ActiveCfg = Release_Broadway|Win32 {2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|Win32.ActiveCfg = Release_Broadway|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|Win32.Build.0 = Release_Broadway|Win32 {2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|Win32.Build.0 = Release_Broadway|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|x64.ActiveCfg = Release_Broadway|x64 {2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|x64.ActiveCfg = Release_Broadway|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|x64.Build.0 = Release_Broadway|x64 {2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|x64.Build.0 = Release_Broadway|x64
{3281202A-CD26-4C67-B892-EB34BDBC612F}.Debug|Win32.ActiveCfg = Debug|Win32 {3281202A-CD26-4C67-B892-EB34BDBC612F}.Debug|Win32.ActiveCfg = Debug|Win32
{3281202A-CD26-4C67-B892-EB34BDBC612F}.Debug|Win32.Build.0 = Debug|Win32 {3281202A-CD26-4C67-B892-EB34BDBC612F}.Debug|Win32.Build.0 = Debug|Win32
{3281202A-CD26-4C67-B892-EB34BDBC612F}.Debug|x64.ActiveCfg = Debug|x64 {3281202A-CD26-4C67-B892-EB34BDBC612F}.Debug|x64.ActiveCfg = Debug|x64

View File

@@ -21,6 +21,8 @@
<AdditionalIncludeDirectories>..\..\..;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\include;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\..\..;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\include;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>HAVE_CONFIG_H;G_DISABLE_SINGLE_INCLUDES;ATK_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>HAVE_CONFIG_H;G_DISABLE_SINGLE_INCLUDES;ATK_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ForcedIncludeFiles>msvc_recommended_pragmas.h;%(ForcedIncludeFiles)</ForcedIncludeFiles> <ForcedIncludeFiles>msvc_recommended_pragmas.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/d2Zi+ %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>pangocairo-1.0.lib;cairo.lib;cairo-gobject.lib;pango-1.0.lib;gdk_pixbuf-2.0.lib;gio-2.0.lib;gmodule-2.0.lib;gobject-2.0.lib;glib-2.0.lib;intl.lib;epoxy.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>pangocairo-1.0.lib;cairo.lib;cairo-gobject.lib;pango-1.0.lib;gdk_pixbuf-2.0.lib;gio-2.0.lib;gmodule-2.0.lib;gobject-2.0.lib;glib-2.0.lib;intl.lib;epoxy.lib;%(AdditionalDependencies)</AdditionalDependencies>

View File

@@ -11,26 +11,69 @@
<GtkDoInstallBin> <GtkDoInstallBin>
mkdir $(CopyDir)\bin mkdir $(CopyDir)\bin
mkdir $(CopyDir)\lib mkdir $(CopyDir)\lib
copy "$(BinDir)\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll" $(CopyDir)\bin
copy "$(BinDir)\$(GtkDllPrefix)gdk$(GtkDllSuffix).pdb" $(CopyDir)\bin
copy "$(BinDir)\gdk-$(ApiVersion).lib" $(CopyDir)\lib
if "$(Configuration)" == "Release_Broadway" goto DO_BROADWAY_BIN if "$(Configuration)" == "Release_Broadway" goto DO_BROADWAY_BIN
if "$(Configuration)" == "Debug_Broadway" goto DO_BROADWAY_BIN if "$(Configuration)" == "Debug_Broadway" goto DO_BROADWAY_BIN
copy "$(BinDir)\*.dll" $(CopyDir)\bin copy "$(BinDir)\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll" $(CopyDir)\bin
copy "$(BinDir)\*-$(ApiVersion).lib" $(CopyDir)\lib copy "$(BinDir)\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb" $(CopyDir)\bin
copy "$(BinDir)\*.exe" $(CopyDir)\bin copy "$(BinDir)\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll" $(CopyDir)\bin
copy "$(BinDir)\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb" $(CopyDir)\bin
copy "$(BinDir)\gtk-$(ApiVersion).lib" $(CopyDir)\lib
copy "$(BinDir)\gailutil-$(ApiVersion).lib" $(CopyDir)\lib
copy "$(BinDir)\gtk3-demo.exe" $(CopyDir)\bin
copy "$(BinDir)\gtk3-demo.pdb" $(CopyDir)\bin
copy "$(BinDir)\gtk3-demo-application.exe" $(CopyDir)\bin
copy "$(BinDir)\gtk3-demo-application.pdb" $(CopyDir)\bin
copy "$(BinDir)\gtk3-icon-browser.exe" $(CopyDir)\bin
copy "$(BinDir)\gtk3-icon-browser.pdb" $(CopyDir)\bin
copy "$(BinDir)\gtk-encode-symbolic-svg.exe" $(CopyDir)\bin
copy "$(BinDir)\gtk-encode-symbolic-svg.pdb" $(CopyDir)\bin
goto DONE_BIN goto DONE_BIN
:DO_BROADWAY_BIN :DO_BROADWAY_BIN
copy "$(BinDir)\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll" $(CopyDir)\bin
copy "$(BinDir)\gdk-$(ApiVersion).lib" $(CopyDir)\lib
copy "$(BinDir)\broadwayd.exe" $(CopyDir)\bin copy "$(BinDir)\broadwayd.exe" $(CopyDir)\bin
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin copy "$(BinDir)\broadwayd.pdb" $(CopyDir)\bin
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib if "$(Configuration)" == "Release_Broadway" goto DO_BROADWAY_RELEASE
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib if "$(Configuration)" == "Debug_Broadway" goto DO_BROADWAY_DEBUG
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\*.exe $(CopyDir)\bin :DO_BROADWAY_RELEASE
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb $(CopyDir)\bin
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb $(CopyDir)\bin
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\*.exe $(CopyDir)\bin copy .\Release\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
copy .\Release\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
copy .\Release\$(Platform)\bin\gtk3-demo.exe $(CopyDir)\bin
copy .\Release\$(Platform)\bin\gtk3-demo.pdb $(CopyDir)\bin
copy .\Release\$(Platform)\bin\gtk3-demo-application.exe $(CopyDir)\bin
copy .\Release\$(Platform)\bin\gtk3-demo-application.pdb $(CopyDir)\bin
copy .\Release\$(Platform)\bin\gtk3-icon-browser.exe $(CopyDir)\bin
copy .\Release\$(Platform)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin
copy .\Release\$(Platform)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin
copy .\Release\$(Platform)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin
goto DONE_BIN
:DO_BROADWAY_DEBUG
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
copy .\Debug\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
copy .\Debug\$(Platform)\bin\gtk3-demo.exe $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\gtk3-demo.pdb $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\gtk3-demo-application.exe $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\gtk3-demo-application.pdb $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\gtk3-icon-browser.exe $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin
:DONE_BIN :DONE_BIN
</GtkDoInstallBin> </GtkDoInstallBin>
<GtkDoInstall> <GtkDoInstall>
@@ -43,6 +86,7 @@ mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y
mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gtk\deprecated mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gtk\deprecated
copy ..\..\..\gdk\win32\gdkwin32.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk copy ..\..\..\gdk\win32\gdkwin32.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk
copy ..\..\..\gdk\gdk.h $(CopyDir)\include\gtk-3.0\gdk\gdk.h copy ..\..\..\gdk\gdk.h $(CopyDir)\include\gtk-3.0\gdk\gdk.h
copy ..\..\..\gdk\gdk-autocleanup.h $(CopyDir)\include\gtk-3.0\gdk\gdk-autocleanup.h
copy ..\..\..\gdk\gdkapplaunchcontext.h $(CopyDir)\include\gtk-3.0\gdk\gdkapplaunchcontext.h copy ..\..\..\gdk\gdkapplaunchcontext.h $(CopyDir)\include\gtk-3.0\gdk\gdkapplaunchcontext.h
copy ..\..\..\gdk\gdkcairo.h $(CopyDir)\include\gtk-3.0\gdk\gdkcairo.h copy ..\..\..\gdk\gdkcairo.h $(CopyDir)\include\gtk-3.0\gdk\gdkcairo.h
copy ..\..\..\gdk\gdkcursor.h $(CopyDir)\include\gtk-3.0\gdk\gdkcursor.h copy ..\..\..\gdk\gdkcursor.h $(CopyDir)\include\gtk-3.0\gdk\gdkcursor.h
@@ -86,7 +130,9 @@ copy ..\..\..\gdk\win32\gdkwin32misc.h $(CopyDir)\include\gtk-3.0\gdk\win32\gdkw
copy ..\..\..\gdk\win32\gdkwin32screen.h $(CopyDir)\include\gtk-3.0\gdk\win32\gdkwin32screen.h copy ..\..\..\gdk\win32\gdkwin32screen.h $(CopyDir)\include\gtk-3.0\gdk\win32\gdkwin32screen.h
copy ..\..\..\gdk\win32\gdkwin32window.h $(CopyDir)\include\gtk-3.0\gdk\win32\gdkwin32window.h copy ..\..\..\gdk\win32\gdkwin32window.h $(CopyDir)\include\gtk-3.0\gdk\win32\gdkwin32window.h
copy ..\..\..\gtk\gtk.h $(CopyDir)\include\gtk-3.0\gtk\gtk.h copy ..\..\..\gtk\gtk.h $(CopyDir)\include\gtk-3.0\gtk\gtk.h
copy ..\..\..\gtk\gtk-autocleanups.h $(CopyDir)\include\gtk-3.0\gtk\gtk-autocleanups.h
copy ..\..\..\gtk\gtkx.h $(CopyDir)\include\gtk-3.0\gtk\gtkx.h copy ..\..\..\gtk\gtkx.h $(CopyDir)\include\gtk-3.0\gtk\gtkx.h
copy ..\..\..\gtk\gtkx-autocleanups.h $(CopyDir)\include\gtk-3.0\gtk\gtkx-autocleanups.h
copy ..\..\..\gtk\gtk-a11y.h $(CopyDir)\include\gtk-3.0\gtk\gtk-a11y.h copy ..\..\..\gtk\gtk-a11y.h $(CopyDir)\include\gtk-3.0\gtk\gtk-a11y.h
copy ..\..\..\gtk\gtkaboutdialog.h $(CopyDir)\include\gtk-3.0\gtk\gtkaboutdialog.h copy ..\..\..\gtk\gtkaboutdialog.h $(CopyDir)\include\gtk-3.0\gtk\gtkaboutdialog.h
copy ..\..\..\gtk\gtkaccelgroup.h $(CopyDir)\include\gtk-3.0\gtk\gtkaccelgroup.h copy ..\..\..\gtk\gtkaccelgroup.h $(CopyDir)\include\gtk-3.0\gtk\gtkaccelgroup.h
@@ -297,6 +343,7 @@ copy ..\..\..\gtk\gtkwindowgroup.h $(CopyDir)\include\gtk-3.0\gtk\gtkwindowgroup
copy ..\..\..\gtk\gtktextlayout.h $(CopyDir)\include\gtk-3.0\gtk\gtktextlayout.h copy ..\..\..\gtk\gtktextlayout.h $(CopyDir)\include\gtk-3.0\gtk\gtktextlayout.h
copy ..\..\..\gtk\gtktypebuiltins.h $(CopyDir)\include\gtk-3.0\gtk\gtktypebuiltins.h copy ..\..\..\gtk\gtktypebuiltins.h $(CopyDir)\include\gtk-3.0\gtk\gtktypebuiltins.h
copy ..\..\..\gtk\gtkversion.h $(CopyDir)\include\gtk-3.0\gtk\gtkversion.h copy ..\..\..\gtk\gtkversion.h $(CopyDir)\include\gtk-3.0\gtk\gtkversion.h
copy ..\..\..\gtk\a11y\gtk-a11y-autocleanups.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtk-a11y-autocleanups.h
copy ..\..\..\gtk\a11y\gtkarrowaccessible.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtkarrowaccessible.h copy ..\..\..\gtk\a11y\gtkarrowaccessible.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtkarrowaccessible.h
copy ..\..\..\gtk\a11y\gtkbooleancellaccessible.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtkbooleancellaccessible.h copy ..\..\..\gtk\a11y\gtkbooleancellaccessible.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtkbooleancellaccessible.h
copy ..\..\..\gtk\a11y\gtkbuttonaccessible.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtkbuttonaccessible.h copy ..\..\..\gtk\a11y\gtkbuttonaccessible.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtkbuttonaccessible.h

View File

@@ -35,8 +35,8 @@
</ProjectConfiguration> </ProjectConfiguration>
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}</ProjectGuid> <ProjectGuid>{2093D218-190E-4194-9421-3BA7CBF33B15}</ProjectGuid>
<RootNamespace>install</RootNamespace> <RootNamespace>gtkinstall</RootNamespace>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -219,4 +219,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>
</Project> </Project>

View File

@@ -89,6 +89,7 @@
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile> <OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary> <ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
@@ -108,6 +109,7 @@
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile> <OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -132,6 +134,7 @@
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile> <OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary> <ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine> <TargetMachine>MachineX64</TargetMachine>
@@ -151,6 +154,7 @@
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile> <OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>

View File

@@ -161,6 +161,7 @@
<ItemGroup> <ItemGroup>
<ClCompile Include="..\..\..\demos\icon-browser\iconbrowserapp.c" /> <ClCompile Include="..\..\..\demos\icon-browser\iconbrowserapp.c" />
<ClCompile Include="..\..\..\demos\icon-browser\iconbrowserwin.c" /> <ClCompile Include="..\..\..\demos\icon-browser\iconbrowserwin.c" />
<ClCompile Include="..\..\..\demos\icon-browser\iconstore.c" />
<ClCompile Include="..\..\..\demos\icon-browser\main.c" /> <ClCompile Include="..\..\..\demos\icon-browser\main.c" />
<ClCompile Include="..\..\..\demos\icon-browser\resources.c" /> <ClCompile Include="..\..\..\demos\icon-browser\resources.c" />
</ItemGroup> </ItemGroup>

View File

@@ -17,6 +17,7 @@
<ItemGroup> <ItemGroup>
<ClCompile Include="..\..\..\demos\icon-browser\iconbrowserapp.c"><Filter>Sources</Filter></ClCompile> <ClCompile Include="..\..\..\demos\icon-browser\iconbrowserapp.c"><Filter>Sources</Filter></ClCompile>
<ClCompile Include="..\..\..\demos\icon-browser\iconbrowserwin.c"><Filter>Sources</Filter></ClCompile> <ClCompile Include="..\..\..\demos\icon-browser\iconbrowserwin.c"><Filter>Sources</Filter></ClCompile>
<ClCompile Include="..\..\..\demos\icon-browser\iconstore.c"><Filter>Sources</Filter></ClCompile>
<ClCompile Include="..\..\..\demos\icon-browser\main.c"><Filter>Sources</Filter></ClCompile> <ClCompile Include="..\..\..\demos\icon-browser\main.c"><Filter>Sources</Filter></ClCompile>
<ClCompile Include="..\..\..\demos\icon-browser\resources.c"><Filter>Sources</Filter></ClCompile> <ClCompile Include="..\..\..\demos\icon-browser\resources.c"><Filter>Sources</Filter></ClCompile>
</ItemGroup> </ItemGroup>

View File

@@ -20,7 +20,7 @@ EXTRA_DIST += \
gtk3-icon-browser.vcxproj.filters \ gtk3-icon-browser.vcxproj.filters \
gailutil.vcxproj \ gailutil.vcxproj \
gailutil.vcxproj.filters \ gailutil.vcxproj.filters \
install.vcxproj \ gtk-install.vcxproj \
broadwayd.vcxproj \ broadwayd.vcxproj \
broadwayd.vcxproj.filters \ broadwayd.vcxproj.filters \
gdk-broadway.vcxproj \ gdk-broadway.vcxproj \

View File

@@ -20,7 +20,7 @@ EXTRA_DIST += \
gtk3-icon-browser.vcxproj.filters \ gtk3-icon-browser.vcxproj.filters \
gailutil.vcxproj \ gailutil.vcxproj \
gailutil.vcxproj.filters \ gailutil.vcxproj.filters \
install.vcxproj \ gtk-install.vcxproj \
broadwayd.vcxproj \ broadwayd.vcxproj \
broadwayd.vcxproj.filters \ broadwayd.vcxproj.filters \
gdk-broadway.vcxproj \ gdk-broadway.vcxproj \

View File

@@ -14,7 +14,7 @@ EXTRA_DIST += \
gtk3-demo-application.vcproj \ gtk3-demo-application.vcproj \
gtk3-icon-browser.vcproj \ gtk3-icon-browser.vcproj \
gailutil.vcproj \ gailutil.vcproj \
install.vcproj \ gtk-install.vcproj \
broadwayd.vcproj \ broadwayd.vcproj \
gdk-broadway.vcproj \ gdk-broadway.vcproj \
gtk-build-defines.vsprops \ gtk-build-defines.vsprops \

View File

@@ -5,7 +5,7 @@ the use of the library.
A more detailed outline for instructions on building the GTK+ with Visual A more detailed outline for instructions on building the GTK+ with Visual
C++ can be found in the following GNOME Live! page: C++ can be found in the following GNOME Live! page:
https://live.gnome.org/GTK%2B/Win32/MSVCCompilationOfGTKStack https://wiki.gnome.org/Projects/GTK+/Win32/MSVCCompilationOfGTKStack
This VS9 solution and the projects it includes are intented to be used This VS9 solution and the projects it includes are intented to be used
in a GTK+ source tree unpacked from a tarball. In a git checkout you in a GTK+ source tree unpacked from a tarball. In a git checkout you

View File

@@ -57,7 +57,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gailutil", "gailutil.vcproj
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5} = {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5} {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5} = {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "install", "install.vcproj", "{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtk-install", "gtk-install.vcproj", "{2093D218-190E-4194-9421-3BA7CBF33B15}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F7} = {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F7} {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F7} = {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F7}
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5} = {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5} {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5} = {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}
@@ -161,22 +161,22 @@ Global
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}.Release_Broadway|Win32.Build.0 = Release|Win32 {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}.Release_Broadway|Win32.Build.0 = Release|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}.Release_Broadway|x64.ActiveCfg = Release|x64 {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}.Release_Broadway|x64.ActiveCfg = Release|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}.Release_Broadway|x64.Build.0 = Release|x64 {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}.Release_Broadway|x64.Build.0 = Release|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.ActiveCfg = Debug|Win32 {2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|Win32.ActiveCfg = Debug|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.Build.0 = Debug|Win32 {2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|Win32.Build.0 = Debug|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.ActiveCfg = Debug|x64 {2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|x64.ActiveCfg = Debug|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.Build.0 = Debug|x64 {2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|x64.Build.0 = Debug|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.ActiveCfg = Release|Win32 {2093D218-190E-4194-9421-3BA7CBF33B15}.Release|Win32.ActiveCfg = Release|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.Build.0 = Release|Win32 {2093D218-190E-4194-9421-3BA7CBF33B15}.Release|Win32.Build.0 = Release|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.ActiveCfg = Release|x64 {2093D218-190E-4194-9421-3BA7CBF33B15}.Release|x64.ActiveCfg = Release|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.Build.0 = Release|x64 {2093D218-190E-4194-9421-3BA7CBF33B15}.Release|x64.Build.0 = Release|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|Win32.ActiveCfg = Debug_Broadway|Win32 {2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|Win32.ActiveCfg = Debug_Broadway|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|Win32.Build.0 = Debug_Broadway|Win32 {2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|Win32.Build.0 = Debug_Broadway|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|x64.ActiveCfg = Debug_Broadway|x64 {2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|x64.ActiveCfg = Debug_Broadway|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|x64.Build.0 = Debug_Broadway|x64 {2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|x64.Build.0 = Debug_Broadway|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|Win32.ActiveCfg = Release_Broadway|Win32 {2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|Win32.ActiveCfg = Release_Broadway|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|Win32.Build.0 = Release_Broadway|Win32 {2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|Win32.Build.0 = Release_Broadway|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|x64.ActiveCfg = Release_Broadway|x64 {2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|x64.ActiveCfg = Release_Broadway|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|x64.Build.0 = Release_Broadway|x64 {2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|x64.Build.0 = Release_Broadway|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FC}.Debug|Win32.ActiveCfg = Debug|Win32 {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FC}.Debug|Win32.ActiveCfg = Debug|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FC}.Debug|Win32.Build.0 = Debug|Win32 {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FC}.Debug|Win32.Build.0 = Debug|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FC}.Debug|x64.ActiveCfg = Debug|x64 {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FC}.Debug|x64.ActiveCfg = Debug|x64

View File

@@ -12,6 +12,7 @@
AdditionalIncludeDirectories="..\..\..;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\include;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0" AdditionalIncludeDirectories="..\..\..;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\include;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0"
PreprocessorDefinitions="HAVE_CONFIG_H;G_DISABLE_SINGLE_INCLUDES;ATK_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES" PreprocessorDefinitions="HAVE_CONFIG_H;G_DISABLE_SINGLE_INCLUDES;ATK_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES"
ForcedIncludeFiles="msvc_recommended_pragmas.h" ForcedIncludeFiles="msvc_recommended_pragmas.h"
AdditionalOptions="/MP"
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"

View File

@@ -2,9 +2,9 @@
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="9.00" Version="9.00"
Name="install" Name="gtk-install"
ProjectGUID="{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}" ProjectGUID="{2093D218-190E-4194-9421-3BA7CBF33B15}"
RootNamespace="install" RootNamespace="gtkinstall"
Keyword="Win32Proj" Keyword="Win32Proj"
TargetFrameworkVersion="131072" TargetFrameworkVersion="131072"
> >

View File

@@ -10,26 +10,63 @@
Value=" Value="
mkdir $(CopyDir)\bin&#x0D;&#x0A; mkdir $(CopyDir)\bin&#x0D;&#x0A;
mkdir $(CopyDir)\lib&#x0D;&#x0A; mkdir $(CopyDir)\lib&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gdk$(GtkDllSuffix).pdb $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gdk-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Release_Broadway&quot; goto DO_BROADWAY_BIN&#x0D;&#x0A; if &quot;$(ConfigurationName)&quot; == &quot;Release_Broadway&quot; goto DO_BROADWAY_BIN&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Debug_Broadway&quot; goto DO_BROADWAY_BIN&#x0D;&#x0A; if &quot;$(ConfigurationName)&quot; == &quot;Debug_Broadway&quot; goto DO_BROADWAY_BIN&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\*.dll $(CopyDir)\bin&#x0D;&#x0A; copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\*-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A; copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\*.exe $(CopyDir)\bin&#x0D;&#x0A; copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-demo.exe $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-demo.pdb $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-demo-application.exe $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-demo-application.pdb $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-icon-browser.exe $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin&#x0D;&#x0A;
goto DONE_BIN&#x0D;&#x0A; goto DONE_BIN&#x0D;&#x0A;
:DO_BROADWAY_BIN&#x0D;&#x0A; :DO_BROADWAY_BIN&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gdk-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\broadwayd.exe $(CopyDir)\bin&#x0D;&#x0A; copy $(ConfigurationName)\$(PlatformName)\bin\broadwayd.exe $(CopyDir)\bin&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Release_Broadway&quot; copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A; copy $(ConfigurationName)\$(PlatformName)\bin\broadwayd.pdb $(CopyDir)\bin&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Release_Broadway&quot; copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Release_Broadway&quot; copy .\Release\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A; if &quot;$(ConfigurationName)&quot; == &quot;Release_Broadway&quot; goto DO_BROADWAY_RELEASE&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Release_Broadway&quot; copy .\Release\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A; if &quot;$(ConfigurationName)&quot; == &quot;Debug_Broadway&quot; goto DO_BROADWAY_DEBUG&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Release_Broadway&quot; copy .\Release\$(PlatformName)\bin\*.exe $(CopyDir)\bin&#x0D;&#x0A; :DO_BROADWAY_RELEASE&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Debug_Broadway&quot; copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A; copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Debug_Broadway&quot; copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A; copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Debug_Broadway&quot; copy .\Debug\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A; copy .\Release\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Debug_Broadway&quot; copy .\Debug\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A; copy .\Release\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Debug_Broadway&quot; copy .\Debug\$(PlatformName)\bin\*.exe $(CopyDir)\bin&#x0D;&#x0A; copy .\Release\$(PlatformName)\bin\gtk3-demo.exe $(CopyDir)\bin&#x0D;&#x0A;
copy .\Release\$(PlatformName)\bin\gtk3-demo.pdb $(CopyDir)\bin&#x0D;&#x0A;
copy .\Release\$(PlatformName)\bin\gtk3-demo-application.exe $(CopyDir)\bin&#x0D;&#x0A;
copy .\Release\$(PlatformName)\bin\gtk3-demo-application.pdb $(CopyDir)\bin&#x0D;&#x0A;
copy .\Release\$(PlatformName)\bin\gtk3-icon-browser.exe $(CopyDir)\bin&#x0D;&#x0A;
copy .\Release\$(PlatformName)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin&#x0D;&#x0A;
copy .\Release\$(PlatformName)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin&#x0D;&#x0A;
copy .\Release\$(PlatformName)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin&#x0D;&#x0A;
goto DONE_BIN&#x0D;&#x0A;
:DO_BROADWAY_DEBUG&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\gtk3-demo.exe $(CopyDir)\bin&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\gtk3-demo.pdb $(CopyDir)\bin&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\gtk3-demo-application.exe $(CopyDir)\bin&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\gtk3-demo-application.pdb $(CopyDir)\bin&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\gtk3-icon-browser.exe $(CopyDir)\bin&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin&#x0D;&#x0A;
:DONE_BIN&#x0D;&#x0A; :DONE_BIN&#x0D;&#x0A;
" "
/> />
@@ -45,6 +82,7 @@ mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y&#x0D;&#x0A;
mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gtk\deprecated&#x0D;&#x0A; mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gtk\deprecated&#x0D;&#x0A;
copy ..\..\..\gdk\win32\gdkwin32.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk&#x0D;&#x0A; copy ..\..\..\gdk\win32\gdkwin32.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk&#x0D;&#x0A;
copy ..\..\..\gdk\gdk.h $(CopyDir)\include\gtk-3.0\gdk\gdk.h&#x0D;&#x0A; copy ..\..\..\gdk\gdk.h $(CopyDir)\include\gtk-3.0\gdk\gdk.h&#x0D;&#x0A;
copy ..\..\..\gdk\gdk-autocleanup.h $(CopyDir)\include\gtk-3.0\gdk\gdk-autocleanup.h&#x0D;&#x0A;
copy ..\..\..\gdk\gdkapplaunchcontext.h $(CopyDir)\include\gtk-3.0\gdk\gdkapplaunchcontext.h&#x0D;&#x0A; copy ..\..\..\gdk\gdkapplaunchcontext.h $(CopyDir)\include\gtk-3.0\gdk\gdkapplaunchcontext.h&#x0D;&#x0A;
copy ..\..\..\gdk\gdkcairo.h $(CopyDir)\include\gtk-3.0\gdk\gdkcairo.h&#x0D;&#x0A; copy ..\..\..\gdk\gdkcairo.h $(CopyDir)\include\gtk-3.0\gdk\gdkcairo.h&#x0D;&#x0A;
copy ..\..\..\gdk\gdkcursor.h $(CopyDir)\include\gtk-3.0\gdk\gdkcursor.h&#x0D;&#x0A; copy ..\..\..\gdk\gdkcursor.h $(CopyDir)\include\gtk-3.0\gdk\gdkcursor.h&#x0D;&#x0A;
@@ -88,7 +126,9 @@ copy ..\..\..\gdk\win32\gdkwin32misc.h $(CopyDir)\include\gtk-3.0\gdk\win32\gdkw
copy ..\..\..\gdk\win32\gdkwin32screen.h $(CopyDir)\include\gtk-3.0\gdk\win32\gdkwin32screen.h&#x0D;&#x0A; copy ..\..\..\gdk\win32\gdkwin32screen.h $(CopyDir)\include\gtk-3.0\gdk\win32\gdkwin32screen.h&#x0D;&#x0A;
copy ..\..\..\gdk\win32\gdkwin32window.h $(CopyDir)\include\gtk-3.0\gdk\win32\gdkwin32window.h&#x0D;&#x0A; copy ..\..\..\gdk\win32\gdkwin32window.h $(CopyDir)\include\gtk-3.0\gdk\win32\gdkwin32window.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtk.h $(CopyDir)\include\gtk-3.0\gtk\gtk.h&#x0D;&#x0A; copy ..\..\..\gtk\gtk.h $(CopyDir)\include\gtk-3.0\gtk\gtk.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtk-autocleanups.h $(CopyDir)\include\gtk-3.0\gtk\gtk-autocleanups.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtkx.h $(CopyDir)\include\gtk-3.0\gtk\gtkx.h&#x0D;&#x0A; copy ..\..\..\gtk\gtkx.h $(CopyDir)\include\gtk-3.0\gtk\gtkx.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtkx-autocleanups.h $(CopyDir)\include\gtk-3.0\gtk\gtkx-autocleanups.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtk-a11y.h $(CopyDir)\include\gtk-3.0\gtk\gtk-a11y.h&#x0D;&#x0A; copy ..\..\..\gtk\gtk-a11y.h $(CopyDir)\include\gtk-3.0\gtk\gtk-a11y.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtkaboutdialog.h $(CopyDir)\include\gtk-3.0\gtk\gtkaboutdialog.h&#x0D;&#x0A; copy ..\..\..\gtk\gtkaboutdialog.h $(CopyDir)\include\gtk-3.0\gtk\gtkaboutdialog.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtkaccelgroup.h $(CopyDir)\include\gtk-3.0\gtk\gtkaccelgroup.h&#x0D;&#x0A; copy ..\..\..\gtk\gtkaccelgroup.h $(CopyDir)\include\gtk-3.0\gtk\gtkaccelgroup.h&#x0D;&#x0A;
@@ -299,6 +339,7 @@ copy ..\..\..\gtk\gtkwindowgroup.h $(CopyDir)\include\gtk-3.0\gtk\gtkwindowgroup
copy ..\..\..\gtk\gtktextlayout.h $(CopyDir)\include\gtk-3.0\gtk\gtktextlayout.h&#x0D;&#x0A; copy ..\..\..\gtk\gtktextlayout.h $(CopyDir)\include\gtk-3.0\gtk\gtktextlayout.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtktypebuiltins.h $(CopyDir)\include\gtk-3.0\gtk\gtktypebuiltins.h&#x0D;&#x0A; copy ..\..\..\gtk\gtktypebuiltins.h $(CopyDir)\include\gtk-3.0\gtk\gtktypebuiltins.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtkversion.h $(CopyDir)\include\gtk-3.0\gtk\gtkversion.h&#x0D;&#x0A; copy ..\..\..\gtk\gtkversion.h $(CopyDir)\include\gtk-3.0\gtk\gtkversion.h&#x0D;&#x0A;
copy ..\..\..\gtk\a11y\gtk-a11y-autocleanups.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtk-a11y-autocleanups.h&#x0D;&#x0A;
copy ..\..\..\gtk\a11y\gtkarrowaccessible.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtkarrowaccessible.h&#x0D;&#x0A; copy ..\..\..\gtk\a11y\gtkarrowaccessible.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtkarrowaccessible.h&#x0D;&#x0A;
copy ..\..\..\gtk\a11y\gtkbooleancellaccessible.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtkbooleancellaccessible.h&#x0D;&#x0A; copy ..\..\..\gtk\a11y\gtkbooleancellaccessible.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtkbooleancellaccessible.h&#x0D;&#x0A;
copy ..\..\..\gtk\a11y\gtkbuttonaccessible.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtkbuttonaccessible.h&#x0D;&#x0A; copy ..\..\..\gtk\a11y\gtkbuttonaccessible.h $(CopyDir)\include\gtk-3.0\gtk\a11y\gtkbuttonaccessible.h&#x0D;&#x0A;

View File

@@ -158,6 +158,7 @@
> >
<File RelativePath="..\..\..\demos\icon-browser\iconbrowserapp.c" /> <File RelativePath="..\..\..\demos\icon-browser\iconbrowserapp.c" />
<File RelativePath="..\..\..\demos\icon-browser\iconbrowserwin.c" /> <File RelativePath="..\..\..\demos\icon-browser\iconbrowserwin.c" />
<File RelativePath="..\..\..\demos\icon-browser\iconstore.c" />
<File RelativePath="..\..\..\demos\icon-browser\main.c" /> <File RelativePath="..\..\..\demos\icon-browser\main.c" />
<File RelativePath="..\..\..\demos\icon-browser\resources.c" /> <File RelativePath="..\..\..\demos\icon-browser\resources.c" />
</Filter> </Filter>

View File

@@ -141,6 +141,9 @@
#define HAVE_ROUND 1 #define HAVE_ROUND 1
#endif #endif
/* Define to 1 if sincos() is available */
/* #undef HAVE_SINCOS */
/* Have the sockaddr_un.sun_len member */ /* Have the sockaddr_un.sun_len member */
/* #undef HAVE_SOCKADDR_UN_SUN_LEN */ /* #undef HAVE_SOCKADDR_UN_SUN_LEN */

View File

@@ -10,7 +10,7 @@
m4_define([gtk_major_version], [3]) m4_define([gtk_major_version], [3])
m4_define([gtk_minor_version], [15]) m4_define([gtk_minor_version], [15])
m4_define([gtk_micro_version], [3]) m4_define([gtk_micro_version], [12])
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)])
@@ -41,14 +41,14 @@ AC_CANONICAL_HOST
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.43.0]) m4_define([glib_required_version], [2.43.4])
m4_define([pango_required_version], [1.36.7]) m4_define([pango_required_version], [1.36.7])
m4_define([atk_required_version], [2.15.1]) m4_define([atk_required_version], [2.15.1])
m4_define([cairo_required_version], [1.14.0]) m4_define([cairo_required_version], [1.14.0])
m4_define([gdk_pixbuf_required_version], [2.30.0]) m4_define([gdk_pixbuf_required_version], [2.30.0])
m4_define([introspection_required_version], [1.39.0]) m4_define([introspection_required_version], [1.39.0])
m4_define([wayland_required_version], [1.5.91]) m4_define([wayland_required_version], [1.5.91])
m4_define([mirclient_required_version], [0.9.0]) m4_define([mirclient_required_version], [0.11.0])
m4_define([epoxy_required_version], [1.0]) m4_define([epoxy_required_version], [1.0])
GLIB_REQUIRED_VERSION=glib_required_version GLIB_REQUIRED_VERSION=glib_required_version
PANGO_REQUIRED_VERSION=pango_required_version PANGO_REQUIRED_VERSION=pango_required_version
@@ -147,7 +147,6 @@ AC_PROG_MKDIR_P
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_MAKE_SET AC_PROG_MAKE_SET
GETTEXT_PACKAGE=gtk30 GETTEXT_PACKAGE=gtk30
AC_SUBST(GETTEXT_PACKAGE) AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
@@ -501,11 +500,6 @@ else
fi fi
fi fi
AC_DEFINE_UNQUOTED(GTK_COMPILED_WITH_DEBUGGING, "${enable_debug}",
[Define if debugging is enabled])
# Build time sanity check... # Build time sanity check...
AM_SANITY_CHECK AM_SANITY_CHECK
@@ -671,6 +665,15 @@ fi
# i18n stuff # i18n stuff
ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`" ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`"
AM_GLIB_GNU_GETTEXT AM_GLIB_GNU_GETTEXT
AC_MSG_CHECKING([whether xgettext supports ui files])
if $ac_cv_path_XGETTEXT --output=- --language=Glade $srcdir/gtk/ui/gtkfilechooserwidget.ui > /dev/null 2>&1; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_ERROR([GNU gettext 0.18.3 or newer is required])
fi
LIBS="$LIBS $INTLLIBS" LIBS="$LIBS $INTLLIBS"
AC_CONFIG_COMMANDS([po-properties], AC_CONFIG_COMMANDS([po-properties],
[[case "$CONFIG_FILES" in *po-properties/Makefile.in*) [[case "$CONFIG_FILES" in *po-properties/Makefile.in*)
@@ -823,7 +826,7 @@ AC_TYPE_UID_T
# Check for round(), rint(), isnan(), isinf() and nearbyint() # Check for round(), rint(), isnan(), isinf() and nearbyint()
AC_CHECK_LIB(m,round,,) AC_CHECK_LIB(m,round,,)
AC_CHECK_FUNCS(round rint nearbyint) AC_CHECK_FUNCS(round rint nearbyint sincos)
AC_CHECK_DECLS([isnan, isinf], [], [], [[#include <math.h>]]) AC_CHECK_DECLS([isnan, isinf], [], [], [[#include <math.h>]])
# Checks for gdkspawn # Checks for gdkspawn
@@ -1028,22 +1031,16 @@ if test "x$enable_x11_backend" = xyes; then
AC_CHECK_FUNC(XextFindDisplay, :, AC_CHECK_FUNC(XextFindDisplay, :,
AC_MSG_ERROR([*** libX11 and libXext not found. Check 'config.log' for more details.])) AC_MSG_ERROR([*** libX11 and libXext not found. Check 'config.log' for more details.]))
# Check for xReply # Check if <X11/extensions/XIproto.h> is needed for xReply.
AC_MSG_CHECKING([if <X11/extensions/XIproto.h> is needed for xReply]) AC_CHECK_TYPE([xReply], ,
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlibint.h>]], [AC_CHECK_TYPE([xReply],
[[xReply *rep = NULL; [AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], 1,
rep = rep;]])], [Define if <X11/extensions/XIproto.h> needed for xReply])],
[AC_MSG_RESULT([no])], [AC_MSG_ERROR([xReply type unavailable. X11 is too old])],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/XIproto.h> [[#include <X11/extensions/XIproto.h>
#include <X11/Xlibint.h>]], #include <X11/Xlibint.h>]])],
[[xReply *rep = NULL; [[#include <X11/Xlibint.h>]])
rep = rep;]])],
[AC_MSG_RESULT([yes])
AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], [1],
[Define if <X11/extensions/XIproto.h> needed for xReply])],
[AC_MSG_RESULT([unknown])
AC_MSG_ERROR([xReply type unavailable. X11 is too old])])])
# Check for XKB support. # Check for XKB support.
@@ -1911,7 +1908,6 @@ gtk/makefile.msc
gtk/gtkversion.h gtk/gtkversion.h
gtk/gtk-win32.rc gtk/gtk-win32.rc
gtk/libgtk3.manifest gtk/libgtk3.manifest
util/Makefile
libgail-util/Makefile libgail-util/Makefile
modules/Makefile modules/Makefile
modules/input/Makefile modules/input/Makefile

View File

@@ -136,6 +136,8 @@ RESOURCES = \
brick2.png \ brick2.png \
background.jpg \ background.jpg \
floppybuddy.gif \ floppybuddy.gif \
glarea-fragment.glsl \
glarea-vertex.glsl \
gnome-applets.png \ gnome-applets.png \
gnome-calendar.png \ gnome-calendar.png \
gnome-foot.png \ gnome-foot.png \

View File

@@ -140,4 +140,8 @@
<gresource prefix="/popover"> <gresource prefix="/popover">
<file>popover.ui</file> <file>popover.ui</file>
</gresource> </gresource>
<gresource prefix="/glarea">
<file>glarea-fragment.glsl</file>
<file>glarea-vertex.glsl</file>
</gresource>
</gresources> </gresources>

View File

@@ -158,11 +158,18 @@ add_item (GtkWidget *button, gpointer data)
/* Insert a new row below the current one */ /* Insert a new row below the current one */
gtk_tree_view_get_cursor (treeview, &path, NULL); gtk_tree_view_get_cursor (treeview, &path, NULL);
model = gtk_tree_view_get_model (treeview); model = gtk_tree_view_get_model (treeview);
gtk_tree_model_get_iter (model, &current, path); if (path)
gtk_tree_path_free (path); {
gtk_tree_model_get_iter (model, &current, path);
gtk_tree_path_free (path);
gtk_list_store_insert_after (GTK_LIST_STORE (model), &iter, &current);
}
else
{
gtk_list_store_insert (GTK_LIST_STORE (model), &iter, -1);
}
/* Set the data for the new row */ /* Set the data for the new row */
gtk_list_store_insert_after (GTK_LIST_STORE (model), &iter, &current);
gtk_list_store_set (GTK_LIST_STORE (model), &iter, gtk_list_store_set (GTK_LIST_STORE (model), &iter,
COLUMN_ITEM_NUMBER, foo.number, COLUMN_ITEM_NUMBER, foo.number,
COLUMN_ITEM_PRODUCT, foo.product, COLUMN_ITEM_PRODUCT, foo.product,

View File

@@ -0,0 +1,9 @@
#version 330
out vec4 outputColor;
void main() {
float lerpVal = gl_FragCoord.y / 500.0f;
outputColor = mix(vec4(1.0f, 0.85f, 0.35f, 1.0f), vec4(0.2f, 0.2f, 0.2f, 1.0f), lerpVal);
}

View File

@@ -0,0 +1,8 @@
#version 330
layout(location = 0) in vec4 position;
uniform mat4 mvp;
void main() {
gl_Position = mvp * position;
}

View File

@@ -3,6 +3,7 @@
* GtkGLArea is a widget that allows custom drawing using OpenGL calls. * GtkGLArea is a widget that allows custom drawing using OpenGL calls.
*/ */
#include <math.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <epoxy/gl.h> #include <epoxy/gl.h>
@@ -23,35 +24,261 @@ enum {
static float rotation_angles[N_AXIS] = { 0.0 }; static float rotation_angles[N_AXIS] = { 0.0 };
/* The object we are drawing */ /* The object we are drawing */
static const GLfloat vertex_data[] = {
0.f, 0.5f, 0.f, 1.f,
0.5f, -0.366f, 0.f, 1.f,
-0.5f, -0.366f, 0.f, 1.f,
};
/* Initialize the GL buffers */
static void
init_buffers (GLuint *vao_out,
GLuint *buffer_out)
{
GLuint vao, buffer;
/* We only use one VAO, so we always keep it bound */
glGenVertexArrays (1, &vao);
glBindVertexArray (vao);
/* This is the buffer that holds the vertices */
glGenBuffers (1, &buffer);
glBindBuffer (GL_ARRAY_BUFFER, buffer);
glBufferData (GL_ARRAY_BUFFER, sizeof (vertex_data), vertex_data, GL_STATIC_DRAW);
glBindBuffer (GL_ARRAY_BUFFER, 0);
if (vao_out != NULL)
*vao_out = vao;
if (buffer_out != NULL)
*buffer_out = buffer;
}
/* Create and compile a shader */
static GLuint
create_shader (int type,
const char *src)
{
GLuint shader;
int status;
shader = glCreateShader (type);
glShaderSource (shader, 1, &src, NULL);
glCompileShader (shader);
glGetShaderiv (shader, GL_COMPILE_STATUS, &status);
if (status == GL_FALSE)
{
int log_len;
char *buffer;
glGetShaderiv (shader, GL_INFO_LOG_LENGTH, &log_len);
buffer = g_malloc (log_len + 1);
glGetShaderInfoLog (shader, log_len, NULL, buffer);
g_warning ("Compile failure in %s shader:\n%s\n",
type == GL_VERTEX_SHADER ? "vertex" : "fragment",
buffer);
g_free (buffer);
glDeleteShader (shader);
return 0;
}
return shader;
}
/* Initialize the shaders and link them into a program */
static void
init_shaders (GLuint *program_out,
GLuint *mvp_out)
{
GLuint vertex, fragment;
GLuint program = 0;
GLuint mvp = 0;
int status;
GBytes *source;
source = g_resources_lookup_data ("/glarea/glarea-vertex.glsl", 0, NULL);
vertex = create_shader (GL_VERTEX_SHADER, g_bytes_get_data (source, NULL));
g_bytes_unref (source);
if (vertex == 0)
{
*program_out = 0;
return;
}
source = g_resources_lookup_data ("/glarea/glarea-fragment.glsl", 0, NULL);
fragment = create_shader (GL_FRAGMENT_SHADER, g_bytes_get_data (source, NULL));
g_bytes_unref (source);
if (fragment == 0)
{
glDeleteShader (vertex);
*program_out = 0;
return;
}
program = glCreateProgram ();
glAttachShader (program, vertex);
glAttachShader (program, fragment);
glLinkProgram (program);
glGetProgramiv (program, GL_LINK_STATUS, &status);
if (status == GL_FALSE)
{
int log_len;
char *buffer;
glGetProgramiv (program, GL_INFO_LOG_LENGTH, &log_len);
buffer = g_malloc (log_len + 1);
glGetProgramInfoLog (program, log_len, NULL, buffer);
g_warning ("Linking failure:\n%s\n", buffer);
g_free (buffer);
glDeleteProgram (program);
program = 0;
goto out;
}
/* Get the location of the "mvp" uniform */
mvp = glGetUniformLocation (program, "mvp");
glDetachShader (program, vertex);
glDetachShader (program, fragment);
out:
glDeleteShader (vertex);
glDeleteShader (fragment);
if (program_out != NULL)
*program_out = program;
if (mvp_out != NULL)
*mvp_out = mvp;
}
static void
compute_mvp (float *res,
float phi,
float theta,
float psi)
{
float x = phi * (G_PI / 180.f);
float y = theta * (G_PI / 180.f);
float z = psi * (G_PI / 180.f);
float c1 = cosf (x), s1 = sinf (x);
float c2 = cosf (y), s2 = sinf (y);
float c3 = cosf (z), s3 = sinf (z);
float c3c2 = c3 * c2;
float s3c1 = s3 * c1;
float c3s2s1 = c3 * s2 * s1;
float s3s1 = s3 * s1;
float c3s2c1 = c3 * s2 * c1;
float s3c2 = s3 * c2;
float c3c1 = c3 * c1;
float s3s2s1 = s3 * s2 * s1;
float c3s1 = c3 * s1;
float s3s2c1 = s3 * s2 * c1;
float c2s1 = c2 * s1;
float c2c1 = c2 * c1;
/* initialize to the identity matrix */
res[0] = 1.f; res[4] = 0.f; res[8] = 0.f; res[12] = 0.f;
res[1] = 0.f; res[5] = 1.f; res[9] = 0.f; res[13] = 0.f;
res[2] = 0.f; res[6] = 0.f; res[10] = 1.f; res[14] = 0.f;
res[3] = 0.f; res[7] = 0.f; res[11] = 0.f; res[15] = 1.f;
/* apply all three rotations using the three matrices:
*
* ⎡ c3 s3 0 ⎤ ⎡ c2 0 -s2 ⎤ ⎡ 1 0 0 ⎤
* ⎢ -s3 c3 0 ⎥ ⎢ 0 1 0 ⎥ ⎢ 0 c1 s1 ⎥
* ⎣ 0 0 1 ⎦ ⎣ s2 0 c2 ⎦ ⎣ 0 -s1 c1 ⎦
*/
res[0] = c3c2; res[4] = s3c1 + c3s2s1; res[8] = s3s1 - c3s2c1; res[12] = 0.f;
res[1] = -s3c2; res[5] = c3c1 - s3s2s1; res[9] = c3s1 + s3s2c1; res[13] = 0.f;
res[2] = s2; res[6] = -c2s1; res[10] = c2c1; res[14] = 0.f;
res[3] = 0.f; res[7] = 0.f; res[11] = 0.f; res[15] = 1.f;
}
static GLuint position_buffer;
static GLuint program;
static GLuint mvp_location;
/* We need to set up our state when we realize the GtkGLArea widget */
static void
realize (GtkWidget *widget)
{
gtk_gl_area_make_current (GTK_GL_AREA (widget));
init_buffers (&position_buffer, NULL);
init_shaders (&program, &mvp_location);
}
/* We should tear down the state when unrealizing */
static void
unrealize (GtkWidget *widget)
{
gtk_gl_area_make_current (GTK_GL_AREA (widget));
glDeleteBuffers (1, &position_buffer);
glDeleteProgram (program);
}
static void static void
draw_triangle (void) draw_triangle (void)
{ {
glColor3f (1.0f, 0.85f, 0.35f); float mvp[16];
glBegin (GL_TRIANGLES);
{ /* Compute the model view projection matrix using the
glVertex3f ( 0.0, 0.6, 0.0); * rotation angles specified through the GtkRange widgets
glVertex3f (-0.2, -0.3, 0.0); */
glVertex3f ( 0.2, -0.3, 0.0); compute_mvp (mvp,
} rotation_angles[X_AXIS],
glEnd (); rotation_angles[Y_AXIS],
rotation_angles[Z_AXIS]);
/* Use our shaders */
glUseProgram (program);
/* Update the "mvp" matrix we use in the shader */
glUniformMatrix4fv (mvp_location, 1, GL_FALSE, &mvp[0]);
/* Use the vertices in our buffer */
glBindBuffer (GL_ARRAY_BUFFER, position_buffer);
glEnableVertexAttribArray (0);
glVertexAttribPointer (0, 4, GL_FLOAT, GL_FALSE, 0, 0);
/* Draw the three vertices as a triangle */
glDrawArrays (GL_TRIANGLES, 0, 3);
/* We finished using the buffers and program */
glDisableVertexAttribArray (0);
glBindBuffer (GL_ARRAY_BUFFER, 0);
glUseProgram (0);
} }
/* The main rendering callback */
static gboolean static gboolean
render (GtkGLArea *area, render (GtkGLArea *area,
GdkGLContext *context) GdkGLContext *context)
{ {
/* Clear the viewport */
glClearColor (0.5, 0.5, 0.5, 1.0); glClearColor (0.5, 0.5, 0.5, 1.0);
glClear (GL_COLOR_BUFFER_BIT); glClear (GL_COLOR_BUFFER_BIT);
glMatrixMode (GL_MODELVIEW); /* Draw our object */
glLoadIdentity ();
glRotatef (rotation_angles[X_AXIS], 1, 0, 0);
glRotatef (rotation_angles[Y_AXIS], 0, 1, 0);
glRotatef (rotation_angles[Z_AXIS], 0, 0, 1);
draw_triangle (); draw_triangle ();
/* Flush the contents of the pipeline */
glFlush (); glFlush ();
return TRUE; return TRUE;
@@ -138,7 +365,7 @@ create_glarea_window (GtkWidget *do_widget)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL); window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "GtkGLArea - Golden Triangle"); gtk_window_set_title (GTK_WINDOW (window), "GtkGLArea - Golden Triangle");
gtk_window_set_default_size (GTK_WINDOW (window), 400, 400); gtk_window_set_default_size (GTK_WINDOW (window), 400, 600);
gtk_container_set_border_width (GTK_CONTAINER (window), 12); gtk_container_set_border_width (GTK_CONTAINER (window), 12);
g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL); g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL);
@@ -151,7 +378,13 @@ create_glarea_window (GtkWidget *do_widget)
gtk_widget_set_vexpand (gl_area, TRUE); gtk_widget_set_vexpand (gl_area, TRUE);
gtk_container_add (GTK_CONTAINER (box), gl_area); gtk_container_add (GTK_CONTAINER (box), gl_area);
/* the main "draw" call for GtkGLArea */ /* We need to initialize and free GL resources, so we use
* the realize and unrealize signals on the widget
*/
g_signal_connect (gl_area, "realize", G_CALLBACK (realize), NULL);
g_signal_connect (gl_area, "unrealize", G_CALLBACK (unrealize), NULL);
/* The main "draw" call for GtkGLArea */
g_signal_connect (gl_area, "render", G_CALLBACK (render), NULL); g_signal_connect (gl_area, "render", G_CALLBACK (render), NULL);
controls = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE); controls = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE);

View File

@@ -218,7 +218,6 @@ add_columns (GtkTreeView *treeview)
/* column for symbolic icon */ /* column for symbolic icon */
renderer = gtk_cell_renderer_pixbuf_new (); renderer = gtk_cell_renderer_pixbuf_new ();
g_object_set (G_OBJECT (renderer), "follow-state", TRUE, NULL);
column = gtk_tree_view_column_new_with_attributes ("Symbolic icon", column = gtk_tree_view_column_new_with_attributes ("Symbolic icon",
renderer, renderer,
"icon-name", "icon-name",

View File

@@ -543,7 +543,7 @@ add_data_tab (const gchar *demoname)
* not an image. Let's try something else then. * not an image. Let's try something else then.
*/ */
g_object_ref_sink (widget); g_object_ref_sink (widget);
gtk_widget_destroy (widget); g_object_unref (widget);
bytes = g_resources_lookup_data (resource_name, 0, NULL); bytes = g_resources_lookup_data (resource_name, 0, NULL);
g_assert (bytes); g_assert (bytes);

View File

@@ -42,6 +42,34 @@ window_key_press_event_cb (GtkWidget *widget,
return gtk_search_bar_handle_event (bar, event); return gtk_search_bar_handle_event (bar, event);
} }
static void
search_changed (GtkSearchEntry *entry,
GtkLabel *label)
{
gtk_label_set_text (label, "search-changed");
}
static void
next_match (GtkSearchEntry *entry,
GtkLabel *label)
{
gtk_label_set_text (label, "next-match");
}
static void
previous_match (GtkSearchEntry *entry,
GtkLabel *label)
{
gtk_label_set_text (label, "previous-match");
}
static void
stop_search (GtkSearchEntry *entry,
GtkLabel *label)
{
gtk_label_set_text (label, "stop-search");
}
GtkWidget * GtkWidget *
do_search_entry2 (GtkWidget *do_widget) do_search_entry2 (GtkWidget *do_widget)
{ {
@@ -99,6 +127,8 @@ do_search_entry2 (GtkWidget *do_widget)
gtk_container_set_border_width (GTK_CONTAINER (hbox), 0); gtk_container_set_border_width (GTK_CONTAINER (hbox), 0);
label = gtk_label_new ("Result:"); label = gtk_label_new ("Result:");
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_widget_set_margin_start (label, 6);
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
label = gtk_label_new (""); label = gtk_label_new ("");
@@ -108,6 +138,27 @@ do_search_entry2 (GtkWidget *do_widget)
G_CALLBACK (search_changed_cb), label); G_CALLBACK (search_changed_cb), label);
g_signal_connect (entry, "changed", g_signal_connect (entry, "changed",
G_CALLBACK (changed_cb), label); G_CALLBACK (changed_cb), label);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 0);
label = gtk_label_new ("Signal:");
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_widget_set_margin_start (label, 6);
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
label = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
g_signal_connect (entry, "search-changed",
G_CALLBACK (search_changed), label);
g_signal_connect (entry, "next-match",
G_CALLBACK (next_match), label);
g_signal_connect (entry, "previous-match",
G_CALLBACK (previous_match), label);
g_signal_connect (entry, "stop-search",
G_CALLBACK (stop_search), label);
} }
if (!gtk_widget_get_visible (window)) if (!gtk_widget_get_visible (window))

View File

@@ -1,9 +1,9 @@
/* Sidebar /* Stack Sidebar
* *
* GtkSidebar provides an automatic sidebar widget to control navigation * GtkStackSidebar provides an automatic sidebar widget to control
* of a GtkStack object. This widget automatically updates it content * navigation of a GtkStack object. This widget automatically updates it
* based on what is presently available in the GtkStack object, and * content based on what is presently available in the GtkStack object,
* using the "title" child property to set the display labels. * and using the "title" child property to set the display labels.
*/ */
#include <glib/gi18n.h> #include <glib/gi18n.h>
@@ -21,7 +21,7 @@ do_sidebar (GtkWidget *do_widget)
GtkWidget *header; GtkWidget *header;
const gchar* pages[] = { const gchar* pages[] = {
"Welcome to GTK+", "Welcome to GTK+",
"GtkSidebar Widget", "GtkStackSidebar Widget",
"Automatic navigation", "Automatic navigation",
"Consistent appearance", "Consistent appearance",
"Scrolling", "Scrolling",
@@ -43,18 +43,18 @@ do_sidebar (GtkWidget *do_widget)
header = gtk_header_bar_new (); header = gtk_header_bar_new ();
gtk_header_bar_set_show_close_button (GTK_HEADER_BAR(header), TRUE); gtk_header_bar_set_show_close_button (GTK_HEADER_BAR(header), TRUE);
gtk_window_set_titlebar (GTK_WINDOW(window), header); gtk_window_set_titlebar (GTK_WINDOW(window), header);
gtk_window_set_title (GTK_WINDOW(window), "Sidebar demo"); gtk_window_set_title (GTK_WINDOW(window), "Stack Sidebar demo");
g_signal_connect (window, "destroy", g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window); G_CALLBACK (gtk_widget_destroyed), &window);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
sidebar = gtk_sidebar_new (); sidebar = gtk_stack_sidebar_new ();
gtk_box_pack_start (GTK_BOX (box), sidebar, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box), sidebar, FALSE, FALSE, 0);
stack = gtk_stack_new (); stack = gtk_stack_new ();
gtk_stack_set_transition_type (GTK_STACK (stack), GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN); gtk_stack_set_transition_type (GTK_STACK (stack), GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN);
gtk_sidebar_set_stack (GTK_SIDEBAR (sidebar), GTK_STACK (stack)); gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR (sidebar), GTK_STACK (stack));
/* Separator between sidebar and stack */ /* Separator between sidebar and stack */
widget = gtk_separator_new (GTK_ORIENTATION_VERTICAL); widget = gtk_separator_new (GTK_ORIENTATION_VERTICAL);

View File

@@ -20,6 +20,7 @@ gtk3_icon_browser_SOURCES = \
main.c \ main.c \
iconbrowserapp.c iconbrowserapp.h \ iconbrowserapp.c iconbrowserapp.h \
iconbrowserwin.c iconbrowserwin.h \ iconbrowserwin.c iconbrowserwin.h \
iconstore.c iconstore.h \
resources.c resources.c
BUILT_SOURCES = \ BUILT_SOURCES = \

View File

@@ -1,6 +1,7 @@
#include <string.h> #include <string.h>
#include "iconbrowserapp.h" #include "iconbrowserapp.h"
#include "iconbrowserwin.h" #include "iconbrowserwin.h"
#include "iconstore.h"
#include <gtk/gtk.h> #include <gtk/gtk.h>
typedef struct typedef struct
@@ -42,13 +43,6 @@ struct _IconBrowserWindowClass
GtkApplicationWindowClass parent_class; GtkApplicationWindowClass parent_class;
}; };
enum {
NAME_COLUMN,
SYMBOLIC_NAME_COLUMN,
DESCRIPTION_COLUMN,
CONTEXT_COLUMN
};
G_DEFINE_TYPE(IconBrowserWindow, icon_browser_window, GTK_TYPE_APPLICATION_WINDOW); G_DEFINE_TYPE(IconBrowserWindow, icon_browser_window, GTK_TYPE_APPLICATION_WINDOW);
static void static void
@@ -64,16 +58,31 @@ search_text_changed (GtkEntry *entry, IconBrowserWindow *win)
gtk_tree_model_filter_refilter (win->filter_model); gtk_tree_model_filter_refilter (win->filter_model);
} }
static void static GdkPixbuf *
set_image (GtkWidget *image, const gchar *name, gint size) get_icon (GtkWidget *image, const gchar *name, gint size)
{ {
gtk_image_set_from_icon_name (GTK_IMAGE (image), name, 1); GtkIconInfo *info;
gtk_image_set_pixel_size (GTK_IMAGE (image), size); GtkStyleContext *context;
GdkPixbuf *pixbuf;
context = gtk_widget_get_style_context (image);
info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (), name, size, 0);
pixbuf = gtk_icon_info_load_symbolic_for_context (info, context, NULL, NULL);
g_object_unref (info);
return pixbuf;
} }
static void static void
selection_changed (GtkIconView *icon_view, IconBrowserWindow *win) set_image (GtkWidget *image, const gchar *name, gint size)
{ {
GdkPixbuf *pixbuf;
gtk_image_set_from_icon_name (GTK_IMAGE (image), name, 1);
gtk_image_set_pixel_size (GTK_IMAGE (image), size);
pixbuf = get_icon (image, name, size);
gtk_drag_source_set_icon_pixbuf (gtk_widget_get_parent (image), pixbuf);
g_object_unref (pixbuf);
} }
static void static void
@@ -87,14 +96,14 @@ item_activated (GtkIconView *icon_view, GtkTreePath *path, IconBrowserWindow *wi
gtk_tree_model_get_iter (GTK_TREE_MODEL (win->filter_model), &iter, path); gtk_tree_model_get_iter (GTK_TREE_MODEL (win->filter_model), &iter, path);
if (win->symbolic) if (win->symbolic)
column = SYMBOLIC_NAME_COLUMN; column = ICON_STORE_SYMBOLIC_NAME_COLUMN;
else else
column = NAME_COLUMN; column = ICON_STORE_NAME_COLUMN;
gtk_tree_model_get (GTK_TREE_MODEL (win->filter_model), &iter, gtk_tree_model_get (GTK_TREE_MODEL (win->filter_model), &iter,
column, &name, column, &name,
DESCRIPTION_COLUMN, &description, ICON_STORE_DESCRIPTION_COLUMN, &description,
-1); -1);
if (name == NULL || !gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), name)) if (name == NULL || !gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), name))
{ {
g_free (description); g_free (description);
@@ -146,10 +155,10 @@ add_icon (IconBrowserWindow *win,
symbolic_name = NULL; symbolic_name = NULL;
} }
gtk_list_store_insert_with_values (win->store, NULL, -1, gtk_list_store_insert_with_values (win->store, NULL, -1,
NAME_COLUMN, regular_name, ICON_STORE_NAME_COLUMN, regular_name,
SYMBOLIC_NAME_COLUMN, symbolic_name, ICON_STORE_SYMBOLIC_NAME_COLUMN, symbolic_name,
DESCRIPTION_COLUMN, description, ICON_STORE_DESCRIPTION_COLUMN, description,
CONTEXT_COLUMN, context, ICON_STORE_CONTEXT_COLUMN, context,
-1); -1);
} }
@@ -702,13 +711,13 @@ icon_visible_func (GtkTreeModel *model,
search_text = gtk_entry_get_text (GTK_ENTRY (win->searchentry)); search_text = gtk_entry_get_text (GTK_ENTRY (win->searchentry));
if (win->symbolic) if (win->symbolic)
column = SYMBOLIC_NAME_COLUMN; column = ICON_STORE_SYMBOLIC_NAME_COLUMN;
else else
column = NAME_COLUMN; column = ICON_STORE_NAME_COLUMN;
gtk_tree_model_get (model, iter, gtk_tree_model_get (model, iter,
column, &name, column, &name,
CONTEXT_COLUMN, &context, ICON_STORE_CONTEXT_COLUMN, &context,
-1); -1);
if (!name) if (!name)
visible = FALSE; visible = FALSE;
@@ -731,9 +740,11 @@ symbolic_toggled (GtkToggleButton *toggle, IconBrowserWindow *win)
win->symbolic = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle)); win->symbolic = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle));
if (win->symbolic) if (win->symbolic)
column = SYMBOLIC_NAME_COLUMN; column = ICON_STORE_SYMBOLIC_NAME_COLUMN;
else else
column = NAME_COLUMN; column = ICON_STORE_NAME_COLUMN;
icon_store_set_text_column (ICON_STORE (win->store), column);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (win->list), win->cell, "icon-name", column, NULL); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (win->list), win->cell, "icon-name", column, NULL);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (win->list), win->text_cell, "text", column, NULL); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (win->list), win->text_cell, "text", column, NULL);
@@ -749,17 +760,72 @@ search_mode_toggled (GObject *searchbar, GParamSpec *pspec, IconBrowserWindow *w
gtk_list_box_unselect_all (GTK_LIST_BOX (win->context_list)); gtk_list_box_unselect_all (GTK_LIST_BOX (win->context_list));
} }
static void
get_image_data (GtkWidget *widget,
GdkDragContext *context,
GtkSelectionData *selection,
guint target_info,
guint time,
gpointer data)
{
GtkWidget *image;
const gchar *name;
gint size;
GdkPixbuf *pixbuf;
image = gtk_bin_get_child (GTK_BIN (widget));
gtk_image_get_icon_name (GTK_IMAGE (image), &name, NULL);
size = gtk_image_get_pixel_size (GTK_IMAGE (image));
pixbuf = get_icon (image, name, size);
gtk_selection_data_set_pixbuf (selection, pixbuf);
g_object_unref (pixbuf);
}
static void
setup_image_dnd (GtkWidget *image)
{
GtkWidget *parent;
parent = gtk_widget_get_parent (image);
gtk_drag_source_set (parent, GDK_BUTTON1_MASK, NULL, 0, GDK_ACTION_COPY);
gtk_drag_source_add_image_targets (parent);
g_signal_connect (parent, "drag-data-get", G_CALLBACK (get_image_data), NULL);
}
static void static void
icon_browser_window_init (IconBrowserWindow *win) icon_browser_window_init (IconBrowserWindow *win)
{ {
GtkTargetList *list;
GtkTargetEntry *targets;
gint n_targets;
gtk_widget_init_template (GTK_WIDGET (win)); gtk_widget_init_template (GTK_WIDGET (win));
list = gtk_target_list_new (NULL, 0);
gtk_target_list_add_text_targets (list, 0);
targets = gtk_target_table_new_from_list (list, &n_targets);
gtk_target_list_unref (list);
gtk_icon_view_enable_model_drag_source (GTK_ICON_VIEW (win->list),
GDK_BUTTON1_MASK,
targets, n_targets,
GDK_ACTION_COPY);
gtk_target_table_free (targets, n_targets);
setup_image_dnd (win->image1);
setup_image_dnd (win->image2);
setup_image_dnd (win->image3);
setup_image_dnd (win->image4);
setup_image_dnd (win->image5);
win->contexts = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_free); win->contexts = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_free);
gtk_tree_model_filter_set_visible_func (win->filter_model, icon_visible_func, win, NULL); gtk_tree_model_filter_set_visible_func (win->filter_model, icon_visible_func, win, NULL);
gtk_window_set_transient_for (GTK_WINDOW (win->details), GTK_WINDOW (win)); gtk_window_set_transient_for (GTK_WINDOW (win->details), GTK_WINDOW (win));
g_signal_connect (win->searchbar, "notify::search-mode-enabled", g_signal_connect (win->searchbar, "notify::search-mode-enabled",
G_CALLBACK (search_mode_toggled), win); G_CALLBACK (search_mode_toggled), win);
@@ -771,6 +837,8 @@ icon_browser_window_init (IconBrowserWindow *win)
static void static void
icon_browser_window_class_init (IconBrowserWindowClass *class) icon_browser_window_class_init (IconBrowserWindowClass *class)
{ {
g_type_ensure (ICON_STORE_TYPE);
gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (class), gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (class),
"/org/gtk/iconbrowser/window.ui"); "/org/gtk/iconbrowser/window.ui");
@@ -794,7 +862,6 @@ icon_browser_window_class_init (IconBrowserWindowClass *class)
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, description); gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, description);
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), search_text_changed); gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), search_text_changed);
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), selection_changed);
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), item_activated); gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), item_activated);
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), selected_context_changed); gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), selected_context_changed);
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), symbolic_toggled); gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), symbolic_toggled);

View File

@@ -0,0 +1,91 @@
#include "iconstore.h"
#include <gtk/gtk.h>
struct _IconStore
{
GtkListStore parent;
gint text_column;
};
struct _IconStoreClass
{
GtkListStoreClass parent_class;
};
static void icon_store_drag_source_init (GtkTreeDragSourceIface *iface);
G_DEFINE_TYPE_WITH_CODE (IconStore, icon_store, GTK_TYPE_LIST_STORE,
G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_DRAG_SOURCE,
icon_store_drag_source_init))
static void
icon_store_init (IconStore *store)
{
GType types[4] = { G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING };
gtk_list_store_set_column_types (GTK_LIST_STORE (store), 4, types);
store->text_column = ICON_STORE_NAME_COLUMN;
}
static void
icon_store_class_init (IconStoreClass *class)
{
}
static gboolean
row_draggable (GtkTreeDragSource *drag_source,
GtkTreePath *path)
{
return TRUE;
}
static gboolean
drag_data_delete (GtkTreeDragSource *drag_source,
GtkTreePath *path)
{
GtkTreeIter iter;
if (gtk_tree_model_get_iter (GTK_TREE_MODEL (drag_source), &iter, path))
return gtk_list_store_remove (GTK_LIST_STORE (drag_source), &iter);
return FALSE;
}
static gboolean
drag_data_get (GtkTreeDragSource *drag_source,
GtkTreePath *path,
GtkSelectionData *selection)
{
GtkTreeIter iter;
gchar *text;
if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (drag_source), &iter, path))
return FALSE;
gtk_tree_model_get (GTK_TREE_MODEL (drag_source), &iter,
ICON_STORE (drag_source)->text_column, &text,
-1);
gtk_selection_data_set_text (selection, text, -1);
g_free (text);
return TRUE;
}
static void
icon_store_drag_source_init (GtkTreeDragSourceIface *iface)
{
iface->row_draggable = row_draggable;
iface->drag_data_delete = drag_data_delete;
iface->drag_data_get = drag_data_get;
}
void
icon_store_set_text_column (IconStore *store, gint text_column)
{
store->text_column = text_column;
}

View File

@@ -0,0 +1,26 @@
#ifndef __ICON_STORE_H
#define __ICON_STORE_H
#include <gtk/gtk.h>
#define ICON_STORE_TYPE (icon_store_get_type ())
#define ICON_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ICON_STORE_TYPE, IconStore))
typedef struct _IconStore IconStore;
typedef struct _IconStoreClass IconStoreClass;
enum {
ICON_STORE_NAME_COLUMN,
ICON_STORE_SYMBOLIC_NAME_COLUMN,
ICON_STORE_DESCRIPTION_COLUMN,
ICON_STORE_CONTEXT_COLUMN
};
GType icon_store_get_type (void);
void icon_store_set_text_column (IconStore *store,
gint column);
#endif /* __ICON_STORE_H */

View File

@@ -1,13 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<interface> <interface>
<!-- interface-requires gtk+ 3.8 --> <!-- interface-requires gtk+ 3.8 -->
<object class="GtkListStore" id="store"> <object class="IconStore" id="store">
<columns>
<column type="gchararray"/>
<column type="gchararray"/>
<column type="gchararray"/>
<column type="gchararray"/>
</columns>
</object> </object>
<object class="GtkTreeModelFilter" id="filter_model"> <object class="GtkTreeModelFilter" id="filter_model">
<property name="child_model">store</property> <property name="child_model">store</property>
@@ -108,7 +102,8 @@
<object class="GtkIconView" id="list"> <object class="GtkIconView" id="list">
<property name="visible">True</property> <property name="visible">True</property>
<property name="model">filter_model</property> <property name="model">filter_model</property>
<signal name="selection_changed" handler="selection_changed"/> <property name="selection-mode">none</property>
<property name="activate-on-single-click">True</property>
<signal name="item_activated" handler="item_activated"/> <signal name="item_activated" handler="item_activated"/>
<child> <child>
<object class="GtkCellRendererPixbuf" id="cell"> <object class="GtkCellRendererPixbuf" id="cell">
@@ -156,12 +151,17 @@
<property name="row-spacing">10</property> <property name="row-spacing">10</property>
<property name="column-spacing">10</property> <property name="column-spacing">10</property>
<child> <child>
<object class="GtkImage" id="image1"> <object class="GtkEventBox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="xpad">4</property> <child>
<property name="ypad">4</property> <object class="GtkImage" id="image1">
<property name="halign">center</property> <property name="visible">True</property>
<property name="valign">end</property> <property name="xpad">4</property>
<property name="ypad">4</property>
<property name="halign">center</property>
<property name="valign">end</property>
</object>
</child>
</object> </object>
<packing> <packing>
<property name="left-attach">0</property> <property name="left-attach">0</property>
@@ -169,12 +169,17 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkImage" id="image2"> <object class="GtkEventBox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="xpad">4</property> <child>
<property name="ypad">4</property> <object class="GtkImage" id="image2">
<property name="halign">center</property> <property name="visible">True</property>
<property name="valign">end</property> <property name="xpad">4</property>
<property name="ypad">4</property>
<property name="halign">center</property>
<property name="valign">end</property>
</object>
</child>
</object> </object>
<packing> <packing>
<property name="left-attach">1</property> <property name="left-attach">1</property>
@@ -182,12 +187,17 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkImage" id="image3"> <object class="GtkEventBox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="xpad">4</property> <child>
<property name="ypad">4</property> <object class="GtkImage" id="image3">
<property name="halign">center</property> <property name="visible">True</property>
<property name="valign">end</property> <property name="xpad">4</property>
<property name="ypad">4</property>
<property name="halign">center</property>
<property name="valign">end</property>
</object>
</child>
</object> </object>
<packing> <packing>
<property name="left-attach">2</property> <property name="left-attach">2</property>
@@ -195,12 +205,17 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkImage" id="image4"> <object class="GtkEventBox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="xpad">4</property> <child>
<property name="ypad">4</property> <object class="GtkImage" id="image4">
<property name="halign">center</property> <property name="visible">True</property>
<property name="valign">end</property> <property name="xpad">4</property>
<property name="ypad">4</property>
<property name="halign">center</property>
<property name="valign">end</property>
</object>
</child>
</object> </object>
<packing> <packing>
<property name="left-attach">3</property> <property name="left-attach">3</property>
@@ -208,12 +223,17 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkImage" id="image5"> <object class="GtkEventBox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="xpad">4</property> <child>
<property name="ypad">4</property> <object class="GtkImage" id="image5">
<property name="halign">center</property> <property name="visible">True</property>
<property name="valign">end</property> <property name="xpad">4</property>
<property name="ypad">4</property>
<property name="halign">center</property>
<property name="valign">end</property>
</object>
</child>
</object> </object>
<packing> <packing>
<property name="left-attach">4</property> <property name="left-attach">4</property>

View File

@@ -62,6 +62,7 @@ uninstall-update-icon-cache:
EXTRA_DIST += \ EXTRA_DIST += \
widget-factory.ui \ widget-factory.ui \
widget-factory.css \
menus.ui \ menus.ui \
widget-factory.gresource.xml \ widget-factory.gresource.xml \
data/source.svg \ data/source.svg \

View File

@@ -159,6 +159,12 @@ spin_value_reset (GtkWidget *button, GtkAdjustment *adjustment)
static gint pulse_time = 250; static gint pulse_time = 250;
static gint pulse_entry_mode = 0; static gint pulse_entry_mode = 0;
static void
remove_pulse (gpointer pulse_id)
{
g_source_remove (GPOINTER_TO_UINT (pulse_id));
}
static gboolean static gboolean
pulse_it (GtkWidget *widget) pulse_it (GtkWidget *widget)
{ {
@@ -170,7 +176,7 @@ pulse_it (GtkWidget *widget)
gtk_progress_bar_pulse (GTK_PROGRESS_BAR (widget)); gtk_progress_bar_pulse (GTK_PROGRESS_BAR (widget));
pulse_id = g_timeout_add (pulse_time, (GSourceFunc)pulse_it, widget); pulse_id = g_timeout_add (pulse_time, (GSourceFunc)pulse_it, widget);
g_object_set_data (G_OBJECT (widget), "pulse_id", GUINT_TO_POINTER (pulse_id)); g_object_set_data_full (G_OBJECT (widget), "pulse_id", GUINT_TO_POINTER (pulse_id), remove_pulse);
return G_SOURCE_REMOVE; return G_SOURCE_REMOVE;
} }
@@ -190,18 +196,14 @@ update_pulse_time (GtkAdjustment *adjustment, GtkWidget *widget)
if (value == 100) if (value == 100)
{ {
if (pulse_id != 0) g_object_set_data (G_OBJECT (widget), "pulse_id", NULL);
{
g_source_remove (pulse_id);
g_object_set_data (G_OBJECT (widget), "pulse_id", NULL);
}
} }
else if (value < 100) else if (value < 100)
{ {
if (pulse_id == 0 && (GTK_IS_PROGRESS_BAR (widget) || pulse_entry_mode % 3 == 2)) if (pulse_id == 0 && (GTK_IS_PROGRESS_BAR (widget) || pulse_entry_mode % 3 == 2))
{ {
pulse_id = g_timeout_add (pulse_time, (GSourceFunc)pulse_it, widget); pulse_id = g_timeout_add (pulse_time, (GSourceFunc)pulse_it, widget);
g_object_set_data (G_OBJECT (widget), "pulse_id", GUINT_TO_POINTER (pulse_id)); g_object_set_data_full (G_OBJECT (widget), "pulse_id", GUINT_TO_POINTER (pulse_id), remove_pulse);
} }
} }
} }
@@ -212,8 +214,6 @@ on_entry_icon_release (GtkEntry *entry,
GdkEvent *event, GdkEvent *event,
gpointer user_data) gpointer user_data)
{ {
guint pulse_id;
if (icon_pos != GTK_ENTRY_ICON_SECONDARY) if (icon_pos != GTK_ENTRY_ICON_SECONDARY)
return; return;
@@ -221,12 +221,7 @@ on_entry_icon_release (GtkEntry *entry,
if (pulse_entry_mode % 3 == 0) if (pulse_entry_mode % 3 == 0)
{ {
pulse_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (entry), "pulse_id")); g_object_set_data (G_OBJECT (entry), "pulse_id", NULL);
if (pulse_id != 0)
{
g_source_remove (pulse_id);
g_object_set_data (G_OBJECT (entry), "pulse_id", NULL);
}
gtk_entry_set_progress_fraction (entry, 0); gtk_entry_set_progress_fraction (entry, 0);
} }
else if (pulse_entry_mode % 3 == 1) else if (pulse_entry_mode % 3 == 1)
@@ -313,27 +308,37 @@ on_page_combo_changed (GtkComboBox *combo,
{ {
GtkWidget *from; GtkWidget *from;
GtkWidget *to; GtkWidget *to;
GtkWidget *print;
from = GTK_WIDGET (g_object_get_data (G_OBJECT (combo), "range_from_spin")); from = GTK_WIDGET (g_object_get_data (G_OBJECT (combo), "range_from_spin"));
to = GTK_WIDGET (g_object_get_data (G_OBJECT (combo), "range_to_spin")); to = GTK_WIDGET (g_object_get_data (G_OBJECT (combo), "range_to_spin"));
print = GTK_WIDGET (g_object_get_data (G_OBJECT (combo), "print_button"));
switch (gtk_combo_box_get_active (combo)) switch (gtk_combo_box_get_active (combo))
{ {
case 0: /* Range */ case 0: /* Range */
gtk_widget_set_sensitive (from, TRUE); gtk_widget_set_sensitive (from, TRUE);
gtk_widget_set_sensitive (to, TRUE); gtk_widget_set_sensitive (to, TRUE);
gtk_widget_set_sensitive (print, TRUE);
break; break;
case 1: /* All */ case 1: /* All */
gtk_widget_set_sensitive (from, FALSE); gtk_widget_set_sensitive (from, FALSE);
gtk_widget_set_sensitive (to, FALSE); gtk_widget_set_sensitive (to, FALSE);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (from), 1); gtk_spin_button_set_value (GTK_SPIN_BUTTON (from), 1);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (to), 99); gtk_spin_button_set_value (GTK_SPIN_BUTTON (to), 99);
gtk_widget_set_sensitive (print, TRUE);
break; break;
case 2: /* Current */ case 2: /* Current */
gtk_widget_set_sensitive (from, FALSE); gtk_widget_set_sensitive (from, FALSE);
gtk_widget_set_sensitive (to, FALSE); gtk_widget_set_sensitive (to, FALSE);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (from), 7); gtk_spin_button_set_value (GTK_SPIN_BUTTON (from), 7);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (to), 7); gtk_spin_button_set_value (GTK_SPIN_BUTTON (to), 7);
gtk_widget_set_sensitive (print, TRUE);
break;
case 4:
gtk_widget_set_sensitive (from, FALSE);
gtk_widget_set_sensitive (to, FALSE);
gtk_widget_set_sensitive (print, FALSE);
break; break;
default:; default:;
} }
@@ -347,8 +352,8 @@ on_range_from_changed (GtkSpinButton *from)
to = GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (from), "range_to_spin")); to = GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (from), "range_to_spin"));
v1 = gtk_spin_button_get_value_as_int (from); v1 = gtk_spin_button_get_value_as_int (from);
v2 = gtk_spin_button_get_value_as_int (to); v2 = gtk_spin_button_get_value_as_int (to);
if (v1 > v2) if (v1 > v2)
gtk_spin_button_set_value (to, v1); gtk_spin_button_set_value (to, v1);
@@ -362,8 +367,8 @@ on_range_to_changed (GtkSpinButton *to)
from = GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (to), "range_from_spin")); from = GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (to), "range_from_spin"));
v1 = gtk_spin_button_get_value_as_int (from); v1 = gtk_spin_button_get_value_as_int (from);
v2 = gtk_spin_button_get_value_as_int (to); v2 = gtk_spin_button_get_value_as_int (to);
if (v1 > v2) if (v1 > v2)
gtk_spin_button_set_value (from, v2); gtk_spin_button_set_value (from, v2);
@@ -723,7 +728,7 @@ populate_colors (GtkWidget *widget)
GdkRGBA rgba; GdkRGBA rgba;
gtk_list_box_set_header_func (GTK_LIST_BOX (widget), update_title_header, NULL, NULL); gtk_list_box_set_header_func (GTK_LIST_BOX (widget), update_title_header, NULL, NULL);
for (i = 0; i < G_N_ELEMENTS (colors); i++) for (i = 0; i < G_N_ELEMENTS (colors); i++)
{ {
row = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 20); row = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 20);
@@ -1104,6 +1109,21 @@ osd_frame_button_press (GtkWidget *frame, GdkEventButton *event, gpointer data)
return GDK_EVENT_STOP; return GDK_EVENT_STOP;
} }
static gboolean
page_combo_separator_func (GtkTreeModel *model,
GtkTreeIter *iter,
gpointer data)
{
gchar *text;
gboolean res;
gtk_tree_model_get (model, iter, 0, &text, -1);
res = g_strcmp0 (text, "-") == 0;
g_free (text);
return res;
}
static void static void
activate (GApplication *app) activate (GApplication *app)
{ {
@@ -1112,6 +1132,7 @@ activate (GApplication *app)
GtkWidget *widget; GtkWidget *widget;
GtkWidget *widget2; GtkWidget *widget2;
GtkWidget *widget3; GtkWidget *widget3;
GtkWidget *widget4;
GtkWidget *stack; GtkWidget *stack;
GtkWidget *dialog; GtkWidget *dialog;
GtkAdjustment *adj; GtkAdjustment *adj;
@@ -1136,7 +1157,7 @@ activate (GApplication *app)
g_type_ensure (my_text_view_get_type ()); g_type_ensure (my_text_view_get_type ());
provider = gtk_css_provider_new (); provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (provider, ".circular-button { border-radius: 20px; outline-radius: 20px; }", -1, NULL); gtk_css_provider_load_from_resource (provider, "/org/gtk/WidgetFactory/widget-factory.css");
gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
GTK_STYLE_PROVIDER (provider), GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_USER); GTK_STYLE_PROVIDER_PRIORITY_USER);
@@ -1259,12 +1280,15 @@ activate (GApplication *app)
populate_colors ((GtkWidget *)gtk_builder_get_object (builder, "munsell")); populate_colors ((GtkWidget *)gtk_builder_get_object (builder, "munsell"));
widget = (GtkWidget *)gtk_builder_get_object (builder, "page_combo"); widget = (GtkWidget *)gtk_builder_get_object (builder, "page_combo");
gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (widget), page_combo_separator_func, NULL, NULL);
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "range_from_spin"); widget2 = (GtkWidget *)gtk_builder_get_object (builder, "range_from_spin");
widget3 = (GtkWidget *)gtk_builder_get_object (builder, "range_to_spin"); widget3 = (GtkWidget *)gtk_builder_get_object (builder, "range_to_spin");
widget4 = (GtkWidget *)gtk_builder_get_object (builder, "print_button");
g_object_set_data (G_OBJECT (widget), "range_from_spin", widget2); g_object_set_data (G_OBJECT (widget), "range_from_spin", widget2);
g_object_set_data (G_OBJECT (widget3), "range_from_spin", widget2); g_object_set_data (G_OBJECT (widget3), "range_from_spin", widget2);
g_object_set_data (G_OBJECT (widget), "range_to_spin", widget3); g_object_set_data (G_OBJECT (widget), "range_to_spin", widget3);
g_object_set_data (G_OBJECT (widget2), "range_to_spin", widget3); g_object_set_data (G_OBJECT (widget2), "range_to_spin", widget3);
g_object_set_data (G_OBJECT (widget), "print_button", widget4);
set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "quitmenuitem"))); set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "quitmenuitem")));
set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "deletemenuitem"))); set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "deletemenuitem")));
@@ -1312,6 +1336,7 @@ int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
GtkApplication *app; GtkApplication *app;
GAction *action;
static GActionEntry app_entries[] = { static GActionEntry app_entries[] = {
{ "about", activate_about, NULL, NULL, NULL }, { "about", activate_about, NULL, NULL, NULL },
{ "quit", activate_quit, NULL, NULL, NULL }, { "quit", activate_quit, NULL, NULL, NULL },
@@ -1329,6 +1354,8 @@ main (int argc, char *argv[])
g_action_map_add_action_entries (G_ACTION_MAP (app), g_action_map_add_action_entries (G_ACTION_MAP (app),
app_entries, G_N_ELEMENTS (app_entries), app_entries, G_N_ELEMENTS (app_entries),
app); app);
action = g_action_map_lookup_action (G_ACTION_MAP (app), "wine");
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL); g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);

View File

@@ -0,0 +1,9 @@
.circular-button {
border-radius: 20px;
outline-radius: 20px;
}
.small-button {
padding: 0;
outline-width: 0;
}

View File

@@ -3,6 +3,9 @@
<gresource prefix="/org/gtk/WidgetFactory"> <gresource prefix="/org/gtk/WidgetFactory">
<file preprocess="xml-stripblanks">widget-factory.ui</file> <file preprocess="xml-stripblanks">widget-factory.ui</file>
</gresource> </gresource>
<gresource prefix="/org/gtk/WidgetFactory">
<file>widget-factory.css</file>
</gresource>
<gresource prefix="/org/gtk/WidgetFactory/gtk"> <gresource prefix="/org/gtk/WidgetFactory/gtk">
<file preprocess="xml-stripblanks">menus.ui</file> <file preprocess="xml-stripblanks">menus.ui</file>
</gresource> </gresource>

View File

@@ -1060,6 +1060,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<object class="GtkFileChooserButton" id="filechooserbutton1"> <object class="GtkFileChooserButton" id="filechooserbutton1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="local_only">False</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@@ -1570,9 +1571,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="title" translatable="yes">Icon</property> <property name="title" translatable="yes">Icon</property>
<property name="reorderable">True</property> <property name="reorderable">True</property>
<child> <child>
<object class="GtkCellRendererPixbuf" id="cellrendererpixbuf1"> <object class="GtkCellRendererPixbuf" id="cellrendererpixbuf1"/>
<property name="follow_state">true</property>
</object>
<attributes> <attributes>
<attribute name="icon_name">1</attribute> <attribute name="icon_name">1</attribute>
</attributes> </attributes>
@@ -2895,6 +2894,15 @@ microphone-sensitivity-medium-symbolic</property>
<property name="tooltip-text" translatable="yes">Search for it</property> <property name="tooltip-text" translatable="yes">Search for it</property>
</object> </object>
</child> </child>
<child>
<object class="GtkToolButton">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="label" translatable="yes">Insert</property>
<property name="icon-name">insert-image</property>
<property name="tooltip-text" translatable="yes">Insert something</property>
</object>
</child>
</object> </object>
</child> </child>
<child> <child>
@@ -3073,9 +3081,7 @@ microphone-sensitivity-medium-symbolic</property>
<property name="selection_mode">multiple</property> <property name="selection_mode">multiple</property>
<property name="model">iconsmodel</property> <property name="model">iconsmodel</property>
<child> <child>
<object class="GtkCellRendererPixbuf" id="iconviewcell"> <object class="GtkCellRendererPixbuf" id="iconviewcell"/>
<property name="follow-state">True</property>
</object>
<attributes> <attributes>
<attribute name="icon-name">0</attribute> <attribute name="icon-name">0</attribute>
</attributes> </attributes>
@@ -3400,7 +3406,7 @@ microphone-sensitivity-medium-symbolic</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="orientation">horizontal</property> <property name="orientation">horizontal</property>
<child> <child>
<object class="GtkSidebar"> <object class="GtkStackSidebar">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stack">sidebar_stack</property> <property name="stack">sidebar_stack</property>
</object> </object>
@@ -3573,6 +3579,8 @@ microphone-sensitivity-medium-symbolic</property>
<item>Range</item> <item>Range</item>
<item>All</item> <item>All</item>
<item>Current</item> <item>Current</item>
<item>-</item>
<item>None</item>
</items> </items>
</object> </object>
</child> </child>
@@ -3591,7 +3599,7 @@ microphone-sensitivity-medium-symbolic</property>
</object> </object>
</child> </child>
<child> <child>
<object class="GtkButton"> <object class="GtkButton" id="print_button">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label">Print</property> <property name="label">Print</property>
</object> </object>
@@ -3619,6 +3627,7 @@ microphone-sensitivity-medium-symbolic</property>
<object class="GtkToolbar"> <object class="GtkToolbar">
<property name="visible">True</property> <property name="visible">True</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="toolbar-style">icons</property>
<property name="icon-size">1</property> <property name="icon-size">1</property>
<child> <child>
<object class="GtkToolButton" id="toolbutton1"> <object class="GtkToolButton" id="toolbutton1">
@@ -3858,11 +3867,41 @@ microphone-sensitivity-medium-symbolic</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="height-request">120</property> <property name="height-request">120</property>
</object> </object>
<packing>
<property name="tab-expand">True</property>
<property name="tab-fill">True</property>
</packing>
</child> </child>
<child type="tab"> <child type="tab">
<object class="GtkLabel"> <object class="GtkBox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Page 1</property> <property name="orientation">horizontal</property>
<child type="center">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Page 1</property>
</object>
</child>
<child>
<object class="GtkButton">
<property name="visible">True</property>
<property name="relief">none</property>
<property name="focus-on-click">False</property>
<style>
<class name="small-button"/>
</style>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon-name">window-close-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
</object> </object>
</child> </child>
<child> <child>
@@ -3870,11 +3909,41 @@ microphone-sensitivity-medium-symbolic</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="vexpand">True</property> <property name="vexpand">True</property>
</object> </object>
<packing>
<property name="tab-expand">True</property>
<property name="tab-fill">True</property>
</packing>
</child> </child>
<child type="tab"> <child type="tab">
<object class="GtkLabel"> <object class="GtkBox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Page 2</property> <property name="orientation">horizontal</property>
<child type="center">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Page 2</property>
</object>
</child>
<child>
<object class="GtkButton">
<property name="visible">True</property>
<property name="relief">none</property>
<property name="focus-on-click">False</property>
<style>
<class name="small-button"/>
</style>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon-name">window-close-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
</object> </object>
</child> </child>
</object> </object>

View File

@@ -28,6 +28,7 @@ IGNORE_HFILES= \
gdkprivate.h \ gdkprivate.h \
gdk*private.h \ gdk*private.h \
keyname-table.h \ keyname-table.h \
wayland/xdg-shell-client-protocol.h \
win32 \ win32 \
x11 \ x11 \
quartz quartz

View File

@@ -713,6 +713,8 @@ GdkGrabOwnership
<SUBSECTION> <SUBSECTION>
gdk_device_get_name gdk_device_get_name
gdk_device_get_vendor_id
gdk_device_get_product_id
gdk_device_get_source gdk_device_get_source
gdk_device_set_mode gdk_device_set_mode
gdk_device_get_mode gdk_device_get_mode
@@ -1286,12 +1288,25 @@ gdk_frame_get_type
<SECTION> <SECTION>
<FILE>gdkglcontext</FILE> <FILE>gdkglcontext</FILE>
GdkGLContext GdkGLContext
gdk_gl_context_get_display
gdk_gl_context_get_window gdk_gl_context_get_window
gdk_gl_context_make_current gdk_gl_context_get_shared_context
gdk_gl_context_clear_current gdk_gl_context_get_version
gdk_gl_context_get_current
GdkGLProfile <SUBSECTION>
gdk_gl_context_set_required_version
gdk_gl_context_get_required_version
gdk_gl_context_set_debug_enabled
gdk_gl_context_get_debug_enabled
gdk_gl_context_set_forward_compatible
gdk_gl_context_get_forward_compatible
<SUBSECTION>
GdkGLError GdkGLError
gdk_gl_context_realize
gdk_gl_context_make_current
gdk_gl_context_get_current
gdk_gl_context_clear_current
<SUBSECTION Standard> <SUBSECTION Standard>
GDK_GL_CONTEXT GDK_GL_CONTEXT

View File

@@ -19,85 +19,217 @@ HFILE_GLOB=$(top_srcdir)/gtk/*.h
CFILE_GLOB=$(top_srcdir)/gtk/*.c CFILE_GLOB=$(top_srcdir)/gtk/*.c
# Header files to ignore when scanning # Header files to ignore when scanning
IGNORE_HFILES= \ IGNORE_HFILES = \
inspector \
a11y \
gtkaccelgroupprivate.h \
gtkaccelmapprivate.h \
gtkadjustmentprivate.h \
gtkallocatedbitmaskprivate.h \
gtkappchooserprivate.h \
gtkapplicationprivate.h \
gtkbindingsprivate.h \
gtkbitmaskprivate.h \
gtkboxprivate.h \
gtkbuilderprivate.h \
gtkbuttonprivate.h \
gtkcairoblurprivate.h \
gtkcellareaboxcontextprivate.h \
gtkclipboardprivate.h \
gtkcolorchooserprivate.h \
gtkcoloreditorprivate.h \
gtkcolorplaneprivate.h \
gtkcolorscaleprivate.h \
gtkcolorswatchprivate.h \
gtkcomboboxprivate.h \
gtkcontainerprivate.h \
gtkcssanimatedstyleprivate.h \
gtkcssanimationprivate.h \
gtkcssarrayvalueprivate.h \
gtkcssbgsizevalueprivate.h \
gtkcssbordervalueprivate.h \
gtkcsscolorvalueprivate.h \
gtkcsscornervalueprivate.h \
gtkcsscustompropertyprivate.h \
gtkcsseasevalueprivate.h \
gtkcssenginevalueprivate.h \
gtkcssenumvalueprivate.h \
gtkcssiconthemevalueprivate.h \
gtkcssimagebuiltinprivate.h \
gtkcssimagecrossfadeprivate.h \
gtkcssimagegradientprivate.h \
gtkcssimageiconthemeprivate.h \
gtkcssimagelinearprivate.h \
gtkcssimageprivate.h \
gtkcssimagescaledprivate.h \
gtkcssimagesurfaceprivate.h \
gtkcssimageurlprivate.h \
gtkcssimagevalueprivate.h \
gtkcssimagewin32private.h \
gtkcssinheritvalueprivate.h \
gtkcssinitialvalueprivate.h \
gtkcsskeyframesprivate.h \
gtkcsslookupprivate.h \
gtkcssmatcherprivate.h \
gtkcssnodedeclarationprivate.h \
gtkcssnumbervalueprivate.h \
gtkcssparserprivate.h \
gtkcsspositionvalueprivate.h \
gtkcssproviderprivate.h \
gtkcssrepeatvalueprivate.h \
gtkcssrgbavalueprivate.h \
gtkcsssectionprivate.h \
gtkcssselectorprivate.h \
gtkcssshadowsvalueprivate.h \
gtkcssshadowvalueprivate.h \
gtkcssshorthandpropertyprivate.h\
gtkcssstaticstyleprivate.h \
gtkcssstringvalueprivate.h \
gtkcssstylefuncsprivate.h \
gtkcssstyleprivate.h \
gtkcssstylepropertyprivate.h \
gtkcsstransformvalueprivate.h \
gtkcsstransitionprivate.h \
gtkcsstypedvalueprivate.h \
gtkcsstypesprivate.h \
gtkcssunsetvalueprivate.h \
gtkcssvalueprivate.h \
gtkdialogprivate.h \
gtkentryprivate.h \
gtkeventcontrollerprivate.h \
gtkfilechooserprivate.h \
gtkfontchooserprivate.h \
gtkgesturedragprivate.h \
gtkgesturelongpressprivate.h \
gtkgesturemultipressprivate.h \
gtkgesturepanprivate.h \
gtkgestureprivate.h \
gtkgesturerotateprivate.h \
gtkgesturesingleprivate.h \
gtkgestureswipeprivate.h \
gtkgesturezoomprivate.h \
gtkheaderbarprivate.h \
gtkhslaprivate.h \
gtkiconhelperprivate.h \
gtkiconviewprivate.h \
gtkimageprivate.h \
gtkimmoduleprivate.h \
gtklabelprivate.h \
gtklockbuttonprivate.h \
gtkmagnifierprivate.h \
gtkmenubuttonprivate.h \
gtkmenuitemprivate.h \
gtkmenuprivate.h \
gtkmenushellprivate.h \
gtkmodulesprivate.h \
gtkmountoperationprivate.h \
gtkorientableprivate.h \
gtkpixelcacheprivate.h \
gtkpopoverprivate.h \
gtkprinter-private.h \
gtkprintoperation-private.h \
gtkprivate.h \
gtkrangeprivate.h \
gtkrecentchooserprivate.h \
gtkrenderbackgroundprivate.h \
gtkrenderborderprivate.h \
gtkrendericonprivate.h \
gtkrenderprivate.h \
gtkroundedboxprivate.h \
gtkscaleprivate.h \
gtksearchentryprivate.h \
gtkselectionprivate.h \
gtksettingsprivate.h \
gtksizegroup-private.h \
gtksizerequestcacheprivate.h \
gtksocketprivate.h \
gtkstyleanimationprivate.h \
gtkstylecascadeprivate.h \
gtkstylecontextprivate.h \
gtkstylepropertyprivate.h \
gtkstyleproviderprivate.h \
gtktextchildprivate.h \
gtktexthandleprivate.h \
gtktextiterprivate.h \
gtktextmarkprivate.h \
gtktexttagprivate.h \
gtktogglebuttonprivate.h \
gtktoolbarprivate.h \
gtktoolpaletteprivate.h \
gtktooltipprivate.h \
gtktreeprivate.h \
gtkwidgetprivate.h \
gtkwin32themeprivate.h \
gtkwindowprivate.h \
fnmatch.h \ fnmatch.h \
gtkactionmuxer.h \ gtkactionmuxer.h \
gtkactionobserver.h \ gtkactionobserver.h \
gtkactionobservable.h \ gtkactionobservable.h \
gtk9slice.h \ gtk9slice.h \
gtkanimationdescription.h \ gtkanimationdescription.h \
gtkbitmaskprivateimpl.h \
gtkbookmarksmanager.h \
gtkdbusgenerated.c \
gtkdbusgenerated.h \
gtkdebug.h \ gtkdebug.h \
gtkactionhelper.h \ gtkactionhelper.h \
gtkapplicationprivate.h \
gtkbuilderprivate.h \
gtkcolorchooserprivate.h \
gtkcoloreditorprivate.h \
gtkcolorplaneprivate.h \
gtkcolorscaleprivate.h \
gtkcolorswatchprivate.h \
gtkdndcursors.h \ gtkdndcursors.h \
gtkentryprivate.h \
gtkfilechooserdefault.h \ gtkfilechooserdefault.h \
gtkfilechooserembed.h \ gtkfilechooserembed.h \
gtkfilechooserentry.h \ gtkfilechooserentry.h \
gtkfilechooserprivate.h \
gtkfilechoosersettings.h \ gtkfilechoosersettings.h \
gtkfilechooserutils.h \ gtkfilechooserutils.h \
gtkfilesystem.h \ gtkfilesystem.h \
gtkfilesystemmodel.h \ gtkfilesystemmodel.h \
gtkfilesystemunix.h \ gtkfilesystemunix.h \
gtkfilesystemwin32.h \ gtkfilesystemwin32.h \
gtkfontchooserutils.h \
gtkiconcache.h \ gtkiconcache.h \
gtkiconcachevalidator.h \ gtkiconcachevalidator.h \
gtkiconthemeparser.h \ gtkiconthemeparser.h \
gtkintl.h \ gtkintl.h \
gtkkeyhash.h \ gtkkeyhash.h \
gtkkineticscrolling.h \
gtkmarshal.h \ gtkmarshal.h \
gtkmenuprivate.h \
gtkmnemonichash.h \ gtkmnemonichash.h \
gtkmenutracker.h \
gtkmenutrackeritem.h \
gtkmenusectionbox.h \
gtkmodelmenu.h \ gtkmodelmenu.h \
gtkmodelmenuitem.h \ gtkmodelmenuitem.h \
gtkmodifierstyle.h \
gtkpathbar.h \ gtkpathbar.h \
gtkplugprivate.h \
gtkprintbackend.h \ gtkprintbackend.h \
gtkprinteroption.h \ gtkprinteroption.h \
gtkprinteroptionset.h \ gtkprinteroptionset.h \
gtkprinteroptionwidget.h \ gtkprinteroptionwidget.h \
gtkprinter-private.h \
gtkprint-win32.h \ gtkprint-win32.h \
gtkprintutils.h \ gtkprintutils.h \
gtkprintoperation-private.h \
gtkprivate.h \ gtkprivate.h \
gtkprivatetypebuiltins.h \
gtkquery.h \ gtkquery.h \
gtkrbtree.h \ gtkrbtree.h \
gtkrecentchooserdefault.h \ gtkrecentchooserdefault.h \
gtkrecentchooserutils.h \ gtkrecentchooserutils.h \
gtkrecentchooserprivate.h \
gtksearchengine.h \ gtksearchengine.h \
gtksearchenginebeagle.h \
gtksearchenginetracker.h \ gtksearchenginetracker.h \
gtksearchenginesimple.h \ gtksearchenginesimple.h \
gtksearchenginequartz.h \ gtksearchenginequartz.h \
gtksequence.h \ gtksequence.h \
gtksocketprivate.h \ gtksocketprivate.h \
gtktextbtree.h \ gtktextbtree.h \
gtktextbufferserializ.h \ gtktextbufferserialize.h \
gtktextchildprivate.h \
gtktextdisplay.h \ gtktextdisplay.h \
gtktexthandleprivate.h \
gtktextiterprivate.h \
gtktextlayout.h \ gtktextlayout.h \
gtktextmarkprivate.h \
gtktextsegment.h \ gtktextsegment.h \
gtktexttagprivate.h \
gtktexttypes.h \ gtktexttypes.h \
gtktextutil.h \ gtktextutil.h \
gtktimeline.h \ gtktimeline.h \
gtkthemes.h \ gtkthemes.h \
gtktrashmonitor.h \
gtktrayicon.h \ gtktrayicon.h \
gtktreedatalist.h \ gtktreedatalist.h \
gtktreeprivate.h \ gtktreemenu.h \
gtktoolpaletteprivate.h \
gtktypebuiltins.h \ gtktypebuiltins.h \
gtkxembed.h \ gtkxembed.h \
gtkwin32embed.h \ gtkwin32embed.h \
@@ -172,6 +304,7 @@ expand_content_files = \
drawing-model.xml \ drawing-model.xml \
getting_started.xml \ getting_started.xml \
glossary.xml \ glossary.xml \
input-handling.xml \
migrating-2to3.xml \ migrating-2to3.xml \
migrating-checklist.sgml \ migrating-checklist.sgml \
migrating-unique-GtkApplication.xml \ migrating-unique-GtkApplication.xml \

View File

@@ -202,7 +202,7 @@ How to compile GTK+ itself
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
<ulink url="http://live.gnome.org/GObjectIntrospection">Gobject Introspection</ulink> <ulink url="https://wiki.gnome.org/Projects/GObjectIntrospection">Gobject Introspection</ulink>
is a framework for making introspection data available to is a framework for making introspection data available to
language bindings. It is available language bindings. It is available
<ulink url="http://download.gnome.org/sources/gobject-introspection/">here</ulink>. <ulink url="http://download.gnome.org/sources/gobject-introspection/">here</ulink>.

View File

@@ -5,6 +5,21 @@
<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>GTK+ is a <ulink url="http://en.wikipedia.org/wiki/Widget_toolkit">
widget toolkit</ulink>. Each user interface created by
GTK+ consists of widgets. This is implemented in C using
<link linkend="gobject">GObject</link>, an object-oriented framework for C.
Widgets are organized in a hierachy. The window widget is the main container.
The user interface is then built by adding buttons, drop-down menus, input
fields, and other widgets to the window.
If you are creating complex user interfaces it is recommended to
use #GtkBuilder and its GTK-specific markup description language, instead of
assembling the interface manually. You can also use a visual user interface
editor, like <ulink url="https://glade.gnome.org/">Glade</ulink>.</para>
<para>GTK+ is event-driven. The toolkit listens for events such as
a click on a button, and passes the event to your application.</para>
<para>This chapter 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
@@ -15,8 +30,8 @@
<section> <section>
<title>Basics</title> <title>Basics</title>
<para>To begin our introduction to GTK, we'll start with the simplest <para>To begin our introduction to GTK, we'll start with a simple
program possible. This program will create an empty 200 × 200 pixel signal-based Gtk application. This program will create an empty 200 × 200 pixel
window.</para> window.</para>
<informalfigure> <informalfigure>
@@ -28,7 +43,7 @@
</informalfigure> </informalfigure>
<informalexample> <informalexample>
<para>Create a new file with the following content named example-0.c.</para> <para>Create a new file with the following content named <filename>example-0.c.</filename></para>
<programlisting><xi:include href="../../../../examples/window-default.c" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting> <programlisting><xi:include href="../../../../examples/window-default.c" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</informalexample> </informalexample>
@@ -52,45 +67,66 @@
by third party code. The compiler will abort with an error if any other by third party code. The compiler will abort with an error if any other
header is directly included.</para></warning> header is directly included.</para></warning>
<para>We then proceed into the <function>main</function>() function of the <para>In a GTK+ application, the purpose of the main() function is to
application, and we declare a <varname>window</varname> variable as a pointer create a #GtkApplication object and run it. In this example a
of type #GtkWidget.</para> #GtkApplication pointer named <varname>app</varname> is called and then
initialized using gtk_application_new().</para>
<para>The following line will call gtk_init(), which <para>When creating a #GtkApplication
is the initialization function for GTK+; this function will set up GTK+, you need to pick an application identifier (a name)
the type system, the connection to the windowing environment, etc. The and input to gtk_application_new() as parameter.
gtk_init() takes as arguments the pointers to the command line arguments For this example <varname>org.gtk.example</varname> is used
but for choosing an identifier for your application see
<ulink url="https://wiki.gnome.org/HowDoI/ChooseApplicationID">this guide</ulink>.
Lastly gtk_application_new() takes a GApplicationFlags as input for your
application, if your application would have special needs.
</para>
<para>Next the
<ulink url="https://wiki.gnome.org/HowDoI/GtkApplication">activate signal</ulink>
is connected to the activate() function above the main() functions.
The <varname>activate</varname> signal will be sent
when your application is launched with
g_application_run() on the line below.
The gtk_application_run() also takes as arguments the pointers to the command line arguments
counter and string array; this allows GTK+ to parse specific command line counter and string array; this allows GTK+ to parse specific command line
arguments that control the behavior of GTK+ itself. The parsed arguments arguments that control the behavior of GTK+ itself. The parsed arguments
will be removed from the array, leaving the unrecognized ones for your will be removed from the array, leaving the unrecognized ones for your
application to parse.</para> application to parse.
</para>
<note><para>For more information on which command line arguments GTK+ <para>Within g_application_run the activate() signal is sent and
recognizes, please refer to the <link linkend="gtk-running">Running GTK+ we then proceed into the <function>activate</function>() function of the
Applications</link> section in this reference.</para></note> application. Inside the activate() function we want to construct
our GTK window, so that a window is shown when the application
is launched. The call to gtk_application_window_new() will
create a new #GtkWindow and store it inside the
<varname>window</varname> pointer. The window will have a frame,
a title bar, and window controls depending on the platform.</para>
<para>The call to gtk_window_new() will create a new #GtkWindow and store <para>A window title is set using gtk_window_set_title(). This function
it inside the <varname>window</varname> variable. The type of the window takes a GtkWindow* pointer and a string as input. As our
is %GTK_WINDOW_TOPLEVEL, which means that the #GtkWindow will be managed <varname>window</varname> pointer is a GtkWidget pointer, we need to cast it
by the windowing system: it will have a frame, a title bar and window to GtkWindow*.
controls, depending on the platform.</para> But instead of casting <varname>window</varname> via
<varname>(GtkWindow*)</varname>,
<varname>window</varname> can be cast using the macro
<varname>GTK_WINDOW()</varname>.
<varname>GTK_WINDOW()</varname> will check if the
pointer is an instance of the GtkWindow class, before casting, and emit a
warning if the check fails. More information about this convention
can be found
<ulink url="https://developer.gnome.org/gobject/stable/gtype-conventions.html">
here</ulink>.</para>
<para>In order to terminate the application when the #GtkWindow is <para>Finally the window size is set using gtk_window_set_default_size and
destroyed, we connect the #GtkWidget::destroy signal to the gtk_main_quit() the window is then shown by GTK via gtk_widget_show_all().</para>
function. This function will terminate the GTK+ main loop started by calling
gtk_main() later. The #GtkWidget::destroy signal is emitted when a widget is
destroyed, either by explicitly calling gtk_widget_destroy() or when the
widget is unparented. Top-level #GtkWindow<!-- -->s are also destroyed when
the Close window control button is clicked.</para>
<para>#GtkWidget<!-- -->s are hidden by default. By calling gtk_widget_show() <para>When you exit the window, by for example pressing the X,
on a #GtkWidget we are asking GTK+ to set the visibility attribute so that it the g_application_run() in the main loop returns with a number
can be displayed. All this work is done after the main loop has been which is saved inside an integer named "status". Afterwards, the
started.</para> #GtkApplication object is freed from memory with g_object_unref().
Finally the status integer is returned and the GTK application exits.</para>
<para>The last line of interest is the call to gtk_main(). This function will
start the GTK+ main loop and will block the control flow of the
main() until the gtk_main_quit() function is called.</para>
<para>While the program is running, GTK+ is receiving <para>While the program is running, GTK+ is receiving
<firstterm>events</firstterm>. These are typically input events caused by <firstterm>events</firstterm>. These are typically input events caused by
@@ -129,13 +165,53 @@
</para> </para>
</section> </section>
<para>As seen above, example-1.c builds further upon example-0.c by adding a
button to our window, with the label "Hello World". Two new GtkWidget pointers
are declared to accomplish this, <varname>button</varname> and
<varname>button_box</varname>. The button_box variable is created to store a
#GtkButtonBox which is GTK+'s way of controlling the size and layout of buttons.
The #GtkButtonBox is created and assigned to gtk_button_box_new() which takes a
#GtkOrientation enum as parameter. The buttons which this box will contain can
either be stored horizontally or vertically but this does not matter in this
particular case as we are dealing with only one button. After initializing
button_box with horizontal orientation, the code adds the button_box widget to the
window widget using gtk_container_add().</para>
<para>Next the <varname>button</varname> variable is initialized in similar manner.
gtk_button_new_with_label() is called which returns a GtkButton to be stored inside
<varname>button</varname>. Afterwards <varname>button</varname> is added to
our <varname>button_box</varname>.
Using g_signal_connect the button is connected to a function in our app called
print_hello(), so that when the button is clicked, GTK will call this function.
As the print_hello() function does not use any data as input, NULL is passed
to it. print_hello() calls g_print() with the string "Hello World"
which will print Hello World in a terminal if the GTK application was started
from one.</para>
<para>After connecting print_hello(), another signal is connected to the "clicked" state
of the button using g_signal_connect_swapped(). This functions is similar to
a g_signal_connect() with the difference lying in how the callback function is
treated. g_signal_connect_swapped() allow you to specify what the callback
function should take as parameter by letting you pass it as data. In this case
the function being called back is gtk_widget_destroy() and the <varname>window</varname>
pointer is passed to it. This has the effect that when the button is clicked,
the whole GTK window is destroyed. In contrast if a normal g_signal_connect() were used
to connect the "clicked" signal with gtk_widget_destroy(), then the <varname>button</varname>
itself would have been destroyed, not the window.
More information about creating buttons can be found
<ulink url="https://wiki.gnome.org/HowDoI/Buttons">here</ulink>.
</para>
<para>The rest of the code in example-1.c is identical to example-0.c. Next
section will elaborate further on how to add several GtkWidgets to your GTK
application.</para>
<section> <section>
<title>Packing</title> <title>Packing</title>
<para>When creating an application, you'll want to put more than one widget <para>When creating an application, you'll want to put more than one widget
inside a window. Our first helloworld example only used one widget so we inside a window.
could simply use a gtk_container_add() call to "pack" the widget into the When you want to put more than one widget into a window, it
window. But when you want to put more than one widget into a window, it
it becomes important to control how each widget is positioned and sized. it becomes important to control how each widget is positioned and sized.
This is where packing comes in.</para> This is where packing comes in.</para>
@@ -167,51 +243,6 @@
</para> </para>
</section> </section>
<section>
<title>Drawing</title>
<para>Many widgets, like buttons, do all their drawing themselves. You
just tell them the label you want to see, and they figure out what font
to use, draw the button outline and focus rectangle, etc. Sometimes, it
is necessary to do some custom drawing. In that case, a #GtkDrawingArea
might be the right widget to use. It offers a canvas on which you can
draw by connecting to the #GtkWidget::draw signal.
</para>
<para>The contents of a widget often need to be partially or fully redrawn,
e.g. when another window is moved and uncovers part of the widget, or
when tie window containing it is resized. It is also possible to explicitly
cause part or all of the widget to be redrawn, by calling
gtk_widget_queue_draw() or its variants. GTK+ takes care of most of the
details by providing a ready-to-use cairo context to the ::draw signal
handler.</para>
<para>The following example shows a ::draw signal handler. It is a bit
more complicated than the previous examples, since it also demonstrates
input event handling by means of ::button-press and ::motion-notify
handlers.</para>
<informalfigure>
<mediaobject>
<imageobject>
<imagedata fileref="drawing.png" format="PNG"/>
</imageobject>
</mediaobject>
</informalfigure>
<example id="gtk-getting-started-drawing">
<title>Drawing in response to input</title>
<para>Create a new file with the following content named example-3.c.</para>
<programlisting><xi:include href="../../../../examples/drawing.c" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</example>
<para>
You can compile the program above with GCC using:
<literallayout>
<literal>gcc `pkg-config --cflags gtk+-3.0` -o example-3 example-3.c `pkg-config --libs gtk+-3.0`</literal>
</literallayout>
</para>
</section>
<section> <section>
<title>Building user interfaces</title> <title>Building user interfaces</title>
@@ -1006,4 +1037,50 @@ example_app_window_init (ExampleAppWindow *win)
here.</para> here.</para>
</section> </section>
</section> </section>
<section>
<title>Custom Drawing</title>
<para>Many widgets, like buttons, do all their drawing themselves. You
just tell them the label you want to see, and they figure out what font
to use, draw the button outline and focus rectangle, etc. Sometimes, it
is necessary to do some custom drawing. In that case, a #GtkDrawingArea
might be the right widget to use. It offers a canvas on which you can
draw by connecting to the #GtkWidget::draw signal.
</para>
<para>The contents of a widget often need to be partially or fully redrawn,
e.g. when another window is moved and uncovers part of the widget, or
when tie window containing it is resized. It is also possible to explicitly
cause part or all of the widget to be redrawn, by calling
gtk_widget_queue_draw() or its variants. GTK+ takes care of most of the
details by providing a ready-to-use cairo context to the ::draw signal
handler.</para>
<para>The following example shows a ::draw signal handler. It is a bit
more complicated than the previous examples, since it also demonstrates
input event handling by means of ::button-press and ::motion-notify
handlers.</para>
<informalfigure>
<mediaobject>
<imageobject>
<imagedata fileref="drawing.png" format="PNG"/>
</imageobject>
</mediaobject>
</informalfigure>
<example id="gtk-getting-started-drawing">
<title>Drawing in response to input</title>
<para>Create a new file with the following content named example-3.c.</para>
<programlisting><xi:include href="../../../../examples/drawing.c" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
</example>
<para>
You can compile the program above with GCC using:
<literallayout>
<literal>gcc `pkg-config --cflags gtk+-3.0` -o example-3 example-3.c `pkg-config --libs gtk+-3.0`</literal>
</literallayout>
</para>
</section>
</chapter> </chapter>

View File

@@ -25,7 +25,7 @@
<xi:include href="resources.sgml" /> <xi:include href="resources.sgml" />
<xi:include href="xml/question_index.sgml" /> <xi:include href="xml/question_index.sgml" />
<xi:include href="drawing-model.xml" /> <xi:include href="drawing-model.xml" />
<xi:include href="input-handling.xml" /> <xi:include href="xml/input-handling.xml" />
</part> </part>
@@ -76,7 +76,7 @@
<xi:include href="xml/gtkflowbox.xml" /> <xi:include href="xml/gtkflowbox.xml" />
<xi:include href="xml/gtkstack.xml" /> <xi:include href="xml/gtkstack.xml" />
<xi:include href="xml/gtkstackswitcher.xml" /> <xi:include href="xml/gtkstackswitcher.xml" />
<xi:include href="xml/gtksidebar.xml" /> <xi:include href="xml/gtkstacksidebar.xml" />
<xi:include href="xml/gtkactionbar.xml" /> <xi:include href="xml/gtkactionbar.xml" />
<xi:include href="xml/gtkheaderbar.xml" /> <xi:include href="xml/gtkheaderbar.xml" />
<xi:include href="xml/gtkoverlay.xml" /> <xi:include href="xml/gtkoverlay.xml" />

View File

@@ -329,6 +329,7 @@ GTK_ADJUSTMENT_CLASS
GTK_IS_ADJUSTMENT_CLASS GTK_IS_ADJUSTMENT_CLASS
GTK_ADJUSTMENT_GET_CLASS GTK_ADJUSTMENT_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
GtkAdjustmentPrivate
gtk_adjustment_get_type gtk_adjustment_get_type
</SECTION> </SECTION>
@@ -550,12 +551,13 @@ gtk_list_box_set_header_func
gtk_list_box_set_sort_func gtk_list_box_set_sort_func
gtk_list_box_drag_highlight_row gtk_list_box_drag_highlight_row
gtk_list_box_drag_unhighlight_row gtk_list_box_drag_unhighlight_row
GtkListBoxCreateWidgetFunc
gtk_list_box_bind_model
gtk_list_box_row_new gtk_list_box_row_new
gtk_list_box_row_changed gtk_list_box_row_changed
gtk_list_box_row_is_selected gtk_list_box_row_is_selected
gtk_list_box_row_get_header gtk_list_box_row_get_header
gtk_list_box_row_get_type
gtk_list_box_row_set_header gtk_list_box_row_set_header
gtk_list_box_row_get_index gtk_list_box_row_get_index
gtk_list_box_row_set_activatable gtk_list_box_row_set_activatable
@@ -564,6 +566,12 @@ gtk_list_box_row_set_selectable
gtk_list_box_row_get_selectable gtk_list_box_row_get_selectable
<SUBSECTION Standard> <SUBSECTION Standard>
GTK_LIST_BOX
GTK_LIST_BOX_CLASS
GTK_LIST_BOX_GET_CLASS
GTK_LIST_BOX_ROW
GTK_LIST_BOX_ROW_CLASS
GTK_LIST_BOX_ROW_GET_CLASS
GTK_IS_LIST_BOX GTK_IS_LIST_BOX
GTK_IS_LIST_BOX_CLASS GTK_IS_LIST_BOX_CLASS
GTK_IS_LIST_BOX_ROW GTK_IS_LIST_BOX_ROW
@@ -1118,6 +1126,7 @@ gtk_editable_get_type
<FILE>gtkentry</FILE> <FILE>gtkentry</FILE>
<TITLE>GtkEntry</TITLE> <TITLE>GtkEntry</TITLE>
GtkEntry GtkEntry
GtkEntryClass
gtk_entry_new gtk_entry_new
gtk_entry_new_with_buffer gtk_entry_new_with_buffer
gtk_entry_get_buffer gtk_entry_get_buffer
@@ -1206,6 +1215,8 @@ GTK_ENTRY_CLASS
GTK_IS_ENTRY_CLASS GTK_IS_ENTRY_CLASS
GTK_ENTRY_GET_CLASS GTK_ENTRY_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
GTK_TYPE_TEXT_HANDLE_POSITION
GTK_TYPE_TEXT_HANDLE_MODE
GtkEntryPrivate GtkEntryPrivate
gtk_entry_get_type gtk_entry_get_type
</SECTION> </SECTION>
@@ -1302,6 +1313,7 @@ GTK_EVENT_BOX_CLASS
GTK_IS_EVENT_BOX_CLASS GTK_IS_EVENT_BOX_CLASS
GTK_EVENT_BOX_GET_CLASS GTK_EVENT_BOX_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
GtkEventBoxPrivate
gtk_event_box_get_type gtk_event_box_get_type
</SECTION> </SECTION>
@@ -1633,6 +1645,7 @@ GTK_IS_FONT_CHOOSER_IFACE
GTK_FONT_CHOOSER_GET_IFACE GTK_FONT_CHOOSER_GET_IFACE
<SUBSECTION Private> <SUBSECTION Private>
GTK_FONT_CHOOSER_DELEGATE_QUARK
gtk_font_chooser_get_type gtk_font_chooser_get_type
</SECTION> </SECTION>
@@ -2235,6 +2248,7 @@ GTK_MENU_CLASS
GTK_IS_MENU_CLASS GTK_IS_MENU_CLASS
GTK_MENU_GET_CLASS GTK_MENU_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
GtkMenuPrivate
gtk_menu_get_type gtk_menu_get_type
</SECTION> </SECTION>
@@ -2287,7 +2301,7 @@ GTK_IS_MENU_BUTTON
GTK_IS_MENU_BUTTON_CLASS GTK_IS_MENU_BUTTON_CLASS
GTK_MENU_BUTTON_GET_CLASS GTK_MENU_BUTTON_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
GtkMenuButtonrPrivate GtkMenuButtonPrivate
gtk_menu_button_get_type gtk_menu_button_get_type
</SECTION> </SECTION>
@@ -2324,6 +2338,7 @@ GTK_MENU_ITEM_CLASS
GTK_IS_MENU_ITEM_CLASS GTK_IS_MENU_ITEM_CLASS
GTK_MENU_ITEM_GET_CLASS GTK_MENU_ITEM_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
GtkMenuItemPrivate
gtk_menu_item_get_type gtk_menu_item_get_type
</SECTION> </SECTION>
@@ -2390,6 +2405,7 @@ GTK_MENU_SHELL_CLASS
GTK_IS_MENU_SHELL_CLASS GTK_IS_MENU_SHELL_CLASS
GTK_MENU_SHELL_GET_CLASS GTK_MENU_SHELL_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
GtkMenuShellPrivate
gtk_menu_shell_get_type gtk_menu_shell_get_type
</SECTION> </SECTION>
@@ -2483,6 +2499,7 @@ gtk_notebook_prepend_page_menu
gtk_notebook_insert_page gtk_notebook_insert_page
gtk_notebook_insert_page_menu gtk_notebook_insert_page_menu
gtk_notebook_remove_page gtk_notebook_remove_page
gtk_notebook_detach_tab
gtk_notebook_page_num gtk_notebook_page_num
gtk_notebook_next_page gtk_notebook_next_page
gtk_notebook_prev_page gtk_notebook_prev_page
@@ -2557,6 +2574,7 @@ GTK_IS_NUMERABLE_ICON_CLASS
GTK_NUMERABLE_ICON_GET_CLASS GTK_NUMERABLE_ICON_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
GtkNumerableIconPrivate
gtk_numerable_icon_get_type gtk_numerable_icon_get_type
</SECTION> </SECTION>
@@ -3198,6 +3216,7 @@ gtk_search_bar_get_type
<TITLE>GtkSearchEntry</TITLE> <TITLE>GtkSearchEntry</TITLE>
GtkSearchEntry GtkSearchEntry
gtk_search_entry_new gtk_search_entry_new
gtk_search_entry_handle_event
<SUBSECTION Standard> <SUBSECTION Standard>
GTK_TYPE_SEARCH_ENTRY GTK_TYPE_SEARCH_ENTRY
GTK_SEARCH_ENTRY GTK_SEARCH_ENTRY
@@ -3272,6 +3291,7 @@ GTK_SETTINGS_CLASS
GTK_SETTINGS_GET_CLASS GTK_SETTINGS_GET_CLASS
GTK_TYPE_SETTINGS GTK_TYPE_SETTINGS
<SUBSECTION Private> <SUBSECTION Private>
GtkSettingsPrivate
gtk_settings_get_type gtk_settings_get_type
GtkSettingsPropertyValue GtkSettingsPropertyValue
</SECTION> </SECTION>
@@ -3317,6 +3337,7 @@ GTK_SOCKET_CLASS
GTK_IS_SOCKET_CLASS GTK_IS_SOCKET_CLASS
GTK_SOCKET_GET_CLASS GTK_SOCKET_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
GtkSocketPrivate
gtk_socket_get_type gtk_socket_get_type
</SECTION> </SECTION>
@@ -4371,6 +4392,7 @@ gtk_tree_model_row_inserted
gtk_tree_model_row_has_child_toggled gtk_tree_model_row_has_child_toggled
gtk_tree_model_row_deleted gtk_tree_model_row_deleted
gtk_tree_model_rows_reordered gtk_tree_model_rows_reordered
gtk_tree_model_rows_reordered_with_length
<SUBSECTION Standard> <SUBSECTION Standard>
GTK_TREE_MODEL GTK_TREE_MODEL
GTK_IS_TREE_MODEL GTK_IS_TREE_MODEL
@@ -4407,6 +4429,7 @@ GTK_TREE_MODEL_SORT_CLASS
GTK_IS_TREE_MODEL_SORT_CLASS GTK_IS_TREE_MODEL_SORT_CLASS
GTK_TREE_MODEL_SORT_GET_CLASS GTK_TREE_MODEL_SORT_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
GtkTreeModelSortPrivate
gtk_tree_model_sort_get_type gtk_tree_model_sort_get_type
</SECTION> </SECTION>
@@ -4474,6 +4497,7 @@ GTK_TREE_SELECTION_CLASS
GTK_TREE_SELECTION_GET_CLASS GTK_TREE_SELECTION_GET_CLASS
GTK_IS_TREE_SELECTION_CLASS GTK_IS_TREE_SELECTION_CLASS
<SUBSECTION Private> <SUBSECTION Private>
GtkTreeSelectionPrivate
gtk_tree_selection_get_type gtk_tree_selection_get_type
</SECTION> </SECTION>
@@ -4564,6 +4588,7 @@ GTK_TREE_STORE_CLASS
GTK_IS_TREE_STORE_CLASS GTK_IS_TREE_STORE_CLASS
GTK_TREE_STORE_GET_CLASS GTK_TREE_STORE_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
GtkTreeStorePrivate
gtk_tree_store_get_type gtk_tree_store_get_type
</SECTION> </SECTION>
@@ -4634,6 +4659,7 @@ GTK_TREE_VIEW_COLUMN_CLASS
GTK_IS_TREE_VIEW_COLUMN_CLASS GTK_IS_TREE_VIEW_COLUMN_CLASS
GTK_TREE_VIEW_COLUMN_GET_CLASS GTK_TREE_VIEW_COLUMN_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
GtkTreeViewColumnPrivate
gtk_tree_view_column_get_type gtk_tree_view_column_get_type
</SECTION> </SECTION>
@@ -4849,6 +4875,7 @@ gtk_cell_area_get_current_path_string
gtk_cell_area_apply_attributes gtk_cell_area_apply_attributes
gtk_cell_area_attribute_connect gtk_cell_area_attribute_connect
gtk_cell_area_attribute_disconnect gtk_cell_area_attribute_disconnect
gtk_cell_area_attribute_get_column
gtk_cell_area_class_install_cell_property gtk_cell_area_class_install_cell_property
gtk_cell_area_class_find_cell_property gtk_cell_area_class_find_cell_property
gtk_cell_area_class_list_cell_properties gtk_cell_area_class_list_cell_properties
@@ -4986,6 +5013,7 @@ GTK_IS_CELL_RENDERER_CLASS
GTK_CELL_RENDERER_GET_CLASS GTK_CELL_RENDERER_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
GtkCellRendererPrivate GtkCellRendererPrivate
GtkCellRendererClassPrivate
gtk_cell_renderer_get_type gtk_cell_renderer_get_type
gtk_cell_renderer_mode_get_type gtk_cell_renderer_mode_get_type
gtk_cell_renderer_state_get_type gtk_cell_renderer_state_get_type
@@ -5624,6 +5652,7 @@ GTK_IS_WIDGET_CLASS
GTK_WIDGET_GET_CLASS GTK_WIDGET_GET_CLASS
GTK_TYPE_REQUISITION GTK_TYPE_REQUISITION
<SUBSECTION Private> <SUBSECTION Private>
GtkWidgetClassPrivate
GtkWidgetPrivate GtkWidgetPrivate
gtk_widget_get_type gtk_widget_get_type
gtk_requisition_get_type gtk_requisition_get_type
@@ -5791,6 +5820,7 @@ GTK_WINDOW_GROUP
GTK_WINDOW_GROUP_CLASS GTK_WINDOW_GROUP_CLASS
GTK_WINDOW_GROUP_GET_CLASS GTK_WINDOW_GROUP_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
GtkWindowGroupPrivate
gtk_window_group_get_type gtk_window_group_get_type
</SECTION> </SECTION>
@@ -5859,6 +5889,11 @@ gtk_get_micro_version
gtk_get_binary_age gtk_get_binary_age
gtk_get_interface_age gtk_get_interface_age
gtk_check_version gtk_check_version
gtk_major_version
gtk_minor_version
gtk_micro_version
gtk_binary_age
gtk_interface_age
<SUBSECTION> <SUBSECTION>
GTK_MAJOR_VERSION GTK_MAJOR_VERSION
@@ -5966,6 +6001,7 @@ GTK_STYLE_PROPERTIES
GTK_STYLE_PROPERTIES_CLASS GTK_STYLE_PROPERTIES_CLASS
GTK_STYLE_PROPERTIES_GET_CLASS GTK_STYLE_PROPERTIES_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
GtkStylePropertiesPrivate
gtk_style_properties_get_type gtk_style_properties_get_type
</SECTION> </SECTION>
@@ -5993,6 +6029,7 @@ GTK_STYLE_CLASS_BUTTON
GTK_STYLE_CLASS_CALENDAR GTK_STYLE_CLASS_CALENDAR
GTK_STYLE_CLASS_CELL GTK_STYLE_CLASS_CELL
GTK_STYLE_CLASS_COMBOBOX_ENTRY GTK_STYLE_CLASS_COMBOBOX_ENTRY
GTK_STYLE_CLASS_CONTEXT_MENU
GTK_STYLE_CLASS_CHECK GTK_STYLE_CLASS_CHECK
GTK_STYLE_CLASS_CSD GTK_STYLE_CLASS_CSD
GTK_STYLE_CLASS_CURSOR_HANDLE GTK_STYLE_CLASS_CURSOR_HANDLE
@@ -6033,12 +6070,14 @@ GTK_STYLE_CLASS_OVERSHOOT
GTK_STYLE_CLASS_PANE_SEPARATOR GTK_STYLE_CLASS_PANE_SEPARATOR
GTK_STYLE_CLASS_PAPER GTK_STYLE_CLASS_PAPER
GTK_STYLE_CLASS_POPUP GTK_STYLE_CLASS_POPUP
GTK_STYLE_CLASS_POPOVER
GTK_STYLE_CLASS_PRIMARY_TOOLBAR GTK_STYLE_CLASS_PRIMARY_TOOLBAR
GTK_STYLE_CLASS_PROGRESSBAR GTK_STYLE_CLASS_PROGRESSBAR
GTK_STYLE_CLASS_PULSE GTK_STYLE_CLASS_PULSE
GTK_STYLE_CLASS_QUESTION GTK_STYLE_CLASS_QUESTION
GTK_STYLE_CLASS_RADIO GTK_STYLE_CLASS_RADIO
GTK_STYLE_CLASS_RAISED GTK_STYLE_CLASS_RAISED
GTK_STYLE_CLASS_READ_ONLY
GTK_STYLE_CLASS_RIGHT GTK_STYLE_CLASS_RIGHT
GTK_STYLE_CLASS_RUBBERBAND GTK_STYLE_CLASS_RUBBERBAND
GTK_STYLE_CLASS_SCALE GTK_STYLE_CLASS_SCALE
@@ -6058,6 +6097,7 @@ GTK_STYLE_CLASS_TITLE
GTK_STYLE_CLASS_TITLEBAR GTK_STYLE_CLASS_TITLEBAR
GTK_STYLE_CLASS_TOOLBAR GTK_STYLE_CLASS_TOOLBAR
GTK_STYLE_CLASS_TOOLTIP GTK_STYLE_CLASS_TOOLTIP
GTK_STYLE_CLASS_TOUCH_SELECTION
GTK_STYLE_CLASS_TOP GTK_STYLE_CLASS_TOP
GTK_STYLE_CLASS_TROUGH GTK_STYLE_CLASS_TROUGH
GTK_STYLE_CLASS_UNDERSHOOT GTK_STYLE_CLASS_UNDERSHOOT
@@ -6166,6 +6206,7 @@ GTK_IS_STYLE_CONTEXT_CLASS
GTK_TYPE_BORDER GTK_TYPE_BORDER
<SUBSECTION Private> <SUBSECTION Private>
GtkStyleContextPrivate
gtk_style_context_get_type gtk_style_context_get_type
gtk_border_get_type gtk_border_get_type
</SECTION> </SECTION>
@@ -6204,6 +6245,8 @@ GTK_CSS_PROVIDER_GET_CLASS
GTK_IS_CSS_PROVIDER GTK_IS_CSS_PROVIDER
GTK_IS_CSS_PROVIDER_CLASS GTK_IS_CSS_PROVIDER_CLASS
<SUBSECTION Private> <SUBSECTION Private>
GTK_TYPE_CSS_SECTION
GtkCssProviderPrivate
gtk_css_provider_get_type gtk_css_provider_get_type
gtk_css_provider_error_quark gtk_css_provider_error_quark
gtk_css_section_get_type gtk_css_section_get_type
@@ -6475,6 +6518,7 @@ GtkClipboardClearFunc
gtk_clipboard_get gtk_clipboard_get
gtk_clipboard_get_for_display gtk_clipboard_get_for_display
gtk_clipboard_get_display gtk_clipboard_get_display
gtk_clipboard_get_default
gtk_clipboard_set_with_data gtk_clipboard_set_with_data
gtk_clipboard_set_with_owner gtk_clipboard_set_with_owner
gtk_clipboard_get_owner gtk_clipboard_get_owner
@@ -6534,6 +6578,7 @@ gtk_drag_unhighlight
<SUBSECTION Source Side> <SUBSECTION Source Side>
gtk_drag_begin gtk_drag_begin
gtk_drag_begin_with_coordinates gtk_drag_begin_with_coordinates
gtk_drag_cancel
gtk_drag_set_icon_widget gtk_drag_set_icon_widget
gtk_drag_set_icon_pixbuf gtk_drag_set_icon_pixbuf
gtk_drag_set_icon_stock gtk_drag_set_icon_stock
@@ -6715,6 +6760,8 @@ GTK_STOCK_ZOOM_100
GTK_STOCK_ZOOM_FIT GTK_STOCK_ZOOM_FIT
GTK_STOCK_ZOOM_IN GTK_STOCK_ZOOM_IN
GTK_STOCK_ZOOM_OUT GTK_STOCK_ZOOM_OUT
<SUBSECTION Private>
GtkStock
</SECTION> </SECTION>
<SECTION> <SECTION>
@@ -6776,6 +6823,7 @@ gtk_icon_info_get_attach_points
gtk_icon_info_get_display_name gtk_icon_info_get_display_name
gtk_icon_info_is_symbolic gtk_icon_info_is_symbolic
<SUBSECTION Standard> <SUBSECTION Standard>
GtkIconInfoClass
GTK_ICON_THEME GTK_ICON_THEME
GTK_IS_ICON_THEME GTK_IS_ICON_THEME
GTK_TYPE_ICON_THEME GTK_TYPE_ICON_THEME
@@ -6785,6 +6833,11 @@ GTK_IS_ICON_THEME_CLASS
GTK_ICON_THEME_GET_CLASS GTK_ICON_THEME_GET_CLASS
gtk_icon_info_get_type gtk_icon_info_get_type
GTK_TYPE_ICON_INFO GTK_TYPE_ICON_INFO
GTK_ICON_INFO
GTK_ICON_INFO_CLASS
GTK_ICON_INFO_GET_CLASS
GTK_IS_ICON_INFO
GTK_IS_ICON_INFO_CLASS
<SUBSECTION Private> <SUBSECTION Private>
GtkIconThemePrivate GtkIconThemePrivate
gtk_icon_theme_error_quark gtk_icon_theme_error_quark
@@ -7149,6 +7202,7 @@ gtk_print_settings_get_type
<TITLE>GtkPaperSize</TITLE> <TITLE>GtkPaperSize</TITLE>
GtkPaperSize GtkPaperSize
GtkUnit GtkUnit
GTK_UNIT_PIXEL
GTK_PAPER_NAME_A3 GTK_PAPER_NAME_A3
GTK_PAPER_NAME_A4 GTK_PAPER_NAME_A4
GTK_PAPER_NAME_A5 GTK_PAPER_NAME_A5
@@ -7803,6 +7857,7 @@ GTK_IS_ACTION_BAR_CLASS
GTK_ACTION_BAR_GET_CLASS GTK_ACTION_BAR_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
GtkActionBarPrivate
gtk_action_bar_get_type gtk_action_bar_get_type
</SECTION> </SECTION>
@@ -7835,6 +7890,7 @@ GTK_IS_HEADER_BAR_CLASS
GTK_HEADER_BAR_GET_CLASS GTK_HEADER_BAR_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
GtkHeaderBarPrivate
gtk_header_bar_get_type gtk_header_bar_get_type
</SECTION> </SECTION>
@@ -7863,6 +7919,14 @@ GtkStackTransitionType
gtk_stack_set_transition_type gtk_stack_set_transition_type
gtk_stack_get_transition_type gtk_stack_get_transition_type
gtk_stack_get_transition_running gtk_stack_get_transition_running
<SUBSECTION Standard>
GTK_TYPE_STACK
GTK_IS_STACK
GTK_IS_STACK_CLASS
GTK_STACK
GTK_STACK_CLASS
GTK_STACK_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
gtk_stack_get_type gtk_stack_get_type
</SECTION> </SECTION>
@@ -7874,6 +7938,14 @@ GtkStackSwitcher
gtk_stack_switcher_new gtk_stack_switcher_new
gtk_stack_switcher_set_stack gtk_stack_switcher_set_stack
gtk_stack_switcher_get_stack gtk_stack_switcher_get_stack
<SUBSECTION Standard>
GTK_TYPE_STACK_SWITCHER
GTK_IS_STACK_SWITCHER
GTK_IS_STACK_SWITCHER_CLASS
GTK_STACK_SWITCHER
GTK_STACK_SWITCHER_CLASS
GTK_STACK_SWITCHER_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
gtk_stack_switcher_get_type gtk_stack_switcher_get_type
</SECTION> </SECTION>
@@ -7892,6 +7964,15 @@ gtk_revealer_set_transition_duration
GtkRevealerTransitionType GtkRevealerTransitionType
gtk_revealer_get_transition_type gtk_revealer_get_transition_type
gtk_revealer_set_transition_type gtk_revealer_set_transition_type
<SUBSECTION Standard>
GTK_TYPE_REVEALER
GTK_IS_REVEALER
GTK_IS_REVEALER_CLASS
GTK_REVEALER
GTK_REVEALER_CLASS
GTK_REVEALER_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
gtk_revealer_get_type gtk_revealer_get_type
</SECTION> </SECTION>
@@ -7943,6 +8024,24 @@ gtk_flow_box_child_new
gtk_flow_box_child_get_index gtk_flow_box_child_get_index
gtk_flow_box_child_is_selected gtk_flow_box_child_is_selected
gtk_flow_box_child_changed gtk_flow_box_child_changed
<SUBSECTION Standard>
GtkFlowBoxChildClass
GTK_TYPE_FLOW_BOX
GTK_TYPE_FLOW_BOX_CHILD
GTK_FLOW_BOX
GTK_FLOW_BOX_CLASS
GTK_FLOW_BOX_GET_CLASS
GTK_IS_FLOW_BOX
GTK_IS_FLOW_BOX_CLASS
GTK_FLOW_BOX_CHILD
GTK_FLOW_BOX_CHILD_CLASS
GTK_FLOW_BOX_CHILD_GET_CLASS
GTK_IS_FLOW_BOX_CHILD
GTK_IS_FLOW_BOX_CHILD_CLASS
<SUBSECTION Private>
gtk_flow_box_get_type
gtk_flow_box_child_get_type
</SECTION> </SECTION>
<SECTION> <SECTION>
@@ -7960,7 +8059,20 @@ gtk_popover_set_position
gtk_popover_get_position gtk_popover_get_position
gtk_popover_set_modal gtk_popover_set_modal
gtk_popover_get_modal gtk_popover_get_modal
gtk_popover_set_transitions_enabled
gtk_popover_get_transitions_enabled
<SUBSECTION Standard>
GTK_TYPE_POPOVER
GTK_IS_POPOVER
GTK_IS_POPOVER_CLASS
GTK_IS_POPOVER_MENU
GTK_IS_POPOVER_MENU_CLASS
GTK_POPOVER
GTK_POPOVER_CLASS
GTK_POPOVER_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
GtkPopoverPrivate
gtk_popover_get_type gtk_popover_get_type
</SECTION> </SECTION>
@@ -7970,6 +8082,15 @@ gtk_popover_get_type
GtkPopoverMenu GtkPopoverMenu
gtk_popover_menu_new gtk_popover_menu_new
gtk_popover_menu_open_submenu gtk_popover_menu_open_submenu
<SUBSECTION Standard>
GTK_TYPE_POPOVER_MENU
GTK_IS_POPOVER_MENU
GTK_IS_POPOVER_MENU_CLASS
GTK_POPOVER_MENU
GTK_POPOVER_MENU_CLASS
GTK_POPOVER_MENU_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
gtk_popover_menu_get_type gtk_popover_menu_get_type
</SECTION> </SECTION>
@@ -7980,6 +8101,12 @@ gtk_popover_menu_get_type
GtkModelButton GtkModelButton
GtkButtonRole GtkButtonRole
gtk_model_button_new gtk_model_button_new
<SUBSECTION Standard>
GTK_TYPE_MODEL_BUTTON
GTK_MODEL_BUTTON
GTK_IS_MODEL_BUTTON
<SUBSECTION Private>
gtk_model_button_get_type
</SECTION> </SECTION>
<SECTION> <SECTION>
@@ -7999,6 +8126,7 @@ GTK_EVENT_CONTROLLER
GTK_EVENT_CONTROLLER_CLASS GTK_EVENT_CONTROLLER_CLASS
GTK_IS_EVENT_CONTROLLER GTK_IS_EVENT_CONTROLLER
GTK_EVENT_CONTROLLER_GET_CLASS GTK_EVENT_CONTROLLER_GET_CLASS
GTK_IS_EVENT_CONTROLLER_CLASS
<SUBSECTION Private> <SUBSECTION Private>
GtkEventControllerPriv GtkEventControllerPriv
@@ -8208,24 +8336,24 @@ gtk_gesture_zoom_get_type
</SECTION> </SECTION>
<SECTION> <SECTION>
<FILE>gtksidebar</FILE> <FILE>gtkstacksidebar</FILE>
GtkSidebar GtkStackSidebar
GtkSidebarClass GtkStackSidebarClass
gtk_sidebar_new gtk_stack_sidebar_new
gtk_sidebar_set_stack gtk_stack_sidebar_set_stack
gtk_sidebar_get_stack gtk_stack_sidebar_get_stack
<SUBSECTION Standard> <SUBSECTION Standard>
GTK_TYPE_SIDEBAR GTK_TYPE_STACK_SIDEBAR
GTK_SIDEBAR GTK_STACK_SIDEBAR
GTK_SIDEBAR_CLASS GTK_STACK_SIDEBAR_CLASS
GTK_IS_SIDEBAR GTK_IS_STACK_SIDEBAR
GTK_IS_SIDEBAR_CLASS GTK_IS_STACK_SIDEBAR_CLASS
GTK_SIDEBAR_GET_CLASS GTK_STACK_SIDEBAR_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
GtkSidebarPrivate GtkStackSidebarPrivate
gtk_sidebar_get_type gtk_stack_sidebar_get_type
</SECTION> </SECTION>
<SECTION> <SECTION>
@@ -8236,10 +8364,9 @@ gtk_gl_area_new
gtk_gl_area_get_context gtk_gl_area_get_context
gtk_gl_area_make_current gtk_gl_area_make_current
gtk_gl_area_queue_render gtk_gl_area_queue_render
gtk_gl_area_attach_buffers
gtk_gl_area_set_error gtk_gl_area_set_error
gtk_gl_area_get_error gtk_gl_area_get_error
gtk_gl_area_set_profile
gtk_gl_area_get_profile
<SUBSECTION> <SUBSECTION>
gtk_gl_area_set_has_alpha gtk_gl_area_set_has_alpha
gtk_gl_area_get_has_alpha gtk_gl_area_get_has_alpha
@@ -8249,10 +8376,13 @@ gtk_gl_area_set_has_stencil_buffer
gtk_gl_area_get_has_stencil_buffer gtk_gl_area_get_has_stencil_buffer
gtk_gl_area_set_auto_render gtk_gl_area_set_auto_render
gtk_gl_area_get_auto_render gtk_gl_area_get_auto_render
gtk_gl_area_get_required_version
gtk_gl_area_set_required_version
<SUBSECTION Standard> <SUBSECTION Standard>
GTK_TYPE_GL_AREA GTK_TYPE_GL_AREA
GTK_GL_AREA GTK_GL_AREA
GTK_GL_AREA_CLASS GTK_GL_AREA_CLASS
GTK_GL_AREA_GET_CLASS
GTK_IS_GL_AREA GTK_IS_GL_AREA
GTK_IS_GL_AREA_CLASS GTK_IS_GL_AREA_CLASS
<SUBSECTION Private> <SUBSECTION Private>

View File

@@ -173,7 +173,7 @@ gtk_separator_get_type
gtk_separator_menu_item_get_type gtk_separator_menu_item_get_type
gtk_separator_tool_item_get_type gtk_separator_tool_item_get_type
gtk_settings_get_type gtk_settings_get_type
gtk_sidebar_get_type gtk_stack_sidebar_get_type
gtk_size_group_get_type gtk_size_group_get_type
@ENABLE_ON_X11@gtk_socket_get_type @ENABLE_ON_X11@gtk_socket_get_type
gtk_spin_button_get_type gtk_spin_button_get_type

View File

@@ -4,21 +4,21 @@
]> ]>
<refentry id="chap-input-handling"> <refentry id="chap-input-handling">
<refmeta> <refmeta>
<refentrytitle>The GTK+ Input Handling Model</refentrytitle> <refentrytitle>The GTK+ Input and Event Handling Model</refentrytitle>
<manvolnum>3</manvolnum> <manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo> <refmiscinfo>GTK Library</refmiscinfo>
</refmeta> </refmeta>
<refnamediv> <refnamediv>
<refname>The GTK+ Input Handling Model</refname> <refname>The GTK+ Input and Event Handling Model</refname>
<refpurpose> <refpurpose>
GTK+ input handling in detail GTK+ input and event handling in detail
</refpurpose> </refpurpose>
</refnamediv> </refnamediv>
<refsect1 id="input-overview"> <refsect1 id="input-overview">
<title>Overview of GTK+ input handling</title> <title>Overview of GTK+ input and event handling</title>
<para> <para>
This chapter describes in detail how GTK+ handles input. If you are interested This chapter describes in detail how GTK+ handles input. If you are interested
@@ -64,20 +64,20 @@
GDK translates these raw windowing system events into #GdkEvents. GDK translates these raw windowing system events into #GdkEvents.
Typical input events are: Typical input events are:
<simplelist> <simplelist>
<member>GdkEventButton</member> <member>#GdkEventButton</member>
<member>GdkEventMotion</member> <member>#GdkEventMotion</member>
<member>GdkEventCrossing</member> <member>#GdkEventCrossing</member>
<member>GdkEventKey</member> <member>#GdkEventKey</member>
<member>GdkEventFocus</member> <member>#GdkEventFocus</member>
<member>GdkEventTouch</member> <member>#GdkEventTouch</member>
</simplelist> </simplelist>
</para> </para>
<para> <para>
Additionally, GDK/GTK synthesizes other signals to let know whether Additionally, GDK/GTK synthesizes other signals to let know whether
grabs (system-wide or in-app) are taking input away: grabs (system-wide or in-app) are taking input away:
<simplelist> <simplelist>
<member>GdkEventGrabBroken</member> <member>#GdkEventGrabBroken</member>
<member>GtkWidget::grab-notify</member> <member>#GtkWidget::grab-notify</member>
</simplelist> </simplelist>
</para> </para>
<para> <para>
@@ -87,80 +87,167 @@
</para> </para>
</refsect2> </refsect2>
<refsect2> <refsect2 id="event-propagation">
<title>Event propagation</title> <title>Event propagation</title>
<para> <para>
When GTK+ receives an event, it determines the target widget that For widgets which have a #GdkWindow set, events are received from the
it is directed to. Unless grabs are involved, this is done by finding windowing system and passed to gtk_main_do_event(). See its documentation
the widget to which the window of the event belongs. for details of what it does: compression of enter/leave events,
identification of the widget receiving the event, pushing the event onto a
stack for gtk_get_current_event(), and propagating the event to the
widget.
</para> </para>
<para> <para>
The event is then propagated from the toplevel window down to the When a GDK backend produces an input event, it is tied to a #GdkDevice and
target widget. In this phase, which is known as the “capture” phase, a #GdkWindow, which in turn represents a windowing system surface in the
gestures that are attached with GTK_PHASE_CAPTURE get a chance backend. If a widget has grabbed the current input device, or all input
to react to the event. devices, the event is propagated to that #GtkWidget. Otherwise, it is
propagated to the the #GtkWidget which called gtk_widget_register_window()
on the #GdkWindow receiving the event.
</para>
<para>
Grabs are implemented for each input device, and globally. A grab for a
specific input device (gtk_device_grab_add()), is sent events in
preference to a global grab (gtk_grab_add()). Input grabs only have effect
within the #GtkWindowGroup containing the #GtkWidget which registered the
events #GdkWindow. If this #GtkWidget is a child of the grab widget, the
event is propagated to the child — this is the basis for propagating
events within modal dialogs.
</para>
<para>
An event is propagated to a widget using gtk_propagate_event().
Propagation differs between event types: key events (%GDK_KEY_PRESS,
%GDK_KEY_RELEASE) are delivered to the top-level #GtkWindow; other events
are propagated down and up the widget hierarchy in three phases (see
#GtkPropagationPhase).
</para>
<para>
For key events, the top-level windows default #GtkWindow::key-press-event
and #GtkWindow::key-release-event signal handlers handle mnemonics and
accelerators first. Other key presses are then passed to
gtk_window_propagate_key_event() which propagates the event upwards from
the windows current focus widget (gtk_window_get_focus()) to the
top-level.
</para>
<para>
For other events, in the first phase (the “capture” phase) the event is
delivered to each widget from the top-most (for example, the top-level
#GtkWindow or grab widget) down to the target #GtkWidget.
<link linkend="event-controllers-and-gestures">Gestures</link> that are
attached with %GTK_PHASE_CAPTURE get a chance to react to the event.
</para> </para>
<para> <para>
After the “capture” phase, the widget that was intended to be the After the “capture” phase, the widget that was intended to be the
destination of the event will let run gestures attached to it with destination of the event will run gestures attached to it with
GTK_PHASE_TARGET. This is known as the “target” phase, and does only %GTK_PHASE_TARGET. This is known as the “target” phase, and only
happen on that widget. happens on that widget.
</para> </para>
<para> <para>
Next, the appropriate event signal is emitted for the event in question, Next, the #GtkWidget::event signal is emitted, then the appropriate signal
e.g. “motion-notify-event”. Handling these signals was the primary for the event in question, for example #GtkWidget::motion-notify-event.
way to handle input in GTK+ widgets before gestures were introduced. Handling these signals was the primary way to handle input in GTK+ widgets
The signals are emitted from the target widget up to the toplevel, before gestures were introduced. If the widget is realized, the
until a signal handler indicates that it has handled the event, by #GtkWidget::event-after signal is emitted. The signals are emitted from
returning GDK_EVENT_STOP. the target widget up to the top-level, as part of the “bubble” phase.
</para> </para>
<para> <para>
The default handlers for the event signals send the event The default handlers for the event signals send the event
to gestures that are attached with GTK_PHASE_BUBBLE. Therefore, to gestures that are attached with %GTK_PHASE_BUBBLE. Therefore,
gestures in the “bubble” phase are only used if the widget does gestures in the “bubble” phase are only used if the widget does
not have its own event handlers, or takes care to chain up to the not have its own event handlers, or takes care to chain up to the
default GtkWidget handlers. default #GtkWidget handlers.
</para> </para>
<para> <para>
Anytime during the propagation phase, a widget may indicate that a Events are not delivered to a widget which is insensitive or unmapped.
</para>
<para>
Any time during the propagation phase, a widget may indicate that a
received event was consumed and propagation should therefore be stopped. received event was consumed and propagation should therefore be stopped.
In traditional event handlers, this is hinted by returning GDK_EVENT_STOP, In traditional event handlers, this is hinted by returning %GDK_EVENT_STOP.
if gestures are used, this may happen when the widget tells the gesture If gestures are used, this may happen when the widget tells the gesture
to claim the event touch sequence (or the pointer events) for its own. See the to claim the event touch sequence (or the pointer events) for its own. See the
"gesture states" section below to know more of the latter. "gesture states" section below to know more of the latter.
</para> </para>
</refsect2> </refsect2>
<refsect2 id="event-masks">
<title>Event masks</title>
<para>
Each widget instance has a basic event mask and another per input device,
which determine the types of input event it receives. Each event mask set
on a widget is added to the corresponding (basic or per-device) event mask
for the widgets #GdkWindow, and all child #GdkWindows.
</para>
<para>
If a widget is windowless (gtk_widget_get_has_window() returns %FALSE) and
an application wants to receive custom events on it, it must be placed
inside a #GtkEventBox to receive the events, and an appropriate event mask
must be set on the box. When implementing a widget, use a %GDK_INPUT_ONLY
#GdkWindow to receive the events instead.
</para>
<para>
Filtering events against event masks happens inside #GdkWindow, which
exposes event masks to the windowing system to reduce the number of events
GDK receives from it. On receiving an event, it is filtered against the
#GdkWindows mask for the input device, if set. Otherwise, it is filtered
against the #GdkWindows basic event mask.
</para>
<para>
This means that widgets must add to the event mask for each event type
they expect to receive, using gtk_widget_set_events() or
gtk_widget_add_events() to preserve the existing mask. Widgets which are
aware of floating devices should use gtk_widget_set_device_events() or
gtk_widget_add_device_events(), and must explicitly enable the device
using gtk_widget_set_device_enabled(). See the #GdkDeviceManager
documentation for more information.
</para>
<para>
All standard widgets set the event mask for all events they expect to
receive, and it is not necessary to modify this. Masks should be set when
implementing a new widget.
</para>
</refsect2>
<refsect2> <refsect2>
<title>Touch events</title> <title>Touch events</title>
<para> <para>
Touch events are emitted as events of type GDK_TOUCH_BEGIN, GDK_TOUCH_UPDATE or Touch events are emitted as events of type %GDK_TOUCH_BEGIN, %GDK_TOUCH_UPDATE or
GDK_TOUCH_END, those events contain an “event sequence” that univocally identifies %GDK_TOUCH_END, those events contain an “event sequence” that univocally identifies
the physical touch until it is lifted from the device. the physical touch until it is lifted from the device.
</para> </para>
<para> <para>
On some windowing platforms, multitouch devices perform pointer emulation, this works On some windowing platforms, multitouch devices perform pointer emulation, this works
by granting a “pointer emulating” hint to one of the currently interacting touch by granting a “pointer emulating” hint to one of the currently interacting touch
sequences, which will be reported on every GdkEventTouch event from that sequence. By sequences, which will be reported on every #GdkEventTouch event from that sequence. By
default, if a widget didn't request touch events by setting GDK_TOUCH_MASK on its default, if a widget didn't request touch events by setting %GDK_TOUCH_MASK on its
event mask and didn't override GtkWidget::touch-event, GTK+ will transform these event mask and didn't override #GtkWidget::touch-event, GTK+ will transform these
“pointer emulating” events into semantically similar GdkEventButton and GdkEventMotion “pointer emulating” events into semantically similar #GdkEventButton and #GdkEventMotion
events. Depending on GDK_TOUCH_MASK being in the event mask or not, non-pointer-emulating events. Depending on %GDK_TOUCH_MASK being in the event mask or not, non-pointer-emulating
sequences could still trigger gestures or just get filtered out, regardless of the widget sequences could still trigger gestures or just get filtered out, regardless of the widget
not handling those directly. not handling those directly.
</para> </para>
<para> <para>
If the widget sets GDK_TOUCH_MASK on its event mask and doesn't chain up on If the widget sets %GDK_TOUCH_MASK on its event mask and doesn't chain up on
GtkWidget::touch-event, only touch events will be received, and no pointer emulation #GtkWidget::touch-event, only touch events will be received, and no pointer emulation
will be performed. will be performed.
</para> </para>
</refsect2> </refsect2>
@@ -171,11 +258,11 @@
<para> <para>
Grabs are a method to claim all input events from a device, they happen Grabs are a method to claim all input events from a device, they happen
either implicitly on pointer and touch devices, or explicitly. Implicit grabs either implicitly on pointer and touch devices, or explicitly. Implicit grabs
happen on user interaction, when a GdkEventButtonPress happens, all events from happen on user interaction, when a #GdkEventButtonPress happens, all events from
then on, until after the corresponding GdkEventButtonRelease, will be reported then on, until after the corresponding #GdkEventButtonRelease, will be reported
to the widget that got the first event. Likewise, on touch events, every to the widget that got the first event. Likewise, on touch events, every
GdkEventSequence will deliver only events to the widget that received its #GdkEventSequence will deliver only events to the widget that received its
GDK_TOUCH_BEGIN event. %GDK_TOUCH_BEGIN event.
</para> </para>
<para> <para>
@@ -192,8 +279,8 @@
point somewhere else, even while the pointer/touch device is already grabbed. point somewhere else, even while the pointer/touch device is already grabbed.
This makes it necessary for widgets to handle the cancellation of any ongoing This makes it necessary for widgets to handle the cancellation of any ongoing
interaction. Depending on whether a GTK or GDK grab is causing this, the interaction. Depending on whether a GTK or GDK grab is causing this, the
widget will respectively receive a GtkWidget::grab-notify signal, or a widget will respectively receive a #GtkWidget::grab-notify signal, or a
GdkEventGrabBroken event. #GdkEventGrabBroken event.
</para> </para>
<para> <para>
@@ -209,12 +296,12 @@
<!-- mnemonics, accelerators, bindings --> <!-- mnemonics, accelerators, bindings -->
</refsect2> </refsect2>
<refsect2> <refsect2 id="event-controllers-and-gestures">
<title>Event controllers and gestures</title> <title>Event controllers and gestures</title>
<para> <para>
Event controllers are standalone objects that can perform specific actions Event controllers are standalone objects that can perform specific actions
upon received GdkEvents. These are tied to a GtkWidget, and can be told of upon received #GdkEvents. These are tied to a #GtkWidget, and can be told of
the event propagation phase at which they will manage the events. the event propagation phase at which they will manage the events.
</para> </para>
@@ -270,7 +357,7 @@
Alternatively, or at a later point in time, the widget may choose to deny the touch Alternatively, or at a later point in time, the widget may choose to deny the touch
sequences, thus letting those go through again in event propagation. When this happens sequences, thus letting those go through again in event propagation. When this happens
in the capture phase, and if there are no other claiming gestures in the widget, in the capture phase, and if there are no other claiming gestures in the widget,
a GDK_TOUCH_BEGIN/GDK_BUTTON_PRESS event will be emulated and a %GDK_TOUCH_BEGIN/%GDK_BUTTON_PRESS event will be emulated and
propagated downwards, in order to preserve consistency. propagated downwards, in order to preserve consistency.
</para> </para>

View File

@@ -83,7 +83,7 @@
widgets have been deprecated. These deprecations are clearly spelled widgets have been deprecated. These deprecations are clearly spelled
out in the API reference, with hints about the recommended replacements. out in the API reference, with hints about the recommended replacements.
The API reference for GTK+ 2 also includes an The API reference for GTK+ 2 also includes an
<ulink url="http://developer.gnome.org/gtk/2.24/api-index-deprecated.html">index</ulink> of all deprecated symbols. <ulink url="https://developer.gnome.org/gtk2/2.24/api-index-deprecated.html">index</ulink> of all deprecated symbols.
</para> </para>
<para> <para>
To verify that your program does not use any deprecated symbols, To verify that your program does not use any deprecated symbols,

View File

@@ -31,7 +31,7 @@ or environment variables.
<para> <para>
For up-to-date information about the current status of this port, see the For up-to-date information about the current status of this port, see the
<ulink url="http://live.gnome.org/GTK+/OSX">project page</ulink>. <ulink url="https://wiki.gnome.org/Projects/GTK+/OSX">project page</ulink>.
</para> </para>
</refsect1> </refsect1>

View File

@@ -36,7 +36,7 @@ some additional commandline options.
<para> <para>
A list of modules to load in addition to those specified in the A list of modules to load in addition to those specified in the
<envar>GTK_MODULES</envar> environment variable and the <envar>GTK3_MODULES</envar> environment variable and the
<literal>gtk-modules</literal> setting. <literal>gtk-modules</literal> setting.
</para> </para>
</formalpara> </formalpara>
@@ -223,14 +223,24 @@ additional environment variables.
</formalpara> </formalpara>
<formalpara> <formalpara>
<title><envar>GTK_MODULES</envar></title> <title><envar>GTK3_MODULES</envar></title>
<para> <para>
A list of modules to load. Note that GTK+ also allows to specify modules to load via a commandline option (<option>--gtk-module</option>) and with the <literal>gtk-modules</literal> setting. A list of modules to load. Note that GTK+ also allows to specify modules to load via a commandline option (<option>--gtk-module</option>) and with the <literal>gtk-modules</literal> setting.
</para> </para>
</formalpara>
<formalpara>
<title><envar>GTK_MODULES</envar></title>
<para>
A list of modules to load in addition to the ones in the <envar>GTK3_MODULES</envar> variable.
</para>
<warning> <warning>
Note that this environment variable is read by GTK+ 2.x too, Note that this environment variable is read by GTK+ 2.x too,
which may not have the same set of modules available for loading. which may not have the same set of modules available for loading.
Use <envar>GTK3_MODULES</envar> for modules that are only compatible
with GTK+ 3.
</warning> </warning>
</formalpara> </formalpara>

View File

@@ -144,7 +144,7 @@
<link linkend="GtkStackSwitcher"> <link linkend="GtkStackSwitcher">
<inlinegraphic fileref="stackswitcher.png" format="PNG"></inlinegraphic> <inlinegraphic fileref="stackswitcher.png" format="PNG"></inlinegraphic>
</link> </link>
<link linkend="GtkSidebar"> <link linkend="GtkStackSidebar">
<inlinegraphic fileref="sidebar.png" format="PNG"></inlinegraphic> <inlinegraphic fileref="sidebar.png" format="PNG"></inlinegraphic>
</link> </link>
<link linkend="GtkTreeView"> <link linkend="GtkTreeView">

View File

@@ -110,7 +110,7 @@ in 256 color mode.
<para> <para>
More information about GTK+ on Windows, including detailed build More information about GTK+ on Windows, including detailed build
instructions, binary downloads, etc, can be found instructions, binary downloads, etc, can be found
<ulink url="http://live.gnome.org/GTK+/Win32">online</ulink>. <ulink url="https://wiki.gnome.org/Projects/GTK+/Win32">online</ulink>.
</para> </para>
</refsect1> </refsect1>

View File

@@ -1407,8 +1407,8 @@ create_sidebar (void)
gtk_widget_show (view); gtk_widget_show (view);
gtk_stack_add_titled (GTK_STACK (stack), view, "page2", "Page 2"); gtk_stack_add_titled (GTK_STACK (stack), view, "page2", "Page 2");
sidebar = gtk_sidebar_new (); sidebar = gtk_stack_sidebar_new ();
gtk_sidebar_set_stack (GTK_SIDEBAR (sidebar), GTK_STACK (stack)); gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR (sidebar), GTK_STACK (stack));
frame = gtk_frame_new (NULL); frame = gtk_frame_new (NULL);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);

View File

@@ -11,12 +11,14 @@
<section> <section>
<item> <item>
<attribute name='label' translatable='yes'>_About Bloatpad</attribute> <attribute name='label' translatable='yes'>_About Bloatpad</attribute>
<attribute name='hidden-when'>macos-menubar</attribute>
<attribute name='action'>app.about</attribute> <attribute name='action'>app.about</attribute>
</item> </item>
</section> </section>
<section> <section>
<item> <item>
<attribute name='label' translatable='yes'>_Quit</attribute> <attribute name='label' translatable='yes'>_Quit</attribute>
<attribute name='hidden-when'>macos-menubar</attribute>
<attribute name='action'>app.quit</attribute> <attribute name='action'>app.quit</attribute>
</item> </item>
</section> </section>

View File

@@ -129,17 +129,15 @@ close_window (void)
gtk_main_quit (); gtk_main_quit ();
} }
int static void
main (int argc, activate (GtkApplication *app,
char *argv[]) gpointer user_data)
{ {
GtkWidget *window; GtkWidget *window;
GtkWidget *frame; GtkWidget *frame;
GtkWidget *da; GtkWidget *drawing_area;
gtk_init (&argc, &argv); window = gtk_application_window_new (app);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Drawing Area"); gtk_window_set_title (GTK_WINDOW (window), "Drawing Area");
g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL); g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL);
@@ -150,35 +148,46 @@ main (int argc,
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_container_add (GTK_CONTAINER (window), frame); gtk_container_add (GTK_CONTAINER (window), frame);
da = gtk_drawing_area_new (); drawing_area = gtk_drawing_area_new ();
/* set a minimum size */ /* set a minimum size */
gtk_widget_set_size_request (da, 100, 100); gtk_widget_set_size_request (drawing_area, 100, 100);
gtk_container_add (GTK_CONTAINER (frame), da); gtk_container_add (GTK_CONTAINER (frame), drawing_area);
/* Signals used to handle the backing surface */ /* Signals used to handle the backing surface */
g_signal_connect (da, "draw", g_signal_connect (drawing_area, "draw",
G_CALLBACK (draw_cb), NULL); G_CALLBACK (draw_cb), NULL);
g_signal_connect (da,"configure-event", g_signal_connect (drawing_area,"configure-event",
G_CALLBACK (configure_event_cb), NULL); G_CALLBACK (configure_event_cb), NULL);
/* Event signals */ /* Event signals */
g_signal_connect (da, "motion-notify-event", g_signal_connect (drawing_area, "motion-notify-event",
G_CALLBACK (motion_notify_event_cb), NULL); G_CALLBACK (motion_notify_event_cb), NULL);
g_signal_connect (da, "button-press-event", g_signal_connect (drawing_area, "button-press-event",
G_CALLBACK (button_press_event_cb), NULL); G_CALLBACK (button_press_event_cb), NULL);
/* Ask to receive events the drawing area doesn't normally /* Ask to receive events the drawing area doesn't normally
* subscribe to. In particular, we need to ask for the * subscribe to. In particular, we need to ask for the
* button press and motion notify events that want to handle. * button press and motion notify events that want to handle.
*/ */
gtk_widget_set_events (da, gtk_widget_get_events (da) gtk_widget_set_events (drawing_area, gtk_widget_get_events (drawing_area)
| GDK_BUTTON_PRESS_MASK | GDK_BUTTON_PRESS_MASK
| GDK_POINTER_MOTION_MASK); | GDK_POINTER_MOTION_MASK);
gtk_widget_show_all (window); gtk_widget_show_all (window);
}
gtk_main ();
int
return 0; main (int argc,
char **argv)
{
GtkApplication *app;
int status;
app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
status = g_application_run (G_APPLICATION (app), argc, argv);
g_object_unref (app);
return status;
} }

View File

@@ -7,23 +7,17 @@ print_hello (GtkWidget *widget,
g_print ("Hello World\n"); g_print ("Hello World\n");
} }
int static void
main (int argc, activate (GtkApplication *app,
char *argv[]) gpointer user_data)
{ {
GtkWidget *window; GtkWidget *window;
GtkWidget *grid; GtkWidget *grid;
GtkWidget *button; GtkWidget *button;
/* This is called in all GTK applications. Arguments are parsed
* from the command line and are returned to the application.
*/
gtk_init (&argc, &argv);
/* create a new window, and set its title */ /* create a new window, and set its title */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL); window = gtk_application_window_new (app);
gtk_window_set_title (GTK_WINDOW (window), "Grid"); gtk_window_set_title (GTK_WINDOW (window), "Window");
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
gtk_container_set_border_width (GTK_CONTAINER (window), 10); gtk_container_set_border_width (GTK_CONTAINER (window), 10);
/* Here we construct the container that is going pack our buttons */ /* Here we construct the container that is going pack our buttons */
@@ -49,7 +43,7 @@ main (int argc,
gtk_grid_attach (GTK_GRID (grid), button, 1, 0, 1, 1); gtk_grid_attach (GTK_GRID (grid), button, 1, 0, 1, 1);
button = gtk_button_new_with_label ("Quit"); button = gtk_button_new_with_label ("Quit");
g_signal_connect (button, "clicked", G_CALLBACK (gtk_main_quit), NULL); g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
/* Place the Quit button in the grid cell (0, 1), and make it /* Place the Quit button in the grid cell (0, 1), and make it
* span 2 columns. * span 2 columns.
@@ -63,11 +57,19 @@ main (int argc,
*/ */
gtk_widget_show_all (window); gtk_widget_show_all (window);
/* All GTK applications must have a gtk_main(). Control ends here }
* and waits for an event to occur (like a key press or a mouse event),
* until gtk_main_quit() is called. int
*/ main (int argc,
gtk_main (); char **argv)
{
return 0; GtkApplication *app;
int status;
app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
status = g_application_run (G_APPLICATION (app), argc, argv);
g_object_unref (app);
return status;
} }

View File

@@ -1,8 +1,5 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
/* This is a callback function. The data arguments are ignored
* in this example. More on callbacks below.
*/
static void static void
print_hello (GtkWidget *widget, print_hello (GtkWidget *widget,
gpointer data) gpointer data)
@@ -10,95 +7,40 @@ print_hello (GtkWidget *widget,
g_print ("Hello World\n"); g_print ("Hello World\n");
} }
static gboolean static void
on_delete_event (GtkWidget *widget, activate (GtkApplication *app,
GdkEvent *event, gpointer user_data)
gpointer data)
{ {
/* If you return FALSE in the "delete_event" signal handler, GtkWidget *window;
* GTK will emit the "destroy" signal. Returning TRUE means GtkWidget *button;
* you don't want the window to be destroyed. GtkWidget *button_box;
*
* This is useful for popping up 'are you sure you want to quit?'
* type dialogs.
*/
g_print ("delete event occurred\n"); window = gtk_application_window_new (app);
gtk_window_set_title (GTK_WINDOW (window), "Window");
gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);
return TRUE; button_box = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
gtk_container_add (GTK_CONTAINER (window), button_box);
button = gtk_button_new_with_label ("Hello World");
g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
gtk_container_add (GTK_CONTAINER (button_box), button);
gtk_widget_show_all (window);
} }
int int
main (int argc, main (int argc,
char *argv[]) char **argv)
{ {
/* GtkWidget is the storage type for widgets */ GtkApplication *app;
GtkWidget *window; int status;
GtkWidget *button;
/* This is called in all GTK applications. Arguments are parsed app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
* from the command line and are returned to the application. g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
*/ status = g_application_run (G_APPLICATION (app), argc, argv);
gtk_init (&argc, &argv); g_object_unref (app);
/* create a new window, and set its title */ return status;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Hello");
/* When the window emits the "delete-event" signal (which is emitted
* by GTK+ in response to an event coming from the window manager,
* usually as a result of clicking the "close" window control), we
* ask it to call the on_delete_event() function as defined above.
*
* The data passed to the callback function is NULL and is ignored
* in the callback function.
*/
g_signal_connect (window, "delete-event", G_CALLBACK (on_delete_event), NULL);
/* Here we connect the "destroy" event to the gtk_main_quit() function.
*
* This signal is emitted when we call gtk_widget_destroy() on the window,
* or if we return FALSE in the "delete_event" callback.
*/
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
/* Sets the border width of the window. */
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
/* Creates a new button with the label "Hello World". */
button = gtk_button_new_with_label ("Hello World");
/* When the button receives the "clicked" signal, it will call the
* function print_hello() passing it NULL as its argument.
*
* The print_hello() function is defined above.
*/
g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
/* The g_signal_connect_swapped() function will connect the "clicked" signal
* of the button to the gtk_widget_destroy() function; instead of calling it
* using the button as its argument, it will swap it with the user data
* argument. This will cause the window to be destroyed by calling
* gtk_widget_destroy() on the window.
*/
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
/* This packs the button into the window. A GtkWindow inherits from GtkBin,
* which is a special container that can only have one child
*/
gtk_container_add (GTK_CONTAINER (window), button);
/* The final step is to display this newly created widget... */
gtk_widget_show (button);
/* ... and the window */
gtk_widget_show (window);
/* All GTK applications must have a gtk_main(). Control ends here
* and waits for an event to occur (like a key press or a mouse event),
* until gtk_main_quit() is called.
*/
gtk_main ();
return 0;
} }

View File

@@ -267,16 +267,19 @@ disable_plugin (const gchar *name)
plugin_menu = find_plugin_menu (); plugin_menu = find_plugin_menu ();
if (plugin_menu) if (plugin_menu)
{ {
const gchar *id;
gint i; gint i;
for (i = 0; i < g_menu_model_get_n_items (plugin_menu); i++) for (i = 0; i < g_menu_model_get_n_items (plugin_menu); i++)
{ {
if (g_menu_model_get_item_attribute (plugin_menu, i, "id", "s", &id) && gchar *id;
g_strcmp0 (id, name) == 0) if (g_menu_model_get_item_attribute (plugin_menu, i, "id", "s", &id))
{ {
g_menu_remove (G_MENU (plugin_menu), i); if (g_strcmp0 (id, name) == 0)
g_print ("Menus of '%s' plugin removed\n", name); {
g_menu_remove (G_MENU (plugin_menu), i);
g_print ("Menus of '%s' plugin removed\n", name);
}
g_free (id);
} }
} }
} }
@@ -356,7 +359,7 @@ configure_plugins (GSimpleAction *action,
{ {
g_warning ("%s", error->message); g_warning ("%s", error->message);
g_error_free (error); g_error_free (error);
return; goto out;
} }
dialog = (GtkWidget *)gtk_builder_get_object (builder, "plugin-dialog"); dialog = (GtkWidget *)gtk_builder_get_object (builder, "plugin-dialog");
@@ -370,6 +373,9 @@ configure_plugins (GSimpleAction *action,
g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
gtk_window_present (GTK_WINDOW (dialog)); gtk_window_present (GTK_WINDOW (dialog));
out:
g_object_unref (builder);
} }
static GActionEntry app_entries[] = { static GActionEntry app_entries[] = {

View File

@@ -1,21 +1,28 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
int static void
main (int argc, activate (GtkApplication* app,
char *argv[]) gpointer user_data)
{ {
GtkWidget *window; GtkWidget *window;
gtk_init (&argc, &argv); window = gtk_application_window_new (app);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Window"); gtk_window_set_title (GTK_WINDOW (window), "Window");
gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL); gtk_widget_show_all (window);
}
gtk_widget_show (window);
int
gtk_main (); main (int argc,
char **argv)
return 0; {
GtkApplication *app;
int status;
app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
status = g_application_run (G_APPLICATION (app), argc, argv);
g_object_unref (app);
return status;
} }

View File

@@ -61,6 +61,7 @@ LDADD = \
# #
gdk_public_h_sources = \ gdk_public_h_sources = \
gdk.h \ gdk.h \
gdk-autocleanup.h \
gdkapplaunchcontext.h \ gdkapplaunchcontext.h \
gdkcairo.h \ gdkcairo.h \
gdkcursor.h \ gdkcursor.h \

View File

@@ -456,10 +456,11 @@ main (int argc, char *argv[])
if (display == NULL) if (display == NULL)
{ {
#ifdef G_OS_UNIX #ifdef G_OS_UNIX
display = ":0"; if (g_unix_socket_address_abstract_names_supported ())
#else display = ":0";
display = ":tcp"; else
#endif #endif
display = ":tcp";
} }
if (g_str_has_prefix (display, ":tcp")) if (g_str_has_prefix (display, ":tcp"))

View File

@@ -110,10 +110,11 @@ _gdk_broadway_server_new (const char *display, GError **error)
if (display == NULL) if (display == NULL)
{ {
#ifdef G_OS_UNIX #ifdef G_OS_UNIX
display = ":0"; if (g_unix_socket_address_abstract_names_supported ())
#else display = ":0";
display = ":tcp"; else
#endif #endif
display = ":tcp";
} }
if (g_str_has_prefix (display, ":tcp")) if (g_str_has_prefix (display, ":tcp"))
@@ -544,13 +545,13 @@ map_named_shm (char *name, gsize size)
#ifdef HAVE_POSIX_FALLOCATE #ifdef HAVE_POSIX_FALLOCATE
res = posix_fallocate (fd, 0, size); res = posix_fallocate (fd, 0, size);
if (res != 0) if (res != 0 && errno == ENOSPC)
{ {
shm_unlink (name); shm_unlink (name);
g_error ("Not enough shared memory for window surface"); g_error ("Not enough shared memory for window surface");
} }
#endif #endif
ptr = mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); ptr = mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
(void) close(fd); (void) close(fd);

42
gdk/gdk-autocleanup.h Normal file
View File

@@ -0,0 +1,42 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
#error "Only <gdk/gdk.h> can be included directly."
#endif
#ifndef __GI_SCANNER__
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkAppLaunchContext, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkCursor, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDevice, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDeviceManager, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDisplay, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDisplayManager, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDragContext, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkFrameClock, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkGLContext, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkKeymap, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkScreen, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkVisual, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkWindow, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkEvent, gdk_event_free)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkFrameTimings, gdk_frame_timings_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkRGBA, gdk_rgba_free)
#endif

View File

@@ -62,6 +62,8 @@
#include <gdk/deprecated/gdkcolor.h> #include <gdk/deprecated/gdkcolor.h>
#endif #endif
#include <gdk/gdk-autocleanup.h>
#undef __GDK_H_INSIDE__ #undef __GDK_H_INSIDE__
#endif /* __GDK_H__ */ #endif /* __GDK_H__ */

View File

@@ -185,6 +185,9 @@ gdk_cairo_surface_paint_pixbuf (cairo_surface_t *surface,
int n_channels; int n_channels;
int j; int j;
if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS)
return;
/* This function can't just copy any pixbuf to any surface, be /* This function can't just copy any pixbuf to any surface, be
* sure to read the invariants here before calling it */ * sure to read the invariants here before calling it */

View File

@@ -86,7 +86,9 @@ enum {
PROP_INPUT_SOURCE, PROP_INPUT_SOURCE,
PROP_INPUT_MODE, PROP_INPUT_MODE,
PROP_HAS_CURSOR, PROP_HAS_CURSOR,
PROP_N_AXES PROP_N_AXES,
PROP_VENDOR_ID,
PROP_PRODUCT_ID
}; };
@@ -236,6 +238,36 @@ gdk_device_class_init (GdkDeviceClass *klass)
P_("Number of axes in the device"), P_("Number of axes in the device"),
0, G_MAXUINT, 0, 0, G_MAXUINT, 0,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
/**
* GdkDevice:vendor-id:
*
* Vendor ID of this device, see gdk_device_get_vendor_id().
*
* Since: 3.16
*/
g_object_class_install_property (object_class,
PROP_VENDOR_ID,
g_param_spec_string ("vendor-id",
P_("Vendor ID"),
P_("Vendor ID"),
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
/**
* GdkDevice:product-id:
*
* Product ID of this device, see gdk_device_get_product_id().
*
* Since: 3.16
*/
g_object_class_install_property (object_class,
PROP_PRODUCT_ID,
g_param_spec_string ("product-id",
P_("Product ID"),
P_("Product ID"),
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
/** /**
* GdkDevice::changed: * GdkDevice::changed:
@@ -293,6 +325,9 @@ gdk_device_dispose (GObject *object)
device->name = NULL; device->name = NULL;
device->keys = NULL; device->keys = NULL;
g_clear_pointer (&device->vendor_id, g_free);
g_clear_pointer (&device->product_id, g_free);
G_OBJECT_CLASS (gdk_device_parent_class)->dispose (object); G_OBJECT_CLASS (gdk_device_parent_class)->dispose (object);
} }
@@ -329,6 +364,12 @@ gdk_device_set_property (GObject *object,
case PROP_HAS_CURSOR: case PROP_HAS_CURSOR:
device->has_cursor = g_value_get_boolean (value); device->has_cursor = g_value_get_boolean (value);
break; break;
case PROP_VENDOR_ID:
device->vendor_id = g_value_dup_string (value);
break;
case PROP_PRODUCT_ID:
device->product_id = g_value_dup_string (value);
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break; break;
@@ -372,6 +413,12 @@ gdk_device_get_property (GObject *object,
case PROP_N_AXES: case PROP_N_AXES:
g_value_set_uint (value, device->axes->len); g_value_set_uint (value, device->axes->len);
break; break;
case PROP_VENDOR_ID:
g_value_set_string (value, device->vendor_id);
break;
case PROP_PRODUCT_ID:
g_value_set_string (value, device->product_id);
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break; break;
@@ -1757,3 +1804,68 @@ gdk_device_get_last_event_window (GdkDevice *device)
return info->window_under_pointer; return info->window_under_pointer;
} }
/**
* gdk_device_get_vendor_id:
* @device: a slave #GdkDevice
*
* Returns the vendor ID of this device, or %NULL if this information couldn't
* be obtained. This ID is retrieved from the device, and is thus constant for
* it.
*
* This function, together with gdk_device_get_product_id(), can be used to eg.
* compose #GSettings paths to store settings for this device.
*
* |[<!-- language="C" -->
* static GSettings *
* get_device_settings (GdkDevice *device)
* {
* const gchar *vendor, *product;
* GSettings *settings;
* GdkDevice *device;
* gchar *path;
*
* vendor = gdk_device_get_vendor_id (device);
* product = gdk_device_get_product_id (device);
*
* path = g_strdup_printf ("/org/example/app/devices/%s:%s/", vendor, product);
* settings = g_settings_new_with_path (DEVICE_SCHEMA, path);
* g_free (path);
*
* return settings;
* }
* ]|
*
* Returns: (nullable): the vendor ID, or %NULL
*
* Since: 3.16
*/
const gchar *
gdk_device_get_vendor_id (GdkDevice *device)
{
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_MASTER, NULL);
return device->vendor_id;
}
/**
* gdk_device_get_product_id:
* @device: a slave #GdkDevice
*
* Returns the product ID of this device, or %NULL if this information couldn't
* be obtained. This ID is retrieved from the device, and is thus constant for
* it. See gdk_device_get_vendor_id() for more information.
*
* Returns: (nullable): the product ID, or %NULL
*
* Since: 3.16
*/
const gchar *
gdk_device_get_product_id (GdkDevice *device)
{
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_MASTER, NULL);
return device->product_id;
}

View File

@@ -274,6 +274,11 @@ gboolean gdk_device_grab_info_libgtk_only (GdkDisplay *display,
GDK_AVAILABLE_IN_3_12 GDK_AVAILABLE_IN_3_12
GdkWindow *gdk_device_get_last_event_window (GdkDevice *device); GdkWindow *gdk_device_get_last_event_window (GdkDevice *device);
GDK_AVAILABLE_IN_3_16
const gchar *gdk_device_get_vendor_id (GdkDevice *device);
GDK_AVAILABLE_IN_3_16
const gchar *gdk_device_get_product_id (GdkDevice *device);
G_END_DECLS G_END_DECLS
#endif /* __GDK_DEVICE_H__ */ #endif /* __GDK_DEVICE_H__ */

View File

@@ -56,6 +56,9 @@ struct _GdkDevice
GList *slaves; GList *slaves;
GdkDeviceType type; GdkDeviceType type;
GArray *axes; GArray *axes;
gchar *vendor_id;
gchar *product_id;
}; };
struct _GdkDeviceClass struct _GdkDeviceClass

View File

@@ -270,12 +270,12 @@ static GdkBackend gdk_backends[] = {
#ifdef GDK_WINDOWING_WIN32 #ifdef GDK_WINDOWING_WIN32
{ "win32", _gdk_win32_display_open }, { "win32", _gdk_win32_display_open },
#endif #endif
#ifdef GDK_WINDOWING_X11
{ "x11", _gdk_x11_display_open },
#endif
#ifdef GDK_WINDOWING_WAYLAND #ifdef GDK_WINDOWING_WAYLAND
{ "wayland", _gdk_wayland_display_open }, { "wayland", _gdk_wayland_display_open },
#endif #endif
#ifdef GDK_WINDOWING_X11
{ "x11", _gdk_x11_display_open },
#endif
#ifdef GDK_WINDOWING_MIR #ifdef GDK_WINDOWING_MIR
{ "mir", _gdk_mir_display_open }, { "mir", _gdk_mir_display_open },
#endif #endif

View File

@@ -146,8 +146,8 @@ bind_vao (GdkGLContextPaintData *paint_data)
static void static void
use_texture_2d_program (GdkGLContextPaintData *paint_data) use_texture_2d_program (GdkGLContextPaintData *paint_data)
{ {
const char *vertex_shader_code = static const char *vertex_shader_code =
"#version 120\n" "#version 150\n"
"uniform sampler2D map;" "uniform sampler2D map;"
"attribute vec2 position;\n" "attribute vec2 position;\n"
"attribute vec2 uv;\n" "attribute vec2 uv;\n"
@@ -156,8 +156,8 @@ use_texture_2d_program (GdkGLContextPaintData *paint_data)
" gl_Position = vec4(position, 0, 1);\n" " gl_Position = vec4(position, 0, 1);\n"
" vUv = uv;\n" " vUv = uv;\n"
"}\n"; "}\n";
const char *fragment_shader_code = static const char *fragment_shader_code =
"#version 120\n" "#version 150\n"
"varying vec2 vUv;\n" "varying vec2 vUv;\n"
"uniform sampler2D map;\n" "uniform sampler2D map;\n"
"void main() {\n" "void main() {\n"
@@ -177,8 +177,8 @@ use_texture_2d_program (GdkGLContextPaintData *paint_data)
static void static void
use_texture_rect_program (GdkGLContextPaintData *paint_data) use_texture_rect_program (GdkGLContextPaintData *paint_data)
{ {
const char *vertex_shader_code = static const char *vertex_shader_code =
"#version 120\n" "#version 150\n"
"uniform sampler2DRect map;" "uniform sampler2DRect map;"
"attribute vec2 position;\n" "attribute vec2 position;\n"
"attribute vec2 uv;\n" "attribute vec2 uv;\n"
@@ -187,8 +187,8 @@ use_texture_rect_program (GdkGLContextPaintData *paint_data)
" gl_Position = vec4(position, 0, 1);\n" " gl_Position = vec4(position, 0, 1);\n"
" vUv = uv;\n" " vUv = uv;\n"
"}\n"; "}\n";
const char *fragment_shader_code = static const char *fragment_shader_code =
"#version 120\n" "#version 150\n"
"varying vec2 vUv;\n" "varying vec2 vUv;\n"
"uniform sampler2DRect map;\n" "uniform sampler2DRect map;\n"
"void main() {\n" "void main() {\n"
@@ -235,8 +235,8 @@ gdk_gl_texture_quads (GdkGLContext *paint_context,
glActiveTexture (GL_TEXTURE0); glActiveTexture (GL_TEXTURE0);
glUniform1i(program->map_location, 0); /* Use texture unit 0 */ glUniform1i(program->map_location, 0); /* Use texture unit 0 */
glEnableVertexAttribArray (0); glEnableVertexAttribArray (program->position_location);
glEnableVertexAttribArray (1); glEnableVertexAttribArray (program->uv_location);
glBindBuffer (GL_ARRAY_BUFFER, paint_data->tmp_vertex_buffer); glBindBuffer (GL_ARRAY_BUFFER, paint_data->tmp_vertex_buffer);
glVertexAttribPointer (program->position_location, 2, GL_FLOAT, GL_FALSE, sizeof(float) * 4, NULL); glVertexAttribPointer (program->position_location, 2, GL_FLOAT, GL_FALSE, sizeof(float) * 4, NULL);
@@ -272,8 +272,8 @@ gdk_gl_texture_quads (GdkGLContext *paint_context,
g_free (vertex_buffer_data); g_free (vertex_buffer_data);
glDisableVertexAttribArray (0); glDisableVertexAttribArray (program->position_location);
glDisableVertexAttribArray (1); glDisableVertexAttribArray (program->uv_location);
} }
/* x,y,width,height describes a rectangle in the gl render buffer /* x,y,width,height describes a rectangle in the gl render buffer
@@ -355,7 +355,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
if (source_type == GL_RENDERBUFFER) if (source_type == GL_RENDERBUFFER)
{ {
glBindRenderbufferEXT (GL_RENDERBUFFER_EXT, source); glBindRenderbuffer (GL_RENDERBUFFER, source);
glGetRenderbufferParameteriv (GL_RENDERBUFFER, GL_RENDERBUFFER_ALPHA_SIZE, &alpha_size); glGetRenderbufferParameteriv (GL_RENDERBUFFER, GL_RENDERBUFFER_ALPHA_SIZE, &alpha_size);
} }
else if (source_type == GL_TEXTURE) else if (source_type == GL_TEXTURE)
@@ -519,7 +519,6 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glEnable (GL_SCISSOR_TEST); glEnable (GL_SCISSOR_TEST);
glEnable (GL_TEXTURE_2D);
gdk_window_get_unscaled_size (impl_window, NULL, &unscaled_window_height); gdk_window_get_unscaled_size (impl_window, NULL, &unscaled_window_height);
@@ -587,8 +586,6 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
if (alpha_size != 0) if (alpha_size != 0)
glDisable (GL_BLEND); glDisable (GL_BLEND);
glDisable (GL_TEXTURE_2D);
#undef FLIP_Y #undef FLIP_Y
} }
@@ -644,6 +641,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
if (clip_region) if (clip_region)
cairo_region_destroy (clip_region); cairo_region_destroy (clip_region);
} }
/* This is always called with the paint context current */ /* This is always called with the paint context current */
@@ -664,7 +662,6 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
float umax, vmax; float umax, vmax;
gboolean use_texture_rectangle; gboolean use_texture_rectangle;
guint target; guint target;
paint_context = gdk_gl_context_get_current (); paint_context = gdk_gl_context_get_current ();
if ((_gdk_gl_flags & GDK_GL_SOFTWARE_DRAW_SURFACE) == 0 && if ((_gdk_gl_flags & GDK_GL_SOFTWARE_DRAW_SURFACE) == 0 &&
paint_context && paint_context &&
@@ -692,7 +689,6 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
target = GL_TEXTURE_2D; target = GL_TEXTURE_2D;
glBindTexture (target, texture_id); glBindTexture (target, texture_id);
glEnable (target);
glEnable (GL_SCISSOR_TEST); glEnable (GL_SCISSOR_TEST);
glTexParameteri (target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri (target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
@@ -720,8 +716,7 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
e.height *= sy; e.height *= sy;
image = cairo_surface_map_to_image (surface, &e); image = cairo_surface_map_to_image (surface, &e);
/* We might have a different alignment, stride or format, so allow overriding here if needed */ gdk_gl_context_upload_texture (paint_context, image, e.width, e.height, target);
GDK_GL_CONTEXT_GET_CLASS (paint_context)->upload_texture (paint_context, image, e.width, e.height, target);
cairo_surface_unmap_image (surface, image); cairo_surface_unmap_image (surface, image);
@@ -750,8 +745,8 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
} }
} }
#undef FLIP_Y
glDisable (GL_SCISSOR_TEST); glDisable (GL_SCISSOR_TEST);
glDisable (target);
glDeleteTextures (1, &texture_id); glDeleteTextures (1, &texture_id);
} }

View File

@@ -49,6 +49,14 @@
* #GdkWindow, which you typically get during the realize call * #GdkWindow, which you typically get during the realize call
* of a widget. * of a widget.
* *
* A #GdkGLContext is not realized until either gdk_gl_context_make_current(),
* or until it is realized using gdk_gl_context_realize(). It is possible to
* specify details of the GL context like the OpenGL version to be used, or
* whether the GL context should have extra state validation enabled after
* calling gdk_window_create_gl_context() by calling gdk_gl_context_realize().
* If the realization fails you have the option to change the settings of the
* #GdkGLContext and try again.
*
* ## Using a GdkGLContext ## * ## Using a GdkGLContext ##
* *
* You will need to make the #GdkGLContext the current context * You will need to make the #GdkGLContext the current context
@@ -83,12 +91,18 @@ typedef struct {
GdkDisplay *display; GdkDisplay *display;
GdkWindow *window; GdkWindow *window;
GdkGLContext *shared_context; GdkGLContext *shared_context;
GdkGLProfile profile;
int major;
int minor;
int gl_version;
guint realized : 1; guint realized : 1;
guint use_texture_rectangle : 1; guint use_texture_rectangle : 1;
guint has_gl_framebuffer_blit : 1; guint has_gl_framebuffer_blit : 1;
guint has_frame_terminator : 1; guint has_frame_terminator : 1;
guint extensions_checked : 1;
guint debug_enabled : 1;
guint forward_compatible : 1;
GdkGLContextPaintData *paint_data; GdkGLContextPaintData *paint_data;
} GdkGLContextPrivate; } GdkGLContextPrivate;
@@ -98,7 +112,6 @@ enum {
PROP_DISPLAY, PROP_DISPLAY,
PROP_WINDOW, PROP_WINDOW,
PROP_PROFILE,
PROP_SHARED_CONTEXT, PROP_SHARED_CONTEXT,
LAST_PROP LAST_PROP
@@ -186,10 +199,6 @@ gdk_gl_context_set_property (GObject *gobject,
} }
break; break;
case PROP_PROFILE:
priv->profile = g_value_get_enum (value);
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
} }
@@ -217,17 +226,12 @@ gdk_gl_context_get_property (GObject *gobject,
g_value_set_object (value, priv->shared_context); g_value_set_object (value, priv->shared_context);
break; break;
case PROP_PROFILE:
g_value_set_enum (value, priv->profile);
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
} }
} }
/* Default implementation of upload_texture() for gdk_gl_texture_from_surface() */ void
static void
gdk_gl_context_upload_texture (GdkGLContext *context, gdk_gl_context_upload_texture (GdkGLContext *context,
cairo_surface_t *image_surface, cairo_surface_t *image_surface,
int width, int width,
@@ -238,7 +242,7 @@ gdk_gl_context_upload_texture (GdkGLContext *context,
glPixelStorei (GL_UNPACK_ALIGNMENT, 4); glPixelStorei (GL_UNPACK_ALIGNMENT, 4);
glPixelStorei (GL_UNPACK_ROW_LENGTH, cairo_image_surface_get_stride (image_surface)/4); glPixelStorei (GL_UNPACK_ROW_LENGTH, cairo_image_surface_get_stride (image_surface)/4);
glTexImage2D (texture_target, 0, 4, width, height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, glTexImage2D (texture_target, 0, GL_RGBA, width, height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
cairo_image_surface_get_data (image_surface)); cairo_image_surface_get_data (image_surface));
glPixelStorei (GL_UNPACK_ROW_LENGTH, 0); glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
} }
@@ -280,23 +284,6 @@ gdk_gl_context_class_init (GdkGLContextClass *klass)
G_PARAM_CONSTRUCT_ONLY | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS); G_PARAM_STATIC_STRINGS);
/**
* GdkGLContext:profile:
*
* The #GdkGLProfile of the context
*
* Since: 3.16
*/
obj_pspecs[PROP_PROFILE] =
g_param_spec_enum ("profile",
P_("Profile"),
P_("The GL profile the context was created for"),
GDK_TYPE_GL_PROFILE,
GDK_GL_PROFILE_DEFAULT,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
/** /**
* GdkGLContext:shared-context: * GdkGLContext:shared-context:
* *
@@ -318,9 +305,6 @@ gdk_gl_context_class_init (GdkGLContextClass *klass)
gobject_class->dispose = gdk_gl_context_dispose; gobject_class->dispose = gdk_gl_context_dispose;
gobject_class->finalize = gdk_gl_context_finalize; gobject_class->finalize = gdk_gl_context_finalize;
/* Default Implementation of upload_texture() for gdk_gl_texture_from_surface() */
klass->upload_texture = gdk_gl_context_upload_texture;
g_object_class_install_properties (gobject_class, LAST_PROP, obj_pspecs); g_object_class_install_properties (gobject_class, LAST_PROP, obj_pspecs);
} }
@@ -389,19 +373,237 @@ gdk_gl_context_has_frame_terminator (GdkGLContext *context)
return priv->has_frame_terminator; return priv->has_frame_terminator;
} }
/**
* gdk_gl_context_set_debug_enabled:
* @context: a #GdkGLContext
* @enabled: whether to enable debugging in the context
*
* Sets whether the #GdkGLContext should perform extra validations and
* run time checking. This is useful during development, but has
* additional overhead.
*
* The #GdkGLContext must not be realized or made current prior to
* calling this function.
*
* Since: 3.16
*/
void
gdk_gl_context_set_debug_enabled (GdkGLContext *context,
gboolean enabled)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
g_return_if_fail (!priv->realized);
enabled = !!enabled;
priv->debug_enabled = enabled;
}
/**
* gdk_gl_context_get_debug_enabled:
* @context: a #GdkGLContext
*
* Retrieves the value set using gdk_gl_context_set_debug_enabled().
*
* Returns: %TRUE if debugging is enabled
*
* Since: 3.16
*/
gboolean
gdk_gl_context_get_debug_enabled (GdkGLContext *context)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), FALSE);
return priv->debug_enabled;
}
/**
* gdk_gl_context_set_forward_compatible:
* @context: a #GdkGLContext
* @compatible: whether the context should be forward compatible
*
* Sets whether the #GdkGLContext should be forward compatible.
*
* Forward compatibile contexts must not support OpenGL functionality that
* has been marked as deprecated in the requested version; non-forward
* compatible contexts, on the other hand, must support both deprecated and
* non deprecated functionality.
*
* The #GdkGLContext must not be realized or made current prior to calling
* this function.
*
* Since: 3.16
*/
void
gdk_gl_context_set_forward_compatible (GdkGLContext *context,
gboolean compatible)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
g_return_if_fail (!priv->realized);
compatible = !!compatible;
priv->forward_compatible = compatible;
}
/**
* gdk_gl_context_get_forward_compatible:
* @context: a #GdkGLContext
*
* Retrieves the value set using gdk_gl_context_set_forward_compatible().
*
* Returns: %TRUE if the context should be forward compatible
*
* Since: 3.16
*/
gboolean
gdk_gl_context_get_forward_compatible (GdkGLContext *context)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), FALSE);
return priv->forward_compatible;
}
/**
* gdk_gl_context_set_required_version:
* @context: a #GdkGLContext
* @major: the major version to request
* @minor: the minor version to request
*
* Sets the major and minor version of OpenGL to request.
*
* Setting @major and @minor to zero will use the default values.
*
* The #GdkGLContext must not be realized or made current prior to calling
* this function.
*
* Since: 3.16
*/
void
gdk_gl_context_set_required_version (GdkGLContext *context,
int major,
int minor)
{
int version;
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
g_return_if_fail (!priv->realized);
/* this will take care of the default */
if (major == 0 && minor == 0)
{
priv->major = 0;
priv->minor = 0;
return;
}
/* Enforce a minimum context version number of 3.2 */
version = (major * 100) + minor;
if (version < 302)
{
g_warning ("gdk_gl_context_set_required_version - GL context versions less than 3.2 are not supported.");
version = 302;
}
priv->major = version / 100;
priv->minor = version % 100;
}
/**
* gdk_gl_context_get_required_version:
* @context: a #GdkGLContext
* @major: (out) (nullable): return location for the major version to request
* @minor: (out) (nullable): return location for the minor version to request
*
* Retrieves the major and minor version requested by calling
* gdk_gl_context_set_required_version().
*
* Since: 3.16
*/
void
gdk_gl_context_get_required_version (GdkGLContext *context,
int *major,
int *minor)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
int maj, min;
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
if (priv->major > 0)
maj = priv->major;
else
maj = 3;
if (priv->minor > 0)
min = priv->minor;
else
min = 2;
if (major != NULL)
*major = maj;
if (minor != NULL)
*minor = min;
}
/**
* gdk_gl_context_realize:
* @context: a #GdkGLContext
* @error: return location for a #GError
*
* Realizes the given #GdkGLContext.
*
* It is safe to call this function on a realized #GdkGLContext.
*
* Returns: %TRUE if the context is realized
*
* Since: 3.16
*/
gboolean
gdk_gl_context_realize (GdkGLContext *context,
GError **error)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), FALSE);
if (priv->realized)
return TRUE;
priv->realized = GDK_GL_CONTEXT_GET_CLASS (context)->realize (context, error);
return priv->realized;
}
static void static void
gdk_gl_context_realize (GdkGLContext *context) gdk_gl_context_check_extensions (GdkGLContext *context)
{ {
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context); GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
gboolean has_npot, has_texture_rectangle; gboolean has_npot, has_texture_rectangle;
if (!priv->realized)
return;
if (priv->extensions_checked)
return;
priv->gl_version = epoxy_gl_version ();
has_npot = epoxy_has_gl_extension ("GL_ARB_texture_non_power_of_two"); has_npot = epoxy_has_gl_extension ("GL_ARB_texture_non_power_of_two");
has_texture_rectangle = epoxy_has_gl_extension ("GL_ARB_texture_rectangle"); has_texture_rectangle = epoxy_has_gl_extension ("GL_ARB_texture_rectangle");
priv->has_gl_framebuffer_blit = epoxy_has_gl_extension ("GL_EXT_framebuffer_blit"); priv->has_gl_framebuffer_blit = epoxy_has_gl_extension ("GL_EXT_framebuffer_blit");
priv->has_frame_terminator = epoxy_has_gl_extension ("GL_GREMEDY_frame_terminator"); priv->has_frame_terminator = epoxy_has_gl_extension ("GL_GREMEDY_frame_terminator");
if (_gdk_gl_flags & GDK_GL_TEXTURE_RECTANGLE) if (G_UNLIKELY (_gdk_gl_flags & GDK_GL_TEXTURE_RECTANGLE))
priv->use_texture_rectangle = TRUE; priv->use_texture_rectangle = TRUE;
else if (has_npot) else if (has_npot)
priv->use_texture_rectangle = FALSE; priv->use_texture_rectangle = FALSE;
@@ -410,7 +612,22 @@ gdk_gl_context_realize (GdkGLContext *context)
else else
g_warning ("GL implementation doesn't support any form of non-power-of-two textures"); g_warning ("GL implementation doesn't support any form of non-power-of-two textures");
priv->realized = TRUE; GDK_NOTE (OPENGL,
g_print ("OpenGL version: %d.%d\n"
"Extensions checked:\n"
" - GL_ARB_texture_non_power_of_two: %s\n"
" - GL_ARB_texture_rectangle: %s\n"
" - GL_EXT_framebuffer_blit: %s\n"
" - GL_GREMEDY_frame_terminator: %s\n"
"Using texture rectangle: %s\n",
priv->gl_version / 10, priv->gl_version % 10,
has_npot ? "yes" : "no",
has_texture_rectangle ? "yes" : "no",
priv->has_gl_framebuffer_blit ? "yes" : "no",
priv->has_frame_terminator ? "yes" : "no",
priv->use_texture_rectangle ? "yes" : "no"));
priv->extensions_checked = TRUE;
} }
/** /**
@@ -433,11 +650,24 @@ gdk_gl_context_make_current (GdkGLContext *context)
if (current == context) if (current == context)
return; return;
/* we need to realize the GdkGLContext if it wasn't explicitly realized */
if (!priv->realized)
{
GError *error = NULL;
gdk_gl_context_realize (context, &error);
if (error != NULL)
{
g_critical ("Could not realize the GL context: %s", error->message);
g_error_free (error);
return;
}
}
if (gdk_display_make_gl_context_current (priv->display, context)) if (gdk_display_make_gl_context_current (priv->display, context))
{ {
g_private_replace (&thread_current_context, g_object_ref (context)); g_private_replace (&thread_current_context, g_object_ref (context));
if (!priv->realized) gdk_gl_context_check_extensions (context);
gdk_gl_context_realize (context);
} }
} }
@@ -481,26 +711,6 @@ gdk_gl_context_get_window (GdkGLContext *context)
return priv->window; return priv->window;
} }
/**
* gdk_gl_context_get_profile:
* @context: a #GdkGLContext
*
* Retrieves the #GdkGLProfile that @context was created for.
*
* Returns: a #GdkGLProfile
*
* Since: 3.16
*/
GdkGLProfile
gdk_gl_context_get_profile (GdkGLContext *context)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), GDK_GL_PROFILE_LEGACY);
return priv->profile;
}
/** /**
* gdk_gl_context_get_shared_context: * gdk_gl_context_get_shared_context:
* @context: a #GdkGLContext * @context: a #GdkGLContext
@@ -521,6 +731,34 @@ gdk_gl_context_get_shared_context (GdkGLContext *context)
return priv->shared_context; return priv->shared_context;
} }
/**
* gdk_gl_context_get_version:
* @context: a #GdkGLContext
* @major: (out): return location for the major version
* @minor: (out): return location for the minor version
*
* Retrieves the OpenGL version of the @context.
*
* The @context must be realized prior to calling this function.
*
* Since: 3.16
*/
void
gdk_gl_context_get_version (GdkGLContext *context,
int *major,
int *minor)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
g_return_if_fail (priv->realized);
if (major != NULL)
*major = priv->gl_version / 10;
if (minor != NULL)
*minor = priv->gl_version % 10;
}
/** /**
* gdk_gl_context_clear_current: * gdk_gl_context_clear_current:
* *

View File

@@ -43,18 +43,44 @@ GDK_AVAILABLE_IN_3_16
GType gdk_gl_context_get_type (void) G_GNUC_CONST; GType gdk_gl_context_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_3_16 GDK_AVAILABLE_IN_3_16
GdkDisplay * gdk_gl_context_get_display (GdkGLContext *context); GdkDisplay * gdk_gl_context_get_display (GdkGLContext *context);
GDK_AVAILABLE_IN_3_16 GDK_AVAILABLE_IN_3_16
GdkWindow * gdk_gl_context_get_window (GdkGLContext *context); GdkWindow * gdk_gl_context_get_window (GdkGLContext *context);
GDK_AVAILABLE_IN_3_16 GDK_AVAILABLE_IN_3_16
GdkGLProfile gdk_gl_context_get_profile (GdkGLContext *context); GdkGLContext * gdk_gl_context_get_shared_context (GdkGLContext *context);
GDK_AVAILABLE_IN_3_16
void gdk_gl_context_get_version (GdkGLContext *context,
int *major,
int *minor);
GDK_AVAILABLE_IN_3_16 GDK_AVAILABLE_IN_3_16
void gdk_gl_context_make_current (GdkGLContext *context); void gdk_gl_context_set_required_version (GdkGLContext *context,
int major,
int minor);
GDK_AVAILABLE_IN_3_16 GDK_AVAILABLE_IN_3_16
GdkGLContext * gdk_gl_context_get_current (void); void gdk_gl_context_get_required_version (GdkGLContext *context,
int *major,
int *minor);
GDK_AVAILABLE_IN_3_16 GDK_AVAILABLE_IN_3_16
void gdk_gl_context_clear_current (void); void gdk_gl_context_set_debug_enabled (GdkGLContext *context,
gboolean enabled);
GDK_AVAILABLE_IN_3_16
gboolean gdk_gl_context_get_debug_enabled (GdkGLContext *context);
GDK_AVAILABLE_IN_3_16
void gdk_gl_context_set_forward_compatible (GdkGLContext *context,
gboolean compatible);
GDK_AVAILABLE_IN_3_16
gboolean gdk_gl_context_get_forward_compatible (GdkGLContext *context);
GDK_AVAILABLE_IN_3_16
gboolean gdk_gl_context_realize (GdkGLContext *context,
GError **error);
GDK_AVAILABLE_IN_3_16
void gdk_gl_context_make_current (GdkGLContext *context);
GDK_AVAILABLE_IN_3_16
GdkGLContext * gdk_gl_context_get_current (void);
GDK_AVAILABLE_IN_3_16
void gdk_gl_context_clear_current (void);
G_END_DECLS G_END_DECLS

View File

@@ -40,17 +40,15 @@ struct _GdkGLContextClass
{ {
GObjectClass parent_class; GObjectClass parent_class;
gboolean (* realize) (GdkGLContext *context,
GError **error);
void (* end_frame) (GdkGLContext *context, void (* end_frame) (GdkGLContext *context,
cairo_region_t *painted, cairo_region_t *painted,
cairo_region_t *damage); cairo_region_t *damage);
gboolean (* texture_from_surface) (GdkGLContext *context, gboolean (* texture_from_surface) (GdkGLContext *context,
cairo_surface_t *surface, cairo_surface_t *surface,
cairo_region_t *region); cairo_region_t *region);
void (* upload_texture) (GdkGLContext *context,
cairo_surface_t *image_surface,
int width,
int height,
guint texture_target);
}; };
typedef struct { typedef struct {
@@ -71,13 +69,18 @@ typedef struct {
GdkGLContextProgram *current_program; GdkGLContextProgram *current_program;
} GdkGLContextPaintData; } GdkGLContextPaintData;
GdkGLContextPaintData *gdk_gl_context_get_paint_data (GdkGLContext *context); void gdk_gl_context_upload_texture (GdkGLContext *context,
gboolean gdk_gl_context_use_texture_rectangle (GdkGLContext *context); cairo_surface_t *image_surface,
gboolean gdk_gl_context_has_framebuffer_blit (GdkGLContext *context); int width,
gboolean gdk_gl_context_has_frame_terminator (GdkGLContext *context); int height,
void gdk_gl_context_end_frame (GdkGLContext *context, guint texture_target);
cairo_region_t *painted, GdkGLContextPaintData * gdk_gl_context_get_paint_data (GdkGLContext *context);
cairo_region_t *damage); gboolean gdk_gl_context_use_texture_rectangle (GdkGLContext *context);
gboolean gdk_gl_context_has_framebuffer_blit (GdkGLContext *context);
gboolean gdk_gl_context_has_frame_terminator (GdkGLContext *context);
void gdk_gl_context_end_frame (GdkGLContext *context,
cairo_region_t *painted,
cairo_region_t *damage);
G_END_DECLS G_END_DECLS

View File

@@ -333,6 +333,7 @@ struct _GdkWindow
guint in_update : 1; guint in_update : 1;
guint geometry_dirty : 1; guint geometry_dirty : 1;
guint event_compression : 1; guint event_compression : 1;
guint frame_clock_events_paused : 1;
/* The GdkWindow that has the impl, ref:ed if another window. /* The GdkWindow that has the impl, ref:ed if another window.
* This ref is required to keep the wrapper of the impl window alive * This ref is required to keep the wrapper of the impl window alive

View File

@@ -372,6 +372,9 @@ typedef enum
* Most of these masks map onto one or more of the #GdkEventType event types * Most of these masks map onto one or more of the #GdkEventType event types
* above. * above.
* *
* See the [input handling overview][chap-input-handling] for details of
* [event masks][event-masks] and [event propagation][event-propagation].
*
* %GDK_POINTER_MOTION_HINT_MASK is deprecated. It is a special mask * %GDK_POINTER_MOTION_HINT_MASK is deprecated. It is a special mask
* to reduce the number of %GDK_MOTION_NOTIFY events received. When using * to reduce the number of %GDK_MOTION_NOTIFY events received. When using
* %GDK_POINTER_MOTION_HINT_MASK, fewer %GDK_MOTION_NOTIFY events will * %GDK_POINTER_MOTION_HINT_MASK, fewer %GDK_MOTION_NOTIFY events will
@@ -434,19 +437,15 @@ struct _GdkPoint
}; };
/** /**
* GdkGLProfile: * GdkGLError:
* @GDK_GL_PROFILE_DEFAULT: ... * @GDK_GL_ERROR_NOT_AVAILABLE: OpenGL support is not available
* @GDK_GL_PROFILE_LEGACY: ... * @GDK_GL_ERROR_UNSUPPORTED_FORMAT: The requested visual format is not supported
* @GDK_GL_PROFILE_3_2_CORE: ... * @GDK_GL_ERROR_UNSUPPORTED_PROFILE: The requested profile is not supported
* *
* ... * Error enumeration for #GdkGLContext.
*
* Since: 3.16
*/ */
typedef enum {
GDK_GL_PROFILE_DEFAULT,
GDK_GL_PROFILE_LEGACY,
GDK_GL_PROFILE_3_2_CORE
} GdkGLProfile;
typedef enum { typedef enum {
GDK_GL_ERROR_NOT_AVAILABLE, GDK_GL_ERROR_NOT_AVAILABLE,
GDK_GL_ERROR_UNSUPPORTED_FORMAT, GDK_GL_ERROR_UNSUPPORTED_FORMAT,

View File

@@ -1110,6 +1110,9 @@ find_native_sibling_above (GdkWindow *parent,
{ {
GdkWindow *w; GdkWindow *w;
if (!parent)
return NULL;
w = find_native_sibling_above_helper (parent, child); w = find_native_sibling_above_helper (parent, child);
if (w) if (w)
return w; return w;
@@ -2724,8 +2727,11 @@ gdk_window_ref_impl_surface (GdkWindow *window)
} }
GdkGLContext * GdkGLContext *
gdk_window_get_paint_gl_context (GdkWindow *window, GError **error) gdk_window_get_paint_gl_context (GdkWindow *window,
GError **error)
{ {
GError *internal_error = NULL;
if (_gdk_gl_flags & GDK_GL_DISABLE) if (_gdk_gl_flags & GDK_GL_DISABLE)
{ {
g_set_error_literal (error, GDK_GL_ERROR, g_set_error_literal (error, GDK_GL_ERROR,
@@ -2737,23 +2743,25 @@ gdk_window_get_paint_gl_context (GdkWindow *window, GError **error)
if (window->impl_window->gl_paint_context == NULL) if (window->impl_window->gl_paint_context == NULL)
{ {
window->impl_window->gl_paint_context = window->impl_window->gl_paint_context =
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window, GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window->impl_window,
TRUE, TRUE,
GDK_GL_PROFILE_3_2_CORE,
NULL, NULL,
error); &internal_error);
if (window->impl_window->gl_paint_context == NULL && }
g_error_matches (*error, GDK_GL_ERROR,
GDK_GL_ERROR_UNSUPPORTED_PROFILE)) if (internal_error != NULL)
{ {
g_clear_error (error); g_propagate_error (error, internal_error);
window->impl_window->gl_paint_context = g_clear_object (&(window->impl_window->gl_paint_context));
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window, return NULL;
TRUE, }
GDK_GL_PROFILE_DEFAULT,
NULL, gdk_gl_context_realize (window->impl_window->gl_paint_context, &internal_error);
error); if (internal_error != NULL)
} {
g_propagate_error (error, internal_error);
g_clear_object (&(window->impl_window->gl_paint_context));
return NULL;
} }
return window->impl_window->gl_paint_context; return window->impl_window->gl_paint_context;
@@ -2762,7 +2770,6 @@ gdk_window_get_paint_gl_context (GdkWindow *window, GError **error)
/** /**
* gdk_window_create_gl_context: * gdk_window_create_gl_context:
* @window: a #GdkWindow * @window: a #GdkWindow
* @profile: the GL profile the context should target
* @error: return location for an error * @error: return location for an error
* *
* Creates a new #GdkGLContext matching the * Creates a new #GdkGLContext matching the
@@ -2771,6 +2778,9 @@ gdk_window_get_paint_gl_context (GdkWindow *window, GError **error)
* *
* If the creation of the #GdkGLContext failed, @error will be set. * If the creation of the #GdkGLContext failed, @error will be set.
* *
* Before using the returned #GdkGLContext, you will need to
* call gdk_gl_context_make_current() or gdk_gl_context_realize().
*
* Returns: (transfer full): the newly created #GdkGLContext, or * Returns: (transfer full): the newly created #GdkGLContext, or
* %NULL on error * %NULL on error
* *
@@ -2778,7 +2788,6 @@ gdk_window_get_paint_gl_context (GdkWindow *window, GError **error)
**/ **/
GdkGLContext * GdkGLContext *
gdk_window_create_gl_context (GdkWindow *window, gdk_window_create_gl_context (GdkWindow *window,
GdkGLProfile profile,
GError **error) GError **error)
{ {
GdkGLContext *paint_context; GdkGLContext *paint_context;
@@ -2790,9 +2799,8 @@ gdk_window_create_gl_context (GdkWindow *window,
if (paint_context == NULL) if (paint_context == NULL)
return NULL; return NULL;
return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window, return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window->impl_window,
FALSE, FALSE,
profile,
paint_context, paint_context,
error); error);
} }
@@ -2932,7 +2940,6 @@ gdk_window_begin_paint_region (GdkWindow *window,
glDisable (GL_DEPTH_TEST); glDisable (GL_DEPTH_TEST);
glDisable(GL_BLEND); glDisable(GL_BLEND);
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glViewport (0, 0, ww, wh); glViewport (0, 0, ww, wh);
} }
@@ -3901,10 +3908,10 @@ gdk_window_process_updates (GdkWindow *window,
{ {
g_return_if_fail (GDK_IS_WINDOW (window)); g_return_if_fail (GDK_IS_WINDOW (window));
return gdk_window_process_updates_with_mode (window, gdk_window_process_updates_with_mode (window,
update_children ? update_children ?
PROCESS_UPDATES_WITH_ALL_CHILDREN : PROCESS_UPDATES_WITH_ALL_CHILDREN :
PROCESS_UPDATES_NO_RECURSE); PROCESS_UPDATES_NO_RECURSE);
} }
static void static void
@@ -4661,6 +4668,8 @@ gdk_window_get_device_position_double (GdkWindow *window,
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL); g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL); g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
tmp_x = tmp_y = 0;
tmp_mask = 0;
normal_child = GDK_WINDOW_IMPL_GET_CLASS (window->impl)->get_device_state (window, normal_child = GDK_WINDOW_IMPL_GET_CLASS (window->impl)->get_device_state (window,
device, device,
&tmp_x, &tmp_y, &tmp_x, &tmp_y,
@@ -5419,6 +5428,8 @@ gdk_window_withdraw (GdkWindow *window)
* including #GDK_BUTTON_PRESS_MASK means the window should report button * including #GDK_BUTTON_PRESS_MASK means the window should report button
* press events. The event mask is the bitwise OR of values from the * press events. The event mask is the bitwise OR of values from the
* #GdkEventMask enumeration. * #GdkEventMask enumeration.
*
* See the [input handling overview][event-masks] for details.
**/ **/
void void
gdk_window_set_events (GdkWindow *window, gdk_window_set_events (GdkWindow *window,
@@ -5489,6 +5500,8 @@ gdk_window_get_events (GdkWindow *window)
* press events. The event mask is the bitwise OR of values from the * press events. The event mask is the bitwise OR of values from the
* #GdkEventMask enumeration. * #GdkEventMask enumeration.
* *
* See the [input handling overview][event-masks] for details.
*
* Since: 3.0 * Since: 3.0
**/ **/
void void
@@ -5895,10 +5908,10 @@ gdk_window_scroll (GdkWindow *window,
* Since: 2.8 * Since: 2.8
*/ */
void void
gdk_window_move_region (GdkWindow *window, gdk_window_move_region (GdkWindow *window,
const cairo_region_t *region, const cairo_region_t *region,
gint dx, gint dx,
gint dy) gint dy)
{ {
cairo_region_t *expose_area; cairo_region_t *expose_area;
@@ -5924,10 +5937,12 @@ gdk_window_move_region (GdkWindow *window,
* @window: a #GdkWindow * @window: a #GdkWindow
* @color: a #GdkColor * @color: a #GdkColor
* *
* Sets the background color of @window. (However, when using GTK+, * Sets the background color of @window.
* set the background of a widget with gtk_widget_modify_bg() - if *
* youre an application - or gtk_style_set_background() - if you're * However, when using GTK+, influence the background of a widget
* implementing a custom widget.) * using a style class or CSS — if youre an application — or with
* gtk_style_context_set_background() — if you're implementing a
* custom widget.
* *
* See also gdk_window_set_background_pattern(). * See also gdk_window_set_background_pattern().
* *
@@ -5991,7 +6006,7 @@ gdk_window_set_background_rgba (GdkWindow *window,
* when the window is obscured then exposed. * when the window is obscured then exposed.
*/ */
void void
gdk_window_set_background_pattern (GdkWindow *window, gdk_window_set_background_pattern (GdkWindow *window,
cairo_pattern_t *pattern) cairo_pattern_t *pattern)
{ {
g_return_if_fail (GDK_IS_WINDOW (window)); g_return_if_fail (GDK_IS_WINDOW (window));
@@ -6367,7 +6382,7 @@ gdk_window_get_origin (GdkWindow *window,
* *
* Obtains the position of a window position in root * Obtains the position of a window position in root
* window coordinates. This is similar to * window coordinates. This is similar to
* gdk_window_get_origin() but allows you go pass * gdk_window_get_origin() but allows you to pass
* in any position in the window, not just the origin. * in any position in the window, not just the origin.
* *
* Since: 2.18 * Since: 2.18
@@ -9944,7 +9959,7 @@ gdk_window_set_event_compression (GdkWindow *window,
{ {
g_return_if_fail (GDK_IS_WINDOW (window)); g_return_if_fail (GDK_IS_WINDOW (window));
window->event_compression = event_compression; window->event_compression = !!event_compression;
} }
/** /**
@@ -10910,6 +10925,8 @@ gdk_window_flush_events (GdkFrameClock *clock,
_gdk_display_pause_events (display); _gdk_display_pause_events (display);
gdk_frame_clock_request_phase (clock, GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS); gdk_frame_clock_request_phase (clock, GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS);
window->frame_clock_events_paused = TRUE;
} }
static void static void
@@ -10936,6 +10953,8 @@ gdk_window_resume_events (GdkFrameClock *clock,
display = gdk_window_get_display (window); display = gdk_window_get_display (window);
_gdk_display_unpause_events (display); _gdk_display_unpause_events (display);
window->frame_clock_events_paused = FALSE;
} }
static void static void
@@ -10968,6 +10987,9 @@ gdk_window_set_frame_clock (GdkWindow *window,
if (window->frame_clock) if (window->frame_clock)
{ {
if (window->frame_clock_events_paused)
gdk_window_resume_events (window->frame_clock, G_OBJECT (window));
g_signal_handlers_disconnect_by_func (G_OBJECT (window->frame_clock), g_signal_handlers_disconnect_by_func (G_OBJECT (window->frame_clock),
G_CALLBACK (gdk_window_flush_events), G_CALLBACK (gdk_window_flush_events),
window); window);
@@ -11108,7 +11130,7 @@ gdk_window_set_opaque_region (GdkWindow *window,
impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
if (impl_class->set_opaque_region) if (impl_class->set_opaque_region)
return impl_class->set_opaque_region (window, region); impl_class->set_opaque_region (window, region);
} }
/** /**

View File

@@ -1113,10 +1113,8 @@ gboolean gdk_window_show_window_menu (GdkWindow *window,
GDK_AVAILABLE_IN_3_16 GDK_AVAILABLE_IN_3_16
GdkGLContext * gdk_window_create_gl_context (GdkWindow *window, GdkGLContext * gdk_window_create_gl_context (GdkWindow *window,
GdkGLProfile profile,
GError **error); GError **error);
G_END_DECLS G_END_DECLS
#endif /* __GDK_WINDOW_H__ */ #endif /* __GDK_WINDOW_H__ */

View File

@@ -293,9 +293,11 @@ struct _GdkWindowImplClass
GdkEvent *event); GdkEvent *event);
GdkGLContext *(*create_gl_context) (GdkWindow *window, GdkGLContext *(*create_gl_context) (GdkWindow *window,
gboolean attached, gboolean attached,
GdkGLProfile profile,
GdkGLContext *share, GdkGLContext *share,
GError **error); GError **error);
gboolean (* realize_gl_context) (GdkWindow *window,
GdkGLContext *context,
GError **error);
void (*invalidate_for_new_frame)(GdkWindow *window, void (*invalidate_for_new_frame)(GdkWindow *window,
cairo_region_t *update_area); cairo_region_t *update_area);
}; };
@@ -303,7 +305,6 @@ struct _GdkWindowImplClass
/* Interface Functions */ /* Interface Functions */
GType gdk_window_impl_get_type (void) G_GNUC_CONST; GType gdk_window_impl_get_type (void) G_GNUC_CONST;
G_END_DECLS G_END_DECLS
#endif /* __GDK_WINDOW_IMPL_H__ */ #endif /* __GDK_WINDOW_IMPL_H__ */

View File

@@ -32,6 +32,7 @@ libgdk_mir_la_SOURCES = \
gdkmirwindow.c \ gdkmirwindow.c \
gdkmirwindowimpl.c \ gdkmirwindowimpl.c \
gdkmir-debug.c \ gdkmir-debug.c \
gdkmir-private.h \
gdkmir.h gdkmir.h
libgdkinclude_HEADERS = \ libgdkinclude_HEADERS = \

View File

@@ -269,6 +269,13 @@ _gdk_mir_print_resize_event (const MirResizeEvent *event)
g_printerr (" Size (%i, %i)\n", event->width, event->height); g_printerr (" Size (%i, %i)\n", event->width, event->height);
} }
void
_gdk_mir_print_close_event (const MirCloseSurfaceEvent *event)
{
g_printerr ("CLOSED\n");
g_printerr (" Surface %i\n", event->surface_id);
}
void void
_gdk_mir_print_event (const MirEvent *event) _gdk_mir_print_event (const MirEvent *event)
{ {
@@ -286,6 +293,9 @@ _gdk_mir_print_event (const MirEvent *event)
case mir_event_type_resize: case mir_event_type_resize:
_gdk_mir_print_resize_event (&event->resize); _gdk_mir_print_resize_event (&event->resize);
break; break;
case mir_event_type_close_surface:
_gdk_mir_print_close_event (&event->close_surface);
break;
default: default:
g_printerr ("EVENT %u\n", event->type); g_printerr ("EVENT %u\n", event->type);
break; break;

View File

@@ -69,6 +69,8 @@ GdkDevice *_gdk_mir_device_manager_get_keyboard (GdkDeviceManager *device_manage
GdkKeymap *_gdk_mir_keymap_new (void); GdkKeymap *_gdk_mir_keymap_new (void);
gboolean _gdk_mir_keymap_key_is_modifier (GdkKeymap *keymap, guint keycode);
GdkDevice *_gdk_mir_keyboard_new (GdkDeviceManager *device_manager, const gchar *name); GdkDevice *_gdk_mir_keyboard_new (GdkDeviceManager *device_manager, const gchar *name);
GdkDevice *_gdk_mir_pointer_new (GdkDeviceManager *device_manager, const gchar *name); GdkDevice *_gdk_mir_pointer_new (GdkDeviceManager *device_manager, const gchar *name);
@@ -131,4 +133,16 @@ void _gdk_mir_print_resize_event (const MirResizeEvent *event);
void _gdk_mir_print_event (const MirEvent *event); void _gdk_mir_print_event (const MirEvent *event);
/* TODO: Remove once we have proper transient window support. */
GdkWindow * _gdk_mir_window_get_visible_transient_child (GdkWindow *window,
gdouble x,
gdouble y,
gdouble *out_x,
gdouble *out_y);
/* TODO: Remove once we have proper transient window support. */
void _gdk_mir_window_transient_children_foreach (GdkWindow *window,
void (*func) (GdkWindow *, gpointer),
gpointer user_data);
#endif /* __GDK_PRIVATE_MIR_H__ */ #endif /* __GDK_PRIVATE_MIR_H__ */

View File

@@ -416,9 +416,20 @@ gdk_mir_display_create_window_impl (GdkDisplay *display,
g_printerr (" location=(%d, %d)", window->x, window->y); g_printerr (" location=(%d, %d)", window->x, window->y);
g_printerr (" size=(%d, %d)", window->width, window->height); g_printerr (" size=(%d, %d)", window->width, window->height);
g_printerr ("\n"); g_printerr ("\n");
if (attributes->wclass != GDK_INPUT_OUTPUT)
return; if (attributes->wclass == GDK_INPUT_OUTPUT)
window->impl = _gdk_mir_window_impl_new (); {
window->impl = _gdk_mir_window_impl_new ();
window->impl_window = window;
}
else /* attributes->wclass == GDK_INPUT_ONLY */
{
window->impl = g_object_ref (real_parent->impl);
window->impl_window = real_parent;
/* FIXME: this is called in gdk_window_new, which sets window->impl_window
* back to window after this function returns. */
}
} }
static GdkKeymap * static GdkKeymap *

View File

@@ -22,6 +22,8 @@
#include "gdkmir.h" #include "gdkmir.h"
#include "gdkmir-private.h" #include "gdkmir-private.h"
#define NANO_TO_MILLI(x) ((x) / 1000000)
struct _GdkMirWindowReference { struct _GdkMirWindowReference {
GdkMirEventSource *source; GdkMirEventSource *source;
GdkWindow *window; GdkWindow *window;
@@ -39,6 +41,7 @@ struct _GdkMirEventSource
GMutex mir_event_lock; GMutex mir_event_lock;
GQueue mir_events; GQueue mir_events;
gboolean log_events;
GdkDisplay *display; GdkDisplay *display;
}; };
@@ -50,6 +53,7 @@ send_event (GdkWindow *window, GdkDevice *device, GdkEvent *event)
GList *node; GList *node;
gdk_event_set_device (event, device); gdk_event_set_device (event, device);
gdk_event_set_source_device (event, device);
gdk_event_set_screen (event, gdk_display_get_screen (gdk_window_get_display (window), 0)); gdk_event_set_screen (event, gdk_display_get_screen (gdk_window_get_display (window), 0));
event->any.window = g_object_ref (window); event->any.window = g_object_ref (window);
@@ -118,7 +122,7 @@ set_key_event_string (GdkEventKey *event)
} }
static void static void
generate_key_event (GdkWindow *window, GdkEventType type, guint state, guint keyval, guint16 keycode, gboolean is_modifier) generate_key_event (GdkWindow *window, GdkEventType type, guint state, guint keyval, guint16 keycode, gboolean is_modifier, guint32 event_time)
{ {
GdkEvent *event; GdkEvent *event;
@@ -127,6 +131,7 @@ generate_key_event (GdkWindow *window, GdkEventType type, guint state, guint key
event->key.keyval = keyval; event->key.keyval = keyval;
event->key.hardware_keycode = keycode + 8; event->key.hardware_keycode = keycode + 8;
event->key.is_modifier = is_modifier; event->key.is_modifier = is_modifier;
event->key.time = event_time;
set_key_event_string (&event->key); set_key_event_string (&event->key);
send_event (window, _gdk_mir_device_manager_get_keyboard (gdk_display_get_device_manager (gdk_window_get_display (window))), event); send_event (window, _gdk_mir_device_manager_get_keyboard (gdk_display_get_device_manager (gdk_window_get_display (window))), event);
@@ -139,7 +144,7 @@ get_pointer (GdkWindow *window)
} }
static void static void
generate_button_event (GdkWindow *window, GdkEventType type, gdouble x, gdouble y, guint button, guint state) generate_button_event (GdkWindow *window, GdkEventType type, gdouble x, gdouble y, guint button, guint state, guint32 event_time)
{ {
GdkEvent *event; GdkEvent *event;
@@ -148,12 +153,13 @@ generate_button_event (GdkWindow *window, GdkEventType type, gdouble x, gdouble
event->button.y = y; event->button.y = y;
event->button.state = state; event->button.state = state;
event->button.button = button; event->button.button = button;
event->button.time = event_time;
send_event (window, get_pointer (window), event); send_event (window, get_pointer (window), event);
} }
static void static void
generate_scroll_event (GdkWindow *window, gdouble x, gdouble y, gdouble delta_x, gdouble delta_y, guint state) generate_scroll_event (GdkWindow *window, gdouble x, gdouble y, gdouble delta_x, gdouble delta_y, guint state, guint32 event_time)
{ {
GdkEvent *event; GdkEvent *event;
@@ -161,15 +167,28 @@ generate_scroll_event (GdkWindow *window, gdouble x, gdouble y, gdouble delta_x,
event->scroll.x = x; event->scroll.x = x;
event->scroll.y = y; event->scroll.y = y;
event->scroll.state = state; event->scroll.state = state;
event->scroll.direction = GDK_SCROLL_SMOOTH; event->scroll.time = event_time;
event->scroll.delta_x = -delta_x;
event->scroll.delta_y = -delta_y; if (ABS (delta_x) == 1 && delta_y == 0)
{
event->scroll.direction = (delta_x < 0) ? GDK_SCROLL_LEFT : GDK_SCROLL_RIGHT;
}
else if (ABS (delta_y) == 1 && delta_x == 0)
{
event->scroll.direction = (delta_y < 0) ? GDK_SCROLL_DOWN : GDK_SCROLL_UP;
}
else
{
event->scroll.direction = GDK_SCROLL_SMOOTH;
event->scroll.delta_x = -delta_x;
event->scroll.delta_y = -delta_y;
}
send_event (window, get_pointer (window), event); send_event (window, get_pointer (window), event);
} }
static void static void
generate_motion_event (GdkWindow *window, gdouble x, gdouble y, guint state) generate_motion_event (GdkWindow *window, gdouble x, gdouble y, guint state, guint32 event_time)
{ {
GdkEvent *event; GdkEvent *event;
@@ -178,12 +197,13 @@ generate_motion_event (GdkWindow *window, gdouble x, gdouble y, guint state)
event->motion.y = y; event->motion.y = y;
event->motion.state = state; event->motion.state = state;
event->motion.is_hint = FALSE; event->motion.is_hint = FALSE;
event->motion.time = event_time;
send_event (window, get_pointer (window), event); send_event (window, get_pointer (window), event);
} }
static void static void
generate_crossing_event (GdkWindow *window, GdkEventType type, gdouble x, gdouble y) generate_crossing_event (GdkWindow *window, GdkEventType type, gdouble x, gdouble y, guint32 event_time)
{ {
GdkEvent *event; GdkEvent *event;
@@ -193,6 +213,7 @@ generate_crossing_event (GdkWindow *window, GdkEventType type, gdouble x, gdoubl
event->crossing.mode = GDK_CROSSING_NORMAL; event->crossing.mode = GDK_CROSSING_NORMAL;
event->crossing.detail = GDK_NOTIFY_ANCESTOR; event->crossing.detail = GDK_NOTIFY_ANCESTOR;
event->crossing.focus = TRUE; event->crossing.focus = TRUE;
event->crossing.time = event_time;
send_event (window, get_pointer (window), event); send_event (window, get_pointer (window), event);
} }
@@ -239,35 +260,30 @@ get_modifier_state (unsigned int modifiers, unsigned int button_state)
return modifier_state; return modifier_state;
} }
/*
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (event_data->window->impl);
MirMotionButton changed_button_state;
GdkEventType event_type;
gdouble x, y;
guint modifier_state;
gboolean is_modifier = FALSE;
*/
static void static void
handle_key_event (GdkWindow *window, const MirKeyEvent *event) handle_key_event (GdkWindow *window, const MirKeyEvent *event)
{ {
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
GdkKeymap *keymap;
guint modifier_state; guint modifier_state;
gboolean is_modifier = FALSE; MirMotionButton button_state;
modifier_state = get_modifier_state (event->modifiers, 0); // FIXME: Need to track button state
switch (event->action) switch (event->action)
{ {
case mir_key_action_down: case mir_key_action_down:
case mir_key_action_up: case mir_key_action_up:
// FIXME: Convert keycode // FIXME: Convert keycode
// FIXME: is_modifier _gdk_mir_window_impl_get_cursor_state (impl, NULL, NULL, NULL, &button_state);
modifier_state = get_modifier_state (event->modifiers, button_state);
keymap = gdk_keymap_get_for_display (gdk_window_get_display (window));
generate_key_event (window, generate_key_event (window,
event->action == mir_key_action_down ? GDK_KEY_PRESS : GDK_KEY_RELEASE, event->action == mir_key_action_down ? GDK_KEY_PRESS : GDK_KEY_RELEASE,
modifier_state, modifier_state,
event->key_code, event->key_code,
event->scan_code, event->scan_code,
is_modifier); _gdk_mir_keymap_key_is_modifier (keymap, event->key_code),
NANO_TO_MILLI (event->event_time));
break; break;
default: default:
//case mir_key_action_multiple: //case mir_key_action_multiple:
@@ -276,6 +292,47 @@ handle_key_event (GdkWindow *window, const MirKeyEvent *event)
} }
} }
/* TODO: Remove once we have proper transient window support. */
typedef struct
{
GdkWindow *except;
gdouble x;
gdouble y;
guint32 time;
} LeaveInfo;
/* TODO: Remove once we have proper transient window support. */
/*
* leave_windows_except:
*
* Generate a leave event for every window except the one the cursor is in.
*/
static void
leave_windows_except (GdkWindow *window,
gpointer user_data)
{
LeaveInfo info = *((LeaveInfo *) user_data);
info.x -= window->x;
info.y -= window->y;
_gdk_mir_window_transient_children_foreach (window, leave_windows_except, &info);
if (window != info.except)
{
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
gboolean cursor_inside;
MirMotionButton button_state;
_gdk_mir_window_impl_get_cursor_state (impl, NULL, NULL, &cursor_inside, &button_state);
if (cursor_inside)
generate_crossing_event (window, GDK_LEAVE_NOTIFY, info.x, info.y, info.time);
_gdk_mir_window_impl_set_cursor_state (impl, info.x, info.y, FALSE, button_state);
}
}
static void static void
handle_motion_event (GdkWindow *window, const MirMotionEvent *event) handle_motion_event (GdkWindow *window, const MirMotionEvent *event)
{ {
@@ -284,6 +341,7 @@ handle_motion_event (GdkWindow *window, const MirMotionEvent *event)
gboolean cursor_inside; gboolean cursor_inside;
MirMotionButton button_state; MirMotionButton button_state;
guint modifier_state; guint modifier_state;
guint32 event_time;
GdkEventType event_type; GdkEventType event_type;
MirMotionButton changed_button_state; MirMotionButton changed_button_state;
@@ -294,45 +352,87 @@ handle_motion_event (GdkWindow *window, const MirMotionEvent *event)
y = event->pointer_coordinates[0].y; y = event->pointer_coordinates[0].y;
} }
modifier_state = get_modifier_state (event->modifiers, event->button_state); modifier_state = get_modifier_state (event->modifiers, event->button_state);
event_time = NANO_TO_MILLI (event->event_time);
/* The Mir events generate hover-exits even while inside the window so /* TODO: Remove once we have proper transient window support. */
counteract this by always generating an enter notify on all other events */ if (event->action == mir_motion_action_hover_exit)
if (!cursor_inside && event->action != mir_motion_action_hover_exit)
{ {
cursor_inside = TRUE; LeaveInfo info;
generate_crossing_event (window, GDK_ENTER_NOTIFY, x, y);
info.x = x;
info.y = y;
info.time = event_time;
info.except = window;
/* Leave all transient children from leaf to root, except the root since we do it later. */
_gdk_mir_window_transient_children_foreach (window, leave_windows_except, &info);
}
else
{
LeaveInfo info;
info.x = x;
info.y = y;
info.time = event_time;
info.except = _gdk_mir_window_get_visible_transient_child (window, x, y, &x, &y);
/* Leave all transient children from leaf to root, except the pointer window since we enter it. */
_gdk_mir_window_transient_children_foreach (window, leave_windows_except, &info);
window = info.except;
if (window)
{
/* Enter the pointer window. */
gboolean cursor_inside_pointer_window;
impl = GDK_MIR_WINDOW_IMPL (window->impl);
_gdk_mir_window_impl_get_cursor_state (impl, NULL, NULL, &cursor_inside_pointer_window, NULL);
if (!cursor_inside_pointer_window)
{
generate_crossing_event (window, GDK_ENTER_NOTIFY, x, y, event_time);
_gdk_mir_window_impl_set_cursor_state (impl, x, y, TRUE, event->button_state);
}
}
} }
/* Update which window has focus */ if (window)
_gdk_mir_pointer_set_location (get_pointer (window), x, y, window, modifier_state);
switch (event->action)
{ {
case mir_motion_action_down: /* Update which window has focus */
case mir_motion_action_up: _gdk_mir_pointer_set_location (get_pointer (window), x, y, window, modifier_state);
event_type = event->action == mir_motion_action_down ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE; switch (event->action)
changed_button_state = button_state ^ event->button_state; {
if (changed_button_state == 0 || (changed_button_state & mir_motion_button_primary) != 0) case mir_motion_action_down:
generate_button_event (window, event_type, x, y, GDK_BUTTON_PRIMARY, modifier_state); case mir_motion_action_up:
if ((changed_button_state & mir_motion_button_secondary) != 0) event_type = event->action == mir_motion_action_down ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE;
generate_button_event (window, event_type, x, y, GDK_BUTTON_SECONDARY, modifier_state); changed_button_state = button_state ^ event->button_state;
if ((changed_button_state & mir_motion_button_tertiary) != 0) if (changed_button_state == 0 || (changed_button_state & mir_motion_button_primary) != 0)
generate_button_event (window, event_type, x, y, GDK_BUTTON_MIDDLE, modifier_state); generate_button_event (window, event_type, x, y, GDK_BUTTON_PRIMARY, modifier_state, event_time);
button_state = event->button_state; if ((changed_button_state & mir_motion_button_secondary) != 0)
break; generate_button_event (window, event_type, x, y, GDK_BUTTON_SECONDARY, modifier_state, event_time);
case mir_motion_action_scroll: if ((changed_button_state & mir_motion_button_tertiary) != 0)
generate_scroll_event (window, x, y, event->pointer_coordinates[0].hscroll, event->pointer_coordinates[0].vscroll, modifier_state); generate_button_event (window, event_type, x, y, GDK_BUTTON_MIDDLE, modifier_state, event_time);
break; button_state = event->button_state;
case mir_motion_action_move: // move with button break;
case mir_motion_action_hover_move: // move without button case mir_motion_action_scroll:
generate_motion_event (window, x, y, modifier_state); generate_scroll_event (window, x, y, event->pointer_coordinates[0].hscroll, event->pointer_coordinates[0].vscroll, modifier_state, event_time);
break; break;
case mir_motion_action_hover_exit: case mir_motion_action_move: // move with button
cursor_inside = FALSE; case mir_motion_action_hover_move: // move without button
generate_crossing_event (window, GDK_LEAVE_NOTIFY, x, y); generate_motion_event (window, x, y, modifier_state, event_time);
break; break;
} case mir_motion_action_hover_exit:
if (cursor_inside)
{
cursor_inside = FALSE;
generate_crossing_event (window, GDK_LEAVE_NOTIFY, x, y, event_time);
}
break;
}
_gdk_mir_window_impl_set_cursor_state (impl, x, y, cursor_inside, button_state); _gdk_mir_window_impl_set_cursor_state (impl, x, y, cursor_inside, button_state);
}
} }
static void static void
@@ -385,6 +485,14 @@ handle_resize_event (GdkWindow *window,
generate_configure_event (window, event->width, event->height); generate_configure_event (window, event->width, event->height);
} }
static void
handle_close_event (GdkWindow *window,
const MirCloseSurfaceEvent *event)
{
send_event (window, get_pointer (window), gdk_event_new (GDK_DESTROY));
gdk_window_destroy_notify (window);
}
typedef struct typedef struct
{ {
GdkWindow *window; GdkWindow *window;
@@ -396,9 +504,6 @@ gdk_mir_event_source_queue_event (GdkDisplay *display,
GdkWindow *window, GdkWindow *window,
const MirEvent *event) const MirEvent *event)
{ {
if (g_getenv ("GDK_MIR_LOG_EVENTS"))
_gdk_mir_print_event (event);
// FIXME: Only generate events if the window wanted them? // FIXME: Only generate events if the window wanted them?
switch (event->type) switch (event->type)
{ {
@@ -420,6 +525,9 @@ gdk_mir_event_source_queue_event (GdkDisplay *display,
case mir_event_type_orientation: case mir_event_type_orientation:
// FIXME? // FIXME?
break; break;
case mir_event_type_close_surface:
handle_close_event (window, &event->close_surface);
break;
default: default:
g_warning ("Ignoring unknown Mir event %d", event->type); g_warning ("Ignoring unknown Mir event %d", event->type);
// FIXME? // FIXME?
@@ -459,7 +567,12 @@ gdk_mir_event_source_convert_events (GdkMirEventSource *source)
* event was being dispatched... * event was being dispatched...
*/ */
if (window != NULL) if (window != NULL)
gdk_mir_event_source_queue_event (source->display, window, &event->event); {
if (source->log_events)
_gdk_mir_print_event (&event->event);
gdk_mir_event_source_queue_event (source->display, window, &event->event);
}
else else
g_warning ("window was destroyed before event arrived..."); g_warning ("window was destroyed before event arrived...");
@@ -554,6 +667,7 @@ _gdk_mir_event_source_new (GdkDisplay *display)
source = (GdkMirEventSource *) g_source; source = (GdkMirEventSource *) g_source;
g_mutex_init (&source->mir_event_lock); g_mutex_init (&source->mir_event_lock);
source->display = display; source->display = display;
source->log_events = (g_getenv ("GDK_MIR_LOG_EVENTS") != NULL);
return source; return source;
} }

View File

@@ -26,6 +26,77 @@
G_DEFINE_TYPE (GdkMirGLContext, gdk_mir_gl_context, GDK_TYPE_GL_CONTEXT) G_DEFINE_TYPE (GdkMirGLContext, gdk_mir_gl_context, GDK_TYPE_GL_CONTEXT)
#define N_EGL_ATTRS 16
static gboolean
gdk_mir_gl_context_realize (GdkGLContext *context,
GError **error)
{
GdkMirGLContext *context_mir = GDK_MIR_GL_CONTEXT (context);
GdkDisplay *display = gdk_gl_context_get_display (context);
GdkGLContext *share = gdk_gl_context_get_shared_context (context);
EGLContext ctx;
EGLint context_attribs[N_EGL_ATTRS];
int major, minor, flags;
gboolean debug_bit, forward_bit;
int i = 0;
if (!_gdk_mir_display_init_egl_display (display))
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
_("No GL implementation is available"));
return FALSE;
}
gdk_gl_context_get_required_version (context, &major, &minor);
debug_bit = gdk_gl_context_get_debug_enabled (context);
forward_bit = gdk_gl_context_get_forward_compatible (context);
flags = 0;
if (debug_bit)
flags |= EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR;
if (forward_bit)
flags |= EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
/* We want a core profile */
context_attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
context_attribs[i++] = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
/* Specify the version */
context_attribs[i++] = EGL_CONTEXT_MAJOR_VERSION_KHR;
context_attribs[i++] = major;
context_attribs[i++] = EGL_CONTEXT_MINOR_VERSION_KHR;
context_attribs[i++] = minor;
/* Specify the flags */
context_attribs[i++] = EGL_CONTEXT_FLAGS_KHR;
context_attribs[i++] = flags;
context_attribs[i++] = EGL_NONE;
g_assert (i < N_EGL_ATTRS);
ctx = eglCreateContext (_gdk_mir_display_get_egl_display (display),
context_mir->egl_config,
share != NULL ? GDK_MIR_GL_CONTEXT (share)->egl_context
: EGL_NO_CONTEXT,
context_attribs);
if (ctx == NULL)
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
_("Unable to create a GL context"));
return FALSE;
}
GDK_NOTE (OPENGL, g_print ("Created EGL context[%p]\n", ctx));
context_mir->egl_context = ctx;
return TRUE;
}
static void static void
gdk_mir_gl_context_end_frame (GdkGLContext *context, gdk_mir_gl_context_end_frame (GdkGLContext *context,
cairo_region_t *painted, cairo_region_t *painted,
@@ -96,6 +167,7 @@ gdk_mir_gl_context_class_init (GdkMirGLContextClass *klass)
GdkGLContextClass *context_class = GDK_GL_CONTEXT_CLASS (klass); GdkGLContextClass *context_class = GDK_GL_CONTEXT_CLASS (klass);
GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
context_class->realize = gdk_mir_gl_context_realize;
context_class->end_frame = gdk_mir_gl_context_end_frame; context_class->end_frame = gdk_mir_gl_context_end_frame;
gobject_class->dispose = gdk_mir_gl_context_dispose; gobject_class->dispose = gdk_mir_gl_context_dispose;
} }

View File

@@ -31,6 +31,12 @@ typedef struct GdkMirKeymapClass GdkMirKeymapClass;
#define GDK_IS_MIR_KEYMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_MIR_KEYMAP)) #define GDK_IS_MIR_KEYMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_MIR_KEYMAP))
#define GDK_MIR_KEYMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_MIR_KEYMAP, GdkMirKeymapClass)) #define GDK_MIR_KEYMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_MIR_KEYMAP, GdkMirKeymapClass))
#define IsModifierKey(keysym) \
(((keysym) >= XKB_KEY_Shift_L && (keysym) <= XKB_KEY_Hyper_R) || \
((keysym) >= XKB_KEY_ISO_Lock && (keysym) <= XKB_KEY_ISO_Last_Group_Lock) || \
((keysym) == XKB_KEY_Mode_switch) || \
((keysym) == XKB_KEY_Num_Lock))
struct GdkMirKeymap struct GdkMirKeymap
{ {
GdkKeymap parent_instance; GdkKeymap parent_instance;
@@ -342,6 +348,14 @@ gdk_mir_keymap_get_modifier_state (GdkKeymap *keymap)
return get_gdk_modifiers (mir_keymap->xkb_keymap, mods); return get_gdk_modifiers (mir_keymap->xkb_keymap, mods);
} }
gboolean
_gdk_mir_keymap_key_is_modifier (GdkKeymap *keymap,
guint keycode)
{
// FIXME: use xkb_state
return IsModifierKey (keycode);
}
static void static void
update_direction (GdkMirKeymap *keymap) update_direction (GdkMirKeymap *keymap)
{ {

View File

@@ -17,6 +17,7 @@
#include "config.h" #include "config.h"
#include "gdkdisplayprivate.h"
#include "gdkdeviceprivate.h" #include "gdkdeviceprivate.h"
#include "gdkscreen.h" #include "gdkscreen.h"
#include "gdkwindow.h" #include "gdkwindow.h"
@@ -183,6 +184,11 @@ gdk_mir_pointer_ungrab (GdkDevice *device,
{ {
//g_printerr ("gdk_mir_pointer_ungrab\n"); //g_printerr ("gdk_mir_pointer_ungrab\n");
/* Mir doesn't do grabs */ /* Mir doesn't do grabs */
GdkDeviceGrabInfo *grab = _gdk_display_get_last_device_grab (gdk_device_get_display (device), device);
if (grab)
grab->serial_end = grab->serial_start;
} }
static GdkWindow * static GdkWindow *

View File

@@ -327,35 +327,31 @@ gdk_mir_screen_get_monitor_plug_name (GdkScreen *screen,
switch (output->type) switch (output->type)
{ {
case mir_display_output_type_unknown: case mir_display_output_type_unknown:
return g_strdup_printf ("UNKNOWN-%u", output->output_id); return g_strdup_printf ("None-%u", output->output_id);
case mir_display_output_type_vga: case mir_display_output_type_vga:
return g_strdup_printf ("VGA-%u", output->output_id); return g_strdup_printf ("VGA-%u", output->output_id);
case mir_display_output_type_dvii: case mir_display_output_type_dvii:
return g_strdup_printf ("DVII-%u", output->output_id);
case mir_display_output_type_dvid: case mir_display_output_type_dvid:
return g_strdup_printf ("DVID-%u", output->output_id);
case mir_display_output_type_dvia: case mir_display_output_type_dvia:
return g_strdup_printf ("DVIA-%u", output->output_id); return g_strdup_printf ("DVI-%u", output->output_id);
case mir_display_output_type_composite: case mir_display_output_type_composite:
return g_strdup_printf ("COMPOSITE-%u", output->output_id); return g_strdup_printf ("Composite-%u", output->output_id);
case mir_display_output_type_svideo:
return g_strdup_printf ("SVIDEO-%u", output->output_id);
case mir_display_output_type_lvds: case mir_display_output_type_lvds:
return g_strdup_printf ("LVDS-%u", output->output_id); return g_strdup_printf ("LVDS-%u", output->output_id);
case mir_display_output_type_component: case mir_display_output_type_component:
return g_strdup_printf ("COMPONENT-%u", output->output_id); return g_strdup_printf ("CTV-%u", output->output_id);
case mir_display_output_type_ninepindin: case mir_display_output_type_ninepindin:
return g_strdup_printf ("NINEPINDIN-%u", output->output_id); return g_strdup_printf ("DIN-%u", output->output_id);
case mir_display_output_type_displayport: case mir_display_output_type_displayport:
return g_strdup_printf ("DISPLAYPORT-%u", output->output_id); return g_strdup_printf ("DP-%u", output->output_id);
case mir_display_output_type_hdmia: case mir_display_output_type_hdmia:
return g_strdup_printf ("HDMIA-%u", output->output_id);
case mir_display_output_type_hdmib: case mir_display_output_type_hdmib:
return g_strdup_printf ("HDMIB-%u", output->output_id); return g_strdup_printf ("HDMI-%u", output->output_id);
case mir_display_output_type_svideo:
case mir_display_output_type_tv: case mir_display_output_type_tv:
return g_strdup_printf ("TV-%u", output->output_id); return g_strdup_printf ("TV-%u", output->output_id);
case mir_display_output_type_edp: case mir_display_output_type_edp:
return g_strdup_printf ("EDP-%u", output->output_id); return g_strdup_printf ("eDP-%u", output->output_id);
} }
} }

View File

@@ -183,19 +183,29 @@ create_mir_surface (GdkDisplay *display,
gint height, gint height,
MirBufferUsage buffer_usage) MirBufferUsage buffer_usage)
{ {
MirSurfaceParameters parameters; MirSurfaceSpec *spec;
MirConnection *connection; MirConnection *connection;
MirPixelFormat format;
parameters.name = g_get_prgname (); MirSurface *surface;
parameters.width = width;
parameters.height = height;
parameters.pixel_format = _gdk_mir_display_get_pixel_format (display, buffer_usage);
parameters.buffer_usage = buffer_usage;
parameters.output_id = mir_display_output_id_invalid;
connection = gdk_mir_display_get_mir_connection (display); connection = gdk_mir_display_get_mir_connection (display);
format = _gdk_mir_display_get_pixel_format (display, buffer_usage);
spec = mir_connection_create_spec_for_normal_surface (connection, width, height, format);
mir_surface_spec_set_name (spec, g_get_prgname ());
mir_surface_spec_set_buffer_usage (spec, buffer_usage);
surface = mir_surface_create_sync (spec);
mir_surface_spec_release (spec);
return mir_connection_create_surface_sync (connection, &parameters); return surface;
}
/* TODO: Remove once we have proper transient window support. */
static gboolean
should_render_in_parent (GdkWindow *window)
{
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
return impl->transient_for && gdk_window_get_window_type (window) != GDK_WINDOW_TOPLEVEL;
} }
static void static void
@@ -206,7 +216,7 @@ ensure_surface_full (GdkWindow *window,
MirEventDelegate event_delegate = { event_cb, NULL }; MirEventDelegate event_delegate = { event_cb, NULL };
GdkMirWindowReference *window_ref; GdkMirWindowReference *window_ref;
if (impl->surface) if (impl->surface || should_render_in_parent (window))
return; return;
/* no destroy notify -- we must leak for now /* no destroy notify -- we must leak for now
@@ -294,7 +304,7 @@ send_buffer (GdkWindow *window)
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl); GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
/* Transient windows draw onto parent instead */ /* Transient windows draw onto parent instead */
if (impl->transient_for) if (should_render_in_parent (window))
{ {
redraw_transient (window); redraw_transient (window);
return; return;
@@ -352,7 +362,7 @@ gdk_mir_window_impl_ref_cairo_surface (GdkWindow *window)
} }
/* Transient windows get rendered into a buffer and copied onto their parent */ /* Transient windows get rendered into a buffer and copied onto their parent */
if (impl->transient_for || window->gl_paint_context) if (should_render_in_parent (window) || window->gl_paint_context)
{ {
cairo_surface = cairo_image_surface_create (pixel_format, window->width, window->height); cairo_surface = cairo_image_surface_create (pixel_format, window->width, window->height);
} }
@@ -373,13 +383,13 @@ gdk_mir_window_impl_ref_cairo_surface (GdkWindow *window)
impl->cairo_surface = cairo_surface_reference (cairo_surface); impl->cairo_surface = cairo_surface_reference (cairo_surface);
/* Draw background */ /* Draw background */
c = cairo_create (impl->cairo_surface);
if (impl->background) if (impl->background)
cairo_set_source (c, impl->background); {
else c = cairo_create (impl->cairo_surface);
cairo_set_source_rgb (c, 1.0, 0.0, 0.0); cairo_set_source (c, impl->background);
cairo_paint (c); cairo_paint (c);
cairo_destroy (c); cairo_destroy (c);
}
return cairo_surface; return cairo_surface;
} }
@@ -446,10 +456,11 @@ gdk_mir_window_impl_hide (GdkWindow *window)
//g_printerr ("gdk_mir_window_impl_hide window=%p\n", window); //g_printerr ("gdk_mir_window_impl_hide window=%p\n", window);
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl); GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
impl->cursor_inside = FALSE;
impl->visible = FALSE; impl->visible = FALSE;
ensure_no_surface (window); ensure_no_surface (window);
if (impl->transient_for) if (should_render_in_parent (window))
redraw_transient (window); redraw_transient (window);
} }
@@ -459,10 +470,11 @@ gdk_mir_window_impl_withdraw (GdkWindow *window)
//g_printerr ("gdk_mir_window_impl_withdraw window=%p\n", window); //g_printerr ("gdk_mir_window_impl_withdraw window=%p\n", window);
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl); GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
impl->cursor_inside = FALSE;
impl->visible = FALSE; impl->visible = FALSE;
ensure_no_surface (window); ensure_no_surface (window);
if (impl->transient_for) if (should_render_in_parent (window))
redraw_transient (window); redraw_transient (window);
} }
@@ -505,6 +517,7 @@ gdk_mir_window_impl_move_resize (GdkWindow *window,
gint width, gint width,
gint height) gint height)
{ {
/*
g_printerr ("gdk_mir_window_impl_move_resize"); g_printerr ("gdk_mir_window_impl_move_resize");
g_printerr (" window=%p", window); g_printerr (" window=%p", window);
if (with_move) if (with_move)
@@ -512,24 +525,27 @@ gdk_mir_window_impl_move_resize (GdkWindow *window,
if (width > 0) if (width > 0)
g_printerr (" size=%dx%dpx", width, height); g_printerr (" size=%dx%dpx", width, height);
g_printerr ("\n"); g_printerr ("\n");
*/
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl); GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
gboolean recreate_surface = FALSE;
/* Redraw parent where we moved from */ /* Redraw parent where we moved from */
if (impl->transient_for) if (should_render_in_parent (window))
redraw_transient (window); redraw_transient (window);
/* Transient windows can move wherever they want */ /* Transient windows can move wherever they want */
if (with_move) if (with_move)
{ {
if (impl->transient_for) if (should_render_in_parent (window))
{ {
window->x = x; window->x = x;
window->y = y; window->y = y;
} }
else else if (x != impl->transient_x || y != impl->transient_y)
{ {
impl->transient_x = x; impl->transient_x = x;
impl->transient_y = y; impl->transient_y = y;
recreate_surface = TRUE;
} }
} }
@@ -539,16 +555,17 @@ gdk_mir_window_impl_move_resize (GdkWindow *window,
/* We accept any resize */ /* We accept any resize */
window->width = width; window->width = width;
window->height = height; window->height = height;
recreate_surface = TRUE;
if (impl->surface)
{
ensure_no_surface (window);
ensure_surface (window);
}
} }
if (recreate_surface && impl->surface)
{
ensure_no_surface (window);
ensure_surface (window);
}
/* Redraw parent where we moved to */ /* Redraw parent where we moved to */
if (impl->transient_for) if (should_render_in_parent (window))
redraw_transient (window); redraw_transient (window);
} }
@@ -711,7 +728,7 @@ gdk_mir_window_impl_input_shape_combine_region (GdkWindow *window,
gint offset_x, gint offset_x,
gint offset_y) gint offset_y)
{ {
g_printerr ("gdk_mir_window_impl_input_shape_combine_region window=%p\n", window); // g_printerr ("gdk_mir_window_impl_input_shape_combine_region window=%p\n", window);
} }
static void static void
@@ -725,7 +742,7 @@ gdk_mir_window_impl_destroy (GdkWindow *window,
impl->visible = FALSE; impl->visible = FALSE;
ensure_no_surface (window); ensure_no_surface (window);
if (impl->transient_for) if (should_render_in_parent (window))
{ {
/* Redraw parent */ /* Redraw parent */
redraw_transient (window); redraw_transient (window);
@@ -862,7 +879,7 @@ static void
gdk_mir_window_impl_set_title (GdkWindow *window, gdk_mir_window_impl_set_title (GdkWindow *window,
const gchar *title) const gchar *title)
{ {
g_printerr ("gdk_mir_window_impl_set_title window=%p\n", window); // g_printerr ("gdk_mir_window_impl_set_title window=%p\n", window);
} }
static void static void
@@ -893,7 +910,7 @@ gdk_mir_window_impl_set_transient_for (GdkWindow *window,
/* Link this window to the parent */ /* Link this window to the parent */
impl->transient_for = parent; impl->transient_for = parent;
if (parent) if (should_render_in_parent (window))
{ {
GdkMirWindowImpl *parent_impl = GDK_MIR_WINDOW_IMPL (parent->impl); GdkMirWindowImpl *parent_impl = GDK_MIR_WINDOW_IMPL (parent->impl);
parent_impl->transient_children = g_list_append (parent_impl->transient_children, window); parent_impl->transient_children = g_list_append (parent_impl->transient_children, window);
@@ -902,12 +919,55 @@ gdk_mir_window_impl_set_transient_for (GdkWindow *window,
window->x = impl->transient_x; window->x = impl->transient_x;
window->y = impl->transient_y; window->y = impl->transient_y;
/* Remove surface if we had made one before this was set */
ensure_no_surface (window);
/* Redraw onto parent */ /* Redraw onto parent */
redraw_transient (window); redraw_transient (window);
} }
}
/* Remove surface if we had made one before this was set */ /* TODO: Remove once we have proper transient window support. */
ensure_no_surface (window); GdkWindow *
_gdk_mir_window_get_visible_transient_child (GdkWindow *window,
gdouble x,
gdouble y,
gdouble *out_x,
gdouble *out_y)
{
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
GdkWindow *child = NULL;
GList *i;
x -= window->x;
y -= window->y;
if (x < 0 || x >= window->width || y < 0 || y >= window->height)
return NULL;
for (i = impl->transient_children; i && !child; i = i->next)
{
if (GDK_MIR_WINDOW_IMPL (GDK_WINDOW (i->data)->impl)->visible)
child = _gdk_mir_window_get_visible_transient_child (i->data, x, y, out_x, out_y);
}
if (child)
return child;
*out_x = x;
*out_y = y;
return window;
}
/* TODO: Remove once we have proper transient window support. */
void
_gdk_mir_window_transient_children_foreach (GdkWindow *window,
void (*func) (GdkWindow *, gpointer),
gpointer user_data)
{
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
g_list_foreach (impl->transient_children, (GFunc) func, user_data);
} }
static void static void
@@ -1254,7 +1314,7 @@ gdk_mir_window_impl_set_shadow_width (GdkWindow *window,
gint top, gint top,
gint bottom) gint bottom)
{ {
g_printerr ("gdk_mir_window_impl_set_shadow_width window=%p\n", window); // g_printerr ("gdk_mir_window_impl_set_shadow_width window=%p\n", window);
} }
static gboolean static gboolean
@@ -1332,16 +1392,12 @@ find_eglconfig_for_window (GdkWindow *window,
static GdkGLContext * static GdkGLContext *
gdk_mir_window_impl_create_gl_context (GdkWindow *window, gdk_mir_window_impl_create_gl_context (GdkWindow *window,
gboolean attached, gboolean attached,
GdkGLProfile profile,
GdkGLContext *share, GdkGLContext *share,
GError **error) GError **error)
{ {
GdkDisplay *display = gdk_window_get_display (window); GdkDisplay *display = gdk_window_get_display (window);
GdkMirGLContext *context; GdkMirGLContext *context;
EGLContext ctx;
EGLConfig config; EGLConfig config;
int i;
EGLint context_attribs[3];
if (!_gdk_mir_display_init_egl_display (display)) if (!_gdk_mir_display_init_egl_display (display))
{ {
@@ -1351,11 +1407,7 @@ gdk_mir_window_impl_create_gl_context (GdkWindow *window,
return NULL; return NULL;
} }
if (profile == GDK_GL_PROFILE_DEFAULT) if (!_gdk_mir_display_have_egl_khr_create_context (display))
profile = GDK_GL_PROFILE_LEGACY;
if (profile == GDK_GL_PROFILE_3_2_CORE &&
!_gdk_mir_display_have_egl_khr_create_context (display))
{ {
g_set_error_literal (error, GDK_GL_ERROR, g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_UNSUPPORTED_PROFILE, GDK_GL_ERROR_UNSUPPORTED_PROFILE,
@@ -1366,38 +1418,13 @@ gdk_mir_window_impl_create_gl_context (GdkWindow *window,
if (!find_eglconfig_for_window (window, &config, error)) if (!find_eglconfig_for_window (window, &config, error))
return NULL; return NULL;
i = 0;
if (profile == GDK_GL_PROFILE_3_2_CORE)
{
context_attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
context_attribs[i++] = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
}
context_attribs[i++] = EGL_NONE;
ctx = eglCreateContext (_gdk_mir_display_get_egl_display (display),
config,
share ? GDK_MIR_GL_CONTEXT (share)->egl_context : EGL_NO_CONTEXT,
context_attribs);
if (ctx == NULL)
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
_("Unable to create a GL context"));
return NULL;
}
GDK_NOTE (OPENGL,
g_print ("Created EGL context[%p]\n", ctx));
context = g_object_new (GDK_TYPE_MIR_GL_CONTEXT, context = g_object_new (GDK_TYPE_MIR_GL_CONTEXT,
"display", display, "display", display,
"window", window, "window", window,
"profile", profile,
"shared-context", share, "shared-context", share,
NULL); NULL);
context->egl_config = config; context->egl_config = config;
context->egl_context = ctx;
context->is_attached = attached; context->is_attached = attached;
return GDK_GL_CONTEXT (context); return GDK_GL_CONTEXT (context);

View File

@@ -818,7 +818,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
impl->view = NULL; impl->view = NULL;
switch (attributes->window_type) switch (window->window_type)
{ {
case GDK_WINDOW_TOPLEVEL: case GDK_WINDOW_TOPLEVEL:
case GDK_WINDOW_TEMP: case GDK_WINDOW_TEMP:
@@ -846,8 +846,9 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
window->width, window->width,
window->height); window->height);
if (attributes->window_type == GDK_WINDOW_TEMP || if (window->window_type == GDK_WINDOW_TEMP ||
attributes->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN) ((attributes_mask & GDK_WA_TYPE_HINT) &&
attributes->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN))
{ {
style_mask = NSBorderlessWindowMask; style_mask = NSBorderlessWindowMask;
} }
@@ -2852,7 +2853,7 @@ gdk_quartz_window_get_scale_factor (GdkWindow *window)
impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
if (gdk_quartz_osx_version() >= GDK_OSX_LION) if (impl->toplevel != NULL && gdk_quartz_osx_version() >= GDK_OSX_LION)
return [(id <ScaleFactor>) impl->toplevel backingScaleFactor]; return [(id <ScaleFactor>) impl->toplevel backingScaleFactor];
return 1; return 1;

View File

@@ -32,15 +32,15 @@
static char * static char *
gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context, gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
GAppInfo *info, GAppInfo *info,
GList *files) GList *files)
{ {
return NULL; return NULL;
} }
static void static void
gdk_wayland_app_launch_context_launch_failed (GAppLaunchContext *context, gdk_wayland_app_launch_context_launch_failed (GAppLaunchContext *context,
const char *startup_notify_id) const char *startup_notify_id)
{ {
} }

View File

@@ -19,7 +19,7 @@
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog * file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with * files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/. * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/ */
#include "config.h" #include "config.h"
@@ -59,6 +59,7 @@ struct _GdkWaylandCursor
} surface; } surface;
struct wl_cursor *wl_cursor; struct wl_cursor *wl_cursor;
int scale;
}; };
struct _GdkWaylandCursorClass struct _GdkWaylandCursorClass
@@ -83,10 +84,18 @@ _gdk_wayland_display_finalize_cursors (GdkWaylandDisplay *display)
} }
static gboolean static gboolean
set_cursor_from_theme (GdkWaylandCursor *cursor, struct wl_cursor_theme *theme) _gdk_wayland_cursor_update (GdkWaylandDisplay *wayland_display,
GdkWaylandCursor *cursor)
{ {
struct wl_cursor *c; struct wl_cursor *c;
struct wl_cursor_theme *theme;
/* Do nothing if this is not a wl_cursor cursor. */
if (cursor->name == NULL)
return FALSE;
theme = _gdk_wayland_display_get_scaled_cursor_theme (wayland_display,
cursor->scale);
c = wl_cursor_theme_get_cursor (theme, cursor->name); c = wl_cursor_theme_get_cursor (theme, cursor->name);
if (!c) if (!c)
{ {
@@ -105,8 +114,7 @@ set_cursor_from_theme (GdkWaylandCursor *cursor, struct wl_cursor_theme *theme)
} }
void void
_gdk_wayland_display_update_cursors (GdkWaylandDisplay *display, _gdk_wayland_display_update_cursors (GdkWaylandDisplay *display)
struct wl_cursor_theme *theme)
{ {
GHashTableIter iter; GHashTableIter iter;
const char *name; const char *name;
@@ -115,7 +123,7 @@ _gdk_wayland_display_update_cursors (GdkWaylandDisplay *display,
g_hash_table_iter_init (&iter, display->cursor_cache); g_hash_table_iter_init (&iter, display->cursor_cache);
while (g_hash_table_iter_next (&iter, (gpointer *) &name, (gpointer *) &cursor)) while (g_hash_table_iter_next (&iter, (gpointer *) &name, (gpointer *) &cursor))
set_cursor_from_theme (cursor, theme); _gdk_wayland_cursor_update (display, cursor);
} }
static void static void
@@ -168,11 +176,11 @@ _gdk_wayland_cursor_get_buffer (GdkCursor *cursor,
*w = image->width; *w = image->width;
*h = image->height; *h = image->height;
*scale = 1; *scale = wayland_cursor->scale;
return wl_cursor_image_get_buffer (image); return wl_cursor_image_get_buffer (image);
} }
else /* From surface */ else if (wayland_cursor->name == NULL) /* From surface */
{ {
*hotspot_x = wayland_cursor->surface.hotspot_x; *hotspot_x = wayland_cursor->surface.hotspot_x;
*hotspot_y = wayland_cursor->surface.hotspot_y; *hotspot_y = wayland_cursor->surface.hotspot_y;
@@ -185,9 +193,9 @@ _gdk_wayland_cursor_get_buffer (GdkCursor *cursor,
if (wayland_cursor->surface.cairo_surface) if (wayland_cursor->surface.cairo_surface)
return _gdk_wayland_shm_surface_get_wl_buffer (wayland_cursor->surface.cairo_surface); return _gdk_wayland_shm_surface_get_wl_buffer (wayland_cursor->surface.cairo_surface);
else
return NULL;
} }
return NULL;
} }
guint guint
@@ -216,6 +224,28 @@ _gdk_wayland_cursor_get_next_image_index (GdkCursor *cursor,
return current_image_index; return current_image_index;
} }
void
_gdk_wayland_cursor_set_scale (GdkCursor *cursor,
guint scale)
{
GdkWaylandDisplay *wayland_display =
GDK_WAYLAND_DISPLAY (gdk_cursor_get_display (cursor));
GdkWaylandCursor *wayland_cursor = GDK_WAYLAND_CURSOR (cursor);
if (scale > GDK_WAYLAND_MAX_THEME_SCALE)
{
g_warning (G_STRLOC ": cursor theme size %u too large", scale);
scale = GDK_WAYLAND_MAX_THEME_SCALE;
}
if (wayland_cursor->scale == scale)
return;
wayland_cursor->scale = scale;
_gdk_wayland_cursor_update (wayland_display, wayland_cursor);
}
static void static void
_gdk_wayland_cursor_class_init (GdkWaylandCursorClass *wayland_cursor_class) _gdk_wayland_cursor_class_init (GdkWaylandCursorClass *wayland_cursor_class)
{ {
@@ -232,9 +262,15 @@ _gdk_wayland_cursor_init (GdkWaylandCursor *cursor)
{ {
} }
static GdkCursor *
_gdk_wayland_display_get_cursor_for_name_with_scale (GdkDisplay *display,
const gchar *name,
guint scale);
GdkCursor * GdkCursor *
_gdk_wayland_display_get_cursor_for_type (GdkDisplay *display, _gdk_wayland_display_get_cursor_for_type_with_scale (GdkDisplay *display,
GdkCursorType cursor_type) GdkCursorType cursor_type,
guint scale)
{ {
GEnumClass *enum_class; GEnumClass *enum_class;
GEnumValue *enum_value; GEnumValue *enum_value;
@@ -247,7 +283,9 @@ _gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
g_strdelimit (cursor_name, "-", '_'); g_strdelimit (cursor_name, "-", '_');
g_type_class_unref (enum_class); g_type_class_unref (enum_class);
result = _gdk_wayland_display_get_cursor_for_name (display, cursor_name); result = _gdk_wayland_display_get_cursor_for_name_with_scale (display,
cursor_name,
scale);
g_free (cursor_name); g_free (cursor_name);
@@ -255,8 +293,18 @@ _gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
} }
GdkCursor * GdkCursor *
_gdk_wayland_display_get_cursor_for_name (GdkDisplay *display, _gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
const gchar *name) GdkCursorType cursor_type)
{
return _gdk_wayland_display_get_cursor_for_type_with_scale (display,
cursor_type,
1);
}
static GdkCursor *
_gdk_wayland_display_get_cursor_for_name_with_scale (GdkDisplay *display,
const gchar *name,
guint scale)
{ {
GdkWaylandCursor *private; GdkWaylandCursor *private;
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (display); GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (display);
@@ -272,13 +320,13 @@ _gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
"display", display, "display", display,
NULL); NULL);
private->name = g_strdup (name); private->name = g_strdup (name);
private->surface.scale = 1; private->scale = scale;
/* Blank cursor case */ /* Blank cursor case */
if (!name || g_str_equal (name, "blank_cursor")) if (!name || g_str_equal (name, "blank_cursor"))
return GDK_CURSOR (private); return GDK_CURSOR (private);
if (!set_cursor_from_theme (private, wayland_display->cursor_theme)) if (!_gdk_wayland_cursor_update (wayland_display, private))
return GDK_CURSOR (private); return GDK_CURSOR (private);
/* Insert into cache. */ /* Insert into cache. */
@@ -286,6 +334,13 @@ _gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
return GDK_CURSOR (private); return GDK_CURSOR (private);
} }
GdkCursor *
_gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
const gchar *name)
{
return _gdk_wayland_display_get_cursor_for_name_with_scale (display, name, 1);
}
GdkCursor * GdkCursor *
_gdk_wayland_display_get_cursor_for_surface (GdkDisplay *display, _gdk_wayland_display_get_cursor_for_surface (GdkDisplay *display,
cairo_surface_t *surface, cairo_surface_t *surface,

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