Compare commits

...

786 Commits

Author SHA1 Message Date
Matthias Clasen
4217fccbc9 3.16.3 2015-05-11 14:47:17 -04:00
Matthias Clasen
086e885c02 Fix a11y tests
The output of the about dialog test is affected by the keynav
fixes.
2015-05-11 14:47:17 -04:00
Lars Uebernickel
b737bfec24 Allow overriding WM_CLASS from the command line
Even when the program itself calls gdk_set_program_class(). There's
currently no way for this function to be called without breaking gdk's
--class command line option, because you cannot call it before
gtk_init().

https://bugzilla.gnome.org/show_bug.cgi?id=747634
2015-05-11 14:22:15 -04:00
Matthias Clasen
570fd6c185 gtk-demo: Remove an unncessary define
The changedisplay example no longer uses and deprecated
API, so don't disable deprecations.
2015-05-11 14:22:08 -04:00
Matthias Clasen
151e74c12d Revert "Work around a pkg-config bug"
This reverts commit 57751fa391.

I've been told that this is not, in fact, a pkg-config bug,
but a pkg-config feature.
2015-05-11 14:21:40 -04:00
Philip Chimento
09408aca1e quartz: Non-implementation of GdkGLContext
This makes sure the Quartz backend returns an error when asked to create
a GL context, rather than crashing because of a NULL vfunc.

https://bugzilla.gnome.org/show_bug.cgi?id=740199
2015-05-11 14:21:32 -04:00
Sjoerd Simons
103346c780 notify test: Don't test object relying on dbus connections
Don't test types that rely on a pre-existing dbus session bus.

https://bugzilla.gnome.org/show_bug.cgi?id=749009
2015-05-11 14:21:04 -04:00
Matthias Clasen
ed9b598e9b GtkRecentChooser: Use a better busy cursor 2015-05-11 14:20:57 -04:00
Matthias Clasen
927d8e84dc GtkPrintUnixDialog: Use a better busy cursor 2015-05-11 14:20:49 -04:00
Garrett Regier
9c307fedc9 GtkFontChooserWidget: Remove unused struct field
This was added accidentally in a recent patch.

Signed-off-by: Garrett Regier <garrettregier@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=748992
2015-05-11 14:20:27 -04:00
Jakub Steiner
27130ab6b1 Adwaita: tone down popover dropshadow 2015-05-11 14:20:08 -04:00
Jonas Ådahl
0f18e90734 GtkWindow: Manually set CSD should enable shadow width calculation
If CSD is enabled with shadow even though it "shouldn't"*, the width
should still be calculated correctly. This fixes a regression caused by
b1e5ad469c.

* gtk_window_should_use_csd () returns false

https://bugzilla.gnome.org/show_bug.cgi?id=748615
2015-05-11 14:19:47 -04:00
Jonas Ådahl
be8ff8e56a GtkWindow: Get the correct shadow width even before window is realized
The window state 'client_decorated' will only be set the window is being
realized. If anyone tries to get the shadow size before that it'd get
the with as if there always was no shadow.

This avoids negative sized opaque regions caused by the allocation being
smaller than shadow.

https://bugzilla.gnome.org/show_bug.cgi?id=748615
2015-05-11 14:19:32 -04:00
Matthias Clasen
6e92757ed0 GtkFontChooserWidget: Listen for fontconfig changes
We were relying on indirectly getting notify when fontconfig
configuration changes, by GtkSettings translating the timestamp
change into a style-invalidation, which gets fed through the
css invalidation machinery. That machinery has gotten good enough
at optimizing away redundant changes that it no longer emits
::style-updated in this case.

So, instead make the font chooser listen directly to what it
cares about: the fontconfig change notification from GtkSettings.
2015-05-11 14:19:21 -04:00
Emmanuele Bassi
d2df0aa7ca fontchooser: Use gtk-fontconfig-timestamp setting
We can use the GtkSettings:gtk-fontconfig-timestamp property to decide
whether or not we should reload fonts on style and screen changes. This
should avoid doing a lot of work with large font collections when only
the theme has changed.

https://bugzilla.gnome.org/show_bug.cgi?id=748782
2015-05-11 14:19:14 -04:00
Emmanuele Bassi
db4b1e62fe settings: Wayland-only systems also use fontconfig
We're relying on the X11 backend being compiled in, but that may not be
the case.

https://bugzilla.gnome.org/show_bug.cgi?id=748782
2015-05-11 14:18:46 -04:00
Christian Hergert
68e31e19fe inspector: allow object read-only properties in prop-editor
If we have a GObject property that is also a GObject, we should be able
to view additional information on that object (even if the param spec
is read-only).
2015-05-11 14:18:11 -04:00
Руслан Ижбулатов
9cbcd541d9 W32: Add a mapping for "left_ptr_watch" cursor
This is purely to support gdk_cursor_new_from_name().
In particular, its counterpart, gdk_cursor_new_for_display(), will not
be affected, because there's no GDK_LEFT_PTR_WATCH cursor type,
and because i don't have a fallback cursor bitmask for gdk/win32/xcursors.h
2015-05-11 14:17:51 -04:00
Jakub Steiner
3d9f024deb HC: implement overlay scrollbar theming
while the behavior was in place, the specific theming for
overlay scrollbars was missing, and content was hidden.
2015-05-11 14:17:31 -04:00
Matthias Clasen
2252876614 Drop PANGO_ENABLE_BACKEND
Not needed for a long time now.

https://bugzilla.gnome.org/show_bug.cgi?id=748783
2015-05-11 14:16:40 -04:00
Matthias Clasen
2d873f3449 docs: Add a note about button 4 & 5 2015-05-11 14:16:09 -04:00
Matthias Clasen
adeca58af7 xi2: Don't set button mask 4 and 5
We interpret buttons 4-7 as old-school scroll events, so it does
not make sense to add these to the mask. Also fix an off-by-one
in the loop here, buttons_mask is 1-based.
2015-05-11 14:16:02 -04:00
Matthias Clasen
ee184e895a GtkAboutDialog: Make credits section keyboard navigatable
Its the right thing to do.
2015-05-11 14:15:51 -04:00
Matthias Clasen
2f91f31b1a GtkAboutDialog: Fix some focus issues
Making a container focusable is rarely the right thing to do.
It typically breaks the focus chain, and makes the container
contents unfocusable, as was the case here.
2015-05-11 14:15:45 -04:00
Timm Bäder
6f7e6f68be inspector/misc-info: Fix typo 2015-05-11 14:15:30 -04:00
Matthias Clasen
7802bbd9c5 GtkSearchEngine: Use all search engines
Just using tracker does not work well if you are searching in
non-indexed locations, such as git checkouts or network mounts.

Ideally, we'd decide the 'best' engine to use for each location.
Since that is not easy to do, just run them in parallel for now,
which is the same strategy that nautilus uses.
2015-05-11 14:14:44 -04:00
Руслан Ижбулатов
1bb0c94767 Rewrite simple search engine to use GFile and breadth order
https://bugzilla.gnome.org/show_bug.cgi?id=746916
2015-05-11 14:14:38 -04:00
Matthias Clasen
1062be1115 GtkSearchEngine: Drop unused functionality 2015-05-11 14:13:08 -04:00
Matthias Clasen
2954c9c09b Drop a redundant call
g_thread_supported() is always TRUE nowadays, so drop the call.
2015-05-11 14:12:51 -04:00
Matthias Clasen
f9bf9295c5 GtkFileChooser: Use a better busy cursor
It is possible to interact with the file chooser while
things are loading, so use a cursor that indicates this,
if we have one.
2015-05-11 14:12:44 -04:00
Руслан Ижбулатов
d041ff409a Fix use-after-free in gdk_window_end_paint()
It's a miracle that this code ever worked.
2015-05-11 14:12:12 -04:00
Alexander Larsson
efaaa3a4a8 wayland: Don't send bogus values for cursor surface buffer/scale
I was getting really weird values for scale for the blank cursor used
when hiding the cursor in a GtkEntry when typing, this was caused
by gdk_wayland_device_update_window_cursor sending random values
when the returned buffer was NULL.

We fix this by just not sending any buffer or scale updates in this
case.
2015-05-11 14:11:44 -04:00
Matthias Clasen
385798c89f Fix inclusion of examples in docs in non-srcdir builds
This is a bit messy, since xsltproc insists on stripping relative
paths to the basename before consulting the paths.

https://bugzilla.gnome.org/show_bug.cgi?id=748640
2015-05-11 14:11:17 -04:00
Jakub Steiner
d597d5beca HC: include a missing sass function
- used in the color widget
2015-05-11 14:10:39 -04:00
Jakub Steiner
32e7d5ae59 HC: tone down backdrop for gtk switches
https://bugzilla.gnome.org/show_bug.cgi?id=746925
2015-05-11 14:10:25 -04:00
Matthias Clasen
cc03e3319c docs: Add an cross-reference to template docs 2015-05-11 14:08:04 -04:00
Matthias Clasen
5efed59da1 Improve the docs for gdk_window_set_opaque_region
Fix several typos and annotate the region parameter
as allow-none.
2015-05-11 13:37:59 -04:00
Carlos Garnacho
5174ad9001 wayland: Don't unset the selected mimetype on drop_reply
gdk_wayland_drop_context_set_status() can't do much else currently besides
picking a mimetype (the first one is currently chosen). This may incorrectly
unset the mimetype chosen on .receive(), so the transfer is cancelled before
it even starts.

At the time drop_reply happens, we should have already picked a mimetype
along the way, so only cover for accepted=FALSE in order to unset it.
2015-05-11 13:37:53 -04:00
Carlos Garnacho
732e313a7a wayland: Plug leak
We leak refs on the dest window if it gets set multiple times, expected to
happen as the DnD operation moves across the window.
2015-05-11 13:37:48 -04:00
Carlos Garnacho
77c5cef932 wayland: Create internal GdkWindow to be set as the DnD source
During drag operations from another client, we currently set no window as
the DnD source. There's paths in upper layers though that rely on it being
set, just that we don't trigger these yet.
2015-05-11 13:37:42 -04:00
Lapo Calamandrei
21216fc8b1 Adwaita: scrollbar contrast bump 2015-05-11 13:36:07 -04:00
Руслан Ижбулатов
932ed7cd51 W32: Support horizontal mouse wheel scrolling
https://bugzilla.gnome.org/show_bug.cgi?id=748014
2015-05-11 13:35:50 -04:00
Lapo Calamandrei
e9d65c9d51 Adwaita: colorpicker fixes.
Added another :not() to fix the first and last swatches in the
first section of colorpicker.
Dodge the artifacts due to stacked anti-aliased rounded corners by
increasing the radius of the base object by 1px.
2015-05-11 13:34:25 -04:00
Jakub Steiner
ee6f29ae19 HighContrast: sync color picker changes with Adwaita 2015-05-11 13:34:18 -04:00
Lapo Calamandrei
5d3c596a84 Adwaita: clearer comment for colorbutton hack 2015-05-11 13:34:06 -04:00
Lapo Calamandrei
c6c56f387a Adwaita: colorpicker and colorbutton fixes.
With nasty gross ugly code, no other ways, sorry.
2015-05-11 13:33:54 -04:00
Lapo Calamandrei
8069712a0e Adwaita: GtkPlacesSidebar insensitive items.
Set the right colors there.
2015-05-11 13:33:43 -04:00
Alexandre Franke
f971d4e4f6 Updated French translation 2015-05-09 09:45:14 +00:00
Alexandre Franke
bf7e5d48a3 Updated French translation 2015-05-09 08:19:47 +00:00
Petr Kovar
201918c501 Update Czech translation 2015-05-07 16:23:13 +02:00
Debarshi Ray
afb1132f7a GtkStack: Don't emit notify::visible-child during destruction
https://bugzilla.gnome.org/show_bug.cgi?id=749012
2015-05-07 15:19:24 +02:00
Debarshi Ray
9270638f38 GtkStackSwitcher: Don't emit notify::visible-child when setting a stack
Synchronizing the visible child with the switcher's toggle buttons can
lead to GtkButton::clicked being emitted twice. Once for the button
that was active before, and once for the button that we just activated.
This leads to notify::visible-child being called twice and one of
them is with the wrong child.

Let's deal with this in the same way we handle the visible child
changing underneath us.

https://bugzilla.gnome.org/show_bug.cgi?id=749021
2015-05-07 15:15:54 +02:00
Daniel van Vugt
ae8fe51669 configure: specify that mir backend needs gio-unix 2015-05-07 11:46:37 +02:00
Yuri Myasoedov
122d72f5da Fixed Russian translation 2015-05-06 13:54:30 +03:00
Lapo Calamandrei
2e6c86310f Adwaita: .title and .subtitle paddings
Only set side paddings for title and subtitle classes, we had 0
vertical padding set there, no idea why, so let's find out...
2015-05-06 10:09:09 +02:00
Lapo Calamandrei
259fc130fd Adwaita: fix selected backdrop list rows.
A misplaced selector was making backdrop selected list rows vanish
on hover, fixed. Thanks to Florian for spotting.
2015-05-06 10:08:34 +02:00
Руслан Ижбулатов
996a4f3d82 Use GDK_KEY_KP_Decimal instead of GDK_KP_Decimal
Fixes the FTBFS introduced in 578043f97e
2015-05-04 17:04:04 +00:00
Cédric Valmary
d732df385f Updated Occitan translation 2015-05-02 15:26:50 +00:00
Matthias Clasen
165684fb7a win32: Support the decimal point on the keypad
Based on a patch by John Emmas.
2015-05-01 07:33:51 -04:00
Daiki Ueno
6fc72c423d build: Avoid xgettext crash on MSYS2
isatty() on MSYS2 returns non-zero if the fd is stdout and is redirected
to /dev/null.  That lets xgettext to produce colorized output and leads
to an assertion failure during terminal type detection.

Although the problem should be fixed in MSYS2, isatty() could behave
wrongly in many ways on Windows.  Since gtk+ doesn't need colorized
output, it would be safer to bypass the terminal dependent code.

See also:
https://lists.gnu.org/archive/html/bug-gettext/2015-04/msg00004.html

https://bugzilla.gnome.org/show_bug.cgi?id=748346
2015-04-27 13:26:09 -04:00
Christian Hergert
171448e4c4 gdk: don't segfault on beep with offscreen window
https://bugzilla.gnome.org/show_bug.cgi?id=748341
2015-04-27 13:26:04 -04:00
Kai Willadsen
5ff8f6824d docs: Fix incorrect cross-reference to GtkSearchBar
https://bugzilla.gnome.org/show_bug.cgi?id=748500
2015-04-27 13:25:57 -04:00
Matthias Clasen
9a75337b5f GtkDialog: Fix up docs
The ui fragment in the example was causing a critical
warning, which is not nice. Fix it to work properly.
2015-04-27 13:25:22 -04:00
Matthias Clasen
cc74421272 GtkActionable: Fix small doc formatting issues 2015-04-27 13:24:45 -04:00
Matthias Clasen
17b5ee4067 GtkApplicationWindow: Fix small doc formatting issues 2015-04-27 13:24:38 -04:00
Matthias Clasen
43c10fd785 GtkApplication: Fix some small doc formatting issues 2015-04-27 13:24:31 -04:00
Matthias Clasen
d74502e81f gl area: Add a few missing docs 2015-04-27 13:24:23 -04:00
Michael Catanzaro
8cd76cdd08 GtkMessageDialog: Minor documentation update
Icons went away in 3.12

https://bugzilla.gnome.org/show_bug.cgi?id=748061
2015-04-27 13:23:06 -04:00
Federico Mena Quintero
62cdbb85aa gdkcolor.h: Use GDK_DEPRECATED_IN_3_14_FOR() throughout
So that lazy people like me can see in the header file which new functions to use.
2015-04-27 13:22:43 -04:00
Sveinn í Felli
105d954946 Updated Icelandic translation 2015-04-23 11:30:34 +00:00
Ask Hjorth Larsen
abfd4ddcf6 fix minor error in Danish translation of properties 2015-04-22 00:28:05 +02:00
Ask Hjorth Larsen
ae71ac49f2 updated Danish translation of properties 2015-04-22 00:25:10 +02:00
Ask Hjorth Larsen
f9ed596de9 Updated Danish translation 2015-04-22 00:18:13 +02:00
Daniel Korostil
8de39d8d46 Updated Ukrainian translation 2015-04-20 20:54:17 +03:00
Lars Uebernickel
456b5e50b5 GtkRange: fix horizontal scrolling
https://bugzilla.gnome.org/show_bug.cgi?id=737175
2015-04-17 17:31:00 +02:00
Rafael Ferreira
6bdcac4c45 Updated Brazilian Portuguese translation 2015-04-17 15:29:37 +00:00
Cosimo Cecchi
7b2f3a0887 window: fix initial shadow width for maximized/fullscreen windows
To calculate the shadow width, we look at the value of priv->fullscreen
and priv->maximized.
Those fields will have the actual value only after GTK receives back a
window state event though, so they will be wrong in _realize(). Look at
priv->fullscreen_initially and priv->maximize_initially too, to avoid
the size changing right after realize, which would make the window
flicker if maximized at startup.

https://bugzilla.gnome.org/show_bug.cgi?id=747808
2015-04-16 22:26:35 -04:00
Sebastian Keller
e1e5cd881e Adwaita: fix outline radius for dialog-action-area buttons
https://bugzilla.gnome.org/show_bug.cgi?id=748013
2015-04-16 22:10:25 -04:00
Rafael Ferreira
b28868cf72 Updated Brazilian Portuguese translation 2015-04-16 21:07:45 +00:00
Carlos Garnacho
78ba188814 scrolledwindow: Do not round dx/dy to int
Libinput will use 0.0f on the "scrolling finished" event, so check for this
instead of rounding (<1 values are sort of frequent on touchpads). This
impedes bug #745315 to resurface after commit d563b943ed.
2015-04-16 22:55:27 +02:00
Carlos Garnacho
ffd944f1c1 scrolledwindow: Ensure the animation is cancelled on arriving scroll events
When the scrolledwindow receives scroll events, it ensures the timeout to
maybe start the "snap back to edges" animation is reset, but it does nothing
about the animation source. It must be reset just the same, to maybe be
started after the timeout fires up.
2015-04-16 18:45:51 +02:00
Matej Urbančič
df0f5569d1 Updated Slovenian translation 2015-04-15 22:28:15 +02:00
Matthias Clasen
c8dc2dee78 Fix window button updates in split headers
We were only updating window buttons when the headerbar was
a direct child of the window. That is not the case in more
complicated situations, such as the split headers in gedit
or polari. To fix such cases, make the headerbar itself listen
for state changes on its toplevel.

https://bugzilla.gnome.org/show_bug.cgi?id=747805
2015-04-14 17:29:50 -04:00
Matthias Clasen
f323633883 3.16.2 2015-04-13 19:16:26 -04:00
Carlos Garnacho
272f43cae7 gesturesingle: Ignore motion/updates from unhandled sequences
This used to do the right thing, practically ignoring those event
if they went all through the event handler, unless this motion event
triggered the cancellation of this gesture from the event handler
of another controllers.

In this case, the controller would be reset, but the motion event
would still go through its handler, setting again
current_button/sequence as the motion event has buttons in its
modifiers. This leaves GtkGestureSingle with inconsistent data
that may interfere with future runs.

https://bugzilla.gnome.org/show_bug.cgi?id=747469
2015-04-13 17:29:25 +02:00
Carlos Garnacho
527d64e68b scrolledwindow: Show scrollbars on tablet devices
The code managing scrollbars visibility was too pervasively checking for
mouse devices, leaving pen/eraser/cursor devices with no scrollbars at
all. Relax these checks a bit, and actually toggle full-width scrollbars
on pen/eraser devices, so it is an easier target.

https://bugzilla.gnome.org/show_bug.cgi?id=747608
2015-04-13 17:29:25 +02:00
Jakub Steiner
c986d6ce78 HC: fix selected list-rows
https://bugzilla.gnome.org/show_bug.cgi?id=747689
2015-04-13 17:07:16 +02:00
Evangelos Foutras
ee679931ab x11: Relax requirements for setting ParentRelative
XSetWindowBackgroundPixmap() will throw BadMatch only in the case of a
different parent window depth. Different visuals are fine and actually
expected in Gtk+ 3.16 (since we don't stick to the system default visual
but try to pick a better one).

https://bugzilla.gnome.org/show_bug.cgi?id=747524
2015-04-13 08:27:51 -04:00
Carlos Garnacho
fb54abb087 plug: Remove size_allocate handler
Since windows can be intermediate containers this is somewhat redundant,
plus gtk_window_size_allocate() will do additional things like allocating
the popovers, which was mistakenly skipped by local plugs not chaining up.

https://bugzilla.gnome.org/show_bug.cgi?id=747553
2015-04-13 12:43:15 +02:00
Khaled Hosny
946cc8ae4d Update Arabic translation 2015-04-12 01:42:31 +02:00
Anders Jonsson
e6db3b556e Updated Swedish translation 2015-04-11 20:39:01 +00:00
Anders Jonsson
80881406ef Updated Swedish translation 2015-04-11 20:36:12 +00:00
Jakub Steiner
588c93ff36 HighContrast: insensitive backdrop list rows have a border
https://bugzilla.gnome.org/show_bug.cgi?id=747288
2015-04-10 17:02:26 +02:00
Jakub Steiner
290a31c614 notebook: prevent tab closebutton :hover to change metric 2015-04-10 17:01:00 +02:00
Lapo Calamandrei
ac41eb4fac Adwaita: reset .list-row.button props more aggressively...
...otherwise we run into problem with `.button` inherited style
properties, see https://bugzilla.gnome.org/show_bug.cgi?id=747288
which applies to Adwaita as well.
2015-04-10 16:48:52 +02:00
Joanmarie Diggs
06efce6fa2 a11y: Only emit signals when cells change; not upon creation
This is a workaround for atspi-atk behaviour.

atspi-atk uses signal emission hooks. So it to already catches
signal emissions on creation of objects, before anyone could even
think of g_signal_connect()ing.

https://bugzilla.gnome.org/show_bug.cgi?id=746706
2015-04-10 16:44:03 +02:00
Joanmarie Diggs
45fb396343 a11y: Only emit name-changed once
We were emitting it twice, once with deleting the old text, once with
inserting the new text.

https://bugzilla.gnome.org/show_bug.cgi?id=746706
2015-04-10 16:44:03 +02:00
Joanmarie Diggs
c7b96d8579 a11y: Free the cell text after emitting text-changed:delete.
This is needed because AT-SPI2's ATK bridge exposes the deleted string
to ATs.

https://bugzilla.gnome.org/show_bug.cgi?id=746706
2015-04-10 16:44:03 +02:00
Joanmarie Diggs
08bf5c4d8c a11y: Refactor code
Put the equality check in front. This allows better detection of when an
insert or delete needs to be emitted.

Also, only emit text-changed:delete if the deleted text is not the empty
string. Only emit text-changed:insert if the inserted text is not the
empty string.

https://bugzilla.gnome.org/show_bug.cgi?id=746706
2015-04-10 16:44:03 +02:00
Joanmarie Diggs
4784d35ec4 a11y: Refactor textcellaccessible code
Compute the new text and its length in advance. This way those
computations will not confuse us when they happen in the middle of the
actual action.

https://bugzilla.gnome.org/show_bug.cgi?id=746706
2015-04-10 16:44:03 +02:00
Matthias Clasen
95e80ef6f8 GtkApplication: Prevent more crashes around shutdown
gtk_application_shutdown clears the impl member, so all
callbacks, signal handlers, etc that might still be triggered
between a shutdown call and the return from the mainloop
better be prepared to deal with impl being NULL.
2015-04-10 08:05:25 -04:00
Sveinn í Felli
53d253d1f0 Updated Icelandic translation 2015-04-10 11:07:55 +00:00
Chun-wei Fan
5be441699b Visual Studio Builds: Fix Header "Installation"
gtksidebar.h was renamed as gtkstacksidebar.h, so fix that in the header
"installation".
2015-04-10 16:19:49 +08:00
Matthias Clasen
ccea7799c4 popover: Remove signal handlers in dispose
If we don't, they may get triggered at an inopportune
time later, causing us to crash.

See
https://bugzilla.redhat.com/show_bug.cgi?id=1203499

https://bugzilla.gnome.org/show_bug.cgi?id=747539
2015-04-09 06:40:12 -04:00
Sveinn í Felli
755bda4bf5 Updated Icelandic translation 2015-04-09 10:31:51 +00:00
Matthias Clasen
ed36e29ec4 wayland: Wait for output and seat information
When we open the connection, we get the wl_output object,
but we return before all the information such as monitor
geometry has arrived, which causes us to misinform early
users of this information. Do a roundtrip here that causes
us to wait until the information is complete. Do the same
for seats, just in case.
https://bugzilla.gnome.org/show_bug.cgi?id=747471
2015-04-09 06:01:39 -04:00
Matthias Clasen
3a40225872 Make gtk-update-icon-cache not fall over leftover temp files
This is a followup to 0fd185fa6d. There is no
good reason to only try again if --force is passed. Do it
always.

