Compare commits

..

416 Commits

Author SHA1 Message Date
Matthias Clasen fd8306f340 Remove lies
We forgot the documentation when we simplified the GtkApplication
session api.
2012-05-11 17:42:47 -04:00
Benjamin Otte e12b785653 tests: USE ALL THE WORDS! 2012-05-11 04:46:40 +02:00
Benjamin Otte fe421e1a7d listview: Reduce the amount of widgets we pre-allocate for sizing
This is getting kinda dangerous because we imply that a child is at
least 4px high by now.
2012-05-11 04:46:40 +02:00
Benjamin Otte 3bb8419dff listview: Implement scrolling 2012-05-11 04:46:40 +02:00
Benjamin Otte b5dc516704 iconview: Don't draw unallocated items
This is more a workaround for Clutter-GTK than anything else. Most of
all, it makes gnome-boxes start again.
2012-05-09 14:12:24 +02:00
Benjamin Otte e34702911b listview: Add a scrollbar
The scrollbar doesn't do anything. It's just put in the correct place.
2012-05-09 08:31:26 +02:00
Benjamin Otte 5822782963 listview: Add vfuncs for widget management
No public API yet, I don't have a good one...
2012-05-09 07:49:45 +02:00
Benjamin Otte 02bc5022fa tests: Add testlistview 2012-05-09 05:06:56 +02:00
Benjamin Otte b794cdbb0a listview: Add skeleton
The widget doesn't do very much yet. But at least it prints lots of
"Hello world".
2012-05-09 05:06:22 +02:00
Benjamin Otte d736d06db8 iconview: Only compute item sizes in one place
Code was using different places to compute the icon size when layouting
and when doing size requests. This resulted in non-matching behavior in
obscure cases. And that lead to iconviews that were too small.
2012-05-08 03:58:23 +02:00
Benjamin Otte e31fb77c22 iconview: Bring back per-row contexts
Apparently GtkCellAreaContext is broken enough to not allow multiple
allocations...
2012-05-08 03:58:23 +02:00
Benjamin Otte e8eeb39d98 iconview: Move wrap width adjustment to size request code 2012-05-08 03:58:23 +02:00
Benjamin Otte f51c9d4154 stylecontext: Make queue_invalidate() always work
Handle both the case where a widget is set and also the case where a
widget path is set.
2012-05-08 03:58:23 +02:00
Rui Matos a0f155e839 immulticontext: Always check if the global context id changed
This makes sure that if the gtk-im-module setting changes we update
our internal state immediately on the next event whichever it is.

In particular this fixes the case of the gtk-im-module setting
changing while the user is typing and the slave context remaining the
same, effectively ignoring the setting change.

https://bugzilla.gnome.org/show_bug.cgi?id=675365
2012-05-08 00:35:30 +02:00
Cosimo Cecchi a4d76439e6 infobar: set default border/spacing on action/content areas
Commit cdf473ec10 deprecated the style
properties associated with the container border width and box spacing of
the action and content areas, in favour of using
gtk_container_set_border_width() and gtk_box_set_spacing() on the
widgets themselves, but failed to initialize those values to the
defaults.
2012-05-07 18:06:32 -04:00
John Ralls 985881ffcc [Bug 675501] gtkquartz.h is not in the gtk+-3.5.2.tar.xz archive
Rearrange the gtk_private_h_sources so that they're all added to EXTRA_DIST instead of only the ones included in the current build.
2012-05-07 14:59:06 -07:00
John Ralls b5bcdbc10f Rename gtkquartz-menu to gtkmodelmenu-quartz
Makes name consistent with other quartz-only modules and makes it clear that this works with the GMenuModel system rather than the older GtkMenu system.
2012-05-07 14:59:06 -07:00
Federico Mena Quintero e00847b0d5 bgo#675421 - Set the wm_role on GtkFileChooserDialog
The window's role is 'GtkFileChooserDialog', so that window managers can match it
for positioning.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-05-07 15:42:32 -05:00
Benjamin Otte 5722f9ab0f sizerequest: Improve warning message
Actually print out the function we're warning about
2012-05-07 17:37:36 +02:00
Benjamin Otte 86cebc9b43 iconview: Fix negative natural size request on empty iconview 2012-05-07 17:19:10 +02:00
Benjamin Otte 78638f798b broadway: Fix vfunc prototype 2012-05-07 04:12:29 +02:00
Benjamin Otte 20583c6d98 build: Don't invoke pkg-config directly
Instead, always use PKG_CHECK_MODULES(). That macro actually gets it
right. In particular the erroring out part when you miss xkbcommon or
wayland-client.
2012-05-07 04:12:26 +02:00
Benjamin Otte e133c6cb71 iconview: Don't expand items to more than natural size
This ensures that items stay left-aligned instead of slowly expanding into
empty space when widening the iconview. It's also what the iconview did
pre-refactoring.

Note that for cases where natural width != minimum width, the cells
might still expand and shrink back.
2012-05-07 01:37:27 +02:00
Benjamin Otte e187cda5e9 tests: Remove unused include
Fixes build
2012-05-07 00:16:45 +02:00
Benjamin Otte d20d7c54d3 iconview: Redo layouting 2012-05-07 00:12:26 +02:00
Benjamin Otte b7385ffcab iconview: Respect item width in size requestr code 2012-05-07 00:12:26 +02:00
Benjamin Otte d406bf96d4 iconview: Reduce complexity of sizing code
Always assume max-columns and min-rows. The old approach was kinda
insane.

As an example, try to write an algorithm that optimizes the minimum size
for infinite (take a reasonably large number like 2520) word-wrapped
Monospace text cells containing the text "XXXXX XXX XXX XXXXX" (keep in
mind that this is the easy problem, because it's assuming equal cell
renderers). There's 4 ways to reasonably lay out this text:
19 glyphs (19x1):
  XXXXX XXX XXX XXXXX
18 glyphs (9x2):
  XXXXX XXX
  XXX XXXXX
21 glyphs (7x3):
  XXXXX
  XXX XXX
  XXXXX
20 glyphs (5x4):
  XXXXX
  XXX
  XXX
  XXXXX
The best thing to do usually is using the 9x2 approach, but that's
neither the one using the natural nor the one using the minimum size.

As a side note, this does not include spacing and padding, which might
also influence the decision. Nor does it include height-for-width
considerations. Look at this table (numbers given in glyphs, not pixels,
as for pixel-sizes it gets even more interesting):
  given  best solution
  width  columns  sizing  glyphs per cell
   6      1       6x4           20
   7      1       7x3           21
   8      1       7x3           24
   9      1       9x2           18
  10      1/2     9x2/5x4       20
  11      1/2     9x2/5x4       22
  12      1/2     9x2/5x4       24
  13      1/2     9x2/5x4       26
  14      2       7x3           21
  15      3       5x4           20
  16      3       5x4           21.3
  17      3       5x4           22.7
  18      2       9x2           18
  19      1/2    19x1/8x2       19
  20      1/2/4  19x1/8x2/5x4   20
  21      1-4     any           21
  22      1-4     any           22
  23      1-4     any           23
  24      1-4     any           24
  25      5       5x4           20
  26      5       5x4           20.8
  27      3       9x2           18
  28      3       9x2           18.7
  29      3       9x2           19.3
  30      3/6     9x2/5x4       20

Now of course, nobody wants the number of columns to randomly change in
inexplicable ways while they enlarge or shrink an iconview, so we not
only have to optimize for smallest or other size measurements, but we
also have to optimize for "most pleasing to the eye".

And last but not least, I'd like to once again remind you - if you kept
up until now - that this discussion was for identically-sized cells
only.
2012-05-07 00:12:26 +02:00
Benjamin Otte 2da7a6d803 tests: Make testcellarea use an iconview 2012-05-07 00:12:26 +02:00
Benjamin Otte 65ad492c24 iconview: Redo size requests
Instead of just returning the last allocated numbers, we now compute the
proper sizes from scratch. This is a bit less trivial, but it results in
proper height-for-width handling.
2012-05-07 00:12:26 +02:00
Benjamin Otte 63ddb3f2c7 iconview: Don't cache iters
This is a huge quest to remove all caching from GtkIconview to simplify
the code. As it turns out, iconview performance is a joke, so the caches
are kinda unnecessary.

If we need caching, we can add it in a useful way later.
2012-05-07 00:12:26 +02:00
Benjamin Otte ee91e272a8 iconview: Remove needless requirement
If we use
  &item->cell_area
instead of
  (GdkRectangle *) item
there is no need anymore to keep the cell_area as the first member of
the the item. And we cget compile-time checks for changes to the item
struct.
2012-05-07 00:12:26 +02:00
José Alburquerque 7604e2d418 gtk_entry_[get|set]_inner_border(): Clarify the deprecation docs. 2012-05-06 15:05:27 -04:00
Paolo Borelli 3b0cd0eb8a [socket]: fix gtk-doc warnings. 2012-05-06 12:37:59 +02:00
Marc-André Lureau 4884a7c1af gdk: do not send leave event on touchpad button release
This is along the changes introduced in
bd55519f7e,
A TOUCHPAD device behaves like a mouse"

https://bugzilla.gnome.org/show_bug.cgi?id=674549
2012-05-05 14:39:37 -04:00
Yaron Shahrabani 321d06117f Updated Hebrew translation. 2012-05-05 18:22:56 +03:00
Fran Diéguez 3ad3a6699a Updated Galician translations 2012-05-05 15:18:26 +02:00
Cosimo Cecchi e5f0e30843 themingengine: don't hardcode the slider lines in the theming engine
It's wrong to hardcode the slider lines here; those should be rendered
as an additional background layer using background-image if the theme
specifies so.

https://bugzilla.gnome.org/show_bug.cgi?id=652304
2012-05-04 16:47:24 -04:00
Cosimo Cecchi 5a8e2b5995 entry-completion: set size request on the toplevel window
Instead of setting it on the child scrolled window. This is needed
because the whole window's allocation must be equal to the one of the
entry (in case the popup-set-width property is TRUE); if we set the size
request on a children of the window, there might be other children with
borders/paddings in between the toplevel and the child we set the size
request too, which will break alignment.

https://bugzilla.gnome.org/show_bug.cgi?id=672947
2012-05-04 15:43:29 -04:00
Cosimo Cecchi 644070b551 entry-completion: don't subtract entry borders from popup allocation
The completion popup should be aligned with the GtkEntry allocation, not
less than that.

https://bugzilla.gnome.org/show_bug.cgi?id=672947
2012-05-04 15:43:27 -04:00
Daniel Mustieles 3f54cf9e78 Updated Spanish translation 2012-05-04 14:16:45 +02:00
Carlos Garcia Campos a18f018d87 cellrenderertext: Add placeholder-text property
It works similar to placeholder text in a GtkEntry, if the cell renderer
is editable and it's empty, the placeholder text is displayed.
https://bugzilla.gnome.org/show_bug.cgi?id=645514
2012-05-03 23:35:34 -04:00
David King 2d10c8844e docs: Improve GtkMessageDialog description
Add mention of default setting of GtkWindow:skip-taskbar-hint.

https://bugzilla.gnome.org/show_bug.cgi?id=587873
2012-05-04 03:09:13 +01:00
David King e6daedae0a docs: Move GtkSelectionData to gtk3-Selections
Put the (albeit empty) documentation for the GtkSelectionData struct
with the gtk_selection_data_*() methods.

https://bugzilla.gnome.org/show_bug.cgi?id=663072
2012-05-04 03:06:47 +01:00
David King da1a90bcaf docs: Correct gtk_tree_row_reference_new() description
Remove the text that mentions listening to tree model signals, and
instead say that any changes are automatically propagated.

https://bugzilla.gnome.org/show_bug.cgi?id=478344
2012-05-04 03:04:58 +01:00
Bastien Nocera c1f01eb929 Add support for disabling middle click paste
Adds a gtk-enable-primary-paste setting that is backed by
and X setting, and make GtkEntry and GtkTextView respect it.

https://bugzilla.gnome.org/show_bug.cgi?id=665243
2012-05-03 21:59:54 -04:00
Ryan Lortie 88c63903a5 printing: Rename GTK_UNIT_PIXEL to GTK_UNIT_NONE
...and document that many functions don't accept "none" as a unit.

https://bugzilla.gnome.org/show_bug.cgi?id=460908
2012-05-03 18:30:48 -07:00
Dan Winship 154ce014a8 gdk: add bindings-friendly alias for GDK_EVENT_2BUTTON_PRESS
GDK_EVENT_2BUTTON_PRESS and GDK_EVENT_3BUTTON_PRESS can't be used from
some bindings because they'd translate to something syntactically
invalid. Add GDK_EVENT_DOUBLE_BUTTON_PRESS and
GDK_EVENT_TRIPLE_BUTTON_PRESS aliases to work around that.

https://bugzilla.gnome.org/show_bug.cgi?id=671025
2012-05-03 21:22:39 -04:00
Rui Matos 4d7c7ec32f window: Remove needless call to ensure_state_flag_backdrop() on map
This call was forcing needless work since gtk_window_map() already
does a gdk_window_show() which initially sets GDK_WINDOW_STATE_FOCUSED
that we then handle regularly on the widget's window state event
handler.

https://bugzilla.gnome.org/show_bug.cgi?id=673237
2012-05-03 17:24:05 -07:00
Michael Biebl 7c038b1b33 build: Fix out-of-tree build of widget-factory demo application
https://bugzilla.gnome.org/show_bug.cgi?id=674192
2012-05-03 17:22:11 -07:00
Reinout van Schouwen 549ec0d190 Updated Dutch po-properties translation by Rachid, reviewed by Reinout
van Schouwen.
2012-05-04 00:23:36 +02:00
Matthias Clasen 823ee6d529 Fix unclosed comments 2012-05-03 16:11:14 -04:00
Cosimo Cecchi b9eb02ebbe colorbutton: don't hardcode a 16px margin around the color sample
Since themes might want different paddings around the color sample
according to where it's being used, don't hardcode a 16px one here.
The theme can specify a padding to get the same effect.

Reported by Christian Persch <chpe@gnome.org>
2012-05-03 15:03:22 -04:00
Christian Persch 4b4ec4472c application: Fix build without x11 2012-05-03 18:47:58 +02:00
Christian Persch ff66d0d8e5 application: Add unique IDs for GtkApplicationWindow
This will allow to refer to specific GtkApplicationWindows remotely by ID.

https://bugzilla.gnome.org/show_bug.cgi?id=674409
2012-05-03 17:45:46 +02:00
Emmanuele Bassi 824776cb02 fontsel: Add a deprecation note in the constructor docs
To match the compiler attribute, otherwise the introspection scanner
will not pick up the deprecation.
2012-05-03 08:07:13 +01:00
Chun-wei Fan 5f61f40601 Bug 670499-gtk/fallback-c89.c: Add fallback for nearbyint()
This adds a C89 implementation for nearbyint() as it is a function that
is only made available in C99.
2012-05-03 11:59:16 +08:00
Chun-wei Fan a5626c489e Bug 670499-gdk/gdkrgba.c: Include fallback-c89.c
Include (gdk/)fallback-c89.c as isnan() and isinf() is used.
2012-05-03 11:55:20 +08:00
Chun-wei Fan 4f56f53ad7 Bug 670499-Add gdk/fallback-c89.c
Add a fallback-c89.c for the gdk/ subdirectory as there is code that uses
functions that are introduced by C99.  This currently adds fallback
implementations for MSVC for isnan() and isinf()

Dist this "new" source file as well
2012-05-03 11:55:11 +08:00
Chun-wei Fan c97f0b660c Bug 670499-configure.ac: Check for nearbyint(), isinf() and isnan()
nearbyint(), isinf() and isnan() are C99 functions, so check for them.

Also clean up configure.ac a little bit as the checks for rint() and
round() can be a bit simpler, according to Matthias' suggestions.
2012-05-03 11:54:41 +08:00
Chun-wei Fan 2969db9993 Bug 670449-gtk/gtksettings.c: Fix build on Windows
On Windows, gtkwin32themeprivate.h is needed as
_gtk_win32_theme_get_default() is called on that platform to avoid C4013
warnings/errors (aka implicit declaration of ... for GCC folks).
2012-05-03 11:54:15 +08:00
Cosimo Cecchi aeb5cb2caa pathbar: fix a copy/paste error from last commit
We need to update the child pointer to the current iterator when going
trough the button list.
2012-05-02 11:49:40 -04:00
Benjamin Otte 0743cef50d stylecontext: Disallow adding/removing GtkSettings style providers
Adding "system" providers like the GtkSettings object shouldn't be
allowed at all, so ensure that it indeed is not.
2012-05-02 17:04:49 +02:00
Benjamin Otte 01b75f19a6 pathbar: Only invalidate styles in allocate if stuff really changed
I still don't like queueing restyles in size_allocate(), but I can't
come up with a better mechanims for the way the pathbar works today.
2012-05-02 17:04:49 +02:00
Dimitris Spingos 532c66df81 Updated Greek translation 2012-05-02 12:21:52 +03:00
Benjamin Otte 793748eadd debug: Add GTK_DEBUG=no-css-cache
See inline comments for what it does. Its main use is figuring out if
something has been caused by GTK's caching of CSS properties or if it's
a different problem.
2012-05-02 02:00:11 +02:00
Benjamin Otte b0317280e7 build: Set G_ENABLE_DEBUG for minimal --enable-debug=minimum
With that flag set, we get GDK_DEBUG and GTK_DEBUG support. And those
provide useful features we want when debugging.
2012-05-02 02:00:11 +02:00
Benjamin Otte d22a632b54 window: Validate style context before first allocation
When we don't do that, we completely botch sizing popups. Not good.

Fixes remaining failing reftests
2012-05-02 02:00:11 +02:00
Benjamin Otte 40915d9a34 reftests: Remove unneeded event boxes
The event boxes break when backgrounds are transparent.

Fixes border-image-repeat.ui reftest.
2012-05-02 02:00:11 +02:00
Benjamin Otte d7992d0f4e reftests: Make reset css include new CSS properties 2012-05-02 02:00:10 +02:00
Cosimo Cecchi fd549e432f cssshadow: plug a memory leak 2012-05-01 15:03:47 -04:00
Matthias Clasen b07e51bfee Bump version 2012-04-30 23:18:49 -04:00
Matthias Clasen c0708f23df Bump to 3.5.2 2012-04-30 23:02:18 -04:00
Matthias Clasen 3be5c09a90 Add some more documentation about GDK_SCROLL_SMOOTH 2012-04-30 22:28:08 -04:00
Benjamin Otte 333a5b4307 cssshadow: Default fallback color is transparent
... not the current color. Fixes unresolvable.ui test.
2012-05-01 03:13:02 +02:00
Benjamin Otte b4195cb408 cssmatcher: Handle case of empty widget path
This is tested by the stylecontext test, but doesn't appear in practice.
2012-05-01 03:13:02 +02:00
Benjamin Otte 6c63842e68 cssprovider: Actually match the state for style properties
Copy/paste error when refactoring.

Caught by stylecontext test.
2012-05-01 03:13:02 +02:00
Benjamin Otte 12846d821c versionmacros: min-require the current stable version
.. instead of the previous stable version.

This ensures that if we use GDK_DEPRECATED_IN_3_6, it will actually emit
a warning in GTK 3.5, and not wait with that until GTK 3.7. This is
particularly useful for stuff that gets deprecated right now. This code
should emit warnings right now, so we know what we're doing while
deprecating.
2012-05-01 03:13:01 +02:00
Benjamin Otte 7bb19b85c2 docs: Fix copy/paste typo 2012-05-01 03:13:01 +02:00
Benjamin Otte 4531da17e4 gtk: Get rid of deprecation warnings 2012-05-01 03:13:01 +02:00
Benjamin Otte de9ffc99c2 tests: Ifdef out unused code
The test using those functions was disabled in
b310ba29d0
2012-05-01 03:13:01 +02:00
Benjamin Otte 23907e1d53 build: Remove now-unused GTK_DISABLE_DEPRECATED undefs 2012-05-01 03:13:01 +02:00
Matthias Clasen e9e557a353 Update reference output for css parser tests
Seems these were not kept up-to-date with the recent
CSS parser changes.
2012-04-30 20:45:46 -04:00
Ryan Lortie af71917015 GtkApplication: adjust to GApplication changes
GApplication now makes the session bus and object path available as a
public API on the application instance.  Use that instead of trying to
guess values for ourselves.

This causes this version of Gtk+ to depend on GLib 2.32.2, so bumping
version dependency accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=671249
2012-04-30 17:50:45 -04:00
Ryan Lortie babd137e32 GtkApplication: fixes for NULL session bus
We currently have a couple of cases where GtkApplication assumes that
the session bus will be non-NULL causing critical error output or (in
the case of trying to publish menus) an infinite loop.

Three fixes:

 - if the session bus is NULL due to not having registered the
   GtkApplication yet then give a g_critical on the entry point to the
   menu setters instead of going into an infinite loop.  Document this.

 - check for NULL session bus even when calling the menu setters at the
   right time in order to prevent the infinite loop for
   non-programer-error cases (ie: because we had trouble connecting to
   the session bus)

 - check for NULL session bus when publishing the X11 properties on the
   GtkApplicationWindow and skip publishing them if we're not on the bus

https://bugzilla.gnome.org/show_bug.cgi?id=671249
2012-04-30 17:50:45 -04:00
Cosimo Cecchi cdf473ec10 infobar: deprecate broken GtkInfoBar style properties
The way we use these style properties to set regular properties on
containers accessible from the public API is really just broken, and
could lead to undefined values for the spacing and border-width
container properties (since they could be set from public API and then
changed from under in a style_update handler from GTK).

Take this as an occasion to deprecate these style properties, which do
not make a lot of sense anyway, now that GtkInfoBar supports regular CSS
padding and border.
2012-04-30 17:14:44 -04:00
Owen W. Taylor 0aa989ae76 GtkPlug: fix handling of key events for different layouts
GtkPlug directly handles X KeyPress/Release events, instead of using
translation in GDK (which expects XI2 events for XI2). When this
was done, the handling of the group was stubbed out and never replaced.

Export gdk_keymap_x11_group_for_state() and gdk_keymap_x11_is_modifier()
so we can fill out the fields correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=675167
2012-04-30 16:35:10 -04:00
Paolo Borelli 2f81a58573 Fix info-bar reftest
InfoBar must take into account the border and padding when requesting
its allocation, since it is then drawing them. Besides, the border and
background should always be drawn, even when the message type is OTHER.
2012-04-30 21:53:17 +02:00
Paolo Borelli 9af5d89f26 Fix infobar reftest for label background changes
Fix the reftest after previous commit

https://bugzilla.gnome.org/show_bug.cgi?id=670743
2012-04-30 21:53:17 +02:00
Cosimo Cecchi 868b28b503 reftests: fix background-size reftest
We have to be careful and not set the background on the labels
themselves.

https://bugzilla.gnome.org/show_bug.cgi?id=670743
2012-04-30 13:13:46 -04:00
Paolo Borelli 03bf85ba07 Paint label background
Make GtkLabel respect background css properties.

https://bugzilla.gnome.org/show_bug.cgi?id=670743
2012-04-30 13:13:25 -04:00
Cosimo Cecchi 20f8dd2309 themingbackground: fix copy/paste typo
We need to fetch the area value for the origin, not for the clip.
2012-04-30 12:10:45 -04:00
Matthias Clasen b310ba29d0 Disable configuration-dependent keymap tests for now
These need to be made independent of the xkb configuration somehow.
As things are now, they will either fail when run on a naked X
server in make check, or fail when run in my session.
2012-04-30 07:32:33 -04:00
Matthias Clasen 18db64749f Fix build with --enable-debug 2012-04-30 07:07:33 -04:00
Matthias Clasen 328add40ca Updates for 3.5.1 2012-04-30 07:02:01 -04:00
William Jon McCann 922b404091 Mention XDG Base Dir migration in README for 3.6
https://bugzilla.gnome.org/show_bug.cgi?id=646631
2012-04-30 06:50:17 -04:00
William Jon McCann ceb3fecd11 Migrate to XDG config dir for bookmarks
Will read from old location if new location isn't found but will
write it out to the new location.

https://bugzilla.gnome.org/show_bug.cgi?id=646631
2012-04-30 06:42:35 -04:00
William Jon McCann f10176e49f Prefer xdg data directory to legacy .icons directory
https://bugzilla.gnome.org/show_bug.cgi?id=646631
2012-04-30 06:42:34 -04:00
William Jon McCann 9f5e580821 Try to load css themes from the XDG config directory first
Will fall back to previous locations.

https://bugzilla.gnome.org/show_bug.cgi?id=646631
2012-04-30 06:42:33 -04:00
William Jon McCann bbb7b2987e Migrate to XDG config dir for custom papers
Will read from old location if new location isn't found but will
only write to the new location.

https://bugzilla.gnome.org/show_bug.cgi?id=646631
2012-04-30 06:42:31 -04:00
William Jon McCann fa0d6127c3 Don't load binary modules from the home directory by default
We should rely on the module path environment variables being
set correctly for the architecture rather than load from .gtk-3.0

https://bugzilla.gnome.org/show_bug.cgi?id=646631
2012-04-30 06:42:30 -04:00
Richard Hughes bf71b88319 Fix the colord support in GtkPrinterCups when the PPD is loaded async
If the PPD is not available when the printer is loaded then the PPD options are
not available and we can't get the correct qualifier to use with colord.

When the PPD becomes available, refresh the profile title to reflect reality.

https://bugzilla.gnome.org/show_bug.cgi?id=674890
2012-04-30 06:22:12 -04:00
Matthias Clasen 0c6d158373 GtkGrid: Add a note about overlapping children
https://bugzilla.gnome.org/show_bug.cgi?id=669989
2012-04-28 02:19:45 -04:00
Matthias Clasen d44edc1f7d Revert "WIP: make GtkNotebook window-draggable"
This reverts commit b3a66c59ad.
2012-04-28 02:06:37 -04:00
Carlos Garnacho 676441398a treemodelsort: fix iter_previous so it can go back to the first item
It was getting the previous element, then checking whether it was the
first one, that has to be inverted so it doesn't stop on the second
item.

https://bugzilla.gnome.org/show_bug.cgi?id=674587
2012-04-28 02:01:16 -04:00
Diego Escalante Urrelo b3a66c59ad WIP: make GtkNotebook window-draggable
https://bugzilla.gnome.org/show_bug.cgi?id=672427

https://bugzilla.gnome.org/show_bug.cgi?id=674587
2012-04-28 02:01:16 -04:00
Matthias Clasen 22eb687264 Add a 'fine adjustment' mode to ranges
Shift-click in the slider now starts a drag in 'fine adjustment'
mode, where we move the slider 10-times slower than the mouse.

This can be very helpful when scrolling through a very long document
or webpage, and moving the scrollbar even a single pixel already
jumps too far in the content.

https://bugzilla.gnome.org/show_bug.cgi?id=563688
2012-04-27 12:08:16 -04:00
Matthias Clasen 162614aab4 Change button bindings for range widgets around
It seems to be general consensus that button 1 should do the jumping,
so we now jump to the clicked position on primary button clicks and
page on secondary button clicks. Touch behaves like primary.

https://bugzilla.gnome.org/show_bug.cgi?id=563688
2012-04-27 12:08:15 -04:00
Debarshi Ray 1d5ba789d5 stylecontext: Add GTK_STYLE_CLASS_DIM_LABEL
Fixes: https://bugzilla.gnome.org/674468
2012-04-27 14:55:49 +02:00
Matthias Clasen 4e18e5f687 gtk-demo: fix the tool palette demo
The palette was confined to its minimal size, when in horizontal mode.
2012-04-27 08:30:05 -04:00
Benjamin Otte 0cf3791c28 toolpalette: Configure adjustment properly
https://bugzilla.gnome.org/show_bug.cgi?id=673650
2012-04-27 03:33:57 +02:00
Benjamin Otte 145b59b4b1 toolpalette: Rename variable
The variable that holds the total size for all widget allocations
shouldn't be called page_start.
2012-04-27 03:28:22 +02:00
Cosimo Cecchi 271adacfad icontheme: search first in all themes if the requested icon is symbolic
Symbolic icons use a "-symbolic" suffix to distinguish themselves from
highcolor variants. Note that the dash character here has a different
meaning than the specificity level defined in the icon-naming-spec [1],
as it identifies a property of the icon itself.

Since they might be provided by a parent theme (e.g. the HighContrast theme
relies on the gnome icon theme for them), when we are looking up one we
should first escape the generic icon inheritance mechanism defined in the
icon-naming-spec [1], and privilege a symbolic icon, if it exists in a
parent theme, before applying the inheritance evaluation.

This fixes symbolic icons not working properly when used in the
HighContrast theme with the GTK_ICON_LOOKUP_GENERIC_FALLBACK flag set.

[1]
http://standards.freedesktop.org/icon-naming-spec/latest/ar01s03.html

https://bugzilla.gnome.org/show_bug.cgi?id=674806
2012-04-26 13:52:01 -04:00
Cosimo Cecchi 7e917e54a3 themingengine: simplify render_extension() default implementation
Avoid doing useless translations/rotations, since themes will most
likely set different CSS gradients using left/right/top/bottom style
classes, or use a plain color.

https://bugzilla.gnome.org/show_bug.cgi?id=674809
2012-04-26 13:50:20 -04:00
Cosimo Cecchi d12fd1435a themingengine: render a frame in gtk_render_handle()
We already render a background there after all.

https://bugzilla.gnome.org/show_bug.cgi?id=674808
2012-04-26 13:45:24 -04:00
Cosimo Cecchi 5538552ebc spinbutton: port to GtkIconHelper
Instead of doing our own lookup for symbolic icons and rendering the
pixbuf, use GtkIconHelper as other widgets do, which saves a bunch of
code.

https://bugzilla.gnome.org/show_bug.cgi?id=674807
2012-04-26 13:35:54 -04:00
Mark Vender d9eb667776 Regenerate the gdk/gdkkeysyms.h and gdk/gdkkeysyms-compat.h files
https://bugzilla.gnome.org/show_bug.cgi?id=673259
2012-04-25 20:29:36 -04:00
Mark Vender d13740b2ba Fix the gdk/gdkkeysyms-update.pl to reflect new upstream location
https://bugzilla.gnome.org/show_bug.cgi?id=673259
2012-04-25 20:29:29 -04:00
Rob Bradford af8e4ee8e7 wayland: Calculate window position offset to give emulated root coordinates
This allows combo box popup windows to appear in the correct place. This is a
workaround emulating root coordinates by calculating the offset for a chain
of windows that that are relative to each other.
2012-04-25 14:36:08 +01:00
Rob Bradford 568b310eb3 wayland: Only update position if the with_move flag is set
This was causing the combobox popup to be moved to (0,0) when just the
size was asserted.
2012-04-25 12:00:40 +01:00
Rob Bradford 55261f4e3f wayland: Improve error message handling in cursor buffer code 2012-04-25 12:00:40 +01:00
Matthias Clasen 87cd49371a Make page up/down work again in scrolled menus
This was broken since before GTK+ 3.0, when we replaced
a use of requisition by allocation. Fix this by using the
requisition height, that is already cached by the menu code.

The math is not quite right here; if you page all the way
down a long menu, you end up on the second-to-last menuitem.
But at least, page up/down let you move up and down the menu
again.
https://bugzilla.gnome.org/show_bug.cgi?id=668931
2012-04-24 23:34:12 -04:00
Sam Thursfield 2e873e3fdc Fix build with XInput < 2.2
Fixes regression introduced in fa8e6f7857
2012-04-24 12:55:39 +01:00
Cosimo Cecchi 2058ea09a7 docs: add gtk_builder_add_from_resource() to gtk-doc 2012-04-23 17:42:17 -04:00
John Ralls 46385aff03 Remove some more CUPS 1.2 ifdefs. 2012-04-23 12:44:06 -07:00
John Ralls 2c000c8e61 Bug 670373: modules/printing/cups/gtkprintbackendcups.c won't build with CUPS 1.6
Fix up accesses of ipp structures in gtkcupsutils.c
2012-04-23 12:44:06 -07:00
John Ralls 02f57f9642 Bug 670373: modules/printing/cups/gtkprintbackendcups.c won't build with CUPS 1.6
Having refactored cups_request_printer_list_cb so that the cups
version-dependent block size is small enough to be handled in a single ifdef,
make the ifdef HAVE_CUPS_API_1_6 block.
2012-04-23 12:44:06 -07:00
John Ralls 3e354a17ef Move some variable declarations into the scopes in which they're used. 2012-04-23 12:44:06 -07:00
John Ralls 58ca84584a Extract Function cups_create_printer 2012-04-23 12:44:06 -07:00
John Ralls d10d34e0ec Extract function cups_printer_handle_attribute 2012-04-23 12:44:06 -07:00
John Ralls 651f7b4b93 Extract printer setup variables into a struct
So that it can be passed as a single parameter to functions as we extract-function to make cups_request_printer_list_cb more manageable.

Note that not all of the affected variables are changed in this changeset. Those are in extracted functions and will be addressed in the next two changes.
2012-04-23 12:44:06 -07:00
John Ralls 4945b832b2 Create enum PrinterStateLevel
Fixes "magic number" in printer_state_reason_level.
2012-04-23 12:44:06 -07:00
John Ralls 60969ff951 Extract reasons and reasons_desc arrays to file level
So that they can be used from more than one function. Rename them to avoid naming conflicts.
2012-04-23 12:44:06 -07:00
John Ralls bfad99ad52 Bug 670373: modules/printing/cups/gtkprintbackendcups.c won't build with CUPS 1.6
The first, simple changes. Turns off the deprecation warnings and substitutes macros and short ifdef blocks where feasible.
2012-04-23 12:44:06 -07:00
Giovanni Campagna dee341fc35 StyleProviderPrivate: mark internal variable as static
Otherwise, it could conflict with other symbols with the same
name exported by a different shared library, with undefined
effects.

https://bugzilla.gnome.org/show_bug.cgi?id=674577
2012-04-23 19:16:14 +02:00
Yuri Kozlov 9d6811859f Updated Russian translation 2012-04-23 12:14:57 +04:00
Cosimo Cecchi 8bb3a2001f xi2: ignore extraneous events for smooth scroll
Since the event will be ignored anyway after it's translated (slave
devices are disabled), don't let it run in the smooth scroll code path,
as it will burn our caches for the actual event we're interested in.

https://bugzilla.gnome.org/show_bug.cgi?id=673644
2012-04-22 13:06:39 -04:00
Cosimo Cecchi 37149668c0 xi2: fix thinko in variable type
https://bugzilla.gnome.org/show_bug.cgi?id=673644
2012-04-22 13:01:08 -04:00
Matthias Clasen 5a41b74c5c XI2: More logging for smooth scrolling
In addition to the delta, log device information.
This was triggered by
https://bugzilla.gnome.org/show_bug.cgi?id=673644
2012-04-22 13:00:47 -04:00
Matthias Clasen 9107074795 Beginning of keyhash tests
Not very interesting yet
2012-04-22 13:00:46 -04:00
Kristian Rietveld 89f166b542 quartz: fix coordinates for synthesized event
Of course, we must pass coordinates in the NSWindow coordinate system
when creating an NSEvent. This fixes drag icon positioning and makes
the icon slide back to the correct position when the drag is
canceled.
2012-04-22 17:38:52 +02:00
Yaron Shahrabani 88ed04cc37 Updated Hebrew translation. 2012-04-22 11:43:37 +03:00
Alexander Shopov ffc5c214d2 Updated Bulgarian translation 2012-04-22 09:13:05 +03:00
Мирослав Николић 8ede7473de Updated Serbian translation 2012-04-21 09:30:37 +02:00
Ryan Lortie e84809c56a ./configure: fix error output for no -libXext
Due to the way the tests are structured, a missing libXext will give a
warning about a missing libX11 (even if libX11 is installed).  This is
confusing to people who are trying to build Gtk.

https://bugzilla.gnome.org/show_bug.cgi?id=674200
2012-04-20 14:38:47 -04:00
Marek Kasik 2c1839ae5f printing: Localize loaded PPD files
Use ppdLocalize() to localize strings in loaded PPD file (#674326).
2012-04-20 17:09:58 +02:00
Marek Kasik f6e2d0947d printing: Get default number-up value from CUPS
Requests "number-up-default" attribute from CUPS and
uses its value for setting value of "gtk-n-up" option.
(#672993)
2012-04-20 17:04:58 +02:00
Alexander Larsson 516fb89065 gtk-demo: Find gtk-demo-application.exe on win32
We need to append the ".exe" extension when looking for the
application file on windows.
2012-04-20 16:00:48 +02:00
Matthias Clasen aa3d30e256 Fix a cornercase of menu parsing
When a uimanager in a gtkbuilder file contains a menu,
the builder parser was getting confused.

https://bugzilla.gnome.org/show_bug.cgi?id=672789
2012-04-20 01:50:01 -04:00
Matthias Clasen ffafe80f5b Cosmetic 2012-04-19 23:41:53 -04:00
Cosimo Cecchi a94f4a4387 stylecontext: add a define for an OSD style class 2012-04-19 15:10:52 -04:00
Cosimo Cecchi 00440e32a4 stylecontext: reorder style classes defines
A couple of style classes defines ended up mixed with the region
defines.
2012-04-19 15:10:52 -04:00
Rob Bradford 1aa2a7f821 wayland: Improve the error reporting in the Cairo GL surface code path 2012-04-19 17:59:09 +01:00
Rob Bradford b5845514ec wayland: Improve error messages during SHM buffer creation
Use g_critical rather than fprintf and and also grab the error messages from
errno and from Cairo
2012-04-19 17:58:59 +01:00
Murray Cumming d4c1b46a9e GtkAppplication docs: Fix small typo. 2012-04-19 09:26:00 +02:00
Marek Černocký cad8aaadce Updated Czech translation 2012-04-18 22:02:40 +02:00
Cosimo Cecchi 0fc7c92235 messagedialog: also set GtkMisc alignment to zero for dialog labels
Setting xalign to START is not enough to make them left-aligned in every
case. This fixes a regression introduced in commit
cc0be1f949

https://bugzilla.gnome.org/show_bug.cgi?id=674286
2012-04-18 14:42:57 -04:00
Cosimo Cecchi eea0cb3a68 messagedialog: don't use gtk_widget_override_font()
Instead of overriding the font theme settings, just set the Pango
attributes we want on the label. This fixes message dialogs growing on
style_update after recent GTK+ changes.
2012-04-18 13:46:39 -04:00
Cosimo Cecchi 8febbcaf6a gdk: add missing GDK_VERSION_3_6 symbol 2012-04-18 13:23:29 -04:00
Cosimo Cecchi 4118e13596 container: fix wrong branching logic
If the resize mode of the container was GTK_RESIZE_IMMEDIATE we would
also fall trough to the next case in the switch, and always throw an
assertion.
2012-04-18 12:12:32 -04:00
Matej Urbančič 724a985465 Updated Slovenian translation 2012-04-17 21:44:37 +02:00
Fran Diéguez 81121ad271 Updated Galician translations
Signed-off-by: Fran Diéguez <fran.dieguez@mabishu.com>
2012-04-17 20:04:05 +02:00
Rob Bradford cd831b1390 wayland: Expose GdkWaylandDisplayManager as a public GType
This permits a runtime test of whether we are running on the Wayland platform
or not.
2012-04-17 18:40:41 +01:00
Daniel Mustieles 553f516eb7 Updated Spanish translation 2012-04-17 18:03:01 +02:00
Piotr Drąg aa1ff574b5 Updated POTFILES.in 2012-04-17 17:17:21 +02:00
Rob Bradford 6f9ad538d9 wayland: Rename GdkScreenWayland to GdkWaylandScreen
This makes it consistent with the functions in the vtable and also consistent
with other backends.
2012-04-17 14:11:31 +01:00
Rob Bradford fc58ff1e6a wayland: Rename GdkDisplayWayland to GdkWaylandDisplay
This makes it consistent with the functions in the vtable and also consistent
with other backends.
2012-04-17 14:11:31 +01:00
Benjamin Otte 14fb4984ce tests: Add a parsing test for the transition property 2012-04-17 08:59:24 +02:00
Benjamin Otte 04c85a5b3b container: Redo style validation handling
Instead of using 1 global queue for both resizes and style validation,
use 2 queues. This makes the code a lot simpler and fixes a bug where we
could accidentally stop restylying for very delayed restyles.
2012-04-17 08:59:23 +02:00
Benjamin Otte 17ccbe4843 container: needs_resize is a container flag, not a widget flag
The widget flag is alloc_needed, needs_resize is used for "is queued
into the container resize queue".
2012-04-17 08:59:23 +02:00
Benjamin Otte 53e714199a cssvalue: Remove GObject macros
GtkCssValue is not a GObject
2012-04-17 08:59:23 +02:00
Benjamin Otte 35e36b9fe5 stylecontext: Avoid style_context_save() calls
Introduce style_data_lookup_for_state() that does this.
2012-04-17 08:59:23 +02:00
Benjamin Otte 2179580c8e stylecontext: Pull all the animation code together
We now animate the core style information (see comment in
gtk_style_context_save()). A lot of widgets save + set custom style
classes/states during drawing and so can't be animated. It does work for
labels, menus and buttons though.
2012-04-17 08:59:23 +02:00
Benjamin Otte 632a84af8c stylecontext: Add GtkCssAnimatedValues
This is a GtkCssComputedValues subclass. So it's essentially a store for
computed CSS values. But it can be animated by advancing it to a certain
timestamp.
2012-04-17 08:59:23 +02:00
Benjamin Otte 9c57b96f56 animation: Add CSS transition object
This is an implementation of GtkStyleAnimation for CSS transitions.

Again, this doesn't do anything but store the data needed to do the
transition.
2012-04-17 08:59:23 +02:00
Benjamin Otte 7b7027c971 stylecontext: Add new class for animation handling
A StyleAnimation is an immutable object used to track the state of CSS
values. I'd have liked to make it fully immutable - ie not have the
timestamp in there - but couldn't find a place to sanely store the
timestamp.

This is an abstract base class. Implementations for this will be added
later (for both CSS3 transitions and animations, potentially for
animated images).

Actually aplying the information in this object will be done by a
different object commtted later.
2012-04-17 08:59:23 +02:00
Benjamin Otte 8b1385804e button: Remove _gtk_button_paint()
All buttons use the same paint function these days. States are managed
correctly so this was just leftovers from GTK 1 or GTK 2.
2012-04-17 08:59:23 +02:00
Benjamin Otte d8b99d47ea menuitem: Don't set menubar style class randomly
a) We're not a menubar, you can match on the parent if you have to
b) It's not set while getting preferred sizes
2012-04-17 08:59:23 +02:00
Benjamin Otte 1d54e4e867 widget: Set .default class when widget is default
Don't just conditionally set it on buttons.
2012-04-17 08:59:22 +02:00
Benjamin Otte 60eff87d08 stylecontext: Shuffle around code
This has two goals:

1) Move invalidation code out of a nested if branch. Invalidation is
actually the most important thing this function does.

2) Have the changes bitmask available. It will needed for invalidate
calls to children later.
2012-04-17 08:59:22 +02:00
Benjamin Otte 42d2430498 stylecontext: Add style_info_set_data()
.. to take care of the refcounting properly.
2012-04-17 08:59:22 +02:00
Benjamin Otte b8c72a0bdb stylecontext: Make StyleInfo keep the next pointer 2012-04-17 08:59:22 +02:00
Benjamin Otte deefb64661 stylecontext: Make StyleData refcounted
This is needed for animations where we want to keep a custom StyleData
for animations.
2012-04-17 08:59:22 +02:00
Benjamin Otte fe89e710ea stylecontext: Add public API to stop animations
... and use it.

Of course, there still are no animations, so we don't turn anything off
yet.
2012-04-17 08:59:22 +02:00
Benjamin Otte a240808824 stylecontext: Add an animating framework
The design principles were:

- synchronized
If multiple style contexts are animating, they should all do an
animation step at the same time.

- degrades well
Even when there's thousands of style contexts all animating at the same
time, the animation steps don't starve the CPU. This is achieved by
making sure the timeout is really fast. It just sets a bunch of flags.

- no hidden bottlenecks
Turning animatability on or off on a style context is O(1).

So far it is unused.
2012-04-17 08:59:22 +02:00
Benjamin Otte 50fdb6a13f computedvalues: Split out a function 2012-04-17 08:59:22 +02:00
Benjamin Otte b6594d1ac9 stylecontext: Don't queue a resize when none is needed 2012-04-17 08:59:22 +02:00
Benjamin Otte 97dc45f8a5 container: Split out a function 2012-04-17 08:59:22 +02:00
Benjamin Otte 090f30c559 container: Remove duplicated flag
GtkContainer::need_resize and GtkWidget::alloc_needed are the same
thing.
2012-04-17 08:59:22 +02:00
Benjamin Otte 8bda7442c8 container: Simplify code
This code should not have any functional changes and just be simpler.
2012-04-17 08:59:21 +02:00
Benjamin Otte e2f89c0c6a stylecontext: Listen to the new changed signal 2012-04-17 08:59:21 +02:00
Benjamin Otte 6443baadb9 styleprovider: Make all implementors emit the new signal
... and listen to it in the cases where they use other style providers.
2012-04-17 08:59:21 +02:00
Benjamin Otte 74f4c6f6bd styleprovider: Add a private signal for when things change 2012-04-17 08:59:21 +02:00
Benjamin Otte 29fbfcb8f5 stylecontext: Pass time to style_context_validate()
This way, we can ensure that every style context uses the same timestamp
for whatever they do.
2012-04-17 08:59:21 +02:00
Benjamin Otte aaedc7b67f stylecontext: Compute if things changed before invalidating
This is only a small performance boost by itself, but it's necessary
for animations, so we need it.

Benchmark numbers for my Glade benchmark for interested people:
        GTK 3.4.0    last commit  this commit
Raleigh
  real  0m41.879s    0m10.176s    0m9.900s
  user  0m41.394s    0m9.895s     0m9.628s
  sys   0m0.111s     0m0.096s     0m0.102s

Adwaita                                        (*)
  real  0m51.049s    0m13.432s    0m14.848s    0m12.253s
  user  0m50.487s    0m13.034s    0m13.218s    0m11.927s
  sys   0m0.117s     0m0.151s     0m0.147s     0m0.107s

Ambiance (patched to not use private GTK APIs)
  real  0m52.167s    0m13.115s    0m13.117s    0m12.944s
  user  0m51.576s    0m12.739s    0m12.768s    0m12.651s
  sys   0m0.119s     0m0.137s     0m0.136s     0m0.118s

(*) Adwaita and unico currently use custom properties, and
_gtk_css_value_compare() for custom properties always returns FALSE,
which makes this optimization never trigger. So I modified
_gtk_css_value_compare() to return TRUE for these properties instead and
reran the benchmark. Those are the numbers.
2012-04-17 08:59:21 +02:00
Benjamin Otte 95a4b46f8b reftests: Fix reftests for recent changes 2012-04-17 08:59:21 +02:00
Benjamin Otte 33f111a47c widget: Don't cache widget paths all the time
Add an internal API that allows GtkStyleContext to create a widget path
for the widget and with that bypassing gtk_widget_get_path() and that
  function caching the path.
2012-04-17 08:59:21 +02:00
Benjamin Otte 6ac754cdd1 stylecontext: Remove theming_engine cache variable
Instead, look up the variable upon use. This is more correct (for when
the engine changes due to save/restore() shenanigans.

And it removes code that doesn't use the standard code paths.
2012-04-17 08:59:21 +02:00
Benjamin Otte 3ddb104302 stylecontext: Split out a function 2012-04-17 08:59:20 +02:00
Benjamin Otte 2fec112422 styleproperty: Remove equal_func vfunc
Equality tests are done with _gtk_css_value_equal(). There is no need to
do it per-property, equal values will still be equal.

This essentially reverts 24f5d54329e028347bd76af42e86ed190c1229a2 and
92c7a7171e1240b6d961ee5b6f9ab6b596e98904.
2012-04-17 08:59:20 +02:00
Benjamin Otte 40283e7c27 cssvalue: Split out old value handling to new typed value
... and Make this new value be a real GValue, as we don't need to save
performance for these anymore (it's just used for custom properties).
And I'd rather have code work for all values then be optimized for no
reason.
2012-04-17 08:59:20 +02:00
Benjamin Otte 883c871be6 themingengine: Fix outline-width
It's a number, not an int.
2012-04-17 08:59:20 +02:00
Benjamin Otte ba7141b92e shorthand: Fix border query functions
We haven't been using ints there for a while, I wonder why that never
blew up...
2012-04-17 08:59:20 +02:00
Benjamin Otte 0111b9d507 symboliccolor: Treat it as a CssValue
.. now that it is one.
2012-04-17 08:59:20 +02:00
Benjamin Otte 0048c8baf5 tests: Add a test ensuring currentColor is parsed everywhere 2012-04-17 08:59:20 +02:00
Benjamin Otte 505fefbec7 cssprovider: Add an empty line when printing
... between the @define-color statements and the rules.
2012-04-17 08:59:20 +02:00
Benjamin Otte 51da8cb263 symboliccolor: Parse 'currentColor' everywhere 2012-04-17 08:59:20 +02:00
Benjamin Otte 83be7e5dbd symboliccolor: Pass the current color to the resolve function
This way, we can resolve things like
  mix (currentColor, &otherColor);
and therefore parse currentColor as a regular color.
2012-04-17 08:59:19 +02:00
Benjamin Otte 1223d53a82 cssparser: Move symbolic color parser to gtksymboliccolor.c 2012-04-17 08:59:19 +02:00
Benjamin Otte 7606fcb52e symboliccolor: Turn this into a GtkCssValue 2012-04-17 08:59:19 +02:00
Benjamin Otte b403a1b550 css: Add a shorthand 'transition' property 2012-04-17 08:59:19 +02:00
Benjamin Otte c3f46ab5c0 shorthand: Add ',' to value_is_done_parsing() 2012-04-17 08:59:19 +02:00
Benjamin Otte 04c5fdaca6 css: Remove old animation code
Deprecate public API where appropriate and make it no-ops.
Remove all calls to it.
Get rid of the 'transition' css property.

For now, this means spinners don't animate anymore.
2012-04-17 08:59:19 +02:00
Benjamin Otte dcd54e20d1 css: Remove GtkCssNumber
It's completely replaced by GtkCssNumberValue now.
2012-04-17 08:59:19 +02:00
Benjamin Otte 1b69f1d7c2 linear-gradient: Convert from GtkCssNumber to GtkCssValue 2012-04-17 08:59:19 +02:00
Benjamin Otte 1170ecfd2e cssvalue: Convert border-image-width to border value 2012-04-17 08:59:19 +02:00
Benjamin Otte 56f79fecce cssvalue: Add a border value
.. and parse border-image-slice with it.
2012-04-17 08:59:18 +02:00
Benjamin Otte cfc6462730 cssvalue: Add a cssvalue for background-size 2012-04-17 08:59:18 +02:00
Benjamin Otte f785f7177c cssvalue: Add a custom value for repeats
In particular, that's background-repeat and border-image-repeat.

Also, fix up the border-image shorthand to allow any order.
2012-04-17 08:59:18 +02:00
Benjamin Otte 5377169ef3 cssvalue: Add a value for background-position 2012-04-17 08:59:18 +02:00
Benjamin Otte aed7600425 cssvalue: Add a css value for engines 2012-04-17 08:59:18 +02:00
Benjamin Otte 4f63c1c7ca cssstyleproperty: Convert binding sets
Instead of keeping a custom GPtrArray, keep it as a GtkCssArrayValue of
GtkCssStringValue. This way, we gain equality comparisons and print
functions for free.
2012-04-17 08:59:18 +02:00
Benjamin Otte edbc8e4f57 cssvalue: Add a value for border-radius corner properties
... and convert those properties to this value.
2012-04-17 08:59:18 +02:00
Benjamin Otte 05f2249d08 css: Make outline-offset a number property 2012-04-17 08:59:18 +02:00
Benjamin Otte c366b5b8b7 shadow: Add equal and transition support
... and enable transitions for the shadow properties.
2012-04-17 08:59:18 +02:00
Benjamin Otte ac6d61f6bb cssvalue: Add GtkCssShadowsValue
This is necessary because shadows get treated differently from other
lists when transitioning.
2012-04-17 08:59:18 +02:00
Benjamin Otte 8f240275fd tests: Add a parsing test for shadows 2012-04-17 08:59:17 +02:00
Benjamin Otte b8ccda4140 shadow: Rewrite to store contents as values 2012-04-17 08:59:17 +02:00
Benjamin Otte 7bdcba189e shadow: Make color a GtkCssValue 2012-04-17 08:59:17 +02:00
Benjamin Otte ca17270187 cssvalue: Make GtkCssShadowValue only hold one shadow
All the properties now are a GtkCssArrayValue of GtkCssSadowValue.
GtkCssArrayValue already does everything we want, so no need to
duplicate its funtionality.
2012-04-17 08:59:17 +02:00
Benjamin Otte c5878e8f6f themingengine: Make _gtk_theming_engine_paint_spinner() args const 2012-04-17 08:59:17 +02:00
Benjamin Otte b9ebe8c226 cssarrayvalue: Redo parsing arrays
Does 3 things:
1) Introduce a "none" array signleton
2) Get rid of memleaks in error paths
3) Reduce code in parse funcs
2012-04-17 08:59:17 +02:00
Benjamin Otte 580b5e4a83 stylecontext: Don't queue_resize() all the time
When a parent style context exists, there's no need to queue_resize() on
the widget, because the parent widget will call
gtk_style_context_validate() on us and _then_ we can call queue_resize()
if we have to.
2012-04-17 08:59:17 +02:00
Benjamin Otte a8efb784d7 cssstyleproperty: Mark all animatable properties
Only the ones that can be animated are marked of course. So more work is
needed.
This is important for
  transition-property: all;
because it'll just animate all the properties that can be.
2012-04-17 08:59:17 +02:00
Benjamin Otte ed45a3c2f0 cssstyleproperty: Add _gtk_css_style_property_is_animated() 2012-04-17 08:59:17 +02:00
Benjamin Otte 9e4341f730 css: Move enum to the only source file using it 2012-04-17 08:59:17 +02:00
Benjamin Otte e597f4d6a9 cssvalue: Add transition support for images 2012-04-17 08:59:16 +02:00
Benjamin Otte d853a8f2f7 cssimage: Add GtkCssImageCrossFade
Supports the cross-fade() css notation the way the old CSS3 specs did.

The main reason for adding it is supporting image transitions though.
2012-04-17 08:59:16 +02:00
Benjamin Otte 8ad8a4febf cssvalue: Add _gtk_css_value_to_string()
This is a tiny wrapper around _gtk_css_value_print().
It's intended for usage in gdb and printf debugging.
2012-04-17 08:59:16 +02:00
Benjamin Otte 41ce29767c cssstyleproperty: Add transition properties 2012-04-17 08:59:16 +02:00
Benjamin Otte 7511109103 cssvalue: Add GtkCssEaseValue
This is supposed to hold the transition-easing-function and
animation-easing-function values.
2012-04-17 08:59:16 +02:00
Benjamin Otte 2ff47ed26d cssvalue: Add a GtkCssValue for idents 2012-04-17 08:59:16 +02:00
Benjamin Otte 662d6787f3 css: Add <time> type to css number stuff 2012-04-17 08:59:16 +02:00
Benjamin Otte 68b7d3e410 computedvalues: Fix signage error 2012-04-17 08:59:16 +02:00
Benjamin Otte a360e77a7b css: Remove _gtk_css_computed_values_get_value_by_name()
Now that we use an enum for the IDs, we don't need that function
anymore.
2012-04-17 08:59:16 +02:00
Benjamin Otte 31565139ba stylecontext: Convert _gtk_style_context_peek_property()
Take the property id instead of the name.
2012-04-17 08:59:15 +02:00
Benjamin Otte 5d8789680e css: Add an enum for all the style properties
So instead of using
  _gtk_css_style_property_get_id (GTK_CSS_STYLE_PROPERTY
        (_gtk_style_property_lookup ("name")))
one can now use
  GTK_CSS_PROPERTY_NAME

Esaier, eh?
2012-04-17 08:59:15 +02:00
Benjamin Otte 1a9dfab825 cssvalue: Add _gtk_css_value_transition()
Returns a value that transitions between start and end or %NULL if the
values cannot be transitioned.

So far, all implementations but numbers and rgba return NULL.
2012-04-17 08:59:15 +02:00
Benjamin Otte bf92f2f7ac cssvalue: Do a hacky conversion of font-size to a number value
Just store the value as px for now.

The font-size property needs a complete makeover anyway.
2012-04-17 08:59:15 +02:00
Benjamin Otte ad05604b3e cssvalue: Convert 'font-family'
It's now a CssArrayValue filled with CssStringValue
2012-04-17 08:59:15 +02:00
Benjamin Otte 7c75611bc2 cssvalue: Add a custom value for strings 2012-04-17 08:59:15 +02:00
Benjamin Otte 0cce3520d3 cssprovider: Store widget style value as string
There's no need to turn it into a GtkCssValue, it's always a string.
2012-04-17 08:59:15 +02:00
Benjamin Otte 4ba9be5b97 cssvalue: Add GtkCssArea to the enum values
... and get rid of its GType.

This makes it non-queryable using gtk_style_context_get() but it used to
be a private struct anyway.
2012-04-17 08:59:15 +02:00
Benjamin Otte 8e17f9c233 switch: Set ACTIVE state flag with is_active property 2012-04-17 08:59:15 +02:00
Benjamin Otte 40982eabbb stylecontext: Keep the main style data around until revalidation 2012-04-17 08:59:15 +02:00
Benjamin Otte 751187aa0c stylecontext: Keep per-styleinfo data
Instead of having one global data structure, keep it per style info.
This means that we can do special tricks on the "global" style data.
2012-04-17 08:59:14 +02:00
Benjamin Otte a737adadf8 stylecontext: Make style_data_lookup() not take a state anymore
Instead, use the current state of the style context.
2012-04-17 08:59:14 +02:00
Benjamin Otte 82b769ddde widget-factory: Add spinners
Doesn't look very well, but if somebody cares about that, he can fix it
(hint hint)
2012-04-17 08:59:14 +02:00
Benjamin Otte 8c49cd97a7 cssvalue: Add a cssvalue for images 2012-04-17 08:59:14 +02:00
Benjamin Otte d63b11e56b cssvalue: Add enum values for the pango enums
And fix the parser to conform to the CSS spec while at it.
2012-04-17 08:59:14 +02:00
Benjamin Otte b65d17dda8 cssvalue: Make border styles be their own value
... and add them via gtkcssenumvalue.[ch] which will be used for all
enums.
2012-04-17 08:59:14 +02:00
Benjamin Otte 58b6d492b8 cssvalue: Add a custom RGBA value
Note: custom CSS properties still use the default GtkCssValue and always
will.
So there is a difference in css values used between those, even though
they both carry a GdkRGBA payload.
2012-04-17 08:59:14 +02:00
Benjamin Otte dcec7a5529 cssstyleproperty: Make assign_value a vfunc 2012-04-17 08:59:14 +02:00
Benjamin Otte 81dfc2776e customproperty: Implement assign vfunc
I'm going to overwrite the GtkCssStyleProperty one, so better keep this
one.
2012-04-17 08:59:14 +02:00
Benjamin Otte 645309e98b shadow: Also rename files 2012-04-17 08:59:14 +02:00
Benjamin Otte ec5c77a552 shadow: Rename to GtkCssShadowValue
I don't want to confuse css values with other stuff, so there.
2012-04-17 08:59:13 +02:00
Benjamin Otte da40ba431d cssvalue: Remove unused function 2012-04-17 08:59:13 +02:00
Benjamin Otte 96948576bd shadow: Move parse function into GtkShadow
This way, we have less public API.
And gtkcssstylepropertyimpl.c looks less scary (only 1624 lines now).
2012-04-17 08:59:13 +02:00
Benjamin Otte ccd443796c shadow: Make this a GtkCssValue 2012-04-17 08:59:13 +02:00
Benjamin Otte 38ac68790e shadow: Remove _gtk_shadow_get_resolved()
It's unused
2012-04-17 08:59:13 +02:00
Benjamin Otte ca4a080c8a stylepropertyimpl: Make shadows unqueryable
Normal APIs couldn't use GtkShadow anyway as the type was private.
2012-04-17 08:59:13 +02:00
Benjamin Otte 281d094b42 theming: Use peek_property() calls to query shadows 2012-04-17 08:59:13 +02:00
Benjamin Otte a33df2d1d6 cssvalue: Split number values into their own class 2012-04-17 08:59:13 +02:00
Benjamin Otte f7c0c7677b cssstyleproperty: Make query func a vfunc
This will be needed soon.
2012-04-17 08:59:13 +02:00
Benjamin Otte 6ef76f4a92 customproperty: Add our own query_value function
I'm about to change the CssStyleProperty one, so better copy things
here.
2012-04-17 08:59:13 +02:00
Benjamin Otte c8e57d63ec cssstyelproperty: Rempove specified-type and computed-type props
This removes the necessity to keep a GType associated with style
properties and code can now make use of GtkCssValue completely.
2012-04-17 08:59:13 +02:00
Benjamin Otte 75a5f04352 styleproperty: Remove default parse function
... and assert every style property brings its own.
2012-04-17 08:59:13 +02:00
Benjamin Otte a5d001b2ba stylepropertyimpl: Add remaining parse functions 2012-04-17 08:59:12 +02:00
Benjamin Otte 0fdc287339 styleproperty: Simplify compute_value function
The compute_value fallback path is only needed for custom properties,
the real style properties have custom compute functions if they need
them already.
2012-04-17 08:59:12 +02:00
Benjamin Otte 7fbc583b88 css: Move shadow parse/print/compute funcs
They don't belong in the style funcs, as those are for custom
properties, and the shadow type is private.
2012-04-17 08:59:12 +02:00
Benjamin Otte dd144c2bad stylepropertyimpl: Add parse funcs for enums 2012-04-17 08:59:12 +02:00
Benjamin Otte 86a387f571 stylepropertyimpl: Add color parsing function
This is in preparation for removing the specified type and computed type
properties from GtkCssStyleProperty, which is in preparation for really
using GtkCssValue classes and not GTypes.
2012-04-17 08:59:12 +02:00
Benjamin Otte b5fc484c99 customproperty: Don't rely on querying style property
This way, we can remove type madness from GtkCssStyleProperty later.
2012-04-17 08:59:12 +02:00
Benjamin Otte bc9060a591 styleproperty: Make gtk_style_property_register() not be valist
Instead, make the caller create a GtkCssValue in advance.
2012-04-17 08:59:12 +02:00
Benjamin Otte ffe50c3b67 cssvalue: Add _gtk_css_value_equal()
For now, we return FALSE for all default css values, so this is not very
useful.

I also think of this as an optimization equal, not a guaranteed equal,
because we don't even have a notion of what "equal" means.

For example, for background-repeat, "repeat, repeat" and "repeat"
are functionally equivalent. But the cssvalue has no idea that it's used
for background-repeat.
As a more complicated example, "repeat, no-repeat" and "repeat" are
equal to what one sees as long as there's only one image listed
background-image-source. But once you start transition'ing to an image
with 2 sources, it's different...
2012-04-17 08:59:12 +02:00
Benjamin Otte 3e601691d9 tests: Change expected errors to conform with output
This change isn't strictly correct, but I can't be bothered until we get
a tokenizer that can really differentiate between allowed values and
invalid syntax.
2012-04-17 08:59:12 +02:00
Benjamin Otte b0e764000f cssparser: Use _gtk_css_parser_error_full() 2012-04-17 08:59:12 +02:00
Benjamin Otte e7acdec220 cssparser: Add _gtk_css_parser_error_full() 2012-04-17 08:59:11 +02:00
Benjamin Otte 9b7640b898 styleproperty: Make _gtk_style_property_parse_value() return a CssValue
Also split out initial/inherit handling into a custom GtkCssValue class.
2012-04-17 08:59:11 +02:00
Benjamin Otte 718ceaec45 css: Remove _gtk_css_style_property_is_specified_type()
That check is going to be refactored away.
2012-04-17 08:59:11 +02:00
Benjamin Otte 04f5c8708a cssvalue: Add a CSS value for arrays
Make the value auto-cycle its child values, so it can be used for
background properties.
2012-04-17 08:59:11 +02:00
Benjamin Otte df45983fcb cssvalue: Remove _gtk_css_value_new_take_gvalue()
Having two constructors from GValues complicates refactorings, so I'd
rather not have them.
2012-04-17 08:59:11 +02:00
Benjamin Otte 8e3e3d582f cssvalue: Get rid of unused functions 2012-04-17 08:59:11 +02:00
Benjamin Otte 5ac9ba714a styleproperty: Make _gtk_style_property_query() take a GValue
... and don't make it return a GtkCssValue. We want to use this for
compat with the old GValue APIs after all...
2012-04-17 08:59:11 +02:00
Benjamin Otte 58e4fdf911 styleproperty: Make print_func take a GtkCssValue
Also, constify GtkCssValue getters, so we can pass a const GtkCssValue
to the print_func.
2012-04-17 08:59:11 +02:00
Benjamin Otte b728cfd3e8 cssvalue: Make the structure vtable-based
Don't use real classes, just a vtable.
2012-04-17 08:59:11 +02:00
Benjamin Otte 3cdb9c91ca styleproperty: Add support for equal_func 2012-04-17 08:59:11 +02:00
Benjamin Otte d5a2392cc7 stylecontext: Don't clear cache when only state changes
This takes more memory, but changes to backdrop or active state are
quite expensive otherwise.
2012-04-17 08:59:11 +02:00
Benjamin Otte 44187ca3b5 cssmatcher: Use quarks for classes 2012-04-17 08:59:10 +02:00
Benjamin Otte 115c34498e styleproperty: Add a function to compare values for equality
and default to never compare them as equal.
2012-04-17 08:59:10 +02:00
Benjamin Otte 5bbf59b519 cssvalue: Constify a bunch of APIs 2012-04-17 08:59:10 +02:00
Benjamin Otte 4a12717e4d cssvalue: Remove unused functions 2012-04-17 08:59:10 +02:00
Benjamin Otte 585a1fae4f stylecontext: Really queue style changes
Instead of instantly applying a new style, just mark the context as
invalid. Only apply the new style at layout time.
2012-04-17 08:59:10 +02:00
Benjamin Otte eb537b60f4 stylecontext: Optimize the common case of "style didn't change" 2012-04-17 08:59:10 +02:00
Benjamin Otte ece9d2fd92 gtk: Make widget only invalidate widget positions
Instead of resetting them completely
2012-04-17 08:59:10 +02:00
Benjamin Otte e7a984b337 window: Set parent context instead of just resetting style
Otherwise the inherit properties won't inherit properly.
2012-04-17 08:59:10 +02:00
Benjamin Otte 27c9352df3 widget: Replace reset_style() calls
... with finer grained _gtk_widget_invalidate_style_context() calls.
2012-04-17 08:59:10 +02:00
Benjamin Otte 969daec353 widget: Don't go via path when resetting style
Instead, invalidate the path when the style context changes. And
invalidate the style context directly.
2012-04-17 08:59:09 +02:00
Benjamin Otte d589566f40 widget: Add _gtk_widget_invalidate_style_context()
This is supposed to replace gtk_widget_reset_style().
2012-04-17 08:59:09 +02:00
Benjamin Otte 48a8ca8bbe widget: Merge function into only caller 2012-04-17 08:59:09 +02:00
Benjamin Otte 257d961a01 widget: Clear broken widget path in constructor
... where it belongs instead of fiddling with it in get_path().
2012-04-17 08:59:09 +02:00
Benjamin Otte 198cf93f0f stylecontext: On failure, exit the loop, don't try again
Because we will fail again. And then we try again. And then we fail
again. Ad infinitum.
2012-04-17 08:59:09 +02:00
Benjamin Otte 15be680540 stylecontext: Invalidate when setting classes/state/regions
... and nobody has called style_context_save().
2012-04-17 08:59:09 +02:00
Benjamin Otte 44d49c900d stylecontext: Use _gtk_style_context_queue_invalidate() on self 2012-04-17 08:59:09 +02:00
Benjamin Otte 39ff874a11 stylecontext: Introduce _gtk_style_context_queue_invalidate()
This is for only queueing invalidations instead of doing a full
invalidation cycle.
2012-04-17 08:59:09 +02:00
Benjamin Otte 1a51ea3ea3 stylecontext: Keep track of children 2012-04-17 08:59:09 +02:00
Benjamin Otte 7f511f2b33 widget: Don't set widget path on style context
Instead, make the style context use the widget's path. Saves a bunch of
memory.
2012-04-17 08:59:09 +02:00
Benjamin Otte e5ab48ac59 stylecontext: Notify widget directly of changes
This way, we don't need to g_signal_connect(), which saves a bunch of
memory and performance.
2012-04-17 08:59:08 +02:00
Benjamin Otte 1aa4a196dc stylecontext: Add setter for widget
... and actually set the widget on the style context. Note that this
function does not take a reference on the widget, which is a very good
reason to keep it private.
2012-04-17 08:59:08 +02:00
Benjamin Otte 102d10016f matcher: Add a superset matcher
This matcher always matches only on some relvant things and ignores the
rest. This allows you to match only on name and class, but ignore state
and parents/siblings for example.
2012-04-17 08:59:08 +02:00
Benjamin Otte 5f5bf27287 matcher: Add a matcher that matches anything
Lesson learned: Adwaita uses all possible selector types and all of
those for parents, too. But so far no siblings.
2012-04-17 08:59:08 +02:00
Benjamin Otte d115441a57 reftests: Add a reftest for nth-child
Prime numbers are fun.
2012-04-17 08:59:08 +02:00
Benjamin Otte cbe40f27e1 tests: Add a parsing test for nth-child()
Now that we support the an+b notation, make sure we really do.
Maybe my generating script went a bit overboard with the space
possibilities though...
2012-04-17 08:59:08 +02:00
Benjamin Otte 3bdde54aaf selector: Rewrite position tracking
We now track the position as a (type,a,b) tuple where the numbers make
up the an + b formula from CSS3 nth-child.

Also, the get_sibling() and get_sibling_index() vfuncs were replaced by
a has_position() vfunc. This is mostly so that the matcher can always
return TRUE. And I need that for the everything matcher.
2012-04-17 08:59:08 +02:00
Benjamin Otte 8dbe8c8349 syleprovider: Add a vfunc to get the changes
This way we can check what changes are even interesting for our matcher.
2012-04-17 08:59:08 +02:00
Benjamin Otte b0b6c8ad4b selector: Rename selector class
It's a 'position' pseudoclass, not a 'region' pseudoclass.
2012-04-17 08:59:08 +02:00
Benjamin Otte 2d01f7786d css: Add selector change types
This allows querying selectors for which changes would change their
"matchingness".
2012-04-17 08:59:07 +02:00
Benjamin Otte 53317aed55 matcher: Turn GtkCssMatcher into a union
That way, we can add more matchers as we need them.
2012-04-17 08:59:07 +02:00
Benjamin Otte b368c5f10a matcher: Use a vtable
Now we can do lots of fancy matchers, yay!
2012-04-17 08:59:07 +02:00
Benjamin Otte a94b85d375 css: Make the style provider take a matcher as an input argument 2012-04-17 08:59:07 +02:00
Benjamin Otte c0b7c3321d css: Add GtkCssMatcher
This is so we can later do matching with other things than
GtkWidgetPath.
In particular, this is a requirement for getting rid of GtkWidgetPath.
2012-04-17 08:59:07 +02:00
Benjamin Otte a2ded8b72a styleprovider: Add a custom object for a list of style providers
This way, we don't have to do magic inside GtkStyleContext, but have a
real API.
As a cute bonus, this object implements GtkStyleProvider itself. So we
can just pretend there's only one provider.
2012-04-17 08:59:07 +02:00
Benjamin Otte 015e3a768f stylecontext: Stop querying style providers for icon factories
Nobody implements this feature and I don't wanna maintain it. If it
turns out somebody is using it, we gotta invent something.
2012-04-17 08:59:07 +02:00
Benjamin Otte a52336bedc gdk: Add deprecation/availability macros for 3.6 2012-04-17 08:59:07 +02:00
Mario Blättermann 1de2e3ce00 [l10n] Updated German translation 2012-04-16 21:42:14 +02:00
Kristian Høgsberg ea78bcb7c5 wayland: Prefer X11 backend over Wayland
https://bugzilla.gnome.org/show_bug.cgi?id=674102
2012-04-16 18:53:54 +02:00
Kalev Lember 234c7fcf28 application-window: Move desktop file handling code to separate function
https://bugzilla.gnome.org/show_bug.cgi?id=674118
2012-04-16 18:33:50 +03:00
Rob Bradford ba81a3a14c build: Add an enable flag to allow enabling Cairo GL backend
This change adds --enable-wayland-cairo-gl which turns on the define used in
the Wayland backend to determine whether to use EGL surfaces with Cairo GL or
whether to use the Cairo image backend with an SHM surface (the default).

Part of the fix for: https://bugzilla.gnome.org/show_bug.cgi?id=672361
2012-04-16 16:05:51 +01:00
Rob Bradford 71ca53993e wayland: Use an ARGB buffer for the Cairo and SHM surface 2012-04-16 15:09:14 +01:00
Rob Bradford cddfcf1418 wayland: Force an expose for the whole area when scrolling 2012-04-16 15:09:14 +01:00
Rob Bradford cdf5c2af62 wayland: Add support for rendering into an SHM buffer with Cairo image backend
The first version of this change included a bug that meant that if you don't
compile for any other backend then it wouldn't search for cairo. Credit for
identifying the bug goes to darxus@chaosreigns.com.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=672361
2012-04-16 15:09:14 +01:00
Rob Bradford 6977ea0bd1 wayland: Move the buffer creation to the cairo surface creation 2012-04-16 14:12:51 +01:00
Rob Bradford d9ca1a8636 wayland: Move the finalize function to allow a clear logical block of code 2012-04-16 14:12:51 +01:00
Rob Bradford a8d03c9970 wayland: Remove unused member from struct 2012-04-16 14:12:51 +01:00
Reşat SABIQ a820962b2b Updated Crimean Tatar (Crimean Turkish) translation 2012-04-16 01:56:55 -05:00
Reşat SABIQ 49abf425a4 Updated Crimean Tatar (Crimean Turkish) translation 2012-04-16 01:54:47 -05:00
Yinghua Wang 872d170fd1 update Simplified Chinese (zh_CN) translation 2012-04-16 14:14:33 +08:00
Michael Vogt 19e55d620f GtkImage: Move g_clear_object() to gtk_image_finalize()
This moves the freeing of the icon_helper from the destory to the finalize
function to avoid segfaults when trying to access a destroyed object before it
is disposed. This often happens in signal handlers which get called
asynchronously after destroy.

https://bugzilla.gnome.org/show_bug.cgi?id=674050
2012-04-16 06:51:43 +02:00
Kjartan Maraas 298ba51d31 Updated Norwegian bokmål translation 2012-04-15 19:38:20 +02:00
Matthias Clasen 158784f66b Bump version 2012-04-13 21:26:43 -04:00
Matthias Clasen 39a9472e3b 3.4.1 2012-04-13 21:08:06 -04:00
Cosimo Cecchi 398ba38cfe application-window: try to use the desktop name in the fallback menu
Try to fetch the name from the application desktop file for the
fallback menu if possible, instead of forcing applications to use
g_set_application_name or hardcoding "Application".

https://bugzilla.gnome.org/show_bug.cgi?id=673882
2012-04-12 21:41:46 -04:00
Cosimo Cecchi 1713cbe8d0 build: split out a HAVE_GIO_UNIX config variable
We'll use it in GtkApplicationWindow, since we need to conditionally
depend on gio-unix there.

https://bugzilla.gnome.org/show_bug.cgi?id=673882
2012-04-12 21:41:43 -04:00
Matthias Clasen 050cba6a31 Fix malformed doc comments
Most of these are forgotten :'s and similar details
which gtk-doc now warns about.
2012-04-12 21:12:16 -04:00
Kalev Lember da755ada52 configure: Use AM_PATH_GLIB_2_0() for finding glib-compile-resources
No need to manually set GLIB_COMPILE_RESOURCES when AM_PATH_GLIB_2_0()
does this for us.
2012-04-11 23:12:15 +03:00
Pavel Holejsovsky 94116aec8e Fix sourcedir!=builddir .gir build from source tarball
Setting -I$(top_builddir) before -I$(top_srcdir) causes that
g-ir-scanner picks up boxing definitions generated by glib-mkenums.

https://bugzilla.gnome.org/show_bug.cgi?id=672133
2012-04-11 20:05:10 +02:00
Kristian Rietveld 7e778aa033 [quartz] Fix manual resizing of windows
In the Quartz backend, there are two methods by which windows are
resized. The first method is fully handled by Quartz and does not appear
in the event stream the application resizes. The second method is when
we resize windows by ourselves. In OS X this happens when a GTK+ resize
grip is used. This resize grip is larger than the Quartz resize grip.
When the resize is started outside the "Quartz area", we have to handle
it by ourselves.

This patch fixes this manual window resizing by ignoring events while we
are in the process of resizing (such that the events actually arrive at
the sendEvent handler of GdkQuartzWindow where this resize is handled).
When the resize has finished we break all grabs such that GDK is not
stuck thinking the cursor is still in the resize window.
2012-04-10 21:54:03 +02:00
Kristian Rietveld d5ac2bd372 Export break_all_grabs() within Quartz backend
Function was renamed to _gdk_quartz_events_break_all_grabs().
2012-04-10 21:50:07 +02:00
Carles Ferrando c10b65519c [l10n]Updated Catalan (Valencian) translation 2012-04-10 21:22:30 +02:00
Jordi Serratosa 812c5e7f25 [l10n] Fixes on Catalan translation 2012-04-10 21:22:22 +02:00
Carles Ferrando 0b171c8490 [l10n]Updated Catalan (Valencian) translation 2012-04-10 21:21:06 +02:00
Jordi Serratosa 39fd069a0d [l10n] Fixes on Catalan translation 2012-04-10 21:20:55 +02:00
Benjamin Otte 555cf516fd styleproperty: 3rd hotfix for a 3-line patch
I really should not write code sometimes...

Copy/paste error this time.
2012-04-10 16:55:05 +02:00
Benjamin Otte 3610ef90c3 Revert part of "textview: Remove extra magic for drawing children"
This partially reverts commit df37446f9b.
The commit changed API that was public (or at least semi-public) and
it's not worth changing that.

The original bug should still be fixed.

https://bugzilla.gnome.org/show_bug.cgi?id=673839
2012-04-10 16:21:07 +02:00
Benjamin Otte 8b5910f8d7 styleproperty: Fix thinko
Introduced in 8243b16ad7 - seems I wasn't
really on top of my own capabilities on Saturday.
2012-04-09 20:33:46 +02:00
Benjamin Otte 9573ed467d customproperty: Fix thinko
.. in 43c56d70ea
2012-04-09 03:27:55 +02:00
Benjamin Otte 8243b16ad7 styleproperty: Save some memory
Only create a new CssValue when we actually need one.
2012-04-09 03:14:51 +02:00
Benjamin Otte fde43d01e5 customproperty: Ensure style properties are registered
... before reigstering our own. Also, use that capability to emit a
warning.
2012-04-09 03:11:20 +02:00
Benjamin Otte 43c56d70ea csscustomproperty: Redo RGBA/Color parsing
This fixes custom parse functions returning RGBA values where we
expected symbolic colors.
2012-04-09 03:09:44 +02:00
Benjamin Otte 122cde9528 tests: Add a uint8 test
... to ensure the last test works.
2012-04-09 03:09:44 +02:00
Benjamin Otte b7ad432654 cssvalue: Re-add support for random value types
This got lost in the CssValue transition, and apparently some people use
this.
2012-04-09 03:09:44 +02:00
Pavel Holejsovsky 331bba1ad6 entrycompletion: set_property() should call property setters
gtk_entry_completion_set_property() was setting many properties by
directly modifying priv values, bypassing notification invocation and
possibly another actions done by gtk_completion_entry_set_xxx ()
functions.  Fix by invoking set_xxx() instead of setting the property
value directly.

The real bug observerd was that setting text-column property using
g_object_set() caused SIGFPE later when entry completion was about to
appear.  gtk_entry_completion_set_text_column () apparently does way
more important things than just setting priv->text_column member.

https://bugzilla.gnome.org/show_bug.cgi?id=673693
2012-04-08 12:10:44 +02:00
Benjamin Otte df37446f9b textview: Remove extra magic for drawing children
Instead, just draw the children. The cairo code will keep track of
things, so there's no need to track things.
Also, the old code was doing it wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=672544
2012-04-07 13:01:25 +02:00
Benjamin Otte 7a7e2ed92b csscomputedvalues: Unref old value when setting new one 2012-04-07 13:01:25 +02:00
Benjamin Otte 246269faac docs: Add gtkx.h to the list of headers 2012-04-07 13:01:25 +02:00
Benjamin Otte 605a472c99 treeview: Don't cache expander size
Style properties should not be cached, they should be queried live.

Also, this fixes the case where the expander size wasn't set when
constructing the widget which caused expanders to go missing.
2012-04-07 13:01:25 +02:00
Benjamin Otte 1ca8098543 widget: Create style context using regular API 2012-04-07 13:01:25 +02:00
Benjamin Otte 7204724c9f menu: Undo a hack with style contexts
Widget implementations aren't allowed to fiddle with the widget's style
context.

Sheesh.
2012-04-07 13:01:25 +02:00
Benjamin Otte b5714ea265 tray: Add suggested braces around empty body in 'if' statements 2012-04-07 13:01:24 +02:00
Benjamin Otte bd400b0957 win32: Move variable declarations into #if block 2012-04-07 13:01:24 +02:00
Benjamin Otte 826360a214 x11: Add suggested braces around empty body in 'if' statements 2012-04-07 13:01:24 +02:00
Matthias Clasen 2ef4b930c7 Don't force BUTTON1_MASK on non-touch events
This problem was pointed out by Hans de Goede in
https://bugzilla.gnome.org/show_bug.cgi?id=673458
2012-04-06 20:25:21 -04:00
Matthias Clasen 432f0151eb xi2: Remove touchscreen heuristics
It doesn't make sense to consider a device a touchscreen if it
doesn't have any touch classes. Even if it has 'touch' in its
name.
https://bugzilla.gnome.org/show_bug.cgi?id=673440
2012-04-06 20:00:35 -04:00
Chun-wei Fan 1f5537c689 Update libgail-util Visual C++ projects
Make the output .lib name more consistent with the GDK/GTK+ output .lib
naming.
2012-04-06 12:11:40 +08:00
Chun-wei Fan d8f13c933a Update gdk-win32 Visual C++ projects
A new source file gdkdevice-virtual.c was added in commit 24f9ca92 for the
Win32 GDK backend, so add that file to the list of source files to compile.
2012-04-06 00:24:34 +08:00
Benjamin Otte 917ca6a802 gtk: Don't call gdk_window_process_updates() when scrolling
This can cause lagging when scrolling as it causes us to repaint
on every scroll event. This wasn't historically a great problem,
but with smooth scrolling we get a lot more events, so this
now creates visible lagging on slower machines.
2012-04-05 15:48:51 +02:00
ManojKumar Giri d55961adf9 Updated Odia Translation 2012-04-05 17:08:19 +05:30
Benjamin Otte 12d6b0fe62 paned: Shrinkable widgets don't require a size
This could otherwise lead to very funny size request behaviors, in
particular in empathy.

https://bugzilla.gnome.org/show_bug.cgi?id=587441
2012-04-05 11:30:41 +02:00
Rui Matos 7b0fd635fa x11: Don't ignore button releases after a wmspec move/resize
_gdk_x11_moveresize_configure_done() isn't called for wmspec
moves/resizes so we don't have a way to notice when a wmspec
move/resize ends and consequently untrigger the sending of
_NET_WM_MOVERESIZE_CANCEL which results in this message always being
sent on the next button release event. In that case we are marking
that event as handled so it isn't processed further which breaks
button press/release event handling in several widgets.

To fix this we simply allow the normal event handling machinery to run
after sending the _NET_WM_MOVERESIZE_CANCEL message.

https://bugzilla.gnome.org/show_bug.cgi?id=673328
2012-04-05 10:12:16 +02:00
Rui Matos 8dcbe9e2de configure.ac: Clean the ms-windows related stuff
Build fix and cleanup for the ms-windows engine removal.
2012-04-04 17:49:10 +02:00
Rui Matos 987baaba5c x11: Set GdkToplevelX11.have_focused on creation
Since the order in which _NET_WM_STATE and _NET_WM_DESKTOP are set, or
even *if* they are set, isn't defined, we could end up unsetting
GDK_WINDOW_STATE_FOCUSED given that both handlers for these two X
properties end up doing window state changes for all states. As we
want GDK_WINDOW_STATE_FOCUSED to be set by default we need to set its
master flag by default as well.

https://bugzilla.gnome.org/show_bug.cgi?id=673125
2012-04-04 17:14:06 +02:00
Nelson Benitez Leon 45a5151f94 gtktreeview: don't handle extra mouse buttons
Don't handle mouse button events greater than 5 so
they can bubble up to be used by the application.

This was causing nautilus list view to not go forward
and backwards when pressing the extra mouse buttons
designated for that.

Fixes bug 673441

Signed-off-by: Nelson Benitez Leon <nbenitezl@gmail.com>
2012-04-04 16:26:57 +02:00
ManojKumar Giri b7e3702d32 Updated Odia Translation 2012-04-04 18:06:30 +05:30
Alexander Larsson 5d9ab2621d win32: Remove the ms-windows engine
This is not used for the windows theme anymore, and is in fact completely
useless. The code is still in git if anyone wants to look at it.
2012-04-03 19:34:02 +02:00
Alexander Larsson a4cde82365 win32: Fall back to raleigh with the classic theme
This is not ideal, we should have a real classic windows theme,
but at least its better than everything being pink, which is what
happens otherwise when theming is not enables.
2012-04-03 19:26:15 +02:00
Alexander Larsson c5a8f3cb61 gdk: Remove GdkDisplay->ignore_core_pointer
This is not used anywhere anymore
2012-04-03 11:37:42 +02:00
Alexander Larsson 24f9ca92ab win32: Fix up wintab support
We now have a proper MASTER/SLAVE input device split, where
the masters are virtual core input devices and we add fake hw
slave devices for the system pointer and real slave devices for
wintab devices.

We also set the proper source_device on the events so you can
tell which device sent it and properly decode the axis info.
2012-04-03 11:37:42 +02:00
Alexander Larsson ddd24761fd Add _gdk_device_get_axis_info
This is needed for the win32 master/slave handling code.
2012-04-03 11:37:41 +02:00
Alexander Larsson 2697ac5770 testinput: Fix cursor rendering
Make sure custom cursors are rendered at integer coordinates,
otherwise there will be leftover alpha borders when we remove the
cursor.
2012-04-03 11:37:41 +02:00
Javier Jardón 440e9cdfd3 configure.ac: Depend on the corresponding stable versions 2012-04-03 03:19:05 +01:00
Mario Blättermann 245a08a1a0 [l10n] Updated German translation 2012-04-01 11:14:41 +02:00
Matthias Clasen 1473db7f1e Fix a link
As pointed out in bug 673139, the link to the mailing list
information page was outdated.
2012-03-30 17:37:06 -04:00
Jasper St. Pierre 356c3a3b29 gactionmuxer: Fix list_actions
The code there before was just completely wrong

https://bugzilla.gnome.org/show_bug.cgi?id=673200
2012-03-30 15:21:06 -04:00
Matthias Clasen d51840ccf3 filechooser: Fix entry completion
Inserting the selected completion did not actually work. Oops.

https://bugzilla.gnome.org/show_bug.cgi?id=673090
2012-03-29 18:59:07 -04:00
Matthias Clasen 71a82b1e98 Amend the release notes 2012-03-29 18:59:07 -04:00
Alexander Larsson 0b26605ab0 css: Only keep around GtkCssSections if GTK_CSS_DEBUG env var set
These are used purely for CSS debugging, and was using over 100k just
starting up gtk3-demo.
2012-03-29 13:57:22 +02:00
Rob Bradford 13b2720308 build: Don't use Wayland GtkClipboard implementation if also building for X
Workaround for: https://bugzilla.gnome.org/show_bug.cgi?id=672358
2012-03-29 10:50:07 +01:00
Marek Černocký 4e8f724391 Updated Czech translation 2012-03-29 08:34:07 +02:00
Murray Cumming c00cfda370 GtkApplication Docs: Add a hint.
gtk_application_set_app_menu(), gtk_application_set_menubar():
Mention that you probably want to call this in the startup signal
handler. If you do it earlier you will likely get a warning about
a missing D-Bus connection, because doing it earlier does not
make sense anyway.
2012-03-28 11:26:22 +02:00
Sandeep Sheshrao Shedmake f900ae4aaa Updated Marathi Translations 2012-03-28 08:59:18 +05:30
Benjamin Otte 94dbefda1c Fix for bug 672961 - Custom theme can crash apps with GtkEntryCompletion 2012-03-27 20:29:56 -04:00
Cosimo Cecchi 52bd5f2f1f treeview: filter out invisible columns in get_path_for_child()
Since we check for !list->next (and !list->prev for RTL) to set the
GTK_REGION_LAST flag, we have to filter out invisible columns before
looping; if we don't do that we might end up assigning GTK_REGION_LAST
to an invisible column.

https://bugzilla.gnome.org/show_bug.cgi?id=672937
2012-03-27 12:39:20 -04:00
Sandeep Sheshrao Shedmake c1a7da05a4 Updated Marathi Translations 2012-03-27 17:56:01 +05:30
Daniel Korostil 4f7011c931 Uploaded Ukranian 2012-03-26 21:00:49 +03:00
Petr Kovar eb40954a8c Update Czech translation 2012-03-26 18:17:53 +02:00
Daniel Nylander 5407881d09 Updated Swedish translation 2012-03-26 18:02:42 +02:00
Matthias Clasen a3dbc65ced Bump version 2012-03-26 10:14:43 -04:00
366 changed files with 64526 additions and 43948 deletions
+90
View File
@@ -1,3 +1,93 @@
Overview of Changes in GTK+ 3.5.1
=================================
* Wayland:
- Allow the wayland backend to be used without cairo-gl
- Expose GdkWaylandDisplayManager for runtime checks
* Theming:
- Optimizations to style invalidation
- Support CSS animatable properties
* Bugs fixed
563688 GtkScale (GtkRange) should jump to clicked position
668931 Scrolling down via PageDown/PageUp keys impossible ...
669989 gtk_grid_attach(): Documentation doesn't mention mu...
670373 modules/printing/cups/gtkprintbackendcups.c won't b...
672361 Remove cairo-gl dependency from wayland backend
672789 gtk_builder_add_objects_from_file() crashes on GtkU...
672993 print dialog overrides default cups number-up settings
673259 The gdk/gdkkeysyms-update.pl script and the keysym ...
673644 Scroll not working in document overview
673650 Evince 3.4: adding new annotation is not possible (...
674050 Free image->priv->icon_helper in gtk_image_finalize...
674102 Defaults to wayland over x11 backend
674118 application-window: Desktop file handling improvements
674200 ./configure gives wrong error message if -lXext is ...
674286 "Delete confirmation" dialog has wrong padding
674326 Use localizations of option names and values contai...
674468 Add GTK_STYLE_CLASS_DIM_LABEL
674577 Non static variable in GtkStyleProviderPrivate
674587 treemodelsort: allow iter_previous() to go past the...
674806 icontheme: search first in all themes if the reques...
674807 spinbutton: port to GtkIconHelper
674808 themingengine: render a frame in gtk_render_handle()
674809 themingengine: simplify render_extension() default ...
674890 Fix the colord support in GtkPrinterCups when the P...
646631 GTK should use XDG base dir spec instead of home
* Translation updates
Bulgarian
Crimean Tatar
Czech
Galician
German
Hebrew
Norwegian bokmål
Russian
Serbian
Simplified Chinese
Slovenian
Overview of Changes in GTK+ 3.4.1
=================================
* Win32 fixes:
- Fix wintab support
- Fall back to Raleigh with th eclassic theme
* OS X fixes:
- Fix manual resizing of windows
* Bugs fixed:
672961 Custom theme can crash apps with GtkEntryCompletion
587441 Window expands horizontally rather than the text entry growing...
672133 conflict between srcdir != builddir and generated enum types
672358 Wayland and X11 backends simultaneously enabled is broken
672544 Anchored widgets inside GtkTextView are drawn out of place...
673090 gtk file-chooser: Autocompletion - Dropdown-list: selection fails
673125 windows draw as unfocused/backdrop on window managers that do...
673139 URL to mailing lists in README incorrect
673200 gactionmuxer: Fix list_actions
673328 After clicking empty parts of a toolbar/menubar the next mouse...
673440 shouldn't set GDK_SOURCE_TOUCHSCREEN based on the name
673441 GtkTreeView should not handle extra mouse buttons
673458 GdkEventButton contains wrong buttons in modifier mask...
673693 entrycompletion: set_property() should use property setter...
673882 application-window: try to use the desktop name in the fallback...
Deal more gracefully with a flood of scroll events
* Translation updates:
Catalan
Czech
German
Marathi
Odia
Swedish
Ukrainian
Overview of Changes in GTK+ 3.4.0
=================================
+47 -2
View File
@@ -19,7 +19,7 @@ The official web site is:
http://www.gtk.org/
Information about mailing lists can be found at
http://www.gtk.org/mailing-lists.html
http://www.gtk.org/mailing-lists.php
Installation
@@ -72,16 +72,61 @@ and attach the patch to that bug report.
Patches should be in unified diff form. (The -up option to GNU diff.)
Release notes for 3.6
=====================
* Now follows the XDG Base Directory specification for user
configuration and data files. In detail,
* $XDG_CONFIG_HOME/gtk-3.0/custom-papers is the new location
for $HOME/.gtk-custom-papers
* $XDG_CONFIG_HOME/gtk-3.0/bookmarks is the new location
for $HOME/.gtk-bookmarks
* $XDG_DATA_HOME/themes is preferred over $HOME/.themes
* $XDG_DATA_HOME/icons is preferred over $HOME/.icons.
Existing files from the old location will still be read
if the new location does not exist.
* $HOME/.gtk-3.0 is no longer in the default module load path.
If you want to load modules from there, add it to the GTK_PATH
environment variable.
Release notes for 3.4
=====================
* Scroll events have been separated from button events, and smooth
scrolling has been added with a separate event mask. Widgets now
need to have either GDK_SCROLL_MASK or GDK_SMOOTH_SCROLL_MASK in
their event mask to receive scroll events.
their event mask to receive scroll events. In addition, the
GdkScrollDirection enumeration has gained a new member,
GDK_SCROLL_SMOOTH, so switch statements will have to be amended
to cover this case.
* GTK+ now uses <Primary> instead of <Control> in keyboard accelerators,
for improved cross-platform handling. This should not affect
applications, unless they parse or create these accelerator
manually.
* The tacit assumption that the Alt key corresponds to the MOD1
modifier under X11 is now a hard requirement.
* The beagle search backend for the file chooser has been dropped.
Tracker is the only supported search backend on Linux now.
* GtkNotebook has been changed to destroy its action widgets when
it gets destroyed itself. If your application is using action
widgets in notebooks, you may have to adjust your code to take
this into account.
* GtkApplication no longer uses the gtk mainloop wrappers, so
it is no longer possible to use gtk_main_quit() to stop it.
* The -uninstalled variants of the pkg-config files have been dropped.
* Excessive dependencies have been culled from Requires: lines
in .pc files. Dependent modules may have to declare dependencies
that there were getting 'for free' in the past.
Release notes for 3.2
=====================
+4 -4
View File
@@ -86,7 +86,7 @@
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
<ImportLibrary>$(TargetDir)$(ProjectName).lib</ImportLibrary>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(GtkApiVersion).lib</ImportLibrary>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
@@ -110,7 +110,7 @@
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(TargetDir)$(ProjectName).lib</ImportLibrary>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(GtkApiVersion).lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
@@ -132,7 +132,7 @@
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
<ImportLibrary>$(TargetDir)$(ProjectName).lib</ImportLibrary>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(GtkApiVersion).lib</ImportLibrary>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -157,7 +157,7 @@
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<ImportLibrary>$(TargetDir)$(ProjectName).lib</ImportLibrary>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(GtkApiVersion).lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
+1
View File
@@ -114,6 +114,7 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\gdk\win32\gdkcursor-win32.c" />
<ClCompile Include="..\..\..\gdk\win32\gdkdevice-virtual.c" />
<ClCompile Include="..\..\..\gdk\win32\gdkdevice-win32.c" />
<ClCompile Include="..\..\..\gdk\win32\gdkdevice-wintab.c" />
<ClCompile Include="..\..\..\gdk\win32\gdkdevicemanager-win32.c" />
@@ -18,6 +18,9 @@
<ClCompile Include="..\..\..\gdk\win32\gdkcursor-win32.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\gdk\win32\gdkdevice-virtual.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\gdk\win32\gdkdevice-win32.c">
<Filter>Source Files</Filter>
</ClCompile>
+4 -4
View File
@@ -47,7 +47,7 @@
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll"
GenerateDebugInformation="true"
ModuleDefinitionFile="..\..\..\libgail-util\gailutil.def"
ImportLibrary="$(TargetDir)$(ProjectName).lib"
ImportLibrary="$(TargetDir)$(ProjectName)-$(GtkApiVersion).lib"
SubSystem="2"
TargetMachine="1"
/>
@@ -81,7 +81,7 @@
ModuleDefinitionFile="..\..\..\libgail-util\gailutil.def"
GenerateDebugInformation="true"
SubSystem="2"
ImportLibrary="$(TargetDir)$(ProjectName).lib"
ImportLibrary="$(TargetDir)$(ProjectName)-$(GtkApiVersion).lib"
TargetMachine="17"
/>
</Configuration>
@@ -114,7 +114,7 @@
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll"
GenerateDebugInformation="true"
ModuleDefinitionFile="..\..\..\libgail-util\gailutil.def"
ImportLibrary="$(TargetDir)$(ProjectName).lib"
ImportLibrary="$(TargetDir)$(ProjectName)-$(GtkApiVersion).lib"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
@@ -149,7 +149,7 @@
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
ImportLibrary="$(TargetDir)$(ProjectName).lib"
ImportLibrary="$(TargetDir)$(ProjectName)-$(GtkApiVersion).lib"
TargetMachine="17"
/>
</Configuration>
+1
View File
@@ -123,6 +123,7 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File RelativePath="..\..\..\gdk\win32\gdkcursor-win32.c" />
<File RelativePath="..\..\..\gdk\win32\gdkdevice-virtual.c" />
<File RelativePath="..\..\..\gdk\win32\gdkdevice-win32.c" />
<File RelativePath="..\..\..\gdk\win32\gdkdevice-wintab.c" />
<File RelativePath="..\..\..\gdk\win32\gdkdevicemanager-win32.c" />
+60 -74
View File
@@ -9,8 +9,8 @@
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
m4_define([gtk_major_version], [3])
m4_define([gtk_minor_version], [4])
m4_define([gtk_micro_version], [0])
m4_define([gtk_minor_version], [5])
m4_define([gtk_micro_version], [3])
m4_define([gtk_interface_age], [0])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
@@ -39,12 +39,12 @@ AC_CONFIG_AUX_DIR([build-aux])
m4_define([gtk_binary_version], [3.0.0])
# required versions of other packages
m4_define([glib_required_version], [2.31.20])
m4_define([pango_required_version], [1.29.0])
m4_define([atk_required_version], [2.1.5])
m4_define([glib_required_version], [2.33.1])
m4_define([pango_required_version], [1.30.0])
m4_define([atk_required_version], [2.2.0])
m4_define([cairo_required_version], [1.10.0])
m4_define([gdk_pixbuf_required_version], [2.25.2])
m4_define([introspection_required_version], [0.10.1])
m4_define([gdk_pixbuf_required_version], [2.26.0])
m4_define([introspection_required_version], [1.32.0])
GLIB_REQUIRED_VERSION=glib_required_version
PANGO_REQUIRED_VERSION=pango_required_version
ATK_REQUIRED_VERSION=atk_required_version
@@ -316,13 +316,19 @@ AC_ARG_ENABLE(quartz-relocation,
[enable bundle-based relocation functions])],
[quartz_relocation=yes])
AC_ARG_ENABLE(wayland-cairo-gl,
AS_HELP_STRING([--enable-wayland-cairo-gl],
[enable the use of Cairo GL in the Wayland backend]),
[enable_wayland_cairo_gl=yes])
cairo_backends=
backend_immodules=
have_gio_unix=no
GDK_BACKENDS=
GDK_EXTRA_LIBS=
GDK_EXTRA_CFLAGS=
GDK_WINDOWING=
GIO_PACKAGE=gio-2.0
PANGO_PACKAGES="pango pangocairo"
if test "$enable_x11_backend" = "yes"; then
@@ -332,7 +338,7 @@ if test "$enable_x11_backend" = "yes"; then
GDK_BACKENDS="$GDK_BACKENDS x11"
# Pull in gio-unix for GDesktopAppInfo usage, see at least
# gdkapplaunchcontext-x11.c
GIO_PACKAGE=gio-unix-2.0
have_gio_unix=yes
backend_immodules="$backend_immodules,xim"
GDK_WINDOWING="$GDK_WINDOWING
#define GDK_WINDOWING_X11"
@@ -379,13 +385,22 @@ else
fi
if test "x$enable_wayland_backend" == "xyes"; then
# Wayland uses cairo-gl
cairo_backends="$cairo_backends cairo-gl"
if test "x$enable_wayland_cairo_gl" == "xyes"; then
# Wayland can use cairo-gl
cairo_backends="$cairo_backends cairo-gl"
AC_DEFINE(GDK_WAYLAND_USE_EGL, [1], [Whether to use EGL in Wayland backend])
else
# For the cairo image backend
cairo_backends="$cairo_backends cairo"
fi
GDK_BACKENDS="$GDK_BACKENDS wayland"
GIO_PACKAGE=gio-unix-2.0
have_gio_unix=yes
GDK_WINDOWING="$GDK_WINDOWING
#define GDK_WINDOWING_WAYLAND"
WAYLAND_PACKAGES="wayland-client xkbcommon wayland-egl egl"
WAYLAND_PACKAGES="wayland-client xkbcommon "
if test "x$enable_wayland_cairo_gl" == "xyes"; then
WAYLAND_PACKAGES="$WAYLAND_PACKAGES wayland-egl egl"
fi
AM_CONDITIONAL(USE_WAYLAND, true)
else
AM_CONDITIONAL(USE_WAYLAND, false)
@@ -407,7 +422,7 @@ else
if test "x$enable_debug" = "xno"; then
GTK_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
else
GTK_DEBUG_FLAGS="-DG_DISABLE_CAST_CHECKS"
GTK_DEBUG_FLAGS="-DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS"
fi
fi
@@ -734,26 +749,9 @@ AC_CHECK_FUNCS(mallinfo)
AC_CHECK_FUNCS(getresuid)
AC_TYPE_UID_T
# Check for uxtheme.h (for MS-Windows Engine)
AC_MSG_CHECKING(for uxtheme.h)
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <uxtheme.h>]])],
[gtk_uxtheme_h=yes], [gtk_uxtheme_h=no])
if test $gtk_uxtheme_h = yes; then
AC_DEFINE(HAVE_UXTHEME_H, 1, [Have uxtheme.h include file])
fi
AC_MSG_RESULT($gtk_uxtheme_h)
# Check for round()
AC_CHECK_LIB(m,round,have_round=yes,have_round=no)
if test $have_round = yes; then
AC_DEFINE(HAVE_ROUND, 1, [Define to 1 if round() is available])
fi
# Check for rint()
AC_CHECK_LIB(m,rint,have_rint=yes,have_rint=no)
if test $have_rint = yes; then
AC_DEFINE(HAVE_RINT, 1, [Define to 1 if rint() is available])
fi
# Check for round(), rint(), isnan(), isinf() and nearbyint()
AC_CHECK_LIB(m,round,,)
AC_CHECK_FUNCS(round rint isnan isinf nearbyint)
# Checks for gdkspawn
AC_CHECK_HEADERS(crt_externs.h)
@@ -970,9 +968,9 @@ if test "x$enable_x11_backend" = xyes; then
# Xext is optional, the chances a system has *none* of these things is so
# small that we just unconditionally require it.
AC_CHECK_FUNC(XOpenDisplay, :,
AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]))
AC_MSG_ERROR([*** libX11 and libXext not found. Check 'config.log' for more details.]))
AC_CHECK_FUNC(XextFindDisplay, :,
AC_MSG_ERROR([*** libXext not found. Check 'config.log' for more details.]))
AC_MSG_ERROR([*** libX11 and libXext not found. Check 'config.log' for more details.]))
# Check for xReply
@@ -1203,6 +1201,15 @@ else
AM_CONDITIONAL(USE_X11, false)
fi
# Check for gio-unix
if test "$have_gio_unix" = "yes"; then
GDK_GIO_PACKAGE=gio-unix-2.0
AC_DEFINE([HAVE_GIO_UNIX], [1],
[Define if gio-unix is available])
else
GDK_GIO_PACKAGE=gio-2.0
fi
# Check for Pango flags
AC_MSG_CHECKING(Pango flags)
@@ -1235,13 +1242,14 @@ CFLAGS="$saved_cflags"
LDFLAGS="$saved_ldflags"
GDK_PACKAGES="$PANGO_PACKAGES gdk-pixbuf-2.0 cairo cairo-gobject"
GDK_PRIVATE_PACKAGES="$GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $cairo_backends"
GDK_PRIVATE_PACKAGES="$GDK_GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $cairo_backends"
if test "x$enable_x11_backend" = xyes; then
GDK_PRIVATE_PACKAGES="$GDK_PRIVATE_PACKAGES pangoft2"
fi
GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PACKAGES $GDK_PRIVATE_PACKAGES` $MATH_LIB"
GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PACKAGES $GDK_PRIVATE_PACKAGES` $GDK_EXTRA_CFLAGS"
PKG_CHECK_MODULES(GDK_DEP, $GDK_PACKAGES $GDK_PRIVATE_PACKAGES)
GDK_DEP_LIBS="$GDK_EXTRA_LIBS $GDK_DEP_LIBS $MATH_LIB"
GDK_DEP_CFLAGS="$GDK_DEP_CFLAGS $GDK_EXTRA_CFLAGS"
#
# If we aren't writing explicit dependencies, then don't put the extra libraries we need
# into the pkg-config files
@@ -1263,40 +1271,22 @@ AC_SUBST(GDK_DEP_CFLAGS)
########################################
ATK_PACKAGES=atk
AC_MSG_CHECKING(ATK flags)
if $PKG_CONFIG --exists $ATK_PACKAGES ; then
ATK_CFLAGS=`$PKG_CONFIG --cflags $ATK_PACKAGES`
ATK_LIBS=`$PKG_CONFIG --libs $ATK_PACKAGES`
AC_MSG_RESULT($ATK_CFLAGS $ATK_LIBS)
else
AC_MSG_ERROR([
*** Accessibility Toolkit not found. Accessibility Toolkit is required
*** to build GTK+.
])
fi
if $PKG_CONFIG --uninstalled $ATK_PACKAGES; then
:
else
gtk_save_LIBS="$LIBS"
LIBS="$ATK_LIBS $LIBS"
AC_TRY_LINK_FUNC(atk_object_get_type, : , AC_MSG_ERROR([
*** Cannot link to Accessibility Toolkit. Accessibility Toolkit is required
*** to build GTK+]))
LIBS="$gtk_save_LIBS"
fi
PKG_CHECK_MODULES(ATK, $ATK_PACKAGES)
GTK_PACKAGES="atk cairo cairo-gobject gdk-pixbuf-2.0 gio-2.0"
GTK_PRIVATE_PACKAGES=""
if test "x$enable_x11_backend" = xyes; then
GTK_PRIVATE_PACKAGES="$GTK_PRIVATE_PACKAGES pangoft2"
fi
if test "$have_gio_unix" = "yes"; then
GTK_PRIVATE_PACKAGES="$GTK_PRIVATE_PACKAGES gio-unix-2.0"
fi
GTK_EXTRA_LIBS=
GTK_EXTRA_CFLAGS=
GTK_DEP_LIBS="$GDK_EXTRA_LIBS $GTK_DEP_LIBS_FOR_X `$PKG_CONFIG --libs $PANGO_PACKAGES $GTK_PACKAGES_FOR_X $GTK_PACKAGES $GTK_PRIVATE_PACKAGES` $GTK_EXTRA_LIBS $MATH_LIB"
GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PACKAGES $GTK_PACKAGES $GTK_PRIVATE_PACKAGES` $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
PKG_CHECK_MODULES(GTK_DEP, $PANGO_PACKAGES $GTK_PACKAGES_FOR_X $GTK_PACKAGES $GTK_PRIVATE_PACKAGES)
GTK_DEP_LIBS="$GDK_EXTRA_LIBS $GTK_DEP_LIBS_FOR_X $GTK_DEP_LIBS $GTK_EXTRA_LIBS $MATH_LIB"
GTK_DEP_CFLAGS="$GTK_DEP_CFLAGS $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
if test x"$os_win32" = xyes; then
GTK_EXTRA_CFLAGS="$msnative_struct"
@@ -1391,6 +1381,12 @@ else
$CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -lt 2; then
AC_MSG_ERROR([CUPS >= 1.2 not found])
fi
if test $CUPS_API_MAJOR -gt 1 -o \
$CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -ge 6; then
AC_DEFINE(HAVE_CUPS_API_1_6, 1,
[Define to 1 if CUPS 1.6 API is available])
fi
AC_SUBST(CUPS_API_MAJOR)
AC_SUBST(CUPS_API_MINOR)
@@ -1506,13 +1502,6 @@ fi
GLIB_GSETTINGS
#############
# Resources #
#############
GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable glib_compile_resources gio-2.0`
AC_SUBST(GLIB_COMPILE_RESOURCES)
##################################################
# GObject introspection
##################################################
@@ -1752,9 +1741,6 @@ libgail-util/Makefile
modules/Makefile
modules/engines/Makefile
modules/engines/pixbuf/Makefile
modules/engines/ms-windows/Makefile
modules/engines/ms-windows/Theme/Makefile
modules/engines/ms-windows/Theme/gtk-3.0/Makefile
modules/input/Makefile
modules/printbackends/Makefile
modules/printbackends/cups/Makefile
+8 -2
View File
@@ -427,6 +427,12 @@ on_name_vanished (GDBusConnection *connection,
}
}
#ifdef G_OS_WIN32
#define APP_EXTENSION ".exe"
#else
#define APP_EXTENSION
#endif
GtkWidget *
do_application (GtkWidget *toplevel)
{
@@ -445,8 +451,8 @@ do_application (GtkWidget *toplevel)
const gchar *command;
GError *error = NULL;
if (g_file_test ("./gtk3-demo-application", G_FILE_TEST_IS_EXECUTABLE))
command = "./gtk3-demo-application";
if (g_file_test ("./gtk3-demo-application" APP_EXTENSION, G_FILE_TEST_IS_EXECUTABLE))
command = "./gtk3-demo-application" APP_EXTENSION;
else
command = "gtk3-demo-application";
+1
View File
@@ -522,6 +522,7 @@ do_toolpalette (GtkWidget *do_widget)
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_container_set_border_width (GTK_CONTAINER (palette_scroller), 6);
gtk_widget_set_hexpand (palette_scroller, TRUE);
gtk_container_add (GTK_CONTAINER (palette_scroller), palette);
gtk_container_add (GTK_CONTAINER (hbox), palette_scroller);
+1 -1
View File
@@ -22,7 +22,7 @@ gtk3_widget_factory_LDADD = \
$(top_builddir)/gtk/libgtk-3.la \
$(GTK_DEP_LIBS)
widget_factory_resources.c: widget-factory.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies $(srcdir)/widget-factory.gresource.xml)
widget_factory_resources.c: widget-factory.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/widget-factory.gresource.xml)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $<
EXTRA_DIST += \
+53
View File
@@ -658,6 +658,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_homogeneous">True</property>
<property name="column_homogeneous">True</property>
<child>
<object class="GtkCheckButton" id="checkbutton1">
<property name="label" translatable="yes">checkbutton</property>
@@ -908,6 +909,58 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinner" id="spinner1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="active">True</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinner" id="spinner2">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinner" id="spinner3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="active">True</property>
<property name="sensitive">False</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinner" id="spinner4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="sensitive">False</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">4</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
+4
View File
@@ -65,6 +65,10 @@
<title>Index of new symbols in 3.4</title>
<xi:include href="xml/api-index-3.4.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-3-6" role="3.6">
<title>Index of new symbols in 3.6</title>
<xi:include href="xml/api-index-3.6.xml"><xi:fallback /></xi:include>
</index>
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
+2
View File
@@ -991,6 +991,8 @@ gdk_x11_grab_server
gdk_x11_ungrab_server
gdk_x11_cursor_get_xcursor
gdk_x11_cursor_get_xdisplay
gdk_x11_keymap_get_group_for_state
gdk_x11_keymap_key_is_modifier
gdk_x11_visual_get_xvisual
gdk_x11_atom_to_xatom
gdk_x11_atom_to_xatom_for_display
+5 -1
View File
@@ -526,6 +526,7 @@ GtkBuilderConnectFunc
GtkBuilderError
gtk_builder_new
gtk_builder_add_from_file
gtk_builder_add_from_resource
gtk_builder_add_from_string
gtk_builder_add_objects_from_file
gtk_builder_add_objects_from_string
@@ -5029,7 +5030,6 @@ GtkWidgetClass
GtkCallback
GtkRequisition
GtkAllocation
GtkSelectionData
GtkWidgetAuxInfo
GtkWidgetHelpType
gtk_widget_new
@@ -5678,6 +5678,7 @@ GTK_STYLE_CLASS_LEFT
GTK_STYLE_CLASS_RIGHT
GTK_STYLE_CLASS_LINKED
GTK_STYLE_CLASS_ARROW
GTK_STYLE_CLASS_OSD
GTK_STYLE_REGION_COLUMN
GTK_STYLE_REGION_COLUMN_HEADER
GTK_STYLE_REGION_ROW
@@ -5999,6 +6000,7 @@ GtkRcContext
<SECTION>
<FILE>gtkselection</FILE>
<TITLE>Selections</TITLE>
GtkSelectionData
GtkTargetEntry
GtkTargetList
GtkTargetPair
@@ -7018,6 +7020,7 @@ gtk_application_new
gtk_application_add_window
gtk_application_remove_window
gtk_application_get_windows
gtk_application_get_window_by_id
<SUBSECTION>
GtkApplicationInhibitFlags
@@ -7051,6 +7054,7 @@ GtkApplicationWindow
gtk_application_window_new
gtk_application_window_set_show_menubar
gtk_application_window_get_show_menubar
gtk_application_window_get_id
<SUBSECTION Standard>
GtkApplicationWindowClass
+4
View File
@@ -41,6 +41,10 @@
<term><filename>gtk/gtk.h</filename></term>
<listitem>for GTK</listitem>
</varlistentry>
<varlistentry>
<term><filename>gtk/gtkx.h</filename></term>
<listitem>for the X-specfic widgets #GtkSocket and #GtkPlug</listitem>
</varlistentry>
<varlistentry>
<term><filename>gtk/gtkunixprint.h</filename></term>
<listitem>for low-level, UNIX-specific printing functions</listitem>
@@ -31,18 +31,18 @@
</thead>
<tbody>
<row><entry>EggSMClient::quit-requested</entry><entry>instead of calling will_quit (FALSE,...) in response to this signal, install an inhibitor</entry></row>
<row><entry>EggSMClient::quit</entry><entry>the #GtkApplication::quit signal</entry></row>
<row><entry>EggSMClient::quit-cancelled</entry><entry></entry></row>
<row><entry>EggSMClient::quit</entry><entry>the #GApplication::shutdown signal</entry></row>
<row><entry>EggSMClient::quit-cancelled</entry><entry>-</entry></row>
<row><entry>egg_sm_client_will_quit</entry><entry>instead of calling will_quit (FALSE,...), install an inhibitor</entry></row>
<row><entry>egg_sm_client_end_session</entry><entry>gtk_application_end_session()</entry></row>
<row><entry>egg_sm_client_end_session</entry><entry>-</entry></row>
</tbody>
</tgroup>
</table>
<para>
At this point, GtkApplication has no special support for state saving.
Applications can use GSettings or GKeyFile and save as much state as
they see fit in response to #GtkApplication::quit or whenever they
consider appropriate.
At this point, GtkApplication has no special support for state saving
and restarting. Applications can use GSettings or GKeyFile and save as
much state as they see fit in response to #GApplication::shutdown or
whenever they consider appropriate.
</para>
</chapter>
+11 -3
View File
@@ -58,8 +58,8 @@ warning that occurs.
<para>
A list of <link linkend="GTK-Debug-Options">debug options</link>
to turn on in addition to those specified in the <envar>GTK_DEBUG</envar>
environment variable. This option is only available if GTK+ has been
configured with <option>--enable-debug=yes</option>.
environment variable. This option is not available if GTK+ has been
configured with <option>--enable-debug=no</option>.
</para>
</formalpara>
@@ -134,7 +134,7 @@ additional environment variables.
<title><envar>GTK_DEBUG</envar></title>
<para>
If GTK+ has been configured with <option>--enable-debug=yes</option>,
Unless GTK+ has been configured with <option>--enable-debug=no</option>,
this variable can be set to a list of debug options, which cause GTK+
to print out different types of debugging information.
<variablelist>
@@ -186,6 +186,14 @@ additional environment variables.
<term>builder</term>
<listitem><para>GtkBuilder support</para></listitem>
</varlistentry>
<varlistentry>
<term>size-request</term>
<listitem><para>Size requests</para></listitem>
</varlistentry>
<varlistentry>
<term>no-css-cache</term>
<listitem><para>Bypass caching for CSS style properties.</para></listitem>
</varlistentry>
</variablelist>
The special value <literal>all</literal> can be used to turn on all
+4 -2
View File
@@ -36,9 +36,9 @@ EXTRA_DIST += \
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"Gdk\" \
-DGDK_COMPILATION \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_builddir)/gdk \
-I$(top_srcdir) \
$(GTK_DEBUG_FLAGS) \
$(GDK_DEP_CFLAGS)
@@ -306,7 +306,9 @@ endif
lib_LTLIBRARIES = libgdk-3.la
MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
EXTRA_DIST += $(gdk_built_sources)
EXTRA_DIST += \
$(gdk_built_sources) \
fallback-c89.c
install-exec-hook:
if DISABLE_EXPLICIT_DEPS
+13 -13
View File
@@ -40,15 +40,15 @@ static void gdk_broadway_device_warp (GdkDevice *device,
GdkScreen *screen,
gint x,
gint y);
static gboolean gdk_broadway_device_query_state (GdkDevice *device,
GdkWindow *window,
GdkWindow **root_window,
GdkWindow **child_window,
gint *root_x,
gint *root_y,
gint *win_x,
gint *win_y,
GdkModifierType *mask);
static void gdk_broadway_device_query_state (GdkDevice *device,
GdkWindow *window,
GdkWindow **root_window,
GdkWindow **child_window,
gint *root_x,
gint *root_y,
gint *win_x,
gint *win_y,
GdkModifierType *mask);
static GdkGrabStatus gdk_broadway_device_grab (GdkDevice *device,
GdkWindow *window,
gboolean owner_events,
@@ -140,7 +140,7 @@ gdk_broadway_device_warp (GdkDevice *device,
{
}
static gboolean
static void
gdk_broadway_device_query_state (GdkDevice *device,
GdkWindow *window,
GdkWindow **root_window,
@@ -159,7 +159,7 @@ gdk_broadway_device_query_state (GdkDevice *device,
gint device_root_x, device_root_y;
if (gdk_device_get_source (device) != GDK_SOURCE_MOUSE)
return FALSE;
return;
display = gdk_device_get_display (device);
broadway_display = GDK_BROADWAY_DISPLAY (display);
@@ -196,7 +196,7 @@ gdk_broadway_device_query_state (GdkDevice *device,
else
*child_window = toplevel; /* No native children */
}
return TRUE;
return;
}
/* Fallback when unconnected */
@@ -229,7 +229,7 @@ gdk_broadway_device_query_state (GdkDevice *device,
}
}
return TRUE;
return;
}
void
+44
View File
@@ -0,0 +1,44 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2011 Chun-wei Fan <fanc999@yahoo.com.tw>
*
* Author: Chun-wei Fan <fanc999@yahoo.com.tw>
*
* 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/>.
*/
#include <float.h>
#ifndef HAVE_ISNAN
/* it seems of the supported compilers only
* MSVC does not have isnan(), but it does
* have _isnan() which does the same as isnan()
*/
static inline gboolean
isnan (double x)
{
return _isnan (x);
}
#endif
#ifndef HAVE_ISINF
/* Unfortunately MSVC does not have finite()
* but it does have _finite() which is the same
* as finite() except when x is a NaN
*/
static inline gboolean
isinf (double x)
{
return (!_finite (x) && !_isnan (x));
}
#endif
+2
View File
@@ -561,6 +561,8 @@ gdk_x11_get_xatom_name
gdk_x11_get_xatom_name_for_display
gdk_x11_grab_server
gdk_x11_keymap_get_type
gdk_x11_keymap_get_group_for_state
gdk_x11_keymap_key_is_modifier
gdk_x11_lookup_xdisplay
gdk_x11_register_standard_event_type
gdk_x11_screen_get_monitor_output
+23
View File
@@ -1369,6 +1369,29 @@ _gdk_device_add_axis (GdkDevice *device,
return pos;
}
void
_gdk_device_get_axis_info (GdkDevice *device,
guint index_,
GdkAtom *label_atom,
GdkAxisUse *use,
gdouble *min_value,
gdouble *max_value,
gdouble *resolution)
{
GdkAxisInfo *info;
g_return_if_fail (GDK_IS_DEVICE (device));
g_return_if_fail (index_ < device->axes->len);
info = &g_array_index (device->axes, GdkAxisInfo, index_);
*label_atom = info->label;
*use = info->use;
*min_value = info->min_value;
*max_value = info->max_value;
*resolution = info->resolution;
}
void
_gdk_device_set_keys (GdkDevice *device,
guint num_keys)
+7
View File
@@ -121,6 +121,13 @@ guint _gdk_device_add_axis (GdkDevice *device,
gdouble min_value,
gdouble max_value,
gdouble resolution);
void _gdk_device_get_axis_info (GdkDevice *device,
guint index,
GdkAtom *label_atom,
GdkAxisUse *use,
gdouble *min_value,
gdouble *max_value,
gdouble *resolution);
void _gdk_device_set_keys (GdkDevice *device,
guint num_keys);
+3 -4
View File
@@ -970,8 +970,7 @@ switch_to_pointer_grab (GdkDisplay *display,
* synthesized when needed.
*/
if (source_device &&
(gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN ||
gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHPAD))
(gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN))
info->need_touch_press_enter = TRUE;
pointer_window = NULL;
@@ -1603,7 +1602,7 @@ gdk_display_request_selection_notification (GdkDisplay *display,
}
/**
* gdk_display_supports_clipboard_persistence
* gdk_display_supports_clipboard_persistence:
* @display: a #GdkDisplay
*
* Returns whether the speicifed display supports clipboard
@@ -1624,7 +1623,7 @@ gdk_display_supports_clipboard_persistence (GdkDisplay *display)
}
/**
* gdk_display_store_clipboard
* gdk_display_store_clipboard:
* @display: a #GdkDisplay
* @clipboard_window: a #GdkWindow belonging to the clipboard owner
* @time_: a timestamp
+5 -5
View File
@@ -244,16 +244,16 @@ gdk_display_manager_get (void)
manager = g_object_new (gdk_win32_display_manager_get_type (), NULL);
else
#endif
#ifdef GDK_WINDOWING_WAYLAND
if (backend == NULL || strcmp (backend, "wayland") == 0)
manager = g_object_new (gdk_wayland_display_manager_get_type (), NULL);
else
#endif
#ifdef GDK_WINDOWING_X11
if (backend == NULL || strcmp (backend, "x11") == 0)
manager = g_object_new (gdk_x11_display_manager_get_type (), NULL);
else
#endif
#ifdef GDK_WINDOWING_WAYLAND
if (backend == NULL || strcmp (backend, "wayland") == 0)
manager = g_object_new (gdk_wayland_display_manager_get_type (), NULL);
else
#endif
#ifdef GDK_WINDOWING_BROADWAY
if (backend == NULL || strcmp (backend, "broadway") == 0)
manager = g_object_new (gdk_broadway_display_manager_get_type (), NULL);
-1
View File
@@ -114,7 +114,6 @@ struct _GdkDisplay
GdkDevice *core_pointer; /* Core pointer device */
guint closed : 1; /* Whether this display has been closed */
guint ignore_core_events : 1; /* Don't send core motion and button event */
GArray *touch_implicit_grabs;
GHashTable *device_grabs;
+6 -6
View File
@@ -170,15 +170,15 @@ _gdk_event_queue_insert_after (GdkDisplay *display,
}
/**
* _gdk_event_queue_insert_after:
* _gdk_event_queue_insert_before:
* @display: a #GdkDisplay
* @sibling: Append after this event.
* @event: Event to append.
* @sibling: Append before this event
* @event: Event to prepend
*
* Appends an event before the specified event, or if it isn't in
* the queue, onto the tail of the event queue.
* Prepends an event before the specified event, or if it isn't in
* the queue, onto the head of the event queue.
*
* Returns: the newly appended list node.
* Returns: the newly prepended list node.
*
* Since: 2.16
*/
+18 -1
View File
@@ -225,8 +225,10 @@ typedef GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent,
* @GDK_2BUTTON_PRESS: a mouse button has been double-clicked (clicked twice
* within a short period of time). Note that each click also generates a
* %GDK_BUTTON_PRESS event.
* @GDK_DOUBLE_BUTTON_PRESS: alias for %GDK_2BUTTON_PRESS, added in 3.6.
* @GDK_3BUTTON_PRESS: a mouse button has been clicked 3 times in a short period
* of time. Note that each click also generates a %GDK_BUTTON_PRESS event.
* @GDK_TRIPLE_BUTTON_PRESS: alias for %GDK_3BUTTON_PRESS, added in 3.6.
* @GDK_BUTTON_RELEASE: a mouse button has been released.
* @GDK_KEY_PRESS: a key has been pressed.
* @GDK_KEY_RELEASE: a key has been released.
@@ -280,6 +282,13 @@ typedef GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent,
* Do not confuse these events with the signals that GTK+ widgets emit.
* Although many of these events result in corresponding signals being emitted,
* the events are often transformed or filtered along the way.
*
* In some language bindings, the values %GDK_2BUTTON_PRESS and
* %GDK_3BUTTON_PRESS would translate into something syntactically
* invalid (eg <literal>Gdk.EventType.2ButtonPress</literal>, where a
* symbol is not allowed to start with a number). In that case, the
* aliases %GDK_DOUBLE_BUTTON_PRESS and %GDK_TRIPLE_BUTTON_PRESS can
* be used instead.
*/
typedef enum
{
@@ -290,7 +299,9 @@ typedef enum
GDK_MOTION_NOTIFY = 3,
GDK_BUTTON_PRESS = 4,
GDK_2BUTTON_PRESS = 5,
GDK_DOUBLE_BUTTON_PRESS = GDK_2BUTTON_PRESS,
GDK_3BUTTON_PRESS = 6,
GDK_TRIPLE_BUTTON_PRESS = GDK_3BUTTON_PRESS,
GDK_BUTTON_RELEASE = 7,
GDK_KEY_PRESS = 8,
GDK_KEY_RELEASE = 9,
@@ -736,7 +747,8 @@ struct _GdkEventTouch
* the modifier keys (e.g. Control, Shift and Alt) and the pointer
* buttons. See #GdkModifierType.
* @direction: the direction to scroll to (one of %GDK_SCROLL_UP,
* %GDK_SCROLL_DOWN, %GDK_SCROLL_LEFT and %GDK_SCROLL_RIGHT).
* %GDK_SCROLL_DOWN, %GDK_SCROLL_LEFT, %GDK_SCROLL_RIGHT or
* %GDK_SCROLL_SMOOTH).
* @device: the device where the event originated.
* @x_root: the x coordinate of the pointer relative to the root of the
* screen.
@@ -746,6 +758,11 @@ struct _GdkEventTouch
* Generated from button presses for the buttons 4 to 7. Wheel mice are
* usually configured to generate button press events for buttons 4 and 5
* when the wheel is turned.
*
* Some GDK backends can also generate 'smooth' scroll events, which
* can be recognized by the %GDK_SCROLL_SMOOTH scroll direction. For
* these, the scroll deltas can be obtained with
* gdk_event_get_scroll_deltas().
*/
struct _GdkEventScroll
{
+108 -14
View File
@@ -286,6 +286,7 @@
#define GDK_dead_U 0xfe89
#define GDK_dead_small_schwa 0xfe8a
#define GDK_dead_capital_schwa 0xfe8b
#define GDK_dead_greek 0xfe8c
#define GDK_First_Virtual_Screen 0xfed0
#define GDK_Prev_Virtual_Screen 0xfed1
#define GDK_Next_Virtual_Screen 0xfed2
@@ -332,6 +333,12 @@
#define GDK_Pointer_Accelerate 0xfefa
#define GDK_Pointer_DfltBtnNext 0xfefb
#define GDK_Pointer_DfltBtnPrev 0xfefc
#define GDK_ch 0xfea0
#define GDK_Ch 0xfea1
#define GDK_CH 0xfea2
#define GDK_c_h 0xfea3
#define GDK_C_h 0xfea4
#define GDK_C_H 0xfea5
#define GDK_3270_Duplicate 0xfd01
#define GDK_3270_FieldMark 0xfd02
#define GDK_3270_Right2 0xfd03
@@ -611,9 +618,9 @@
#define GDK_nacute 0x1f1
#define GDK_ncaron 0x1f2
#define GDK_odoubleacute 0x1f5
#define GDK_udoubleacute 0x1fb
#define GDK_rcaron 0x1f8
#define GDK_uring 0x1f9
#define GDK_udoubleacute 0x1fb
#define GDK_tcedilla 0x1fe
#define GDK_abovedot 0x1ff
#define GDK_Hstroke 0x2a1
@@ -674,32 +681,32 @@
#define GDK_uogonek 0x3f9
#define GDK_utilde 0x3fd
#define GDK_umacron 0x3fe
#define GDK_Wcircumflex 0x1000174
#define GDK_wcircumflex 0x1000175
#define GDK_Ycircumflex 0x1000176
#define GDK_ycircumflex 0x1000177
#define GDK_Babovedot 0x1001e02
#define GDK_babovedot 0x1001e03
#define GDK_Dabovedot 0x1001e0a
#define GDK_Wgrave 0x1001e80
#define GDK_Wacute 0x1001e82
#define GDK_dabovedot 0x1001e0b
#define GDK_Ygrave 0x1001ef2
#define GDK_Fabovedot 0x1001e1e
#define GDK_fabovedot 0x1001e1f
#define GDK_Mabovedot 0x1001e40
#define GDK_mabovedot 0x1001e41
#define GDK_Pabovedot 0x1001e56
#define GDK_wgrave 0x1001e81
#define GDK_pabovedot 0x1001e57
#define GDK_wacute 0x1001e83
#define GDK_Sabovedot 0x1001e60
#define GDK_ygrave 0x1001ef3
#define GDK_sabovedot 0x1001e61
#define GDK_Tabovedot 0x1001e6a
#define GDK_tabovedot 0x1001e6b
#define GDK_Wgrave 0x1001e80
#define GDK_wgrave 0x1001e81
#define GDK_Wacute 0x1001e82
#define GDK_wacute 0x1001e83
#define GDK_Wdiaeresis 0x1001e84
#define GDK_wdiaeresis 0x1001e85
#define GDK_sabovedot 0x1001e61
#define GDK_Wcircumflex 0x1000174
#define GDK_Tabovedot 0x1001e6a
#define GDK_Ycircumflex 0x1000176
#define GDK_wcircumflex 0x1000175
#define GDK_tabovedot 0x1001e6b
#define GDK_ycircumflex 0x1000177
#define GDK_Ygrave 0x1001ef2
#define GDK_ygrave 0x1001ef3
#define GDK_OE 0x13bc
#define GDK_oe 0x13bd
#define GDK_Ydiaeresis 0x13be
@@ -1194,6 +1201,7 @@
#define GDK_leftdoublequotemark 0xad2
#define GDK_rightdoublequotemark 0xad3
#define GDK_prescription 0xad4
#define GDK_permille 0xad5
#define GDK_minutes 0xad6
#define GDK_seconds 0xad7
#define GDK_latincross 0xad9
@@ -1627,6 +1635,8 @@
#define GDK_obarred 0x1000275
#define GDK_SCHWA 0x100018f
#define GDK_schwa 0x1000259
#define GDK_EZH 0x10001b7
#define GDK_ezh 0x1000292
#define GDK_Lbelowdot 0x1001e36
#define GDK_lbelowdot 0x1001e37
#define GDK_Abelowdot 0x1001ea0
@@ -2032,6 +2042,86 @@
#define GDK_braille_dots_1345678 0x10028fd
#define GDK_braille_dots_2345678 0x10028fe
#define GDK_braille_dots_12345678 0x10028ff
#define GDK_Sinh_ng 0x1000d82
#define GDK_Sinh_h2 0x1000d83
#define GDK_Sinh_a 0x1000d85
#define GDK_Sinh_aa 0x1000d86
#define GDK_Sinh_ae 0x1000d87
#define GDK_Sinh_aee 0x1000d88
#define GDK_Sinh_i 0x1000d89
#define GDK_Sinh_ii 0x1000d8a
#define GDK_Sinh_u 0x1000d8b
#define GDK_Sinh_uu 0x1000d8c
#define GDK_Sinh_ri 0x1000d8d
#define GDK_Sinh_rii 0x1000d8e
#define GDK_Sinh_lu 0x1000d8f
#define GDK_Sinh_luu 0x1000d90
#define GDK_Sinh_e 0x1000d91
#define GDK_Sinh_ee 0x1000d92
#define GDK_Sinh_ai 0x1000d93
#define GDK_Sinh_o 0x1000d94
#define GDK_Sinh_oo 0x1000d95
#define GDK_Sinh_au 0x1000d96
#define GDK_Sinh_ka 0x1000d9a
#define GDK_Sinh_kha 0x1000d9b
#define GDK_Sinh_ga 0x1000d9c
#define GDK_Sinh_gha 0x1000d9d
#define GDK_Sinh_ng2 0x1000d9e
#define GDK_Sinh_nga 0x1000d9f
#define GDK_Sinh_ca 0x1000da0
#define GDK_Sinh_cha 0x1000da1
#define GDK_Sinh_ja 0x1000da2
#define GDK_Sinh_jha 0x1000da3
#define GDK_Sinh_nya 0x1000da4
#define GDK_Sinh_jnya 0x1000da5
#define GDK_Sinh_nja 0x1000da6
#define GDK_Sinh_tta 0x1000da7
#define GDK_Sinh_ttha 0x1000da8
#define GDK_Sinh_dda 0x1000da9
#define GDK_Sinh_ddha 0x1000daa
#define GDK_Sinh_nna 0x1000dab
#define GDK_Sinh_ndda 0x1000dac
#define GDK_Sinh_tha 0x1000dad
#define GDK_Sinh_thha 0x1000dae
#define GDK_Sinh_dha 0x1000daf
#define GDK_Sinh_dhha 0x1000db0
#define GDK_Sinh_na 0x1000db1
#define GDK_Sinh_ndha 0x1000db3
#define GDK_Sinh_pa 0x1000db4
#define GDK_Sinh_pha 0x1000db5
#define GDK_Sinh_ba 0x1000db6
#define GDK_Sinh_bha 0x1000db7
#define GDK_Sinh_ma 0x1000db8
#define GDK_Sinh_mba 0x1000db9
#define GDK_Sinh_ya 0x1000dba
#define GDK_Sinh_ra 0x1000dbb
#define GDK_Sinh_la 0x1000dbd
#define GDK_Sinh_va 0x1000dc0
#define GDK_Sinh_sha 0x1000dc1
#define GDK_Sinh_ssha 0x1000dc2
#define GDK_Sinh_sa 0x1000dc3
#define GDK_Sinh_ha 0x1000dc4
#define GDK_Sinh_lla 0x1000dc5
#define GDK_Sinh_fa 0x1000dc6
#define GDK_Sinh_al 0x1000dca
#define GDK_Sinh_aa2 0x1000dcf
#define GDK_Sinh_ae2 0x1000dd0
#define GDK_Sinh_aee2 0x1000dd1
#define GDK_Sinh_i2 0x1000dd2
#define GDK_Sinh_ii2 0x1000dd3
#define GDK_Sinh_u2 0x1000dd4
#define GDK_Sinh_uu2 0x1000dd6
#define GDK_Sinh_ru2 0x1000dd8
#define GDK_Sinh_e2 0x1000dd9
#define GDK_Sinh_ee2 0x1000dda
#define GDK_Sinh_ai2 0x1000ddb
#define GDK_Sinh_o2 0x1000ddc
#define GDK_Sinh_oo2 0x1000ddd
#define GDK_Sinh_au2 0x1000dde
#define GDK_Sinh_lu2 0x1000ddf
#define GDK_Sinh_ruu2 0x1000df2
#define GDK_Sinh_luu2 0x1000df3
#define GDK_Sinh_kunddaliya 0x1000df4
#define GDK_ModeLock 0x1008ff01
#define GDK_MonBrightnessUp 0x1008ff02
#define GDK_MonBrightnessDown 0x1008ff03
@@ -2186,6 +2276,8 @@
#define GDK_Suspend 0x1008ffa7
#define GDK_Hibernate 0x1008ffa8
#define GDK_TouchpadToggle 0x1008ffa9
#define GDK_TouchpadOn 0x1008ffb0
#define GDK_TouchpadOff 0x1008ffb1
#define GDK_Switch_VT_1 0x1008fe01
#define GDK_Switch_VT_2 0x1008fe02
#define GDK_Switch_VT_3 0x1008fe03
@@ -2202,5 +2294,7 @@
#define GDK_ClearGrab 0x1008fe21
#define GDK_Next_VMode 0x1008fe22
#define GDK_Prev_VMode 0x1008fe23
#define GDK_LogWindowTree 0x1008fe24
#define GDK_LogGrabInfo 0x1008fe25
#endif /* __GDK_KEYSYMS_COMPAT_H__ */
+18 -18
View File
@@ -1,15 +1,15 @@
#!/usr/bin/env perl
# Updates http://git.gnome.org/cgit/gtk+/tree/gdk/gdkkeysyms.h from upstream (X.org 7.x),
# from http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=keysymdef.h
# Updates http://git.gnome.org/browse/gtk+/tree/gdk/gdkkeysyms.h from upstream (X.org 7.x),
# from http://cgit.freedesktop.org/xorg/proto/x11proto/plain/keysymdef.h
#
# Author : Simos Xenitellis <simos at gnome dot org>.
# Authos : Bastien Nocera <hadess@hadess.net>
# Version : 1.2
#
# Input : http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=keysymdef.h
# Input : http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h
# Output : http://git.gnome.org/cgit/gtk+/tree/gdk/gdkkeysyms.h
# Input : http://cgit.freedesktop.org/xorg/proto/x11proto/plain/keysymdef.h
# Input : http://cgit.freedesktop.org/xorg/proto/x11proto/plain/XF86keysym.h
# Output : http://git.gnome.org/browse/gtk+/tree/gdk/gdkkeysyms.h
#
# Notes : It downloads keysymdef.h from the Internet, if not found locally,
# Notes : and creates an updated gdkkeysyms.h
@@ -23,31 +23,31 @@ my @keysymelements;
if ( ! -f "keysymdef.h" )
{
print "Trying to download keysymdef.h from\n";
print "http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=keysymdef.h\n";
die "Unable to download keysymdef.h from http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=keysymdef.h\n"
unless system("wget -c -O keysymdef.h \"http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=keysymdef.h\"") == 0;
print "http://cgit.freedesktop.org/xorg/proto/x11proto/plain/keysymdef.h\n";
die "Unable to download keysymdef.h from http://cgit.freedesktop.org/xorg/proto/x11proto/plain/keysymdef.h\n"
unless system("wget -c -O keysymdef.h \"http://cgit.freedesktop.org/xorg/proto/x11proto/plain/keysymdef.h\"") == 0;
print " done.\n\n";
}
else
{
print "We are using existing keysymdef.h found in this directory.\n";
print "It is assumed that you took care and it is a recent version\n";
print "as found at http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob;f=keysymdef.h\n\n";
print "as found at http://cgit.freedesktop.org/xorg/proto/x11proto/plain/keysymdef.h\n\n";
}
if ( ! -f "XF86keysym.h" )
{
print "Trying to download XF86keysym.h from\n";
print "http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h\n";
die "Unable to download keysymdef.h from http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h\n"
unless system("wget -c -O XF86keysym.h \"http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h\"") == 0;
print "http://cgit.freedesktop.org/xorg/proto/x11proto/plain/XF86keysym.h\n";
die "Unable to download keysymdef.h from http://cgit.freedesktop.org/xorg/proto/x11proto/plain/XF86keysym.h\n"
unless system("wget -c -O XF86keysym.h \"http://cgit.freedesktop.org/xorg/proto/x11proto/plain/XF86keysym.h\"") == 0;
print " done.\n\n";
}
else
{
print "We are using existing XF86keysym.h found in this directory.\n";
print "It is assumed that you took care and it is a recent version\n";
print "as found at http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob;f=XF86keysym.h\n\n";
print "as found at http://cgit.freedesktop.org/xorg/proto/x11proto/plain/XF86keysym.h\n\n";
}
if ( -f "gdkkeysyms.h" )
@@ -57,7 +57,7 @@ if ( -f "gdkkeysyms.h" )
die "Exiting...\n\n";
}
# Source: http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob;f=keysymdef.h
# Source: http://cgit.freedesktop.org/xorg/proto/x11proto/plain/keysymdef.h
die "Could not open file keysymdef.h: $!\n" unless open(IN_KEYSYMDEF, "<:utf8", "keysymdef.h");
# Output: gtk+/gdk/gdkkeysyms.h
@@ -93,11 +93,11 @@ print OUT_GDKKEYSYMS_COMPAT $LICENSE_HEADER;
print OUT_GDKKEYSYMS<<EOF;
/*
* File auto-generated from script http://git.gnome.org/cgit/gtk+/tree/gdk/gdkkeysyms-update.pl
* File auto-generated from script http://git.gnome.org/browse/gtk+/tree/gdk/gdkkeysyms-update.pl
* using the input file
* http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=keysymdef.h
* http://cgit.freedesktop.org/xorg/proto/x11proto/plain/keysymdef.h
* and
* http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h
* http://cgit.freedesktop.org/xorg/proto/x11proto/plain/XF86keysym.h
*/
/*
@@ -154,7 +154,7 @@ close IN_KEYSYMDEF;
#$gdksyms{"0"} = "0000";
# Source: http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob;f=XF86keysym.h
# Source: http://cgit.freedesktop.org/xorg/proto/x11proto/plain/XF86keysym.h
die "Could not open file XF86keysym.h: $!\n" unless open(IN_XF86KEYSYM, "<:utf8", "XF86keysym.h");
while (<IN_XF86KEYSYM>)
+29 -17
View File
@@ -18,11 +18,11 @@
/*
* File auto-generated from script http://git.gnome.org/cgit/gtk+/tree/gdk/gdkkeysyms-update.pl
* File auto-generated from script http://git.gnome.org/browse/gtk+/tree/gdk/gdkkeysyms-update.pl
* using the input file
* http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=keysymdef.h
* http://cgit.freedesktop.org/xorg/proto/x11proto/plain/keysymdef.h
* and
* http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h
* http://cgit.freedesktop.org/xorg/proto/x11proto/plain/XF86keysym.h
*/
/*
@@ -295,6 +295,7 @@
#define GDK_KEY_dead_U 0xfe89
#define GDK_KEY_dead_small_schwa 0xfe8a
#define GDK_KEY_dead_capital_schwa 0xfe8b
#define GDK_KEY_dead_greek 0xfe8c
#define GDK_KEY_First_Virtual_Screen 0xfed0
#define GDK_KEY_Prev_Virtual_Screen 0xfed1
#define GDK_KEY_Next_Virtual_Screen 0xfed2
@@ -341,6 +342,12 @@
#define GDK_KEY_Pointer_Accelerate 0xfefa
#define GDK_KEY_Pointer_DfltBtnNext 0xfefb
#define GDK_KEY_Pointer_DfltBtnPrev 0xfefc
#define GDK_KEY_ch 0xfea0
#define GDK_KEY_Ch 0xfea1
#define GDK_KEY_CH 0xfea2
#define GDK_KEY_c_h 0xfea3
#define GDK_KEY_C_h 0xfea4
#define GDK_KEY_C_H 0xfea5
#define GDK_KEY_3270_Duplicate 0xfd01
#define GDK_KEY_3270_FieldMark 0xfd02
#define GDK_KEY_3270_Right2 0xfd03
@@ -620,9 +627,9 @@
#define GDK_KEY_nacute 0x1f1
#define GDK_KEY_ncaron 0x1f2
#define GDK_KEY_odoubleacute 0x1f5
#define GDK_KEY_udoubleacute 0x1fb
#define GDK_KEY_rcaron 0x1f8
#define GDK_KEY_uring 0x1f9
#define GDK_KEY_udoubleacute 0x1fb
#define GDK_KEY_tcedilla 0x1fe
#define GDK_KEY_abovedot 0x1ff
#define GDK_KEY_Hstroke 0x2a1
@@ -683,32 +690,32 @@
#define GDK_KEY_uogonek 0x3f9
#define GDK_KEY_utilde 0x3fd
#define GDK_KEY_umacron 0x3fe
#define GDK_KEY_Wcircumflex 0x1000174
#define GDK_KEY_wcircumflex 0x1000175
#define GDK_KEY_Ycircumflex 0x1000176
#define GDK_KEY_ycircumflex 0x1000177
#define GDK_KEY_Babovedot 0x1001e02
#define GDK_KEY_babovedot 0x1001e03
#define GDK_KEY_Dabovedot 0x1001e0a
#define GDK_KEY_Wgrave 0x1001e80
#define GDK_KEY_Wacute 0x1001e82
#define GDK_KEY_dabovedot 0x1001e0b
#define GDK_KEY_Ygrave 0x1001ef2
#define GDK_KEY_Fabovedot 0x1001e1e
#define GDK_KEY_fabovedot 0x1001e1f
#define GDK_KEY_Mabovedot 0x1001e40
#define GDK_KEY_mabovedot 0x1001e41
#define GDK_KEY_Pabovedot 0x1001e56
#define GDK_KEY_wgrave 0x1001e81
#define GDK_KEY_pabovedot 0x1001e57
#define GDK_KEY_wacute 0x1001e83
#define GDK_KEY_Sabovedot 0x1001e60
#define GDK_KEY_ygrave 0x1001ef3
#define GDK_KEY_sabovedot 0x1001e61
#define GDK_KEY_Tabovedot 0x1001e6a
#define GDK_KEY_tabovedot 0x1001e6b
#define GDK_KEY_Wgrave 0x1001e80
#define GDK_KEY_wgrave 0x1001e81
#define GDK_KEY_Wacute 0x1001e82
#define GDK_KEY_wacute 0x1001e83
#define GDK_KEY_Wdiaeresis 0x1001e84
#define GDK_KEY_wdiaeresis 0x1001e85
#define GDK_KEY_sabovedot 0x1001e61
#define GDK_KEY_Wcircumflex 0x1000174
#define GDK_KEY_Tabovedot 0x1001e6a
#define GDK_KEY_Ycircumflex 0x1000176
#define GDK_KEY_wcircumflex 0x1000175
#define GDK_KEY_tabovedot 0x1001e6b
#define GDK_KEY_ycircumflex 0x1000177
#define GDK_KEY_Ygrave 0x1001ef2
#define GDK_KEY_ygrave 0x1001ef3
#define GDK_KEY_OE 0x13bc
#define GDK_KEY_oe 0x13bd
#define GDK_KEY_Ydiaeresis 0x13be
@@ -1203,6 +1210,7 @@
#define GDK_KEY_leftdoublequotemark 0xad2
#define GDK_KEY_rightdoublequotemark 0xad3
#define GDK_KEY_prescription 0xad4
#define GDK_KEY_permille 0xad5
#define GDK_KEY_minutes 0xad6
#define GDK_KEY_seconds 0xad7
#define GDK_KEY_latincross 0xad9
@@ -1636,6 +1644,8 @@
#define GDK_KEY_obarred 0x1000275
#define GDK_KEY_SCHWA 0x100018f
#define GDK_KEY_schwa 0x1000259
#define GDK_KEY_EZH 0x10001b7
#define GDK_KEY_ezh 0x1000292
#define GDK_KEY_Lbelowdot 0x1001e36
#define GDK_KEY_lbelowdot 0x1001e37
#define GDK_KEY_Abelowdot 0x1001ea0
@@ -2293,5 +2303,7 @@
#define GDK_KEY_ClearGrab 0x1008fe21
#define GDK_KEY_Next_VMode 0x1008fe22
#define GDK_KEY_Prev_VMode 0x1008fe23
#define GDK_KEY_LogWindowTree 0x1008fe24
#define GDK_KEY_LogGrabInfo 0x1008fe25
#endif /* __GDK_KEYSYMS_H__ */
+2
View File
@@ -28,6 +28,8 @@
#include <errno.h>
#include <math.h>
#include "fallback-c89.c"
/**
* SECTION:rgba_colors
* @Short_description: RGBA colors
+26 -2
View File
@@ -80,6 +80,16 @@
*/
#define GDK_VERSION_3_4 (G_ENCODE_VERSION (3, 4))
/**
* GDK_VERSION_3_6:
*
* A macro that evaluates to the 3.6 version of GDK, in a format
* that can be used by the C pre-processor.
*
* Since: 3.6
*/
#define GDK_VERSION_3_6 (G_ENCODE_VERSION (3, 6))
/* evaluates to the current stable version; for development cycles,
* this means the next stable target
@@ -105,7 +115,7 @@
* The definition should be one of the predefined GDK version
* macros: %GDK_VERSION_3_0, %GDK_VERSION_3_2,...
*
* This macro defines the lower bound for the GLib API to use.
* This macro defines the lower bound for the GDK API to use.
*
* If a function has been deprecated in a newer version of GDK,
* it is possible to use this symbol to avoid the compiler warnings
@@ -114,7 +124,7 @@
* Since: 3.4
*/
#ifndef GDK_VERSION_MIN_REQUIRED
# define GDK_VERSION_MIN_REQUIRED (GDK_VERSION_PREV_STABLE)
# define GDK_VERSION_MIN_REQUIRED (GDK_VERSION_CUR_STABLE)
#endif
/**
@@ -193,4 +203,18 @@
# define GDK_AVAILABLE_IN_3_4
#endif
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_6
# define GDK_DEPRECATED_IN_3_6 GDK_DEPRECATED
# define GDK_DEPRECATED_IN_3_6_FOR(f) GDK_DEPRECATED_FOR(f)
#else
# define GDK_DEPRECATED_IN_3_6
# define GDK_DEPRECATED_IN_3_6_FOR(f)
#endif
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_6
# define GDK_AVAILABLE_IN_3_6 GDK_UNAVAILABLE(3, 6)
#else
# define GDK_AVAILABLE_IN_3_6
#endif
#endif /* __GDK_VERSION_MACROS_H__ */
+45 -49
View File
@@ -9469,56 +9469,53 @@ proxy_pointer_event (GdkDisplay *display,
if (!event_win)
return TRUE;
if (!display->ignore_core_events)
{
event = gdk_event_new (event_type);
event->any.window = g_object_ref (event_win);
event->any.send_event = source_event->any.send_event;
event = gdk_event_new (event_type);
event->any.window = g_object_ref (event_win);
event->any.send_event = source_event->any.send_event;
gdk_event_set_device (event, gdk_event_get_device (source_event));
gdk_event_set_source_device (event, source_device);
gdk_event_set_device (event, gdk_event_get_device (source_event));
gdk_event_set_source_device (event, source_device);
if (event_type == GDK_TOUCH_UPDATE)
{
event->touch.time = time_;
event->touch.state = state | GDK_BUTTON1_MASK;
event->touch.sequence = source_event->touch.sequence;
event->touch.emulating_pointer = source_event->touch.emulating_pointer;
convert_toplevel_coords_to_window (event_win,
toplevel_x, toplevel_y,
&event->touch.x, &event->touch.y);
gdk_event_get_root_coords (source_event,
&event->touch.x_root,
&event->touch.y_root);
if (event_type == GDK_TOUCH_UPDATE)
{
event->touch.time = time_;
event->touch.state = state | GDK_BUTTON1_MASK;
event->touch.sequence = source_event->touch.sequence;
event->touch.emulating_pointer = source_event->touch.emulating_pointer;
convert_toplevel_coords_to_window (event_win,
toplevel_x, toplevel_y,
&event->touch.x, &event->touch.y);
gdk_event_get_root_coords (source_event,
&event->touch.x_root,
&event->touch.y_root);
event->touch.axes = g_memdup (source_event->touch.axes,
sizeof (gdouble) * gdk_device_get_n_axes (source_event->touch.device));
}
else
{
event->motion.time = time_;
event->motion.state = state;
event->motion.is_hint = is_hint;
event->touch.axes = g_memdup (source_event->touch.axes,
sizeof (gdouble) * gdk_device_get_n_axes (source_event->touch.device));
}
else
{
event->motion.time = time_;
event->motion.state = state;
event->motion.is_hint = is_hint;
convert_toplevel_coords_to_window (event_win,
toplevel_x, toplevel_y,
&event->motion.x, &event->motion.y);
gdk_event_get_root_coords (source_event,
&event->motion.x_root,
&event->motion.y_root);
convert_toplevel_coords_to_window (event_win,
toplevel_x, toplevel_y,
&event->motion.x, &event->motion.y);
gdk_event_get_root_coords (source_event,
&event->motion.x_root,
&event->motion.y_root);
if (is_touch_type (source_event->type))
event->motion.axes = g_memdup (source_event->touch.axes,
sizeof (gdouble) * gdk_device_get_n_axes (source_event->touch.device));
else
event->motion.axes = g_memdup (source_event->motion.axes,
sizeof (gdouble) * gdk_device_get_n_axes (source_event->motion.device));
}
if (is_touch_type (source_event->type))
event->motion.axes = g_memdup (source_event->touch.axes,
sizeof (gdouble) * gdk_device_get_n_axes (source_event->touch.device));
else
event->motion.axes = g_memdup (source_event->motion.axes,
sizeof (gdouble) * gdk_device_get_n_axes (source_event->motion.device));
}
/* Just insert the event */
_gdk_event_queue_insert_after (gdk_window_get_display (event_win),
source_event, event);
}
/* Just insert the event */
_gdk_event_queue_insert_after (gdk_window_get_display (event_win),
source_event, event);
}
/* unlink all move events from queue.
@@ -9663,7 +9660,7 @@ proxy_button_event (GdkEvent *source_event,
if (source_event->type == GDK_TOUCH_END && !is_touch_type (type))
state |= GDK_BUTTON1_MASK;
if (event_win == NULL || display->ignore_core_events)
if (event_win == NULL)
return TRUE;
if (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_MASTER &&
@@ -9719,11 +9716,10 @@ proxy_button_event (GdkEvent *source_event,
gdk_event_set_device (event, gdk_event_get_device (source_event));
gdk_event_set_source_device (event, source_device);
if (type == GDK_BUTTON_RELEASE)
event->button.state |= GDK_BUTTON1_MASK;
if (is_touch_type (source_event->type))
{
{
if (type == GDK_BUTTON_RELEASE)
event->button.state |= GDK_BUTTON1_MASK;
event->button.button = 1;
event->button.axes = g_memdup (source_event->touch.axes,
sizeof (gdouble) * gdk_device_get_n_axes (source_event->touch.device));
+10
View File
@@ -114,10 +114,15 @@
switch ([event type])
{
case NSLeftMouseUp:
{
double time = ((double)[event timestamp]) * 1000.0;
_gdk_quartz_events_break_all_grabs (time);
inManualMove = NO;
inManualResize = NO;
inMove = NO;
break;
}
case NSLeftMouseDragged:
if ([self trackManualMove] || [self trackManualResize])
@@ -313,6 +318,11 @@
return YES;
}
-(BOOL)isInManualResize
{
return inManualResize;
}
-(void)beginManualMove
{
NSRect frame = [self frame];
+1
View File
@@ -36,6 +36,7 @@
-(BOOL)isInMove;
-(void)beginManualMove;
-(BOOL)trackManualMove;
-(BOOL)isInManualResize;
-(void)beginManualResize;
-(BOOL)trackManualResize;
-(void)showAndMakeKey:(BOOL)makeKey;
+10 -4
View File
@@ -73,8 +73,8 @@ _gdk_quartz_display_has_pending (GdkDisplay *display)
(_gdk_quartz_event_loop_check_pending ()));
}
static void
break_all_grabs (guint32 time)
void
_gdk_quartz_events_break_all_grabs (guint32 time)
{
GList *list, *l;
GdkDeviceManager *device_manager;
@@ -1178,7 +1178,7 @@ gdk_event_translate (GdkEvent *event,
if (event_type == NSAppKitDefined)
{
if ([nsevent subtype] == NSApplicationDeactivatedEventType)
break_all_grabs (get_time_from_ns_event (nsevent));
_gdk_quartz_events_break_all_grabs (get_time_from_ns_event (nsevent));
/* This could potentially be used to break grabs when clicking
* on the title. The subtype 20 is undocumented so it's probably
@@ -1237,10 +1237,16 @@ gdk_event_translate (GdkEvent *event,
*/
if ([(GdkQuartzNSWindow *)nswindow isInMove])
{
break_all_grabs (get_time_from_ns_event (nsevent));
_gdk_quartz_events_break_all_grabs (get_time_from_ns_event (nsevent));
return FALSE;
}
/* Also when in a manual resize, we ignore events so that these are
* pushed to GdkQuartzWindow's sendEvent handler.
*/
if ([(GdkQuartzWindow *)nswindow isInManualResize])
return FALSE;
/* Find the right GDK window to send the event to, taking grabs and
* event masks into consideration.
*/
+1
View File
@@ -65,6 +65,7 @@ GdkModifierType _gdk_quartz_events_get_current_keyboard_modifiers (void);
GdkModifierType _gdk_quartz_events_get_current_mouse_modifiers (void);
void _gdk_quartz_events_send_enter_notify_event (GdkWindow *window);
void _gdk_quartz_events_break_all_grabs (guint32 time);
/* Event loop */
gboolean _gdk_quartz_event_loop_check_pending (void);
+25 -18
View File
@@ -35,6 +35,7 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <sys/mman.h>
#include <errno.h>
#define GDK_TYPE_WAYLAND_CURSOR (_gdk_wayland_cursor_get_type ())
#define GDK_WAYLAND_CURSOR(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_CURSOR, GdkWaylandCursor))
@@ -163,7 +164,7 @@ set_pixbuf (GdkWaylandCursor *cursor, GdkPixbuf *pixbuf)
}
static GdkCursor *
create_cursor(GdkDisplayWayland *display, GdkPixbuf *pixbuf, int x, int y)
create_cursor(GdkWaylandDisplay *display, GdkPixbuf *pixbuf, int x, int y)
{
GdkWaylandCursor *cursor;
int stride, fd;
@@ -193,28 +194,34 @@ create_cursor(GdkDisplayWayland *display, GdkPixbuf *pixbuf, int x, int y)
cursor->size = stride * cursor->height;
fd = g_file_open_tmp("wayland-shm-XXXXXX", &filename, &error);
if (fd < 0) {
fprintf(stderr, "g_file_open_tmp failed: %s\n", error->message);
g_error_free (error);
return NULL;
if (fd < 0)
{
g_critical (G_STRLOC ": Error opening temporary file for buffer: %s",
error->message);
g_error_free (error);
return NULL;
}
unlink (filename);
g_free (filename);
if (ftruncate(fd, cursor->size) < 0) {
fprintf(stderr, "ftruncate failed: %m\n");
close(fd);
return NULL;
}
if (ftruncate(fd, cursor->size) < 0)
{
g_critical (G_STRLOC ": Error truncating file for buffer: %s",
g_strerror (errno));
close(fd);
return NULL;
}
cursor->map = mmap(NULL, cursor->size,
PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (cursor->map == MAP_FAILED) {
fprintf(stderr, "mmap failed: %m\n");
close(fd);
return NULL;
}
PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (cursor->map == MAP_FAILED)
{
g_critical (G_STRLOC ": Error mmap'ing file for buffer: %s",
g_strerror (errno));
close(fd);
return NULL;
}
if (pixbuf)
set_pixbuf (cursor, pixbuf);
@@ -251,7 +258,7 @@ GdkCursor *
_gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
GdkCursorType cursor_type)
{
GdkDisplayWayland *wayland_display;
GdkWaylandDisplay *wayland_display;
GdkPixbuf *pixbuf = NULL;
GError *error = NULL;
int i;
@@ -269,7 +276,7 @@ _gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
i = 0;
}
wayland_display = GDK_DISPLAY_WAYLAND (display);
wayland_display = GDK_WAYLAND_DISPLAY (display);
if (!wayland_display->cursors)
wayland_display->cursors =
g_new0 (GdkCursor *, G_N_ELEMENTS(cursor_definitions));
+6 -6
View File
@@ -350,7 +350,7 @@ input_handle_motion(void *data, struct wl_input_device *input_device,
int32_t x, int32_t y, int32_t sx, int32_t sy)
{
GdkWaylandDevice *device = data;
GdkDisplayWayland *display = GDK_DISPLAY_WAYLAND (device->display);
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
GdkEvent *event;
event = gdk_event_new (GDK_NOTHING);
@@ -386,7 +386,7 @@ input_handle_button(void *data, struct wl_input_device *input_device,
uint32_t time, uint32_t button, uint32_t state)
{
GdkWaylandDevice *device = data;
GdkDisplayWayland *display = GDK_DISPLAY_WAYLAND (device->display);
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
GdkEvent *event;
uint32_t modifier;
int gdk_button;
@@ -911,14 +911,14 @@ _gdk_wayland_device_manager_add_device (GdkDeviceManager *device_manager,
struct wl_input_device *wl_device)
{
GdkDisplay *display;
GdkDisplayWayland *display_wayland;
GdkWaylandDisplay *display_wayland;
GdkDeviceManagerCore *device_manager_core =
GDK_DEVICE_MANAGER_CORE(device_manager);
GdkWaylandDevice *device;
device = g_new0 (GdkWaylandDevice, 1);
display = gdk_device_manager_get_display (device_manager);
display_wayland = GDK_DISPLAY_WAYLAND (display);
display_wayland = GDK_WAYLAND_DISPLAY (display);
device->display = display;
device->pointer = g_object_new (GDK_TYPE_DEVICE_CORE,
@@ -1258,7 +1258,7 @@ gdk_wayland_device_offer_selection_content (GdkDevice
gpointer userdata)
{
GdkDisplay *display;
GdkDisplayWayland *display_wayland;
GdkWaylandDisplay *display_wayland;
GdkWaylandSelectionOffer *offer;
GdkWaylandDevice *device;
gint i;
@@ -1267,7 +1267,7 @@ gdk_wayland_device_offer_selection_content (GdkDevice
device = GDK_DEVICE_CORE (gdk_device)->device;
display = device->display;
display_wayland = GDK_DISPLAY_WAYLAND (display);
display_wayland = GDK_WAYLAND_DISPLAY (display);
offer = g_new0 (GdkWaylandSelectionOffer, 1);
offer->cb = cb;
+36 -25
View File
@@ -17,7 +17,9 @@
#include "config.h"
#ifdef GDK_WAYLAND_USE_EGL
#include <wayland-egl.h>
#endif
#include <stdlib.h>
#include <string.h>
@@ -36,17 +38,17 @@
#include "gdkkeysprivate.h"
#include "gdkprivate-wayland.h"
G_DEFINE_TYPE (GdkDisplayWayland, _gdk_display_wayland, GDK_TYPE_DISPLAY)
G_DEFINE_TYPE (GdkWaylandDisplay, _gdk_wayland_display, GDK_TYPE_DISPLAY)
static void
gdk_input_init (GdkDisplay *display)
{
GdkDisplayWayland *display_wayland;
GdkWaylandDisplay *display_wayland;
GdkDeviceManager *device_manager;
GdkDevice *device;
GList *list, *l;
display_wayland = GDK_DISPLAY_WAYLAND (display);
display_wayland = GDK_WAYLAND_DISPLAY (display);
device_manager = gdk_display_get_device_manager (display);
/* For backwards compatibility, just add
@@ -118,7 +120,7 @@ static void
gdk_display_handle_global(struct wl_display *display, uint32_t id,
const char *interface, uint32_t version, void *data)
{
GdkDisplayWayland *display_wayland = data;
GdkWaylandDisplay *display_wayland = data;
GdkDisplay *gdk_display = GDK_DISPLAY_OBJECT (data);
struct wl_input_device *input;
@@ -145,18 +147,19 @@ gdk_display_handle_global(struct wl_display *display, uint32_t id,
}
}
#ifdef GDK_WAYLAND_USE_EGL
static gboolean
gdk_display_init_egl(GdkDisplay *display)
{
GdkDisplayWayland *display_wayland = GDK_DISPLAY_WAYLAND (display);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
EGLint major, minor, i;
void *p;
static const struct { const char *f; unsigned int offset; }
extension_functions[] = {
{ "glEGLImageTargetTexture2DOES", offsetof(GdkDisplayWayland, image_target_texture_2d) },
{ "eglCreateImageKHR", offsetof(GdkDisplayWayland, create_image) },
{ "eglDestroyImageKHR", offsetof(GdkDisplayWayland, destroy_image) }
{ "glEGLImageTargetTexture2DOES", offsetof(GdkWaylandDisplay, image_target_texture_2d) },
{ "eglCreateImageKHR", offsetof(GdkWaylandDisplay, create_image) },
{ "eglDestroyImageKHR", offsetof(GdkWaylandDisplay, destroy_image) }
};
display_wayland->egl_display =
@@ -200,20 +203,21 @@ gdk_display_init_egl(GdkDisplay *display)
return TRUE;
}
#endif
GdkDisplay *
_gdk_wayland_display_open (const gchar *display_name)
{
struct wl_display *wl_display;
GdkDisplay *display;
GdkDisplayWayland *display_wayland;
GdkWaylandDisplay *display_wayland;
wl_display = wl_display_connect(display_name);
if (!wl_display)
return NULL;
display = g_object_new (GDK_TYPE_DISPLAY_WAYLAND, NULL);
display_wayland = GDK_DISPLAY_WAYLAND (display);
display = g_object_new (GDK_TYPE_WAYLAND_DISPLAY, NULL);
display_wayland = GDK_WAYLAND_DISPLAY (display);
display_wayland->wl_display = wl_display;
@@ -225,7 +229,12 @@ _gdk_wayland_display_open (const gchar *display_name)
wl_display_add_global_listener(display_wayland->wl_display,
gdk_display_handle_global, display_wayland);
#ifdef GDK_WAYLAND_USE_EGL
gdk_display_init_egl(display);
#else
wl_display_iterate(wl_display, WL_DISPLAY_READABLE);
wl_display_roundtrip(wl_display);
#endif
display_wayland->event_source =
_gdk_wayland_display_event_source_new (display);
@@ -241,7 +250,7 @@ _gdk_wayland_display_open (const gchar *display_name)
static void
gdk_wayland_display_dispose (GObject *object)
{
GdkDisplayWayland *display_wayland = GDK_DISPLAY_WAYLAND (object);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (object);
_gdk_wayland_display_manager_remove_display (gdk_display_manager_get (),
GDK_DISPLAY (display_wayland));
@@ -257,15 +266,17 @@ gdk_wayland_display_dispose (GObject *object)
display_wayland->event_source = NULL;
}
#ifdef GDK_WAYLAND_USE_EGL
eglTerminate(display_wayland->egl_display);
#endif
G_OBJECT_CLASS (_gdk_display_wayland_parent_class)->dispose (object);
G_OBJECT_CLASS (_gdk_wayland_display_parent_class)->dispose (object);
}
static void
gdk_wayland_display_finalize (GObject *object)
{
GdkDisplayWayland *display_wayland = GDK_DISPLAY_WAYLAND (object);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (object);
/* Keymap */
if (display_wayland->keymap)
@@ -278,7 +289,7 @@ gdk_wayland_display_finalize (GObject *object)
g_free (display_wayland->startup_notification_id);
G_OBJECT_CLASS (_gdk_display_wayland_parent_class)->finalize (object);
G_OBJECT_CLASS (_gdk_wayland_display_parent_class)->finalize (object);
}
static const gchar *
@@ -300,7 +311,7 @@ gdk_wayland_display_get_screen (GdkDisplay *display,
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
g_return_val_if_fail (screen_num == 0, NULL);
return GDK_DISPLAY_WAYLAND (display)->screen;
return GDK_WAYLAND_DISPLAY (display)->screen;
}
static GdkScreen *
@@ -308,7 +319,7 @@ gdk_wayland_display_get_default_screen (GdkDisplay *display)
{
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
return GDK_DISPLAY_WAYLAND (display)->screen;
return GDK_WAYLAND_DISPLAY (display)->screen;
}
static void
@@ -320,11 +331,11 @@ gdk_wayland_display_beep (GdkDisplay *display)
static void
gdk_wayland_display_sync (GdkDisplay *display)
{
GdkDisplayWayland *display_wayland;
GdkWaylandDisplay *display_wayland;
g_return_if_fail (GDK_IS_DISPLAY (display));
display_wayland = GDK_DISPLAY_WAYLAND (display);
display_wayland = GDK_WAYLAND_DISPLAY (display);
wl_display_roundtrip(display_wayland->wl_display);
}
@@ -336,7 +347,7 @@ gdk_wayland_display_flush (GdkDisplay *display)
if (!display->closed)
_gdk_wayland_display_flush (display,
GDK_DISPLAY_WAYLAND (display)->event_source);
GDK_WAYLAND_DISPLAY (display)->event_source);
}
static gboolean
@@ -406,7 +417,7 @@ gdk_wayland_display_list_devices (GdkDisplay *display)
{
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
return GDK_DISPLAY_WAYLAND (display)->input_devices;
return GDK_WAYLAND_DISPLAY (display)->input_devices;
}
static void
@@ -520,10 +531,10 @@ gdk_wayland_display_event_data_free (GdkDisplay *display,
static GdkKeymap *
gdk_wayland_display_get_keymap (GdkDisplay *display)
{
GdkDisplayWayland *display_wayland;
GdkWaylandDisplay *display_wayland;
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
display_wayland = GDK_DISPLAY_WAYLAND (display);
display_wayland = GDK_WAYLAND_DISPLAY (display);
if (!display_wayland->keymap)
display_wayland->keymap = _gdk_wayland_keymap_new (display);
@@ -544,7 +555,7 @@ gdk_wayland_display_pop_error_trap (GdkDisplay *display,
}
static void
_gdk_display_wayland_class_init (GdkDisplayWaylandClass * class)
_gdk_wayland_display_class_init (GdkWaylandDisplayClass * class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
GdkDisplayClass *display_class = GDK_DISPLAY_CLASS (class);
@@ -599,7 +610,7 @@ _gdk_display_wayland_class_init (GdkDisplayWaylandClass * class)
}
static void
_gdk_display_wayland_init (GdkDisplayWayland *display)
_gdk_wayland_display_init (GdkWaylandDisplay *display)
{
_gdk_wayland_display_manager_add_display (gdk_display_manager_get (),
GDK_DISPLAY (display));
+24 -14
View File
@@ -19,17 +19,22 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GDK_DISPLAY_WAYLAND__
#define __GDK_DISPLAY_WAYLAND__
#ifndef __GDK_WAYLAND_DISPLAY__
#define __GDK_WAYLAND_DISPLAY__
#include <config.h>
#include <stdint.h>
#include <wayland-client.h>
#ifdef GDK_WAYLAND_USE_EGL
#include <wayland-egl.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GL/gl.h>
#include <GL/glext.h>
#include <cairo-gl.h>
#endif
#include <glib.h>
#include <gdk/gdkkeys.h>
#include <gdk/gdkwindow.h>
@@ -40,17 +45,17 @@
G_BEGIN_DECLS
typedef struct _GdkDisplayWayland GdkDisplayWayland;
typedef struct _GdkDisplayWaylandClass GdkDisplayWaylandClass;
typedef struct _GdkWaylandDisplay GdkWaylandDisplay;
typedef struct _GdkWaylandDisplayClass GdkWaylandDisplayClass;
#define GDK_TYPE_DISPLAY_WAYLAND (_gdk_display_wayland_get_type())
#define GDK_DISPLAY_WAYLAND(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DISPLAY_WAYLAND, GdkDisplayWayland))
#define GDK_DISPLAY_WAYLAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DISPLAY_WAYLAND, GdkDisplayWaylandClass))
#define GDK_IS_DISPLAY_WAYLAND(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DISPLAY_WAYLAND))
#define GDK_IS_DISPLAY_WAYLAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DISPLAY_WAYLAND))
#define GDK_DISPLAY_WAYLAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DISPLAY_WAYLAND, GdkDisplayWaylandClass))
#define GDK_TYPE_WAYLAND_DISPLAY (_gdk_wayland_display_get_type())
#define GDK_WAYLAND_DISPLAY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_DISPLAY, GdkWaylandDisplay))
#define GDK_WAYLAND_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WAYLAND_DISPLAY, GdkWaylandDisplayClass))
#define GDK_IS_WAYLAND_DISPLAY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_DISPLAY))
#define GDK_IS_WAYLAND_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WAYLAND_DISPLAY))
#define GDK_WAYLAND_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WAYLAND_DISPLAY, GdkWaylandDisplayClass))
struct _GdkDisplayWayland
struct _GdkWaylandDisplay
{
GdkDisplay parent_instance;
GdkScreen *screen;
@@ -76,24 +81,29 @@ struct _GdkDisplayWayland
struct wl_input_device *input_device;
struct wl_data_device_manager *data_device_manager;
GSource *event_source;
#ifdef GDK_WAYLAND_USE_EGL
EGLDisplay egl_display;
EGLContext egl_context;
cairo_device_t *cairo_device;
#endif
GdkCursor **cursors;
#ifdef GDK_WAYLAND_USE_EGL
PFNGLEGLIMAGETARGETTEXTURE2DOESPROC image_target_texture_2d;
PFNEGLCREATEIMAGEKHRPROC create_image;
PFNEGLDESTROYIMAGEKHRPROC destroy_image;
#endif
};
struct _GdkDisplayWaylandClass
struct _GdkWaylandDisplayClass
{
GdkDisplayClass parent_class;
};
GType _gdk_display_wayland_get_type (void);
GType _gdk_wayland_display_get_type (void);
G_END_DECLS
#endif /* __GDK_DISPLAY_WAYLAND__ */
#endif /* __GDK_WAYLAND_DISPLAY__ */
+1 -11
View File
@@ -24,21 +24,11 @@
#include "gdkdisplaymanagerprivate.h"
#include "gdkdisplay-wayland.h"
#include "gdkprivate-wayland.h"
#include "gdkwayland.h"
#include "gdkinternals.h"
#include <X11/extensions/XKBcommon.h>
typedef struct _GdkWaylandDisplayManager GdkWaylandDisplayManager;
typedef struct _GdkWaylandDisplayManagerClass GdkWaylandDisplayManagerClass;
#define GDK_TYPE_WAYLAND_DISPLAY_MANAGER (gdk_wayland_display_manager_get_type())
#define GDK_WAYLAND_DISPLAY_MANAGER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_DISPLAY_MANAGER, GdkWaylandDisplayManager))
#define GDK_WAYLAND_DISPLAY_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WAYLAND_DISPLAY_MANAGER, GdkWaylandDisplayManagerClass))
#define GDK_IS_WAYLAND_DISPLAY_MANAGER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_DISPLAY_MANAGER))
#define GDK_IS_WAYLAND_DISPLAY_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WAYLAND_DISPLAY_MANAGER))
#define GDK_WAYLAND_DISPLAY_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WAYLAND_DISPLAY_MANAGER, GdkWaylandDisplayManagerClass))
struct _GdkWaylandDisplayManager
{
GdkDisplayManager parent;
+6 -6
View File
@@ -33,7 +33,7 @@ static gboolean
gdk_event_source_prepare(GSource *base, gint *timeout)
{
GdkWaylandEventSource *source = (GdkWaylandEventSource *) base;
GdkDisplayWayland *display = (GdkDisplayWayland *) source->display;
GdkWaylandDisplay *display = (GdkWaylandDisplay *) source->display;
*timeout = -1;
@@ -122,7 +122,7 @@ _gdk_wayland_display_event_source_new (GdkDisplay *display)
{
GSource *source;
GdkWaylandEventSource *wl_source;
GdkDisplayWayland *display_wayland;
GdkWaylandDisplay *display_wayland;
char *name;
source = g_source_new (&wl_glib_source_funcs,
@@ -132,7 +132,7 @@ _gdk_wayland_display_event_source_new (GdkDisplay *display)
g_free (name);
wl_source = (GdkWaylandEventSource *) source;
display_wayland = GDK_DISPLAY_WAYLAND (display);
display_wayland = GDK_WAYLAND_DISPLAY (display);
wl_source->display = display;
wl_source->pfd.fd = wl_display_get_fd(display_wayland->wl_display,
gdk_event_source_update, source);
@@ -154,17 +154,17 @@ _gdk_wayland_display_flush (GdkDisplay *display, GSource *source)
GdkWaylandEventSource *wayland_source = (GdkWaylandEventSource *) source;
while (wayland_source->mask & WL_DISPLAY_WRITABLE)
wl_display_iterate(GDK_DISPLAY_WAYLAND (display)->wl_display,
wl_display_iterate(GDK_WAYLAND_DISPLAY (display)->wl_display,
WL_DISPLAY_WRITABLE);
}
void
_gdk_wayland_display_queue_events (GdkDisplay *display)
{
GdkDisplayWayland *display_wayland;
GdkWaylandDisplay *display_wayland;
GdkWaylandEventSource *source;
display_wayland = GDK_DISPLAY_WAYLAND (display);
display_wayland = GDK_WAYLAND_DISPLAY (display);
source = (GdkWaylandEventSource *) display_wayland->event_source;
if (source->pfd.revents)
+43 -43
View File
@@ -28,19 +28,19 @@
#include "gdkwayland.h"
#include "gdkprivate-wayland.h"
typedef struct _GdkScreenWayland GdkScreenWayland;
typedef struct _GdkScreenWaylandClass GdkScreenWaylandClass;
typedef struct _GdkWaylandScreen GdkWaylandScreen;
typedef struct _GdkWaylandScreenClass GdkWaylandScreenClass;
#define GDK_TYPE_SCREEN_WAYLAND (_gdk_screen_wayland_get_type ())
#define GDK_SCREEN_WAYLAND(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SCREEN_WAYLAND, GdkScreenWayland))
#define GDK_SCREEN_WAYLAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SCREEN_WAYLAND, GdkScreenWaylandClass))
#define GDK_IS_SCREEN_WAYLAND(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SCREEN_WAYLAND))
#define GDK_IS_SCREEN_WAYLAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SCREEN_WAYLAND))
#define GDK_SCREEN_WAYLAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SCREEN_WAYLAND, GdkScreenWaylandClass))
#define GDK_TYPE_WAYLAND_SCREEN (_gdk_wayland_screen_get_type ())
#define GDK_WAYLAND_SCREEN(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_SCREEN, GdkWaylandScreen))
#define GDK_WAYLAND_SCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WAYLAND_SCREEN, GdkWaylandScreenClass))
#define GDK_IS_WAYLAND_SCREEN(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_SCREEN))
#define GDK_IS_WAYLAND_SCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WAYLAND_SCREEN))
#define GDK_WAYLAND_SCREEN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WAYLAND_SCREEN, GdkWaylandScreenClass))
typedef struct _GdkWaylandMonitor GdkWaylandMonitor;
struct _GdkScreenWayland
struct _GdkWaylandScreen
{
GdkScreen parent_instance;
@@ -59,11 +59,11 @@ struct _GdkScreenWayland
gint primary_monitor;
};
struct _GdkScreenWaylandClass
struct _GdkWaylandScreenClass
{
GdkScreenClass parent_class;
void (* window_manager_changed) (GdkScreenWayland *screen_wayland);
void (* window_manager_changed) (GdkWaylandScreen *screen_wayland);
};
struct _GdkWaylandMonitor
@@ -75,7 +75,7 @@ struct _GdkWaylandMonitor
char * manufacturer;
};
G_DEFINE_TYPE (GdkScreenWayland, _gdk_screen_wayland, GDK_TYPE_SCREEN)
G_DEFINE_TYPE (GdkWaylandScreen, _gdk_wayland_screen, GDK_TYPE_SCREEN)
static void
init_monitor_geometry (GdkWaylandMonitor *monitor,
@@ -110,7 +110,7 @@ free_monitors (GdkWaylandMonitor *monitors,
static void
deinit_multihead (GdkScreen *screen)
{
GdkScreenWayland *screen_wayland = GDK_SCREEN_WAYLAND (screen);
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
free_monitors (screen_wayland->monitors, screen_wayland->n_monitors);
@@ -121,7 +121,7 @@ deinit_multihead (GdkScreen *screen)
static void
init_multihead (GdkScreen *screen)
{
GdkScreenWayland *screen_wayland = GDK_SCREEN_WAYLAND (screen);
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
/* No multihead support of any kind for this screen */
screen_wayland->n_monitors = 1;
@@ -135,18 +135,18 @@ init_multihead (GdkScreen *screen)
static void
gdk_wayland_screen_dispose (GObject *object)
{
GdkScreenWayland *screen_wayland = GDK_SCREEN_WAYLAND (object);
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (object);
if (screen_wayland->root_window)
_gdk_window_destroy (screen_wayland->root_window, TRUE);
G_OBJECT_CLASS (_gdk_screen_wayland_parent_class)->dispose (object);
G_OBJECT_CLASS (_gdk_wayland_screen_parent_class)->dispose (object);
}
static void
gdk_wayland_screen_finalize (GObject *object)
{
GdkScreenWayland *screen_wayland = GDK_SCREEN_WAYLAND (object);
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (object);
if (screen_wayland->root_window)
g_object_unref (screen_wayland->root_window);
@@ -155,37 +155,37 @@ gdk_wayland_screen_finalize (GObject *object)
deinit_multihead (GDK_SCREEN (object));
G_OBJECT_CLASS (_gdk_screen_wayland_parent_class)->finalize (object);
G_OBJECT_CLASS (_gdk_wayland_screen_parent_class)->finalize (object);
}
static GdkDisplay *
gdk_wayland_screen_get_display (GdkScreen *screen)
{
return GDK_SCREEN_WAYLAND (screen)->display;
return GDK_WAYLAND_SCREEN (screen)->display;
}
static gint
gdk_wayland_screen_get_width (GdkScreen *screen)
{
return GDK_SCREEN_WAYLAND (screen)->width;
return GDK_WAYLAND_SCREEN (screen)->width;
}
static gint
gdk_wayland_screen_get_height (GdkScreen *screen)
{
return GDK_SCREEN_WAYLAND (screen)->height;
return GDK_WAYLAND_SCREEN (screen)->height;
}
static gint
gdk_wayland_screen_get_width_mm (GdkScreen *screen)
{
return GDK_SCREEN_WAYLAND (screen)->width_mm;
return GDK_WAYLAND_SCREEN (screen)->width_mm;
}
static gint
gdk_wayland_screen_get_height_mm (GdkScreen *screen)
{
return GDK_SCREEN_WAYLAND (screen)->height_mm;
return GDK_WAYLAND_SCREEN (screen)->height_mm;
}
static gint
@@ -197,26 +197,26 @@ gdk_wayland_screen_get_number (GdkScreen *screen)
static GdkWindow *
gdk_wayland_screen_get_root_window (GdkScreen *screen)
{
return GDK_SCREEN_WAYLAND (screen)->root_window;
return GDK_WAYLAND_SCREEN (screen)->root_window;
}
static gint
gdk_wayland_screen_get_n_monitors (GdkScreen *screen)
{
return GDK_SCREEN_WAYLAND (screen)->n_monitors;
return GDK_WAYLAND_SCREEN (screen)->n_monitors;
}
static gint
gdk_wayland_screen_get_primary_monitor (GdkScreen *screen)
{
return GDK_SCREEN_WAYLAND (screen)->primary_monitor;
return GDK_WAYLAND_SCREEN (screen)->primary_monitor;
}
static gint
gdk_wayland_screen_get_monitor_width_mm (GdkScreen *screen,
gint monitor_num)
{
GdkScreenWayland *screen_wayland = GDK_SCREEN_WAYLAND (screen);
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
return screen_wayland->monitors[monitor_num].width_mm;
}
@@ -225,7 +225,7 @@ static gint
gdk_wayland_screen_get_monitor_height_mm (GdkScreen *screen,
gint monitor_num)
{
GdkScreenWayland *screen_wayland = GDK_SCREEN_WAYLAND (screen);
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
return screen_wayland->monitors[monitor_num].height_mm;
}
@@ -234,7 +234,7 @@ static gchar *
gdk_wayland_screen_get_monitor_plug_name (GdkScreen *screen,
gint monitor_num)
{
GdkScreenWayland *screen_wayland = GDK_SCREEN_WAYLAND (screen);
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
return g_strdup (screen_wayland->monitors[monitor_num].output_name);
}
@@ -244,7 +244,7 @@ gdk_wayland_screen_get_monitor_geometry (GdkScreen *screen,
gint monitor_num,
GdkRectangle *dest)
{
GdkScreenWayland *screen_wayland = GDK_SCREEN_WAYLAND (screen);
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
if (dest)
*dest = screen_wayland->monitors[monitor_num].geometry;
@@ -253,13 +253,13 @@ gdk_wayland_screen_get_monitor_geometry (GdkScreen *screen,
static GdkVisual *
gdk_wayland_screen_get_system_visual (GdkScreen * screen)
{
return (GdkVisual *) GDK_SCREEN_WAYLAND (screen)->visual;
return (GdkVisual *) GDK_WAYLAND_SCREEN (screen)->visual;
}
static GdkVisual *
gdk_wayland_screen_get_rgba_visual (GdkScreen *screen)
{
return (GdkVisual *) GDK_SCREEN_WAYLAND (screen)->visual;
return (GdkVisual *) GDK_WAYLAND_SCREEN (screen)->visual;
}
static gboolean
@@ -340,21 +340,21 @@ gdk_wayland_screen_visual_get_best_type (GdkScreen *screen)
static GdkVisual*
gdk_wayland_screen_visual_get_best (GdkScreen *screen)
{
return GDK_SCREEN_WAYLAND (screen)->visual;
return GDK_WAYLAND_SCREEN (screen)->visual;
}
static GdkVisual*
gdk_wayland_screen_visual_get_best_with_depth (GdkScreen *screen,
gint depth)
{
return GDK_SCREEN_WAYLAND (screen)->visual;
return GDK_WAYLAND_SCREEN (screen)->visual;
}
static GdkVisual*
gdk_wayland_screen_visual_get_best_with_type (GdkScreen *screen,
GdkVisualType visual_type)
{
return GDK_SCREEN_WAYLAND (screen)->visual;
return GDK_WAYLAND_SCREEN (screen)->visual;
}
static GdkVisual*
@@ -362,7 +362,7 @@ gdk_wayland_screen_visual_get_best_with_both (GdkScreen *screen,
gint depth,
GdkVisualType visual_type)
{
return GDK_SCREEN_WAYLAND (screen)->visual;
return GDK_WAYLAND_SCREEN (screen)->visual;
}
static void
@@ -391,10 +391,10 @@ static GList *
gdk_wayland_screen_list_visuals (GdkScreen *screen)
{
GList *list;
GdkScreenWayland *screen_wayland;
GdkWaylandScreen *screen_wayland;
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
screen_wayland = GDK_SCREEN_WAYLAND (screen);
screen_wayland = GDK_WAYLAND_SCREEN (screen);
list = g_list_append (NULL, screen_wayland->visual);
@@ -421,11 +421,11 @@ GdkScreen *
_gdk_wayland_screen_new (GdkDisplay *display)
{
GdkScreen *screen;
GdkScreenWayland *screen_wayland;
GdkWaylandScreen *screen_wayland;
screen = g_object_new (GDK_TYPE_SCREEN_WAYLAND, NULL);
screen = g_object_new (GDK_TYPE_WAYLAND_SCREEN, NULL);
screen_wayland = GDK_SCREEN_WAYLAND (screen);
screen_wayland = GDK_WAYLAND_SCREEN (screen);
screen_wayland->display = display;
screen_wayland->width = 8192;
screen_wayland->height = 8192;
@@ -443,7 +443,7 @@ _gdk_wayland_screen_new (GdkDisplay *display)
}
static void
_gdk_screen_wayland_class_init (GdkScreenWaylandClass *klass)
_gdk_wayland_screen_class_init (GdkWaylandScreenClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GdkScreenClass *screen_class = GDK_SCREEN_CLASS (klass);
@@ -485,6 +485,6 @@ _gdk_screen_wayland_class_init (GdkScreenWaylandClass *klass)
}
static void
_gdk_screen_wayland_init (GdkScreenWayland *screen_wayland)
_gdk_wayland_screen_init (GdkWaylandScreen *screen_wayland)
{
}
+10
View File
@@ -29,6 +29,16 @@
G_BEGIN_DECLS
typedef struct _GdkWaylandDisplayManager GdkWaylandDisplayManager;
typedef struct _GdkWaylandDisplayManagerClass GdkWaylandDisplayManagerClass;
#define GDK_TYPE_WAYLAND_DISPLAY_MANAGER (gdk_wayland_display_manager_get_type())
#define GDK_WAYLAND_DISPLAY_MANAGER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_DISPLAY_MANAGER, GdkWaylandDisplayManager))
#define GDK_WAYLAND_DISPLAY_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WAYLAND_DISPLAY_MANAGER, GdkWaylandDisplayManagerClass))
#define GDK_IS_WAYLAND_DISPLAY_MANAGER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_DISPLAY_MANAGER))
#define GDK_IS_WAYLAND_DISPLAY_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WAYLAND_DISPLAY_MANAGER))
#define GDK_WAYLAND_DISPLAY_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WAYLAND_DISPLAY_MANAGER, GdkWaylandDisplayManagerClass))
GType gdk_wayland_display_manager_get_type (void);
#if defined (GTK_COMPILATION) || defined (GDK_COMPILATION)
+206 -62
View File
@@ -33,6 +33,8 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/mman.h>
#include <errno.h>
#include <wayland-egl.h>
@@ -113,7 +115,6 @@ struct _GdkWindowImplWayland
*/
cairo_surface_t *server_surface;
GLuint texture;
uint32_t resize_edges;
int focus_count;
@@ -301,11 +302,16 @@ _gdk_wayland_display_create_window_impl (GdkDisplay *display,
static const cairo_user_data_key_t gdk_wayland_cairo_key;
typedef struct _GdkWaylandCairoSurfaceData {
#ifdef GDK_WAYLAND_USE_EGL
EGLImageKHR image;
GLuint texture;
struct wl_egl_pixmap *pixmap;
#else
gpointer buf;
size_t buf_length;
#endif
struct wl_buffer *buffer;
GdkDisplayWayland *display;
GdkWaylandDisplay *display;
int32_t width, height;
} GdkWaylandCairoSurfaceData;
@@ -352,9 +358,6 @@ gdk_wayland_window_attach_image (GdkWindow *window)
/* Get a Wayland buffer from this new surface */
data = cairo_surface_get_user_data (impl->cairo_surface,
&gdk_wayland_cairo_key);
if (!data->buffer)
data->buffer =
wl_egl_pixmap_create_buffer(data->pixmap);
if (impl->resize_edges & WL_SHELL_SURFACE_RESIZE_LEFT)
dx = server_width - data->width;
@@ -370,23 +373,7 @@ gdk_wayland_window_attach_image (GdkWindow *window)
wl_surface_attach (impl->surface, data->buffer, dx, dy);
}
static void
gdk_window_impl_wayland_finalize (GObject *object)
{
GdkWindowImplWayland *impl;
g_return_if_fail (GDK_IS_WINDOW_IMPL_WAYLAND (object));
impl = GDK_WINDOW_IMPL_WAYLAND (object);
if (impl->cursor)
g_object_unref (impl->cursor);
if (impl->server_surface)
cairo_surface_destroy (impl->server_surface);
G_OBJECT_CLASS (_gdk_window_impl_wayland_parent_class)->finalize (object);
}
#ifdef GDK_WAYLAND_USE_EGL
static void
gdk_wayland_cairo_surface_destroy (void *p)
{
@@ -402,11 +389,12 @@ gdk_wayland_cairo_surface_destroy (void *p)
}
static cairo_surface_t *
gdk_wayland_create_cairo_surface (GdkDisplayWayland *display,
gdk_wayland_create_cairo_surface (GdkWaylandDisplay *display,
int width, int height)
{
GdkWaylandCairoSurfaceData *data;
cairo_surface_t *surface;
cairo_status_t status;
data = g_new (GdkWaylandCairoSurfaceData, 1);
data->display = display;
@@ -431,11 +419,122 @@ gdk_wayland_create_cairo_surface (GdkDisplayWayland *display,
cairo_surface_set_user_data (surface, &gdk_wayland_cairo_key,
data, gdk_wayland_cairo_surface_destroy);
if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS)
fprintf (stderr, "create gl surface failed\n");
status = cairo_surface_status (surface);
if (status != CAIRO_STATUS_SUCCESS)
{
g_critical (G_STRLOC ": Unable to create Cairo GL surface: %s",
cairo_status_to_string (status));
}
if (!data->buffer)
data->buffer =
wl_egl_pixmap_create_buffer(data->pixmap);
return surface;
}
#else
static struct wl_buffer *
create_shm_buffer (struct wl_shm *shm,
int width,
int height,
uint32_t format,
size_t *buf_length,
void **data_out)
{
char filename[] = "/tmp/wayland-shm-XXXXXX";
struct wl_buffer *buffer;
int fd, size, stride;
void *data;
fd = mkstemp (filename);
if (fd < 0) {
g_critical (G_STRLOC ": Unable to create temporary file (%s): %s",
filename, g_strerror (errno));
return NULL;
}
stride = width * 4;
size = stride * height;
if (ftruncate (fd, size) < 0) {
g_critical (G_STRLOC ": Truncating temporary file failed: %s",
g_strerror (errno));
close(fd);
return NULL;
}
data = mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
unlink (filename);
if (data == MAP_FAILED) {
g_critical (G_STRLOC ": mmap'ping temporary file failed: %s",
g_strerror (errno));
close(fd);
return NULL;
}
buffer = wl_shm_create_buffer (shm, fd,
width, height,
stride, format);
close (fd);
*data_out = data;
*buf_length = size;
return buffer;
}
static void
gdk_wayland_cairo_surface_destroy (void *p)
{
GdkWaylandCairoSurfaceData *data = p;
if (data->buffer)
wl_buffer_destroy (data->buffer);
munmap (data->buf, data->buf_length);
g_free (data);
}
static cairo_surface_t *
gdk_wayland_create_cairo_surface (GdkWaylandDisplay *display,
int width, int height)
{
GdkWaylandCairoSurfaceData *data;
cairo_surface_t *surface = NULL;
cairo_status_t status;
data = g_new (GdkWaylandCairoSurfaceData, 1);
data->display = display;
data->buffer = NULL;
data->width = width;
data->height = height;
data->buffer = create_shm_buffer (display->shm,
width,
height,
WL_SHM_FORMAT_ARGB8888,
&data->buf_length,
&data->buf);
surface = cairo_image_surface_create_for_data (data->buf,
CAIRO_FORMAT_ARGB32,
width,
height,
width * 4);
cairo_surface_set_user_data (surface, &gdk_wayland_cairo_key,
data, gdk_wayland_cairo_surface_destroy);
status = cairo_surface_status (surface);
if (status != CAIRO_STATUS_SUCCESS)
{
g_critical (G_STRLOC ": Unable to create Cairo image surface: %s",
cairo_status_to_string (status));
}
return surface;
}
#endif
/* On this first call this creates a double reference - the first reference
* is held by the GdkWindowImplWayland struct - since unlike other backends
@@ -446,8 +545,8 @@ static cairo_surface_t *
gdk_wayland_window_ref_cairo_surface (GdkWindow *window)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
GdkDisplayWayland *display_wayland =
GDK_DISPLAY_WAYLAND (gdk_window_get_display (impl->wrapper));
GdkWaylandDisplay *display_wayland =
GDK_WAYLAND_DISPLAY (gdk_window_get_display (impl->wrapper));
if (GDK_WINDOW_DESTROYED (impl->wrapper))
return NULL;
@@ -465,6 +564,24 @@ gdk_wayland_window_ref_cairo_surface (GdkWindow *window)
return impl->cairo_surface;
}
static void
gdk_window_impl_wayland_finalize (GObject *object)
{
GdkWindowImplWayland *impl;
g_return_if_fail (GDK_IS_WINDOW_IMPL_WAYLAND (object));
impl = GDK_WINDOW_IMPL_WAYLAND (object);
if (impl->cursor)
g_object_unref (impl->cursor);
if (impl->server_surface)
cairo_surface_destroy (impl->server_surface);
G_OBJECT_CLASS (_gdk_window_impl_wayland_parent_class)->finalize (object);
}
static void
gdk_wayland_window_configure (GdkWindow *window,
int width, int height, int edges)
@@ -577,12 +694,12 @@ static void
gdk_wayland_window_show (GdkWindow *window, gboolean already_mapped)
{
GdkDisplay *display;
GdkDisplayWayland *display_wayland;
GdkWaylandDisplay *display_wayland;
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
GdkEvent *event;
display = gdk_window_get_display (window);
display_wayland = GDK_DISPLAY_WAYLAND (display);
display_wayland = GDK_WAYLAND_DISPLAY (display);
if (impl->user_time != 0 &&
display_wayland->user_time != 0 &&
@@ -691,14 +808,17 @@ gdk_window_wayland_restack_toplevel (GdkWindow *window,
static void
gdk_window_wayland_move_resize (GdkWindow *window,
gboolean with_move,
gint x,
gint y,
gint width,
gint height)
gboolean with_move,
gint x,
gint y,
gint width,
gint height)
{
window->x = x;
window->y = y;
if (with_move)
{
window->x = x;
window->y = y;
}
/* If this function is called with width and height = -1 then that means
* just move the window - don't update its size
@@ -754,6 +874,32 @@ gdk_window_wayland_get_geometry (GdkWindow *window,
}
}
void
_gdk_wayland_window_offset (GdkWindow *window,
gint *x_out,
gint *y_out)
{
GdkWindowImplWayland *impl, *parent_impl;
GdkWindow *parent_window;
gint x_offset = 0, y_offset = 0;
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
parent_window = impl->transient_for;
while (parent_window)
{
parent_impl = GDK_WINDOW_IMPL_WAYLAND (parent_window->impl);
x_offset += window->x;
y_offset += window->y;
parent_window = parent_impl->transient_for;
}
*x_out = x_offset;
*y_out = y_offset;
}
static gint
gdk_window_wayland_get_root_coords (GdkWindow *window,
gint x,
@@ -761,11 +907,12 @@ gdk_window_wayland_get_root_coords (GdkWindow *window,
gint *root_x,
gint *root_y)
{
/* We can't do this. */
if (root_x)
*root_x = 0;
if (root_y)
*root_y = 0;
gint x_offset, y_offset;
_gdk_wayland_window_offset (window, &x_offset, &y_offset);
*root_x = x_offset + x;
*root_y = y_offset + y;
return 1;
}
@@ -833,21 +980,7 @@ gdk_wayland_window_translate (GdkWindow *window,
gint dx,
gint dy)
{
cairo_surface_t *surface;
cairo_t *cr;
surface = gdk_wayland_window_ref_cairo_surface (window->impl_window);
cr = cairo_create (surface);
cairo_surface_destroy (surface);
gdk_cairo_region (cr, area);
cairo_clip (cr);
cairo_set_source_surface (cr, cairo_get_target (cr), dx, dy);
cairo_push_group (cr);
cairo_paint (cr);
cairo_pop_group_to_source (cr);
cairo_paint (cr);
cairo_destroy (cr);
_gdk_window_invalidate_for_expose (window, area);
}
static void
@@ -866,9 +999,6 @@ gdk_wayland_window_destroy (GdkWindow *window,
NULL, NULL);
}
if (impl->texture)
glDeleteTextures(1, &impl->texture);
if (!recursing && !foreign_destroy)
{
if (GDK_WINDOW_IMPL_WAYLAND (window->impl)->surface)
@@ -1362,10 +1492,13 @@ gdk_wayland_window_destroy_notify (GdkWindow *window)
}
static void
gdk_wayland_window_process_updates_recurse (GdkWindow *window,
cairo_region_t *region)
gdk_wayland_window_process_updates_recurse (GdkWindow *window,
cairo_region_t *region)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
#ifndef GDK_WAYLAND_USE_EGL
GdkWaylandCairoSurfaceData *data = NULL;
#endif
cairo_rectangle_int_t rect;
int i, n;
@@ -1374,12 +1507,23 @@ gdk_wayland_window_process_updates_recurse (GdkWindow *window,
if (impl->cairo_surface)
gdk_wayland_window_attach_image (window);
#ifndef GDK_WAYLAND_USE_EGL
if (impl->server_surface)
data = cairo_surface_get_user_data (impl->server_surface,
&gdk_wayland_cairo_key);
#endif
n = cairo_region_num_rectangles(region);
for (i = 0; i < n; i++)
{
cairo_region_get_rectangle (region, i, &rect);
#ifndef GDK_WAYLAND_USE_EGL
if (data && data->buffer)
wl_buffer_damage (data->buffer,
rect.x, rect.y, rect.width, rect.height);
#endif
wl_surface_damage (impl->surface,
rect.x, rect.y, rect.width, rect.height);
rect.x, rect.y, rect.width, rect.height);
}
_gdk_window_process_updates_recurse (window, region);
+2
View File
@@ -29,6 +29,8 @@ libgdk_win32_la_SOURCES = \
gdkcursor-win32.c \
gdkdevicemanager-win32.c \
gdkdevicemanager-win32.h \
gdkdevice-virtual.c \
gdkdevice-virtual.h \
gdkdevice-win32.c \
gdkdevice-win32.h \
gdkdevice-wintab.c \
+429
View File
@@ -0,0 +1,429 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2009 Carlos Garnacho <carlosg@gnome.org>
*
* 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/>.
*/
#include "config.h"
#include <gdk/gdkwindow.h>
#include <windowsx.h>
#include <objbase.h>
#include "gdkdisplayprivate.h"
#include "gdkdevice-virtual.h"
#include "gdkwin32.h"
static gboolean gdk_device_virtual_get_history (GdkDevice *device,
GdkWindow *window,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
gint *n_events);
static void gdk_device_virtual_get_state (GdkDevice *device,
GdkWindow *window,
gdouble *axes,
GdkModifierType *mask);
static void gdk_device_virtual_set_window_cursor (GdkDevice *device,
GdkWindow *window,
GdkCursor *cursor);
static void gdk_device_virtual_warp (GdkDevice *device,
GdkScreen *screen,
gint x,
gint y);
static void gdk_device_virtual_query_state (GdkDevice *device,
GdkWindow *window,
GdkWindow **root_window,
GdkWindow **child_window,
gint *root_x,
gint *root_y,
gint *win_x,
gint *win_y,
GdkModifierType *mask);
static GdkGrabStatus gdk_device_virtual_grab (GdkDevice *device,
GdkWindow *window,
gboolean owner_events,
GdkEventMask event_mask,
GdkWindow *confine_to,
GdkCursor *cursor,
guint32 time_);
static void gdk_device_virtual_ungrab (GdkDevice *device,
guint32 time_);
static GdkWindow * gdk_device_virtual_window_at_position (GdkDevice *device,
gint *win_x,
gint *win_y,
GdkModifierType *mask,
gboolean get_toplevel);
static void gdk_device_virtual_select_window_events (GdkDevice *device,
GdkWindow *window,
GdkEventMask event_mask);
G_DEFINE_TYPE (GdkDeviceVirtual, gdk_device_virtual, GDK_TYPE_DEVICE)
static void
gdk_device_virtual_class_init (GdkDeviceVirtualClass *klass)
{
GdkDeviceClass *device_class = GDK_DEVICE_CLASS (klass);
device_class->get_history = gdk_device_virtual_get_history;
device_class->get_state = gdk_device_virtual_get_state;
device_class->set_window_cursor = gdk_device_virtual_set_window_cursor;
device_class->warp = gdk_device_virtual_warp;
device_class->query_state = gdk_device_virtual_query_state;
device_class->grab = gdk_device_virtual_grab;
device_class->ungrab = gdk_device_virtual_ungrab;
device_class->window_at_position = gdk_device_virtual_window_at_position;
device_class->select_window_events = gdk_device_virtual_select_window_events;
}
static void
gdk_device_virtual_init (GdkDeviceVirtual *device_virtual)
{
GdkDevice *device;
device = GDK_DEVICE (device_virtual);
}
void
_gdk_device_virtual_set_active (GdkDevice *device,
GdkDevice *new_active)
{
GdkDeviceVirtual *virtual = GDK_DEVICE_VIRTUAL (device);
int n_axes, i;
GdkAtom label_atom;
GdkAxisUse use;
gdouble min_value, max_value, resolution;
if (virtual->active_device == new_active)
return;
virtual->active_device = new_active;
if (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD)
{
_gdk_device_reset_axes (device);
n_axes = gdk_device_get_n_axes (new_active);
for (i = 0; i < n_axes; i++)
{
_gdk_device_get_axis_info (new_active, i,
&label_atom, &use,
&min_value, &max_value, &resolution);
_gdk_device_add_axis (device,
label_atom, use,
min_value, max_value, resolution);
}
}
g_signal_emit_by_name (G_OBJECT (device), "changed");
}
static gboolean
gdk_device_virtual_get_history (GdkDevice *device,
GdkWindow *window,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
gint *n_events)
{
/* History is only per slave device */
return FALSE;
}
static void
gdk_device_virtual_get_state (GdkDevice *device,
GdkWindow *window,
gdouble *axes,
GdkModifierType *mask)
{
GdkDeviceVirtual *virtual = GDK_DEVICE_VIRTUAL (device);
GdkDevice *active = virtual->active_device;
GDK_DEVICE_GET_CLASS (active)->get_state (active,
window, axes, mask);
}
static void
gdk_device_virtual_set_window_cursor (GdkDevice *device,
GdkWindow *window,
GdkCursor *cursor)
{
GdkWin32Cursor *cursor_private;
GdkWindow *parent_window;
GdkWindowImplWin32 *impl;
HCURSOR hcursor;
HCURSOR hprevcursor;
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
cursor_private = (GdkWin32Cursor*) cursor;
hprevcursor = impl->hcursor;
if (!cursor)
hcursor = NULL;
else
hcursor = cursor_private->hcursor;
if (hcursor != NULL)
{
/* If the pointer is over our window, set new cursor */
GdkWindow *curr_window = gdk_window_get_pointer (window, NULL, NULL, NULL);
if (curr_window == window ||
(curr_window && window == gdk_window_get_toplevel (curr_window)))
SetCursor (hcursor);
else
{
/* Climb up the tree and find whether our window is the
* first ancestor that has cursor defined, and if so, set
* new cursor.
*/
while (curr_window && curr_window->impl &&
!GDK_WINDOW_IMPL_WIN32 (curr_window->impl)->hcursor)
{
curr_window = curr_window->parent;
if (curr_window == GDK_WINDOW (window))
{
SetCursor (hcursor);
break;
}
}
}
}
/* Unset the previous cursor: Need to make sure it's no longer in
* use before we destroy it, in case we're not over our window but
* the cursor is still set to our old one.
*/
if (hprevcursor != NULL &&
GetCursor () == hprevcursor)
{
/* Look for a suitable cursor to use instead */
hcursor = NULL;
parent_window = GDK_WINDOW (window)->parent;
while (hcursor == NULL)
{
if (parent_window)
{
impl = GDK_WINDOW_IMPL_WIN32 (parent_window->impl);
hcursor = impl->hcursor;
parent_window = parent_window->parent;
}
else
hcursor = LoadCursor (NULL, IDC_ARROW);
}
SetCursor (hcursor);
}
}
static void
gdk_device_virtual_warp (GdkDevice *device,
GdkScreen *screen,
gint x,
gint y)
{
SetCursorPos (x - _gdk_offset_x, y - _gdk_offset_y);
}
static void
gdk_device_virtual_query_state (GdkDevice *device,
GdkWindow *window,
GdkWindow **root_window,
GdkWindow **child_window,
gint *root_x,
gint *root_y,
gint *win_x,
gint *win_y,
GdkModifierType *mask)
{
GdkDeviceVirtual *virtual = GDK_DEVICE_VIRTUAL (device);
_gdk_device_query_state (virtual->active_device,
window, root_window, child_window,
root_x, root_y,
win_x, win_y,
mask);
}
static GdkGrabStatus
gdk_device_virtual_grab (GdkDevice *device,
GdkWindow *window,
gboolean owner_events,
GdkEventMask event_mask,
GdkWindow *confine_to,
GdkCursor *cursor,
guint32 time_)
{
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
HCURSOR hcursor;
GdkWin32Cursor *cursor_private;
cursor_private = (GdkWin32Cursor*) cursor;
if (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD)
{
if (!cursor)
hcursor = NULL;
else if ((hcursor = CopyCursor (cursor_private->hcursor)) == NULL)
WIN32_API_FAILED ("CopyCursor");
if (_gdk_win32_grab_cursor != NULL)
{
if (GetCursor () == _gdk_win32_grab_cursor)
SetCursor (NULL);
DestroyCursor (_gdk_win32_grab_cursor);
}
_gdk_win32_grab_cursor = hcursor;
if (_gdk_win32_grab_cursor != NULL)
SetCursor (_gdk_win32_grab_cursor);
else if (impl->hcursor != NULL)
SetCursor (impl->hcursor);
else
SetCursor (LoadCursor (NULL, IDC_ARROW));
SetCapture (GDK_WINDOW_HWND (window));
}
return GDK_GRAB_SUCCESS;
}
static void
gdk_device_virtual_ungrab (GdkDevice *device,
guint32 time_)
{
GdkDeviceGrabInfo *info;
GdkDisplay *display;
display = gdk_device_get_display (device);
info = _gdk_display_get_last_device_grab (display, device);
if (info)
info->serial_end = 0;
if (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD)
{
if (_gdk_win32_grab_cursor != NULL)
{
if (GetCursor () == _gdk_win32_grab_cursor)
SetCursor (NULL);
DestroyCursor (_gdk_win32_grab_cursor);
}
_gdk_win32_grab_cursor = NULL;
ReleaseCapture ();
}
_gdk_display_device_grab_update (display, device, NULL, 0);
}
static void
screen_to_client (HWND hwnd, POINT screen_pt, POINT *client_pt)
{
*client_pt = screen_pt;
ScreenToClient (hwnd, client_pt);
}
static GdkWindow *
gdk_device_virtual_window_at_position (GdkDevice *device,
gint *win_x,
gint *win_y,
GdkModifierType *mask,
gboolean get_toplevel)
{
GdkWindow *window = NULL;
POINT screen_pt, client_pt;
HWND hwnd, hwndc;
RECT rect;
GetCursorPos (&screen_pt);
if (get_toplevel)
{
/* Only consider visible children of the desktop to avoid the various
* non-visible windows you often find on a running Windows box. These
* might overlap our windows and cause our walk to fail. As we assume
* WindowFromPoint() can find our windows, we follow similar logic
* here, and ignore invisible and disabled windows.
*/
hwnd = GetDesktopWindow ();
do {
window = gdk_win32_handle_table_lookup (hwnd);
if (window != NULL &&
GDK_WINDOW_TYPE (window) != GDK_WINDOW_ROOT &&
GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
break;
screen_to_client (hwnd, screen_pt, &client_pt);
hwndc = ChildWindowFromPointEx (hwnd, client_pt, CWP_SKIPDISABLED |
CWP_SKIPINVISIBLE);
/* Verify that we're really inside the client area of the window */
if (hwndc != hwnd)
{
GetClientRect (hwndc, &rect);
screen_to_client (hwndc, screen_pt, &client_pt);
if (!PtInRect (&rect, client_pt))
hwndc = hwnd;
}
} while (hwndc != hwnd && (hwnd = hwndc, 1));
}
else
{
hwnd = WindowFromPoint (screen_pt);
/* Verify that we're really inside the client area of the window */
GetClientRect (hwnd, &rect);
screen_to_client (hwnd, screen_pt, &client_pt);
if (!PtInRect (&rect, client_pt))
hwnd = NULL;
/* If we didn't hit any window at that point, return the desktop */
if (hwnd == NULL)
{
if (win_x)
*win_x = screen_pt.x + _gdk_offset_x;
if (win_y)
*win_y = screen_pt.y + _gdk_offset_y;
return _gdk_root;
}
window = gdk_win32_handle_table_lookup (hwnd);
}
if (window && (win_x || win_y))
{
if (win_x)
*win_x = client_pt.x;
if (win_y)
*win_y = client_pt.y;
}
return window;
}
static void
gdk_device_virtual_select_window_events (GdkDevice *device,
GdkWindow *window,
GdkEventMask event_mask)
{
}
+54
View File
@@ -0,0 +1,54 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2009 Carlos Garnacho <carlosg@gnome.org>
*
* 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/>.
*/
#ifndef __GDK_DEVICE_VIRTUAL_H__
#define __GDK_DEVICE_VIRTUAL_H__
#include <gdk/gdkdeviceprivate.h>
G_BEGIN_DECLS
#define GDK_TYPE_DEVICE_VIRTUAL (gdk_device_virtual_get_type ())
#define GDK_DEVICE_VIRTUAL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_VIRTUAL, GdkDeviceVirtual))
#define GDK_DEVICE_VIRTUAL_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_VIRTUAL, GdkDeviceVirtualClass))
#define GDK_IS_DEVICE_VIRTUAL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_VIRTUAL))
#define GDK_IS_DEVICE_VIRTUAL_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE_VIRTUAL))
#define GDK_DEVICE_VIRTUAL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_VIRTUAL, GdkDeviceVirtualClass))
typedef struct _GdkDeviceVirtual GdkDeviceVirtual;
typedef struct _GdkDeviceVirtualClass GdkDeviceVirtualClass;
struct _GdkDeviceVirtual
{
GdkDevice parent_instance;
GdkDevice *active_device;
};
struct _GdkDeviceVirtualClass
{
GdkDeviceClass parent_class;
};
GType gdk_device_virtual_get_type (void) G_GNUC_CONST;
void _gdk_device_virtual_set_active (GdkDevice *device,
GdkDevice *new_active);
G_END_DECLS
#endif /* __GDK_DEVICE_VIRTUAL_H__ */
+2 -125
View File
@@ -133,74 +133,6 @@ gdk_device_win32_set_window_cursor (GdkDevice *device,
GdkWindow *window,
GdkCursor *cursor)
{
GdkWin32Cursor *cursor_private;
GdkWindow *parent_window;
GdkWindowImplWin32 *impl;
HCURSOR hcursor;
HCURSOR hprevcursor;
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
cursor_private = (GdkWin32Cursor*) cursor;
hprevcursor = impl->hcursor;
if (!cursor)
hcursor = NULL;
else
hcursor = cursor_private->hcursor;
if (hcursor != NULL)
{
/* If the pointer is over our window, set new cursor */
GdkWindow *curr_window = gdk_window_get_pointer (window, NULL, NULL, NULL);
if (curr_window == window ||
(curr_window && window == gdk_window_get_toplevel (curr_window)))
SetCursor (hcursor);
else
{
/* Climb up the tree and find whether our window is the
* first ancestor that has cursor defined, and if so, set
* new cursor.
*/
while (curr_window && curr_window->impl &&
!GDK_WINDOW_IMPL_WIN32 (curr_window->impl)->hcursor)
{
curr_window = curr_window->parent;
if (curr_window == GDK_WINDOW (window))
{
SetCursor (hcursor);
break;
}
}
}
}
/* Unset the previous cursor: Need to make sure it's no longer in
* use before we destroy it, in case we're not over our window but
* the cursor is still set to our old one.
*/
if (hprevcursor != NULL &&
GetCursor () == hprevcursor)
{
/* Look for a suitable cursor to use instead */
hcursor = NULL;
parent_window = GDK_WINDOW (window)->parent;
while (hcursor == NULL)
{
if (parent_window)
{
impl = GDK_WINDOW_IMPL_WIN32 (parent_window->impl);
hcursor = impl->hcursor;
parent_window = parent_window->parent;
}
else
hcursor = LoadCursor (NULL, IDC_ARROW);
}
SetCursor (hcursor);
}
}
static void
@@ -209,7 +141,6 @@ gdk_device_win32_warp (GdkDevice *device,
gint x,
gint y)
{
SetCursorPos (x - _gdk_offset_x, y - _gdk_offset_y);
}
static GdkModifierType
@@ -309,68 +240,14 @@ gdk_device_win32_grab (GdkDevice *device,
GdkCursor *cursor,
guint32 time_)
{
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
HCURSOR hcursor;
GdkWin32Cursor *cursor_private;
cursor_private = (GdkWin32Cursor*) cursor;
if (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD)
{
if (!cursor)
hcursor = NULL;
else if ((hcursor = CopyCursor (cursor_private->hcursor)) == NULL)
WIN32_API_FAILED ("CopyCursor");
if (_gdk_win32_grab_cursor != NULL)
{
if (GetCursor () == _gdk_win32_grab_cursor)
SetCursor (NULL);
DestroyCursor (_gdk_win32_grab_cursor);
}
_gdk_win32_grab_cursor = hcursor;
if (_gdk_win32_grab_cursor != NULL)
SetCursor (_gdk_win32_grab_cursor);
else if (impl->hcursor != NULL)
SetCursor (impl->hcursor);
else
SetCursor (LoadCursor (NULL, IDC_ARROW));
SetCapture (GDK_WINDOW_HWND (window));
}
return GDK_GRAB_SUCCESS;
/* No support for grabbing the slave atm */
return GDK_GRAB_NOT_VIEWABLE;
}
static void
gdk_device_win32_ungrab (GdkDevice *device,
guint32 time_)
{
GdkDeviceGrabInfo *info;
GdkDisplay *display;
display = gdk_device_get_display (device);
info = _gdk_display_get_last_device_grab (display, device);
if (info)
info->serial_end = 0;
if (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD)
{
if (_gdk_win32_grab_cursor != NULL)
{
if (GetCursor () == _gdk_win32_grab_cursor)
SetCursor (NULL);
DestroyCursor (_gdk_win32_grab_cursor);
}
_gdk_win32_grab_cursor = NULL;
ReleaseCapture ();
}
_gdk_display_device_grab_update (display, device, NULL, 0);
}
static void
+90 -119
View File
@@ -25,16 +25,6 @@
#include "gdkwin32.h"
#include "gdkdevice-wintab.h"
static GQuark quark_window_input_info = 0;
static GSList *input_windows = NULL;
typedef struct
{
gdouble root_x;
gdouble root_y;
GHashTable *device_events;
} GdkWindowInputInfo;
static gboolean gdk_device_wintab_get_history (GdkDevice *device,
GdkWindow *window,
guint32 start,
@@ -96,8 +86,6 @@ gdk_device_wintab_class_init (GdkDeviceWintabClass *klass)
device_class->ungrab = gdk_device_wintab_ungrab;
device_class->window_at_position = gdk_device_wintab_window_at_position;
device_class->select_window_events = gdk_device_wintab_select_window_events;
quark_window_input_info = g_quark_from_static_string ("gdk-window-input-info");
}
static void
@@ -119,6 +107,32 @@ gdk_device_wintab_get_history (GdkDevice *device,
return FALSE;
}
static GdkModifierType
get_current_mask (void)
{
GdkModifierType mask;
BYTE kbd[256];
GetKeyboardState (kbd);
mask = 0;
if (kbd[VK_SHIFT] & 0x80)
mask |= GDK_SHIFT_MASK;
if (kbd[VK_CAPITAL] & 0x80)
mask |= GDK_LOCK_MASK;
if (kbd[VK_CONTROL] & 0x80)
mask |= GDK_CONTROL_MASK;
if (kbd[VK_MENU] & 0x80)
mask |= GDK_MOD1_MASK;
if (kbd[VK_LBUTTON] & 0x80)
mask |= GDK_BUTTON1_MASK;
if (kbd[VK_MBUTTON] & 0x80)
mask |= GDK_BUTTON2_MASK;
if (kbd[VK_RBUTTON] & 0x80)
mask |= GDK_BUTTON3_MASK;
return mask;
}
static void
gdk_device_wintab_get_state (GdkDevice *device,
GdkWindow *window,
@@ -134,7 +148,7 @@ gdk_device_wintab_get_state (GdkDevice *device,
* second, the info should be fairly up to date */
if (mask)
{
gdk_window_get_pointer (window, NULL, NULL, mask);
*mask = get_current_mask ();
*mask &= 0xFF; /* Mask away core pointer buttons */
*mask |= ((device_wintab->button_state << 8)
& (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK
@@ -142,7 +156,7 @@ gdk_device_wintab_get_state (GdkDevice *device,
| GDK_BUTTON5_MASK));
}
if (device_wintab->last_axis_data)
if (axes && device_wintab->last_axis_data)
_gdk_device_wintab_translate_axes (device_wintab, window, axes, NULL, NULL);
}
@@ -172,7 +186,66 @@ gdk_device_wintab_query_state (GdkDevice *device,
gint *win_y,
GdkModifierType *mask)
{
g_warning ("query_state unimplemented for wintab devices. Expect bad things.");
GdkDeviceWintab *device_wintab;
POINT point;
HWND hwnd, hwndc;
device_wintab = GDK_DEVICE_WINTAB (device);
hwnd = GDK_WINDOW_HWND (window);
GetCursorPos (&point);
if (root_x)
*root_x = point.x;
if (root_y)
*root_y = point.y;
ScreenToClient (hwnd, &point);
if (win_x)
*win_x = point.x;
if (win_y)
*win_y = point.y;
if (window == _gdk_root)
{
if (win_x)
*win_x += _gdk_offset_x;
if (win_y)
*win_y += _gdk_offset_y;
}
if (child_window)
{
hwndc = ChildWindowFromPoint (hwnd, point);
if (hwndc && hwndc != hwnd)
*child_window = gdk_win32_handle_table_lookup (hwndc);
else
*child_window = NULL; /* Direct child unknown to gdk */
}
if (root_window)
{
GdkScreen *screen;
screen = gdk_window_get_screen (window);
*root_window = gdk_screen_get_root_window (screen);
}
if (mask)
{
*mask = get_current_mask ();
*mask &= 0xFF; /* Mask away core pointer buttons */
*mask |= ((device_wintab->button_state << 8)
& (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK
| GDK_BUTTON3_MASK | GDK_BUTTON4_MASK
| GDK_BUTTON5_MASK));
}
}
static GdkGrabStatus
@@ -203,112 +276,11 @@ gdk_device_wintab_window_at_position (GdkDevice *device,
return NULL;
}
static void
input_info_free (GdkWindowInputInfo *info)
{
g_hash_table_destroy (info->device_events);
g_free (info);
}
static void
gdk_device_wintab_select_window_events (GdkDevice *device,
GdkWindow *window,
GdkEventMask event_mask)
{
GdkWindowInputInfo *info;
info = g_object_get_qdata (G_OBJECT (window),
quark_window_input_info);
if (event_mask)
{
if (!info)
{
info = g_new0 (GdkWindowInputInfo, 1);
info->device_events = g_hash_table_new (NULL, NULL);
g_object_set_qdata_full (G_OBJECT (window),
quark_window_input_info,
info,
(GDestroyNotify) input_info_free);
input_windows = g_slist_prepend (input_windows, window);
}
g_hash_table_insert (info->device_events, device,
GUINT_TO_POINTER (event_mask));
}
else if (info)
{
g_hash_table_remove (info->device_events, device);
if (g_hash_table_size (info->device_events) == 0)
{
g_object_set_qdata (G_OBJECT (window),
quark_window_input_info,
NULL);
input_windows = g_slist_remove (input_windows, window);
}
}
}
gboolean
_gdk_device_wintab_wants_events (GdkWindow *window)
{
GdkWindowInputInfo *info;
info = g_object_get_qdata (G_OBJECT (window),
quark_window_input_info);
return info != NULL;
}
GdkEventMask
_gdk_device_wintab_get_events (GdkDeviceWintab *device,
GdkWindow *window)
{
GdkWindowInputInfo *info;
info = g_object_get_qdata (G_OBJECT (window),
quark_window_input_info);
if (!info)
return 0;
return GPOINTER_TO_UINT (g_hash_table_lookup (info->device_events, device));
}
gboolean
_gdk_device_wintab_get_window_coords (GdkWindow *window,
gdouble *root_x,
gdouble *root_y)
{
GdkWindowInputInfo *info;
info = g_object_get_qdata (G_OBJECT (window),
quark_window_input_info);
if (!info)
return FALSE;
*root_x = info->root_x;
*root_y = info->root_y;
return TRUE;
}
void
_gdk_device_wintab_update_window_coords (GdkWindow *window)
{
GdkWindowInputInfo *info;
gint root_x, root_y;
info = g_object_get_qdata (G_OBJECT (window),
quark_window_input_info);
g_return_if_fail (info != NULL);
gdk_window_get_origin (window, &root_x, &root_y);
info->root_x = (gdouble) root_x;
info->root_y = (gdouble) root_y;
}
void
@@ -320,7 +292,7 @@ _gdk_device_wintab_translate_axes (GdkDeviceWintab *device_wintab,
{
GdkDevice *device;
GdkWindow *impl_window;
gdouble root_x, root_y;
gint root_x, root_y;
gdouble temp_x, temp_y;
gint i;
@@ -328,8 +300,7 @@ _gdk_device_wintab_translate_axes (GdkDeviceWintab *device_wintab,
impl_window = _gdk_window_get_impl_window (window);
temp_x = temp_y = 0;
if (!_gdk_device_wintab_get_window_coords (impl_window, &root_x, &root_y))
return;
gdk_window_get_origin (impl_window, &root_x, &root_y);
for (i = 0; i < gdk_device_get_n_axes (device); i++)
{
+1 -8
View File
@@ -39,6 +39,7 @@ struct _GdkDeviceWintab
{
GdkDevice parent_instance;
gboolean sends_core;
gint *last_axis_data;
gint button_state;
@@ -59,14 +60,6 @@ struct _GdkDeviceWintabClass
GType gdk_device_wintab_get_type (void) G_GNUC_CONST;
gboolean _gdk_device_wintab_wants_events (GdkWindow *window);
GdkEventMask _gdk_device_wintab_get_events (GdkDeviceWintab *device,
GdkWindow *window);
gboolean _gdk_device_wintab_get_window_coords (GdkWindow *window,
gdouble *root_x,
gdouble *root_y);
void _gdk_device_wintab_update_window_coords (GdkWindow *window);
void _gdk_device_wintab_translate_axes (GdkDeviceWintab *device,
GdkWindow *window,
gdouble *axes,
+145 -116
View File
@@ -27,6 +27,7 @@
#include "gdkdevicemanager-win32.h"
#include "gdkdeviceprivate.h"
#include "gdkdevice-win32.h"
#include "gdkdevice-virtual.h"
#include "gdkdevice-wintab.h"
#include "gdkdisplayprivate.h"
@@ -38,18 +39,18 @@
#include <pktdef.h>
#define DEBUG_WINTAB 1 /* Verbose debug messages enabled */
#define PROXIMITY_OUT_DELAY 200 /* In milliseconds, see set_ignore_core */
#define TWOPI (2 * G_PI)
static GList *wintab_contexts = NULL;
static GdkWindow *wintab_window = NULL;
static guint ignore_core_timer = 0;
extern gint _gdk_input_ignore_core;
typedef UINT (WINAPI *t_WTInfoA) (UINT a, UINT b, LPVOID c);
typedef UINT (WINAPI *t_WTInfoW) (UINT a, UINT b, LPVOID c);
typedef BOOL (WINAPI *t_WTEnable) (HCTX a, BOOL b);
typedef HCTX (WINAPI *t_WTOpenA) (HWND a, LPLOGCONTEXTA b, BOOL c);
typedef BOOL (WINAPI *t_WTGetA) (HCTX a, LPLOGCONTEXTA b);
typedef BOOL (WINAPI *t_WTSetA) (HCTX a, LPLOGCONTEXTA b);
typedef BOOL (WINAPI *t_WTOverlap) (HCTX a, BOOL b);
typedef BOOL (WINAPI *t_WTPacket) (HCTX a, UINT b, LPVOID c);
typedef int (WINAPI *t_WTQueueSizeSet) (HCTX a, int b);
@@ -58,6 +59,8 @@ static t_WTInfoA p_WTInfoA;
static t_WTInfoW p_WTInfoW;
static t_WTEnable p_WTEnable;
static t_WTOpenA p_WTOpenA;
static t_WTGetA p_WTGetA;
static t_WTSetA p_WTSetA;
static t_WTOverlap p_WTOverlap;
static t_WTPacket p_WTPacket;
static t_WTQueueSizeSet p_WTQueueSizeSet;
@@ -86,25 +89,31 @@ gdk_device_manager_win32_class_init (GdkDeviceManagerWin32Class *klass)
}
static GdkDevice *
create_core_pointer (GdkDeviceManager *device_manager)
create_pointer (GdkDeviceManager *device_manager,
GType g_type,
const char *name,
GdkDeviceType type)
{
return g_object_new (GDK_TYPE_DEVICE_WIN32,
"name", "Core Pointer",
"type", GDK_DEVICE_TYPE_MASTER,
return g_object_new (g_type,
"name", name,
"type", type,
"input-source", GDK_SOURCE_MOUSE,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", TRUE,
"has-cursor", type == GDK_DEVICE_TYPE_MASTER,
"display", _gdk_display,
"device-manager", device_manager,
NULL);
}
static GdkDevice *
create_core_keyboard (GdkDeviceManager *device_manager)
create_keyboard (GdkDeviceManager *device_manager,
GType g_type,
const char *name,
GdkDeviceType type)
{
return g_object_new (GDK_TYPE_DEVICE_WIN32,
"name", "Core Keyboard",
"type", GDK_DEVICE_TYPE_MASTER,
return g_object_new (g_type,
"name", name,
"type", type,
"input-source", GDK_SOURCE_KEYBOARD,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", FALSE,
@@ -419,6 +428,10 @@ _gdk_input_wintab_init_check (GdkDeviceManager *_device_manager)
return;
if ((p_WTOpenA = (t_WTOpenA) GetProcAddress (wintab32, "WTOpenA")) == NULL)
return;
if ((p_WTGetA = (t_WTGetA) GetProcAddress (wintab32, "WTGetA")) == NULL)
return;
if ((p_WTSetA = (t_WTSetA) GetProcAddress (wintab32, "WTSetA")) == NULL)
return;
if ((p_WTOverlap = (t_WTOverlap) GetProcAddress (wintab32, "WTOverlap")) == NULL)
return;
if ((p_WTPacket = (t_WTPacket) GetProcAddress (wintab32, "WTPacket")) == NULL)
@@ -496,7 +509,7 @@ _gdk_input_wintab_init_check (GdkDeviceManager *_device_manager)
#if DEBUG_WINTAB
GDK_NOTE (INPUT, (g_print("Default context:\n"), print_lc(&lc)));
#endif
lc.lcOptions |= CXO_MESSAGES;
lc.lcOptions |= CXO_MESSAGES | CXO_CSRMESSAGES;
lc.lcStatus = 0;
lc.lcMsgBase = WT_DEFBASE;
lc.lcPktRate = 0;
@@ -506,8 +519,8 @@ _gdk_input_wintab_init_check (GdkDeviceManager *_device_manager)
lc.lcBtnUpMask = lc.lcBtnDnMask = ~0;
lc.lcOutOrgX = axis_x.axMin;
lc.lcOutOrgY = axis_y.axMin;
lc.lcOutExtX = axis_x.axMax - axis_x.axMin;
lc.lcOutExtY = axis_y.axMax - axis_y.axMin;
lc.lcOutExtX = axis_x.axMax - axis_x.axMin + 1;
lc.lcOutExtY = axis_y.axMax - axis_y.axMin + 1;
lc.lcOutExtY = -lc.lcOutExtY; /* We want Y growing downward */
#if DEBUG_WINTAB
GDK_NOTE (INPUT, (g_print("context for device %d:\n", devix),
@@ -537,7 +550,7 @@ _gdk_input_wintab_init_check (GdkDeviceManager *_device_manager)
* with a smaller queue size.
*/
GDK_NOTE (INPUT, g_print("Attempting to increase queue size\n"));
for (i = 32; i >= 1; i >>= 1)
for (i = 128; i >= 1; i >>= 1)
{
if ((*p_WTQueueSizeSet) (*hctx, i))
{
@@ -575,14 +588,21 @@ _gdk_input_wintab_init_check (GdkDeviceManager *_device_manager)
device = g_object_new (GDK_TYPE_DEVICE_WINTAB,
"name", device_name,
"type", GDK_DEVICE_TYPE_SLAVE,
"type", GDK_DEVICE_TYPE_FLOATING,
"input-source", GDK_SOURCE_PEN,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", FALSE,
"has-cursor", lc.lcOptions & CXO_SYSTEM,
"display", _gdk_display,
"device-manager", device_manager,
NULL);
device->sends_core = lc.lcOptions & CXO_SYSTEM;
if (device->sends_core)
{
_gdk_device_set_associated_device (device_manager->system_pointer, GDK_DEVICE (device));
_gdk_device_add_slave (device_manager->core_pointer, GDK_DEVICE (device));
}
g_free (csrname_utf8);
device->hctx = *hctx;
@@ -684,8 +704,35 @@ gdk_device_manager_win32_constructed (GObject *object)
GdkDeviceManagerWin32 *device_manager;
device_manager = GDK_DEVICE_MANAGER_WIN32 (object);
device_manager->core_pointer = create_core_pointer (GDK_DEVICE_MANAGER (device_manager));
device_manager->core_keyboard = create_core_keyboard (GDK_DEVICE_MANAGER (device_manager));
device_manager->core_pointer =
create_pointer (GDK_DEVICE_MANAGER (device_manager),
GDK_TYPE_DEVICE_VIRTUAL,
"Virtual Core Pointer",
GDK_DEVICE_TYPE_MASTER);
device_manager->system_pointer =
create_pointer (GDK_DEVICE_MANAGER (device_manager),
GDK_TYPE_DEVICE_WIN32,
"System Aggregated Pointer",
GDK_DEVICE_TYPE_SLAVE);
_gdk_device_virtual_set_active (device_manager->core_pointer,
device_manager->system_pointer);
_gdk_device_set_associated_device (device_manager->system_pointer, device_manager->core_pointer);
_gdk_device_add_slave (device_manager->core_pointer, device_manager->system_pointer);
device_manager->core_keyboard =
create_keyboard (GDK_DEVICE_MANAGER (device_manager),
GDK_TYPE_DEVICE_VIRTUAL,
"Virtual Core Keyboard",
GDK_DEVICE_TYPE_MASTER);
device_manager->system_keyboard =
create_keyboard (GDK_DEVICE_MANAGER (device_manager),
GDK_TYPE_DEVICE_WIN32,
"System Aggregated Keyboard",
GDK_DEVICE_TYPE_SLAVE);
_gdk_device_virtual_set_active (device_manager->core_keyboard,
device_manager->system_keyboard);
_gdk_device_set_associated_device (device_manager->system_keyboard, device_manager->core_keyboard);
_gdk_device_add_slave (device_manager->core_keyboard, device_manager->system_keyboard);
_gdk_device_set_associated_device (device_manager->core_pointer, device_manager->core_keyboard);
_gdk_device_set_associated_device (device_manager->core_keyboard, device_manager->core_pointer);
@@ -696,7 +743,7 @@ gdk_device_manager_win32_list_devices (GdkDeviceManager *device_manager,
GdkDeviceType type)
{
GdkDeviceManagerWin32 *device_manager_win32;
GList *devices = NULL;
GList *devices = NULL, *l;
device_manager_win32 = (GdkDeviceManagerWin32 *) device_manager;
@@ -705,10 +752,24 @@ gdk_device_manager_win32_list_devices (GdkDeviceManager *device_manager,
devices = g_list_prepend (devices, device_manager_win32->core_keyboard);
devices = g_list_prepend (devices, device_manager_win32->core_pointer);
}
else if (type == GDK_DEVICE_TYPE_FLOATING)
devices = g_list_copy (device_manager_win32->wintab_devices);
else
{
if (type == GDK_DEVICE_TYPE_SLAVE)
{
devices = g_list_prepend (devices, device_manager_win32->system_keyboard);
devices = g_list_prepend (devices, device_manager_win32->system_pointer);
}
return devices;
for (l = device_manager_win32->wintab_devices; l != NULL; l = l->next)
{
GdkDevice *device = l->data;
if (gdk_device_get_device_type (device) == type)
devices = g_list_prepend (devices, device);
}
}
return g_list_reverse (devices);
}
static GdkDevice *
@@ -791,41 +852,6 @@ get_modifier_key_state (void)
return state;
}
static gboolean
ignore_core_timefunc (gpointer data)
{
/* The delay has passed */
_gdk_input_ignore_core = FALSE;
ignore_core_timer = 0;
return FALSE; /* remove timeout */
}
/*
* Set or unset the _gdk_input_ignore_core variable that tells GDK
* to ignore events for the core pointer when the tablet is in proximity
* The unsetting is delayed slightly so that if a tablet event arrives
* just after proximity out, it does not cause a core pointer event
* which e.g. causes GIMP to switch tools.
*/
static void
set_ignore_core (gboolean ignore)
{
if (ignore)
{
_gdk_input_ignore_core = TRUE;
/* Remove any pending clear */
if (ignore_core_timer)
{
g_source_remove (ignore_core_timer);
ignore_core_timer = 0;
}
}
else if (!ignore_core_timer)
ignore_core_timer = gdk_threads_add_timeout (PROXIMITY_OUT_DELAY,
ignore_core_timefunc, NULL);
}
static GdkDeviceWintab *
_gdk_device_manager_find_wintab_device (HCTX hctx,
UINT cursor)
@@ -855,15 +881,16 @@ _gdk_input_other_event (GdkEvent *event,
MSG *msg,
GdkWindow *window)
{
GdkDeviceManagerWin32 *device_manager;
GdkDisplay *display;
GdkDeviceWintab *device = NULL;
GdkDeviceWintab *source_device = NULL;
GdkDeviceGrabInfo *last_grab;
GdkEventMask masktest;
guint key_state;
POINT pt;
PACKET packet;
gdouble root_x, root_y;
gint root_x, root_y;
gint num_axes;
gint x, y;
guint translated_buttons, button_diff, button_mask;
@@ -878,6 +905,8 @@ _gdk_input_other_event (GdkEvent *event,
return FALSE;
}
device_manager = GDK_DEVICE_MANAGER_WIN32 (gdk_display_get_device_manager (_gdk_display));
window = gdk_window_at_pointer (&x, &y);
if (window == NULL)
window = _gdk_root;
@@ -889,7 +918,7 @@ _gdk_input_other_event (GdkEvent *event,
g_print ("_gdk_input_other_event: window=%p %+d%+d\n",
GDK_WINDOW_HWND (window), x, y));
if (msg->message == WT_PACKET)
if (msg->message == WT_PACKET || msg->message == WT_CSRCHANGE)
{
if (!(*p_WTPacket) ((HCTX) msg->lParam, msg->wParam, &packet))
return FALSE;
@@ -907,14 +936,14 @@ _gdk_input_other_event (GdkEvent *event,
return FALSE;
}
if ((device = _gdk_device_manager_find_wintab_device ((HCTX) msg->lParam,
packet.pkCursor)) == NULL)
if ((source_device = _gdk_device_manager_find_wintab_device ((HCTX) msg->lParam,
packet.pkCursor)) == NULL)
return FALSE;
if (gdk_device_get_mode (GDK_DEVICE (device)) == GDK_MODE_DISABLED)
if (gdk_device_get_mode (GDK_DEVICE (source_device)) == GDK_MODE_DISABLED)
return FALSE;
last_grab = _gdk_display_get_last_device_grab (_gdk_display, GDK_DEVICE (device));
last_grab = _gdk_display_get_last_device_grab (_gdk_display, GDK_DEVICE (source_device));
if (last_grab && last_grab->window)
{
@@ -930,29 +959,29 @@ _gdk_input_other_event (GdkEvent *event,
}
num_axes = 0;
if (device->pktdata & PK_X)
device->last_axis_data[num_axes++] = packet.pkX;
if (device->pktdata & PK_Y)
device->last_axis_data[num_axes++] = packet.pkY;
if (device->pktdata & PK_NORMAL_PRESSURE)
device->last_axis_data[num_axes++] = packet.pkNormalPressure;
if (device->pktdata & PK_ORIENTATION)
if (source_device->pktdata & PK_X)
source_device->last_axis_data[num_axes++] = packet.pkX;
if (source_device->pktdata & PK_Y)
source_device->last_axis_data[num_axes++] = packet.pkY;
if (source_device->pktdata & PK_NORMAL_PRESSURE)
source_device->last_axis_data[num_axes++] = packet.pkNormalPressure;
if (source_device->pktdata & PK_ORIENTATION)
{
decode_tilt (device->last_axis_data + num_axes,
device->orientation_axes, &packet);
decode_tilt (source_device->last_axis_data + num_axes,
source_device->orientation_axes, &packet);
num_axes += 2;
}
translated_buttons = button_map[packet.pkButtons & 0x07] | (packet.pkButtons & ~0x07);
if (translated_buttons != device->button_state)
if (translated_buttons != source_device->button_state)
{
/* At least one button has changed state so produce a button event
* If more than one button has changed state (unlikely),
* just care about the first and act on the next the next time
* we get a packet
*/
button_diff = translated_buttons ^ device->button_state;
button_diff = translated_buttons ^ source_device->button_state;
/* Gdk buttons are numbered 1.. */
event->button.button = 1;
@@ -977,39 +1006,33 @@ _gdk_input_other_event (GdkEvent *event,
event->any.type = GDK_BUTTON_PRESS;
masktest = GDK_BUTTON_PRESS_MASK;
}
device->button_state ^= button_mask;
source_device->button_state ^= button_mask;
}
else
{
event->any.type = GDK_MOTION_NOTIFY;
masktest = GDK_POINTER_MOTION_MASK;
if (device->button_state & (1 << 0))
if (source_device->button_state & (1 << 0))
masktest |= GDK_BUTTON_MOTION_MASK | GDK_BUTTON1_MOTION_MASK;
if (device->button_state & (1 << 1))
if (source_device->button_state & (1 << 1))
masktest |= GDK_BUTTON_MOTION_MASK | GDK_BUTTON2_MOTION_MASK;
if (device->button_state & (1 << 2))
if (source_device->button_state & (1 << 2))
masktest |= GDK_BUTTON_MOTION_MASK | GDK_BUTTON3_MOTION_MASK;
}
/* Now we can check if the window wants the event, and
* propagate if necessary.
*/
while (gdk_window_get_device_events (window, GDK_DEVICE (device)) == 0)
while ((gdk_window_get_device_events (window, GDK_DEVICE (source_device)) & masktest) == 0 &&
(gdk_device_get_device_type (GDK_DEVICE (source_device)) == GDK_DEVICE_TYPE_SLAVE &&
(gdk_window_get_events (window) & masktest) == 0))
{
GDK_NOTE (EVENTS_OR_INPUT, g_print ("... not selected\n"));
if (window->parent == GDK_WINDOW (_gdk_root))
if (window->parent == GDK_WINDOW (_gdk_root) ||
window->parent == NULL)
return FALSE;
/* It is not good to propagate the extended events up to the parent
* if this window wants normal (not extended) motion/button events */
if (window->event_mask & masktest)
{
GDK_NOTE (EVENTS_OR_INPUT,
g_print ("... wants ordinary event, ignoring this\n"));
return FALSE;
}
pt.x = x;
pt.y = y;
ClientToScreen (GDK_WINDOW_HWND (window), &pt);
@@ -1023,21 +1046,20 @@ _gdk_input_other_event (GdkEvent *event,
GDK_WINDOW_HWND (window), x, y));
}
if (gdk_window_get_device_events (window, GDK_DEVICE (device)) == 0)
return FALSE;
event->any.window = window;
key_state = get_modifier_key_state ();
if (event->any.type == GDK_BUTTON_PRESS ||
event->any.type == GDK_BUTTON_RELEASE)
{
event->button.time = _gdk_win32_get_next_tick (msg->time);
gdk_event_set_device (event, GDK_DEVICE (device));
if (source_device->sends_core)
gdk_event_set_device (event, device_manager->core_pointer);
gdk_event_set_source_device (event, GDK_DEVICE (source_device));
event->button.axes = g_new (gdouble, num_axes);
_gdk_device_wintab_get_window_coords (window, &root_x, &root_y);
gdk_window_get_origin (window, &root_x, &root_y);
_gdk_device_wintab_translate_axes (device,
_gdk_device_wintab_translate_axes (source_device,
window,
event->button.axes,
&event->button.x,
@@ -1047,7 +1069,7 @@ _gdk_input_other_event (GdkEvent *event,
event->button.y_root = event->button.y + root_y;
event->button.state =
key_state | ((device->button_state << 8)
key_state | ((source_device->button_state << 8)
& (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK
| GDK_BUTTON3_MASK | GDK_BUTTON4_MASK
| GDK_BUTTON5_MASK));
@@ -1063,12 +1085,13 @@ _gdk_input_other_event (GdkEvent *event,
{
event->motion.time = _gdk_win32_get_next_tick (msg->time);
event->motion.is_hint = FALSE;
gdk_event_set_device (event, GDK_DEVICE (device));
gdk_event_set_device (event, device_manager->core_pointer);
gdk_event_set_source_device (event, GDK_DEVICE (source_device));
event->motion.axes = g_new (gdouble, num_axes);
_gdk_device_wintab_get_window_coords (window, &root_x, &root_y);
gdk_window_get_origin (window, &root_x, &root_y);
_gdk_device_wintab_translate_axes (device,
_gdk_device_wintab_translate_axes (source_device,
window,
event->motion.axes,
&event->motion.x,
@@ -1078,7 +1101,7 @@ _gdk_input_other_event (GdkEvent *event,
event->motion.y_root = event->motion.y + root_y;
event->motion.state =
key_state | ((device->button_state << 8)
key_state | ((source_device->button_state << 8)
& (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK
| GDK_BUTTON3_MASK | GDK_BUTTON4_MASK
| GDK_BUTTON5_MASK));
@@ -1089,25 +1112,31 @@ _gdk_input_other_event (GdkEvent *event,
}
return TRUE;
case WT_CSRCHANGE:
if ((source_device = _gdk_device_manager_find_wintab_device ((HCTX) msg->lParam,
packet.pkCursor)) == NULL)
return FALSE;
if (gdk_device_get_mode (GDK_DEVICE (source_device)) == GDK_MODE_DISABLED)
return FALSE;
if (source_device->sends_core)
{
_gdk_device_virtual_set_active (device_manager->core_pointer, GDK_DEVICE (source_device));
_gdk_input_ignore_core = TRUE;
}
return FALSE;
case WT_PROXIMITY:
if (LOWORD (msg->lParam) == 0)
{
event->proximity.type = GDK_PROXIMITY_OUT;
set_ignore_core (FALSE);
_gdk_input_ignore_core = FALSE;
_gdk_device_virtual_set_active (device_manager->core_pointer,
device_manager->system_pointer);
}
else
{
event->proximity.type = GDK_PROXIMITY_IN;
set_ignore_core (TRUE);
}
event->proximity.time = _gdk_win32_get_next_tick (msg->time);
gdk_event_set_device (event, GDK_DEVICE (device));
GDK_NOTE (EVENTS_OR_INPUT,
g_print ("WINTAB proximity %s\n",
(event->proximity.type == GDK_PROXIMITY_IN ?
"in" : "out")));
return TRUE;
return FALSE;
}
return FALSE;
+4
View File
@@ -35,8 +35,12 @@ typedef struct _GdkDeviceManagerWin32Class GdkDeviceManagerWin32Class;
struct _GdkDeviceManagerWin32
{
GdkDeviceManager parent_object;
/* Master Devices */
GdkDevice *core_pointer;
GdkDevice *core_keyboard;
/* Fake slave devices */
GdkDevice *system_pointer;
GdkDevice *system_keyboard;
GList *wintab_devices;
};
+51 -29
View File
@@ -192,14 +192,17 @@ generate_focus_event (GdkDeviceManager *device_manager,
gboolean in)
{
GdkDevice *device;
GdkDevice *source_device;
GdkEvent *event;
device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_keyboard;
source_device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->system_keyboard;
event = gdk_event_new (GDK_FOCUS_CHANGE);
event->focus_change.window = window;
event->focus_change.in = in;
gdk_event_set_device (event, device);
gdk_event_set_source_device (event, source_device);
_gdk_win32_append_event (event);
}
@@ -212,11 +215,18 @@ generate_grab_broken_event (GdkDeviceManager *device_manager,
{
GdkEvent *event = gdk_event_new (GDK_GRAB_BROKEN);
GdkDevice *device;
GdkDevice *source_device;
if (keyboard)
device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_keyboard;
{
device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_keyboard;
source_device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->system_keyboard;
}
else
device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_pointer;
{
device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_pointer;
source_device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->system_pointer;
}
event->grab_broken.window = window;
event->grab_broken.send_event = 0;
@@ -224,6 +234,7 @@ generate_grab_broken_event (GdkDeviceManager *device_manager,
event->grab_broken.implicit = FALSE;
event->grab_broken.grab_window = grab_window;
gdk_event_set_device (event, device);
gdk_event_set_source_device (event, device);
_gdk_win32_append_event (event);
}
@@ -1130,13 +1141,10 @@ send_crossing_event (GdkDisplay *display,
event->crossing.detail = notify_type;
event->crossing.focus = FALSE;
event->crossing.state = mask;
gdk_event_set_device (event, _gdk_display->core_pointer);
gdk_event_set_device (event, device_manager->core_pointer);
gdk_event_set_source_device (event, device_manager->system_pointer);
_gdk_win32_append_event (event);
if (type == GDK_ENTER_NOTIFY &&
_gdk_device_wintab_wants_events (window))
_gdk_device_wintab_update_window_coords (window);
}
static GdkWindow *
@@ -1655,6 +1663,12 @@ generate_button_event (GdkEventType type,
MSG *msg)
{
GdkEvent *event = gdk_event_new (type);
GdkDeviceManagerWin32 *device_manager;
if (_gdk_input_ignore_core)
return;
device_manager = GDK_DEVICE_MANAGER_WIN32 (gdk_display_get_device_manager (_gdk_display));
event->button.window = window;
event->button.time = _gdk_win32_get_next_tick (msg->time);
@@ -1665,7 +1679,8 @@ generate_button_event (GdkEventType type,
event->button.axes = NULL;
event->button.state = build_pointer_event_state (msg);
event->button.button = button;
gdk_event_set_device (event, _gdk_display->core_pointer);
gdk_event_set_device (event, device_manager->core_pointer);
gdk_event_set_source_device (event, device_manager->system_pointer);
_gdk_win32_append_event (event);
}
@@ -1841,6 +1856,7 @@ gdk_event_translate (MSG *msg,
GdkWindow *orig_window, *new_window;
GdkDeviceManager *device_manager;
GdkDeviceManagerWin32 *device_manager_win32;
GdkDeviceGrabInfo *keyboard_grab = NULL;
GdkDeviceGrabInfo *pointer_grab = NULL;
@@ -1892,11 +1908,12 @@ gdk_event_translate (MSG *msg,
}
device_manager = gdk_display_get_device_manager (_gdk_display);
device_manager_win32 = GDK_DEVICE_MANAGER_WIN32 (device_manager);
keyboard_grab = _gdk_display_get_last_device_grab (_gdk_display,
GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_keyboard);
device_manager_win32->core_keyboard);
pointer_grab = _gdk_display_get_last_device_grab (_gdk_display,
GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_pointer);
device_manager_win32->core_pointer);
g_object_ref (window);
@@ -2051,7 +2068,8 @@ gdk_event_translate (MSG *msg,
event->key.string = NULL;
event->key.length = 0;
event->key.hardware_keycode = msg->wParam;
gdk_event_set_device (event, GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_keyboard);
gdk_event_set_device (event, device_manager_win32->core_keyboard);
gdk_event_set_source_device (event, device_manager_win32->system_keyboard);
if (HIWORD (msg->lParam) & KF_EXTENDED)
{
switch (msg->wParam)
@@ -2168,7 +2186,8 @@ gdk_event_translate (MSG *msg,
/* Build a key press event */
event = gdk_event_new (GDK_KEY_PRESS);
event->key.window = window;
gdk_event_set_device (event, GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_keyboard);
gdk_event_set_device (event, device_manager_win32->core_keyboard);
gdk_event_set_source_device (event, device_manager_win32->system_keyboard);
build_wm_ime_composition_event (event, msg, wbuf[i], key_state);
_gdk_win32_append_event (event);
@@ -2179,7 +2198,8 @@ gdk_event_translate (MSG *msg,
/* Build a key release event. */
event = gdk_event_new (GDK_KEY_RELEASE);
event->key.window = window;
gdk_event_set_device (event, GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_keyboard);
gdk_event_set_device (event, device_manager_win32->core_keyboard);
gdk_event_set_source_device (event, device_manager_win32->system_keyboard);
build_wm_ime_composition_event (event, msg, wbuf[i], key_state);
_gdk_win32_append_event (event);
@@ -2361,19 +2381,23 @@ gdk_event_translate (MSG *msg,
current_root_x = msg->pt.x + _gdk_offset_x;
current_root_y = msg->pt.y + _gdk_offset_y;
event = gdk_event_new (GDK_MOTION_NOTIFY);
event->motion.window = window;
event->motion.time = _gdk_win32_get_next_tick (msg->time);
event->motion.x = current_x = (gint16) GET_X_LPARAM (msg->lParam);
event->motion.y = current_y = (gint16) GET_Y_LPARAM (msg->lParam);
event->motion.x_root = current_root_x;
event->motion.y_root = current_root_y;
event->motion.axes = NULL;
event->motion.state = build_pointer_event_state (msg);
event->motion.is_hint = FALSE;
gdk_event_set_device (event, _gdk_display->core_pointer);
if (!_gdk_input_ignore_core)
{
event = gdk_event_new (GDK_MOTION_NOTIFY);
event->motion.window = window;
event->motion.time = _gdk_win32_get_next_tick (msg->time);
event->motion.x = current_x = (gint16) GET_X_LPARAM (msg->lParam);
event->motion.y = current_y = (gint16) GET_Y_LPARAM (msg->lParam);
event->motion.x_root = current_root_x;
event->motion.y_root = current_root_y;
event->motion.axes = NULL;
event->motion.state = build_pointer_event_state (msg);
event->motion.is_hint = FALSE;
gdk_event_set_device (event, device_manager_win32->core_pointer);
gdk_event_set_source_device (event, device_manager_win32->system_pointer);
_gdk_win32_append_event (event);
_gdk_win32_append_event (event);
}
return_val = TRUE;
break;
@@ -2485,7 +2509,8 @@ gdk_event_translate (MSG *msg,
event->scroll.x_root = (gint16) GET_X_LPARAM (msg->lParam) + _gdk_offset_x;
event->scroll.y_root = (gint16) GET_Y_LPARAM (msg->lParam) + _gdk_offset_y;
event->scroll.state = build_pointer_event_state (msg);
gdk_event_set_device (event, _gdk_display->core_pointer);
gdk_event_set_device (event, device_manager_win32->core_pointer);
gdk_event_set_source_device (event, device_manager_win32->system_pointer);
_gdk_win32_append_event (event);
@@ -2763,9 +2788,6 @@ gdk_event_translate (MSG *msg,
!IsIconic (msg->hwnd) &&
!GDK_WINDOW_DESTROYED (window))
_gdk_win32_emit_configure_event (window);
if (_gdk_device_wintab_wants_events (window))
_gdk_device_wintab_update_window_coords (window);
}
if ((windowpos->flags & SWP_HIDEWINDOW) &&
+1 -1
View File
@@ -75,6 +75,6 @@ _gdk_input_init (GdkDisplay *display)
_gdk_input_devices = g_list_concat (_gdk_input_devices,
g_list_copy (device_manager->wintab_devices));
_gdk_input_wintab_init_check (device_manager);
_gdk_input_wintab_init_check (GDK_DEVICE_MANAGER (device_manager));
}
+2 -2
View File
@@ -145,7 +145,7 @@ translate_key_event (GdkDisplay *display,
gdk_event_set_device (event, device_manager->core_keyboard);
event->key.state = (GdkModifierType) xevent->xkey.state;
event->key.group = _gdk_x11_get_group_for_state (display, xevent->xkey.state);
event->key.group = gdk_x11_keymap_get_group_for_state (keymap, xevent->xkey.state);
event->key.hardware_keycode = xevent->xkey.keycode;
event->key.keyval = GDK_KEY_VoidSymbol;
@@ -161,7 +161,7 @@ translate_key_event (GdkDisplay *display,
_gdk_x11_keymap_add_virt_mods (keymap, &state);
event->key.state |= state;
event->key.is_modifier = _gdk_x11_keymap_key_is_modifier (keymap, event->key.hardware_keycode);
event->key.is_modifier = gdk_x11_keymap_key_is_modifier (keymap, event->key.hardware_keycode);
_gdk_x11_event_translate_keyboard_string (&event->key);
+25 -16
View File
@@ -331,10 +331,6 @@ create_device (GdkDeviceManager *device_manager,
input_source = GDK_SOURCE_ERASER;
else if (strstr (tmp_name, "cursor"))
input_source = GDK_SOURCE_CURSOR;
else if (strstr (tmp_name, "finger") ||
(strstr (tmp_name, "touch") &&
!strstr (tmp_name, "touchpad")))
input_source = GDK_SOURCE_TOUCHSCREEN;
else if (strstr (tmp_name, "wacom") ||
strstr (tmp_name, "pen"))
input_source = GDK_SOURCE_PEN;
@@ -1066,7 +1062,7 @@ scroll_valuators_changed (GdkX11DeviceXI2 *device,
gdouble *dx,
gdouble *dy)
{
gdouble has_scroll_valuators = FALSE;
gboolean has_scroll_valuators = FALSE;
GdkScrollDirection direction;
guint n_axes, i, n_val;
gdouble *vals;
@@ -1164,10 +1160,10 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
event->key.time = xev->time;
event->key.state = _gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group);
event->key.group = _gdk_x11_get_group_for_state (display, event->key.state);
event->key.group = xev->group.effective;
event->key.hardware_keycode = xev->detail;
event->key.is_modifier = _gdk_x11_keymap_key_is_modifier (keymap, event->key.hardware_keycode);
event->key.is_modifier = gdk_x11_keymap_key_is_modifier (keymap, event->key.hardware_keycode);
device = g_hash_table_lookup (device_manager->id_table,
GUINT_TO_POINTER (xev->deviceid));
@@ -1309,20 +1305,37 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
case XI_Motion:
{
XIDeviceEvent *xev = (XIDeviceEvent *) ev;
GdkDevice *source_device;
GdkDevice *source_device, *device;
gdouble delta_x, delta_y;
source_device = g_hash_table_lookup (device_manager->id_table,
GUINT_TO_POINTER (xev->sourceid));
device = g_hash_table_lookup (device_manager->id_table,
GUINT_TO_POINTER (xev->deviceid));
if (scroll_valuators_changed (GDK_X11_DEVICE_XI2 (source_device),
/* When scrolling, X might send events twice here; once with both the
* device and the source device set to the physical device, and once
* with the device set to the master device.
* Since we are only interested in the latter, and
* scroll_valuators_changed() updates the valuator cache for the
* source device, we need to explicitly ignore the first event in
* order to get the correct delta for the second.
*/
if (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE &&
scroll_valuators_changed (GDK_X11_DEVICE_XI2 (source_device),
&xev->valuators, &delta_x, &delta_y))
{
event->scroll.type = GDK_SCROLL;
event->scroll.direction = GDK_SCROLL_SMOOTH;
GDK_NOTE(EVENTS,
g_message ("smooth scroll:\twindow %ld\n\tdeltas: %f %f",
g_message ("smooth scroll: %s\n\tdevice: %u\n\tsource device: %u\n\twindow %ld\n\tdeltas: %f %f",
#ifdef XINPUT_2_2
(xev->flags & XIPointerEmulated) ? "emulated" : "",
#else
"",
#endif
xev->deviceid, xev->sourceid,
xev->event, delta_x, delta_y));
@@ -1335,9 +1348,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
event->scroll.delta_x = delta_x;
event->scroll.delta_y = delta_y;
event->scroll.device = g_hash_table_lookup (device_manager->id_table,
GUINT_TO_POINTER (xev->deviceid));
event->scroll.device = device;
gdk_event_set_source_device (event, source_device);
event->scroll.state = _gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group);
@@ -1352,9 +1363,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
event->motion.x_root = (gdouble) xev->root_x;
event->motion.y_root = (gdouble) xev->root_y;
event->motion.device = g_hash_table_lookup (device_manager->id_table,
GINT_TO_POINTER (xev->deviceid));
event->motion.device = device;
gdk_event_set_source_device (event, source_device);
event->motion.state = _gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group);
+45 -27
View File
@@ -1510,9 +1510,11 @@ motif_send_enter (GdkX11DragContext *context_x11,
if (!_gdk_x11_display_send_xevent (display,
GDK_WINDOW_XID (context->dest_window),
FALSE, 0, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XID (context->dest_window)));
{
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XID (context->dest_window)));
}
}
static void
@@ -1539,9 +1541,11 @@ motif_send_leave (GdkX11DragContext *context_x11,
if (!_gdk_x11_display_send_xevent (display,
GDK_WINDOW_XID (context->dest_window),
FALSE, 0, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XID (context->dest_window)));
{
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XID (context->dest_window)));
}
}
static gboolean
@@ -1589,9 +1593,11 @@ motif_send_motion (GdkX11DragContext *context_x11,
if (!_gdk_x11_display_send_xevent (display,
GDK_WINDOW_XID (context->dest_window),
FALSE, 0, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XID (context->dest_window)));
{
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XID (context->dest_window)));
}
return retval;
}
@@ -1623,9 +1629,11 @@ motif_send_drop (GdkX11DragContext *context_x11,
if (!_gdk_x11_display_send_xevent (display,
GDK_WINDOW_XID (context->dest_window),
FALSE, 0, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XID (context->dest_window)));
{
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XID (context->dest_window)));
}
}
/* Target Side */
@@ -2605,9 +2613,11 @@ xdnd_check_dest (GdkDisplay *display,
proxy = *proxy_data;
}
else
GDK_NOTE (DND,
g_warning ("Invalid XdndProxy "
"property on window %ld\n", win));
{
GDK_NOTE (DND,
g_warning ("Invalid XdndProxy "
"property on window %ld\n", win));
}
XFree (proxy_data);
}
@@ -2629,9 +2639,11 @@ xdnd_check_dest (GdkDisplay *display,
*xdnd_version = *version;
}
else
GDK_NOTE (DND,
g_warning ("Invalid XdndAware "
"property on window %ld\n", win));
{
GDK_NOTE (DND,
g_warning ("Invalid XdndAware "
"property on window %ld\n", win));
}
XFree (version);
}
@@ -3657,9 +3669,11 @@ gdk_x11_drag_context_drag_status (GdkDragContext *context,
if (!_gdk_x11_display_send_xevent (display,
GDK_WINDOW_XID (context->source_window),
FALSE, 0, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XID (context->source_window)));
{
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XID (context->source_window)));
}
}
else if (context->protocol == GDK_DRAG_PROTO_XDND)
{
@@ -3674,9 +3688,11 @@ gdk_x11_drag_context_drag_status (GdkDragContext *context,
xev.xclient.data.l[3] = 0;
xev.xclient.data.l[4] = xdnd_action_to_atom (display, action);
if (!xdnd_send_xevent (context_x11, context->source_window, FALSE, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XID (context->source_window)));
{
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XID (context->source_window)));
}
}
context_x11->old_action = action;
@@ -3754,9 +3770,11 @@ gdk_x11_drag_context_drop_finish (GdkDragContext *context,
xev.xclient.data.l[4] = 0;
if (!xdnd_send_xevent (GDK_X11_DRAG_CONTEXT (context), context->source_window, FALSE, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XID (context->source_window)));
{
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XID (context->source_window)));
}
}
}
+42 -5
View File
@@ -1429,11 +1429,30 @@ _gdk_x11_display_manager_keyval_convert_case (GdkDisplayManager *manager,
*upper = xupper;
}
/**
* gdk_x11_keymap_get_group_for_state:
* @keymap: a #GdkX11Keymap
* @state: raw state returned from X
*
* Extracts the group from the state field sent in an X Key event.
* This is only needed for code processing raw X events, since #GdkEventKey
* directly includes an is_modifier field.
*
* Returns: the index of the active keyboard group for the event
*
* Since: 3.6
*/
gint
_gdk_x11_get_group_for_state (GdkDisplay *display,
GdkModifierType state)
gdk_x11_keymap_get_group_for_state (GdkKeymap *keymap,
guint state)
{
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
GdkDisplay *display;
GdkX11Display *display_x11;
g_return_val_if_fail (GDK_IS_X11_KEYMAP (keymap), 0);
display = keymap->display;
display_x11 = GDK_X11_DISPLAY (display);
#ifdef HAVE_XKB
if (display_x11->use_xkb)
@@ -1498,13 +1517,31 @@ gdk_x11_keymap_add_virtual_modifiers (GdkKeymap *keymap,
}
}
/**
* gdk_x11_keymap_key_is_modifier:
* @keymap: a #GdkX11Keymap
* @keycode: the hardware keycode from a key event
*
* Determines whether a particular key code represents a key that
* is a modifier. That is, it's a key that normally just affects
* the keyboard state and the behavior of other keys rather than
* producing a direct effect itself. This is only needed for code
* processing raw X events, since #GdkEventKey directly includes
* an is_modifier field.
*
* Returns: %TRUE if the hardware keycode is a modifier key
*
* Since: 3.6
*/
gboolean
_gdk_x11_keymap_key_is_modifier (GdkKeymap *keymap,
guint keycode)
gdk_x11_keymap_key_is_modifier (GdkKeymap *keymap,
guint keycode)
{
GdkX11Keymap *keymap_x11 = GDK_X11_KEYMAP (keymap);
gint i;
g_return_val_if_fail (GDK_IS_X11_KEYMAP (keymap), FALSE);
update_keyrange (keymap_x11);
if (keycode < keymap_x11->min_keycode ||
keycode > keymap_x11->max_keycode)
-4
View File
@@ -155,12 +155,8 @@ gboolean _gdk_x11_moveresize_configure_done (GdkDisplay *display,
void _gdk_x11_keymap_state_changed (GdkDisplay *display,
XEvent *event);
void _gdk_x11_keymap_keys_changed (GdkDisplay *display);
gint _gdk_x11_get_group_for_state (GdkDisplay *display,
GdkModifierType state);
void _gdk_x11_keymap_add_virt_mods (GdkKeymap *keymap,
GdkModifierType *modifiers);
gboolean _gdk_x11_keymap_key_is_modifier (GdkKeymap *keymap,
guint keycode);
void _gdk_x11_windowing_init (void);
+5 -2
View File
@@ -81,7 +81,9 @@ static const char gdk_settings_names[] =
"Gtk/AutoMnemonics\0" "gtk-auto-mnemonics\0"
"Gtk/VisibleFocus\0" "gtk-visible-focus\0"
"Gtk/ShellShowsAppMenu\0" "gtk-shell-shows-app-menu\0"
"Gtk/ShellShowsMenubar\0" "gtk-shell-shows-menubar\0";
"Gtk/ShellShowsMenubar\0" "gtk-shell-shows-menubar\0"
"Gtk/EnablePrimaryPaste\0" "gtk-enable-primary-paste\0";
static const struct
@@ -137,5 +139,6 @@ static const struct
{ 1730, 1748 },
{ 1767, 1784 },
{ 1802, 1824 },
{ 1849, 1871 }
{ 1849, 1871 },
{ 1895, 1918 }
};
+9 -11
View File
@@ -170,7 +170,10 @@ _gdk_x11_window_get_toplevel (GdkWindow *window)
impl = GDK_WINDOW_IMPL_X11 (window->impl);
if (!impl->toplevel)
impl->toplevel = g_new0 (GdkToplevelX11, 1);
{
impl->toplevel = g_new0 (GdkToplevelX11, 1);
impl->toplevel->have_focused = TRUE;
}
return impl->toplevel;
}
@@ -4076,7 +4079,7 @@ wmspec_send_message (GdkDisplay *display,
(XEvent *)&xclient);
}
static gboolean
static void
handle_wmspec_button_release (GdkDisplay *display,
XEvent *xevent)
{
@@ -4107,11 +4110,8 @@ handle_wmspec_button_release (GdkDisplay *display,
{
display_x11->wm_moveresize_button = 0;
wmspec_send_message (display, window, 0, 0, _NET_WM_MOVERESIZE_CANCEL, 0);
return TRUE;
}
}
return FALSE;
}
static void
@@ -4392,11 +4392,11 @@ _gdk_x11_moveresize_handle_event (XEvent *event)
GdkDisplay *display = gdk_x11_lookup_xdisplay (event->xany.display);
MoveResizeData *mv_resize = get_move_resize_data (display, FALSE);
if (handle_wmspec_button_release (display, event))
return TRUE;
if (!mv_resize || !mv_resize->moveresize_window)
return FALSE;
{
handle_wmspec_button_release (display, event);
return FALSE;
}
button_mask = GDK_BUTTON1_MASK << (mv_resize->moveresize_button - 1);
@@ -4476,8 +4476,6 @@ _gdk_x11_moveresize_configure_done (GdkDisplay *display,
XEvent *tmp_event;
MoveResizeData *mv_resize = get_move_resize_data (display, FALSE);
GDK_X11_DISPLAY (display)->wm_moveresize_button = 0;
if (!mv_resize || window != mv_resize->moveresize_window)
return FALSE;
+7
View File
@@ -42,6 +42,13 @@ typedef struct _GdkX11KeymapClass GdkX11KeymapClass;
GType gdk_x11_keymap_get_type (void);
GDK_AVAILABLE_IN_3_6
gint gdk_x11_keymap_get_group_for_state (GdkKeymap *keymap,
guint state);
GDK_AVAILABLE_IN_3_6
gboolean gdk_x11_keymap_key_is_modifier (GdkKeymap *keymap,
guint keycode);
G_END_DECLS
#endif /* __GDK_X11_KEYMAP_H__ */
+81 -20
View File
@@ -267,6 +267,7 @@ gtk_public_h_sources = \
gtklayout.h \
gtklinkbutton.h \
gtkliststore.h \
gtklistview.h \
gtklockbutton.h \
gtkmain.h \
gtkmenu.h \
@@ -405,7 +406,6 @@ gtk_private_h_sources = \
gtkaccelgroupprivate.h \
gtkaccelmapprivate.h \
gtkallocatedbitmaskprivate.h \
gtkanimationdescription.h \
gtkappchooserprivate.h \
gtkappchoosermodule.h \
gtkappchooseronline.h \
@@ -423,21 +423,43 @@ gtk_private_h_sources = \
gtkcolorscaleprivate.h \
gtkcolorchooserprivate.h \
gtkcontainerprivate.h \
gtkcssanimatedvaluesprivate.h \
gtkcssarrayvalueprivate.h \
gtkcssbgsizevalueprivate.h \
gtkcssbordervalueprivate.h \
gtkcsscomputedvaluesprivate.h \
gtkcsscornervalueprivate.h \
gtkcsscustompropertyprivate.h \
gtkcsseasevalueprivate.h \
gtkcssenginevalueprivate.h \
gtkcssenumvalueprivate.h \
gtkcssimagecrossfadeprivate.h \
gtkcssimagegradientprivate.h \
gtkcssimagelinearprivate.h \
gtkcssimageprivate.h \
gtkcssimageurlprivate.h \
gtkcssimagevalueprivate.h \
gtkcssimagewin32private.h \
gtkcssinheritvalueprivate.h \
gtkcssinitialvalueprivate.h \
gtkcsslookupprivate.h \
gtkcssmatcherprivate.h \
gtkcssnumbervalueprivate.h \
gtkcssparserprivate.h \
gtkcsspositionvalueprivate.h \
gtkcssproviderprivate.h \
gtkcssrepeatvalueprivate.h \
gtkcssrgbavalueprivate.h \
gtkcsssectionprivate.h \
gtkcssselectorprivate.h \
gtkcssshadowsvalueprivate.h \
gtkcssshadowvalueprivate.h \
gtkcssshorthandpropertyprivate.h \
gtkcssstringvalueprivate.h \
gtkcssstylefuncsprivate.h \
gtkcssstylepropertyprivate.h \
gtkcsstransitionprivate.h \
gtkcsstypedvalueprivate.h \
gtkcssvalueprivate.h \
gtkcustompaperunixdialog.h \
gtkentryprivate.h \
@@ -487,9 +509,10 @@ gtk_private_h_sources = \
gtksearchenginesimple.h \
gtkselectionprivate.h \
gtksettingsprivate.h \
gtkshadowprivate.h \
gtksizegroup-private.h \
gtksocketprivate.h \
gtkstyleanimationprivate.h \
gtkstylecascadeprivate.h \
gtkstylecontextprivate.h \
gtkstylepropertiesprivate.h \
gtkstylepropertyprivate.h \
@@ -506,7 +529,6 @@ gtk_private_h_sources = \
gtktextutil.h \
gtkthemingbackgroundprivate.h \
gtkthemingengineprivate.h \
gtktimeline.h \
gtktoolpaletteprivate.h \
gtktreedatalist.h \
gtktreeprivate.h \
@@ -572,7 +594,6 @@ gtk_base_c_sources = \
gtkappchooseronline.c \
gtkapplication.c \
gtkapplicationwindow.c \
gtkanimationdescription.c \
gtkarrow.c \
gtkaspectframe.c \
gtkassistant.c \
@@ -618,23 +639,45 @@ gtk_base_c_sources = \
gtkcombobox.c \
gtkcomboboxtext.c \
gtkcontainer.c \
gtkcssanimatedvalues.c \
gtkcssarrayvalue.c \
gtkcssbgsizevalue.c \
gtkcssbordervalue.c \
gtkcsscomputedvalues.c \
gtkcsscornervalue.c \
gtkcsscustomproperty.c \
gtkcsseasevalue.c \
gtkcssenumvalue.c \
gtkcssenginevalue.c \
gtkcssimage.c \
gtkcssimagecrossfade.c \
gtkcssimagegradient.c \
gtkcssimagelinear.c \
gtkcssimageurl.c \
gtkcssimagevalue.c \
gtkcssimagewin32.c \
gtkcssinheritvalue.c \
gtkcssinitialvalue.c \
gtkcsslookup.c \
gtkcssmatcher.c \
gtkcssnumbervalue.c \
gtkcssparser.c \
gtkcsspositionvalue.c \
gtkcssprovider.c \
gtkcssrepeatvalue.c \
gtkcssrgbavalue.c \
gtkcsssection.c \
gtkcssselector.c \
gtkcssstringvalue.c \
gtkcssshadowsvalue.c \
gtkcssshadowvalue.c \
gtkcssshorthandproperty.c \
gtkcssshorthandpropertyimpl.c \
gtkcssstylefuncs.c \
gtkcssstyleproperty.c \
gtkcssstylepropertyimpl.c \
gtkcsstransition.c \
gtkcsstypedvalue.c \
gtkcssvalue.c \
gtkcsstypes.c \
gtkdialog.c \
@@ -684,6 +727,7 @@ gtk_base_c_sources = \
gtklayout.c \
gtklinkbutton.c \
gtkliststore.c \
gtklistview.c \
gtklockbutton.c \
gtkmain.c \
gtkmarshalers.c \
@@ -748,13 +792,14 @@ gtk_base_c_sources = \
gtksettings.c \
gtksizegroup.c \
gtksizerequest.c \
gtkshadow.c \
gtkshow.c \
gtkspinbutton.c \
gtkspinner.c \
gtkstatusbar.c \
gtkstatusicon.c \
gtkstock.c \
gtkstyleanimation.c \
gtkstylecascade.c \
gtkstylecontext.c \
gtkstyleproperties.c \
gtkstyleproperty.c \
@@ -781,7 +826,6 @@ gtk_base_c_sources = \
gtktextview.c \
gtkthemingbackground.c \
gtkthemingengine.c \
gtktimeline.c \
gtktoggleaction.c \
gtktogglebutton.c \
gtktoggletoolbutton.c \
@@ -865,34 +909,46 @@ gtk_use_win32_c_sources = \
gtk_use_quartz_c_sources = \
gtksearchenginequartz.c \
gtkmountoperation-stub.c \
gtkquartz-menu.h \
gtkquartz-menu.c \
gtkmodelmenu-quartz.c \
gtkquartz.c
gtk_use_stub_c_sources = \
gtkmountoperation-stub.c
gtk_all_c_sources += $(gtk_use_x11_c_sources) $(gtk_use_win32_c_sources) $(gtk_use_quartz_c_sources) $(gtk_use_stub_c_sources)
if USE_X11
gtk_private_h_sources += \
gtk_use_x11_private_h_sources = \
gtkxembed.h \
gtktrayicon.h \
xembed.h
if USE_X11
gtk_c_sources += $(gtk_use_x11_c_sources)
else
if USE_WIN32
gtk_private_h_sources += \
gtk_private_h_sources += $(gtk_use_x11_private_h_sources)
endif
gtk_use_win32_private_h_sources = \
gtkwin32embed.h \
gtkwin32embedwidget.h
if USE_WIN32
gtk_c_sources += $(gtk_use_win32_c_sources)
else
if USE_QUARTZ
gtk_private_h_sources += \
gtk_private_h_sources += $(gtk_use_win32_private_h_sources)
endif
gtk_use_quartz_private_h_sources = \
gtksearchenginequartz.h \
gtkmenuquartz.h \
gtkmodelmenu-quartz.h \
gtkquartz.h
if USE_QUARTZ
gtk_c_sources += $(gtk_use_quartz_c_sources)
libgtk_3_la_CFLAGS = "-xobjective-c"
gtk_private_h_sources += $(gtk_use_quartz_private_h_sources)
endif
else
gtk_all_private_h_sources = \
$(gtk_use_x11_private_h_sources) \
$(gtk_use_win32_private_h_sources) \
$(gtk_use_quartz_private_h_sources)
if !USE_X11
if !USE_WIN32
if !USE_QUARTZ
gtk_c_sources += $(gtk_use_stub_c_sources)
endif
endif
@@ -904,6 +960,7 @@ gtk_clipboard_dnd_c_sources = \
gtkdnd-quartz.c
else
if USE_WAYLAND
if !USE_X11
# No wayland gtkdnd-wayland.c yet
gtk_clipboard_dnd_c_sources = \
gtkclipboard-wayland.c \
@@ -911,6 +968,9 @@ gtk_clipboard_dnd_c_sources = \
else
gtk_clipboard_dnd_c_sources = gtkclipboard.c gtkdnd.c
endif
else
gtk_clipboard_dnd_c_sources = gtkclipboard.c gtkdnd.c
endif
endif
# we use our own built_sources variable rules to avoid automake's
@@ -957,6 +1017,7 @@ gtk_extra_sources = \
gtk-win32-base.css \
gtk-win32.css \
gtk-win32-xp.css \
gtk-win32-classic.css \
gtkversion.h.in \
gtkmarshalers.list \
fallback-c89.c
@@ -971,7 +1032,7 @@ MAINTAINERCLEANFILES = \
stock-icons/icon-theme.cache
EXTRA_HEADERS =
EXTRA_DIST += $(gtk_private_h_sources) $(gtk_extra_sources)
EXTRA_DIST += $(gtk_all_private_h_sources) $(gtk_extra_sources)
EXTRA_DIST += $(gtk_built_sources)
EXTRA_DIST += $(STOCK_ICONS)
@@ -1032,7 +1093,7 @@ gtktypebuiltins.c: @REBUILD@ $(gtk_public_h_sources) $(deprecated_h_sources) gtk
gtkresources.h: gtk.gresource.xml
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/gtk.gresource.xml \
--target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-header --manual-register
gtkresources.c: gtk.gresource.xml gtk-default.css gtk-win32.css $(DND_CURSORS)
gtkresources.c: gtk.gresource.xml gtk-default.css gtk-win32.css gtk-win32-xp.css gtk-win32-base.css gtk-win32-classic.css $(DND_CURSORS)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/gtk.gresource.xml \
--target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-source --manual-register
+1 -1
View File
@@ -226,7 +226,7 @@ get_pixbuf_box (GtkIconView *icon_view,
_gtk_icon_view_set_cell_data (icon_view, item);
gtk_cell_area_foreach_alloc (icon_view->priv->cell_area, context,
GTK_WIDGET (icon_view),
(GdkRectangle *)item, (GdkRectangle *)item,
&item->cell_area, &item->cell_area,
(GtkCellAllocCallback)get_pixbuf_foreach, &data);
return data.pixbuf_found;
+2 -2
View File
@@ -333,7 +333,7 @@ gtk_color_selection_class_init (GtkColorSelectionClass *klass)
GTK_PARAM_READWRITE));
/**
* GtkColorSelection:current-color
* GtkColorSelection:current-color:
*
* The current GdkColor color.
*
@@ -355,7 +355,7 @@ gtk_color_selection_class_init (GtkColorSelectionClass *klass)
GTK_PARAM_READWRITE));
/**
* GtkColorSelection:current-rgba
* GtkColorSelection:current-rgba:
*
* The current RGBA color.
*
+3 -1
View File
@@ -610,7 +610,9 @@ gtk_font_selection_init (GtkFontSelection *fontsel)
*
* Creates a new #GtkFontSelection.
*
* Return value: a n ew #GtkFontSelection
* Return value: a new #GtkFontSelection
*
* Deprecated: 3.2: Use #GtkFontChooserWidget instead
*/
GtkWidget *
gtk_font_selection_new (void)
+12 -1
View File
@@ -53,4 +53,15 @@ rint (double x)
return ceil (x - 0.5);
}
}
#endif
#endif
#ifndef HAVE_NEARBYINT
/* Workaround for nearbyint() for non-GCC/non-C99 compilers */
/* This is quite similar to rint() in most respects */
static inline double
nearbyint (double x)
{
return floor (x + 0.5);
}
#endif
+13 -1
View File
@@ -90,8 +90,20 @@ static gchar **
g_action_muxer_list_actions (GActionGroup *action_group)
{
GActionMuxer *muxer = G_ACTION_MUXER (action_group);
GHashTableIter iter;
gchar *key;
gchar **keys;
gsize i;
return (gchar **) muxer->groups;
keys = g_new (gchar *, g_hash_table_size (muxer->actions) + 1);
i = 0;
g_hash_table_iter_init (&iter, muxer->actions);
while (g_hash_table_iter_next (&iter, (gpointer *) &key, NULL))
keys[i++] = g_strdup (key);
keys[i] = NULL;
return keys;
}
static Group *
-8
View File
@@ -36,10 +36,6 @@ GtkTreeView.view.expander:selected:hover {
color: @text_color;
}
.expander:active {
transition: 200ms linear;
}
*:insensitive {
border-color: shade (@bg_color, 0.7);
background-color: shade (@bg_color, 0.9);
@@ -295,10 +291,6 @@ GtkLabel:selected:focused {
background-color: @selected_bg_color;
}
.spinner:active {
transition: 750ms linear loop;
}
.info {
background-color: @info_bg_color;
color: @info_fg_color;
+1 -5
View File
@@ -77,10 +77,6 @@ GtkFrame {
color: #fff;
}
.spinner:active {
transition: 750ms linear loop;
}
.notebook > GtkScrolledWindow.frame {
border-style: none;
}
@@ -837,4 +833,4 @@ GtkStatusbar > GtkFrame {
background-color: transparent;
background-image: -gtk-win32-theme-part(status, 3 1);
}
*/
*/
+4
View File
@@ -0,0 +1,4 @@
/* We should have a real win32 classic theme that picks up
colors from the settings. But for now, at least don't break
when win32 is in classic mode by just using raleigh. */
@import url("Raleigh.css");
+1
View File
@@ -5,6 +5,7 @@
<file>gtk-win32.css</file>
<file>gtk-win32-xp.css</file>
<file>gtk-win32-base.css</file>
<file>gtk-win32-classic.css</file>
<file alias="cursor/dnd-ask.png">cursor_dnd_ask.png</file>
<file alias="cursor/dnd-link.png">cursor_dnd_link.png</file>
<file alias="cursor/dnd-none.png">cursor_dnd_none.png</file>
+1
View File
@@ -124,6 +124,7 @@
#include <gtk/gtklayout.h>
#include <gtk/gtklinkbutton.h>
#include <gtk/gtkliststore.h>
#include <gtk/gtklistview.h>
#include <gtk/gtklockbutton.h>
#include <gtk/gtkmain.h>
#include <gtk/gtkmenu.h>
+2
View File
@@ -231,6 +231,7 @@ gtk_application_get_app_menu
gtk_application_get_menubar
gtk_application_get_type
gtk_application_get_windows
gtk_application_get_window_by_id
gtk_application_inhibit
gtk_application_inhibit_flags_get_type
gtk_application_is_inhibited
@@ -242,6 +243,7 @@ gtk_application_set_menubar
gtk_application_uninhibit
gtk_application_window_get_show_menubar
gtk_application_window_get_type
gtk_application_window_get_id
gtk_application_window_new
gtk_application_window_set_show_menubar
gtk_arrow_get_type
-175
View File
@@ -1,175 +0,0 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
*
* 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/>.
*/
#include "config.h"
#include "gtkanimationdescription.h"
#include "gtkintl.h"
struct GtkAnimationDescription
{
GtkTimelineProgressType progress_type;
gdouble duration;
guint loop : 1;
guint ref_count;
};
GtkAnimationDescription *
_gtk_animation_description_new (gdouble duration,
GtkTimelineProgressType progress_type,
gboolean loop)
{
GtkAnimationDescription *desc;
desc = g_slice_new (GtkAnimationDescription);
desc->duration = duration;
desc->progress_type = progress_type;
desc->loop = loop;
desc->ref_count = 1;
return desc;
}
gdouble
_gtk_animation_description_get_duration (GtkAnimationDescription *desc)
{
return desc->duration;
}
GtkTimelineProgressType
_gtk_animation_description_get_progress_type (GtkAnimationDescription *desc)
{
return desc->progress_type;
}
gboolean
_gtk_animation_description_get_loop (GtkAnimationDescription *desc)
{
return (desc->loop != 0);
}
GtkAnimationDescription *
_gtk_animation_description_ref (GtkAnimationDescription *desc)
{
desc->ref_count++;
return desc;
}
void
_gtk_animation_description_unref (GtkAnimationDescription *desc)
{
desc->ref_count--;
if (desc->ref_count == 0)
g_slice_free (GtkAnimationDescription, desc);
}
GtkAnimationDescription *
_gtk_animation_description_from_string (const gchar *str)
{
gchar timing_function[16] = { 0, };
gchar duration_unit[3] = { 0, };
gchar loop_str[5] = { 0, };
GtkTimelineProgressType progress_type;
guint duration = 0;
gboolean loop;
if (sscanf (str, "%d%2s %15s %5s", &duration, duration_unit, timing_function, loop_str) == 4)
loop = TRUE;
else if (sscanf (str, "%d%2s %15s", &duration, duration_unit, timing_function) == 3)
loop = FALSE;
else
return NULL;
if (strcmp (duration_unit, "s") == 0)
duration *= 1000;
else if (strcmp (duration_unit, "ms") != 0)
{
g_warning ("Unknown duration unit: %s\n", duration_unit);
return NULL;
}
if (strcmp (timing_function, "linear") == 0)
progress_type = GTK_TIMELINE_PROGRESS_LINEAR;
else if (strcmp (timing_function, "ease") == 0)
progress_type = GTK_TIMELINE_PROGRESS_EASE;
else if (strcmp (timing_function, "ease-in") == 0)
progress_type = GTK_TIMELINE_PROGRESS_EASE_IN;
else if (strcmp (timing_function, "ease-out") == 0)
progress_type = GTK_TIMELINE_PROGRESS_EASE_OUT;
else if (strcmp (timing_function, "ease-in-out") == 0)
progress_type = GTK_TIMELINE_PROGRESS_EASE_IN_OUT;
else
{
g_warning ("Unknown timing function: %s\n", timing_function);
return NULL;
}
return _gtk_animation_description_new ((gdouble) duration, progress_type, loop);
}
void
_gtk_animation_description_print (GtkAnimationDescription *desc,
GString *str)
{
int duration;
g_return_if_fail (desc != NULL);
g_return_if_fail (str != NULL);
duration = desc->duration;
if (duration % 1000 == 0)
g_string_append_printf (str, "%ds", (int) desc->duration / 1000);
else
g_string_append_printf (str, "%dms", (int) desc->duration);
switch (desc->progress_type)
{
case GTK_TIMELINE_PROGRESS_LINEAR:
g_string_append (str, " linear");
break;
case GTK_TIMELINE_PROGRESS_EASE:
g_string_append (str, " ease");
break;
case GTK_TIMELINE_PROGRESS_EASE_IN:
g_string_append (str, " ease-in");
break;
case GTK_TIMELINE_PROGRESS_EASE_OUT:
g_string_append (str, " ease-out");
break;
case GTK_TIMELINE_PROGRESS_EASE_IN_OUT:
g_string_append (str, " ease-in-out");
break;
default:
g_assert_not_reached ();
}
if (desc->loop)
g_string_append (str, " loop");
}
GType
_gtk_animation_description_get_type (void)
{
static GType type = 0;
if (G_UNLIKELY (!type))
type = g_boxed_type_register_static (I_("GtkAnimationDescription"),
(GBoxedCopyFunc) _gtk_animation_description_ref,
(GBoxedFreeFunc) _gtk_animation_description_unref);
return type;
}
-49
View File
@@ -1,49 +0,0 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
*
* 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/>.
*/
#ifndef __GTK_ANIMATION_DESCRIPTION_H__
#define __GTK_ANIMATION_DESCRIPTION_H__
#include "gtktimeline.h"
G_BEGIN_DECLS
/* Dummy typedefs */
typedef struct GtkAnimationDescription GtkAnimationDescription;
#define GTK_TYPE_ANIMATION_DESCRIPTION (_gtk_animation_description_get_type ())
GType _gtk_animation_description_get_type (void) G_GNUC_CONST;
GtkAnimationDescription * _gtk_animation_description_new (gdouble duration,
GtkTimelineProgressType progress_type,
gboolean loop);
gdouble _gtk_animation_description_get_duration (GtkAnimationDescription *desc);
GtkTimelineProgressType _gtk_animation_description_get_progress_type (GtkAnimationDescription *desc);
gboolean _gtk_animation_description_get_loop (GtkAnimationDescription *desc);
GtkAnimationDescription * _gtk_animation_description_ref (GtkAnimationDescription *desc);
void _gtk_animation_description_unref (GtkAnimationDescription *desc);
GtkAnimationDescription * _gtk_animation_description_from_string (const gchar *str);
void _gtk_animation_description_print (GtkAnimationDescription *desc,
GString *string);
G_END_DECLS
#endif /* __GTK_ANIMATION_DESCRIPTION_H__ */
+57 -38
View File
@@ -37,7 +37,7 @@
#include "gtkintl.h"
#ifdef GDK_WINDOWING_QUARTZ
#include "gtkquartz-menu.h"
#include "gtkmodelmenu-quartz.h"
#import <Cocoa/Cocoa.h>
#include <Carbon/Carbon.h>
#include "gtkmessagedialog.h"
@@ -149,7 +149,7 @@ struct _GtkApplicationPrivate
#ifdef GDK_WINDOWING_X11
GDBusConnection *session_bus;
const gchar *application_id;
gchar *object_path;
const gchar *object_path;
gchar *app_menu_path;
guint app_menu_id;
@@ -185,6 +185,9 @@ gtk_application_x11_publish_menu (GtkApplication *application,
{
gint i;
if (application->priv->session_bus == NULL)
return;
/* unexport any existing menu */
if (*id)
{
@@ -252,8 +255,8 @@ gtk_application_window_added_x11 (GtkApplication *application,
guint window_id;
window_id = application->priv->next_id++;
window_path = g_strdup_printf ("%s/window/%d", application->priv->object_path, window_id);
success = gtk_application_window_publish (app_window, application->priv->session_bus, window_path);
window_path = g_strdup_printf ("%s/window/%u", application->priv->object_path, window_id);
success = gtk_application_window_publish (app_window, application->priv->session_bus, window_path, window_id);
g_free (window_path);
}
while (!success);
@@ -271,34 +274,13 @@ gtk_application_window_removed_x11 (GtkApplication *application,
gtk_application_window_unpublish (GTK_APPLICATION_WINDOW (window));
}
static gchar *
object_path_from_appid (const gchar *appid)
{
gchar *appid_path, *iter;
appid_path = g_strconcat ("/", appid, NULL);
for (iter = appid_path; *iter; iter++)
{
if (*iter == '.')
*iter = '/';
if (*iter == '-')
*iter = '_';
}
return appid_path;
}
static void gtk_application_startup_session_dbus (GtkApplication *app);
static void
gtk_application_startup_x11 (GtkApplication *application)
{
const gchar *application_id;
application_id = g_application_get_application_id (G_APPLICATION (application));
application->priv->session_bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
application->priv->object_path = object_path_from_appid (application_id);
application->priv->session_bus = g_application_get_dbus_connection (G_APPLICATION (application));
application->priv->object_path = g_application_get_dbus_object_path (G_APPLICATION (application));
gtk_application_startup_session_dbus (GTK_APPLICATION (application));
}
@@ -306,9 +288,8 @@ gtk_application_startup_x11 (GtkApplication *application)
static void
gtk_application_shutdown_x11 (GtkApplication *application)
{
g_free (application->priv->object_path);
application->priv->session_bus = NULL;
application->priv->object_path = NULL;
g_clear_object (&application->priv->session_bus);
g_clear_object (&application->priv->sm_proxy);
g_clear_object (&application->priv->client_proxy);
@@ -316,12 +297,6 @@ gtk_application_shutdown_x11 (GtkApplication *application)
g_free (application->priv->client_path);
}
const gchar *
gtk_application_get_dbus_object_path (GtkApplication *application)
{
return application->priv->object_path;
}
const gchar *
gtk_application_get_app_menu_object_path (GtkApplication *application)
{
@@ -526,6 +501,10 @@ gtk_application_init (GtkApplication *application)
application->priv = G_TYPE_INSTANCE_GET_PRIVATE (application,
GTK_TYPE_APPLICATION,
GtkApplicationPrivate);
#ifdef GDK_WINDOWING_X11
application->priv->next_id = 1;
#endif
}
static void
@@ -784,8 +763,8 @@ gtk_application_class_init (GtkApplicationClass *class)
* as soon as the application gets registered as the primary instance.
*
* Concretely, gtk_init() is called in the default handler for the
* startup() signal. Therefore, #GtkApplication subclasses should
* chain up in their startup() handler before using any GTK+ API.
* #GApplication:startup signal. Therefore, #GtkApplication subclasses should
* chain up in their #GApplication:startup handler before using any GTK+ API.
*
* Note that commandline arguments are not passed to gtk_init().
* All GTK+ functionality that is available via commandline arguments
@@ -820,7 +799,7 @@ gtk_application_new (const gchar *application_id,
* @application: a #GtkApplication
* @window: a #GtkWindow
*
* Adds a window from @application.
* Adds a window to @application.
*
* This call is equivalent to setting the #GtkWindow:application
* property of @window to @application.
@@ -898,6 +877,34 @@ gtk_application_get_windows (GtkApplication *application)
return application->priv->windows;
}
/**
* gtk_application_get_window_by_id:
* @application: a #GtkApplication
* @id: an identifier number
*
* Returns: (transfer none): the #GtkApplicationWindow with ID @id, or
* %NULL if there is no window with this ID
*
* Since: 3.6
*/
GtkWindow *
gtk_application_get_window_by_id (GtkApplication *application,
guint id)
{
GList *l;
g_return_val_if_fail (GTK_IS_APPLICATION (application), NULL);
for (l = application->priv->windows; l != NULL; l = l->next)
{
if (GTK_IS_APPLICATION_WINDOW (l->data) &&
gtk_application_window_get_id (GTK_APPLICATION_WINDOW (l->data)) == id)
return l->data;
}
return NULL;
}
/**
* gtk_application_add_accelerator:
* @application: a #GtkApplication
@@ -999,6 +1006,10 @@ gtk_application_remove_accelerator (GtkApplication *application,
*
* Sets or unsets the application menu for @application.
*
* This can only be done in the primary instance of the application,
* after it has been registered. #GApplication:startup is a good place
* to call this.
*
* The application menu is a single menu containing items that typically
* impact the application as a whole, rather than acting on a specific
* window or document. For example, you would expect to see
@@ -1018,6 +1029,8 @@ gtk_application_set_app_menu (GtkApplication *application,
GMenuModel *app_menu)
{
g_return_if_fail (GTK_IS_APPLICATION (application));
g_return_if_fail (g_application_get_is_registered (G_APPLICATION (application)));
g_return_if_fail (!g_application_get_is_remote (G_APPLICATION (application)));
if (app_menu != application->priv->app_menu)
{
@@ -1067,6 +1080,10 @@ gtk_application_get_app_menu (GtkApplication *application)
*
* This is a menubar in the traditional sense.
*
* This can only be done in the primary instance of the application,
* after it has been registered. #GApplication:startup is a good place
* to call this.
*
* Depending on the desktop environment, this may appear at the top of
* each window, or at the top of the screen. In some environments, if
* both the application menu and the menubar are set, the application
@@ -1085,6 +1102,8 @@ gtk_application_set_menubar (GtkApplication *application,
GMenuModel *menubar)
{
g_return_if_fail (GTK_IS_APPLICATION (application));
g_return_if_fail (g_application_get_is_registered (G_APPLICATION (application)));
g_return_if_fail (!g_application_get_is_remote (G_APPLICATION (application)));
if (menubar != application->priv->menubar)
{
+4
View File
@@ -115,6 +115,10 @@ GDK_AVAILABLE_IN_3_4
gboolean gtk_application_is_inhibited (GtkApplication *application,
GtkApplicationInhibitFlags flags);
GDK_AVAILABLE_IN_3_6
GtkWindow * gtk_application_get_window_by_id (GtkApplication *application,
guint id);
G_END_DECLS
#endif /* __GTK_APPLICATION_H__ */
+2 -3
View File
@@ -27,7 +27,8 @@
G_GNUC_INTERNAL
gboolean gtk_application_window_publish (GtkApplicationWindow *window,
GDBusConnection *session,
const gchar *object_path);
const gchar *object_path,
guint object_id);
G_GNUC_INTERNAL
void gtk_application_window_unpublish (GtkApplicationWindow *window);
@@ -43,8 +44,6 @@ GActionObservable * gtk_application_window_get_observable (GtkAppl
G_GNUC_INTERNAL
GtkAccelGroup * gtk_application_window_get_accel_group (GtkApplicationWindow *window);
G_GNUC_INTERNAL
const gchar * gtk_application_get_dbus_object_path (GtkApplication *application);
G_GNUC_INTERNAL
const gchar * gtk_application_get_app_menu_object_path (GtkApplication *application);
G_GNUC_INTERNAL
+77 -7
View File
@@ -35,6 +35,10 @@
#include <gdk/x11/gdkx.h>
#endif
#ifdef HAVE_GIO_UNIX
#include <gio/gdesktopappinfo.h>
#endif
/**
* SECTION:gtkapplicationwindow
* @title: GtkApplicationWindow
@@ -214,6 +218,8 @@ struct _GtkApplicationWindowPrivate
GDBusConnection *session;
gchar *object_path;
guint export_id;
guint id;
};
static void
@@ -253,6 +259,32 @@ gtk_application_window_update_menubar (GtkApplicationWindow *window)
}
}
static gchar *
gtk_application_window_get_app_desktop_name (void)
{
gchar *retval = NULL;
#ifdef HAVE_GIO_UNIX
GDesktopAppInfo *app_info;
const gchar *app_name = NULL;
gchar *desktop_file;
desktop_file = g_strconcat (g_get_prgname (), ".desktop", NULL);
app_info = g_desktop_app_info_new (desktop_file);
g_free (desktop_file);
if (app_info != NULL)
app_name = g_app_info_get_name (G_APP_INFO (app_info));
if (app_name != NULL)
retval = g_strdup (app_name);
g_clear_object (&app_info);
#endif /* HAVE_GIO_UNIX */
return retval;
}
static void
gtk_application_window_update_shell_shows_app_menu (GtkApplicationWindow *window,
GtkSettings *settings)
@@ -278,12 +310,25 @@ gtk_application_window_update_shell_shows_app_menu (GtkApplicationWindow *window
if (app_menu != NULL)
{
const gchar *name;
const gchar *app_name;
gchar *name;
app_name = g_get_application_name ();
if (app_name != g_get_prgname ())
{
/* the app has set its application name, use it */
name = g_strdup (app_name);
}
else
{
/* get the name from .desktop file */
name = gtk_application_window_get_app_desktop_name ();
if (name == NULL)
name = g_strdup (_("Application"));
}
name = g_get_application_name ();
if (name == g_get_prgname ())
name = _("Application");
g_menu_append_submenu (window->priv->app_menu_section, name, app_menu);
g_free (name);
}
}
}
@@ -725,7 +770,7 @@ gtk_application_window_real_realize (GtkWidget *widget)
gdkwindow = gtk_widget_get_window (GTK_WIDGET (window));
if (GDK_IS_X11_WINDOW (gdkwindow))
if (GDK_IS_X11_WINDOW (gdkwindow) && window->priv->session)
{
gdk_x11_window_set_utf8_property (gdkwindow, "_GTK_APPLICATION_ID",
g_application_get_application_id (G_APPLICATION (application)));
@@ -734,7 +779,7 @@ gtk_application_window_real_realize (GtkWidget *widget)
g_dbus_connection_get_unique_name (window->priv->session));
gdk_x11_window_set_utf8_property (gdkwindow, "_GTK_APPLICATION_OBJECT_PATH",
gtk_application_get_dbus_object_path (application));
g_application_get_dbus_object_path (G_APPLICATION (application)));
gdk_x11_window_set_utf8_property (gdkwindow, "_GTK_WINDOW_OBJECT_PATH",
window->priv->object_path);
@@ -766,11 +811,13 @@ gtk_application_window_real_unrealize (GtkWidget *widget)
gboolean
gtk_application_window_publish (GtkApplicationWindow *window,
GDBusConnection *session,
const gchar *object_path)
const gchar *object_path,
guint object_id)
{
g_assert (window->priv->session == NULL);
g_assert (window->priv->export_id == 0);
g_assert (window->priv->object_path == NULL);
g_assert (window->priv->id == 0);
window->priv->export_id = g_dbus_connection_export_action_group (session, object_path,
G_ACTION_GROUP (window->priv->actions),
@@ -781,6 +828,7 @@ gtk_application_window_publish (GtkApplicationWindow *window,
window->priv->session = session;
window->priv->object_path = g_strdup (object_path);
window->priv->id = object_id;
return TRUE;
}
@@ -791,10 +839,12 @@ gtk_application_window_unpublish (GtkApplicationWindow *window)
g_assert (window->priv->session != NULL);
g_assert (window->priv->export_id != 0);
g_assert (window->priv->object_path != NULL);
g_assert (window->priv->id != 0);
g_dbus_connection_unexport_action_group (window->priv->session, window->priv->export_id);
window->priv->session = NULL;
window->priv->export_id = 0;
window->priv->id = 0;
g_free (window->priv->object_path);
window->priv->object_path = NULL;
@@ -1043,3 +1093,23 @@ gtk_application_window_get_accel_group (GtkApplicationWindow *window)
{
return window->priv->accels;
}
/**
* gtk_application_window_get_id:
* @window: a #GtkApplicationWindow
*
* Returns the unique ID of the window. If the window has not yet been added to
* a #GtkApplication, returns <literal>0</literal>.
*
* Returns: the unique ID for @window, or <literal>0</literal> if the window
* has not yet been added to a #GtkApplication
*
* Since: 3.6
*/
guint
gtk_application_window_get_id (GtkApplicationWindow *window)
{
g_return_val_if_fail (GTK_IS_APPLICATION_WINDOW (window), 0);
return window->priv->id;
}
+3
View File
@@ -67,6 +67,9 @@ void gtk_application_window_set_show_menubar (GtkApplicationWindow *windo
GDK_AVAILABLE_IN_3_4
gboolean gtk_application_window_get_show_menubar (GtkApplicationWindow *window);
GDK_AVAILABLE_IN_3_6
guint gtk_application_window_get_id (GtkApplicationWindow *window);
G_END_DECLS
#endif /* __GTK_APPLICATION_WINDOW_H__ */
+1 -1
View File
@@ -391,7 +391,7 @@ gtk_button_box_get_child_secondary (GtkButtonBox *widget,
}
/**
* gtk_button_box_set_child_secondary
* gtk_button_box_set_child_secondary:
* @widget: a #GtkButtonBox
* @child: a child of @widget
* @is_secondary: if %TRUE, the @child appears in a secondary group of the
+51 -38
View File
@@ -25,6 +25,10 @@
#include <math.h>
#include "gtkborderimageprivate.h"
#include "gtkcssbordervalueprivate.h"
#include "gtkcssimagevalueprivate.h"
#include "gtkcssnumbervalueprivate.h"
#include "gtkcssrepeatvalueprivate.h"
#include "gtkstylepropertiesprivate.h"
#include "gtkthemingengineprivate.h"
@@ -37,23 +41,13 @@ gboolean
_gtk_border_image_init (GtkBorderImage *image,
GtkThemingEngine *engine)
{
GtkBorder *width;
image->source = _gtk_css_value_get_object (_gtk_theming_engine_peek_property (engine, "border-image-source"));
image->source = _gtk_css_image_value_get_image (_gtk_theming_engine_peek_property (engine, GTK_CSS_PROPERTY_BORDER_IMAGE_SOURCE));
if (image->source == NULL)
return FALSE;
image->slice = *(GtkBorder *) _gtk_css_value_get_boxed (_gtk_theming_engine_peek_property (engine, "border-image-slice"));
width = _gtk_css_value_get_boxed (_gtk_theming_engine_peek_property (engine, "border-image-width"));
if (width)
{
image->width = *width;
image->has_width = TRUE;
}
else
image->has_width = FALSE;
image->repeat = *_gtk_css_value_get_border_image_repeat (_gtk_theming_engine_peek_property (engine, "border-image-repeat"));
image->slice = _gtk_theming_engine_peek_property (engine, GTK_CSS_PROPERTY_BORDER_IMAGE_SLICE);
image->width = _gtk_theming_engine_peek_property (engine, GTK_CSS_PROPERTY_BORDER_IMAGE_WIDTH);
image->repeat = _gtk_theming_engine_peek_property (engine, GTK_CSS_PROPERTY_BORDER_IMAGE_REPEAT);
return TRUE;
}
@@ -65,20 +59,38 @@ struct _GtkBorderImageSliceSize {
};
static void
gtk_border_image_compute_border_size (GtkBorderImageSliceSize sizes[3],
double offset,
double area_size,
int start_border,
int end_border)
gtk_border_image_compute_border_size (GtkBorderImageSliceSize sizes[3],
double offset,
double area_size,
int start_border_width,
int end_border_width,
const GtkCssValue *start_border,
const GtkCssValue *end_border)
{
/* This code assumes area_size >= start_border + end_border */
double start, end;
if (_gtk_css_number_value_get_unit (start_border) == GTK_CSS_NUMBER)
start = start_border_width * _gtk_css_number_value_get (start_border, 100);
else
start = _gtk_css_number_value_get (start_border, area_size);
if (_gtk_css_number_value_get_unit (end_border) == GTK_CSS_NUMBER)
end = end_border_width * _gtk_css_number_value_get (end_border, 100);
else
end = _gtk_css_number_value_get (end_border, area_size);
/* XXX: reduce vertical and horizontal by the same factor */
if (start + end > area_size)
{
start = start * area_size / (start + end);
end = end * area_size / (start + end);
}
sizes[0].offset = offset;
sizes[0].size = start_border;
sizes[1].offset = offset + start_border;
sizes[1].size = area_size - start_border - end_border;
sizes[2].offset = offset + area_size - end_border;
sizes[2].size = end_border;
sizes[0].size = start;
sizes[1].offset = offset + start;
sizes[1].size = area_size - start - end;
sizes[2].offset = offset + area_size - end;
sizes[2].size = end;
}
static void
@@ -90,8 +102,8 @@ gtk_border_image_render_slice (cairo_t *cr,
double y,
double width,
double height,
GtkCssBorderRepeatStyle hrepeat,
GtkCssBorderRepeatStyle vrepeat)
GtkCssRepeatStyle hrepeat,
GtkCssRepeatStyle vrepeat)
{
double hscale, vscale;
double xstep, ystep;
@@ -236,9 +248,6 @@ _gtk_border_image_render (GtkBorderImage *image,
double source_width, source_height;
int h, v;
if (image->has_width)
border_width = &image->width;
_gtk_css_image_get_concrete_size (image->source,
0, 0,
width, height,
@@ -252,22 +261,26 @@ _gtk_border_image_render (GtkBorderImage *image,
gtk_border_image_compute_slice_size (horizontal_slice,
source_width,
image->slice.left,
image->slice.right);
_gtk_css_number_value_get (_gtk_css_border_value_get_left (image->slice), source_width),
_gtk_css_number_value_get (_gtk_css_border_value_get_right (image->slice), source_width));
gtk_border_image_compute_slice_size (vertical_slice,
source_height,
image->slice.top,
image->slice.bottom);
_gtk_css_number_value_get (_gtk_css_border_value_get_top (image->slice), source_height),
_gtk_css_number_value_get (_gtk_css_border_value_get_bottom (image->slice), source_height));
gtk_border_image_compute_border_size (horizontal_border,
x,
width,
border_width->left,
border_width->right);
border_width->right,
_gtk_css_border_value_get_left (image->width),
_gtk_css_border_value_get_right (image->width));
gtk_border_image_compute_border_size (vertical_border,
y,
height,
border_width->top,
border_width->bottom);
border_width->bottom,
_gtk_css_border_value_get_top (image->width),
_gtk_css_border_value_get_bottom(image->width));
for (v = 0; v < 3; v++)
{
@@ -298,8 +311,8 @@ _gtk_border_image_render (GtkBorderImage *image,
vertical_border[v].offset,
horizontal_border[h].size,
vertical_border[v].size,
h == 1 ? image->repeat.hrepeat : GTK_CSS_REPEAT_STYLE_STRETCH,
v == 1 ? image->repeat.vrepeat : GTK_CSS_REPEAT_STYLE_STRETCH);
h == 1 ? _gtk_css_border_repeat_value_get_x (image->repeat) : GTK_CSS_REPEAT_STYLE_STRETCH,
v == 1 ? _gtk_css_border_repeat_value_get_y (image->repeat) : GTK_CSS_REPEAT_STYLE_STRETCH);
cairo_surface_destroy (slice);
}
+4 -5
View File
@@ -24,8 +24,8 @@
#include "gtkborder.h"
#include "gtkcssimageprivate.h"
#include "gtkcssvalueprivate.h"
#include "gtkthemingengine.h"
#include "gtkcsstypesprivate.h"
G_BEGIN_DECLS
@@ -34,10 +34,9 @@ typedef struct _GtkBorderImage GtkBorderImage;
struct _GtkBorderImage {
GtkCssImage *source;
GtkBorder slice;
gboolean has_width;
GtkBorder width;
GtkCssBorderImageRepeat repeat;
GtkCssValue *slice;
GtkCssValue *width;
GtkCssValue *repeat;
};
gboolean _gtk_border_image_init (GtkBorderImage *image,
+9 -2
View File
@@ -85,6 +85,7 @@
#include "gtktypebuiltins.h"
#include "gtksizerequest.h"
#include "gtkwidgetpath.h"
#include "gtkwidgetprivate.h"
#include "a11y/gtkboxaccessible.h"
@@ -898,7 +899,7 @@ gtk_box_get_path_for_child (GtkContainer *container,
box = GTK_BOX (container);
private = box->priv;
path = gtk_widget_path_copy (gtk_widget_get_path (GTK_WIDGET (container)));
path = _gtk_widget_create_path (GTK_WIDGET (container));
if (gtk_widget_get_visible (child))
{
@@ -937,11 +938,17 @@ gtk_box_get_path_for_child (GtkContainer *container,
return path;
}
static void
gtk_box_invalidate_order_foreach (GtkWidget *widget)
{
_gtk_widget_invalidate_style_context (widget, GTK_CSS_CHANGE_POSITION | GTK_CSS_CHANGE_SIBLING_POSITION);
}
static void
gtk_box_invalidate_order (GtkBox *box)
{
gtk_container_foreach (GTK_CONTAINER (box),
(GtkCallback) gtk_widget_reset_style,
(GtkCallback) gtk_box_invalidate_order_foreach,
NULL);
}
+4 -4
View File
@@ -963,15 +963,15 @@ end_element (GMarkupParseContext *context,
else if (strcmp (element_name, "interface") == 0)
{
}
else if (strcmp (element_name, "menu") == 0)
{
_gtk_builder_menu_end (data);
}
else if (data->requested_objects && !data->inside_requested_object)
{
/* If outside a requested object, simply ignore this tag */
return;
}
else if (strcmp (element_name, "menu") == 0)
{
_gtk_builder_menu_end (data);
}
else if (strcmp (element_name, "object") == 0)
{
ObjectInfo *object_info = state_pop_info (data, ObjectInfo);
+9 -27
View File
@@ -1677,15 +1677,12 @@ gtk_button_size_allocate (GtkWidget *widget,
}
}
void
_gtk_button_paint (GtkButton *button,
cairo_t *cr,
int width,
int height,
GtkStateFlags state)
static gboolean
gtk_button_draw (GtkWidget *widget,
cairo_t *cr)
{
GtkButton *button = GTK_BUTTON (widget);
GtkButtonPrivate *priv = button->priv;
GtkWidget *widget;
gint x, y;
GtkBorder default_border;
GtkBorder default_outside_border;
@@ -1694,13 +1691,12 @@ _gtk_button_paint (GtkButton *button,
gint focus_pad;
GtkAllocation allocation;
GtkStyleContext *context;
GtkStateFlags state;
gboolean draw_focus;
gint width, height;
widget = GTK_WIDGET (button);
context = gtk_widget_get_style_context (widget);
gtk_style_context_save (context);
gtk_style_context_set_state (context, state);
state = gtk_style_context_get_state (context);
gtk_button_get_props (button, &default_border, &default_outside_border, NULL, NULL, &interior_focus);
gtk_style_context_get_style (context,
@@ -1712,6 +1708,8 @@ _gtk_button_paint (GtkButton *button,
x = 0;
y = 0;
width = allocation.width;
height = allocation.height;
if (gtk_widget_has_default (widget) &&
priv->relief == GTK_RELIEF_NORMAL)
@@ -1720,8 +1718,6 @@ _gtk_button_paint (GtkButton *button,
y += default_border.top;
width -= default_border.left + default_border.right;
height -= default_border.top + default_border.bottom;
gtk_style_context_add_class (context, GTK_STYLE_CLASS_DEFAULT);
}
else if (gtk_widget_get_can_default (widget))
{
@@ -1789,20 +1785,6 @@ _gtk_button_paint (GtkButton *button,
gtk_render_focus (context, cr, x, y, width, height);
}
gtk_style_context_restore (context);
}
static gboolean
gtk_button_draw (GtkWidget *widget,
cairo_t *cr)
{
GtkButton *button = GTK_BUTTON (widget);
_gtk_button_paint (button, cr,
gtk_widget_get_allocated_width (widget),
gtk_widget_get_allocated_height (widget),
gtk_widget_get_state_flags (widget));
GTK_WIDGET_CLASS (gtk_button_parent_class)->draw (widget, cr);
return FALSE;
-5
View File
@@ -63,11 +63,6 @@ struct _GtkButtonPrivate
void _gtk_button_set_depressed (GtkButton *button,
gboolean depressed);
void _gtk_button_paint (GtkButton *button,
cairo_t *cr,
int width,
int height,
GtkStateFlags state);
G_END_DECLS
+3 -3
View File
@@ -610,7 +610,7 @@ gtk_calendar_class_init (GtkCalendarClass *class)
/**
* GtkCalendar:inner-border
* GtkCalendar:inner-border:
*
* The spacing around the day/week headers and main area.
*/
@@ -622,7 +622,7 @@ gtk_calendar_class_init (GtkCalendarClass *class)
GTK_PARAM_READABLE));
/**
* GtkCalndar:vertical-separation
* GtkCalndar:vertical-separation:
*
* Separation between day headers and main area.
*/
@@ -634,7 +634,7 @@ gtk_calendar_class_init (GtkCalendarClass *class)
GTK_PARAM_READABLE));
/**
* GtkCalendar:horizontal-separation
* GtkCalendar:horizontal-separation:
*
* Separation between week headers and main area.
*/
+1 -1
View File
@@ -2335,7 +2335,7 @@ gtk_cell_area_attribute_disconnect (GtkCellArea *area,
}
/**
* gtk_cell_area_apply_attributes
* gtk_cell_area_apply_attributes:
* @area: a #GtkCellArea
* @tree_model: the #GtkTreeModel to pull values from
* @iter: the #GtkTreeIter in @tree_model to apply values for
-1
View File
@@ -38,7 +38,6 @@
#undef GDK_DEPRECATED_FOR
#define GDK_DEPRECATED
#define GDK_DEPRECATED_FOR(f)
#undef GTK_DISABLE_DEPRECATED
#include "deprecated/gtkstyle.h"
+60 -6
View File
@@ -107,7 +107,8 @@ enum {
PROP_MAX_WIDTH_CHARS,
PROP_WRAP_WIDTH,
PROP_ALIGN,
PROP_PLACEHOLDER_TEXT,
/* Style args */
PROP_BACKGROUND,
PROP_FOREGROUND,
@@ -171,6 +172,7 @@ struct _GtkCellRendererTextPrivate
PangoWrapMode wrap_mode;
gchar *text;
gchar *placeholder_text;
gdouble font_scale;
@@ -619,7 +621,22 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
PANGO_TYPE_ALIGNMENT,
PANGO_ALIGN_LEFT,
GTK_PARAM_READWRITE));
/**
* GtkCellRendererText:placeholder-text:
*
* The text that will be displayed in the #GtkCellRenderer if
* #GtkCellRendererText:editable is %TRUE and the cell is empty.
*
* Since 3.6
*/
g_object_class_install_property (object_class,
PROP_PLACEHOLDER_TEXT,
g_param_spec_string ("placeholder-text",
P_("Placeholder text"),
P_("Text rendered when an editable cell is empty"),
NULL,
GTK_PARAM_READWRITE));
/* Style props are set or not */
@@ -691,7 +708,7 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
P_("Whether this tag affects the alignment mode"));
/**
* GtkCellRendererText::edited
* GtkCellRendererText::edited:
* @renderer: the object which received the signal
* @path: the path identifying the edited cell
* @new_text: the new text
@@ -726,6 +743,7 @@ gtk_cell_renderer_text_finalize (GObject *object)
pango_font_description_free (priv->font);
g_free (priv->text);
g_free (priv->placeholder_text);
if (priv->extra_attrs)
pango_attr_list_unref (priv->extra_attrs);
@@ -950,6 +968,10 @@ gtk_cell_renderer_text_get_property (GObject *object,
g_value_set_int (value, priv->max_width_chars);
break;
case PROP_PLACEHOLDER_TEXT:
g_value_set_string (value, priv->placeholder_text);
break;
case PROP_BACKGROUND:
case PROP_FOREGROUND:
case PROP_MARKUP:
@@ -1510,7 +1532,12 @@ gtk_cell_renderer_text_set_property (GObject *object,
case PROP_ALIGN_SET:
priv->align_set = g_value_get_boolean (value);
break;
case PROP_PLACEHOLDER_TEXT:
g_free (priv->placeholder_text);
priv->placeholder_text = g_value_dup_string (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
break;
@@ -1536,6 +1563,15 @@ gtk_cell_renderer_text_new (void)
return g_object_new (GTK_TYPE_CELL_RENDERER_TEXT, NULL);
}
static inline gboolean
show_placeholder_text (GtkCellRendererText *celltext)
{
GtkCellRendererTextPrivate *priv = celltext->priv;
return priv->editable && priv->placeholder_text &&
(!priv->text || !priv->text[0]);
}
static void
add_attr (PangoAttrList *attr_list,
PangoAttribute *attr)
@@ -1557,8 +1593,10 @@ get_layout (GtkCellRendererText *celltext,
PangoLayout *layout;
PangoUnderline uline;
gint xpad;
gboolean placeholder_layout = show_placeholder_text (celltext);
layout = gtk_widget_create_pango_layout (widget, priv->text);
layout = gtk_widget_create_pango_layout (widget, placeholder_layout ?
priv->placeholder_text : priv->text);
gtk_cell_renderer_get_padding (GTK_CELL_RENDERER (celltext), &xpad, NULL);
@@ -1569,7 +1607,7 @@ get_layout (GtkCellRendererText *celltext,
pango_layout_set_single_paragraph_mode (layout, priv->single_paragraph);
if (cell_area)
if (!placeholder_layout && cell_area)
{
/* Add options that affect appearance but not size */
@@ -1594,6 +1632,22 @@ get_layout (GtkCellRendererText *celltext,
add_attr (attr_list,
pango_attr_strikethrough_new (priv->strikethrough));
}
else if (placeholder_layout)
{
PangoColor color;
GtkStyleContext *context;
GdkRGBA fg = { 0.5, 0.5, 0.5 };
context = gtk_widget_get_style_context (widget);
gtk_style_context_lookup_color (context, "placeholder_text_color", &fg);
color.red = CLAMP (fg.red * 65535. + 0.5, 0, 65535);
color.green = CLAMP (fg.green * 65535. + 0.5, 0, 65535);
color.blue = CLAMP (fg.blue * 65535. + 0.5, 0, 65535);
add_attr (attr_list,
pango_attr_foreground_new (color.red, color.green, color.blue));
}
add_attr (attr_list, pango_attr_font_desc_new (priv->font));
+7 -7
View File
@@ -192,7 +192,7 @@ gtk_cell_view_class_init (GtkCellViewClass *klass)
GTK_PARAM_WRITABLE));
/**
* GtkCellView:background-gdk
* GtkCellView:background-gdk:
*
* The background color as a #GdkColor
*
@@ -206,7 +206,7 @@ gtk_cell_view_class_init (GtkCellViewClass *klass)
GDK_TYPE_COLOR,
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
/**
* GtkCellView:background-rgba
* GtkCellView:background-rgba:
*
* The background color as a #GdkRGBA
*
@@ -221,7 +221,7 @@ gtk_cell_view_class_init (GtkCellViewClass *klass)
GTK_PARAM_READWRITE));
/**
* GtkCellView:model
* GtkCellView:model:
*
* The model for cell view
*
@@ -237,7 +237,7 @@ gtk_cell_view_class_init (GtkCellViewClass *klass)
/**
* GtkCellView:cell-area
* GtkCellView:cell-area:
*
* The #GtkCellArea rendering cells
*
@@ -255,7 +255,7 @@ gtk_cell_view_class_init (GtkCellViewClass *klass)
GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
/**
* GtkCellView:cell-area-context
* GtkCellView:cell-area-context:
*
* The #GtkCellAreaContext used to compute the geometry of the cell view.
*
@@ -280,7 +280,7 @@ gtk_cell_view_class_init (GtkCellViewClass *klass)
GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
/**
* GtkCellView:draw-sensitive
* GtkCellView:draw-sensitive:
*
* Whether all cells should be draw as sensitive for this view regardless
* of the actual cell properties (used to make menus with submenus appear
@@ -298,7 +298,7 @@ gtk_cell_view_class_init (GtkCellViewClass *klass)
GTK_PARAM_READWRITE));
/**
* GtkCellView:fit-model
* GtkCellView:fit-model:
*
* Whether the view should request enough space to always fit
* the size of every row in the model (used by the combo box to
+3 -3
View File
@@ -1816,7 +1816,7 @@ gtk_clipboard_wait_is_uris_available (GtkClipboard *clipboard)
}
/**
* gtk_clipboard_wait_for_targets
* gtk_clipboard_wait_for_targets:
* @clipboard: a #GtkClipboard
* @targets: (out) (array length=n_targets) (transfer container): location
* to store an array of targets. The result stored here must
@@ -1824,9 +1824,9 @@ gtk_clipboard_wait_is_uris_available (GtkClipboard *clipboard)
* @n_targets: location to store number of items in @targets.
*
* Returns a list of targets that are present on the clipboard, or %NULL
* if there aren't any targets available. The returned list must be
* if there aren't any targets available. The returned list must be
* freed with g_free().
* This function waits for the data to be received using the main
* This function waits for the data to be received using the main
* loop, so events, timeouts, etc, may be dispatched during the wait.
*
* Return value: %TRUE if any targets are present on the clipboard,
+1 -10
View File
@@ -60,8 +60,6 @@
#define CHECK_DARK (1.0 / 3.0)
#define CHECK_LIGHT (2.0 / 3.0)
#define COLOR_SAMPLE_MARGIN 1
struct _GtkColorButtonPrivate
{
GtkWidget *draw_area; /* Widget where we draw the color sample */
@@ -437,19 +435,12 @@ gtk_color_button_init (GtkColorButton *button)
gtk_widget_push_composite_child ();
button->priv->draw_area = gtk_drawing_area_new ();
g_object_set (button->priv->draw_area,
"margin-top", COLOR_SAMPLE_MARGIN,
"margin-bottom", COLOR_SAMPLE_MARGIN,
"margin-left", 16,
"margin-right", 16,
NULL);
layout = gtk_widget_create_pango_layout (GTK_WIDGET (button), "Black");
pango_layout_get_pixel_extents (layout, NULL, &rect);
g_object_unref (layout);
gtk_widget_set_size_request (button->priv->draw_area,
rect.width, rect.height - 2 * COLOR_SAMPLE_MARGIN);
rect.width, rect.height);
g_signal_connect (button->priv->draw_area, "draw",
G_CALLBACK (gtk_color_button_draw_cb), button);
+9 -2
View File
@@ -41,6 +41,7 @@
#include "gtktreeselection.h"
#include "gtkseparator.h"
#include "gtkwidgetpath.h"
#include "gtkwidgetprivate.h"
#include "gtkwindow.h"
#include "gtktypebuiltins.h"
#include "gtkprivate.h"
@@ -1381,11 +1382,17 @@ gtk_combo_box_button_state_flags_changed (GtkWidget *widget,
gtk_widget_queue_draw (widget);
}
static void
gtk_combo_box_invalidate_order_foreach (GtkWidget *widget)
{
_gtk_widget_invalidate_style_context (widget, GTK_CSS_CHANGE_POSITION | GTK_CSS_CHANGE_SIBLING_POSITION);
}
static void
gtk_combo_box_invalidate_order (GtkComboBox *combo_box)
{
gtk_container_forall (GTK_CONTAINER (combo_box),
(GtkCallback) gtk_widget_reset_style,
(GtkCallback) gtk_combo_box_invalidate_order_foreach,
NULL);
}
@@ -1408,7 +1415,7 @@ gtk_combo_box_get_path_for_child (GtkContainer *container,
GtkWidgetPath *sibling_path;
int pos;
path = gtk_widget_path_copy (gtk_widget_get_path (GTK_WIDGET (container)));
path = _gtk_widget_create_path (GTK_WIDGET (container));
if (gtk_widget_get_visible (child))
{

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