See
https://bugzilla.redhat.com/show_bug.cgi?id=1194957
2015-04-08 20:35:10 -04:00
Matthias Clasen
9753499a77 tree view: Avoid a crash with rubberbanding
When a treeview is destroyed while rubberbanding is going
on, we crash because the rb tree is nuked before we want
to access it to stop the rubberbanding. To avoid this crash
end the rubberbanding early in destroy().

See
https://bugzilla.redhat.com/show_bug.cgi?id=1173904
2015-04-08 18:57:26 -04:00
Matthias Clasen
3894d1923c GtkApplication: avoid a crash
It can apparently happen that we get focus in events
on windows after gtk_application_shutdown() has been
called. Avoid an unnecessary crash in this case.

See
https://bugzilla.redhat.com/show_bug.cgi?id=1176339
2015-04-08 15:46:07 -04:00
Matthias Clasen
7963f68929 Revert "image: Optimize non-resize changes"
This reverts commit fef7d65685.

We're still seeing regressions from this, see
http://bugzilla.redhat.com/show_bug.cgi?id=1208183
2015-04-08 14:18:08 -04:00
Matthias Clasen
2baadce9c6 3.16.1 2015-04-07 08:08:12 -04:00
Matthias Clasen
f65d46ff2f Fix indicator proximity checks
The coordinate translations here were not working properly
for window widgets inside the scrolled window, as can be
seen e.g. for the horizontal scrollbar of the 'Tree View'
example in gtk3-demo.

https://bugzilla.gnome.org/show_bug.cgi?id=747406
2015-04-07 06:31:36 -04:00
Victor Ibragimov
28cc8dc745 Updated Tajik translation 2015-04-07 05:11:24 +00:00
Matthias Clasen
b6b03e261a Make indicators pop out when needed
When moving over a non-expanded indicator from the outside, we were
not expanding it, due to on_scrollbar being true. This can be seen
e.g. when moving from the content pane over to the sidebar indicator
in gtk3-demo. We must still ensure that the indicator is expanded
when receiving motion events over the indicator.

https://bugzilla.gnome.org/show_bug.cgi?id=747407
2015-04-06 19:37:34 -04:00
Matthias Clasen
3824f7a44c GtkListBox: Make model binding introspectable
Introspection can't deal with bare pointers, so annotate
the callback as taking objects. This is the outcome of
discussion in
https://bugzilla.gnome.org/show_bug.cgi?id=746893
2015-04-05 08:15:56 -04:00
Paolo Borelli
2aec572a2f gtktextbuffer: small cleanup in clipboard handling
Make code shorter and also more efficient since we move the
selection check out of the loop

https://bugzilla.gnome.org/show_bug.cgi?id=747096
2015-04-05 07:54:43 -04:00
Olivier Fourdan
b52654b03d x11/gl: Fix use after free
https://bugzilla.gnome.org/show_bug.cgi?id=747305

Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
2015-04-05 07:43:49 -04:00
Victor Ibragimov
c9dadf92fe Updated Tajik translation 2015-04-04 05:03:31 +00:00
Dušan Kazik
83d22b4df9 Updated Slovak translation 2015-04-02 08:55:57 +00:00
Victor Ibragimov
2edbbe716d Updated Tajik translation 2015-04-02 05:09:38 +00:00
Carlos Garnacho
d563b943ed scrolledwindow: Ignore 0/0 scroll events when possibly cancelling animation
These should be used eventually to start kinetic scrolling, so should definitely
be ignored on cancellation.

https://bugzilla.gnome.org/show_bug.cgi?id=747133
2015-04-01 16:27:52 +02:00
Stas Solovey
ac12895430 Updated Russian translation 2015-04-01 12:15:05 +00:00
Stas Solovey
fbd9092755 Updated Russian translation 2015-04-01 11:20:59 +00:00
Marek Černocký
f39d0ede70 Udated Czech translation 2015-04-01 11:54:24 +02:00
Matej Urbančič
1d54e38818 Updated Slovenian translation 2015-03-31 21:09:08 +02:00
Carlos Garnacho
260c2b7477 scrolledwindow: Remove needless "dragging" field from Indicator struct
The "over" state already stays set while scrollbar dragging happens, there's
no need to double track that.

https://bugzilla.gnome.org/show_bug.cgi?id=746961
2015-03-31 16:08:47 +02:00
Carlos Garnacho
398aeb31b3 scrolledwindow: Check the event widget on captured motion events
This path is only intended to be triggered on events directed towards the
child of the scrolledwindow, so make it explicitly so. This avoids scrollbar
"over" state flashing when dragging finishes within the slider.

https://bugzilla.gnome.org/show_bug.cgi?id=746961
2015-03-31 16:08:47 +02:00
Stas Solovey
846bd99cdd Updated Russian translation 2015-03-30 22:38:14 +00:00
Carlos Garnacho
ebca729cd1 gtkdnd: Restore widget opacity after fading out
Otherwise the widget is left fully transparent, and will start as such if
the widget is reused.
2015-03-29 22:59:41 +02:00
Carlos Garnacho
1597e2e6b8 gtkdnd: Set the icon helper from the drag site onto the context
If the icon happened to come from the drag site icon helper (ie. set through
gtk_drag_source_set_icon*), it would be referenced on the GtkDragInfo,
but not hooked into its context. This results on non visible drag windows,
until set_icon_helper() happened to be called on some path.
2015-03-29 22:59:41 +02:00
Benjamin Otte
24be2232b5 roundedbox: Fix a copy/paste error
This caused shadows to not be drawn in certain situations when overlayed
via a popover animation.

https://bugzilla.gnome.org/show_bug.cgi?id=746862
2015-03-29 16:47:39 -04:00
Matthias Clasen
56d509b09b radio button: Fix directional navigation
GtkRadioButton had a deficient copy of the focus sort code
in GtkContainer, causing focus to jump over the next button
in the list. Just use _gtk_container_focus_sort() here,
which fixes the bug _and_ saves 80 lines of code.

https://bugzilla.gnome.org/show_bug.cgi?id=746817
2015-03-29 16:47:31 -04:00
Matthias Clasen
287e2250e0 Fix separator in testsplitheaders 2015-03-29 16:47:24 -04:00
Lars Uebernickel
a696ac14f0 gtkprogressbar: fix size allocation
As of 74405cc, progress bars use a new design with values drawn on top
(or to the left) of the through instead of inside of it. This change
brought a number of regressions: the min-horizontal-bar-height and
min-vertical-bar-width style properties are not respected anymore. For
vertical progress bars, the value was drawn too close to the bar and not
centered vertically.

Fix this by respecting the style properties and drawing the value label
at the correct position.

Also, the xspacing and yspacing properties didn't server any apparent
purpose. Change their semantics to mean "the spacing between the label
and the bar". Hence, they only need to be added to the size request when
showing the label. Since we are changing semantics anyway, reduce their
default values from 7 to 2, to avoid and excessive gap.

https://bugzilla.gnome.org/show_bug.cgi?id=746688
2015-03-29 16:47:17 -04:00
Antoine Jacoutot
0c83e6f52a make libcanberra support optional
Make it possible to control libcanberra support so we don't risk ending up with
a cyclic dependency when using packages: gtk+ -> libcanberra-gtk3 -> gtk+

https://bugzilla.gnome.org/show_bug.cgi?id=746904
2015-03-29 16:47:01 -04:00
Will Thompson
9b3af5878f bbox: correct documentation typo 2015-03-29 16:46:11 -04:00
Joanmarie Diggs
862a1c36ef Fix an AtkStateType emitted for GtkBooleanCellAccessible
An apparent copy-and-paste error is resulting in ATs being notified of
changes in ATK_STATE_CHECKED when the cell's "sensitive" state changes.

https://bugzilla.gnome.org/show_bug.cgi?id=746784
2015-03-29 16:45:56 -04:00
Benjamin Otte
b77c6b1b97 filechooser: Use same priority everywhere
I managed to stall recent files today while trying to save a GTK
testcase in glade that contained enough spinning spinners that the CPU
was saturated just redrawing things.

I had to navigate the filesystem!
2015-03-29 16:44:47 -04:00
Marcus Karlsson
59861241ad GtkRange: Check "inverted" property when drawing
The direction in which the slider moves can be inverted by setting the
inverted property. But the draw method does not check this, instead it
checks if the direction of the widget is set to be right to left.

Call the should_invert function in order to determine if the direction
of the range should be inverted. It too checks the widget's direction,
but also checks the "inverted" property, and allows the range to be
drawn inverted even if it is vertically oriented.

https://bugzilla.gnome.org/show_bug.cgi?id=746712
2015-03-29 16:44:38 -04:00
Marcus Karlsson
1e8b89a5ce GtkRange: Fix drawing of fill-level
Compute the proportion of the range that should be filled to match the
fill level, and use it to compute the starting point and length of the
area between the slider and the fill level.

https://bugzilla.gnome.org/show_bug.cgi?id=734741
2015-03-29 16:35:54 -04:00
Marek Černocký
7cea667a3e Updated Czech translation 2015-03-29 13:58:07 +02:00
Marek Černocký
293b53bb00 Updated Czech translation 2015-03-29 13:50:37 +02:00
Matej Urbančič
739fdecc09 Updated Slovenian translation 2015-03-28 22:43:48 +01:00
Jordi Mas
390414e635 Upload Catalan translation 2015-03-28 13:37:50 +01:00
Ryan Lortie
e1da396e5d NEWS: mention GtkListBoxCreateWidgetFunc API break
This should probably be in the NEWS for the next release...
2015-03-27 12:10:39 -04:00
Ryan Lortie
992ff9818c GtkListBox: fix model binding refcount issue
As it is, GtkListBox model binding will work nicely as long as your
create_widget_func returns a floating reference on the newly-created
widget.

If you try to return a full reference (as any higher-level language
would do) then you will leak that reference.

Fix that up by converting any floating references into full references
and then unconditionally releasing the full reference after adding to
the box.

https://bugzilla.gnome.org/show_bug.cgi?id=746893
2015-03-27 12:08:02 -04:00
Emmanuele Bassi
6d75d452aa docs: Add initialization example for GtkGLArea
Show how to safely check for errors when initializing the OpenGL
pipeline.
2015-03-27 11:33:59 +00:00
Emmanuele Bassi
c7dd439d4f x11/gl: Do not use GLX_EXT_texture_from_pixmap if not available
If the GLX_EXT_texture_from_pixmap extension is not available when we
did the extensions check, then there's no point in using the backend
specific code paths that rely on it.
2015-03-27 11:33:52 +00:00
Emmanuele Bassi
a7f06d2ae6 demo/glarea: Check errors on GtkGLArea
We should not call OpenGL API if GtkGLArea is in an error state.

https://bugzilla.gnome.org/show_bug.cgi?id=746746
2015-03-27 11:33:41 +00:00
Emmanuele Bassi
f72db440b5 glarea: Check that the context is not NULL
The public API should perform more checks when it comes to an NULL
context.

https://bugzilla.gnome.org/show_bug.cgi?id=746746
2015-03-27 11:33:29 +00:00
Emmanuele Bassi
732671f639 x11/gl: Do not try to call MakeCurrent with a NULL context
This should not happen, but better safe than sorry.

https://bugzilla.gnome.org/show_bug.cgi?id=746746
2015-03-27 11:33:22 +00:00
Emmanuele Bassi
d4c7fcd050 x11/gl: Trap GL context creation
Avoid an X11 error in case the context creation fails, so we can avoid a
crash and pick it up in the upper layers, and display an error.

https://bugzilla.gnome.org/show_bug.cgi?id=746746
2015-03-27 11:33:19 +00:00
Hans de Goede
318c784b3e scrolledwindow: Extend trackpoint heuristic to ALPS trackpoints
These have a different characteristic device name, look for it too
in order to enable trackpoint features.
2015-03-26 19:52:14 +01:00
Руслан Ижбулатов
80df4f3b1c W32: Only override window miximized position for CSDed windows
This fixes an issue with non-CSDed windows being improperly positioned
when maximized, which was introduced by the previous commit.

https://bugzilla.gnome.org/show_bug.cgi?id=746821
2015-03-26 17:07:34 +00:00
Руслан Ижбулатов
047c6210ad W32: Correctly set maximized window position
Use screen workarea to *also* set the position of a maximized window,
not just its size. Without this the window position defaults to 0:0
(the topleft corner), which is wrong when taskbar is position along the
top or left edge of the screen.

https://bugzilla.gnome.org/show_bug.cgi?id=746821
2015-03-26 15:53:26 +00:00
Aurimas Černius
a455c3cc49 Updated Lithuanian translation 2015-03-25 23:55:00 +02:00
Rico Tzschichholz
99a0b320a3 textview: Fix "Since" versions after backport
Fix for 28063ee2e4 which got cherry-picked
to 3.16

(cherry picked from commit 9ca8b71e76)
2015-03-25 20:55:52 +01:00
Fran Dieguez
df2c1c4d5d Updated Galician translation 2015-03-24 22:30:02 +00:00
Ignacio Casal Quinteiro
2eab2d79b7 inspector: fix warning about not using the right format for an int64 2015-03-24 14:32:58 +01:00
Daniel Mustieles
b83f8bd825 Updated Spanish translation 2015-03-24 10:41:35 +01:00
Daniel Mustieles
9f5eb8f021 Updated Spanish translation 2015-03-24 10:40:21 +01:00
Trần Ngọc Quân
e3d64fb0e2 Updated Vietnamese translation
Signed-off-by: Trần Ngọc Quân <vnwildman@gmail.com>
2015-03-24 14:13:39 +07:00
Changwoo Ryu
1a9d78c58d Updated Korean translation 2015-03-24 09:54:04 +09:00
Inaki Larranaga Murgoitio
64c6869708 Updated Basque language 2015-03-23 22:24:38 +01:00
Inaki Larranaga Murgoitio
afd8697baa Updated Basque language 2015-03-23 22:24:13 +01:00
Fran Dieguez
b652f840f2 Updated Galician translation 2015-03-23 21:14:00 +00:00
Fran Dieguez
349fbb1eac Updated Galician translation 2015-03-23 21:10:45 +00:00
Piotr Drąg
3399395234 Updated Polish translation 2015-03-23 17:33:05 +01:00
Marek Černocký
f52e9bffd6 Updated Czech translation 2015-03-23 16:15:28 +01:00
Matthias Clasen
7be4d69868 csd: Fix an oversight for popups
After the recent rework of client-side shadow code, menus,
tooltips and similar popups were ending up with solid decorations.
Fix this oversight.
2015-03-23 10:43:43 -04:00
Balázs Úr
36f02f4041 Updated Hungarian translation 2015-03-23 14:39:35 +00:00
Balázs Úr
08d649de2f Updated Hungarian translation 2015-03-23 14:35:17 +00:00
Yosef Or Boczko
0235e4c7a1 Update properties Hebrew translation 2015-03-23 14:46:19 +02:00
Yosef Or Boczko
de00a55751 Updated Hebrew translation 2015-03-23 14:44:04 +02:00
Tom Tryfonidis
ba6fd13d38 Updated Greek translation 2015-03-23 10:23:04 +00:00
Tom Tryfonidis
2ecd3b033d Updated Greek translations 2015-03-23 12:09:17 +02:00
Milo Casagrande
db7732ee6c Updated Italian translation 2015-03-23 07:28:32 +00:00
Milo Casagrande
9b9aa14ef7 Updated Italian translation 2015-03-23 07:24:33 +00:00
Matthias Clasen
bff9f190aa Stop using GDK_POINTER_MOTION_HINT_MASK in widgets
It is deprecated and no longer needed, and,as observed in
https://bugzilla.gnome.org/show_bug.cgi?id=746253 it
interferes with turning off event compression.
2015-03-22 23:03:26 -04:00
Matthias Clasen
867dcd3d67 Silence another compiler warning
Again, our habit of comparing enum values against -1.
2015-03-22 23:03:13 -04:00
Matthias Clasen
cb25f48bf6 Don't return G_TYPE_INVALID as a pointer
Use NULL for g_return_val_if_fail checks if the function returns
a pointer. Pointed out by clang.
2015-03-22 23:03:06 -04:00
Matthias Clasen
76a37d542e text view: Avoid clang compiler warnings
Again, our habit to use -1 as an unset value for enum types.
2015-03-22 23:03:00 -04:00
Matthias Clasen
c30f74e506 Remove a redundant const
const gchar const is still just const gchar, unless there's
indirections in between.
2015-03-22 23:02:54 -04:00
Matthias Clasen
1768f3e5dd css: Silence a clang warning
Clang complains that this check can never be true. Since this
is a argument range check which we do to catch bad input,
convince clang to not complain instead of taking it out.
2015-03-22 23:02:48 -04:00
Matthias Clasen
28fde2f320 Remove a pointless comparison
Comparing an unsigned value against < 0 is not going to succeed.
Pointed out by clang.
2015-03-22 23:02:43 -04:00
Matthias Clasen
511d7c3304 paper size: Don't use abs() on floats
Use fabs() instead. Pointed out by clang.
2015-03-22 23:02:36 -04:00
Matthias Clasen
885b5bbe30 More of the same
A similar case in GtkIconHelper. Here we were confusing ourselves,
and compared a icon_size against -1, although the variable is
never set to -1.
2015-03-22 23:02:30 -04:00
Matthias Clasen
289a8e824d Avoid some clang compiler warnings
Avoid some compiler warnings from clang in deprecated code.
Most of these are around our habit of using -1 as an 'unset'
value for enumerations.
2015-03-22 23:02:24 -04:00
Matthias Clasen
524ccf6d42 Fix some clang warnings
It complains about double const, and it is right.
2015-03-22 23:02:17 -04:00
Matthias Clasen
eaa77f6918 Make the blur code compile with clang
clang complains that the expression involving sqrt() is not
constant, and thus refuses to accept it as a case label. So,
use precomputed values instead.

https://bugzilla.gnome.org/show_bug.cgi?id=746468
2015-03-22 23:01:51 -04:00
Matthias Clasen
2984dcdbe5 tooltip: Minor cleanup
Preserve the symmetry in gtk_tooltip_set_last_window.
2015-03-22 23:01:42 -04:00
Matthias Clasen
111a84bd1c search bar: Clean up weak pointer handling
Break out a setter that manages the weak pointer, and
use it in finalize. This also fixes a bug where we were
forgetting to disconnect the right signal handler in
some cases.
2015-03-22 23:01:41 -04:00
Matthias Clasen
32c4bcbd3e mount operation: Minor formatting cleanup
The pattern for g_object_add_weak_pointer calls is to
have the same expression in both arguments.
2015-03-22 23:00:53 -04:00
Matthias Clasen
31252c1fe4 menu button: Minor cleanup
Preserve the symmetry in set_align_widget_pointer.
2015-03-22 23:00:48 -04:00
Matthias Clasen
dd09993f37 Clean up some unfortunate formatting
"if (...) do" just looks wrong.
2015-03-22 23:00:40 -04:00
Matthias Clasen
c0727abccc dnd: Introduce a helper to manage the weak pointer
Introduce a setter that takes care of updating the weak ref
whenever we assign info->widget. Just a cleanup of the previous patch.
2015-03-22 23:00:25 -04:00
Tom Hughes
9a27dca38f DND: Clean up weak pointers when they are no longer needed
Failure to do so leads to memory corruption down the road.
This was introduced in commit 650c25e06c.

https://bugzilla.gnome.org/show_bug.cgi?id=746602
2015-03-22 23:00:18 -04:00
Matthias Clasen
ca3c79e997 radio-menu-item: Allow arguments to be NULL
Some arguments, like the group and the label of a RadioMenuItem, can be
NULL: the RadioMenuItem has all the code to deal with them. The argument
validation is too strict, though, for instance doing:

  return_if_fail (IS_RADIO_MENU_ITEM (foo))

  if (foo != NULL)
    set_foo (foo)

Which is obviously incorrect.

This commit also modifies the annotations of the API, to ensure that
language bindings do the right thing.

https://bugzilla.gnome.org/show_bug.cgi?id=671362
2015-03-22 23:00:09 -04:00
Emmanuele Bassi
1d24014a8b radio-menu-item: Handle a !NULL group
If we create a RadioMenuItem without a group, and then set a group, the
menu item will still be set as active, which means an inconsistently
drawn radio menu item - as the RadioMenuItem will set the active flag on
itself, but then it won't reset it when it gets a new group.

https://bugzilla.gnome.org/show_bug.cgi?id=671362
2015-03-22 23:00:02 -04:00
Olivier Fourdan
9da241b2d0 Improve CSD decorations without a compositor
It turned out that using mwm hints to instruct wms to
create border-only decorations is not really working
universally. So, instead of doing this, render a solid
frame without shadow on the client-side to handle this
case.

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

Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
2015-03-22 22:59:37 -04:00
Matthias Clasen
fef7d65685 image: Optimize non-resize changes
When the image content is changed, only queue a resize
if the size is actually changing, otherwise just a
redraw. Suggested by Owen in

https://bugzilla.gnome.org/show_bug.cgi?id=613833
2015-03-22 22:59:30 -04:00
Christian Hergert
0230fff141 a11y: handle atk race condition where widget has been destroyed
If the widget has been destroyed since a DBus message had been sent,
we could be in a condition that the widget pointer exists but it does
not have a window.

This bails as if the widget didn't exist if there is no available
GdkWindow.

We also set the extents to 0 to be defensive since this is a vfunc
implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=746586
2015-03-22 22:59:21 -04:00
Alexander Larsson
da5cbcaf86 box-shadow: For top/bottom and left/right parts, repeat a single line
Since these part really are the same in all of the x or y direction
and we don't blur in that direction we can just blur one line and
repeat it during drawing.

https://bugzilla.gnome.org/show_bug.cgi?id=746468
2015-03-22 22:59:04 -04:00
Alexander Larsson
0707a2fa0e shadow-box: Blur only horizontally/vertically for the non-corner parts
There is no need to e.g. blur in the x-direction for the top part
of a box shadow. Also, there is no need to extend the mask in the
non-blurred direction.

https://bugzilla.gnome.org/show_bug.cgi?id=746468
2015-03-22 22:58:54 -04:00
Alexander Larsson
d370d130fb shadow-box: Bail out blur early if radius is 1px
For radius 1px the current implementation rounds down to a 1 px box
filter which is a no-op. Rather than creating useless shadow masks
in this case we bail out blurring early.

Another alternative would be to make radius 1px round up to a 2 px box
filter, but that would change the rendering of Adwaita which is probably
not a great idea this late in the cycle.

https://bugzilla.gnome.org/show_bug.cgi?id=746468
2015-03-22 22:58:46 -04:00
Alexander Larsson
c96df5a350 gtkcairoblur: Unroll inner loop for common radius values
This unrolls the inner blur loop for radius 1-10, allowing
the compiler to use a divide-by-constant operation instead
of a generic division.

Here is the blur-performance output before:

Radius  1: 124.95 msec, 32.01 kpixels/msec:
Radius  2: 117.27 msec, 34.11 kpixels/msec:
Radius  3: 123.57 msec, 32.37 kpixels/msec:
Radius  4: 118.17 msec, 33.85 kpixels/msec:
Radius  5: 119.32 msec, 33.52 kpixels/msec:
Radius  6: 124.17 msec, 32.21 kpixels/msec:
Radius  7: 121.04 msec, 33.05 kpixels/msec:
Radius  8: 130.64 msec, 30.62 kpixels/msec:
Radius  9: 119.47 msec, 33.48 kpixels/msec:
Radius 10: 117.95 msec, 33.91 kpixels/msec:
Radius 11: 122.38 msec, 32.68 kpixels/msec:
Radius 12: 121.92 msec, 32.81 kpixels/msec:
Radius 13: 125.45 msec, 31.89 kpixels/msec:
Radius 14: 121.63 msec, 32.89 kpixels/msec:
Radius 15: 120.18 msec, 33.28 kpixels/msec:

And after:

Radius  1: 42.26 msec, 94.65 kpixels/msec:
Radius  2: 59.15 msec, 67.62 kpixels/msec:
Radius  3: 60.29 msec, 66.35 kpixels/msec:
Radius  4: 64.53 msec, 61.99 kpixels/msec:
Radius  5: 60.07 msec, 66.59 kpixels/msec:
Radius  6: 62.43 msec, 64.07 kpixels/msec:
Radius  7: 60.36 msec, 66.27 kpixels/msec:
Radius  8: 59.59 msec, 67.13 kpixels/msec:
Radius  9: 76.17 msec, 52.51 kpixels/msec:
Radius 10: 79.41 msec, 50.37 kpixels/msec:
Radius 11: 118.92 msec, 33.64 kpixels/msec:
Radius 12: 121.31 msec, 32.97 kpixels/msec:
Radius 13: 118.30 msec, 33.81 kpixels/msec:
Radius 14: 116.82 msec, 34.24 kpixels/msec:
Radius 15: 116.99 msec, 34.19 kpixels/msec:

I.e. almost double performance for the unrolled radius values.

https://bugzilla.gnome.org/show_bug.cgi?id=746468
2015-03-22 22:58:39 -04:00
Alexander Larsson
41e863a0f0 gtkcairoblur: Minor restructure
This just moves get_box_filter_size to the top and makes
it a macro (so it can be used as a constant later).

https://bugzilla.gnome.org/show_bug.cgi?id=746468
2015-03-22 22:58:33 -04:00
Alexander Larsson
9bc2bbf782 Add performance test for gtkcairoblur
This just creates a large cairo surface and times bluring it
at various values of radius.

https://bugzilla.gnome.org/show_bug.cgi?id=746468
2015-03-22 22:58:27 -04:00
Matthias Clasen
586cdb63e4 HighContrast: Fix a typo
Commit 0a39d7d9 introduced a selected_bg_color with a missing $
in front of it.
2015-03-22 22:58:19 -04:00
Matthias Clasen
2506683cc3 reftests: Add a way to compare different runs
gtk-reftest already had an --output=DIR option to tell it where
to save all the resulting images. Now you can combine this with
the --compare-with=DIR option in a second run to make gtk-reftest
compare the .out.png files from the first run with the .out.png
files of the current run, instead of producing .ref.png files.

The intended use for this is to verify that changes do not affect
the generated output.
2015-03-22 22:58:09 -04:00
Matthias Clasen
bcfa4eec25 gtk-demo: Plug a memory leak 2015-03-22 22:57:13 -04:00
Matthias Clasen
59674ba8f4 widget-factory: Fix toolbar on page 3
Set toolbar-style to 'icons' to avoid rectangular buttons.
2015-03-22 22:57:05 -04:00
Vadim Rutkovsky
e497363d60 inspector: show accessible name and description 2015-03-22 22:56:55 -04:00
Bastien Nocera
e166747170 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-22 22:56:41 -04:00
Benjamin Otte
79ab6c8963 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-22 22:55:57 -04:00
Christian Hergert
2d5b801a28 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-22 22:55:29 -04:00
Matthias Clasen
beb19b389b 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-22 22:55:17 -04:00
Matthias Clasen
539caa897a 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-22 22:55:06 -04:00
Matthias Clasen
a816ccd496 3.16.0 2015-03-22 21:50:55 -04:00
Matthias Clasen
3a2f5634ee Updates 2015-03-22 21:50:55 -04:00
Andika Triwidada
4cee145764 Updated Indonesian translation 2015-03-23 00:06:08 +00:00
Jiro Matsuzawa
14289cfb3e l10n: Update Japanese translation 2015-03-23 02:54:19 +09:00
Andika Triwidada
9c45420bd8 Updated Indonesian translation 2015-03-22 09:30:19 +00:00
Samir Ribic
b4c6fb6334 Updated Bosnian translation 2015-03-22 07:54:46 +00:00
Muhammet Kara
686fec77cb Updated Turkish translation 2015-03-21 21:29:43 +00:00
Inaki Larranaga Murgoitio
f5051cca83 Updated Basque language 2015-03-21 17:01:29 +01:00
Inaki Larranaga Murgoitio
6f748c31ca Updated Basque language 2015-03-21 16:57:50 +01:00
Matthias Clasen
56583717fe HighContrast: Fix a typo
Commit 0a39d7d9 introduced a selected_bg_color with a missing $
in front of it.
2015-03-20 20:50:55 -04:00
Gábor Kelemen
1d93297a3a Updated Hungarian translation 2015-03-20 23:20:39 +00:00
Rico Tzschichholz
7c63374093 mir: Fix version annotation, the mir-backend is available since 3.16 2015-03-20 20:18:44 +01:00
Jakub Steiner
0a39d7d91e HighContrast: fix insensitive and backdrop states
- checkboxes, labels, menus/modelbuttons and buttons were
  a mixed bag for :insensitive and :backdrop

https://bugzilla.gnome.org/show_bug.cgi?id=746188
2015-03-20 13:08:17 +01:00
Carlos Garnacho
139ed7409f 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 20:15:55 -04:00
Carlos Garnacho
e995c0d1bf 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 20:15:55 -04:00
Carlos Garnacho
9ec5b3f9a1 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 20:15:55 -04:00
Kjartan Maraas
223209ecaa Updated Norwegian bokmål translation. 2015-03-19 21:26:44 +01:00
Милош Поповић
8d6b19533f Updated Serbian translation 2015-03-19 13:23:10 +00:00
Carlos Garnacho
17b65d3c8a 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 12:13:18 +01:00
Chao-Hsiung Liao
847a79c5f9 Updated Chinese (Taiwan) translation 2015-03-18 01:54:29 +00:00
Chao-Hsiung Liao
24db6d5518 Updated Chinese (Taiwan) translation 2015-03-18 01:51:13 +00: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
472 changed files with 168140 additions and 146134 deletions

View File

@@ -1,7 +1,7 @@
## Makefile.am for GTK+
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
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
@@ -21,7 +21,8 @@ EXTRA_DIST += \
gtk-zip.sh.in \
sanitize-la.sh \
po/README.translators \
po/po2tbl.sed.in
po/po2tbl.sed.in \
make-pot
MAINTAINERCLEANFILES = \
$(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \

464
NEWS
View File

@@ -1,3 +1,467 @@
Overview of changes in GTK+ 3.16.3
==================================
* Bug fixes:
737175 most horizontal sliders are inverted when scrolled with mouse...
746916 File chooser search does not work over remote network shares
746925 [HighContrast] Backdrop active (sensitive) GtkSwitch should l...
747634 gdk_set_program_class() breaks --class
747805 Split Headerbar unmaximize
747808 window: fix initial shadow width for maximized/fullscreen win...
748013 Adwaita: keyboard navigation outline on first/last button in ...
748014 W32: Tilting mousewheel left/right does not scroll horizontally
748061 GtkMessageDialog: Minor documentation update
748341 GdkOffscreenWindow should not segfault on gdk_window_beep()
748346 build: Avoid xgettext crash on MSYS2
748500 GtkSearchEntry docs incorrectly link to themselves
748615 GtkWindow: Get the correct shadow width even before window is...
748640 Documentation misses out example source files when not buildi...
748782 fontchooser should reload list of families/styles on theme ch...
748783 Remove PANGO_ENABLE_BACKEND from gtksettings.c
748992 GtkFontChooserWidget: Remove unused struct field
749009 notify test fails without a session bus
749012 GtkStack: Don't emit notify::visible-child during destruction
749021 GtkStackSwitcher: Don't emit notify::visible-child when setti...
* Translation updates:
Brazilian Portuguese
Czech
Danish
French
Icelandic
Occitan
Russian
Slovenian
Ukrainian
Overview of changes in GTK+ 3.16.2
==================================
* Bug fixes:
746706 Serious accessible event spewage from Gtk+ table cells
747288 [HighContrast] Insensitive backdrop ListBoxRow have an...
747471 [wayland] gdk_screen_get_monitor_geometry() returns in...
747539 popover: Remove signal handlers in dispose
747608 Scrollbar hiding / unhiding does not work with a stylus
747689 [HighContrast] Selected ListBoxRows Label is white on...
Avoid a crash in GtkApplication
Avoid a crash with GtkTreeview rubberbanding
GtkApplication: Prevent more crashes around shutdown
Prevent tab close button size changes
* Translation updates:
Icelandic
Swedish
Overview of changes in GTK+ 3.16.1
==================================
* Improve client-side decorations without a compositor
* Bug fixes:
132197 Horizontal Scrolling Using Modifier Key and Scroll Wheel
402168 Add underline-color and strikethrough-color to GtkTextTag properties
613833 Unnecessary queue_resize() for GtkImage
671362 Fixes for GtkRadioMenuItem
734741 GtkScale's fill-level starts at the very left if show-fill-level is set
737175 most horizontal sliders are inverted when scrolled with mouse wheel
746222 Improve CSD windows without a compositor
746253 has-tooltip property interferes with event-compression
746301 Opening "Sound" panel generates pixman error
746391 inspector: Make it easier to cut'n'paste advice message
746468 gtkcairoblur is slow
746586 critical warnings in a11y if focus widget is destroyed
746602 Invalid writes through dangling weak pointers in DND code cause crashes
746688 GtkProgressBar doesn't respect its style properties
746712 Range ignores the "inverted" property
746746 gtk3-demo 'OpenGL Area' crashes on systems with old OpenGL version
746784 GtkBooleanCellAccessible emits state-changed:checked signals instead...
746817 GtkRadioButton keynav uses wrong succession
746821 W32: Maximized window is obscured by the taskbar
746862 popover clears shadow of underlying widgets
746893 gtk_list_box_bind_model is not introspectable
746904 make it possible to disable libcanberra
746961 new scroll bar "hides" after click+drag+release while mouse is still...
747096 small cleanup in textbuffer clipoard handling
747133 overshoot animation is stopped on libinput-managed touchpads
747305 x11/gl: Use after free in glx_pixmap_get()
747406 Fix indicator proximity checks
747407 Make indicators pop out when needed
* GtkListBox
- There has been a minor API break on the return value of the
GtkListBoxCreateWidgetFunc callback. Previously, we would leak a
full reference returned by this callback and now we free it.
* Translation updates:
Basque
Catalan
Czech
Galician
Greek
Hebrew
Hungarian
Italian
Korean
Lithuanian
Polish
Russian
Slovak
Slovenian
Spanish
Tajik
Vietnamese
Overview of Changes in GTK+ 3.16.0
==================================
* Theming: Fixes for the HighContrast theme
* Wayland: Fix Clipboard handling
* Bug fixes:
746148 Overlay controls unusable in HighContrast
746149 “Close tab” buttons change the tab high on hover when using...
746188 insensitive ModelButtons are not drawn insensitive
746358 insensitive active backdrop GtkSwitches should probably loo...
746368 the “selected color” mark is always black, even for black
746369 “no date selection” (white on white)
746370 GtkExpander doesn't show it is expanded when using HighCont...
746386 clipboard crash when other client becomes the selection owner
* Translation updates:
Basque
Bosnian
Bulgarian
Chinese (Taiwan)
Hungarian
Indonesian
Japanese
Norwegian bokmål
Serbian
Swedish
Turkish
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
==================================

View File

@@ -76,8 +76,8 @@ Even better are git-formatted patches. (Use git format-patch)
Release notes for 3.16
======================
* GTK+ now includes an OpenGL rendering widget. To support GL on various
platforms, GTK+ uses libepoxy.
* GTK+ now includes an OpenGL rendering widget. To support GL on
various platforms, GTK+ uses libepoxy.
* GTK+ no longer uses gtk-update-icon-cache during its build. The
--enable-gtk2-dependency configure option has been removed.
@@ -99,6 +99,11 @@ Release notes for 3.16
has non-scrolling parts similar to treeview headers, there is no need
to implement this vfunc.
* The GtkSearchEntry widget has gained a number of new signals 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
======================

View File

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

View File

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

View File

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

View File

@@ -22,7 +22,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtk-encode-symbolic-svg", "
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gailutil", "gailutil.vcxproj", "{29E3E814-1BA3-4AD7-A3A7-3669CB80A942}"
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
Global
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|x64.ActiveCfg = Release|x64
{29E3E814-1BA3-4AD7-A3A7-3669CB80A942}.Release_Broadway|x64.Build.0 = Release|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.ActiveCfg = Debug|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.Build.0 = Debug|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.ActiveCfg = Debug|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.Build.0 = Debug|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.ActiveCfg = Release|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.Build.0 = Release|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.ActiveCfg = Release|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.Build.0 = Release|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|Win32.ActiveCfg = Debug_Broadway|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|Win32.Build.0 = Debug_Broadway|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|x64.ActiveCfg = Debug_Broadway|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|x64.Build.0 = Debug_Broadway|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|Win32.ActiveCfg = Release_Broadway|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|Win32.Build.0 = Release_Broadway|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.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}.Debug|Win32.ActiveCfg = Debug|Win32
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|Win32.Build.0 = Debug|Win32
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|x64.ActiveCfg = Debug|x64
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|x64.Build.0 = Debug|x64
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|Win32.ActiveCfg = Release|Win32
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|Win32.Build.0 = Release|Win32
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|x64.ActiveCfg = Release|x64
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|x64.Build.0 = Release|x64
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|Win32.ActiveCfg = Debug_Broadway|Win32
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|Win32.Build.0 = Debug_Broadway|Win32
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|x64.ActiveCfg = Debug_Broadway|x64
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|x64.Build.0 = Debug_Broadway|x64
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|Win32.ActiveCfg = Release_Broadway|Win32
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|Win32.Build.0 = Release_Broadway|Win32
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|x64.ActiveCfg = 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.Build.0 = Debug|Win32
{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>
<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>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/d2Zi+ %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<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>

View File

@@ -11,26 +11,69 @@
<GtkDoInstallBin>
mkdir $(CopyDir)\bin
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)" == "Debug_Broadway" goto DO_BROADWAY_BIN
copy "$(BinDir)\*.dll" $(CopyDir)\bin
copy "$(BinDir)\*-$(ApiVersion).lib" $(CopyDir)\lib
copy "$(BinDir)\*.exe" $(CopyDir)\bin
copy "$(BinDir)\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll" $(CopyDir)\bin
copy "$(BinDir)\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb" $(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
:DO_BROADWAY_BIN
copy "$(BinDir)\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll" $(CopyDir)\bin
copy "$(BinDir)\gdk-$(ApiVersion).lib" $(CopyDir)\lib
copy "$(BinDir)\broadwayd.exe" $(CopyDir)\bin
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(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" copy .\Release\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\*.exe $(CopyDir)\bin
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\*.exe $(CopyDir)\bin
copy "$(BinDir)\broadwayd.pdb" $(CopyDir)\bin
if "$(Configuration)" == "Release_Broadway" goto DO_BROADWAY_RELEASE
if "$(Configuration)" == "Debug_Broadway" goto DO_BROADWAY_DEBUG
:DO_BROADWAY_RELEASE
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb $(CopyDir)\bin
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb $(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
</GtkDoInstallBin>
<GtkDoInstall>
@@ -43,6 +86,7 @@ mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y
mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gtk\deprecated
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-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\gdkcairo.h $(CopyDir)\include\gtk-3.0\gdk\gdkcairo.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\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-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-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\gtkaboutdialog.h $(CopyDir)\include\gtk-3.0\gtk\gtkaboutdialog.h
copy ..\..\..\gtk\gtkaccelgroup.h $(CopyDir)\include\gtk-3.0\gtk\gtkaccelgroup.h
@@ -246,7 +292,7 @@ copy ..\..\..\gtk\gtkseparatormenuitem.h $(CopyDir)\include\gtk-3.0\gtk\gtksepar
copy ..\..\..\gtk\gtkseparatortoolitem.h $(CopyDir)\include\gtk-3.0\gtk\gtkseparatortoolitem.h
copy ..\..\..\gtk\gtksettings.h $(CopyDir)\include\gtk-3.0\gtk\gtksettings.h
copy ..\..\..\gtk\gtkshow.h $(CopyDir)\include\gtk-3.0\gtk\gtkshow.h
copy ..\..\..\gtk\gtksidebar.h $(CopyDir)\include\gtk-3.0\gtk\gtksidebar.h
copy ..\..\..\gtk\gtkstacksidebar.h $(CopyDir)\include\gtk-3.0\gtk\gtkstacksidebar.h
copy ..\..\..\gtk\gtksizegroup.h $(CopyDir)\include\gtk-3.0\gtk\gtksizegroup.h
copy ..\..\..\gtk\gtksizerequest.h $(CopyDir)\include\gtk-3.0\gtk\gtksizerequest.h
copy ..\..\..\gtk\gtksocket.h $(CopyDir)\include\gtk-3.0\gtk\gtksocket.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\gtktypebuiltins.h $(CopyDir)\include\gtk-3.0\gtk\gtktypebuiltins.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\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

View File

@@ -35,8 +35,8 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}</ProjectGuid>
<RootNamespace>install</RootNamespace>
<ProjectGuid>{2093D218-190E-4194-9421-3BA7CBF33B15}</ProjectGuid>
<RootNamespace>gtkinstall</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -219,4 +219,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</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>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
@@ -108,6 +109,7 @@
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -132,6 +134,7 @@
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine>
@@ -151,6 +154,7 @@
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>

View File

@@ -161,6 +161,7 @@
<ItemGroup>
<ClCompile Include="..\..\..\demos\icon-browser\iconbrowserapp.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\resources.c" />
</ItemGroup>

View File

@@ -17,6 +17,7 @@
<ItemGroup>
<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\iconstore.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>
</ItemGroup>

View File

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

View File

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

View File

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

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}
EndProjectSection
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
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F7} = {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F7}
{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|x64.ActiveCfg = Release|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}.Release_Broadway|x64.Build.0 = Release|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.ActiveCfg = Debug|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.Build.0 = Debug|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.ActiveCfg = Debug|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.Build.0 = Debug|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.ActiveCfg = Release|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.Build.0 = Release|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.ActiveCfg = Release|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.Build.0 = Release|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|Win32.ActiveCfg = Debug_Broadway|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|Win32.Build.0 = Debug_Broadway|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|x64.ActiveCfg = Debug_Broadway|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug_Broadway|x64.Build.0 = Debug_Broadway|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|Win32.ActiveCfg = Release_Broadway|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release_Broadway|Win32.Build.0 = Release_Broadway|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.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}.Debug|Win32.ActiveCfg = Debug|Win32
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|Win32.Build.0 = Debug|Win32
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|x64.ActiveCfg = Debug|x64
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug|x64.Build.0 = Debug|x64
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|Win32.ActiveCfg = Release|Win32
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|Win32.Build.0 = Release|Win32
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|x64.ActiveCfg = Release|x64
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release|x64.Build.0 = Release|x64
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|Win32.ActiveCfg = Debug_Broadway|Win32
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|Win32.Build.0 = Debug_Broadway|Win32
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|x64.ActiveCfg = Debug_Broadway|x64
{2093D218-190E-4194-9421-3BA7CBF33B15}.Debug_Broadway|x64.Build.0 = Debug_Broadway|x64
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|Win32.ActiveCfg = Release_Broadway|Win32
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|Win32.Build.0 = Release_Broadway|Win32
{2093D218-190E-4194-9421-3BA7CBF33B15}.Release_Broadway|x64.ActiveCfg = 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.Build.0 = Debug|Win32
{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"
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"
AdditionalOptions="/MP"
/>
<Tool
Name="VCLinkerTool"

View File

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

View File

@@ -10,26 +10,63 @@
Value="
mkdir $(CopyDir)\bin&#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;Debug_Broadway&quot; goto DO_BROADWAY_BIN&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\*.dll $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\*-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\*.exe $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb $(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;
: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;
if &quot;$(ConfigurationName)&quot; == &quot;Release_Broadway&quot; copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(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; copy .\Release\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Release_Broadway&quot; copy .\Release\$(PlatformName)\bin\*.exe $(CopyDir)\bin&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Debug_Broadway&quot; copy .\Debug\$(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;
if &quot;$(ConfigurationName)&quot; == &quot;Debug_Broadway&quot; copy .\Debug\$(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;
if &quot;$(ConfigurationName)&quot; == &quot;Debug_Broadway&quot; copy .\Debug\$(PlatformName)\bin\*.exe $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\broadwayd.pdb $(CopyDir)\bin&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Release_Broadway&quot; goto DO_BROADWAY_RELEASE&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Debug_Broadway&quot; goto DO_BROADWAY_DEBUG&#x0D;&#x0A;
:DO_BROADWAY_RELEASE&#x0D;&#x0A;
copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
copy .\Release\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
copy .\Release\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib&#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;
"
/>
@@ -45,6 +82,7 @@ mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y&#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\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\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;
@@ -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\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-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-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\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;
@@ -248,7 +288,7 @@ copy ..\..\..\gtk\gtkseparatormenuitem.h $(CopyDir)\include\gtk-3.0\gtk\gtksepar
copy ..\..\..\gtk\gtkseparatortoolitem.h $(CopyDir)\include\gtk-3.0\gtk\gtkseparatortoolitem.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtksettings.h $(CopyDir)\include\gtk-3.0\gtk\gtksettings.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtkshow.h $(CopyDir)\include\gtk-3.0\gtk\gtkshow.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtksidebar.h $(CopyDir)\include\gtk-3.0\gtk\gtksidebar.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtkstacksidebar.h $(CopyDir)\include\gtk-3.0\gtk\gtkstacksidebar.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtksizegroup.h $(CopyDir)\include\gtk-3.0\gtk\gtksizegroup.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtksizerequest.h $(CopyDir)\include\gtk-3.0\gtk\gtksizerequest.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtksocket.h $(CopyDir)\include\gtk-3.0\gtk\gtksocket.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\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\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\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;

View File

@@ -158,6 +158,7 @@
>
<File RelativePath="..\..\..\demos\icon-browser\iconbrowserapp.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\resources.c" />
</Filter>

View File

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

View File

@@ -9,9 +9,9 @@
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
m4_define([gtk_major_version], [3])
m4_define([gtk_minor_version], [15])
m4_define([gtk_micro_version], [4])
m4_define([gtk_interface_age], [0])
m4_define([gtk_minor_version], [16])
m4_define([gtk_micro_version], [3])
m4_define([gtk_interface_age], [3])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
m4_define([gtk_version],
@@ -41,14 +41,14 @@ AC_CANONICAL_HOST
m4_define([gtk_binary_version], [3.0.0])
# 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([atk_required_version], [2.15.1])
m4_define([cairo_required_version], [1.14.0])
m4_define([gdk_pixbuf_required_version], [2.30.0])
m4_define([introspection_required_version], [1.39.0])
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])
GLIB_REQUIRED_VERSION=glib_required_version
PANGO_REQUIRED_VERSION=pango_required_version
@@ -147,7 +147,6 @@ AC_PROG_MKDIR_P
AC_PROG_INSTALL
AC_PROG_MAKE_SET
GETTEXT_PACKAGE=gtk30
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
@@ -349,8 +348,7 @@ backend_immodules=
have_gio_unix=no
GDK_BACKENDS=
GDK_EXTRA_LIBS=
# expoxy.pc has Cflags: -I${includedir}, but pkg-config swallows that :-(
GDK_EXTRA_CFLAGS="-I${prefix}/include"
GDK_EXTRA_CFLAGS=
GDK_WINDOWING=
PANGO_PACKAGES="pango pangocairo"
@@ -475,6 +473,7 @@ if test "$enable_mir_backend" = "yes"; then
GDK_WINDOWING="$GDK_WINDOWING
#define GDK_WINDOWING_MIR"
MIR_PACKAGES="$MIR_DEPENDENCIES"
have_gio_unix=yes
AM_CONDITIONAL(USE_MIR, true)
else
@@ -666,6 +665,15 @@ fi
# i18n stuff
ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`"
AM_GLIB_GNU_GETTEXT
AC_MSG_CHECKING([whether xgettext supports ui files])
if $ac_cv_path_XGETTEXT --output=- --color=no --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"
AC_CONFIG_COMMANDS([po-properties],
[[case "$CONFIG_FILES" in *po-properties/Makefile.in*)
@@ -818,7 +826,7 @@ AC_TYPE_UID_T
# Check for round(), rint(), isnan(), isinf() and nearbyint()
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>]])
# Checks for gdkspawn
@@ -1023,22 +1031,16 @@ if test "x$enable_x11_backend" = xyes; then
AC_CHECK_FUNC(XextFindDisplay, :,
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_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlibint.h>]],
[[xReply *rep = NULL;
rep = rep;]])],
[AC_MSG_RESULT([no])],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/XIproto.h>
#include <X11/Xlibint.h>]],
[[xReply *rep = NULL;
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])])])
AC_CHECK_TYPE([xReply], ,
[AC_CHECK_TYPE([xReply],
[AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], 1,
[Define if <X11/extensions/XIproto.h> needed for xReply])],
[AC_MSG_ERROR([xReply type unavailable. X11 is too old])],
[[#include <X11/extensions/XIproto.h>
#include <X11/Xlibint.h>]])],
[[#include <X11/Xlibint.h>]])
# Check for XKB support.
@@ -1658,12 +1660,35 @@ AM_CONDITIONAL(HAVE_COLORD, test "x$have_colord" = "xyes")
# Check for libcanberra (only used in examples)
##################################################
PKG_CHECK_MODULES(LIBCANBERRA, libcanberra-gtk3,
have_libcanberra=yes, have_libcanberra=no)
if test "$have_libcanberra" = "yes"; then
AC_DEFINE(HAVE_LIBCANBERRA, 1, [define if we have libcanberra])
AC_ARG_ENABLE(libcanberra,
[AS_HELP_STRING([--enable-libcanberra],
[enable libcanberra support in examples [default=auto]])],
[enable_libcanberra="$enableval"],
[enable_libcanberra=auto])
AC_MSG_CHECKING([whether to use libcanberra])
if test "$enable_libcanberra" != "no"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
have_libcanberra=no
if test "$enable_libcanberra" != "no"; then
PKG_CHECK_MODULES(LIBCANBERRA, libcanberra-gtk3,
have_libcanberra=yes, have_libcanberra=no)
if test "$enable_libcanberra" = "yes"; then
if test "$have_libcanberra" = "no"; then
AC_MSG_ERROR([--enable-libcanberra specified, but not available])
fi
fi
fi
if test "$have_libcanberra" = "yes"; then
AC_DEFINE(HAVE_LIBCANBERRA, 1, [define if we have libcanberra])
fi
AM_CONDITIONAL(HAVE_LIBCANBERRA, test "x$have_libcanberra" = "xyes")
##################################################
# Checks for gtk-doc and docbook-tools
##################################################
@@ -1906,7 +1931,6 @@ gtk/makefile.msc
gtk/gtkversion.h
gtk/gtk-win32.rc
gtk/libgtk3.manifest
util/Makefile
libgail-util/Makefile
modules/Makefile
modules/input/Makefile
@@ -1937,6 +1961,7 @@ echo " Print backends: $PRINT_BACKENDS"
echo " Dynamic modules: $build_dynamic_modules"
echo " Included immodules: $included_immodules"
echo " colord support: $have_colord"
echo " libcanberra support: $have_libcanberra"
echo " Introspection: $found_introspection"
echo " Debugging: $enable_debug"
echo " Documentation: $enable_gtk_doc"

View File

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

View File

@@ -2,7 +2,7 @@
*
* Demonstrates migrating a window between different displays.
* A display is a mouse and keyboard with some number of
* associated monitors. The neat thing about having multiple
* associated monitors. The neat thing about having multiple
* displays is that they can be on a completely separate
* computers, as long as there is a network connection to the
* computer where the application is running.
@@ -26,9 +26,6 @@
* - Using GtkDialog
*/
#include <string.h>
#undef GDK_DISABLE_DEPRECATED
#include <glib/gi18n.h>
#include <gtk/gtk.h>

View File

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

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.
*/
#include <math.h>
#include <gtk/gtk.h>
#include <epoxy/gl.h>
@@ -23,35 +24,270 @@ enum {
static float rotation_angles[N_AXIS] = { 0.0 };
/* 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));
if (gtk_gl_area_get_error (GTK_GL_AREA (widget)) != NULL)
return;
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));
if (gtk_gl_area_get_error (GTK_GL_AREA (widget)) != NULL)
return;
glDeleteBuffers (1, &position_buffer);
glDeleteProgram (program);
}
static void
draw_triangle (void)
{
glColor3f (1.0f, 0.85f, 0.35f);
glBegin (GL_TRIANGLES);
{
glVertex3f ( 0.0, 0.6, 0.0);
glVertex3f (-0.2, -0.3, 0.0);
glVertex3f ( 0.2, -0.3, 0.0);
}
glEnd ();
float mvp[16];
/* Compute the model view projection matrix using the
* rotation angles specified through the GtkRange widgets
*/
compute_mvp (mvp,
rotation_angles[X_AXIS],
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
render (GtkGLArea *area,
GdkGLContext *context)
{
if (gtk_gl_area_get_error (area) != NULL)
return FALSE;
/* Clear the viewport */
glClearColor (0.5, 0.5, 0.5, 1.0);
glClear (GL_COLOR_BUFFER_BIT);
glMatrixMode (GL_MODELVIEW);
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 our object */
draw_triangle ();
/* Flush the contents of the pipeline */
glFlush ();
return TRUE;
@@ -138,7 +374,7 @@ create_glarea_window (GtkWidget *do_widget)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
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_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);
g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL);
@@ -151,7 +387,13 @@ create_glarea_window (GtkWidget *do_widget)
gtk_widget_set_vexpand (gl_area, TRUE);
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);
controls = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE);

View File

@@ -218,7 +218,6 @@ add_columns (GtkTreeView *treeview)
/* column for symbolic icon */
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",
renderer,
"icon-name",

View File

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

View File

@@ -42,6 +42,34 @@ window_key_press_event_cb (GtkWidget *widget,
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 *
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);
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);
label = gtk_label_new ("");
@@ -108,6 +138,27 @@ do_search_entry2 (GtkWidget *do_widget)
G_CALLBACK (search_changed_cb), label);
g_signal_connect (entry, "changed",
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))

View File

@@ -1,9 +1,9 @@
/* Sidebar
/* Stack Sidebar
*
* GtkSidebar provides an automatic sidebar widget to control navigation
* of a GtkStack object. This widget automatically updates it content
* based on what is presently available in the GtkStack object, and
* using the "title" child property to set the display labels.
* GtkStackSidebar provides an automatic sidebar widget to control
* navigation of a GtkStack object. This widget automatically updates it
* content based on what is presently available in the GtkStack object,
* and using the "title" child property to set the display labels.
*/
#include <glib/gi18n.h>
@@ -21,7 +21,7 @@ do_sidebar (GtkWidget *do_widget)
GtkWidget *header;
const gchar* pages[] = {
"Welcome to GTK+",
"GtkSidebar Widget",
"GtkStackSidebar Widget",
"Automatic navigation",
"Consistent appearance",
"Scrolling",
@@ -43,18 +43,18 @@ do_sidebar (GtkWidget *do_widget)
header = gtk_header_bar_new ();
gtk_header_bar_set_show_close_button (GTK_HEADER_BAR(header), TRUE);
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_CALLBACK (gtk_widget_destroyed), &window);
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);
stack = gtk_stack_new ();
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 */
widget = gtk_separator_new (GTK_ORIENTATION_VERTICAL);

View File

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

View File

@@ -1,6 +1,7 @@
#include <string.h>
#include "iconbrowserapp.h"
#include "iconbrowserwin.h"
#include "iconstore.h"
#include <gtk/gtk.h>
typedef struct
@@ -42,13 +43,6 @@ struct _IconBrowserWindowClass
GtkApplicationWindowClass parent_class;
};
enum {
NAME_COLUMN,
SYMBOLIC_NAME_COLUMN,
DESCRIPTION_COLUMN,
CONTEXT_COLUMN
};
G_DEFINE_TYPE(IconBrowserWindow, icon_browser_window, GTK_TYPE_APPLICATION_WINDOW);
static void
@@ -64,16 +58,31 @@ search_text_changed (GtkEntry *entry, IconBrowserWindow *win)
gtk_tree_model_filter_refilter (win->filter_model);
}
static void
set_image (GtkWidget *image, const gchar *name, gint size)
static GdkPixbuf *
get_icon (GtkWidget *image, const gchar *name, gint size)
{
gtk_image_set_from_icon_name (GTK_IMAGE (image), name, 1);
gtk_image_set_pixel_size (GTK_IMAGE (image), size);
GtkIconInfo *info;
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
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
@@ -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);
if (win->symbolic)
column = SYMBOLIC_NAME_COLUMN;
column = ICON_STORE_SYMBOLIC_NAME_COLUMN;
else
column = NAME_COLUMN;
column = ICON_STORE_NAME_COLUMN;
gtk_tree_model_get (GTK_TREE_MODEL (win->filter_model), &iter,
column, &name,
DESCRIPTION_COLUMN, &description,
ICON_STORE_DESCRIPTION_COLUMN, &description,
-1);
if (name == NULL || !gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), name))
{
g_free (description);
@@ -146,10 +155,10 @@ add_icon (IconBrowserWindow *win,
symbolic_name = NULL;
}
gtk_list_store_insert_with_values (win->store, NULL, -1,
NAME_COLUMN, regular_name,
SYMBOLIC_NAME_COLUMN, symbolic_name,
DESCRIPTION_COLUMN, description,
CONTEXT_COLUMN, context,
ICON_STORE_NAME_COLUMN, regular_name,
ICON_STORE_SYMBOLIC_NAME_COLUMN, symbolic_name,
ICON_STORE_DESCRIPTION_COLUMN, description,
ICON_STORE_CONTEXT_COLUMN, context,
-1);
}
@@ -702,13 +711,13 @@ icon_visible_func (GtkTreeModel *model,
search_text = gtk_entry_get_text (GTK_ENTRY (win->searchentry));
if (win->symbolic)
column = SYMBOLIC_NAME_COLUMN;
column = ICON_STORE_SYMBOLIC_NAME_COLUMN;
else
column = NAME_COLUMN;
column = ICON_STORE_NAME_COLUMN;
gtk_tree_model_get (model, iter,
column, &name,
CONTEXT_COLUMN, &context,
ICON_STORE_CONTEXT_COLUMN, &context,
-1);
if (!name)
visible = FALSE;
@@ -731,9 +740,11 @@ symbolic_toggled (GtkToggleButton *toggle, IconBrowserWindow *win)
win->symbolic = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle));
if (win->symbolic)
column = SYMBOLIC_NAME_COLUMN;
column = ICON_STORE_SYMBOLIC_NAME_COLUMN;
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->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));
}
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
icon_browser_window_init (IconBrowserWindow *win)
{
GtkTargetList *list;
GtkTargetEntry *targets;
gint n_targets;
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);
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));
g_signal_connect (win->searchbar, "notify::search-mode-enabled",
G_CALLBACK (search_mode_toggled), win);
@@ -771,6 +837,8 @@ icon_browser_window_init (IconBrowserWindow *win)
static void
icon_browser_window_class_init (IconBrowserWindowClass *class)
{
g_type_ensure (ICON_STORE_TYPE);
gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (class),
"/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_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), selected_context_changed);
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"?>
<interface>
<!-- interface-requires gtk+ 3.8 -->
<object class="GtkListStore" id="store">
<columns>
<column type="gchararray"/>
<column type="gchararray"/>
<column type="gchararray"/>
<column type="gchararray"/>
</columns>
<object class="IconStore" id="store">
</object>
<object class="GtkTreeModelFilter" id="filter_model">
<property name="child_model">store</property>
@@ -108,7 +102,8 @@
<object class="GtkIconView" id="list">
<property name="visible">True</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"/>
<child>
<object class="GtkCellRendererPixbuf" id="cell">
@@ -156,12 +151,17 @@
<property name="row-spacing">10</property>
<property name="column-spacing">10</property>
<child>
<object class="GtkImage" id="image1">
<object class="GtkEventBox">
<property name="visible">True</property>
<property name="xpad">4</property>
<property name="ypad">4</property>
<property name="halign">center</property>
<property name="valign">end</property>
<child>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="xpad">4</property>
<property name="ypad">4</property>
<property name="halign">center</property>
<property name="valign">end</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">0</property>
@@ -169,12 +169,17 @@
</packing>
</child>
<child>
<object class="GtkImage" id="image2">
<object class="GtkEventBox">
<property name="visible">True</property>
<property name="xpad">4</property>
<property name="ypad">4</property>
<property name="halign">center</property>
<property name="valign">end</property>
<child>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="xpad">4</property>
<property name="ypad">4</property>
<property name="halign">center</property>
<property name="valign">end</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">1</property>
@@ -182,12 +187,17 @@
</packing>
</child>
<child>
<object class="GtkImage" id="image3">
<object class="GtkEventBox">
<property name="visible">True</property>
<property name="xpad">4</property>
<property name="ypad">4</property>
<property name="halign">center</property>
<property name="valign">end</property>
<child>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="xpad">4</property>
<property name="ypad">4</property>
<property name="halign">center</property>
<property name="valign">end</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">2</property>
@@ -195,12 +205,17 @@
</packing>
</child>
<child>
<object class="GtkImage" id="image4">
<object class="GtkEventBox">
<property name="visible">True</property>
<property name="xpad">4</property>
<property name="ypad">4</property>
<property name="halign">center</property>
<property name="valign">end</property>
<child>
<object class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="xpad">4</property>
<property name="ypad">4</property>
<property name="halign">center</property>
<property name="valign">end</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">3</property>
@@ -208,12 +223,17 @@
</packing>
</child>
<child>
<object class="GtkImage" id="image5">
<object class="GtkEventBox">
<property name="visible">True</property>
<property name="xpad">4</property>
<property name="ypad">4</property>
<property name="halign">center</property>
<property name="valign">end</property>
<child>
<object class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="xpad">4</property>
<property name="ypad">4</property>
<property name="halign">center</property>
<property name="valign">end</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">4</property>

View File

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

View File

@@ -1157,7 +1157,7 @@ activate (GApplication *app)
g_type_ensure (my_text_view_get_type ());
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_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_USER);
@@ -1336,6 +1336,7 @@ int
main (int argc, char *argv[])
{
GtkApplication *app;
GAction *action;
static GActionEntry app_entries[] = {
{ "about", activate_about, NULL, NULL, NULL },
{ "quit", activate_quit, NULL, NULL, NULL },
@@ -1353,6 +1354,8 @@ main (int argc, char *argv[])
g_action_map_add_action_entries (G_ACTION_MAP (app),
app_entries, G_N_ELEMENTS (app_entries),
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);

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">
<file preprocess="xml-stripblanks">widget-factory.ui</file>
</gresource>
<gresource prefix="/org/gtk/WidgetFactory">
<file>widget-factory.css</file>
</gresource>
<gresource prefix="/org/gtk/WidgetFactory/gtk">
<file preprocess="xml-stripblanks">menus.ui</file>
</gresource>

View File

@@ -1060,6 +1060,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<object class="GtkFileChooserButton" id="filechooserbutton1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="local_only">False</property>
</object>
<packing>
<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="reorderable">True</property>
<child>
<object class="GtkCellRendererPixbuf" id="cellrendererpixbuf1">
<property name="follow_state">true</property>
</object>
<object class="GtkCellRendererPixbuf" id="cellrendererpixbuf1"/>
<attributes>
<attribute name="icon_name">1</attribute>
</attributes>
@@ -2895,6 +2894,15 @@ microphone-sensitivity-medium-symbolic</property>
<property name="tooltip-text" translatable="yes">Search for it</property>
</object>
</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>
</child>
<child>
@@ -3073,9 +3081,7 @@ microphone-sensitivity-medium-symbolic</property>
<property name="selection_mode">multiple</property>
<property name="model">iconsmodel</property>
<child>
<object class="GtkCellRendererPixbuf" id="iconviewcell">
<property name="follow-state">True</property>
</object>
<object class="GtkCellRendererPixbuf" id="iconviewcell"/>
<attributes>
<attribute name="icon-name">0</attribute>
</attributes>
@@ -3400,7 +3406,7 @@ microphone-sensitivity-medium-symbolic</property>
<property name="visible">True</property>
<property name="orientation">horizontal</property>
<child>
<object class="GtkSidebar">
<object class="GtkStackSidebar">
<property name="visible">True</property>
<property name="stack">sidebar_stack</property>
</object>
@@ -3621,6 +3627,7 @@ microphone-sensitivity-medium-symbolic</property>
<object class="GtkToolbar">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="toolbar-style">icons</property>
<property name="icon-size">1</property>
<child>
<object class="GtkToolButton" id="toolbutton1">
@@ -3860,11 +3867,41 @@ microphone-sensitivity-medium-symbolic</property>
<property name="visible">True</property>
<property name="height-request">120</property>
</object>
<packing>
<property name="tab-expand">True</property>
<property name="tab-fill">True</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel">
<object class="GtkBox">
<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>
</child>
<child>
@@ -3872,11 +3909,41 @@ microphone-sensitivity-medium-symbolic</property>
<property name="visible">True</property>
<property name="vexpand">True</property>
</object>
<packing>
<property name="tab-expand">True</property>
<property name="tab-fill">True</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel">
<object class="GtkBox">
<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>
</child>
</object>

View File

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

View File

@@ -1288,12 +1288,25 @@ gdk_frame_get_type
<SECTION>
<FILE>gdkglcontext</FILE>
GdkGLContext
gdk_gl_context_get_display
gdk_gl_context_get_window
gdk_gl_context_make_current
gdk_gl_context_clear_current
gdk_gl_context_get_current
GdkGLProfile
gdk_gl_context_get_shared_context
gdk_gl_context_get_version
<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
gdk_gl_context_realize
gdk_gl_context_make_current
gdk_gl_context_get_current
gdk_gl_context_clear_current
<SUBSECTION Standard>
GDK_GL_CONTEXT

View File

@@ -19,85 +19,217 @@ HFILE_GLOB=$(top_srcdir)/gtk/*.h
CFILE_GLOB=$(top_srcdir)/gtk/*.c
# 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 \
gtkactionmuxer.h \
gtkactionobserver.h \
gtkactionobservable.h \
gtk9slice.h \
gtkanimationdescription.h \
gtkbitmaskprivateimpl.h \
gtkbookmarksmanager.h \
gtkdbusgenerated.c \
gtkdbusgenerated.h \
gtkdebug.h \
gtkactionhelper.h \
gtkapplicationprivate.h \
gtkbuilderprivate.h \
gtkcolorchooserprivate.h \
gtkcoloreditorprivate.h \
gtkcolorplaneprivate.h \
gtkcolorscaleprivate.h \
gtkcolorswatchprivate.h \
gtkdndcursors.h \
gtkentryprivate.h \
gtkfilechooserdefault.h \
gtkfilechooserembed.h \
gtkfilechooserentry.h \
gtkfilechooserprivate.h \
gtkfilechoosersettings.h \
gtkfilechooserutils.h \
gtkfilesystem.h \
gtkfilesystemmodel.h \
gtkfilesystemunix.h \
gtkfilesystemwin32.h \
gtkfontchooserutils.h \
gtkiconcache.h \
gtkiconcachevalidator.h \
gtkiconthemeparser.h \
gtkintl.h \
gtkkeyhash.h \
gtkkineticscrolling.h \
gtkmarshal.h \
gtkmenuprivate.h \
gtkmnemonichash.h \
gtkmenutracker.h \
gtkmenutrackeritem.h \
gtkmenusectionbox.h \
gtkmodelmenu.h \
gtkmodelmenuitem.h \
gtkmodifierstyle.h \
gtkpathbar.h \
gtkplugprivate.h \
gtkprintbackend.h \
gtkprinteroption.h \
gtkprinteroptionset.h \
gtkprinteroptionwidget.h \
gtkprinter-private.h \
gtkprint-win32.h \
gtkprintutils.h \
gtkprintoperation-private.h \
gtkprivate.h \
gtkprivatetypebuiltins.h \
gtkquery.h \
gtkrbtree.h \
gtkrecentchooserdefault.h \
gtkrecentchooserutils.h \
gtkrecentchooserprivate.h \
gtksearchengine.h \
gtksearchenginebeagle.h \
gtksearchenginetracker.h \
gtksearchenginesimple.h \
gtksearchenginequartz.h \
gtksequence.h \
gtksocketprivate.h \
gtktextbtree.h \
gtktextbufferserializ.h \
gtktextchildprivate.h \
gtktextbufferserialize.h \
gtktextdisplay.h \
gtktexthandleprivate.h \
gtktextiterprivate.h \
gtktextlayout.h \
gtktextmarkprivate.h \
gtktextsegment.h \
gtktexttagprivate.h \
gtktexttypes.h \
gtktextutil.h \
gtktimeline.h \
gtkthemes.h \
gtktrashmonitor.h \
gtktrayicon.h \
gtktreedatalist.h \
gtktreeprivate.h \
gtktoolpaletteprivate.h \
gtktreemenu.h \
gtktypebuiltins.h \
gtkxembed.h \
gtkwin32embed.h \
@@ -129,6 +261,8 @@ GTKDOC_LIBS = \
# Extra options to supply to gtkdoc-mkdb
MKDB_OPTIONS=--output-format=xml --name-space=gtk
MKHTML_OPTIONS="--path=\"$(abs_srcdir):$(top_srcdir)/examples\""
# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE)
content_files = \
version.xml \
@@ -172,6 +306,7 @@ expand_content_files = \
drawing-model.xml \
getting_started.xml \
glossary.xml \
input-handling.xml \
migrating-2to3.xml \
migrating-checklist.sgml \
migrating-unique-GtkApplication.xml \

View File

@@ -5,6 +5,21 @@
<chapter id="gtk-getting-started" xmlns:xi="http://www.w3.org/2003/XInclude">
<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
started with GTK+ programming. It assumes that you have GTK+, its
dependencies and a C compiler installed and ready to use. If you
@@ -15,8 +30,8 @@
<section>
<title>Basics</title>
<para>To begin our introduction to GTK, we'll start with the simplest
program possible. This program will create an empty 200 × 200 pixel
<para>To begin our introduction to GTK, we'll start with a simple
signal-based Gtk application. This program will create an empty 200 × 200 pixel
window.</para>
<informalfigure>
@@ -28,7 +43,7 @@
</informalfigure>
<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>
</informalexample>
@@ -52,45 +67,66 @@
by third party code. The compiler will abort with an error if any other
header is directly included.</para></warning>
<para>We then proceed into the <function>main</function>() function of the
application, and we declare a <varname>window</varname> variable as a pointer
of type #GtkWidget.</para>
<para>In a GTK+ application, the purpose of the main() function is to
create a #GtkApplication object and run it. In this example a
#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
is the initialization function for GTK+; this function will set up GTK+,
the type system, the connection to the windowing environment, etc. The
gtk_init() takes as arguments the pointers to the command line arguments
<para>When creating a #GtkApplication
you need to pick an application identifier (a name)
and input to gtk_application_new() as parameter.
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
arguments that control the behavior of GTK+ itself. The parsed arguments
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+
recognizes, please refer to the <link linkend="gtk-running">Running GTK+
Applications</link> section in this reference.</para></note>
<para>Within g_application_run the activate() signal is sent and
we then proceed into the <function>activate</function>() function of the
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
it inside the <varname>window</varname> variable. The type of the window
is %GTK_WINDOW_TOPLEVEL, which means that the #GtkWindow will be managed
by the windowing system: it will have a frame, a title bar and window
controls, depending on the platform.</para>
<para>A window title is set using gtk_window_set_title(). This function
takes a GtkWindow* pointer and a string as input. As our
<varname>window</varname> pointer is a GtkWidget pointer, we need to cast it
to GtkWindow*.
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
destroyed, we connect the #GtkWidget::destroy signal to the gtk_main_quit()
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>Finally the window size is set using gtk_window_set_default_size and
the window is then shown by GTK via gtk_widget_show_all().</para>
<para>#GtkWidget<!-- -->s are hidden by default. By calling gtk_widget_show()
on a #GtkWidget we are asking GTK+ to set the visibility attribute so that it
can be displayed. All this work is done after the main loop has been
started.</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>When you exit the window, by for example pressing the X,
the g_application_run() in the main loop returns with a number
which is saved inside an integer named "status". Afterwards, the
#GtkApplication object is freed from memory with g_object_unref().
Finally the status integer is returned and the GTK application exits.</para>
<para>While the program is running, GTK+ is receiving
<firstterm>events</firstterm>. These are typically input events caused by
@@ -129,13 +165,53 @@
</para>
</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>
<title>Packing</title>
<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
could simply use a gtk_container_add() call to "pack" the widget into the
window. But when you want to put more than one widget into a window, it
inside a window.
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.
This is where packing comes in.</para>
@@ -167,51 +243,6 @@
</para>
</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>
<title>Building user interfaces</title>
@@ -1006,4 +1037,50 @@ example_app_window_init (ExampleAppWindow *win)
here.</para>
</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>

View File

@@ -25,7 +25,7 @@
<xi:include href="resources.sgml" />
<xi:include href="xml/question_index.sgml" />
<xi:include href="drawing-model.xml" />
<xi:include href="input-handling.xml" />
<xi:include href="xml/input-handling.xml" />
</part>
@@ -76,7 +76,7 @@
<xi:include href="xml/gtkflowbox.xml" />
<xi:include href="xml/gtkstack.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/gtkheaderbar.xml" />
<xi:include href="xml/gtkoverlay.xml" />

View File

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

View File

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

View File

@@ -4,21 +4,21 @@
]>
<refentry id="chap-input-handling">
<refmeta>
<refentrytitle>The GTK+ Input Handling Model</refentrytitle>
<refentrytitle>The GTK+ Input and Event Handling Model</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>The GTK+ Input Handling Model</refname>
<refname>The GTK+ Input and Event Handling Model</refname>
<refpurpose>
GTK+ input handling in detail
GTK+ input and event handling in detail
</refpurpose>
</refnamediv>
<refsect1 id="input-overview">
<title>Overview of GTK+ input handling</title>
<title>Overview of GTK+ input and event handling</title>
<para>
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.
Typical input events are:
<simplelist>
<member>GdkEventButton</member>
<member>GdkEventMotion</member>
<member>GdkEventCrossing</member>
<member>GdkEventKey</member>
<member>GdkEventFocus</member>
<member>GdkEventTouch</member>
<member>#GdkEventButton</member>
<member>#GdkEventMotion</member>
<member>#GdkEventCrossing</member>
<member>#GdkEventKey</member>
<member>#GdkEventFocus</member>
<member>#GdkEventTouch</member>
</simplelist>
</para>
<para>
Additionally, GDK/GTK synthesizes other signals to let know whether
grabs (system-wide or in-app) are taking input away:
<simplelist>
<member>GdkEventGrabBroken</member>
<member>GtkWidget::grab-notify</member>
<member>#GdkEventGrabBroken</member>
<member>#GtkWidget::grab-notify</member>
</simplelist>
</para>
<para>
@@ -87,80 +87,167 @@
</para>
</refsect2>
<refsect2>
<refsect2 id="event-propagation">
<title>Event propagation</title>
<para>
When GTK+ receives an event, it determines the target widget that
it is directed to. Unless grabs are involved, this is done by finding
the widget to which the window of the event belongs.
For widgets which have a #GdkWindow set, events are received from the
windowing system and passed to gtk_main_do_event(). See its documentation
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>
The event is then propagated from the toplevel window down to the
target widget. In this phase, which is known as the “capture” phase,
gestures that are attached with GTK_PHASE_CAPTURE get a chance
to react to the event.
When a GDK backend produces an input event, it is tied to a #GdkDevice and
a #GdkWindow, which in turn represents a windowing system surface in the
backend. If a widget has grabbed the current input device, or all input
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>
After the “capture” phase, the widget that was intended to be the
destination of the event will let run gestures attached to it with
GTK_PHASE_TARGET. This is known as the “target” phase, and does only
happen on that widget.
destination of the event will run gestures attached to it with
%GTK_PHASE_TARGET. This is known as the “target” phase, and only
happens on that widget.
</para>
<para>
Next, the appropriate event signal is emitted for the event in question,
e.g. “motion-notify-event”. Handling these signals was the primary
way to handle input in GTK+ widgets before gestures were introduced.
The signals are emitted from the target widget up to the toplevel,
until a signal handler indicates that it has handled the event, by
returning GDK_EVENT_STOP.
Next, the #GtkWidget::event signal is emitted, then the appropriate signal
for the event in question, for example #GtkWidget::motion-notify-event.
Handling these signals was the primary way to handle input in GTK+ widgets
before gestures were introduced. If the widget is realized, the
#GtkWidget::event-after signal is emitted. The signals are emitted from
the target widget up to the top-level, as part of the “bubble” phase.
</para>
<para>
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
not have its own event handlers, or takes care to chain up to the
default GtkWidget handlers.
default #GtkWidget handlers.
</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.
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
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
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.
</para>
</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>
<title>Touch events</title>
<para>
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
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
the physical touch until it is lifted from the device.
</para>
<para>
On some windowing platforms, multitouch devices perform pointer emulation, this works
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
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
“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
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
event mask and didn't override #GtkWidget::touch-event, GTK+ will transform these
“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
sequences could still trigger gestures or just get filtered out, regardless of the widget
not handling those directly.
</para>
<para>
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
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
will be performed.
</para>
</refsect2>
@@ -171,11 +258,11 @@
<para>
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
happen on user interaction, when a GdkEventButtonPress happens, all events from
then on, until after the corresponding GdkEventButtonRelease, will be reported
happen on user interaction, when a #GdkEventButtonPress happens, all events from
then on, until after the corresponding #GdkEventButtonRelease, will be reported
to the widget that got the first event. Likewise, on touch events, every
GdkEventSequence will deliver only events to the widget that received its
GDK_TOUCH_BEGIN event.
#GdkEventSequence will deliver only events to the widget that received its
%GDK_TOUCH_BEGIN event.
</para>
<para>
@@ -192,8 +279,8 @@
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
interaction. Depending on whether a GTK or GDK grab is causing this, the
widget will respectively receive a GtkWidget::grab-notify signal, or a
GdkEventGrabBroken event.
widget will respectively receive a #GtkWidget::grab-notify signal, or a
#GdkEventGrabBroken event.
</para>
<para>
@@ -209,12 +296,12 @@
<!-- mnemonics, accelerators, bindings -->
</refsect2>
<refsect2>
<refsect2 id="event-controllers-and-gestures">
<title>Event controllers and gestures</title>
<para>
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.
</para>
@@ -270,7 +357,7 @@
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
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.
</para>

View File

@@ -83,7 +83,7 @@
widgets have been deprecated. These deprecations are clearly spelled
out in the API reference, with hints about the recommended replacements.
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>
To verify that your program does not use any deprecated symbols,

View File

@@ -36,7 +36,7 @@ some additional commandline options.
<para>
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.
</para>
</formalpara>
@@ -223,14 +223,24 @@ additional environment variables.
</formalpara>
<formalpara>
<title><envar>GTK_MODULES</envar></title>
<title><envar>GTK3_MODULES</envar></title>
<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.
</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>
Note that this environment variable is read by GTK+ 2.x too,
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>
</formalpara>

View File

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

View File

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

View File

@@ -129,17 +129,15 @@ close_window (void)
gtk_main_quit ();
}
int
main (int argc,
char *argv[])
static void
activate (GtkApplication *app,
gpointer user_data)
{
GtkWidget *window;
GtkWidget *frame;
GtkWidget *da;
GtkWidget *drawing_area;
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
window = gtk_application_window_new (app);
gtk_window_set_title (GTK_WINDOW (window), "Drawing Area");
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_container_add (GTK_CONTAINER (window), frame);
da = gtk_drawing_area_new ();
drawing_area = gtk_drawing_area_new ();
/* 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 */
g_signal_connect (da, "draw",
g_signal_connect (drawing_area, "draw",
G_CALLBACK (draw_cb), NULL);
g_signal_connect (da,"configure-event",
g_signal_connect (drawing_area,"configure-event",
G_CALLBACK (configure_event_cb), NULL);
/* 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_signal_connect (da, "button-press-event",
g_signal_connect (drawing_area, "button-press-event",
G_CALLBACK (button_press_event_cb), NULL);
/* Ask to receive events the drawing area doesn't normally
* subscribe to. In particular, we need to ask for the
* button press and motion notify events that want to handle.
*/
gtk_widget_set_events (da, gtk_widget_get_events (da)
| GDK_BUTTON_PRESS_MASK
| GDK_POINTER_MOTION_MASK);
gtk_widget_set_events (drawing_area, gtk_widget_get_events (drawing_area)
| GDK_BUTTON_PRESS_MASK
| GDK_POINTER_MOTION_MASK);
gtk_widget_show_all (window);
gtk_main ();
return 0;
}
int
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");
}
int
main (int argc,
char *argv[])
static void
activate (GtkApplication *app,
gpointer user_data)
{
GtkWidget *window;
GtkWidget *grid;
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 */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Grid");
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
window = gtk_application_window_new (app);
gtk_window_set_title (GTK_WINDOW (window), "Window");
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
/* 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);
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
* span 2 columns.
@@ -63,11 +57,19 @@ main (int argc,
*/
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.
*/
gtk_main ();
return 0;
}
int
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

@@ -1,8 +1,5 @@
#include <gtk/gtk.h>
/* This is a callback function. The data arguments are ignored
* in this example. More on callbacks below.
*/
static void
print_hello (GtkWidget *widget,
gpointer data)
@@ -10,95 +7,40 @@ print_hello (GtkWidget *widget,
g_print ("Hello World\n");
}
static gboolean
on_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer data)
static void
activate (GtkApplication *app,
gpointer user_data)
{
/* If you return FALSE in the "delete_event" signal handler,
* GTK will emit the "destroy" signal. Returning TRUE means
* you don't want the window to be destroyed.
*
* This is useful for popping up 'are you sure you want to quit?'
* type dialogs.
*/
GtkWidget *window;
GtkWidget *button;
GtkWidget *button_box;
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
main (int argc,
char *argv[])
main (int argc,
char **argv)
{
/* GtkWidget is the storage type for widgets */
GtkWidget *window;
GtkWidget *button;
GtkApplication *app;
int status;
/* This is called in all GTK applications. Arguments are parsed
* from the command line and are returned to the application.
*/
gtk_init (&argc, &argv);
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);
/* create a new window, and set its title */
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;
return status;
}

View File

@@ -267,16 +267,19 @@ disable_plugin (const gchar *name)
plugin_menu = find_plugin_menu ();
if (plugin_menu)
{
const gchar *id;
gint 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) &&
g_strcmp0 (id, name) == 0)
gchar *id;
if (g_menu_model_get_item_attribute (plugin_menu, i, "id", "s", &id))
{
g_menu_remove (G_MENU (plugin_menu), i);
g_print ("Menus of '%s' plugin removed\n", name);
if (g_strcmp0 (id, name) == 0)
{
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_error_free (error);
return;
goto out;
}
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);
gtk_window_present (GTK_WINDOW (dialog));
out:
g_object_unref (builder);
}
static GActionEntry app_entries[] = {

View File

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

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

View File

@@ -61,24 +61,24 @@ struct _GdkColor
#define GDK_TYPE_COLOR (gdk_color_get_type ())
GDK_DEPRECATED_IN_3_14
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_get_type)
GType gdk_color_get_type (void) G_GNUC_CONST;
GDK_DEPRECATED_IN_3_14
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_copy)
GdkColor *gdk_color_copy (const GdkColor *color);
GDK_DEPRECATED_IN_3_14
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_free)
void gdk_color_free (GdkColor *color);
GDK_DEPRECATED_IN_3_14
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_hash)
guint gdk_color_hash (const GdkColor *color);
GDK_DEPRECATED_IN_3_14
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_equal)
gboolean gdk_color_equal (const GdkColor *colora,
const GdkColor *colorb);
GDK_DEPRECATED_IN_3_14
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_parse)
gboolean gdk_color_parse (const gchar *spec,
GdkColor *color);
GDK_DEPRECATED_IN_3_14
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_to_string)
gchar * gdk_color_to_string (const GdkColor *color);

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

@@ -130,6 +130,7 @@ static int gdk_initialized = 0; /* 1 if the library is initi
*/
static gchar *gdk_progclass = NULL;
static gboolean gdk_progclass_overridden;
static GMutex gdk_threads_mutex;
@@ -208,6 +209,7 @@ static gboolean
gdk_arg_class_cb (const char *key, const char *value, gpointer user_data, GError **error)
{
gdk_set_program_class (value);
gdk_progclass_overridden = TRUE;
return TRUE;
}
@@ -1025,10 +1027,16 @@ gdk_get_program_class (void)
* Sets the program class. The X11 backend uses the program class to set
* the class name part of the `WM_CLASS` property on
* toplevel windows; see the ICCCM.
*
* The program class can still be overridden with the --class command
* line option.
*/
void
gdk_set_program_class (const char *program_class)
{
if (gdk_progclass_overridden)
return;
g_free (gdk_progclass);
gdk_progclass = g_strdup (program_class);

View File

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

View File

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

View File

@@ -52,7 +52,8 @@ get_vertex_type_name (int type)
}
static guint
create_shader (int type, const char const *code)
create_shader (int type,
const char *code)
{
guint shader;
int status;
@@ -85,8 +86,8 @@ create_shader (int type, const char const *code)
static void
make_program (GdkGLContextProgram *program,
const char const *vertex_shader_code,
const char const *fragment_shader_code)
const char *vertex_shader_code,
const char *fragment_shader_code)
{
guint vertex_shader, fragment_shader;
int status;
@@ -146,8 +147,8 @@ bind_vao (GdkGLContextPaintData *paint_data)
static void
use_texture_2d_program (GdkGLContextPaintData *paint_data)
{
const char *vertex_shader_code =
"#version 120\n"
static const char *vertex_shader_code =
"#version 150\n"
"uniform sampler2D map;"
"attribute vec2 position;\n"
"attribute vec2 uv;\n"
@@ -156,8 +157,8 @@ use_texture_2d_program (GdkGLContextPaintData *paint_data)
" gl_Position = vec4(position, 0, 1);\n"
" vUv = uv;\n"
"}\n";
const char *fragment_shader_code =
"#version 120\n"
static const char *fragment_shader_code =
"#version 150\n"
"varying vec2 vUv;\n"
"uniform sampler2D map;\n"
"void main() {\n"
@@ -177,8 +178,8 @@ use_texture_2d_program (GdkGLContextPaintData *paint_data)
static void
use_texture_rect_program (GdkGLContextPaintData *paint_data)
{
const char *vertex_shader_code =
"#version 120\n"
static const char *vertex_shader_code =
"#version 150\n"
"uniform sampler2DRect map;"
"attribute vec2 position;\n"
"attribute vec2 uv;\n"
@@ -187,8 +188,8 @@ use_texture_rect_program (GdkGLContextPaintData *paint_data)
" gl_Position = vec4(position, 0, 1);\n"
" vUv = uv;\n"
"}\n";
const char *fragment_shader_code =
"#version 120\n"
static const char *fragment_shader_code =
"#version 150\n"
"varying vec2 vUv;\n"
"uniform sampler2DRect map;\n"
"void main() {\n"
@@ -235,8 +236,8 @@ gdk_gl_texture_quads (GdkGLContext *paint_context,
glActiveTexture (GL_TEXTURE0);
glUniform1i(program->map_location, 0); /* Use texture unit 0 */
glEnableVertexAttribArray (0);
glEnableVertexAttribArray (1);
glEnableVertexAttribArray (program->position_location);
glEnableVertexAttribArray (program->uv_location);
glBindBuffer (GL_ARRAY_BUFFER, paint_data->tmp_vertex_buffer);
glVertexAttribPointer (program->position_location, 2, GL_FLOAT, GL_FALSE, sizeof(float) * 4, NULL);
@@ -272,8 +273,8 @@ gdk_gl_texture_quads (GdkGLContext *paint_context,
g_free (vertex_buffer_data);
glDisableVertexAttribArray (0);
glDisableVertexAttribArray (1);
glDisableVertexAttribArray (program->position_location);
glDisableVertexAttribArray (program->uv_location);
}
/* x,y,width,height describes a rectangle in the gl render buffer
@@ -355,7 +356,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
if (source_type == GL_RENDERBUFFER)
{
glBindRenderbufferEXT (GL_RENDERBUFFER_EXT, source);
glBindRenderbuffer (GL_RENDERBUFFER, source);
glGetRenderbufferParameteriv (GL_RENDERBUFFER, GL_RENDERBUFFER_ALPHA_SIZE, &alpha_size);
}
else if (source_type == GL_TEXTURE)
@@ -519,7 +520,6 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glEnable (GL_SCISSOR_TEST);
glEnable (GL_TEXTURE_2D);
gdk_window_get_unscaled_size (impl_window, NULL, &unscaled_window_height);
@@ -587,8 +587,6 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
if (alpha_size != 0)
glDisable (GL_BLEND);
glDisable (GL_TEXTURE_2D);
#undef FLIP_Y
}
@@ -644,6 +642,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
if (clip_region)
cairo_region_destroy (clip_region);
}
/* This is always called with the paint context current */
@@ -664,7 +663,6 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
float umax, vmax;
gboolean use_texture_rectangle;
guint target;
paint_context = gdk_gl_context_get_current ();
if ((_gdk_gl_flags & GDK_GL_SOFTWARE_DRAW_SURFACE) == 0 &&
paint_context &&
@@ -692,7 +690,6 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
target = GL_TEXTURE_2D;
glBindTexture (target, texture_id);
glEnable (target);
glEnable (GL_SCISSOR_TEST);
glTexParameteri (target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
@@ -720,8 +717,7 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
e.height *= sy;
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_GET_CLASS (paint_context)->upload_texture (paint_context, image, e.width, e.height, target);
gdk_gl_context_upload_texture (paint_context, image, e.width, e.height, target);
cairo_surface_unmap_image (surface, image);
@@ -750,8 +746,8 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
}
}
#undef FLIP_Y
glDisable (GL_SCISSOR_TEST);
glDisable (target);
glDeleteTextures (1, &texture_id);
}

View File

@@ -49,6 +49,14 @@
* #GdkWindow, which you typically get during the realize call
* 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 ##
*
* You will need to make the #GdkGLContext the current context
@@ -83,12 +91,18 @@ typedef struct {
GdkDisplay *display;
GdkWindow *window;
GdkGLContext *shared_context;
GdkGLProfile profile;
int major;
int minor;
int gl_version;
guint realized : 1;
guint use_texture_rectangle : 1;
guint has_gl_framebuffer_blit : 1;
guint has_frame_terminator : 1;
guint extensions_checked : 1;
guint debug_enabled : 1;
guint forward_compatible : 1;
GdkGLContextPaintData *paint_data;
} GdkGLContextPrivate;
@@ -98,7 +112,6 @@ enum {
PROP_DISPLAY,
PROP_WINDOW,
PROP_PROFILE,
PROP_SHARED_CONTEXT,
LAST_PROP
@@ -186,10 +199,6 @@ gdk_gl_context_set_property (GObject *gobject,
}
break;
case PROP_PROFILE:
priv->profile = g_value_get_enum (value);
break;
default:
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);
break;
case PROP_PROFILE:
g_value_set_enum (value, priv->profile);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
}
}
/* Default implementation of upload_texture() for gdk_gl_texture_from_surface() */
static void
void
gdk_gl_context_upload_texture (GdkGLContext *context,
cairo_surface_t *image_surface,
int width,
@@ -238,7 +242,7 @@ gdk_gl_context_upload_texture (GdkGLContext *context,
glPixelStorei (GL_UNPACK_ALIGNMENT, 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));
glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
}
@@ -280,23 +284,6 @@ gdk_gl_context_class_init (GdkGLContextClass *klass)
G_PARAM_CONSTRUCT_ONLY |
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:
*
@@ -318,9 +305,6 @@ gdk_gl_context_class_init (GdkGLContextClass *klass)
gobject_class->dispose = gdk_gl_context_dispose;
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);
}
@@ -389,19 +373,237 @@ gdk_gl_context_has_frame_terminator (GdkGLContext *context)
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
gdk_gl_context_realize (GdkGLContext *context)
gdk_gl_context_check_extensions (GdkGLContext *context)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
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_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_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;
else if (has_npot)
priv->use_texture_rectangle = FALSE;
@@ -410,7 +612,22 @@ gdk_gl_context_realize (GdkGLContext *context)
else
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)
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))
{
g_private_replace (&thread_current_context, g_object_ref (context));
if (!priv->realized)
gdk_gl_context_realize (context);
gdk_gl_context_check_extensions (context);
}
}
@@ -481,26 +711,6 @@ gdk_gl_context_get_window (GdkGLContext *context)
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:
* @context: a #GdkGLContext
@@ -521,6 +731,34 @@ gdk_gl_context_get_shared_context (GdkGLContext *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:
*

View File

@@ -43,18 +43,44 @@ GDK_AVAILABLE_IN_3_16
GType gdk_gl_context_get_type (void) G_GNUC_CONST;
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
GdkWindow * gdk_gl_context_get_window (GdkGLContext *context);
GdkWindow * gdk_gl_context_get_window (GdkGLContext *context);
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
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
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
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

View File

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

View File

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

View File

@@ -669,6 +669,12 @@ gdk_offscreen_window_set_opacity (GdkWindow *window, gdouble opacity)
{
}
static gboolean
gdk_offscreen_window_beep (GdkWindow *window)
{
return FALSE;
}
static void
gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
{
@@ -701,7 +707,7 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
impl_class->destroy_foreign = NULL;
impl_class->get_shape = NULL;
impl_class->get_input_shape = NULL;
impl_class->beep = NULL;
impl_class->beep = gdk_offscreen_window_beep;
impl_class->focus = NULL;
impl_class->set_type_hint = NULL;

View File

@@ -207,6 +207,10 @@ typedef enum
* reserved values such as %GDK_MODIFIER_RESERVED_13_MASK. Your code
* should preserve and ignore them. You can use %GDK_MODIFIER_MASK to
* remove all reserved values.
*
* Also note that the GDK X backend interprets button press events for button
* 4-7 as scroll events, so %GDK_BUTTON4_MASK and %GDK_BUTTON5_MASK will never
* be set.
*/
typedef enum
{
@@ -372,6 +376,9 @@ typedef enum
* Most of these masks map onto one or more of the #GdkEventType event types
* 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
* to reduce the number of %GDK_MOTION_NOTIFY events received. When using
* %GDK_POINTER_MOTION_HINT_MASK, fewer %GDK_MOTION_NOTIFY events will
@@ -434,19 +441,15 @@ struct _GdkPoint
};
/**
* GdkGLProfile:
* @GDK_GL_PROFILE_DEFAULT: ...
* @GDK_GL_PROFILE_LEGACY: ...
* @GDK_GL_PROFILE_3_2_CORE: ...
* GdkGLError:
* @GDK_GL_ERROR_NOT_AVAILABLE: OpenGL support is not available
* @GDK_GL_ERROR_UNSUPPORTED_FORMAT: The requested visual format is not supported
* @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 {
GDK_GL_ERROR_NOT_AVAILABLE,
GDK_GL_ERROR_UNSUPPORTED_FORMAT,

View File

@@ -1110,6 +1110,9 @@ find_native_sibling_above (GdkWindow *parent,
{
GdkWindow *w;
if (!parent)
return NULL;
w = find_native_sibling_above_helper (parent, child);
if (w)
return w;
@@ -2724,8 +2727,11 @@ gdk_window_ref_impl_surface (GdkWindow *window)
}
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)
{
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)
{
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,
GDK_GL_PROFILE_3_2_CORE,
NULL,
error);
if (window->impl_window->gl_paint_context == NULL &&
g_error_matches (*error, GDK_GL_ERROR,
GDK_GL_ERROR_UNSUPPORTED_PROFILE))
{
g_clear_error (error);
window->impl_window->gl_paint_context =
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window,
TRUE,
GDK_GL_PROFILE_DEFAULT,
NULL,
error);
}
&internal_error);
}
if (internal_error != NULL)
{
g_propagate_error (error, internal_error);
g_clear_object (&(window->impl_window->gl_paint_context));
return NULL;
}
gdk_gl_context_realize (window->impl_window->gl_paint_context, &internal_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;
@@ -2762,7 +2770,6 @@ gdk_window_get_paint_gl_context (GdkWindow *window, GError **error)
/**
* gdk_window_create_gl_context:
* @window: a #GdkWindow
* @profile: the GL profile the context should target
* @error: return location for an error
*
* 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.
*
* 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
* %NULL on error
*
@@ -2778,7 +2788,6 @@ gdk_window_get_paint_gl_context (GdkWindow *window, GError **error)
**/
GdkGLContext *
gdk_window_create_gl_context (GdkWindow *window,
GdkGLProfile profile,
GError **error)
{
GdkGLContext *paint_context;
@@ -2790,9 +2799,8 @@ gdk_window_create_gl_context (GdkWindow *window,
if (paint_context == 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,
profile,
paint_context,
error);
}
@@ -2932,7 +2940,6 @@ gdk_window_begin_paint_region (GdkWindow *window,
glDisable (GL_DEPTH_TEST);
glDisable(GL_BLEND);
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glViewport (0, 0, ww, wh);
}
@@ -3104,7 +3111,6 @@ gdk_window_end_paint (GdkWindow *window)
{
surface = gdk_window_ref_impl_surface (window);
cr = cairo_create (surface);
cairo_surface_destroy (surface);
cairo_set_source_surface (cr, window->current_paint.surface, 0, 0);
gdk_cairo_region (cr, window->current_paint.region);
@@ -3116,6 +3122,7 @@ gdk_window_end_paint (GdkWindow *window)
cairo_destroy (cr);
cairo_surface_flush (surface);
cairo_surface_destroy (surface);
}
}
@@ -3901,10 +3908,10 @@ gdk_window_process_updates (GdkWindow *window,
{
g_return_if_fail (GDK_IS_WINDOW (window));
return gdk_window_process_updates_with_mode (window,
update_children ?
PROCESS_UPDATES_WITH_ALL_CHILDREN :
PROCESS_UPDATES_NO_RECURSE);
gdk_window_process_updates_with_mode (window,
update_children ?
PROCESS_UPDATES_WITH_ALL_CHILDREN :
PROCESS_UPDATES_NO_RECURSE);
}
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_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,
device,
&tmp_x, &tmp_y,
@@ -5419,6 +5428,8 @@ gdk_window_withdraw (GdkWindow *window)
* including #GDK_BUTTON_PRESS_MASK means the window should report button
* press events. The event mask is the bitwise OR of values from the
* #GdkEventMask enumeration.
*
* See the [input handling overview][event-masks] for details.
**/
void
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
* #GdkEventMask enumeration.
*
* See the [input handling overview][event-masks] for details.
*
* Since: 3.0
**/
void
@@ -9946,7 +9959,7 @@ gdk_window_set_event_compression (GdkWindow *window,
{
g_return_if_fail (GDK_IS_WINDOW (window));
window->event_compression = event_compression;
window->event_compression = !!event_compression;
}
/**
@@ -10912,6 +10925,8 @@ gdk_window_flush_events (GdkFrameClock *clock,
_gdk_display_pause_events (display);
gdk_frame_clock_request_phase (clock, GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS);
window->frame_clock_events_paused = TRUE;
}
static void
@@ -10938,6 +10953,8 @@ gdk_window_resume_events (GdkFrameClock *clock,
display = gdk_window_get_display (window);
_gdk_display_unpause_events (display);
window->frame_clock_events_paused = FALSE;
}
static void
@@ -10970,6 +10987,9 @@ gdk_window_set_frame_clock (GdkWindow *window,
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_CALLBACK (gdk_window_flush_events),
window);
@@ -11080,9 +11100,9 @@ gdk_window_get_unscaled_size (GdkWindow *window,
/**
* gdk_window_set_opaque_region:
* @window: a top-level or non-native #GdkWindow
* @region: a region
* @region: (allow-none): a region, or %NULL
*
* For optimizization purposes, compositing window managers may
* For optimisation purposes, compositing window managers may
* like to not draw obscured regions of windows, or turn off blending
* during for these regions. With RGB windows with no transparency,
* this is just the shape of the window, but with ARGB32 windows, the
@@ -11091,7 +11111,7 @@ gdk_window_get_unscaled_size (GdkWindow *window,
*
* This function only works for toplevel windows.
*
* GTK+ will automatically update this property automatically if
* GTK+ will update this property automatically if
* the @window background is opaque, as we know where the opaque regions
* are. If your window background is not opaque, please update this
* property in your #GtkWidget::style-updated handler.
@@ -11110,7 +11130,7 @@ gdk_window_set_opaque_region (GdkWindow *window,
impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
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
GdkGLContext * gdk_window_create_gl_context (GdkWindow *window,
GdkGLProfile profile,
GError **error);
G_END_DECLS
#endif /* __GDK_WINDOW_H__ */

View File

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

View File

@@ -269,6 +269,13 @@ _gdk_mir_print_resize_event (const MirResizeEvent *event)
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
_gdk_mir_print_event (const MirEvent *event)
{
@@ -286,6 +293,9 @@ _gdk_mir_print_event (const MirEvent *event)
case mir_event_type_resize:
_gdk_mir_print_resize_event (&event->resize);
break;
case mir_event_type_close_surface:
_gdk_mir_print_close_event (&event->close_surface);
break;
default:
g_printerr ("EVENT %u\n", event->type);
break;

View File

@@ -69,6 +69,8 @@ GdkDevice *_gdk_mir_device_manager_get_keyboard (GdkDeviceManager *device_manage
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_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);
/* 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__ */

View File

@@ -30,13 +30,13 @@
#define GDK_TYPE_MIR_WINDOW (gdk_mir_window_get_type ())
#define GDK_IS_MIR_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_MIR_WINDOW))
GDK_AVAILABLE_IN_3_10
GDK_AVAILABLE_IN_3_16
GType gdk_mir_display_get_type (void);
GDK_AVAILABLE_IN_3_10
GDK_AVAILABLE_IN_3_16
MirConnection *gdk_mir_display_get_mir_connection (GdkDisplay *display);
GDK_AVAILABLE_IN_3_10
GDK_AVAILABLE_IN_3_16
GType gdk_mir_window_get_type (void);
GDK_AVAILABLE_IN_3_16

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 (" size=(%d, %d)", window->width, window->height);
g_printerr ("\n");
if (attributes->wclass != GDK_INPUT_OUTPUT)
return;
window->impl = _gdk_mir_window_impl_new ();
if (attributes->wclass == GDK_INPUT_OUTPUT)
{
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 *

View File

@@ -22,6 +22,8 @@
#include "gdkmir.h"
#include "gdkmir-private.h"
#define NANO_TO_MILLI(x) ((x) / 1000000)
struct _GdkMirWindowReference {
GdkMirEventSource *source;
GdkWindow *window;
@@ -39,6 +41,7 @@ struct _GdkMirEventSource
GMutex mir_event_lock;
GQueue mir_events;
gboolean log_events;
GdkDisplay *display;
};
@@ -50,6 +53,7 @@ send_event (GdkWindow *window, GdkDevice *device, GdkEvent *event)
GList *node;
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));
event->any.window = g_object_ref (window);
@@ -118,7 +122,7 @@ set_key_event_string (GdkEventKey *event)
}
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;
@@ -127,6 +131,7 @@ generate_key_event (GdkWindow *window, GdkEventType type, guint state, guint key
event->key.keyval = keyval;
event->key.hardware_keycode = keycode + 8;
event->key.is_modifier = is_modifier;
event->key.time = event_time;
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);
@@ -139,7 +144,7 @@ get_pointer (GdkWindow *window)
}
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;
@@ -148,12 +153,13 @@ generate_button_event (GdkWindow *window, GdkEventType type, gdouble x, gdouble
event->button.y = y;
event->button.state = state;
event->button.button = button;
event->button.time = event_time;
send_event (window, get_pointer (window), event);
}
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;
@@ -161,15 +167,28 @@ generate_scroll_event (GdkWindow *window, gdouble x, gdouble y, gdouble delta_x,
event->scroll.x = x;
event->scroll.y = y;
event->scroll.state = state;
event->scroll.direction = GDK_SCROLL_SMOOTH;
event->scroll.delta_x = -delta_x;
event->scroll.delta_y = -delta_y;
event->scroll.time = event_time;
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);
}
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;
@@ -178,12 +197,13 @@ generate_motion_event (GdkWindow *window, gdouble x, gdouble y, guint state)
event->motion.y = y;
event->motion.state = state;
event->motion.is_hint = FALSE;
event->motion.time = event_time;
send_event (window, get_pointer (window), event);
}
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;
@@ -193,6 +213,7 @@ generate_crossing_event (GdkWindow *window, GdkEventType type, gdouble x, gdoubl
event->crossing.mode = GDK_CROSSING_NORMAL;
event->crossing.detail = GDK_NOTIFY_ANCESTOR;
event->crossing.focus = TRUE;
event->crossing.time = event_time;
send_event (window, get_pointer (window), event);
}
@@ -239,35 +260,30 @@ get_modifier_state (unsigned int modifiers, unsigned int button_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
handle_key_event (GdkWindow *window, const MirKeyEvent *event)
{
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
GdkKeymap *keymap;
guint modifier_state;
gboolean is_modifier = FALSE;
modifier_state = get_modifier_state (event->modifiers, 0); // FIXME: Need to track button state
MirMotionButton button_state;
switch (event->action)
{
case mir_key_action_down:
case mir_key_action_up:
// 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,
event->action == mir_key_action_down ? GDK_KEY_PRESS : GDK_KEY_RELEASE,
modifier_state,
event->key_code,
event->scan_code,
is_modifier);
_gdk_mir_keymap_key_is_modifier (keymap, event->key_code),
NANO_TO_MILLI (event->event_time));
break;
default:
//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
handle_motion_event (GdkWindow *window, const MirMotionEvent *event)
{
@@ -284,6 +341,7 @@ handle_motion_event (GdkWindow *window, const MirMotionEvent *event)
gboolean cursor_inside;
MirMotionButton button_state;
guint modifier_state;
guint32 event_time;
GdkEventType event_type;
MirMotionButton changed_button_state;
@@ -294,45 +352,87 @@ handle_motion_event (GdkWindow *window, const MirMotionEvent *event)
y = event->pointer_coordinates[0].y;
}
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
counteract this by always generating an enter notify on all other events */
if (!cursor_inside && event->action != mir_motion_action_hover_exit)
/* TODO: Remove once we have proper transient window support. */
if (event->action == mir_motion_action_hover_exit)
{
cursor_inside = TRUE;
generate_crossing_event (window, GDK_ENTER_NOTIFY, x, y);
LeaveInfo info;
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 */
_gdk_mir_pointer_set_location (get_pointer (window), x, y, window, modifier_state);
switch (event->action)
if (window)
{
case mir_motion_action_down:
case mir_motion_action_up:
event_type = event->action == mir_motion_action_down ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE;
changed_button_state = button_state ^ event->button_state;
if (changed_button_state == 0 || (changed_button_state & mir_motion_button_primary) != 0)
generate_button_event (window, event_type, x, y, GDK_BUTTON_PRIMARY, modifier_state);
if ((changed_button_state & mir_motion_button_secondary) != 0)
generate_button_event (window, event_type, x, y, GDK_BUTTON_SECONDARY, modifier_state);
if ((changed_button_state & mir_motion_button_tertiary) != 0)
generate_button_event (window, event_type, x, y, GDK_BUTTON_MIDDLE, modifier_state);
button_state = event->button_state;
break;
case mir_motion_action_scroll:
generate_scroll_event (window, x, y, event->pointer_coordinates[0].hscroll, event->pointer_coordinates[0].vscroll, modifier_state);
break;
case mir_motion_action_move: // move with button
case mir_motion_action_hover_move: // move without button
generate_motion_event (window, x, y, modifier_state);
break;
case mir_motion_action_hover_exit:
cursor_inside = FALSE;
generate_crossing_event (window, GDK_LEAVE_NOTIFY, x, y);
break;
}
/* Update which window has focus */
_gdk_mir_pointer_set_location (get_pointer (window), x, y, window, modifier_state);
switch (event->action)
{
case mir_motion_action_down:
case mir_motion_action_up:
event_type = event->action == mir_motion_action_down ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE;
changed_button_state = button_state ^ event->button_state;
if (changed_button_state == 0 || (changed_button_state & mir_motion_button_primary) != 0)
generate_button_event (window, event_type, x, y, GDK_BUTTON_PRIMARY, modifier_state, event_time);
if ((changed_button_state & mir_motion_button_secondary) != 0)
generate_button_event (window, event_type, x, y, GDK_BUTTON_SECONDARY, modifier_state, event_time);
if ((changed_button_state & mir_motion_button_tertiary) != 0)
generate_button_event (window, event_type, x, y, GDK_BUTTON_MIDDLE, modifier_state, event_time);
button_state = event->button_state;
break;
case mir_motion_action_scroll:
generate_scroll_event (window, x, y, event->pointer_coordinates[0].hscroll, event->pointer_coordinates[0].vscroll, modifier_state, event_time);
break;
case mir_motion_action_move: // move with button
case mir_motion_action_hover_move: // move without button
generate_motion_event (window, x, y, modifier_state, event_time);
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
@@ -385,6 +485,14 @@ handle_resize_event (GdkWindow *window,
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
{
GdkWindow *window;
@@ -396,9 +504,6 @@ gdk_mir_event_source_queue_event (GdkDisplay *display,
GdkWindow *window,
const MirEvent *event)
{
if (g_getenv ("GDK_MIR_LOG_EVENTS"))
_gdk_mir_print_event (event);
// FIXME: Only generate events if the window wanted them?
switch (event->type)
{
@@ -420,6 +525,9 @@ gdk_mir_event_source_queue_event (GdkDisplay *display,
case mir_event_type_orientation:
// FIXME?
break;
case mir_event_type_close_surface:
handle_close_event (window, &event->close_surface);
break;
default:
g_warning ("Ignoring unknown Mir event %d", event->type);
// FIXME?
@@ -459,7 +567,12 @@ gdk_mir_event_source_convert_events (GdkMirEventSource *source)
* event was being dispatched...
*/
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
g_warning ("window was destroyed before event arrived...");
@@ -554,6 +667,7 @@ _gdk_mir_event_source_new (GdkDisplay *display)
source = (GdkMirEventSource *) g_source;
g_mutex_init (&source->mir_event_lock);
source->display = display;
source->log_events = (g_getenv ("GDK_MIR_LOG_EVENTS") != NULL);
return source;
}

View File

@@ -26,6 +26,77 @@
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
gdk_mir_gl_context_end_frame (GdkGLContext *context,
cairo_region_t *painted,
@@ -96,6 +167,7 @@ gdk_mir_gl_context_class_init (GdkMirGLContextClass *klass)
GdkGLContextClass *context_class = GDK_GL_CONTEXT_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;
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_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
{
GdkKeymap parent_instance;
@@ -342,6 +348,14 @@ gdk_mir_keymap_get_modifier_state (GdkKeymap *keymap)
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
update_direction (GdkMirKeymap *keymap)
{

View File

@@ -17,6 +17,7 @@
#include "config.h"
#include "gdkdisplayprivate.h"
#include "gdkdeviceprivate.h"
#include "gdkscreen.h"
#include "gdkwindow.h"
@@ -183,6 +184,11 @@ gdk_mir_pointer_ungrab (GdkDevice *device,
{
//g_printerr ("gdk_mir_pointer_ungrab\n");
/* 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 *

View File

@@ -327,35 +327,31 @@ gdk_mir_screen_get_monitor_plug_name (GdkScreen *screen,
switch (output->type)
{
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:
return g_strdup_printf ("VGA-%u", output->output_id);
case mir_display_output_type_dvii:
return g_strdup_printf ("DVII-%u", output->output_id);
case mir_display_output_type_dvid:
return g_strdup_printf ("DVID-%u", output->output_id);
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:
return g_strdup_printf ("COMPOSITE-%u", output->output_id);
case mir_display_output_type_svideo:
return g_strdup_printf ("SVIDEO-%u", output->output_id);
return g_strdup_printf ("Composite-%u", output->output_id);
case mir_display_output_type_lvds:
return g_strdup_printf ("LVDS-%u", output->output_id);
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:
return g_strdup_printf ("NINEPINDIN-%u", output->output_id);
return g_strdup_printf ("DIN-%u", output->output_id);
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:
return g_strdup_printf ("HDMIA-%u", output->output_id);
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:
return g_strdup_printf ("TV-%u", output->output_id);
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,
MirBufferUsage buffer_usage)
{
MirSurfaceParameters parameters;
MirSurfaceSpec *spec;
MirConnection *connection;
parameters.name = g_get_prgname ();
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;
MirPixelFormat format;
MirSurface *surface;
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
@@ -206,7 +216,7 @@ ensure_surface_full (GdkWindow *window,
MirEventDelegate event_delegate = { event_cb, NULL };
GdkMirWindowReference *window_ref;
if (impl->surface)
if (impl->surface || should_render_in_parent (window))
return;
/* no destroy notify -- we must leak for now
@@ -294,7 +304,7 @@ send_buffer (GdkWindow *window)
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
/* Transient windows draw onto parent instead */
if (impl->transient_for)
if (should_render_in_parent (window))
{
redraw_transient (window);
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 */
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);
}
@@ -373,13 +383,13 @@ gdk_mir_window_impl_ref_cairo_surface (GdkWindow *window)
impl->cairo_surface = cairo_surface_reference (cairo_surface);
/* Draw background */
c = cairo_create (impl->cairo_surface);
if (impl->background)
cairo_set_source (c, impl->background);
else
cairo_set_source_rgb (c, 1.0, 0.0, 0.0);
cairo_paint (c);
cairo_destroy (c);
{
c = cairo_create (impl->cairo_surface);
cairo_set_source (c, impl->background);
cairo_paint (c);
cairo_destroy (c);
}
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);
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
impl->cursor_inside = FALSE;
impl->visible = FALSE;
ensure_no_surface (window);
if (impl->transient_for)
if (should_render_in_parent (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);
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
impl->cursor_inside = FALSE;
impl->visible = FALSE;
ensure_no_surface (window);
if (impl->transient_for)
if (should_render_in_parent (window))
redraw_transient (window);
}
@@ -505,6 +517,7 @@ gdk_mir_window_impl_move_resize (GdkWindow *window,
gint width,
gint height)
{
/*
g_printerr ("gdk_mir_window_impl_move_resize");
g_printerr (" window=%p", window);
if (with_move)
@@ -512,24 +525,27 @@ gdk_mir_window_impl_move_resize (GdkWindow *window,
if (width > 0)
g_printerr (" size=%dx%dpx", width, height);
g_printerr ("\n");
*/
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
gboolean recreate_surface = FALSE;
/* Redraw parent where we moved from */
if (impl->transient_for)
if (should_render_in_parent (window))
redraw_transient (window);
/* Transient windows can move wherever they want */
if (with_move)
{
if (impl->transient_for)
if (should_render_in_parent (window))
{
window->x = x;
window->y = y;
}
else
else if (x != impl->transient_x || y != impl->transient_y)
{
impl->transient_x = x;
impl->transient_y = y;
recreate_surface = TRUE;
}
}
@@ -539,16 +555,17 @@ gdk_mir_window_impl_move_resize (GdkWindow *window,
/* We accept any resize */
window->width = width;
window->height = height;
if (impl->surface)
{
ensure_no_surface (window);
ensure_surface (window);
}
recreate_surface = TRUE;
}
if (recreate_surface && impl->surface)
{
ensure_no_surface (window);
ensure_surface (window);
}
/* Redraw parent where we moved to */
if (impl->transient_for)
if (should_render_in_parent (window))
redraw_transient (window);
}
@@ -711,7 +728,7 @@ gdk_mir_window_impl_input_shape_combine_region (GdkWindow *window,
gint offset_x,
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
@@ -725,7 +742,7 @@ gdk_mir_window_impl_destroy (GdkWindow *window,
impl->visible = FALSE;
ensure_no_surface (window);
if (impl->transient_for)
if (should_render_in_parent (window))
{
/* Redraw parent */
redraw_transient (window);
@@ -862,7 +879,7 @@ static void
gdk_mir_window_impl_set_title (GdkWindow *window,
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
@@ -893,7 +910,7 @@ gdk_mir_window_impl_set_transient_for (GdkWindow *window,
/* Link this window to the parent */
impl->transient_for = parent;
if (parent)
if (should_render_in_parent (window))
{
GdkMirWindowImpl *parent_impl = GDK_MIR_WINDOW_IMPL (parent->impl);
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->y = impl->transient_y;
/* Remove surface if we had made one before this was set */
ensure_no_surface (window);
/* Redraw onto parent */
redraw_transient (window);
}
}
/* Remove surface if we had made one before this was set */
ensure_no_surface (window);
/* 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)
{
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
@@ -1254,7 +1314,7 @@ gdk_mir_window_impl_set_shadow_width (GdkWindow *window,
gint top,
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
@@ -1332,16 +1392,12 @@ find_eglconfig_for_window (GdkWindow *window,
static GdkGLContext *
gdk_mir_window_impl_create_gl_context (GdkWindow *window,
gboolean attached,
GdkGLProfile profile,
GdkGLContext *share,
GError **error)
{
GdkDisplay *display = gdk_window_get_display (window);
GdkMirGLContext *context;
EGLContext ctx;
EGLConfig config;
int i;
EGLint context_attribs[3];
if (!_gdk_mir_display_init_egl_display (display))
{
@@ -1351,11 +1407,7 @@ gdk_mir_window_impl_create_gl_context (GdkWindow *window,
return NULL;
}
if (profile == GDK_GL_PROFILE_DEFAULT)
profile = GDK_GL_PROFILE_LEGACY;
if (profile == GDK_GL_PROFILE_3_2_CORE &&
!_gdk_mir_display_have_egl_khr_create_context (display))
if (!_gdk_mir_display_have_egl_khr_create_context (display))
{
g_set_error_literal (error, GDK_GL_ERROR,
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))
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,
"display", display,
"window", window,
"profile", profile,
"shared-context", share,
NULL);
context->egl_config = config;
context->egl_context = ctx;
context->is_attached = attached;
return GDK_GL_CONTEXT (context);

View File

@@ -33,6 +33,8 @@ libgdk_quartz_la_SOURCES = \
gdkdnd-quartz.h \
gdkevents-quartz.c \
gdkeventloop-quartz.c \
gdkglcontext-quartz.c \
gdkglcontext-quartz.h \
gdkglobals-quartz.c \
gdkkeys-quartz.c \
gdkprivate-quartz.h \

View File

@@ -0,0 +1,39 @@
/* GDK - The GIMP Drawing Kit
*
* gdkglcontext-quartz.c: Quartz specific OpenGL wrappers
*
* Copyright © 2014 Emmanuele Bassi
* Copyright © 2014 Alexander Larsson
* Copyright © 2014 Brion Vibber
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include "gdkglcontext-quartz.h"
#include "gdkintl.h"
GdkGLContext *
gdk_quartz_window_create_gl_context (GdkWindow *window,
gboolean attached,
GdkGLContext *share,
GError **error)
{
/* FIXME: implement */
g_set_error_literal (error, GDK_GL_ERROR, GDK_GL_ERROR_NOT_AVAILABLE,
_("Not implemented on OS X"));
return NULL;
}

View File

@@ -0,0 +1,41 @@
/* GDK - The GIMP Drawing Kit
*
* gdkglcontext-quartz.h: Private Quartz specific OpenGL wrappers
*
* Copyright © 2014 Emmanuele Bassi
* Copyright © 2014 Red Hat, Int
* Copyright © 2014 Brion Vibber
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GDK_QUARTZ_GL_CONTEXT__
#define __GDK_QUARTZ_GL_CONTEXT__
#include "gdkglcontextprivate.h"
#include "gdkvisual.h"
#include "gdkwindow.h"
#include "gdkinternals.h"
#include "gdkmain.h"
G_BEGIN_DECLS
GdkGLContext * gdk_quartz_window_create_gl_context (GdkWindow *window,
gboolean attach,
GdkGLContext *share,
GError **error);
G_END_DECLS
#endif /* __GDK_QUARTZ_GL_CONTEXT__ */

View File

@@ -25,6 +25,7 @@
#include "gdkwindowimpl.h"
#include "gdkprivate-quartz.h"
#include "gdkglcontext-quartz.h"
#include "gdkquartzscreen.h"
#include "gdkquartzcursor.h"
@@ -818,7 +819,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
impl->view = NULL;
switch (attributes->window_type)
switch (window->window_type)
{
case GDK_WINDOW_TOPLEVEL:
case GDK_WINDOW_TEMP:
@@ -846,8 +847,9 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
window->width,
window->height);
if (attributes->window_type == GDK_WINDOW_TEMP ||
attributes->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN)
if (window->window_type == GDK_WINDOW_TEMP ||
((attributes_mask & GDK_WA_TYPE_HINT) &&
attributes->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN))
{
style_mask = NSBorderlessWindowMask;
}
@@ -2943,6 +2945,7 @@ gdk_window_impl_quartz_class_init (GdkWindowImplQuartzClass *klass)
impl_class->change_property = _gdk_quartz_window_change_property;
impl_class->delete_property = _gdk_quartz_window_delete_property;
impl_class->create_gl_context = gdk_quartz_window_create_gl_context;
impl_quartz_class->get_context = gdk_window_impl_quartz_get_context;
impl_quartz_class->release_context = gdk_window_impl_quartz_release_context;

View File

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

View File

@@ -19,7 +19,7 @@
* 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
* 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"
@@ -59,6 +59,7 @@ struct _GdkWaylandCursor
} surface;
struct wl_cursor *wl_cursor;
int scale;
};
struct _GdkWaylandCursorClass
@@ -83,10 +84,18 @@ _gdk_wayland_display_finalize_cursors (GdkWaylandDisplay *display)
}
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_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);
if (!c)
{
@@ -105,8 +114,7 @@ set_cursor_from_theme (GdkWaylandCursor *cursor, struct wl_cursor_theme *theme)
}
void
_gdk_wayland_display_update_cursors (GdkWaylandDisplay *display,
struct wl_cursor_theme *theme)
_gdk_wayland_display_update_cursors (GdkWaylandDisplay *display)
{
GHashTableIter iter;
const char *name;
@@ -115,7 +123,7 @@ _gdk_wayland_display_update_cursors (GdkWaylandDisplay *display,
g_hash_table_iter_init (&iter, display->cursor_cache);
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
@@ -168,11 +176,11 @@ _gdk_wayland_cursor_get_buffer (GdkCursor *cursor,
*w = image->width;
*h = image->height;
*scale = 1;
*scale = wayland_cursor->scale;
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_y = wayland_cursor->surface.hotspot_y;
@@ -185,9 +193,9 @@ _gdk_wayland_cursor_get_buffer (GdkCursor *cursor,
if (wayland_cursor->surface.cairo_surface)
return _gdk_wayland_shm_surface_get_wl_buffer (wayland_cursor->surface.cairo_surface);
else
return NULL;
}
return NULL;
}
guint
@@ -216,6 +224,28 @@ _gdk_wayland_cursor_get_next_image_index (GdkCursor *cursor,
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
_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 *
_gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
GdkCursorType cursor_type)
_gdk_wayland_display_get_cursor_for_type_with_scale (GdkDisplay *display,
GdkCursorType cursor_type,
guint scale)
{
GEnumClass *enum_class;
GEnumValue *enum_value;
@@ -247,7 +283,9 @@ _gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
g_strdelimit (cursor_name, "-", '_');
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);
@@ -255,8 +293,18 @@ _gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
}
GdkCursor *
_gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
const gchar *name)
_gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
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;
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (display);
@@ -272,13 +320,13 @@ _gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
"display", display,
NULL);
private->name = g_strdup (name);
private->surface.scale = 1;
private->scale = scale;
/* Blank cursor case */
if (!name || g_str_equal (name, "blank_cursor"))
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);
/* Insert into cache. */
@@ -286,6 +334,13 @@ _gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
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 *
_gdk_wayland_display_get_cursor_for_surface (GdkDisplay *display,
cairo_surface_t *surface,

View File

@@ -93,6 +93,11 @@ struct _GdkWaylandDeviceData
GdkDragContext *drop_context;
struct wl_surface *pointer_surface;
guint current_output_scale;
GSList *pointer_surface_outputs;
/* Source/dest for non-local dnd */
GdkWindow *foreign_dnd_window;
};
struct _GdkWaylandDevice
@@ -206,10 +211,13 @@ gdk_wayland_device_update_window_cursor (GdkWaylandDeviceData *wd)
wd->enter_serial,
wd->pointer_surface,
x, y);
wl_surface_attach (wd->pointer_surface, buffer, 0, 0);
wl_surface_set_buffer_scale (wd->pointer_surface, scale);
wl_surface_damage (wd->pointer_surface, 0, 0, w, h);
wl_surface_commit (wd->pointer_surface);
if (buffer)
{
wl_surface_attach (wd->pointer_surface, buffer, 0, 0);
wl_surface_set_buffer_scale (wd->pointer_surface, scale);
wl_surface_damage (wd->pointer_surface, 0, 0, w, h);
wl_surface_commit (wd->pointer_surface);
}
if (wd->grab_cursor)
{
@@ -254,10 +262,14 @@ gdk_wayland_device_set_window_cursor (GdkDevice *device,
*/
if (!cursor)
{
/* FIXME: Is this the best sensible default ? */
cursor = _gdk_wayland_display_get_cursor_for_type (device->display,
GDK_LEFT_PTR);
guint scale = wd->current_output_scale;
cursor =
_gdk_wayland_display_get_cursor_for_type_with_scale (wd->display,
GDK_LEFT_PTR,
scale);
}
else
_gdk_wayland_cursor_set_scale (cursor, wd->current_output_scale);
if (cursor == wd->cursor)
return;
@@ -282,8 +294,10 @@ gdk_wayland_device_warp (GdkDevice *device,
static void
get_coordinates (GdkWaylandDeviceData *data,
double *x, double *y,
double *x_root, double *y_root)
double *x,
double *y,
double *x_root,
double *y_root)
{
int root_x, root_y;
@@ -357,7 +371,6 @@ gdk_wayland_device_grab (GdkDevice *device,
else
{
/* Device is a pointer */
if (wayland_device->pointer_grab_window != NULL &&
time_ != 0 && wayland_device->pointer_grab_time > time_)
{
@@ -482,7 +495,7 @@ gdk_wayland_device_init (GdkWaylandDevice *device_core)
* gdk_wayland_device_get_wl_seat:
* @device: (type GdkWaylandDevice): a #GdkDevice
*
* Returns the Wayland wl_seat of a #GdkDevice
* Returns the Wayland wl_seat of a #GdkDevice.
*
* Returns: (transfer none): a Wayland wl_seat
*
@@ -491,7 +504,7 @@ gdk_wayland_device_init (GdkWaylandDevice *device_core)
struct wl_seat *
gdk_wayland_device_get_wl_seat (GdkDevice *device)
{
g_return_val_if_fail(GDK_IS_WAYLAND_DEVICE (device), NULL);
g_return_val_if_fail (GDK_IS_WAYLAND_DEVICE (device), NULL);
return GDK_WAYLAND_DEVICE (device)->device->wl_seat;
}
@@ -500,7 +513,7 @@ gdk_wayland_device_get_wl_seat (GdkDevice *device)
* gdk_wayland_device_get_wl_pointer:
* @device: (type GdkWaylandDevice): a #GdkDevice
*
* Returns the Wayland wl_pointer of a #GdkDevice
* Returns the Wayland wl_pointer of a #GdkDevice.
*
* Returns: (transfer none): a Wayland wl_pointer
*
@@ -509,7 +522,7 @@ gdk_wayland_device_get_wl_seat (GdkDevice *device)
struct wl_pointer *
gdk_wayland_device_get_wl_pointer (GdkDevice *device)
{
g_return_val_if_fail(GDK_IS_WAYLAND_DEVICE (device), NULL);
g_return_val_if_fail (GDK_IS_WAYLAND_DEVICE (device), NULL);
return GDK_WAYLAND_DEVICE (device)->device->wl_pointer;
}
@@ -518,7 +531,7 @@ gdk_wayland_device_get_wl_pointer (GdkDevice *device)
* gdk_wayland_device_get_wl_keyboard:
* @device: (type GdkWaylandDevice): a #GdkDevice
*
* Returns the Wayland wl_keyboard of a #GdkDevice
* Returns the Wayland wl_keyboard of a #GdkDevice.
*
* Returns: (transfer none): a Wayland wl_keyboard
*
@@ -527,7 +540,7 @@ gdk_wayland_device_get_wl_pointer (GdkDevice *device)
struct wl_keyboard *
gdk_wayland_device_get_wl_keyboard (GdkDevice *device)
{
g_return_val_if_fail(GDK_IS_WAYLAND_DEVICE (device), NULL);
g_return_val_if_fail (GDK_IS_WAYLAND_DEVICE (device), NULL);
return GDK_WAYLAND_DEVICE (device)->device->wl_keyboard;
}
@@ -574,11 +587,15 @@ emit_selection_owner_change_forall (GdkAtom atom)
static void
data_device_data_offer (void *data,
struct wl_data_device *data_device,
struct wl_data_offer *_offer)
struct wl_data_offer *offer)
{
GdkWaylandDeviceData *device = (GdkWaylandDeviceData *)data;
gdk_wayland_selection_set_offer (device->display, _offer);
GDK_NOTE (EVENTS,
g_message ("data device data offer, data device %p, offer %p",
data_device, offer));
gdk_wayland_selection_set_offer (device->display, offer);
emit_selection_owner_change_forall (gdk_atom_intern_static_string ("GdkWaylandSelection"));
}
@@ -599,8 +616,9 @@ data_device_enter (void *data,
if (!GDK_IS_WINDOW (dest_window))
return;
g_debug (G_STRLOC ": %s data_device = %p serial = %u, surface = %p, x = %d y = %d, offer = %p",
G_STRFUNC, data_device, serial, surface, x, y, offer);
GDK_NOTE (EVENTS,
g_message ("data device enter, data device %p serial %u, surface %p, x %d y %d, offer %p",
data_device, serial, surface, x, y, offer));
/* Update pointer state, so device state queries work during DnD */
device->pointer_focus = g_object_ref (dest_window);
@@ -611,8 +629,10 @@ data_device_enter (void *data,
dnd_owner = gdk_selection_owner_get_for_display (device->display, gdk_drag_get_selection (device->drop_context));
if (dnd_owner)
_gdk_wayland_drag_context_set_source_window (device->drop_context, dnd_owner);
if (!dnd_owner)
dnd_owner = device->foreign_dnd_window;
_gdk_wayland_drag_context_set_source_window (device->drop_context, dnd_owner);
_gdk_wayland_drag_context_set_dest_window (device->drop_context,
dest_window, serial);
@@ -632,8 +652,8 @@ data_device_leave (void *data,
{
GdkWaylandDeviceData *device = (GdkWaylandDeviceData *) data;
g_debug (G_STRLOC ": %s data_device = %p",
G_STRFUNC, data_device);
GDK_NOTE (EVENTS,
g_message ("data device leave, data device %p", data_device));
if (!gdk_drag_context_get_dest_window (device->drop_context))
return;
@@ -680,8 +700,8 @@ data_device_drop (void *data,
GdkWaylandDeviceData *device = (GdkWaylandDeviceData *) data;
GdkWindow *local_dnd_owner;
g_debug (G_STRLOC ": %s data_device = %p",
G_STRFUNC, data_device);
GDK_NOTE (EVENTS,
g_message ("data device drop, data device %p", data_device));
local_dnd_owner = gdk_selection_owner_get_for_display (device->display, gdk_drag_get_selection (device->drop_context));
@@ -704,8 +724,9 @@ data_device_selection (void *data,
{
GdkWaylandDeviceData *device = (GdkWaylandDeviceData *) data;
g_debug (G_STRLOC ": %s wl_data_device = %p wl_data_offer = %p",
G_STRFUNC, wl_data_device, offer);
GDK_NOTE (EVENTS,
g_message ("data device selection, data device %p, data offer %p",
wl_data_device, offer));
gdk_wayland_selection_set_offer (device->display, offer);
emit_selection_owner_change_forall (gdk_atom_intern_static_string ("CLIPBOARD"));
@@ -735,6 +756,7 @@ pointer_handle_enter (void *data,
if (!surface)
return;
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
return;
@@ -781,13 +803,14 @@ pointer_handle_leave (void *data,
{
GdkWaylandDeviceData *device = data;
GdkEvent *event;
GdkWaylandDisplay *wayland_display =
GDK_WAYLAND_DISPLAY (device->display);
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (device->display);
if (!surface)
return;
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
return;
if (!device->pointer_focus)
return;
@@ -818,7 +841,7 @@ pointer_handle_leave (void *data,
g_message ("leave, device %p surface %p",
device, device->pointer_focus));
g_object_unref(device->pointer_focus);
g_object_unref (device->pointer_focus);
if (device->cursor)
gdk_wayland_device_stop_window_cursor_animation (device);
@@ -862,8 +885,8 @@ pointer_handle_motion (void *data,
&event->motion.y_root);
GDK_NOTE (EVENTS,
g_message ("motion %d %d, state %d",
sx, sy, event->button.state));
g_message ("motion %d %d, device %p state %d",
sx, sy, device, event->button.state));
_gdk_wayland_display_deliver_event (device->display, event);
}
@@ -881,25 +904,24 @@ pointer_handle_button (void *data,
GdkEvent *event;
uint32_t modifier;
int gdk_button;
GdkWaylandDisplay *wayland_display =
GDK_WAYLAND_DISPLAY (device->display);
if (!device->pointer_focus)
return;
_gdk_wayland_display_update_serial (wayland_display, serial);
_gdk_wayland_display_update_serial (display, serial);
switch (button) {
case 273:
gdk_button = 3;
break;
case 274:
gdk_button = 2;
break;
default:
gdk_button = button - 271;
break;
}
switch (button)
{
case 273:
gdk_button = 3;
break;
case 274:
gdk_button = 2;
break;
default:
gdk_button = button - 271;
break;
}
device->time = time;
if (state)
@@ -928,9 +950,11 @@ pointer_handle_button (void *data,
device->modifiers &= ~modifier;
GDK_NOTE (EVENTS,
g_message ("button %d %s, state %d",
g_message ("button %d %s, device %p state %d",
event->button.button,
state ? "press" : "release", event->button.state));
state ? "press" : "release",
device,
event->button.state));
_gdk_wayland_display_deliver_event (device->display, event);
}
@@ -951,18 +975,19 @@ pointer_handle_axis (void *data,
return;
/* get the delta and convert it into the expected range */
switch (axis) {
case WL_POINTER_AXIS_VERTICAL_SCROLL:
delta_x = 0;
delta_y = wl_fixed_to_double (value) / 10.0;
break;
case WL_POINTER_AXIS_HORIZONTAL_SCROLL:
delta_x = wl_fixed_to_double (value) / 10.0;
delta_y = 0;
break;
default:
g_return_if_reached ();
}
switch (axis)
{
case WL_POINTER_AXIS_VERTICAL_SCROLL:
delta_x = 0;
delta_y = wl_fixed_to_double (value) / 10.0;
break;
case WL_POINTER_AXIS_HORIZONTAL_SCROLL:
delta_x = wl_fixed_to_double (value) / 10.0;
delta_y = 0;
break;
default:
g_return_if_reached ();
}
device->time = time;
event = gdk_event_new (GDK_SCROLL);
@@ -983,8 +1008,8 @@ pointer_handle_axis (void *data,
&event->scroll.y_root);
GDK_NOTE (EVENTS,
g_message ("scroll %f %f",
event->scroll.delta_x, event->scroll.delta_y));
g_message ("scroll %f %f, device %p",
event->scroll.delta_x, event->scroll.delta_y, device));
_gdk_wayland_display_deliver_event (device->display, event);
}
@@ -1014,18 +1039,18 @@ keyboard_handle_enter (void *data,
{
GdkWaylandDeviceData *device = data;
GdkEvent *event;
GdkWaylandDisplay *wayland_display =
GDK_WAYLAND_DISPLAY (device->display);
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
if (!surface)
return;
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
return;
_gdk_wayland_display_update_serial (wayland_display, serial);
_gdk_wayland_display_update_serial (display, serial);
device->keyboard_focus = wl_surface_get_user_data(surface);
g_object_ref(device->keyboard_focus);
device->keyboard_focus = wl_surface_get_user_data (surface);
g_object_ref (device->keyboard_focus);
event = gdk_event_new (GDK_FOCUS_CHANGE);
event->focus_change.window = g_object_ref (device->keyboard_focus);
@@ -1035,7 +1060,7 @@ keyboard_handle_enter (void *data,
gdk_event_set_source_device (event, device->keyboard);
GDK_NOTE (EVENTS,
g_message ("focus int, device %p surface %p",
g_message ("focus in, device %p surface %p",
device, device->keyboard_focus));
_gdk_wayland_display_deliver_event (device->display, event);
@@ -1049,17 +1074,18 @@ keyboard_handle_leave (void *data,
{
GdkWaylandDeviceData *device = data;
GdkEvent *event;
GdkWaylandDisplay *wayland_display =
GDK_WAYLAND_DISPLAY (device->display);
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
if (!surface)
return;
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
return;
if (!device->keyboard_focus)
return;
_gdk_wayland_display_update_serial (wayland_display, serial);
_gdk_wayland_display_update_serial (display, serial);
event = gdk_event_new (GDK_FOCUS_CHANGE);
event->focus_change.window = g_object_ref (device->keyboard_focus);
@@ -1068,7 +1094,7 @@ keyboard_handle_leave (void *data,
gdk_event_set_device (event, device->master_keyboard);
gdk_event_set_source_device (event, device->keyboard);
g_object_unref(device->keyboard_focus);
g_object_unref (device->keyboard_focus);
device->keyboard_focus = NULL;
GDK_NOTE (EVENTS,
@@ -1078,8 +1104,7 @@ keyboard_handle_leave (void *data,
_gdk_wayland_display_deliver_event (device->display, event);
}
static gboolean
keyboard_repeat (gpointer data);
static gboolean keyboard_repeat (gpointer data);
static void
translate_keyboard_string (GdkEventKey *event)
@@ -1100,11 +1125,11 @@ translate_keyboard_string (GdkEventKey *event)
gsize bytes_written;
gint len;
/* Apply the control key - Taken from Xlib
*/
/* Apply the control key - Taken from Xlib */
if (event->state & GDK_CONTROL_MASK)
{
if ((c >= '@' && c < '\177') || c == ' ') c &= 0x1F;
if ((c >= '@' && c < '\177') || c == ' ')
c &= 0x1F;
else if (c == '2')
{
event->string = g_memdup ("\0\0", 2);
@@ -1112,9 +1137,12 @@ translate_keyboard_string (GdkEventKey *event)
buf[0] = '\0';
return;
}
else if (c >= '3' && c <= '7') c -= ('3' - '\033');
else if (c == '8') c = '\177';
else if (c == '/') c = '_' & 0x1F;
else if (c >= '3' && c <= '7')
c -= ('3' - '\033');
else if (c == '8')
c = '\177';
else if (c == '/')
c = '_' & 0x1F;
}
len = g_unichar_to_utf8 (c, buf);
@@ -1277,7 +1305,6 @@ deliver_key_event (GdkWaylandDeviceData *device,
g_source_remove (device->repeat_timer);
device->repeat_timer = 0;
}
device->repeat_timer =
gdk_threads_add_timeout (delay, keyboard_repeat, device);
g_source_set_name_by_id (device->repeat_timer, "[gtk+] keyboard_repeat");
@@ -1310,14 +1337,13 @@ keyboard_handle_key (void *data,
uint32_t state_w)
{
GdkWaylandDeviceData *device = data;
GdkWaylandDisplay *wayland_display =
GDK_WAYLAND_DISPLAY (device->display);
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
if (!device->keyboard_focus)
return;
device->repeat_count = 0;
_gdk_wayland_display_update_serial (wayland_display, serial);
_gdk_wayland_display_update_serial (display, serial);
deliver_key_event (data, time, key + 8, state_w);
}
@@ -1439,12 +1465,11 @@ touch_handle_down (void *data,
wl_fixed_t y)
{
GdkWaylandDeviceData *device = data;
GdkWaylandDisplay *wayland_display =
GDK_WAYLAND_DISPLAY (device->display);
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
GdkWaylandTouchData *touch;
GdkEvent *event;
_gdk_wayland_display_update_serial (wayland_display, serial);
_gdk_wayland_display_update_serial (display, serial);
touch = gdk_wayland_device_add_touch (device, id, wl_surface);
touch->x = wl_fixed_to_double (x);
@@ -1467,12 +1492,11 @@ touch_handle_up (void *data,
int32_t id)
{
GdkWaylandDeviceData *device = data;
GdkWaylandDisplay *wayland_display =
GDK_WAYLAND_DISPLAY (device->display);
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
GdkWaylandTouchData *touch;
GdkEvent *event;
_gdk_wayland_display_update_serial (wayland_display, serial);
_gdk_wayland_display_update_serial (display, serial);
touch = gdk_wayland_device_get_touch (device, id);
event = _create_touch_event (device, touch, GDK_TOUCH_END, time);
@@ -1568,8 +1592,13 @@ seat_handle_capabilities (void *data,
enum wl_seat_capability caps)
{
GdkWaylandDeviceData *device = data;
GdkWaylandDeviceManager *device_manager =
GDK_WAYLAND_DEVICE_MANAGER (device->device_manager);
GdkWaylandDeviceManager *device_manager = GDK_WAYLAND_DEVICE_MANAGER (device->device_manager);
GDK_NOTE (MISC,
g_message ("seat %p with %s%s%s", seat,
(caps & WL_SEAT_CAPABILITY_POINTER) ? " pointer, " : "",
(caps & WL_SEAT_CAPABILITY_KEYBOARD) ? " keyboard, " : "",
(caps & WL_SEAT_CAPABILITY_TOUCH) ? " touch" : ""));
if ((caps & WL_SEAT_CAPABILITY_POINTER) && !device->wl_pointer)
{
@@ -1689,11 +1718,13 @@ seat_handle_capabilities (void *data,
}
static void
seat_handle_name (void *data,
struct wl_seat *seat,
const char *name)
seat_handle_name (void *data,
struct wl_seat *seat,
const char *name)
{
/* We don't care about the name. */
GDK_NOTE (MISC,
g_message ("seat %p name %s", seat, name));
}
static const struct wl_seat_listener seat_listener = {
@@ -1704,8 +1735,7 @@ static const struct wl_seat_listener seat_listener = {
static void
init_devices (GdkWaylandDeviceData *device)
{
GdkWaylandDeviceManager *device_manager =
GDK_WAYLAND_DEVICE_MANAGER (device->device_manager);
GdkWaylandDeviceManager *device_manager = GDK_WAYLAND_DEVICE_MANAGER (device->device_manager);
/* pointer */
device->master_pointer = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
@@ -1744,6 +1774,98 @@ init_devices (GdkWaylandDeviceData *device)
_gdk_device_set_associated_device (device->master_keyboard, device->master_pointer);
}
static void
pointer_surface_update_scale (GdkWaylandDeviceData *device)
{
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (device->display);
guint32 scale;
GSList *l;
if (wayland_display->compositor_version < WL_SURFACE_HAS_BUFFER_SCALE)
{
/* We can't set the scale on this surface */
return;
}
scale = 1;
for (l = device->pointer_surface_outputs; l != NULL; l = l->next)
{
guint32 output_scale =
_gdk_wayland_screen_get_output_scale (wayland_display->screen,
l->data);
scale = MAX (scale, output_scale);
}
device->current_output_scale = scale;
if (device->grab_cursor)
_gdk_wayland_cursor_set_scale (device->grab_cursor, scale);
if (device->cursor)
_gdk_wayland_cursor_set_scale (device->cursor, scale);
gdk_wayland_device_update_window_cursor (device);
}
static void
pointer_surface_enter (void *data,
struct wl_surface *wl_surface,
struct wl_output *output)
{
GdkWaylandDeviceData *device = data;
GDK_NOTE (EVENTS,
g_message ("pointer surface of device %p entered output %p",
device, output));
device->pointer_surface_outputs =
g_slist_append (device->pointer_surface_outputs, output);
pointer_surface_update_scale (device);
}
static void
pointer_surface_leave (void *data,
struct wl_surface *wl_surface,
struct wl_output *output)
{
GdkWaylandDeviceData *device = data;
GDK_NOTE (EVENTS,
g_message ("pointer surface of device %p left output %p",
device, output));
device->pointer_surface_outputs =
g_slist_remove (device->pointer_surface_outputs, output);
pointer_surface_update_scale (device);
}
static const struct wl_surface_listener pointer_surface_listener = {
pointer_surface_enter,
pointer_surface_leave
};
static GdkWindow *
create_foreign_dnd_window (GdkDisplay *display)
{
GdkWindowAttr attrs;
GdkScreen *screen;
guint mask;
screen = gdk_display_get_default_screen (display);
attrs.x = attrs.y = 0;
attrs.width = attrs.height = 1;
attrs.wclass = GDK_INPUT_OUTPUT;
attrs.window_type = GDK_WINDOW_TEMP;
attrs.visual = gdk_screen_get_system_visual (screen);
mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
return gdk_window_new (gdk_screen_get_root_window (screen), &attrs, mask);
}
void
_gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
guint32 id,
@@ -1763,6 +1885,7 @@ _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
device->device_manager = device_manager;
device->touches = g_hash_table_new_full (NULL, NULL, NULL,
(GDestroyNotify) g_free);
device->foreign_dnd_window = create_foreign_dnd_window (display);
device->wl_seat = wl_seat;
wl_seat_add_listener (device->wl_seat, &seat_listener, device);
@@ -1774,8 +1897,12 @@ _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
wl_data_device_add_listener (device->data_device,
&data_device_listener, device);
device->current_output_scale = 1;
device->pointer_surface =
wl_compositor_create_surface (display_wayland->compositor);
wl_surface_add_listener (device->pointer_surface,
&pointer_surface_listener,
device);
init_devices (device);
}
@@ -1800,6 +1927,7 @@ _gdk_wayland_device_manager_remove_seat (GdkDeviceManager *manager,
/* FIXME: destroy data_device */
g_clear_object (&device->keyboard_settings);
g_hash_table_destroy (device->touches);
gdk_window_destroy (device->foreign_dnd_window);
g_free (device);
break;
@@ -1832,7 +1960,7 @@ gdk_wayland_device_manager_list_devices (GdkDeviceManager *device_manager,
GdkWaylandDeviceManager *wayland_device_manager;
GList *devices = NULL, *l;
wayland_device_manager = (GdkWaylandDeviceManager *) device_manager;
wayland_device_manager = GDK_WAYLAND_DEVICE_MANAGER (device_manager);
for (l = wayland_device_manager->devices; l; l = l->next)
{
@@ -1849,7 +1977,7 @@ gdk_wayland_device_manager_get_client_pointer (GdkDeviceManager *device_manager)
GdkWaylandDeviceManager *wayland_device_manager;
GList *l;
wayland_device_manager = (GdkWaylandDeviceManager *) device_manager;
wayland_device_manager = GDK_WAYLAND_DEVICE_MANAGER (device_manager);
/* Find the first master pointer device */
for (l = wayland_device_manager->devices; l != NULL; l = l->next)
@@ -1943,6 +2071,7 @@ gdk_wayland_device_unset_touch_grab (GdkDevice *gdk_device,
GdkWaylandDeviceData *device;
g_return_if_fail (GDK_IS_WAYLAND_DEVICE (gdk_device));
device = GDK_WAYLAND_DEVICE (gdk_device)->device;
gdk_wayland_device_remove_touch (device, GDK_EVENT_SEQUENCE_TO_SLOT (sequence));
@@ -1953,12 +2082,9 @@ gdk_wayland_device_unset_touch_grab (GdkDevice *gdk_device,
struct wl_data_device *
gdk_wayland_device_get_data_device (GdkDevice *gdk_device)
{
GdkWaylandDeviceData *device;
g_return_val_if_fail (GDK_IS_WAYLAND_DEVICE (gdk_device), NULL);
device = GDK_WAYLAND_DEVICE (gdk_device)->device;
return device->data_device;
return GDK_WAYLAND_DEVICE (gdk_device)->device->data_device;
}
void
@@ -1969,6 +2095,7 @@ gdk_wayland_device_set_selection (GdkDevice *gdk_device,
GdkWaylandDisplay *display_wayland;
g_return_if_fail (GDK_IS_WAYLAND_DEVICE (gdk_device));
device = GDK_WAYLAND_DEVICE (gdk_device)->device;
display_wayland = GDK_WAYLAND_DISPLAY (gdk_device_get_display (gdk_device));

View File

@@ -132,6 +132,9 @@ xdg_shell_ping (void *data,
_gdk_wayland_display_update_serial (wayland_display, serial);
GDK_NOTE (EVENTS,
g_message ("ping, shell %p, serial %u\n", xdg_shell, serial));
xdg_shell_pong (xdg_shell, serial);
}
@@ -140,59 +143,85 @@ static const struct xdg_shell_listener xdg_shell_listener = {
};
static void
gdk_registry_handle_global(void *data, struct wl_registry *registry, uint32_t id,
const char *interface, uint32_t version)
gdk_registry_handle_global (void *data,
struct wl_registry *registry,
uint32_t id,
const char *interface,
uint32_t version)
{
GdkWaylandDisplay *display_wayland = data;
GdkDisplay *gdk_display = GDK_DISPLAY_OBJECT (data);
struct wl_seat *seat;
struct wl_output *output;
if (strcmp(interface, "wl_compositor") == 0) {
display_wayland->compositor =
wl_registry_bind(display_wayland->wl_registry, id, &wl_compositor_interface, MIN (version, 3));
display_wayland->compositor_version = MIN (version, 3);
} else if (strcmp(interface, "wl_shm") == 0) {
display_wayland->shm =
wl_registry_bind(display_wayland->wl_registry, id, &wl_shm_interface, 1);
GDK_NOTE (MISC,
g_message ("add global %u, interface %s, version %u", id, interface, version));
/* SHM interface is prerequisite */
_gdk_wayland_display_load_cursor_theme(display_wayland);
} else if (strcmp(interface, "xdg_shell") == 0) {
display_wayland->xdg_shell =
wl_registry_bind(display_wayland->wl_registry, id, &xdg_shell_interface, 1);
xdg_shell_use_unstable_version(display_wayland->xdg_shell, XDG_SHELL_VERSION_CURRENT);
xdg_shell_add_listener(display_wayland->xdg_shell, &xdg_shell_listener, display_wayland);
} else if (strcmp(interface, "gtk_shell") == 0) {
display_wayland->gtk_shell =
wl_registry_bind(display_wayland->wl_registry, id, &gtk_shell_interface, 1);
_gdk_wayland_screen_set_has_gtk_shell (display_wayland->screen);
} else if (strcmp(interface, "wl_output") == 0) {
output =
wl_registry_bind(display_wayland->wl_registry, id, &wl_output_interface, MIN (version, 2));
_gdk_wayland_screen_add_output(display_wayland->screen, id, output, MIN (version, 2));
} else if (strcmp(interface, "wl_seat") == 0) {
seat = wl_registry_bind(display_wayland->wl_registry, id, &wl_seat_interface, 4);
_gdk_wayland_device_manager_add_seat (gdk_display->device_manager, id, seat);
} else if (strcmp(interface, "wl_data_device_manager") == 0) {
if (strcmp (interface, "wl_compositor") == 0)
{
display_wayland->compositor =
wl_registry_bind (display_wayland->wl_registry, id, &wl_compositor_interface, MIN (version, 3));
display_wayland->compositor_version = MIN (version, 3);
}
else if (strcmp (interface, "wl_shm") == 0)
{
display_wayland->shm =
wl_registry_bind (display_wayland->wl_registry, id, &wl_shm_interface, 1);
/* SHM interface is prerequisite */
_gdk_wayland_display_load_cursor_theme (display_wayland);
}
else if (strcmp (interface, "xdg_shell") == 0)
{
display_wayland->xdg_shell =
wl_registry_bind (display_wayland->wl_registry, id, &xdg_shell_interface, 1);
xdg_shell_use_unstable_version (display_wayland->xdg_shell, XDG_SHELL_VERSION_CURRENT);
xdg_shell_add_listener (display_wayland->xdg_shell, &xdg_shell_listener, display_wayland);
}
else if (strcmp (interface, "gtk_shell") == 0)
{
if (version == SUPPORTED_GTK_SHELL_VERSION)
{
display_wayland->gtk_shell =
wl_registry_bind(display_wayland->wl_registry, id,
&gtk_shell_interface, SUPPORTED_GTK_SHELL_VERSION);
_gdk_wayland_screen_set_has_gtk_shell (display_wayland->screen);
}
}
else if (strcmp (interface, "wl_output") == 0)
{
output =
wl_registry_bind (display_wayland->wl_registry, id, &wl_output_interface, MIN (version, 2));
_gdk_wayland_screen_add_output (display_wayland->screen, id, output, MIN (version, 2));
wl_display_roundtrip (display_wayland->wl_display);
}
else if (strcmp (interface, "wl_seat") == 0)
{
seat = wl_registry_bind (display_wayland->wl_registry, id, &wl_seat_interface, MIN (version, 4));
_gdk_wayland_device_manager_add_seat (gdk_display->device_manager, id, seat);
wl_display_roundtrip (display_wayland->wl_display);
}
else if (strcmp (interface, "wl_data_device_manager") == 0)
{
display_wayland->data_device_manager =
wl_registry_bind(display_wayland->wl_registry, id,
&wl_data_device_manager_interface, 1);
} else if (strcmp (interface, "wl_subcompositor") == 0) {
display_wayland->subcompositor =
wl_registry_bind (display_wayland->wl_registry, id,
&wl_subcompositor_interface, 1);
}
wl_registry_bind (display_wayland->wl_registry, id, &wl_data_device_manager_interface, 1);
}
else if (strcmp (interface, "wl_subcompositor") == 0)
{
display_wayland->subcompositor =
wl_registry_bind (display_wayland->wl_registry, id, &wl_subcompositor_interface, 1);
}
}
static void
gdk_registry_handle_global_remove(void *data,
struct wl_registry *registry,
uint32_t id)
gdk_registry_handle_global_remove (void *data,
struct wl_registry *registry,
uint32_t id)
{
GdkWaylandDisplay *display_wayland = data;
GdkDisplay *display = GDK_DISPLAY (display_wayland);
GDK_NOTE (MISC, g_message ("remove global %u", id));
_gdk_wayland_device_manager_remove_seat (display->device_manager, id);
_gdk_wayland_screen_remove_output (display_wayland->screen, id);
@@ -205,7 +234,7 @@ static const struct wl_registry_listener registry_listener = {
};
static void
log_handler(const char *format, va_list args)
log_handler (const char *format, va_list args)
{
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, args);
}
@@ -217,6 +246,8 @@ _gdk_wayland_display_open (const gchar *display_name)
GdkDisplay *display;
GdkWaylandDisplay *display_wayland;
GDK_NOTE (MISC, g_message ("opening display %s", display_name ? display_name : ""));
/* If this variable is unset then wayland initialisation will surely
* fail, logging a fatal error in the process. Save ourselves from
* that.
@@ -224,9 +255,9 @@ _gdk_wayland_display_open (const gchar *display_name)
if (g_getenv ("XDG_RUNTIME_DIR") == NULL)
return NULL;
wl_log_set_handler_client(log_handler);
wl_log_set_handler_client (log_handler);
wl_display = wl_display_connect(display_name);
wl_display = wl_display_connect (display_name);
if (!wl_display)
return NULL;
@@ -239,8 +270,8 @@ _gdk_wayland_display_open (const gchar *display_name)
display_wayland->event_source = _gdk_wayland_display_event_source_new (display);
_gdk_wayland_display_init_cursors (display_wayland);
display_wayland->wl_registry = wl_display_get_registry(display_wayland->wl_display);
wl_registry_add_listener(display_wayland->wl_registry, &registry_listener, display_wayland);
display_wayland->wl_registry = wl_display_get_registry (display_wayland->wl_display);
wl_registry_add_listener (display_wayland->wl_registry, &registry_listener, display_wayland);
/* Wait until the dust has settled during init... */
wl_display_roundtrip (display_wayland->wl_display);
@@ -326,7 +357,7 @@ gdk_wayland_display_sync (GdkDisplay *display)
display_wayland = GDK_WAYLAND_DISPLAY (display);
wl_display_roundtrip(display_wayland->wl_display);
wl_display_roundtrip (display_wayland->wl_display);
}
static void
@@ -335,7 +366,7 @@ gdk_wayland_display_flush (GdkDisplay *display)
g_return_if_fail (GDK_IS_DISPLAY (display));
if (!display->closed)
wl_display_flush(GDK_WAYLAND_DISPLAY (display)->wl_display);
wl_display_flush (GDK_WAYLAND_DISPLAY (display)->wl_display);
}
static gboolean
@@ -356,7 +387,7 @@ gdk_wayland_display_get_default_group (GdkDisplay *display)
static gboolean
gdk_wayland_display_supports_selection_notification (GdkDisplay *display)
{
return TRUE;
return FALSE;
}
static gboolean
@@ -485,7 +516,7 @@ gdk_wayland_display_pop_error_trap (GdkDisplay *display,
}
static void
gdk_wayland_display_class_init (GdkWaylandDisplayClass * class)
gdk_wayland_display_class_init (GdkWaylandDisplayClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
GdkDisplayClass *display_class = GDK_DISPLAY_CLASS (class);
@@ -550,10 +581,15 @@ gdk_wayland_display_set_cursor_theme (GdkDisplay *display,
{
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY(display);
struct wl_cursor_theme *theme;
int i;
g_assert (wayland_display);
g_assert (wayland_display->shm);
if (g_strcmp0 (name, wayland_display->cursor_theme_name) == 0 &&
wayland_display->cursor_theme_size == size)
return;
theme = wl_cursor_theme_load (name, size, wayland_display->shm);
if (theme == NULL)
{
@@ -561,11 +597,49 @@ gdk_wayland_display_set_cursor_theme (GdkDisplay *display,
return;
}
_gdk_wayland_display_update_cursors (wayland_display, theme);
for (i = 0; i < GDK_WAYLAND_THEME_SCALES_COUNT; i++)
{
if (wayland_display->scaled_cursor_themes[i])
{
wl_cursor_theme_destroy (wayland_display->scaled_cursor_themes[i]);
wayland_display->scaled_cursor_themes[i] = NULL;
}
}
wayland_display->scaled_cursor_themes[0] = theme;
if (wayland_display->cursor_theme_name != NULL)
free (wayland_display->cursor_theme_name);
wayland_display->cursor_theme_name = g_strdup (name);
wayland_display->cursor_theme_size = size;
if (wayland_display->cursor_theme != NULL)
wl_cursor_theme_destroy (wayland_display->cursor_theme);
wayland_display->cursor_theme = theme;
_gdk_wayland_display_update_cursors (wayland_display);
}
struct wl_cursor_theme *
_gdk_wayland_display_get_scaled_cursor_theme (GdkWaylandDisplay *wayland_display,
guint scale)
{
struct wl_cursor_theme *theme;
g_assert (wayland_display->cursor_theme_name);
g_assert (scale <= GDK_WAYLAND_MAX_THEME_SCALE);
g_assert (scale >= 1);
theme = wayland_display->scaled_cursor_themes[scale - 1];
if (!theme)
{
theme = wl_cursor_theme_load (wayland_display->cursor_theme_name,
wayland_display->cursor_theme_size * scale,
wayland_display->shm);
if (theme == NULL)
{
g_warning ("Failed to load cursor theme %s with scale %u\n",
wayland_display->cursor_theme_name, scale);
return NULL;
}
wayland_display->scaled_cursor_themes[scale - 1] = theme;
}
return theme;
}
static void
@@ -591,8 +665,7 @@ _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *wayland_display)
else
name = "default";
gdk_wayland_display_set_cursor_theme (GDK_DISPLAY (wayland_display),
name, size);
gdk_wayland_display_set_cursor_theme (GDK_DISPLAY (wayland_display), name, size);
g_value_unset (&v);
}
@@ -610,30 +683,28 @@ _gdk_wayland_display_update_serial (GdkWaylandDisplay *wayland_display,
}
/**
* gdk_wayland_display_get_wl_display
* gdk_wayland_display_get_wl_display:
* @display: (type GdkWaylandDisplay): a #GdkDisplay
*
* Returns the Wayland wl_display of a #GdkDisplay
* Returns the Wayland wl_display of a #GdkDisplay.
*
* Returns: (transfer none): a Wayland wl_display
*
* Since: 3.8
*/
struct wl_display *
gdk_wayland_display_get_wl_display(GdkDisplay *display)
gdk_wayland_display_get_wl_display (GdkDisplay *display)
{
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY(display);
g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY (display), NULL);
g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY(display), NULL);
return wayland_display->wl_display;
return GDK_WAYLAND_DISPLAY (display)->wl_display;
}
/**
* gdk_wayland_display_get_wl_compositor
* gdk_wayland_display_get_wl_compositor:
* @display: (type GdkWaylandDisplay): a #GdkDisplay
*
* Returns the Wayland global singleton compositor of a #GdkDisplay
* Returns the Wayland global singleton compositor of a #GdkDisplay.
*
* Returns: (transfer none): a Wayland wl_compositor
*
@@ -642,18 +713,16 @@ gdk_wayland_display_get_wl_display(GdkDisplay *display)
struct wl_compositor *
gdk_wayland_display_get_wl_compositor (GdkDisplay *display)
{
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY(display);
g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY (display), NULL);
g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY(display), NULL);
return wayland_display->compositor;
return GDK_WAYLAND_DISPLAY (display)->compositor;
}
/**
* gdk_wayland_display_get_xdg_shell
* gdk_wayland_display_get_xdg_shell:
* @display: (type GdkWaylandDisplay): a #GdkDisplay
*
* Returns the Wayland global singleton shell of a #GdkDisplay
* Returns the Wayland global singleton shell of a #GdkDisplay.
*
* Returns: (transfer none): a Wayland xdg_shell
*
@@ -662,11 +731,9 @@ gdk_wayland_display_get_wl_compositor (GdkDisplay *display)
struct xdg_shell *
gdk_wayland_display_get_xdg_shell (GdkDisplay *display)
{
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY(display);
g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY (display), NULL);
g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY(display), NULL);
return wayland_display->xdg_shell;
return GDK_WAYLAND_DISPLAY (display)->xdg_shell;
}
static const cairo_user_data_key_t gdk_wayland_cairo_key;
@@ -737,7 +804,7 @@ create_shm_pool (struct wl_shm *shm,
return NULL;
}
pool = wl_shm_create_pool(shm, fd, size);
pool = wl_shm_create_pool (shm, fd, size);
close (fd);
@@ -834,6 +901,12 @@ _gdk_wayland_shm_surface_get_busy (cairo_surface_t *surface)
return data->busy;
}
gboolean
_gdk_wayland_is_shm_surface (cairo_surface_t *surface)
{
return cairo_surface_get_user_data (surface, &gdk_wayland_cairo_key) != NULL;
}
GdkWaylandSelection *
gdk_wayland_display_get_selection (GdkDisplay *display)
{

View File

@@ -1,7 +1,7 @@
/*
* gdkdisplay-wayland.h
*
* Copyright 2001 Sun Microsystems Inc.
*
* Copyright 2001 Sun Microsystems Inc.
*
* Erwann Chenede <erwann.chenede@sun.com>
*
@@ -42,6 +42,9 @@
G_BEGIN_DECLS
#define GDK_WAYLAND_MAX_THEME_SCALE 2
#define GDK_WAYLAND_THEME_SCALES_COUNT GDK_WAYLAND_MAX_THEME_SCALE
typedef struct _GdkWaylandSelection GdkWaylandSelection;
struct _GdkWaylandDisplay
@@ -69,7 +72,9 @@ struct _GdkWaylandDisplay
struct wl_data_device_manager *data_device_manager;
struct wl_subcompositor *subcompositor;
struct wl_cursor_theme *cursor_theme;
struct wl_cursor_theme *scaled_cursor_themes[GDK_WAYLAND_THEME_SCALES_COUNT];
gchar *cursor_theme_name;
int cursor_theme_size;
GHashTable *cursor_cache;
GSource *event_source;
@@ -99,4 +104,4 @@ struct _GdkWaylandDisplayClass
G_END_DECLS
#endif /* __GDK_WAYLAND_DISPLAY__ */
#endif /* __GDK_WAYLAND_DISPLAY__ */

View File

@@ -236,7 +236,8 @@ gdk_wayland_drag_context_drop_reply (GdkDragContext *context,
gboolean accepted,
guint32 time_)
{
gdk_wayland_drop_context_set_status (context, accepted);
if (!accepted)
gdk_wayland_drop_context_set_status (context, accepted);
}
static void
@@ -382,7 +383,11 @@ _gdk_wayland_drop_context_new (GdkDevice *device,
void
gdk_wayland_drop_context_update_targets (GdkDragContext *context)
{
GdkDisplay *display = gdk_window_get_display (context->source_window);
GdkDisplay *display;
GdkDevice *device;
device = gdk_drag_context_get_device (context);
display = gdk_device_get_display (device);
g_list_free (context->targets);
context->targets = g_list_copy (gdk_wayland_selection_get_targets (display));
}
@@ -414,6 +419,9 @@ _gdk_wayland_drag_context_set_dest_window (GdkDragContext *context,
GdkWindow *dest_window,
uint32_t serial)
{
if (context->dest_window)
g_object_unref (context->dest_window);
context->dest_window = dest_window ? g_object_ref (dest_window) : NULL;
GDK_WAYLAND_DRAG_CONTEXT (context)->serial = serial;
gdk_wayland_drop_context_update_targets (context);

View File

@@ -20,6 +20,7 @@
#include "gdkinternals.h"
#include "gdkprivate-wayland.h"
#include <stdlib.h>
#include <errno.h>
typedef struct _GdkWaylandEventSource {
@@ -32,7 +33,8 @@ typedef struct _GdkWaylandEventSource {
static GList *event_sources = NULL;
static gboolean
gdk_event_source_prepare(GSource *base, gint *timeout)
gdk_event_source_prepare (GSource *base,
gint *timeout)
{
GdkWaylandEventSource *source = (GdkWaylandEventSource *) base;
GdkWaylandDisplay *display = (GdkWaylandDisplay *) source->display;
@@ -59,7 +61,7 @@ gdk_event_source_prepare(GSource *base, gint *timeout)
}
static gboolean
gdk_event_source_check(GSource *base)
gdk_event_source_check (GSource *base)
{
GdkWaylandEventSource *source = (GdkWaylandEventSource *) base;
@@ -71,9 +73,9 @@ gdk_event_source_check(GSource *base)
}
static gboolean
gdk_event_source_dispatch(GSource *base,
GSourceFunc callback,
gpointer data)
gdk_event_source_dispatch (GSource *base,
GSourceFunc callback,
gpointer data)
{
GdkWaylandEventSource *source = (GdkWaylandEventSource *) base;
GdkDisplay *display = source->display;
@@ -109,7 +111,8 @@ static GSourceFuncs wl_glib_source_funcs = {
};
void
_gdk_wayland_display_deliver_event (GdkDisplay *display, GdkEvent *event)
_gdk_wayland_display_deliver_event (GdkDisplay *display,
GdkEvent *event)
{
GList *node;
@@ -160,11 +163,17 @@ _gdk_wayland_display_queue_events (GdkDisplay *display)
if (source->pfd.revents & G_IO_IN)
{
if (wl_display_dispatch (display_wayland->wl_display) < 0)
g_error ("Error dispatching display: %s", g_strerror (errno));
{
g_warning ("Error %d (%s) dispatching to Wayland display.",
errno, g_strerror (errno));
exit (1);
}
}
if (source->pfd.revents & (G_IO_ERR | G_IO_HUP))
g_error ("Lost connection to wayland compositor");
{
g_warning ("Lost connection to Wayland compositor.");
exit (1);
}
source->pfd.revents = 0;
}

View File

@@ -95,13 +95,78 @@ gdk_wayland_window_invalidate_for_new_frame (GdkWindow *window,
window_rect.height = gdk_window_get_height (window);
/* If nothing else is known, repaint everything so that the back
buffer is fully up-to-date for the swapbuffer */
* buffer is fully up-to-date for the swapbuffer
*/
cairo_region_union_rectangle (update_area, &window_rect);
}
}
#define N_EGL_ATTRS 16
static gboolean
gdk_wayland_gl_context_realize (GdkGLContext *context,
GError **error)
{
GdkWaylandGLContext *context_wayland = GDK_WAYLAND_GL_CONTEXT (context);
GdkDisplay *display = gdk_gl_context_get_display (context);
GdkGLContext *share = gdk_gl_context_get_shared_context (context);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
EGLContext ctx;
EGLint context_attribs[N_EGL_ATTRS];
int major, minor, flags;
gboolean debug_bit, forward_bit;
int i = 0;
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 (display_wayland->egl_display,
context_wayland->egl_config,
share != NULL ? GDK_WAYLAND_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_wayland->egl_context = ctx;
return TRUE;
}
static void
gdk_wayland_gl_context_end_frame (GdkGLContext *context,
gdk_wayland_gl_context_end_frame (GdkGLContext *context,
cairo_region_t *painted,
cairo_region_t *damage)
{
@@ -116,7 +181,7 @@ gdk_wayland_gl_context_end_frame (GdkGLContext *context,
egl_surface = gdk_wayland_window_get_egl_surface (window->impl_window,
context_wayland->egl_config);
// TODO: Use eglSwapBuffersWithDamageEXT if available
/* TODO: Use eglSwapBuffersWithDamageEXT if available */
if (display_wayland->have_egl_swap_buffers_with_damage)
{
int i, j, n_rects = cairo_region_num_rectangles (damage);
@@ -142,11 +207,13 @@ gdk_wayland_gl_context_end_frame (GdkGLContext *context,
static void
gdk_wayland_gl_context_class_init (GdkWaylandGLContextClass *klass)
{
GdkGLContextClass *context_class = GDK_GL_CONTEXT_CLASS (klass);
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GdkGLContextClass *context_class = GDK_GL_CONTEXT_CLASS (klass);
context_class->end_frame = gdk_wayland_gl_context_end_frame;
gobject_class->dispose = gdk_x11_gl_context_dispose;
context_class->realize = gdk_wayland_gl_context_realize;
context_class->end_frame = gdk_wayland_gl_context_end_frame;
}
static void
@@ -213,9 +280,9 @@ gdk_wayland_display_init_gl (GdkDisplay *display)
#define MAX_EGL_ATTRS 30
static gboolean
find_eglconfig_for_window (GdkWindow *window,
EGLConfig *egl_config_out,
GError **error)
find_eglconfig_for_window (GdkWindow *window,
EGLConfig *egl_config_out,
GError **error)
{
GdkDisplay *display = gdk_window_get_display (window);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
@@ -287,17 +354,13 @@ find_eglconfig_for_window (GdkWindow *window,
GdkGLContext *
gdk_wayland_window_create_gl_context (GdkWindow *window,
gboolean attached,
GdkGLProfile profile,
GdkGLContext *share,
GError **error)
{
GdkDisplay *display = gdk_window_get_display (window);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
GdkWaylandGLContext *context;
EGLContext ctx;
EGLConfig config;
int i;
EGLint context_attribs[3];
if (!gdk_wayland_display_init_gl (display))
{
@@ -307,53 +370,24 @@ gdk_wayland_window_create_gl_context (GdkWindow *window,
return NULL;
}
if (profile == GDK_GL_PROFILE_DEFAULT)
profile = GDK_GL_PROFILE_LEGACY;
if (profile == GDK_GL_PROFILE_3_2_CORE &&
!display_wayland->have_egl_khr_create_context)
if (!display_wayland->have_egl_khr_create_context)
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_UNSUPPORTED_PROFILE,
_("3.2 core GL profile is not available on EGL implementation"));
_("Core GL is not available on EGL implementation"));
return NULL;
}
if (!find_eglconfig_for_window (window, &config, error))
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 (display_wayland->egl_display,
config,
share ? GDK_WAYLAND_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_WAYLAND_GL_CONTEXT,
"display", display,
"window", window,
"profile", profile,
"shared-context", share,
NULL);
context->egl_config = config;
context->egl_context = ctx;
context->is_attached = attached;
return GDK_GL_CONTEXT (context);

View File

@@ -50,7 +50,6 @@ struct _GdkWaylandGLContextClass
gboolean gdk_wayland_display_init_gl (GdkDisplay *display);
GdkGLContext * gdk_wayland_window_create_gl_context (GdkWindow *window,
gboolean attach,
GdkGLProfile profile,
GdkGLContext *share,
GError **error);
void gdk_wayland_window_invalidate_for_new_frame (GdkWindow *window,

View File

@@ -250,7 +250,7 @@ get_xkb_modifiers (struct xkb_keymap *xkb_keymap,
if (state & GDK_MOD1_MASK)
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_ALT);
if (state & GDK_MOD2_MASK)
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod2");
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_NUM);
if (state & GDK_MOD3_MASK)
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod3");
if (state & GDK_MOD4_MASK)
@@ -275,7 +275,7 @@ get_gdk_modifiers (struct xkb_keymap *xkb_keymap,
state |= GDK_CONTROL_MASK;
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_ALT)))
state |= GDK_MOD1_MASK;
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod2")))
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_NUM)))
state |= GDK_MOD2_MASK;
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod3")))
state |= GDK_MOD3_MASK;
@@ -457,7 +457,7 @@ update_direction (GdkWaylandKeymap *keymap)
}
GdkKeymap *
_gdk_wayland_keymap_new ()
_gdk_wayland_keymap_new (void)
{
GdkWaylandKeymap *keymap;
struct xkb_context *context;
@@ -494,12 +494,12 @@ _gdk_wayland_keymap_update_from_fd (GdkKeymap *keymap,
context = xkb_context_new (0);
map_str = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
map_str = mmap (NULL, size, PROT_READ, MAP_SHARED, fd, 0);
if (map_str == MAP_FAILED)
{
close(fd);
return;
}
}
xkb_keymap = xkb_keymap_new_from_string (context, map_str, format, 0);
munmap (map_str, size);
@@ -523,12 +523,14 @@ _gdk_wayland_keymap_update_from_fd (GdkKeymap *keymap,
update_direction (keymap_wayland);
}
struct xkb_keymap *_gdk_wayland_keymap_get_xkb_keymap (GdkKeymap *keymap)
struct xkb_keymap *
_gdk_wayland_keymap_get_xkb_keymap (GdkKeymap *keymap)
{
return GDK_WAYLAND_KEYMAP (keymap)->xkb_keymap;
}
struct xkb_state *_gdk_wayland_keymap_get_xkb_state (GdkKeymap *keymap)
struct xkb_state *
_gdk_wayland_keymap_get_xkb_state (GdkKeymap *keymap)
{
return GDK_WAYLAND_KEYMAP (keymap)->xkb_state;
}

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