Compare commits

...

291 Commits

Author SHA1 Message Date
Ryan Lortie 4ca9f40769 GtkMenuTrackerItem: track submenu shown state
Before, the best you could do is request submenu shown and then just
show the submenu.  It's now possible to track when the application tells
you that it has become ready.
2013-05-13 09:22:39 -04:00
Ryan Lortie 26e5e44dc6 GtkMenuTracker: add new_from_item_submenu()
Creates a menu tracker for the submenu of an existing item, filling in
about half of the parameters for the new tracker from the correct values
in the menuitem.

Add also a "has-submenu" boolean property so implementations can just
use this to check if they should do the submenu, without having to
handle a GMenuModel at all.
2013-05-10 14:52:59 -04:00
Ryan Lortie c2b9d3f5db fix indentation in gtkmenutracker.h 2013-05-10 14:52:58 -04:00
Jasper St. Pierre cbc844e7ca menushell: Drop support for all items but label for submenus 2013-05-10 14:52:58 -04:00
Jasper St. Pierre c818cc431a menushell: Rearrange and fix indentation 2013-05-10 14:52:58 -04:00
Jasper St. Pierre c1eeb96126 Add more introspection fixes 2013-05-10 14:52:58 -04:00
Jasper St. Pierre 0d05a8f37a Add some more introspection / doc fixes 2013-05-10 14:52:58 -04:00
Jasper St. Pierre 39e99b0987 docs: Fix section names
for the new class names
2013-05-10 14:52:58 -04:00
Jasper St. Pierre 2258dd9a75 gtkactionmuxer: Fix introspection issues 2013-05-10 14:52:58 -04:00
Ryan Lortie 6b394b89ba Action/menu stuff: remove G_GNUC_INTERNAL use
We don't need this anymore with Gtk's new export handling and it's
causing trouble for other users of these files.
2013-05-10 14:52:58 -04:00
Ryan Lortie 9e9bccbaaf Change include style for another file
The shell wants to transplant our GtkActionObserver/GtkActionObservable
code now as well, so change to ""-style #includes there.
2013-05-10 14:52:57 -04:00
Ryan Lortie ab2129016b stop abusing GLib's namespace
Rename our internal GActionMuxer, GActionObserver and GActionObservable
classes and interfaces to have names in our own namespace.

These classes were originally intended for GIO but turned out to be too
special-purpose to be useful there, so we never made them public API but
have just been copying them around (without bothering to properly rename
them).  Now that other people will be copying them out of Gtk, it's even
more important to prevent this namespace abuse from spreading further.
2013-05-10 14:52:57 -04:00
Ryan Lortie 357a390fe9 GtkMenuTrackerItem: clean up "role" a bit
This property was combining something static (item is separator?) with
something dynamic (which state indicator shall we draw?).  Split that
out by making is_separator a separate property and clarify things a bit
by renaming the "toggle" role to "check".
2013-05-10 14:52:57 -04:00
Ryan Lortie 691b37adb2 Revert "GtkMenuTracker: become a proper GObject"
This reverts commit df502861bd09ef269c5ed2edd95ac55852bee06e.

It turns out that Jasper is happier wrapping this object than using it
directly which means we can avoid some of the overhead when using it
inside of Gtk as well.
2013-05-10 14:52:57 -04:00
Ryan Lortie 972374cc30 GtkMenuTracker: Change #include style to ""
The #include <gtk/...> lines were causing trouble for Jasper as he tried
to copy/paste this code into gnome-shell, so switch to using "" instead.
2013-05-10 14:52:57 -04:00
Ryan Lortie 2869f3c492 Fix a leak in GtkMenuTrackerItem 2013-05-10 14:52:57 -04:00
Ryan Lortie 7520eb6996 Fix logic error in GtkMenuTrackerItem 2013-05-10 14:52:57 -04:00
Ryan Lortie 7d3b8ad9bc GtkMenuTrackerItem: Unbreak accels
Forgot to port this one small part over.  Add it back.
2013-05-10 14:52:57 -04:00
Ryan Lortie a96fc95d6d GtkMenuTracker: become a proper GObject
Turn GtkMenuTracker into a GObject with "insert" and "remove" signals
for the sake of accessibility from language bindings.
2013-05-10 14:52:57 -04:00
Ryan Lortie 81845aded9 add GtkMenuTrackerItem
Add a new class, GtkMenuTrackerItem that represents a menu item, to be
used with GtkMenuTracker.

GtkMenuTracker's insert callback now works in terms of this new type
(instead of passing reference to the model and an index to the item).

GtkMenuShell now handles all of the binding tasks internally, mostly
through the use of property bindings.  Having bindings for the label and
visibility attributes, in partiular, will help with supporting upcoming
extensions to GMenuModel.

GtkModelMenu has been reduced to a helper class that has nothing to do
with GMenuModel.  It represents something closer to an "ideal" API for
GtkMenuItem if we didn't have compatibility concerns (eg: not emitting
"activate" when setting toggle state, no separate subclasses per menu
item type, supporting icons, etc.) Improvements to GtkMenuItem could
eventually shrink the size of this class or remove the need for it
entirely.

Some GtkActionHelper functionality has been duplicated in
GtkMenuTracker, which is suboptimal.  The duplication exists so that
other codebases (such as Unity and gnome-shell) can reuse the
GtkMenuTracker code, whereas GtkActionHelper is very much tied to
GtkWidget.  Supporting binding arbitrary GtkWidgets to actions vs.
supporting the full range of GMenuModel features for menu items turns
out to be two overlapping but not entirely similar problems.  Some of
the duplication (such as roles) can be removed from GtkActionHelper once
Gtk's internal Mac OS menubar support is ported to GtkMenuTracker.

The intent to reuse the code outside of Gtk is also the reason for the
unusual treatment of the enum type introduced in this comment.
2013-05-10 14:52:56 -04:00
Ryan Lortie 71e221e51a tests: make GtkMenu test more flexible
We were using gtk_menu_item_get_label() from a testcase to determine the
label associated with a menu item.  Future changes to GtkModelMenuItem
will cause this to stop working, so try a bit harder to find a label
inside of the item.
2013-05-10 14:52:56 -04:00
Matthias Clasen 31fd014c93 Add more window-size related tests 2013-05-10 13:55:00 -04:00
Colin Walters 33f6730249 GtkBookmarksManager: Only save if we have data to save
Otherwise we write an empty file, which is lame.
2013-05-09 16:48:38 -04:00
Colin Walters 4f01c0b159 GtkBookmarksManager: Ensure parent directory exists when saving
Otherwise we fail when the user doesn't have ~/.config yet.
2013-05-09 16:48:03 -04:00
Benjamin Otte 20e8675106 widget: Remove unused variable 2013-05-09 19:09:50 +02:00
Benjamin Otte ecaf09c918 build: remove --disable-rebuilds
It's unused and was only useful when perl wasn't installed. But perl is
a dependency of glib these days, so it's useless.
2013-05-09 19:09:50 +02:00
Colin Walters a8da29b8db Add --enable-installed-tests, use it for reftests
See https://live.gnome.org/GnomeGoals/InstalledTests

https://bugzilla.gnome.org/show_bug.cgi?id=699601
2013-05-09 19:09:49 +02:00
Benjamin Otte 2c1d7cf074 reftests: Automatically recurse into directories 2013-05-09 19:09:49 +02:00
Benjamin Otte a74f47b235 configure: Don't check for indent
indent was used in genmarshal.pl, which was removed in 2002 when gobject
was created.
2013-05-09 19:09:49 +02:00
Colin Walters f297549139 reftests: Add a --directory/-d option
This sets the directory we chdir() to, so we can use relative filenames
in ui files.

Some properties like to take filenames...
2013-05-09 19:09:49 +02:00
Colin Walters 9e57d388e3 reftests: Split out shell scripts from tests
They are just utilities to create tests, don't dump them in with the
tests.

This is in preparation for installed tests.
2013-05-09 19:09:49 +02:00
Colin Walters dc216cf537 reftests: Use $(NULL) in the Makefile 2013-05-09 19:09:49 +02:00
Matthias Clasen 1800dc4709 Remove gtk_widget_size_allocate from gtk_menu_popup_for_device
GtkMenu calls gtk_widget_size_allocate on its GtkWindow during
gtk_menu_popup_for_device if the menu has not been realised. This can cause the
allocation of the GtkWindow and the size of the GdkWindow to become out of sync
because a top level GtkWindow does not attempt to re-size the GdkWindow when
its allocation is set.
https://bugzilla.gnome.org/show_bug.cgi?id=695120
2013-05-09 12:06:05 -04:00
Ryan Lortie 434dfc20c7 GtkCheckMenuItem: remove an unused boolean field
always_show_toggle was always set to TRUE in _init() and never changed
from anywhere else.  Remove it and remove the if() statements based on
it.

https://bugzilla.gnome.org/show_bug.cgi?id=699929
2013-05-09 12:04:41 -04:00
Matthias Clasen b9b196abe3 Fix a typo
Pointed out in bug
https://bugzilla.gnome.org/show_bug.cgi?id=698051
2013-05-09 12:03:09 -04:00
Marek Kasik bdf40603d5 printing: Don't crash when printer-state-message not provided
Check whether "printer-state-message" was returned before its
usage.

https://bugzilla.gnome.org/show_bug.cgi?id=699750
2013-05-09 15:13:59 +02:00
Stefan Sauer a725b06363 label: fix return value type for _draw()
Change from gint to gboolean.
2013-05-08 22:05:56 +02:00
Matthias Clasen c77e12a215 Make key themes work again
This was inadvertedly broken in commit
44ba5d253f.
Thanks to Matthew Francis for tracking this down and providing
a fix in https://bugzilla.gnome.org/show_bug.cgi?id=699901
2013-05-08 10:21:36 -04:00
Alexander Larsson 63a35b6f9c gdkwindow: Don't enforce a native window for a custom visual
In the ancient X days you could have Xservers that had multiple active windows, like
one truecolor and one 8bit palette. Then most apps ran in 8bpp but a single window
would use truecolor. This is done by specifying different visuals for the windows.

To make this work we ensured that a window with a visual different from its parent
gets a native subwindow, so that X can tell the hardware to do its magic.

These days the only real time we get two different visual is when one is a rgba visual
and the other is not. So, the code to check this doesn't really do anything but
get in the way when someone accidentally manages to not get a rgba visual on
a child window (see bb7054b508). So, to avoid
such errors we just remove the "different visual than parent" check.
2013-05-08 15:57:58 +02:00
Alexander Larsson bb7054b508 overlay/paned: Ensure we set the right visual on windows
This was always "needed", but the problems with not doing it
now are worse, since any CSD window will have a nonstandard
rgba visual.
2013-05-08 15:51:00 +02:00
Jiro Matsuzawa 35a14cec0b l10n: Update Japanese translation 2013-05-08 21:16:47 +09:00
Rico Tzschichholz d08d7f2c5a Remove abi checking scripts (2)
In addition to 019ad96479
2013-05-07 17:34:32 +02:00
Alexander Larsson 8ae7defad5 GtkPixelCache: Free cache if not used in 20 seconds
No need to keep a performance enhancing cache around if its not
actually in use.
2013-05-07 16:40:24 +02:00
Alexander Larsson e90fab2b83 gdkwindow: Expose all native windows
We need to send exposes for all native windows, even the ones
without an exposure mask set, because otherwise non-native
children of the native window with an exposure mask will
not be drawn.
2013-05-07 16:40:24 +02:00
Alexander Larsson e2c8a95af6 GtkStack: Fix double-draw in crossfade
We should only draw the cross-fade on the bin window, not doing this
was causing us to draw it multiple times using ADD which resulted
in weird colors.
2013-05-07 16:40:24 +02:00
Alexander Larsson 3610005191 gdkwindow: Avoid some unnecessary typechecks
This removes the typechecks in GDK_WINDOW_TYPE and GDK_WINDOW_DESTROYED. These
are only used internally in gdkwindow.c and gdkdisplay.c anyway,  and these
functions check for typesafety of arguments on function entry.
2013-05-07 16:40:24 +02:00
Alexander Larsson 0600d3d7e4 GtkWidget: Use gdk_window_get_children_for_user_data
This makes iterating over the children a lot faster, as we're
not doing lots of intra-library calls and type checks. We're still
in some sence O(n^2) since we iterate over each child window for each
widget, but the profiles look much better.
2013-05-07 16:40:24 +02:00
Alexander Larsson adffcf8af6 Add gdk_window_get_children_with_user_data
This function returns all the children that has a specific user_data set.
This is used a lot in the new GtkWidget drawing code and doing
it this way is faster than getting every child and calling get_user_data
on each (which was a non-neglible part of the profiles). Additionally it
also allows use to use some kind of hashtable to make this operation even
faster if needed in the future.
2013-05-07 16:40:17 +02:00
Alexander Larsson cad751c762 GtkTreeView: port to PixelCache
We register an invalidate handler on the bin window to get told
of child widget invalidations, although we manually need to discard
invalidates from the scroll operation.

Additionally we invalidate all of the pixel cache whenever
the TreeView itself is queue_draw()n to handle e.g. style (bg)
changes, or changes due to model changes causing queue_draw() in
the tree view.
2013-05-07 16:34:05 +02:00
Alexander Larsson 2df27ce7f8 Make GtkViewport use GtkPixelCache
Since gdk_window_move() no longer uses XCopyArea all scrolling
now re-renders everything in the window. To get performance
back we use a GtkPixelCache to store already drawn children,
and we when we expose the viewport we just blit the
offscreen to the right place.
2013-05-07 16:34:05 +02:00
Alexander Larsson dde714386d GtkPixelCache: Add debug feature to track redraws
Each time we redraw we tint it in a different color so that
you can see which regions are redrawn.
2013-05-07 16:34:05 +02:00
Alexander Larsson 30dc399b72 Add GtkPixelCache
GtkPixelCache is a helper utility that lets you implement
faster scrolling of a viewport of a canvas by using an
offscreen pixmap cache.

You call _gtk_pixel_cache_draw with a callback function that
does the drawing, and additionally you specify the size and the
position of the viewport in the widget, and the position and size
of the canvas wrt the viewport. The callback will be called to
draw on an offscreen surface, and the surface will be drawn
on the window. The next time you do the same, any already drawn
pieces of the surface are re-used from the offscreen and need
not be rendered again.

If things inside the canvas change you need to call
_gtk_pixel_cache_invalidate to tell the cache about this.

Some other details:

* The offscreen surface is generally a bit larger than
  the viewport, so scrolling a small amount can often
  be done without redrawing children.
* If the canvas is not larger than the viewport no
  offscreen surface is used.

GtkPixelCache: Make sure we always copy using SOURCE

We were using OVER for the first copy (from source to group surface.

GtkPixelCache: Fix x/y typos

GtkPixelCache: Allow NULL for invalidate region

gtkpixelcache: Use CONTENT_COLOR for solid bg windows
2013-05-07 16:34:05 +02:00
Alexander Larsson cb2882a273 GtkWidget: Add a vfunc for queue_draw_region
Since widgets now cache drawn state we allow them to override
queue_draw_region to detect when some region of the widget
should be redrawn. For instance, if a widget draws the
background color in a pixel cache we will need to invalidate
that when the style context changes which queues a repaint.
2013-05-07 16:34:05 +02:00
Alexander Larsson e13fb1d3e0 Add gdk_window_set_invalidate_handler
This lets you register callbacks for when child widgets invalidate
areas of the window read it and/or change it.

For instance, this lets you do rendering effects and keeping offscreen
caches uptodate.
2013-05-07 16:34:04 +02:00
Alexander Larsson 590366f0e7 wayland: Don't use double buffers for wayland when not needed
If we got the release event for the last buffer then we're
fine with writing directly to the window surface, as wayland
will not be looing at it. This saves us from allocating
and copying more data.
2013-05-07 16:33:01 +02:00
Alexander Larsson 6115961175 gdkwindow: Make GdkPaintable normal GdkWindowImpl vfuncs
There is no need for this to be a separate interface, its just looking
weird.
2013-05-07 16:33:01 +02:00
Alexander Larsson e09b4fa029 gdkwindow: Change how paints work
First of all, we now only do paints on native windows, as there is
really no reason anymore to do it for subwindows. Secondly, we
keep track of the paints even for GtkPaintable windows, but for
that case we don't create the offscreen surface, but rather
assume the windowing system does the backing store.
2013-05-07 16:33:01 +02:00
Alexander Larsson 6c7689506f GtkWindow: Move cairo_save/restore from marshaller
We do the save/restore when emitting ::draw rather than in a custom
marshaller, as this saves an extra stack frame, which is helpfull now
that we do painting fully recursive. This is also likely to save a few
cycles.
2013-05-07 16:33:01 +02:00
Alexander Larsson c3bff30b50 gdkframeclock: Loop the layout phase if needed
In the case where the layout phase queued a layout we don't
want to progress to the paint phase with invalid allocations, so
we loop the layout. This shouldn't normally happen, but it may
happen in some edge cases like if user/wm resizes clash with
natural window size changes from a gtk widget. This should not
generally loop though, so we detect this after 4 cycles and
print a warning.

This was detected because of an issue in GtkWindow where it
seems to incorrectly handle the case of a user interactive resize.
It seems gtk_window_move_resize() believes that configure_request_size_changed
changed due to hitting some corner case so it calls
gtk_widget_queue_resize_no_redraw(), marking the window as need_alloc
after the layout phase. This commit fixes the issue, but we should
also look into if we can fix that.
2013-05-07 16:33:01 +02:00
Alexander Larsson e0ca53ff7c gdkwindow: Simplify invalidation
Now that all windows are non-opaque we can simplify the invalidation
a lot. There is no need to clip the invalidate area to child regions,
because we will always redraw everything under all the children.
We only have to handle native childen specially.
2013-05-07 16:33:01 +02:00
Alexander Larsson fe0982818d gdkwindow: Remove implicit paints
We now only do one expose event per native window, so there will
only be one begin/end_paint() call. This means all the work with
implicit paints to combine the paints on a single double buffer
surface is unnecessary, so we can just delete it.
2013-05-07 16:33:01 +02:00
Alexander Larsson d22fd7223c Only handle exposes on native window, propagate to children via draw()
We now consider non-native windows non-opaque, which means any invalid
area in a subwindow will also be invalid all the way up to the nearest
native windows. We take advantage of this by ignoring all expose events
on non-native windows (which typically means just the toplevel) and instead
propagating down the draw() calls to children directly via
gtk_container_propagate_draw.

This is nice as it means we always draw widgets the same way, and it
will let us do some interesting ways in the future.

We also clean up the GtkWidget opacity handling as we can now always
rely on the draing happening via cairo.

We can't really just draw by walking down the widget hierarchy, as
this doesn't get the clipping right (so e.g. widgets doing cairo_paint
may draw outside the expected gdkwindow subarea) nor does it let
us paint window backgrounds.

So, we now do multiple draws for each widget, once for each GdkWindow,
although we still do it on the same base cairo_t that we get for the
toplevel native window. The difference is only the clipping, the rendering
order, and which other widgets we propagate into.

We also collect all the windows of a widget so we can expose them inside
the same opacity group if needed.

NOTE: This change neuters gtk_widget_set_double_buffered for
widgets without native windows. Its impossible to disable
the double buffering in this model.
2013-05-07 16:33:01 +02:00
Alexander Larsson fc645f2865 gdkwindow: Remove ancient USE_BACKING_STORE define
This is always set anyway.
2013-05-07 16:33:01 +02:00
Alexander Larsson 1f986ff953 gdkwindow: Simplify clip region calculations
Since we no longer make overlapping siblings affect clip_region we
can further simplify the clip region calculation and updating.
2013-05-07 16:33:01 +02:00
Alexander Larsson 5773cf237c gdkwindow: Simplify clip region handling
Since we dropped the move region optimization there is really no need
to try carefully keep track of opaque non-overlapped regions, as we
don't use this information to trigger the optimization anymore.

So, by assuming that all windows are non-opaque we can vastly simplify
the clip region stuff. First of all, we don't need clip_region_with_children,
as each window will need to draw under all children anyway. Secondly, we
don't remove overlapping sibling areas from clip_region, as these are
all non-opaque anyway and we need to draw under them

Finally, we don't need to track the layered region anymore as its
essentially unused. The few times something like it is needed we can
compute it explicitly.

For the case of native children of widgets we may cause a repaint
under native windows that are guaranteed to be opaque, but these
will be clipped by the native child anyway.
2013-05-07 16:33:01 +02:00
Alexander Larsson 19560bf0d4 gdkwindow: Remove translate vfunc
This is not used anymore
2013-05-07 16:33:00 +02:00
Alexander Larsson da2a1eac1b gdkwindow: Remove outstanding_moves stuff
Since we now never move regions directly on the window we can
remove all the stuff that track outstanding moves and flushes then.
2013-05-07 16:33:00 +02:00
Alexander Larsson 6a478ea672 gdk: Don't ever do copies from the window
This basically neuters gdk_window_move_region, gdk_window_scroll
and gdk_window_move_resize, in that they now never copy any bits but
just invalidate the source and destination regions. This is a performance
loss, but the hope is that the simplifications it later allows will let
us recover this performance loss (which mainly affects scrolling).
2013-05-07 16:33:00 +02:00
Matthias Clasen e9122eca68 Add more test cases
These are taken from
https://bugzilla.gnome.org/show_bug.cgi?id=696882
2013-05-07 08:54:05 -04:00
Benjamin Otte 30a49f1d66 imcontexts: Include config.h first 2013-05-07 14:06:12 +02:00
Benjamin Otte 19fcd12177 reftests: Make window size not influence test
The test is supposed to definitely wrap, make sure it does.
2013-05-07 14:06:11 +02:00
Benjamin Otte a0aa367458 checkbutton: Implement height-for-width 2013-05-07 14:06:11 +02:00
Benjamin Otte 4ea26b619b checkbutton: Split out a common function
Makes size request / allocation code easier to understand.
2013-05-07 14:06:11 +02:00
Kalev Lember 34c0deb006 GtkPlacesSidebar: Fix an uninitialized variable in the error code path
Initialize it to NULL early so that we won't try to free an
uninitialized variable when handling an error.
2013-05-07 14:01:54 +02:00
Kalev Lember 19e6db7997 gtksizegroup: Add explicit braces to avoid dangling else
Otherwise the else after the for loop becomes attached to the wrong if.
2013-05-07 13:59:53 +02:00
Matthias Clasen 1391a0be1c Add a testcase for the dnd window breakage 2013-05-07 06:11:42 -04:00
Matthias Clasen 019ad96479 Remove abi checking scripts
The exported symbols are now controlled explicitly from the headers,
no need to double-check.
2013-05-07 06:01:18 -04:00
Yaron Shahrabani 6ecf634f54 Updated Hebrew translation. 2013-05-07 11:25:25 +03:00
Alexander Larsson c6a5b800c2 GtkEventBox: Correctly handle height for width
We need to pass on the width to the child.

https://bugzilla.gnome.org/show_bug.cgi?id=699140
2013-05-06 17:49:58 +02:00
Alexander Larsson dcb84f158b css shadow: Add extra slop to the blur clipping
Turns out our blurring function isn't very nice, it has a lot
of energy past the blur radius, so clipping at exactly the
blur radius causes ugly gradient stops. This just adds 4
extra pixels of slop, which makes this better in most cases.
2013-05-06 16:20:04 +02:00
Alexander Larsson 66d3b5a9cd css shadows: Split up rendering of shadows
We split up the rendering of blurred shadows into 9 parts, the
corners, the sides and the rest. This lets us only blur the "blurry"
part, and it lets us completely skip blurry parts that are fully
clipped.
2013-05-06 16:20:04 +02:00
Alexander Larsson 5ba5306dc9 css shadows: Exit early if clip is empty 2013-05-06 16:20:03 +02:00
Alexander Larsson 70774bf978 GtkCssShadowValue: Break out the shadow rendering code
This makes it easier to call it multiple times which we
want to do later.
2013-05-06 16:20:03 +02:00
Alexander Larsson c91e706e2b css: Clip outset box-shadow to outside of box
As per css3-background 7.2. Drop Shadows: the ‘box-shadow’ property:

  An outer box-shadow casts a shadow as if the border-box of the element
  were opaque. The shadow is drawn outside the border edge only: it
  is clipped inside the border-box of the element.

Also verified vs firefox behaviour.
2013-05-06 16:20:03 +02:00
Stef Walter ed1eddabf0 gtksettings: Fix loading of uint settings
https://bugzilla.gnome.org/show_bug.cgi?id=699739
2013-05-06 14:20:48 +02:00
Matthias Clasen ec724fe0fd Remove regex-based export control
All export control is now happening through annotations
in the headers.
2013-05-05 15:38:48 -04:00
Matthias Clasen 92597da3a0 Add visibility flags in gtk/a11y 2013-05-05 15:38:48 -04:00
Matthias Clasen feedd371f6 New visibility handling in gtk 2013-05-05 15:38:48 -04:00
Matthias Clasen 8af16c5d44 New visibility handling in gdk
Change the visibility handling to be the same way we do it in
GLib now. We pass -fvisibility=hidden to gcc and decorate public
functions with __attribute__((visibility("default"))).

This commit just does this for GDK, GTK+ will follow later.
2013-05-05 15:38:48 -04:00
Matthias Clasen f5f5b70355 Ignore deprecations where needed
There are a few places where we are still using deprecated
API internally - ignore deprecations around these uses.
2013-05-05 15:38:48 -04:00
Matthias Clasen 7d8e755d16 Fix up headerless symbols
Some symbols are exported from GTK+, but do not appear in any
headers. For these, use _GDK_EXTERN in the source file to make
sure they are exported.
2013-05-05 15:38:47 -04:00
Matthias Clasen 4cec2337ab Add annotations in a11y headers 2013-05-05 15:38:47 -04:00
Matthias Clasen 20c8c8b91c Add annotations to gtk headers
Add annotations to all exported functions in GTK+ headers.
2013-05-05 15:38:47 -04:00
Matthias Clasen 8470eb84c0 gtk: Use GDK_AVAILABLE_IN_ALL for generated enum types
glib-mkenums is not currently clever enough to know which version an
enum type was added in, so just mark all the _get_type() functions as
available in all versions.
2013-05-05 15:38:47 -04:00
Matthias Clasen 28fb54256b Just ignore deprecations inside deprecated/
Not worth tracking uses of deprecated API individually here.
2013-05-05 15:38:47 -04:00
Matthias Clasen 9c0486a726 Use _GDK_EXTERN when defining the decorators
Make all GDK_DEPRECATED and GDK_AVAILABLE macros use a
new _GDK_EXTERN macro. _GDK_EXTERN defaults to just 'extern'
but a subsequent commit will add visibility handling to it
while building GTK+.
2013-05-05 15:38:47 -04:00
Matthias Clasen ca81028901 Add GDK_AVAILABLE_IN_ALL annotations in gdk
This is in preparation to modernizing our handing
of exported symbols.
2013-05-05 15:38:46 -04:00
Matthias Clasen 96d1a1e9c5 Use GDK_AVAILABLE_IN_ALL for generated enum types
glib-mkenums is not currently clever enough to know which version an
enum type was added in, so just mark all the _get_type() functions as
available in all versions.
2013-05-05 15:38:46 -04:00
Matthias Clasen baab7acf08 gdkversionmacros.h: add GDK_AVAILABLE_IN_ALL
Add a macro to declare that a particular symbol is available in all
versions of GTK+.

All newly-added symbols should have proper version macros (like
GDK_AVAILABLE_IN_3_4).
2013-05-05 15:38:46 -04:00
Matthias Clasen 265e617f0a gtk-demo: Include config.h first
If config.h is included after gdkversionmacros.h, _GDK_EXTERN
gets redefined and cpp doesn't like that.
2013-05-05 15:38:46 -04:00
Matthias Clasen 0b3461ff1b gtk-demo: Don't include config.h needlessly
It is not needed here.
2013-05-05 15:38:46 -04:00
Matthias Clasen 111cc604f5 Remove an unused private function
_gtk_text_layout_get_line_xrange was not exported and not used
inside GTK+ either.
2013-05-05 15:38:46 -04:00
Victor Ibragimov 5462961243 Updated Tajik Translation 2013-05-05 19:22:27 +05:00
Matthias Clasen 3b4804bbf1 Always use gint for border_width
This avoids an evil trap when doing MAX (..., ... - 2 * border_width)
and the expression on the right gets promoted to unsigned, instead
of going negative as you would expect.
https://bugzilla.gnome.org/show_bug.cgi?id=699633
2013-05-04 19:21:56 -04:00
Ignacio Casal Quinteiro 38688cad00 window: handle titlebar property for the buildable interface 2013-05-04 23:04:55 +02:00
Matthias Clasen 96e0d9db72 Some window size test tweaks
Draw a checkerboard pattern, and add an interactive mode that
waits for events before moving on. This makes it easier to see
when a size is wrong.
2013-05-04 16:16:20 -04:00
Matthias Clasen 7fd0836567 Add some more GtkWindow tests
These tests check that a toplevel window ends up with the expected
size after setting default sizes or resizing. It currently passes
on X, but fails with client-side decorations under X and Wayland.
2013-05-04 16:16:11 -04:00
Matthias Clasen e61df371c9 Prevent criticals when initializing a Wayland display
When we call _gdk_wayland_display_load_cursor_theme during
the initial opening of the first display, gdk_setting_get does
not work yet, since it relies on the default display/screen
being set, which only happens after open returns.
Instead, just use the screen of this display.
2013-05-04 16:13:09 -04:00
Matthias Clasen ed5ef04127 Fix setting child properties
This was broken in e9f182e37a
2013-05-03 22:29:20 -04:00
Matthias Clasen 97caad1fec Don't clear data on a NULL screen
This makes GtkSettings survive the object finalize test.
2013-05-03 20:05:00 -04:00
John Ralls 3ca0a39fa9 Bug 606378 - gdk doesn't handle non-main thread rendering on Quartz
Document that the restrictions on Win32 apply also to Quartz.
2013-05-03 16:45:03 -07:00
Stefan Sauer b8366027b3 widget: fix two typos in api-docs 2013-05-03 20:40:00 +02:00
Colin Walters 41bf557012 reftests: Don't use spaces in Makefile first line
Otherwise Emacs makes one's life miserable.
2013-05-03 11:08:51 -04:00
Guillaume Desmottes c15a7877e9 treemodelsort: destroy the root only if we are removing the latest row of the level
GtkIconView doesn't ref the rows of the model so we have to make sure that a
level is actually empty before destroying it.

https://bugzilla.gnome.org/show_bug.cgi?id=698846
2013-05-03 13:06:08 +02:00
Matthias Clasen 2b6c684569 Make it possible to finalize theming engines
This was broken since forever. Good that we never finalize
theme engines...
2013-05-02 21:36:45 -04:00
Matthias Clasen c538bdc7dc GtkInvisible behaves like GtkWindow
As far as refcounting is concerned, invisibles are like
windows: you have to destroy them.
2013-05-02 20:43:34 -04:00
Matthias Clasen b980057764 Only check for finalization after a grace period
This makes the file chooser pass this test
2013-05-02 20:42:24 -04:00
Matthias Clasen 1afca5510a Prevent a segfault if GtkAppChooserDialog gets disposed early
If the async call is finished after the dialog is already disposed,
bad things happen. Prevent that by marking the dialog as dismissed
in this case.
2013-05-02 20:00:49 -04:00
Benjamin Otte 01c810b4d7 gdk: Remove new gdk_display_manager_peek() API
It's not necessary anymore because gdk_display_manager_get() always
succeeds and the value is independant of when it was called as it's no
longer backend specific.
2013-05-02 16:27:47 +02:00
Benjamin Otte 43e6b3aa03 window: Handle attach widget disappearing without weak pointers
Fixes the window not emitting a "notify::attached-to" signal when the
attach-widget goes away.
2013-05-02 16:26:37 +02:00
Benjamin Otte f7ee5450e1 displaymanager: Remove GInitable implementation
This is not needed anymore, as only one type exists and that type can
always be instantiated.
2013-05-02 16:17:30 +02:00
Benjamin Otte d67880bf72 broadway: Remove displaymanager implementation
This is an API break, but the broadway backend is unsupported, so we can
get away with it.
2013-05-02 16:15:22 +02:00
Benjamin Otte 7470a280da wayland: Remove displaymanager implementation
This is an API break, but the wayland backend is unsupported, so we can
get away with it.
2013-05-02 16:14:59 +02:00
Benjamin Otte 7c027d51d8 displaymanager: Don't create backend-specific display managers
Just create a backend-agnostic displaymanager. Creating the displays
later on determines the backend in use.
2013-05-02 16:12:04 +02:00
Benjamin Otte 632ee007a4 displaymanager: Copy logic to display creation
Use the same logic for display creation in
gdk_display_manager_open_display() that is used for displaymanager
creation.
2013-05-02 16:06:21 +02:00
Benjamin Otte f3a5ad32f3 quartz: Move initialization code to display_class_init
This follows the same reasoning as the X11 backend in commit
0122a9da8e
2013-05-02 15:43:35 +02:00
Benjamin Otte 8762791e82 win32: Call windowing init from display_class_init()
This follows the same reasoning as the X11 backend in commit
0122a9da8e
2013-05-02 15:36:41 +02:00
Benjamin Otte 7cecc8e524 a11y: Remove AtkSelection implementation from combobox
AtkSelection requires that the immediate children of the object are the
selectable items. The combobox however is implemented with just 1 child:
The popup menu.

The popup menu is implementing the selectable interface.

Test are updated to reflect this change.
2013-05-02 15:31:26 +02:00
Matthias Clasen c6894cd606 Try this again
When the hostnamed call is cancelled, we get a G_IO_ERROR_CANCELLED
error back. Handle it properly.
2013-05-02 09:29:35 -04:00
Matthias Clasen f7f63ae3ee Revert "Remove a superfluous ref"
This reverts commit f326c0eac8.

Grr, turns out that cancelling is not that reliable :-(
2013-05-02 08:23:58 -04:00
Matthias Clasen 117c86d08a Clear list of attached windows when disposing a widget
We were silently relying on everybody to detach their windows,
and would leak memory otherwise.
2013-05-02 08:02:40 -04:00
Matthias Clasen fb08a26acd GtkWindow: use a weak ref to keep track of attach_widget
Taking a full reference of the attach widget creates a reference
cycle, and keeps the attach_widget alive longer than it should.
2013-05-02 08:01:14 -04:00
Matthias Clasen f326c0eac8 Remove a superfluous ref
If we cancel the call in dispose, no need to ref the object
we pass as userdata. Avoids the risk of leaking the ref if
the call is actually canceled.
2013-05-02 05:53:40 -04:00
Matthias Clasen 4dc01aca43 Fix build 2013-05-02 05:37:58 -04:00
Matthias Clasen 6c79fb72bd Revert "Temporarily remove window-border reftest"
This reverts commit cf6695088e.
2013-05-01 22:23:11 -04:00
Matthias Clasen e399798da8 Revert "Disable the filechooser template tests"
This reverts commit 17b9733372.
2013-05-01 22:22:22 -04:00
Matthias Clasen 8eeb379f7c Revert "Disable the object-finalize test for now"
This reverts commit a021dc793c.
2013-05-01 22:22:09 -04:00
Matthias Clasen 67595f3614 Reenable display manager tests
Still broken, but they test the right thing.
2013-05-01 22:20:58 -04:00
Matthias Clasen 43b42704c5 Bump version 2013-05-01 22:06:46 -04:00
Matthias Clasen 3c7fbe237d Remove window-border tests from makefile too 2013-05-01 21:43:19 -04:00
Matthias Clasen 0d49b97fce Silence a compiler warning 2013-05-01 21:35:39 -04:00
Matthias Clasen 286d3466a1 Revert "Temporarily remove button-wrapping reftest"
This reverts commit 851b631c4e.
2013-05-01 21:31:12 -04:00
Matthias Clasen 78189bf5e0 Fix up doc sections 2013-05-01 21:27:25 -04:00
Matthias Clasen 210451e86f Minor doc comment fix 2013-05-01 21:27:06 -04:00
Matthias Clasen 3f397d6b38 Make gtkplacessidebar.h look like a gtk header 2013-05-01 21:23:55 -04:00
Matthias Clasen 2f0a5dd541 GtkPlacesSidebar: Correct all since tags 2013-05-01 21:19:37 -04:00
Matthias Clasen e9e4c8b168 Disable broken picker a11y test
The GtkComboBox accessible implementation is pretty broken,
and it shows through in this a11y test. Disable it for now.
2013-05-01 21:03:55 -04:00
Matthias Clasen b84b933cac Update a few a11y test results 2013-05-01 19:07:10 -04:00
Matthias Clasen 51bbb76d35 Fix image-load-from-file reftest
Need to reset css here to avoid theme interference.
2013-05-01 19:07:10 -04:00
Matthias Clasen 3605e6c900 Temporarily remove grid-span reftest
This was testing grid size allocation changes that had to be
reverted because they broke gnumeric.
2013-05-01 19:07:10 -04:00
Matthias Clasen cf6695088e Temporarily remove window-border reftest
It is broken by unfinished csd changes.
2013-05-01 19:07:10 -04:00
Matthias Clasen 851b631c4e Temporarily remove button-wrapping reftest
Its broken by unsettled GtkBin size allocation changes.
2013-05-01 19:07:10 -04:00
Piotr Drąg 0f9c43b569 Updated POTFILES.skip 2013-05-01 23:48:33 +02:00
Benjamin Otte 327a164744 paned: Fixup recent commit
d90e3670ce had a bunch of embarrassing
bugs.

Fixes paned-undersized reftest.
2013-05-01 23:26:27 +02:00
Benjamin Otte a30b84f522 wayland: Don't add/remove displays manually
This code is handled by GdkDisplay itself these days.
2013-05-01 18:12:38 +02:00
Benjamin Otte 0122a9da8e x11: Move initialization code
Move it from GdkDisplayManagerX11.init to GdkDisplay.class_init.

This shouldn't cause any problems, but who knows, so keep this patch
small.

Reason for this is the unification of display managers.
2013-05-01 18:11:26 +02:00
Benjamin Otte 2d35f7a8e1 tests: make deprecated functions not warn
We still want to test them though.
2013-05-01 17:50:14 +02:00
Benjamin Otte 61f47829ba tests: Comment out unused functions 2013-05-01 17:46:50 +02:00
Benjamin Otte 2d29c4a43f window: last size is more important than default size
reorder size computation code to reflect that.

https://bugzilla.gnome.org/show_bug.cgi?id=696882
2013-05-01 16:41:12 +02:00
Benjamin Otte 01f7ed1d07 window: Deprecate gtk_window_reshow_with_initial_size() 2013-05-01 16:41:12 +02:00
Benjamin Otte d90e3670ce paned: Correctly compute child sizes in size requests 2013-05-01 16:41:12 +02:00
Benjamin Otte 6146bf7a32 gtkprivate: #define OPPOSITE_ORIENTATION
and use it
2013-05-01 16:41:11 +02:00
Benjamin Otte ea98c61f3c paned: Split size request code
The code is pretty different for both cases, so better split things
here.
2013-05-01 16:41:11 +02:00
Benjamin Otte 9c2eb4f233 paned: Split out a function 2013-05-01 16:41:11 +02:00
Benjamin Otte cb99cd2052 button: Rework size request/allocation code
- Split out a common function
- Implement hfw properly.
2013-05-01 16:41:11 +02:00
Benjamin Otte 41e8d3df6d widget: Improve debug output 2013-05-01 16:41:11 +02:00
Benjamin Otte 01fe4ce7f4 button: Use _gtk_widget_get_preferred_size_for_size()
This was accidently lost when merging baseline support.
2013-05-01 16:41:11 +02:00
Benjamin Otte 1349292e47 widget: Adapt _gtk_widget_get_preferred_size_for_size()
... for baseline support byu taking two extra (possible NULL) arguments.
2013-05-01 16:41:11 +02:00
Benjamin Otte 8f06590712 tests: Add reftest for broken button sizing
https://bugzilla.gnome.org/show_bug.cgi?id=698433
2013-05-01 16:41:11 +02:00
Matthias Clasen 17b9733372 Disable the filechooser template tests
The places sidebar breaks the finalization checks in these tests
https://bugzilla.gnome.org/show_bug.cgi?id=699393
2013-05-01 10:28:53 -04:00
Matthias Clasen a021dc793c Disable the object-finalize test for now
GtkPlacesSidebar breaks this:
https://bugzilla.gnome.org/show_bug.cgi?id=699393
2013-05-01 10:28:03 -04:00
Matthias Clasen 032636f3ea Add missing symbols 2013-05-01 10:27:48 -04:00
Matthias Clasen 4f9a71d286 Comment out broken tests
Tsk, tsk. These tests were broken in the recent display manager
changes.  Please run make check after major refactoring.
2013-05-01 09:41:11 -04:00
Matthias Clasen e30d5acc60 Avoid an accidental export 2013-05-01 08:46:50 -04:00
Matthias Clasen b01c69a018 Updates 2013-05-01 08:29:01 -04:00
Hib Eris 4dcd49352b Revert "Don't build gtk-launch when gio-unix is not available"
The gtk-launch tool can be build without gio-unix (although it
will not really do much without an alternative implementation for
g_desktop_app_info).

So there is no need to not build gtk-launch anymore.

This reverts commit 9a1235bf0d.

https://bugzilla.gnome.org/show_bug.cgi?id=682824
2013-05-01 07:39:36 +02:00
Milo Casagrande 11c9c70673 [l10n] Updated Italian translation. 2013-04-30 19:22:41 +02:00
Milo Casagrande c67eb10fcb [l10n] Updated Italian translation. 2013-04-29 23:01:03 +02:00
Matthias Clasen f47e578737 Fix a typo
Modifed should be Modified.
https://bugzilla.gnome.org/show_bug.cgi?id=699225
2013-04-29 13:08:18 -04:00
Alexander Larsson 8cb78d82d6 gtksizerequestcache: Fix typo that lead to crash/leak
We were checking for cache->requests_x but freeing cache->requests_y
which could cause a crash/leak.
2013-04-29 18:17:02 +02:00
David King b8d2806417 docs: Reorder compiler command line for new GCC
Newer versions of GCC/binutils must have the source file come before the
preprocessor and linker flags on the compiler command line, and this is
also compatible with previous versions.

https://bugzilla.gnome.org/show_bug.cgi?id=680241
2013-04-29 07:31:16 +01:00
David King 59c3e7bfe8 docs: Add GtkWidget::show,hide,map,unmap,realize,unrealize
Add gtk-doc comments for several signals on GtkWidget.

https://bugzilla.gnome.org/show_bug.cgi?id=688896
2013-04-29 07:23:46 +01:00
David King 402985077b docs: Add (inout) to requisition of gtk_menu_item_toggle_size_request()
https://bugzilla.gnome.org/show_bug.cgi?id=675571
2013-04-29 07:18:54 +01:00
Matthias Clasen e9f182e37a Fix a few memory leaks wrt to translations
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=699016
The fix here is slightly different. We make
_gtk_builder_parser_translate return a const char * instead of
a dup'ed string, and fix up the callers.
2013-04-28 21:43:49 -04:00
Matthias Clasen 13858fde29 GtkGrid: Undo a size allocation tweak
Revert 5e1a06d1b1

This change caused empty rows to 'open up', which was not
intended and causes problems as seen in bug 698660.
2013-04-28 18:46:41 -04:00
Matthias Clasen ef759ef19d Add a testcase for empty grid rows
This adds a testcase described in bug 698660 to testgrid.
2013-04-28 18:46:11 -04:00
Žygimantas Beručka 51a31f9098 Updated Lithuanian translation 2013-04-28 13:24:47 +03:00
Mario Blättermann 0e4b460574 Updated German translation 2013-04-27 22:42:37 +02:00
Matthias Clasen 1f17efb81c Add some tests for GtkWindow
These tests may have some assumptions on reasonable window manager
behaviour.  For now, we just test that the default size of the
window ends up as the allocated size of the content. This test
currently fails with client-side decorations, because we are
not properly discriminating between overall window size and
content size.
2013-04-27 13:41:17 -04:00
Paolo Borelli d35596fe92 GtkImage: do not leak metrics in baseline align
https://bugzilla.gnome.org/show_bug.cgi?id=699020
2013-04-27 13:59:29 +02:00
Rico Tzschichholz b957e16695 gtk: Add COMPOSITE_TEMPLATES to EXTRA_DIST 2013-04-26 09:25:44 +02:00
Owen W. Taylor b72cf9129c wayland: when possible, fill in actual and predicted presentation times
There is currently no Wayland protocol for providing presentation
timestamps or hints about when drawing will be presented onscreen.
However, by assuming the straightforward algorithm used by the
DRM backend to Weston, we can reverse engineer the right values.

https://bugzilla.gnome.org/show_bug.cgi?id=698864
2013-04-25 13:55:03 -04:00
Owen W. Taylor 23031defde wayland: fill in refresh_interval in GdkFrameTimings
Track the outputs that a window is on, and use the refresh rate from
a random one of those outputs for the refresh_interval in
GdkFrameTimings.

https://bugzilla.gnome.org/show_bug.cgi?id=698864
2013-04-25 13:50:01 -04:00
Owen W. Taylor f1ce727b06 GdkWaylandWindow: Consolidate surface creation and destruction code
Combine duplicate code for creating and destroying surfaces.
To make the operation of the destroy() operation more obvious, the
destruction of the (fake) root window at display dispose time is
changed to not be a "foreign" destroy.

https://bugzilla.gnome.org/show_bug.cgi?id=698864
2013-04-25 13:49:47 -04:00
Owen W. Taylor ca120a98e5 GdkWaylandWindow: synchronize frame drawing
Use wl_surface_frame() to get notification when the compositor paints
a frame, and use this to throttle drawing to the compositor's refresh
cycle.

https://bugzilla.gnome.org/show_bug.cgi?id=698864
2013-04-25 13:45:21 -04:00
Owen W. Taylor c71fea568f GdkWindowWayland: make sure we attach the surface when repainting
Lazily creating the cairo surface that backs a window when we
first paint to it means that the call to
gdk_wayland_window_attach_image() in
gdk_wayland_window_process_updates_recurse() wasn't working the
first time a window was painted.

https://bugzilla.gnome.org/show_bug.cgi?id=698864
2013-04-25 13:45:12 -04:00
Owen W. Taylor d5310f9367 GdkWindowWayland: draw, then damage, then commit
When exposing an area, we were individually damaging and committing
each rectangle, *before* drawing. Surprisingly, this almost worked.
Order things right and only commit once.

https://bugzilla.gnome.org/show_bug.cgi?id=698864
2013-04-25 13:45:06 -04:00
Owen W. Taylor a082f4d804 animated-resizing, video-timer: Add missing return value from ::draw
When we connect to GtkWidget::draw, the signal handler should have
a return value. This fixes overdrawing client-side decorations.
2013-04-25 13:44:58 -04:00
Matthias Clasen 8dc090b9b1 GtkStack: improve docs 2013-04-24 22:07:09 -04:00
Matthias Clasen c69d2e4254 Generate new images 2013-04-24 21:56:08 -04:00
Matthias Clasen f3685c5e88 Docs: some widget gallery updates
Add images for Scrollbar, info bar, combo box text, etc.
2013-04-24 21:55:13 -04:00
Matthias Clasen a8a41b52ad GtkStackSwitcher: unset tooltip
It was pointed out to me that we leave the tooltip behind
when setting and unsetting an icon.
2013-04-24 20:10:05 -04:00
Matthias Clasen af49dd33cf GtkNotebook: Consistent boolean handling
Normalize boolean parameters in gtk_notebook_set_tab_reorderable and
gtk_notebook_set_tab_detachable before comparing them. Pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=697196
2013-04-24 19:58:22 -04:00
Cosimo Cecchi 06c8e8fa43 docs: fix some typos in newly introduced methods 2013-04-24 13:10:54 -04:00
Nik Kalach 95ce57443c [l10n] Update Interlingua translation 2013-04-24 16:03:15 +02:00
Yaron Shahrabani 9544ae08af Updated Hebrew translation. 2013-04-24 10:08:19 +03:00
Yaron Shahrabani 648ef7f7fa Updated Hebrew translation. 2013-04-24 09:45:26 +03:00
Matthias Clasen 661f24736b widget-factory: Add new widgets
Add GtkStack and GtkRevealer to the second page in
gtk3-widget-factory.
2013-04-23 17:39:46 -04:00
Benjamin Otte 174664b235 overlay: Silence gcc warnings 2013-04-23 14:13:51 -04:00
Owen W. Taylor 8c68050af8 tests/scrolling-performance: Add a new test for GtkViewport performance
Add a test that takes four copies of the widget-factory widgets and
scrolls them around to test how smoothly we can scroll and draw.
2013-04-23 14:04:40 -04:00
Owen W. Taylor b7063509f8 tests/animated-resizing: Split frame statistics out into a separate file
Split the code for computing frame rate and latency into a separate file
so we can use it from multiple tests.
2013-04-23 14:04:40 -04:00
Owen W. Taylor 0032b2dc5a GtkSpinButton: don't constantly recreate style contexts for buttons
Cache the style contexts for the up and down panels, instead of recreating
them each time they are drawn or size requested. GtkSpinButtons were
many times slower to draw than other widgets because of the constant
style matching.

https://bugzilla.gnome.org/show_bug.cgi?id=698682
2013-04-23 14:04:39 -04:00
Federico Mena Quintero d9b9ba5da0 Merge branch 'places-sidebar' 2013-04-23 13:58:09 -04:00
Rafael Ferreira 8ca13c4679 Updated Brazilian Portuguese translation 2013-04-23 05:11:52 -03:00
Alexander Larsson 316d450421 Handle non-baseline supporting subclasses overriding baseline supporting classes
If a subclass (say a child of GtkButton) overrides the non-baseline
size request methods we need to call these, rather than the new
get_height_and_baseline_for_width method.

In order to handle this we make the default for this method to be
NULL, and instead check at runtime which method to call. If any
non-baseline vfunc has changed in a class but the baseline one
hasn't, then we can't use the baseline one.
2013-04-23 05:58:48 +02:00
Alexander Larsson c7b4dd5f9d Add baseline functions to docs 2013-04-23 05:58:08 +02:00
Alexander Larsson e8d4bfd04b Add baseline alignment functions to gtk.symbols 2013-04-23 05:58:08 +02:00
Alexander Larsson e253a414b0 GtkLabel: Minor cleanup
Make sure we always compare for a set baseline in the same way.
I.e. baseline != -1, never baseline >= 0.
2013-04-23 05:58:08 +02:00
Alexander Larsson ac8817d34b GtkWidget: Add missing Since docs 2013-04-23 05:58:08 +02:00
Alexander Larsson c630804647 GtkImage: Reuse previously calculated baseline_align in draw()
No need to recalculate this every time we draw.
2013-04-23 05:58:08 +02:00
Alexander Larsson 43f1ac2b8f GtkBox: Add missing Since in docs 2013-04-23 05:58:08 +02:00
Alexander Larsson ebbc7791dd GtkGrid: Add missing Since docs 2013-04-23 05:58:07 +02:00
Alexander Larsson 2b4c9983da Add tests/testbaseline 2013-04-23 05:58:07 +02:00
Alexander Larsson f354cef61b GtkDialog: Baseline align buttons in action area 2013-04-23 05:58:07 +02:00
Alexander Larsson 8fbd6e2edc GtkEventBox: Support baseline alignment
This allows baselines to propagate from the child of the eventbox.
2013-04-23 05:58:07 +02:00
Alexander Larsson e64c1f8929 GtkButtonBox: Support baseline alignment 2013-04-23 05:58:07 +02:00
Alexander Larsson 1df8d18ad2 GtkCheckButton and GtkRadioButton: Implement baseline alignment 2013-04-23 05:58:07 +02:00
Alexander Larsson 433c0c2134 GtkSpinButton: Support baseline alignment 2013-04-23 05:58:07 +02:00
Alexander Larsson 627685e2a2 GtkGrid: Support baseline alignment in GtkGrid
We support a local baseline in each row, as well as selecting
a specific row for the global baseline of the entire GtkGrid.
2013-04-23 05:58:07 +02:00
Alexander Larsson 72cd8b4dab GtkEntry: Support baselines 2013-04-23 05:58:06 +02:00
Alexander Larsson d6684b5748 GtkButton: Add baseline align support 2013-04-23 05:58:06 +02:00
Alexander Larsson 7523b25942 GtkImage: Support baselines
This uses the current font metrics to guess the baseline of the image.
Without this any non-centered baseline in buttons with images look weird.
2013-04-23 05:50:38 +02:00
Alexander Larsson 6acc8c0817 GtkAlignment: Support baselines
We now report any baselines from the child, and allocate it.
Also, in the case of a baselign aligned child we ignore yscale/yalign
as that is not supportable.
2013-04-23 05:50:38 +02:00
Alexander Larsson 9a42942afb GtkBox: Add baseline alignment for horizontal boxes
Report a baseline based height and baseline whenever there
are children with ALIGN_BASELINE.

Assign baseline to childen in size_allocate. Either the one inherited
from the parent if set, or otherwise calculate one based on any
ALIGN_BASELINE children.
2013-04-23 05:50:38 +02:00
Alexander Larsson 1e1cf89e4f GtkLabel: Support baseline
Report the baseline in get_preferred_height_and_baseline_for_width().
2013-04-23 05:50:37 +02:00
Alexander Larsson 5ad618cb95 GtkSizeRequestCache: Don't store baselines in horizontal case
This saves memory for every widget (maximum 48 bytes per widget) at
a cost of a few duplicated codepaths in the size request cache.
2013-04-23 05:50:37 +02:00
Alexander Larsson 77e0f18eda Add GTK_DEBUG=baselines support
This draws red lines to show where the baselines are
2013-04-23 05:50:37 +02:00
Alexander Larsson 852cbb62b8 Initial support for baselines
This modifies the size machinery in order to allow baseline support.

We add a new widget vfunc get_preferred_height_and_baseline_for_width
which queries the normal height_for_width (or non-for-width if width
is -1) and additionally returns optional (-1 means "no baseline")
baselines for the minimal and natural heights.

We also add a new gtk_widget_size_allocate_with_baseline() which
baseline-aware containers can use to allocate children with a specific
baseline, either one inherited from the parent, or one introduced due
to requested baseline alignment in the container
itself. size_allocate_with_baseline() works just like a normal size
allocation, except the baseline gets recorded so that the child can
access it via gtk_widget_get_allocated_baseline() when it aligns
itself.

There are also adjust_baseline_request/allocation similar to the
allocation adjustment, and we extend the size request cache to also
store the baselines.
2013-04-23 05:50:37 +02:00
Alexander Larsson f15bc7818e Add GTK_ALIGN_BASELINE to GtkAlign
Setting this means baseline aware containers should align the widget
according to the baseline. For other containers this behaves like
FILL.

In order to not suprise old code with a new enum value we always
return _FILL for _BASELINE unless you specifically request it via
gtk_widget_get_valign_with_baseline().
2013-04-23 05:47:31 +02:00
John Ralls 655c781b6e Fix automake warning about CFLAGS etc. being user variables 2013-04-22 15:48:35 -07:00
John Ralls f0f07ad6d8 Remove get_atom_name and atom_intern
Completes aa9e974 for quartz
2013-04-22 15:48:35 -07:00
John Ralls 179004f0a7 Fix attempted inclusion of local headers with system brackets. 2013-04-22 15:48:34 -07:00
John Ralls e58b19db04 gdk: Temporarily add -xobjective-c to CFLAGS
To enable compiling the quartz backend after a6a4428
2013-04-22 15:48:34 -07:00
Benjamin Otte 315261260c button: Implement height-for-width
https://bugzilla.gnome.org/show_bug.cgi?id=698433
2013-04-22 18:29:21 -04:00
Benjamin Otte 3450388ff0 sizerequest: Split out a common function 2013-04-22 18:29:01 -04:00
Cosimo Cecchi 009aadf378 window: remove unused code
We don't need to add these style classes.
2013-04-22 18:10:22 -04:00
Cosimo Cecchi 7bbbb01ff5 window: rework the CSD theming layer
Instead of having three different boxes and style classes, we can just
get away with the regular background box, plus a window-frame, which
contains the external frame, together with the window drop shadows.

GtkWindow now has special code to ensure the backing actual window is
allocated big enough to accomodate the shadows (using the shadow size
calculations introduced in the previous commit). We also use the margin
value to determine the size of the invisible borders (which can then be
different than the shadow).
2013-04-22 18:10:22 -04:00
Cosimo Cecchi a44d6816d3 cssshadow: add a method to get the size of a shadows value
The method returns the size of each side of a GtkCssShadowsValue.
2013-04-22 18:10:21 -04:00
Cosimo Cecchi 7846bedebd window: factor out a gtk_window_get_maximized() function
Simplify code that does this same check over and over.
2013-04-22 18:10:21 -04:00
Cosimo Cecchi 87922575d3 window: remove title_border
We don't actually need this additional title border.
2013-04-22 18:10:21 -04:00
Federico Mena Quintero 0c1423d962 Remove GtkPlacesSidebar from our private Glade catalog
Now, Glade already knows about GtkPlacesSidebar AND MY MAD ICONS.
2013-04-22 17:00:08 -04:00
Ryan Lortie ca0a18918c GtkModelMenuItem: add support for 'icon' attribute
Add support for icons on a GMenuModel.

https://bugzilla.gnome.org/show_bug.cgi?id=688820
2013-04-22 15:55:08 -04:00
Federico Mena Quintero 5322420145 Use friendlier property names for Glade 2013-04-22 15:46:59 -04:00
Piotr Drąg 66007d0ab6 Updated POTFILES.in and POTFILES.skip 2013-04-22 20:51:32 +02:00
Matthias Clasen 15bba87e9a Add new symbols
Add the GtkRevealer functions to gtk.symbols
2013-04-22 12:42:39 -04:00
Matthias Clasen 8ff96b3bb2 Do rtl flipping for GtkRevealer transitions 2013-04-22 12:42:39 -04:00
Matthias Clasen 86688c6fde Add a revealer example to gtk-demo
I tried to make a 'revealer ballet'. Judge for yourself if
I succeeded.
2013-04-22 12:42:39 -04:00
Matthias Clasen aec62e1c10 Add docs for GtkRevealer 2013-04-22 12:42:38 -04:00
Matthias Clasen d7f43c30a3 GtkRevealer: Add a fading animation
Using a container for this is not necessarily the most
elegant solution, but it lets us reuse the animation
machinery in GtkRevealer.
2013-04-22 12:42:38 -04:00
Matthias Clasen 0bd173e3d8 Forgotten file 2013-04-22 12:42:37 -04:00
Matthias Clasen 443459b52e Add GtkRevealer
This is a widget that can hide or show (ie reveal) its child
in an animated fashion.

This widget was initially developed in libgd.
2013-04-22 12:42:37 -04:00
Cosimo Cecchi d82257e1c8 stack: fix a typo in docs 2013-04-22 11:20:06 -04:00
Matthias Clasen b88c0d7387 Typo fix in GtkStack docs 2013-04-22 10:25:30 -04:00
Matthias Clasen 6d77bf66ac Typo fix in GtkStackSwitcher docs 2013-04-22 10:25:30 -04:00
Benjamin Otte b8e4adfff9 Revert "Revert "gtkbin: Remove the silliest code on earth""
This reverts commit b164df7450.
2013-04-22 08:23:08 -04:00
Victor Ibragimov 361754b063 Tajik translation updated 2013-04-22 13:17:42 +05:00
Rafael Ferreira b5912e61fd Updated Brazilian translation for UI and PO-Prop. 2013-04-22 05:00:18 -03:00
Tristan Van Berkom e5b384f537 Updated private widget catalog to remove the reference to the shortcuts model
This model seems to be removed since Federico's places-sidebar work.
2013-04-22 15:55:20 +09:00
Tristan Van Berkom b164df7450 Revert "gtkbin: Remove the silliest code on earth"
This reverts commit f4438a1ffc.

The calculation of the delta between parent and child widget
is required in order to automate height-for-width and width-for-height
requests for various GtkBin widgets.

GtkButton, GtkCheckButton, GtkRadioButton, etc, all have different
requests for space around the content which can not be satisfied
with a simple calculation of GtkContainer border-width.
2013-04-22 15:20:51 +09:00
Matthias Clasen 6186429f5f GtkStack: shorten a few parameter names
Looks better in the docs.
2013-04-21 23:13:16 -04:00
Matthias Clasen a8123bf95e Forgot one place
Also change the property definition for transition-duration
to be uint instead of int.
2013-04-21 22:24:54 -04:00
Matthias Clasen af6f874060 Add new places sidebar symbols 2013-04-21 22:00:06 -04:00
Matthias Clasen b0cf4d057d Make transition-duration unsigned
The code doesn't deal with negative durations, so better
don't allow them.
2013-04-21 21:51:28 -04:00
Matthias Clasen 71f1f768cc Change transition-type property type
This is an enum, so declare the property as such.
2013-04-21 21:51:27 -04:00
Matthias Clasen 49511c7f42 Add a GtkStack example to gtk-demo 2013-04-21 21:51:27 -04:00
Matthias Clasen 85ccb93b9f GtkStack: warn if child names are not unique 2013-04-21 21:51:27 -04:00
Matthias Clasen 24bac24602 Add new symbols 2013-04-21 21:51:26 -04:00
Matthias Clasen f83ba08f7f Add new api to the docs 2013-04-21 21:51:26 -04:00
Matthias Clasen c37b30f317 GtkStack: add vertical slide transitions
We allow transitions that slide up or down.
2013-04-21 21:51:26 -04:00
Matthias Clasen 88cd26575d GtkStack: rtl flipping for animation
We switch slide-right and slight-left when in rtl.
2013-04-21 21:51:25 -04:00
Matthias Clasen e72a78c4e6 Add a way to specify transition types on the fly
Add a gtk_stack_set_visible_child_full that takes a
transition type.
2013-04-21 21:51:25 -04:00
Matthias Clasen 8ca73e3258 Add docs for GtkStackSwitcher 2013-04-21 21:51:25 -04:00
Matthias Clasen 06f5b1e572 Add docs for GtkStack 2013-04-21 21:51:24 -04:00
Matthias Clasen 2e39c4bab8 Add GtkStack
Add separate GtkStack and GtkStackSwitcher widgets that are an
alternative to GtkNotebook. Additionally, GtkStack supports
animated transitions when changing pages.
These widgets were initially developed in libgd.
2013-04-21 21:51:24 -04:00
Federico Mena Quintero 57c4bcb369 Merge branch 'master' into places-sidebar 2013-04-21 18:21:37 -04:00
Federico Mena Quintero 9b91e06513 Oops, only show 'Connect to server' if the caller enabled it 2013-04-21 18:20:46 -04:00
Cosimo Cecchi 44ba055d03 window: don't forget to fetch title border when not on CSD
We still need to respect this border value even when we're not running
under CSD, since we support setting a custom titlebar in all cases.

The border/style magic in gtk_window_draw() really needs to be separated
out into logical pieces soon, but for now let's keep a consistent
behavior with the previous code.
2013-04-21 16:59:14 -04:00
Federico Mena Quintero 32abb29b32 Merge branch 'places-sidebar' 2013-04-21 15:51:49 -04:00
Cosimo Cecchi a25e0a97d5 window: only account for decoration borders when we're client decorated 2013-04-21 14:44:24 -04:00
Federico Mena Quintero 9d8e3be6d7 Add a selected_volume argument to ::populate-popup
Nautilus needs this in order to implement a Format command for a volume's popup menu.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-04-21 12:41:33 -04:00
Federico Mena Quintero 9ded1c0c99 Sync from nautilus commit 500770e8de18b07392ffa4435372525d5d03c688
Add a Connect to Server menu item, a show-connect-to-server property, and a show-connect-to-server signal.
2013-04-20 19:14:59 -04:00
569 changed files with 25599 additions and 17212 deletions
+198
View File
@@ -1,3 +1,201 @@
Overview of Changes in GTK+ 3.7 to 3.9
======================================
* GtkFileChooser:
- Always show fuse-mounted locations in shortcuts
- GtkFileChooserButton has received a lot of fixes and tests have
been added for many of them
* GtkWindow:
- Initial support for client-side decorations has been added. This
is going to be used by default under Wayland. To try it with other
backends, set the GTK_CSD=1 environment variable.
- gtk_window_set_titlebar: A new function that can set a custom,
client-side titlebar on toplevel windows.
* Wayland:
- Use client-side decorations
- Implement maximization
- Improve cursor handling
- Improve multi-monitor handling
- Support most GtkSettings (for now by reading GSettings directly)
- Complete the keymap implementation
- Add support for custom surfaces
- Implement animated cursors
- Support the WAYLAND_SOCKET environment variable
- Implement frame synchronizatio
- Document Wayland-specific APIs
* Broadway:
- Improve window size handling
- Implement frame synchronization
- Add support for password authentication
* New APIs, widgets, feature additions:
- GtkHeaderBar is a new widget similar to a GtkBox, with the extra
feature that it can center a child (typically a title), independent
of the other content.
- GtkPlacesSidebar is the sidebar widget in the file chooser, exported
as a public widget - it will be shared with nautilus.
- GtkStack is an alternative to GtkNotebook for showing one of several
child widgets at a time. It supports animated transitions. Tabs are
not built into this widgets, but instead provided by the separate
GtkStackSwitcher widget.
- GtkRevealer is a new new widget that can hide or show its child
in an animated fashion.
- GtkMenuTracker is a helper object that makes dealing with
GMenuModels easier and more efficient.
- gtk_grid_remove_row/column: New functions to remove whole rows
or columns from a GtkGrid
- Support for composite children has been added to GtkWidget. This
allows to create complex widgets from GtkBuilder ui files. All
complex GTK+ widgets have been converted to use this facility.
- Baseline support was added to the GTK+ size allocation machinery.
Widgets can now export the baseline of the text they contain,
and containers can align their children wrt to their baselines.
* Known problems, feature removals, compatibility caveats:
- Handling of window size is currently in flux, and there are
some known problems with sizes unintentionally changing
- Support for the Motif DND protocol has been dropped
- Client-side decorations still have some issues when drawing
directly on toplevel windows or setting their background
- Support for multiple screens per display has been removed. This
was only ever supported on X11, and is an exceedingly rare setup
nowadays. The display-screen relation is now 1:1, and we will do
some more simplification of displaymanager/display/screen/monitor
APIs.
- gdk_window_get_display has been deprecated
- gtk_widget_push_composite_child has been deprecated - this was
used for anything
- GtkSwitch has been changed to draw focus internally, instead of
reserving space outside the switch for it. This may require some
application adjustment where margins were tweaked to 'correct'
the alignment of switches manually
* Printing:
- Avoid blocking when looking for avahi printers
- Don't link against avahi-gobject, use D-Bus directly
* Bugs fixed:
504901 GtkCellRendererCombo requires click-and-hold
586367 In local_only mode, file chooser should return native pa...
671939 [regression] crash on exit
672018 Need API to set global application state (busy, counters...
674051 Scrolling zoom in view - incorrect image display
674759 GtkLabel: wrong value of "mnemonic-keyval" when "use-mar...
675571 (out) or (inout) annotation possibly missing for gtk_men...
675649 gtk-demo: Fix typo
680241 Instructions on how to build a GTK app won't work with r...
681446 gtkdnd memory leak
685419 gtkprintbackendfile: Infinite loop in _cairo_write()
685420 Critical warnings when GtkPrintJob is released too early
688820 GIcon is a bad interface
688896 Add documentation for GtkWidget::show,hide,map,unmap,rea...
690275 scrolling on other windows is applied when coming back (...
691040 selection is reported incorrectly in file chooser button
692871 Need to expose output information to make GdkScreen API ...
694339 Fix build of GTK+ on Windows
694465 Allow backends to fail during initialisation
695200 Switching apps while a combobox open makes the parent wi...
695228 GdkPixbuf:ERROR:gdk-pixbuf-animation.c:242:gdk_pixbuf_an...
695278 Avoid passing a NULL title to setTitle
695304 GtkTextView: don't popdown a bubble if we don't have one
695312 Initial 'text' set in the non-numeric-only GtkSpinButton...
695375 GtkEntryAccessible: also handle entry icon tooltip NULL ...
695380 gtk_binding_entry_skip broken
695391 wayland documentation section id is "gtk-osx"
695473 treeview: fix a critical warning
695476 Drop the Motif DND protocol
695482 Universal Access panel appears jumbled and horrible afte...
695493 testgtk: issues with the color selection example
695495 testgtk: cursor example segfaults
695497 testgtk: lack of key repeat
695506 gtk-demo: link hovering unreliable
695682 Cannot build docs for wayland-only build
695714 Getting of printer info can hang
695772 Different appearance of menus within Audacious
695783 GtkApplication: Allow passing windows on non-X11 targets
695861 Allow to use custom surfaces for GdkWindows in Wayland
695874 GtkFontChooser docs
695895 Fix the gtk3-demo demo program on Windows
695945 implement minimize / maximize functionality
695948 GtkFontButton sets wrong show-preview-entry
695998 csd: enable shadows in the outer border
696051 vertical grid lines in rtl mode
696138 GtkWidget: some deprecation marks are missing
696171 GtkAssistant highlighted font unreadable
696202 Add GtkSpinner animation back to Win32 theme
696232 win32: do not crash on invalid utf8 conversion
696340 wayland: device list is populated async
696370 GtkOverlay doesn't work on top of GtkClutterEmbed
696429 wayland: Implement animated cursors
696457 gnome-ostree build broken by 3a9de35a6cefddc09aaf000e523...
696468 improve GMenuModel -> GtkMenu conversion
696546 gtk_print_backend_cups_finalize() crashes if cups_get_pr...
696553 Crash in avahi_create_browsers
696561 GtkApplicationWindow rendering broken
696608 css_image_value_parse: returning FALSE in pointer function
696622 gtk option printer widget segfault in epiphany
696623 GtkOverlay with a revealer produces warnings setting a m...
696767 a pair of memory leaks
696882 [regression] GtkWindow changes size after hide/show cycle
697048 GtkTextView: small code improvements
697144 Popup menu mnemonics fixes
697196 gtk_notebook_set_tab_reorderable boolean handling
697200 GtkWindow: notify::attached-to not emitted
697263 Impossible to set window transparency on 3.8
697275 gtk_window_set_default_size() doesn't work anymore
697427 Unreferencing GtkStatusIcon object causes abort
697673 Apps should connect only once when using Wayland
697795 xi2: Improve pointer emulation debug reporting
697886 dnd icon drawing broken on master
697947 A lot of GTK+ apps fail to launch with error "desktop_she...
698181 Document icon-shadow CSS property
698433 Geometry management broken in GtkBin widgets
698682 GtkSpinButton: don't constantly recreate style contexts f...
698864 wayland: improve integration with GdkFrameClock
699020 GtkImage: do not leak metrics in baseline align
699225 typo: Modifed -> Modified
* Translation updates:
Arabic
Aragonese
Assamese
Belarusian
Brazilian Portuguese
British English
Catalan
Catalan (Valencian)
Czech
Danish
Finnish
French
Galician
German
Greek
Hindi
Hungarian
Indonesian
Italian
Kazakh
Korean
Latvian
Malayalam
Odia
Persian
Polish
Punjabi
Russian
Serbian
Simplified Chinese
Slovenian
Tajik
Tamil
Ukrainian
Overview of Changes in GTK+ 3.7.12
==================================
+39 -27
View File
@@ -10,7 +10,7 @@
m4_define([gtk_major_version], [3])
m4_define([gtk_minor_version], [9])
m4_define([gtk_micro_version], [0])
m4_define([gtk_micro_version], [1])
m4_define([gtk_interface_age], [0])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
@@ -251,10 +251,11 @@ AC_ARG_ENABLE(debug,
[turn on debugging @<:@default=debug_default@:>@])],,
[enable_debug=debug_default])
AC_ARG_ENABLE(rebuilds,
[AS_HELP_STRING([--disable-rebuilds],
[disable all source autogeneration rules])],,
[enable_rebuilds=yes])
AC_ARG_ENABLE(installed_tests,
AS_HELP_STRING([--enable-installed-tests],
[Install test programs (default: no)]),,
[enable_installed_tests=no])
AM_CONDITIONAL(BUILDOPT_INSTALL_TESTS, test x$enable_installed_tests = xyes)
AC_ARG_ENABLE(gtk2-dependency,
[AS_HELP_STRING([--enable-gtk2-dependency],
@@ -508,16 +509,6 @@ PKG_CHECK_MODULES(CAIRO_BACKEND, [$cairo_backends])
PKG_CHECK_MODULES(GMODULE, [gmodule-2.0])
if test "$os_win32" != yes; then
# libtool option to control which symbols are exported
# right now, symbols starting with _ are not exported
LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
else
# We currently use .def files on Windows (for gdk and gtk)
LIBTOOL_EXPORT_OPTIONS=
fi
AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
dnl ******************************************************
dnl * See whether to include shared library dependencies *
dnl ******************************************************
@@ -552,17 +543,6 @@ AM_CONDITIONAL(DISABLE_EXPLICIT_DEPS, test $enable_explicit_deps = no)
AC_PATH_PROGS(PERL, perl5 perl)
# We would like indent, but don't require it.
AC_CHECK_PROG(INDENT, indent, indent)
REBUILD=\#
if test "x$enable_rebuilds" = "xyes" && \
test -n "$PERL" && \
$PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 ; then
REBUILD=
fi
AC_SUBST(REBUILD)
AC_CHECK_FUNCS(lstat mkstemp)
AC_CHECK_FUNCS(localtime_r)
@@ -1242,7 +1222,6 @@ if test "$have_gio_unix" = "yes"; then
else
GDK_GIO_PACKAGE=gio-2.0
fi
AM_CONDITIONAL(HAVE_GIO_UNIX, test "$have_gio_unix" = "yes")
# Check for Pango flags
@@ -1674,6 +1653,39 @@ else
AC_MSG_RESULT([no])
fi
##################################################
# Visibility handling
##################################################
GDK_HIDDEN_VISIBILITY_CFLAGS=""
case "$host" in
*-*-mingw*)
dnl on mingw32 we do -fvisibility=hidden and __declspec(dllexport)
AC_DEFINE([_GDK_EXTERN], [__attribute__((visibility("default"))) __declspec(dllexport) extern],
[defines how to decorate public symbols while building])
CFLAGS="${CFLAGS} -fvisibility=hidden"
;;
*)
dnl on other compilers, check if we can do -fvisibility=hidden
SAVED_CFLAGS="${CFLAGS}"
CFLAGS="-fvisibility=hidden"
AC_MSG_CHECKING([for -fvisibility=hidden compiler flag])
AC_TRY_COMPILE([], [int main (void) { return 0; }],
AC_MSG_RESULT(yes)
enable_fvisibility_hidden=yes,
AC_MSG_RESULT(no)
enable_fvisibility_hidden=no)
CFLAGS="${SAVED_CFLAGS}"
AS_IF([test "${enable_fvisibility_hidden}" = "yes"], [
AC_DEFINE([_GDK_EXTERN], [__attribute__((visibility("default"))) extern],
[defines how to decorate public symbols while building])
GDK_HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden"
])
;;
esac
AC_SUBST(GDK_HIDDEN_VISIBILITY_CFLAGS)
##################################################
# Output commands
##################################################
+6 -2
View File
@@ -39,10 +39,12 @@ demos = \
pickers.c \
pixbufs.c \
printing.c \
revealer.c \
rotated_text.c \
search_entry.c \
sizegroup.c \
spinner.c \
stack.c \
stock_browser.c \
textview.c \
textscroll.c \
@@ -84,8 +86,8 @@ gsettings_SCHEMAS = \
@GSETTINGS_RULES@
demos.h: @REBUILD@ $(demos) geninclude.pl
$(AM_V_GEN) (here=`pwd` ; cd $(srcdir) && $(PERL) $$here/geninclude.pl $(demos)) > demos.h
demos.h: $(demos) geninclude.pl
$(AM_V_GEN) (here=`pwd` ; cd $(srcdir) && $(PERL) $$here/geninclude.pl $(demos)) > demos.h
gtk3_demo_SOURCES = \
$(demos) \
@@ -110,6 +112,8 @@ RESOURCES= $(demos) \
application.ui \
demo.ui \
menus.ui \
stack.ui \
revealer.ui \
theming.ui \
alphatest.png \
apple-red.png \
+2 -1
View File
@@ -5,9 +5,10 @@
* This example uses GtkUIManager and GtkActionGroup.
*/
#include <gtk/gtk.h>
#include "config.h"
#include <gtk/gtk.h>
static GtkWidget *window = NULL;
static GtkWidget *infobar = NULL;
static GtkWidget *messagelabel = NULL;
+8
View File
@@ -55,6 +55,12 @@
<file preprocess="to-pixdata">gnome-fs-directory.png</file>
<file preprocess="to-pixdata">gnome-fs-regular.png</file>
</gresource>
<gresource prefix="/stack">
<file>stack.ui</file>
</gresource>
<gresource prefix="/revealer">
<file>revealer.ui</file>
</gresource>
<gresource prefix="/images">
<file>alphatest.png</file>
<file>floppybuddy.gif</file>
@@ -107,9 +113,11 @@
<file>pickers.c</file>
<file>pixbufs.c</file>
<file>printing.c</file>
<file>revealer.c</file>
<file>rotated_text.c</file>
<file>search_entry.c</file>
<file>sizegroup.c</file>
<file>stack.c</file>
<file>spinner.c</file>
<file>stock_browser.c</file>
<file>textview.c</file>
-1
View File
@@ -1,4 +1,3 @@
#include "config.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
+85
View File
@@ -0,0 +1,85 @@
/* Revealer
*
* GtkRevealer is a container that animates showing and hiding
* of its sole child with nice transitions.
*/
#include <gtk/gtk.h>
static GtkBuilder *builder;
static gint count = 0;
static void
change_direction (GtkRevealer *revealer)
{
gboolean revealed;
revealed = gtk_revealer_get_child_revealed (revealer);
gtk_revealer_set_reveal_child (revealer, !revealed);
}
static gboolean
reveal_one (gpointer data)
{
gchar *name;
GtkRevealer *revealer;
name = g_strdup_printf ("revealer%d", count);
revealer = (GtkRevealer *)gtk_builder_get_object (builder, name);
gtk_revealer_set_reveal_child (revealer, TRUE);
g_signal_connect (revealer, "notify::child-revealed",
G_CALLBACK (change_direction), NULL);
count++;
return count < 9;
}
static void
response_cb (GtkWidget *dialog,
gint response_id,
gpointer data)
{
gtk_widget_destroy (dialog);
}
GtkWidget *
do_revealer (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
GError *err = NULL;
if (!window)
{
builder = gtk_builder_new ();
gtk_builder_add_from_resource (builder, "/revealer/revealer.ui", &err);
if (err)
{
g_error ("ERROR: %s\n", err->message);
return NULL;
}
gtk_builder_connect_signals (builder, NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "dialog1"));
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
g_signal_connect (window, "response", G_CALLBACK (response_cb), NULL);
}
if (!gtk_widget_get_visible (window))
{
count = 0;
g_timeout_add (690, reveal_one, NULL);
gtk_widget_show_all (window);
}
else
{
gtk_widget_destroy (window);
window = NULL;
}
return window;
}
+223
View File
@@ -0,0 +1,223 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.6 -->
<object class="GtkDialog" id="dialog1">
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="type_hint">dialog</property>
<property name="default_width">300</property>
<property name="default_height">300</property>
<property name="title">Revealer</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button1">
<property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<child>
<object class="GtkRevealer" id="revealer0">
<property name="visible">True</property>
<property name="transition-duration">2000</property>
<property name="transition-type">crossfade</property>
<child>
<object class="GtkImage" id="image0">
<property name="visible">True</property>
<property name="icon-name">face-cool-symbolic</property>
<property name="icon-size">6</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkRevealer" id="revealer1">
<property name="visible">True</property>
<property name="transition-duration">2000</property>
<property name="transition-type">slide-up</property>
<child>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="icon-name">face-cool-symbolic</property>
<property name="icon-size">6</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkRevealer" id="revealer2">
<property name="visible">True</property>
<property name="transition-duration">2000</property>
<property name="transition-type">slide-right</property>
<child>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="icon-name">face-cool-symbolic</property>
<property name="icon-size">6</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">3</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkRevealer" id="revealer3">
<property name="visible">True</property>
<property name="transition-duration">2000</property>
<property name="transition-type">slide-down</property>
<child>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="icon-name">face-cool-symbolic</property>
<property name="icon-size">6</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkRevealer" id="revealer4">
<property name="visible">True</property>
<property name="transition-duration">2000</property>
<property name="transition-type">slide-left</property>
<child>
<object class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="icon-name">face-cool-symbolic</property>
<property name="icon-size">6</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkRevealer" id="revealer5">
<property name="visible">True</property>
<property name="transition-duration">2000</property>
<property name="transition-type">slide-up</property>
<child>
<object class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="icon-name">face-cool-symbolic</property>
<property name="icon-size">6</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkRevealer" id="revealer6">
<property name="visible">True</property>
<property name="transition-duration">2000</property>
<property name="transition-type">slide-right</property>
<child>
<object class="GtkImage" id="image6">
<property name="visible">True</property>
<property name="icon-name">face-cool-symbolic</property>
<property name="icon-size">6</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">4</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkRevealer" id="revealer7">
<property name="visible">True</property>
<property name="transition-duration">2000</property>
<property name="transition-type">slide-down</property>
<child>
<object class="GtkImage" id="image7">
<property name="visible">True</property>
<property name="icon-name">face-cool-symbolic</property>
<property name="icon-size">6</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkRevealer" id="revealer8">
<property name="visible">True</property>
<property name="transition-duration">2000</property>
<property name="transition-type">slide-left</property>
<child>
<object class="GtkImage" id="image8">
<property name="visible">True</property>
<property name="icon-name">face-cool-symbolic</property>
<property name="icon-size">6</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="0">button1</action-widget>
</action-widgets>
</object>
</interface>
+48
View File
@@ -0,0 +1,48 @@
/* Stack
*
* GtkStack is a container that shows a single child at a time,
* with nice transitions when the visible child changes.
*
* GtkStackSwitcher adds buttons to control which child is visible.
*/
#include <gtk/gtk.h>
static GtkBuilder *builder;
GtkWidget *
do_stack (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
GError *err = NULL;
if (!window)
{
builder = gtk_builder_new ();
gtk_builder_add_from_resource (builder, "/stack/stack.ui", &err);
if (err)
{
g_error ("ERROR: %s\n", err->message);
return NULL;
}
gtk_builder_connect_signals (builder, NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
}
if (!gtk_widget_get_visible (window))
{
gtk_widget_show_all (window);
}
else
{
gtk_widget_destroy (window);
window = NULL;
}
return window;
}
+82
View File
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.6 -->
<object class="GtkWindow" id="window1">
<property name="can_focus">False</property>
<property name="title" translatable="yes">GtkStack</property>
<child>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkStackSwitcher" id="switcher">
<property name="visible">True</property>
<property name="stack">stack</property>
<property name="halign">center</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkStack" id="stack">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="transition-type">crossfade</property>
<child>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin-top">20</property>
<property name="margin-bottom">20</property>
<property name="resource">/application/gtk-logo-48.png</property>
</object>
<packing>
<property name="name">page1</property>
<property name="title" translatable="yes">Page 1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton1">
<property name="label" translatable="yes">Page 2</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="halign">center</property>
<property name="valign">center</property>
</object>
<packing>
<property name="name">page2</property>
<property name="title" translatable="yes">Page 2</property>
</packing>
</child>
<child>
<object class="GtkSpinner" id="spinner1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="active">True</property>
</object>
<packing>
<property name="name">page3</property>
<property name="icon-name">face-laugh-symbolic</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
</child>
</object>
</interface>
-1
View File
@@ -6,7 +6,6 @@
#include <string.h>
#include <gtk/gtk.h>
#include "config.h"
static GtkWidget *window = NULL;
+38
View File
@@ -78,6 +78,35 @@ on_page_toggled (GtkToggleButton *button,
gtk_notebook_set_current_page (pages, page);
}
static void
spin_value_changed (GtkAdjustment *adjustment, GtkWidget *label)
{
GtkWidget *w;
gint v;
gchar *text;
v = (int)gtk_adjustment_get_value (adjustment);
if ((v % 3) == 0)
{
text = g_strdup_printf ("%d is a multiple of 3", v);
gtk_label_set_label (GTK_LABEL (label), text);
g_free (text);
}
w = gtk_widget_get_ancestor (label, GTK_TYPE_REVEALER);
gtk_revealer_set_reveal_child (GTK_REVEALER (w), (v % 3) == 0);
}
static void
dismiss (GtkWidget *button)
{
GtkWidget *w;
w = gtk_widget_get_ancestor (button, GTK_TYPE_REVEALER);
gtk_revealer_set_reveal_child (GTK_REVEALER (w), FALSE);
}
int
main (int argc, char *argv[])
{
@@ -86,6 +115,7 @@ main (int argc, char *argv[])
GtkWidget *widget;
GtkWidget *notebook;
gboolean dark = FALSE;
GtkAdjustment *adj;
gtk_init (&argc, &argv);
@@ -114,6 +144,14 @@ main (int argc, char *argv[])
widget = (GtkWidget*) gtk_builder_get_object (builder, "aboutmenuitem");
g_signal_connect (widget, "activate", G_CALLBACK (show_about), window);
widget = (GtkWidget*) gtk_builder_get_object (builder, "page2dismiss");
g_signal_connect (widget, "clicked", G_CALLBACK (dismiss), NULL);
widget = (GtkWidget*) gtk_builder_get_object (builder, "page2note");
adj = (GtkAdjustment *) gtk_builder_get_object (builder, "adjustment2");
g_signal_connect (adj, "value-changed",
G_CALLBACK (spin_value_changed), widget);
g_object_unref (G_OBJECT (builder));
gtk_widget_show (window);
+160 -15
View File
@@ -54,6 +54,23 @@ Vestibulum in tortor diam, quis aliquet quam. Praesent ut justo neque, tempus ru
Duis eu lectus quam. Vivamus eget metus a mauris molestie venenatis pulvinar eleifend nisi.
Nulla facilisi. Pellentesque at dolor sit amet purus dapibus pulvinar molestie quis neque.
Suspendisse feugiat quam quis dolor accumsan cursus. </property>
</object>
<object class="GtkTextBuffer" id="textbuffer2">
<property name="text">* Translation updates:
Aragonese
Assamese
Basque
Brazilian Portuguese
Dutch
German
Hebrew
Hungarian
Polish
Portuguese
Serbian
Slovenian
Spanish
Uyghur</property>
</object>
<object class="GtkAccelGroup" id="accelgroup1"/>
<object class="GtkWindow" id="window">
@@ -2146,30 +2163,158 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </property>
</object>
</child>
<child>
<object class="GtkBox" id="page2">
<object class="GtkOverlay" id="page2">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<property name="border-width">6</property>
<child>
<object class="GtkBox" id="page2box1">
<child type="overlay">
<object class="GtkRevealer" id="page2revealer">
<property name="visible">True</property>
<property name="orientation">horizontal</property>
<property name="spacing">4</property>
<property name="halign">center</property>
<property name="valign">start</property>
<child>
<object class="GtkSpinButton" id="verticalspin1">
<object class="GtkFrame" id="page2frame">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="adjustment">adjustment2</property>
<property name="margin-top">2</property>
<child>
<object class="GtkBox" id="page2box">
<property name="visible">True</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="margin-left">10</property>
<property name="margin-right">10</property>
<property name="spacing">20</property>
<child>
<object class="GtkLabel" id="page2note">
<property name="visible">True</property>
<property name="hexpand">True</property>
<property name="halign">start</property>
<property name="label">NEWS!</property>
</object>
</child>
<child>
<object class="GtkButton" id="page2dismiss">
<property name="visible">True</property>
<child>
<object class="GtkImage" id="page2dismissi">
<property name="visible">True</property>
<property name="icon-name">window-close-symbolic</property>
<property name="icon-size">0</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkGrid" id="page2grid">
<property name="visible">True</property>
<property name="column-homogeneous">True</property>
<property name="row-spacing">6</property>
<property name="column-spacing">6</property>
<property name="border-width">6</property>
<child>
<object class="GtkSpinButton" id="verticalspin2">
<object class="GtkBox" id="page2box1">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="orientation">vertical</property>
<property name="adjustment">adjustment1</property>
<property name="orientation">horizontal</property>
<property name="spacing">4</property>
<child>
<object class="GtkSpinButton" id="verticalspin1">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="adjustment">adjustment2</property>
</object>
</child>
<child>
<object class="GtkSpinButton" id="verticalspin2">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="orientation">vertical</property>
<property name="adjustment">adjustment1</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="filler1">
<property name="visible">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="filler2">
<property name="visible">True</property>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkStackSwitcher" id="switcher">
<property name="visible">True</property>
<property name="stack">stack</property>
<property name="halign">center</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame">
<property name="visible">True</property>
<property name="hexpand">False</property>
<child>
<object class="GtkStack" id="stack">
<property name="visible">True</property>
<property name="transition-type">crossfade</property>
<property name="transition-duration">1000</property>
<child>
<object class="GtkScrolledWindow" id="swo">
<property name="visible">True</property>
<property name="shadow-type">none</property>
<child>
<object class="GtkTextView" id="tvo">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="buffer">textbuffer2</property>
</object>
</child>
</object>
<packing>
<property name="name">page1</property>
<property name="icon-name">document-open-recent-symbolic</property>
<property name="title">News</property>
</packing>
</child>
<child>
<object class="GtkImage" id="imageo">
<property name="visible">True</property>
<property name="resource">/logos/gtk-logo-256.png</property>
</object>
<packing>
<property name="name">page2</property>
<property name="icon-name">system-shutdown-symbolic</property>
<property name="title">Logo</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
</object>
</child>
+5 -2
View File
@@ -301,7 +301,7 @@ HTML_IMAGES = \
$(srcdir)/images/appchooserdialog.png \
$(srcdir)/images/assistant.png \
$(srcdir)/images/box-packing.png \
$(srcdir)/images/box-expand.png \
$(srcdir)/images/box-expand.png \
$(srcdir)/images/button.png \
$(srcdir)/images/check-button.png \
$(srcdir)/images/color-button.png \
@@ -309,8 +309,8 @@ HTML_IMAGES = \
$(srcdir)/images/colorchooser.png \
$(srcdir)/images/combo-box.png \
$(srcdir)/images/combo-box-entry.png \
$(srcdir)/images/combo-box-text.png \
$(srcdir)/images/entry.png \
$(srcdir)/images/search-entry.png \
$(srcdir)/images/figure-hierarchical-drawing.png \
$(srcdir)/images/figure-windowed-label.png \
$(srcdir)/images/file-button.png \
@@ -321,6 +321,7 @@ HTML_IMAGES = \
$(srcdir)/images/frame.png \
$(srcdir)/images/icon-view.png \
$(srcdir)/images/image.png \
$(srcdir)/images/info-bar.png \
$(srcdir)/images/label.png \
$(srcdir)/images/levelbar.png \
$(srcdir)/images/link-button.png \
@@ -342,7 +343,9 @@ HTML_IMAGES = \
$(srcdir)/images/radio-group.png \
$(srcdir)/images/recentchooserdialog.png \
$(srcdir)/images/scales.png \
$(srcdir)/images/scrollbar.png \
$(srcdir)/images/scrolledwindow.png \
$(srcdir)/images/search-entry.png \
$(srcdir)/images/separator.png \
$(srcdir)/images/spinbutton.png \
$(srcdir)/images/spinner.png \
+3 -3
View File
@@ -42,7 +42,7 @@ feature of the shell. If you enclose a command in backticks
substituted into the command line before execution. So to compile
a GTK+ Hello, World, you would type the following:
<programlisting>
$ cc `pkg-config --cflags --libs gtk+-3.0` hello.c -o hello
$ cc `pkg-config --cflags gtk+-3.0` hello.c -o hello `pkg-config --libs gtk+-3.0`
</programlisting>
</para>
@@ -67,7 +67,7 @@ this range will trigger compiler warnings.
Here is how you would compile hello.c if you want to allow it
to use symbols that were not deprecated in 3.2:
<programlisting>
$ cc -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_2 `pkg-config --cflags --libs gtk+-3.0` hello.c -o hello
$ cc `pkg-config --cflags gtk+-3.0` -DGDK_VERSION_MIN_REQIRED=GDK_VERSION_3_2 hello.c -o hello `pkg-config --libs gtk+-3.0`
</programlisting>
</para>
@@ -75,7 +75,7 @@ $ cc -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_2 `pkg-config --cflags --libs gtk+
And here is how you would compile hello.c if you don't want
it to use any symbols that were introduced after 3.4:
<programlisting>
$ cc -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_4 `pkg-config --cflags --libs gtk+-3.0` hello.c -o hello
$ cc `pkg-config --cflags gtk+-3.0` -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_4 hello.c -o hello `pkg-config --libs gtk+-3.0`
</programlisting>
</para>
+3
View File
@@ -234,7 +234,10 @@
<xi:include href="xml/gtkpaned.xml" />
<xi:include href="xml/gtklayout.xml" />
<xi:include href="xml/gtknotebook.xml" />
<xi:include href="xml/gtkstack.xml" />
<xi:include href="xml/gtkstackswitcher.xml" />
<xi:include href="xml/gtkexpander.xml" />
<xi:include href="xml/gtkrevealer.xml" />
<xi:include href="xml/gtkoverlay.xml" />
<xi:include href="xml/gtkheaderbar.xml" />
<xi:include href="xml/gtkorientable.xml" />
+61 -2
View File
@@ -486,6 +486,8 @@ gtk_box_set_spacing
gtk_box_reorder_child
gtk_box_query_child_packing
gtk_box_set_child_packing
gtk_box_get_baseline_position
gtk_box_set_baseline_position
<SUBSECTION Standard>
GTK_BOX
GTK_IS_BOX
@@ -2485,7 +2487,7 @@ gtk_paned_get_type
<SECTION>
<FILE>gtkplacessidebar</FILE>
<TITLE>GtkPlacesSidebar</FILE>
<TITLE>GtkPlacesSidebar</TITLE>
GtkPlacesSidebar
GtkPlacesOpenFlags
gtk_places_sidebar_new
@@ -2493,11 +2495,14 @@ gtk_places_sidebar_set_open_flags
gtk_places_sidebar_set_location
gtk_places_sidebar_get_location
gtk_places_sidebar_set_show_desktop
gtk_places_sidebar_set_accept_uri_drops
gtk_places_sidebar_add_shortcut
gtk_places_sidebar_remove_shortcut
gtk_places_sidebar_list_shortcuts
gtk_places_sidebar_get_nth_bookmark
gtk_places_sidebar_get_open_flags
gtk_places_sidebar_get_show_connect_to_server
gtk_places_sidebar_get_show_desktop
gtk_places_sidebar_set_show_connect_to_server
<SUBSECTION Standard>
GTK_PLACES_SIDEBAR
GTK_IS_PLACES_SIDEBAR
@@ -5188,6 +5193,7 @@ gtk_widget_remove_tick_callback
gtk_widget_size_request
gtk_widget_get_child_requisition
gtk_widget_size_allocate
gtk_widget_size_allocate_with_baseline
gtk_widget_add_accelerator
gtk_widget_remove_accelerator
gtk_widget_set_accel_path
@@ -5320,6 +5326,7 @@ gtk_widget_get_allocated_width
gtk_widget_get_allocated_height
gtk_widget_get_allocation
gtk_widget_set_allocation
gtk_widget_get_allocated_baseline
gtk_widget_get_app_paintable
gtk_widget_get_can_default
gtk_widget_set_can_default
@@ -5380,8 +5387,10 @@ gtk_widget_get_preferred_height
gtk_widget_get_preferred_width
gtk_widget_get_preferred_height_for_width
gtk_widget_get_preferred_width_for_height
gtk_widget_get_preferred_height_and_baseline_for_width
gtk_widget_get_request_mode
gtk_widget_get_preferred_size
gtk_widget_get_preferred_size_and_baseline
gtk_distribute_natural_allocation
<SUBSECTION Alignment and Margins>
@@ -5389,6 +5398,7 @@ GtkAlign
gtk_widget_get_halign
gtk_widget_set_halign
gtk_widget_get_valign
gtk_widget_get_valign_with_baseline
gtk_widget_set_valign
gtk_widget_get_margin_left
gtk_widget_set_margin_left
@@ -7290,6 +7300,10 @@ gtk_grid_set_column_homogeneous
gtk_grid_get_column_homogeneous
gtk_grid_set_column_spacing
gtk_grid_get_column_spacing
gtk_grid_get_baseline_row
gtk_grid_set_baseline_row
gtk_grid_get_row_baseline_position
gtk_grid_set_row_baseline_position
<SUBSECTION Standard>
GtkGridClass
@@ -7564,3 +7578,48 @@ GTK_HEADER_BAR_GET_CLASS
<SUBSECTION Private>
gtk_header_bar_get_type
</SECTION>
<SECTION>
<FILE>gtkstack</FILE>
<TITLE>GtkStack</TITLE>
GtkStack
gtk_stack_new
gtk_stack_add_named
gtk_stack_add_titled
gtk_stack_set_visible_child
gtk_stack_get_visible_child
gtk_stack_set_visible_child_name
gtk_stack_get_visible_child_name
gtk_stack_set_visible_child_full
gtk_stack_set_homogeneous
gtk_stack_get_homogeneous
gtk_stack_set_transition_duration
gtk_stack_get_transition_duration
GtkStackTransitionType
gtk_stack_set_transition_type
gtk_stack_get_transition_type
</SECTION>
<SECTION>
<FILE>gtkstackswitcher</FILE>
<TITLE>GtkStackSwitcher</TITLE>
GtkStackSwitcher
gtk_stack_switcher_new
gtk_stack_switcher_set_stack
gtk_stack_switcher_get_stack
</SECTION>
<SECTION>
<FILE>gtkrevealer</FILE>
<TITLE>GtkRevealer</TITLE>
GtkRevealer
gtk_revealer_new
gtk_revealer_get_reveal_child
gtk_revealer_set_reveal_child
gtk_revealer_get_child_revealed
gtk_revealer_get_transition_duration
gtk_revealer_set_transition_duration
GtkRevealerTransitionType
gtk_revealer_get_transition_type
gtk_revealer_set_transition_type
</SECTION>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

+12
View File
@@ -18,6 +18,9 @@
<link linkend="GtkComboBox">
<inlinegraphic fileref="combo-box.png" format="PNG"></inlinegraphic>
</link>
<link linkend="GtkComboBoxText">
<inlinegraphic fileref="combo-box-text.png" format="PNG"></inlinegraphic>
</link>
<link linkend="GtkEntry">
<inlinegraphic fileref="entry.png" format="PNG"></inlinegraphic>
</link>
@@ -147,4 +150,13 @@
<link linkend="GtkFontChooserDialog">
<inlinegraphic fileref="fontchooser.png" format="PNG"></inlinegraphic>
</link>
<link linkend="GtkAboutDialog">
<inlinegraphic fileref="aboutdialog.png" format="PNG"></inlinegraphic>
</link>
<link linkend="GtkInfoBar">
<inlinegraphic fileref="info-bar.png" format="PNG"></inlinegraphic>
</link>
<link linkend="GtkScrollbar">
<inlinegraphic fileref="scrollbar.png" format="PNG"></inlinegraphic>
</link>
</para>
+76 -16
View File
@@ -400,11 +400,6 @@ create_combo_box_entry (void)
GtkWidget *align;
GtkWidget *child;
GtkTreeModel *model;
gtk_rc_parse_string ("style \"combo-box-entry-style\" {\n"
" GtkComboBox::appears-as-list = 1\n"
"}\n"
"widget_class \"GtkComboBoxEntry\" style \"combo-box-entry-style\"\n" );
model = (GtkTreeModel *)gtk_list_store_new (1, G_TYPE_STRING);
widget = g_object_new (GTK_TYPE_COMBO_BOX,
@@ -427,14 +422,22 @@ create_combo_box (void)
{
GtkWidget *widget;
GtkWidget *align;
gtk_rc_parse_string ("style \"combo-box-style\" {\n"
" GtkComboBox::appears-as-list = 0\n"
"}\n"
"widget_class \"GtkComboBox\" style \"combo-box-style\"\n" );
GtkCellRenderer *cell;
GtkListStore *store;
widget = gtk_combo_box_new ();
gtk_cell_layout_clear (GTK_CELL_LAYOUT (widget));
cell = gtk_cell_renderer_pixbuf_new ();
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (widget), cell, FALSE);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (widget), cell, "icon-name", 0, NULL);
cell = gtk_cell_renderer_text_new ();
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (widget), cell, FALSE);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (widget), cell, "text", 1, NULL);
store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
gtk_list_store_insert_with_values (store, NULL, -1, 0, "edit-delete", 1, "Combo Box", -1);
gtk_combo_box_set_model (GTK_COMBO_BOX (widget), GTK_TREE_MODEL (store));
widget = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Combo Box");
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_container_add (GTK_CONTAINER (align), widget);
@@ -442,6 +445,38 @@ create_combo_box (void)
return new_widget_info ("combo-box", align, SMALL);
}
static WidgetInfo *
create_combo_box_text (void)
{
GtkWidget *widget;
GtkWidget *align;
widget = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Combo Box Text");
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_container_add (GTK_CONTAINER (align), widget);
return new_widget_info ("combo-box-text", align, SMALL);
}
static WidgetInfo *
create_info_bar (void)
{
GtkWidget *widget;
GtkWidget *align;
widget = gtk_info_bar_new_with_buttons ("Close", 0, NULL);
gtk_info_bar_set_message_type (GTK_INFO_BAR (widget), GTK_MESSAGE_INFO);
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (widget))),
gtk_label_new ("Info Bar"));
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_container_add (GTK_CONTAINER (align), widget);
return new_widget_info ("info-bar", align, SMALL);
}
static WidgetInfo *
create_recent_chooser_dialog (void)
{
@@ -679,12 +714,12 @@ create_panes (void)
pane = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
gtk_paned_pack1 (GTK_PANED (pane),
g_object_new (GTK_TYPE_FRAME,
"shadow", GTK_SHADOW_IN,
"shadow-type", GTK_SHADOW_IN,
NULL),
FALSE, FALSE);
gtk_paned_pack2 (GTK_PANED (pane),
g_object_new (GTK_TYPE_FRAME,
"shadow", GTK_SHADOW_IN,
"shadow-type", GTK_SHADOW_IN,
NULL),
FALSE, FALSE);
gtk_box_pack_start (GTK_BOX (hbox),
@@ -693,12 +728,12 @@ create_panes (void)
pane = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
gtk_paned_pack1 (GTK_PANED (pane),
g_object_new (GTK_TYPE_FRAME,
"shadow", GTK_SHADOW_IN,
"shadow-type", GTK_SHADOW_IN,
NULL),
FALSE, FALSE);
gtk_paned_pack2 (GTK_PANED (pane),
g_object_new (GTK_TYPE_FRAME,
"shadow", GTK_SHADOW_IN,
"shadow-type", GTK_SHADOW_IN,
NULL),
FALSE, FALSE);
gtk_box_pack_start (GTK_BOX (hbox),
@@ -1022,6 +1057,8 @@ create_scrolledwindow (void)
GtkWidget *scrolledwin, *label;
scrolledwin = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwin),
GTK_POLICY_ALWAYS, GTK_POLICY_ALWAYS);
label = gtk_label_new ("Scrolled Window");
gtk_container_add (GTK_CONTAINER (scrolledwin), label);
@@ -1029,6 +1066,26 @@ create_scrolledwindow (void)
return new_widget_info ("scrolledwindow", scrolledwin, MEDIUM);
}
static WidgetInfo *
create_scrollbar (void)
{
GtkWidget *widget;
GtkWidget *vbox, *align;
widget = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, NULL);
gtk_widget_set_size_request (widget, 100, -1);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_container_add (GTK_CONTAINER (align), widget);
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_label_new ("Scrollbar"),
FALSE, FALSE, 0);
return new_widget_info ("scrollbar", vbox, SMALL);
}
static WidgetInfo *
create_spinbutton (void)
{
@@ -1257,6 +1314,7 @@ get_all_widgets (void)
retval = g_list_prepend (retval, create_color_button ());
retval = g_list_prepend (retval, create_combo_box ());
retval = g_list_prepend (retval, create_combo_box_entry ());
retval = g_list_prepend (retval, create_combo_box_text ());
retval = g_list_prepend (retval, create_entry ());
retval = g_list_prepend (retval, create_file_button ());
retval = g_list_prepend (retval, create_font_button ());
@@ -1273,6 +1331,7 @@ get_all_widgets (void)
retval = g_list_prepend (retval, create_radio ());
retval = g_list_prepend (retval, create_scales ());
retval = g_list_prepend (retval, create_scrolledwindow ());
retval = g_list_prepend (retval, create_scrollbar ());
retval = g_list_prepend (retval, create_separator ());
retval = g_list_prepend (retval, create_spinbutton ());
retval = g_list_prepend (retval, create_statusbar ());
@@ -1298,6 +1357,7 @@ get_all_widgets (void)
retval = g_list_prepend (retval, create_menu_button ());
retval = g_list_prepend (retval, create_search_entry ());
retval = g_list_prepend (retval, create_level_bar ());
retval = g_list_prepend (retval, create_info_bar ());
return retval;
}
+11 -23
View File
@@ -23,15 +23,12 @@ EXTRA_DIST += \
gen-keyname-table.pl \
gdkconfig.h.win32 \
gdkkeysyms-update.pl \
gdk.def \
gdkmarshalers.list \
gdkwindowimpl.h \
makefile.msc \
gdk.symbols \
gdkenumtypes.c.template \
gdkenumtypes.h.template \
gdkversionmacros.h.in \
abicheck.sh
gdkversionmacros.h.in
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"Gdk\" \
@@ -54,8 +51,7 @@ LDADD = \
-version-info $(LT_VERSION_INFO) \
-export-dynamic \
-rpath $(libdir) \
$(no_undefined) \
$(LIBTOOL_EXPORT_OPTIONS)
$(no_undefined)
#
# setup source file variables
@@ -144,11 +140,11 @@ gdk_c_sources = \
gdkwindowimpl.c
gdk_built_sources = \
gdkenumtypes.h \
gdkenumtypes.c \
gdkmarshalers.h \
gdkmarshalers.c \
gdkversionmacros.h \
gdkenumtypes.h
gdkversionmacros.h
#
# setup GDK sources and their dependencies
@@ -166,6 +162,7 @@ common_sources = \
gdkmarshalers.h
libgdk_3_la_SOURCES = $(common_sources)
libgdk_3_la_CFLAGS = $(AM_CFLAGS) $(GDK_HIDDEN_VISIBILITY_CFLAGS)
libgdk_3_la_LIBADD = $(GDK_DEP_LIBS)
libgdk_3_la_LDFLAGS = $(LDADD)
@@ -174,6 +171,7 @@ libgdk_3_la_LIBADD += x11/libgdk-x11.la
endif # USE_X11
if USE_QUARTZ
libgdk_3_la_CFLAGS = -xobjective-c
libgdk_3_la_LIBADD += quartz/libgdk-quartz.la
endif # USE_QUARTZ
@@ -299,16 +297,6 @@ install-ms-lib:
uninstall-ms-lib:
endif
# This places the generated .def file in srcdir, since it is expected to be there.
# (The one from a tarball is)
gdk.def: gdk.symbols
$(AM_V_GEN) (echo -e EXPORTS; $(CPP) -P -DGDK_WINDOWING_WIN32 - <$(srcdir)/gdk.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g') > $(srcdir)/gdk.def
TESTS_ENVIRONMENT = srcdir="$(srcdir)"
if OS_LINUX
TESTS = abicheck.sh
endif
lib_LTLIBRARIES = libgdk-3.la
MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
@@ -327,13 +315,13 @@ BUILT_SOURCES = \
gdkenumtypes.h: stamp-gdkenumtypes.h
@true
stamp-gdkenumtypes.h: @REBUILD@ $(gdk_public_h_sources) gdkenumtypes.h.template
stamp-gdkenumtypes.h: $(gdk_public_h_sources) gdkenumtypes.h.template
$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.h.template \
$(gdk_public_h_sources) ) >> xgen-geth \
&& (cmp -s xgen-geth gdkenumtypes.h || cp xgen-geth gdkenumtypes.h ) \
&& rm -f xgen-geth \
&& echo timestamp > $(@F)
gdkenumtypes.c: @REBUILD@ $(gdk_public_h_sources) gdkenumtypes.c.template
gdkenumtypes.c: $(gdk_public_h_sources) gdkenumtypes.c.template
$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.c.template \
$(gdk_public_h_sources) ) > xgen-getc \
&& cp xgen-getc gdkenumtypes.c \
@@ -342,11 +330,11 @@ gdkenumtypes.c: @REBUILD@ $(gdk_public_h_sources) gdkenumtypes.c.template
#
# Marshaller generation
#
gdkmarshalers.h: @REBUILD@ gdkmarshalers.list
gdkmarshalers.h: gdkmarshalers.list
$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --header > gdkmarshalers-h.tmp \
&& mv gdkmarshalers-h.tmp gdkmarshalers.h \
|| ( rm -f gdkmarshalers-h.tmp && exit 1)
gdkmarshalers.c: @REBUILD@ gdkmarshalers.list
gdkmarshalers.c: gdkmarshalers.list
$(AM_V_GEN) (echo "#include \"gdkmarshalers.h\""; \
$(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --body) > gdkmarshalers-c.tmp \
&& mv gdkmarshalers-c.tmp gdkmarshalers.c \
@@ -370,7 +358,7 @@ dist-hook: ../build/win32/vs9/gdk.vcproj ../build/win32/vs10/gdk.vcxproj ../buil
done >libgdk.sourcefiles
$(CPP) -P - <$(top_srcdir)/build/win32/vs9/gdk.vcprojin >$@
rm libgdk.sourcefiles
../build/win32/vs10/gdk.vcxproj: ../build/win32/vs10/gdk.vcxprojin
for F in $(libgdk_3_la_SOURCES); do \
case $$F in \
-5
View File
@@ -1,5 +0,0 @@
#! /bin/sh
cpp -P -DGDK_WINDOWING_X11 ${srcdir:-.}/gdk.symbols | sed -e '/^$/d' -e 's/ G_GNUC.*$//' | sort | uniq > expected-abi
nm -D -g --defined-only .libs/libgdk-3.so | cut -d ' ' -f 3 | egrep -v '^(__bss_start|_edata|_end)' | sort > actual-abi
diff -u expected-abi actual-abi && rm -f expected-abi actual-abi
+8 -9
View File
@@ -4,13 +4,14 @@ include $(top_srcdir)/Makefile.decl
libgdkincludedir = $(includedir)/gtk-3.0/gdk
libgdkbroadwayincludedir = $(includedir)/gtk-3.0/gdk/broadway
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"Gdk\" \
-DGDK_COMPILATION \
-I$(top_srcdir) \
-I$(top_srcdir)/gdk \
-I$(top_builddir)/gdk \
$(GTK_DEBUG_FLAGS) \
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"Gdk\" \
-DGDK_COMPILATION \
-I$(top_srcdir) \
-I$(top_srcdir)/gdk \
-I$(top_builddir)/gdk \
$(GDK_HIDDEN_VISIBILITY_CFLAGS) \
$(GTK_DEBUG_FLAGS) \
$(GDK_DEP_CFLAGS)
LDADDS = $(GDK_DEP_LIBS)
@@ -23,7 +24,6 @@ libgdkinclude_HEADERS = \
gdkbroadway.h
libgdkbroadwayinclude_HEADERS = \
gdkbroadwaydisplaymanager.h \
gdkbroadwaywindow.h \
gdkbroadwaycursor.h \
gdkbroadwayvisual.h
@@ -55,7 +55,6 @@ libgdk_broadway_la_SOURCES = \
gdkdevicemanager-broadway.c \
gdkdisplay-broadway.c \
gdkdisplay-broadway.h \
gdkdisplaymanager-broadway.c \
gdkdnd-broadway.c \
gdkeventsource.c \
gdkeventsource.h \
-1
View File
@@ -32,7 +32,6 @@
#include <gdk/broadway/gdkbroadwaywindow.h>
#include <gdk/broadway/gdkbroadwaycursor.h>
#include <gdk/broadway/gdkbroadwayvisual.h>
#include <gdk/broadway/gdkbroadwaydisplaymanager.h>
#undef __GDKBROADWAY_H_INSIDE__
+1
View File
@@ -47,6 +47,7 @@ typedef GdkCursor GdkBroadwayCursor;
#endif
typedef struct _GdkBroadwayCursorClass GdkBroadwayCursorClass;
GDK_AVAILABLE_IN_ALL
GType gdk_broadway_cursor_get_type (void);
G_END_DECLS
+1
View File
@@ -38,6 +38,7 @@ typedef GdkDisplayManager _GdkBroadwayDisplayManager;
#endif
typedef struct _GdkDisplayManagerClass GdkBroadwayDisplayManagerClass;
GDK_AVAILABLE_IN_ALL
GType gdk_broadway_display_manager_get_type (void);
G_END_DECLS
+1
View File
@@ -38,6 +38,7 @@ typedef GdkVisual GdkBroadwayVisual;
typedef struct _GdkBroadwayVisualClass GdkBroadwayVisualClass;
GDK_AVAILABLE_IN_ALL
GType gdk_broadway_visual_get_type (void);
G_END_DECLS
+2
View File
@@ -43,8 +43,10 @@ typedef GdkWindow GdkBroadwayWindow;
#endif
typedef struct _GdkBroadwayWindowClass GdkBroadwayWindowClass;
GDK_AVAILABLE_IN_ALL
GType gdk_broadway_window_get_type (void);
GDK_AVAILABLE_IN_ALL
guint32 gdk_broadway_get_last_seen_time (GdkWindow *window);
G_END_DECLS
-103
View File
@@ -1,103 +0,0 @@
/* GDK - The GIMP Drawing Kit
* gdkdisplaymanager-broadway.c
*
* Copyright (C) 2005 Imendio AB
* Copyright 2010 Red Hat, Inc.
*
* Author: Matthias clasen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <stdlib.h>
#include "gdkdisplay-broadway.h"
#include "gdkbroadwaydisplaymanager.h"
#include "gdkprivate-broadway.h"
#include "gdkdisplaymanagerprivate.h"
#include "gdkinternals.h"
struct _GdkBroadwayDisplayManager
{
GdkDisplayManager parent;
gboolean init_failed;
};
static void g_initable_iface_init (GInitableIface *iface);
G_DEFINE_TYPE_WITH_CODE (GdkBroadwayDisplayManager, gdk_broadway_display_manager, GDK_TYPE_DISPLAY_MANAGER,
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, g_initable_iface_init))
static gboolean
gdk_broadway_display_manager_initable_init (GInitable *initable,
GCancellable *cancellable,
GError **error)
{
const gchar *display_name;
gint port;
GdkBroadwayServer *server;
display_name = g_getenv ("BROADWAY_DISPLAY");
port = 0;
if (display_name != NULL)
{
if (*display_name == ':')
display_name++;
port = strtol(display_name, NULL, 10);
}
if (port == 0)
port = 1;
server = _gdk_broadway_server_new (port, NULL);
if (server == NULL)
{
GDK_BROADWAY_DISPLAY_MANAGER (initable)->init_failed = TRUE;
return FALSE;
}
g_object_unref (server);
return TRUE;
}
void
g_initable_iface_init (GInitableIface *iface)
{
iface->init = gdk_broadway_display_manager_initable_init;
}
static void
gdk_broadway_display_manager_init (GdkBroadwayDisplayManager *manager)
{
}
static void
gdk_broadway_display_manager_finalize (GObject *object)
{
if (!GDK_BROADWAY_DISPLAY_MANAGER (object)->init_failed)
g_error ("A GdkBroadwayDisplayManager object was finalized. This should not happen");
G_OBJECT_CLASS (gdk_broadway_display_manager_parent_class)->finalize (object);
}
static void
gdk_broadway_display_manager_class_init (GdkBroadwayDisplayManagerClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
object_class->finalize = gdk_broadway_display_manager_finalize;
}
-51
View File
@@ -1470,56 +1470,6 @@ _gdk_broadway_window_queue_antiexpose (GdkWindow *window,
return TRUE;
}
static void
copy_region (cairo_surface_t *surface,
cairo_region_t *area,
gint dx,
gint dy)
{
cairo_t *cr;
cr = cairo_create (surface);
gdk_cairo_region (cr, area);
cairo_clip (cr);
/* NB: This is a self-copy and Cairo doesn't support that yet.
* So we do a litle trick.
*/
cairo_push_group (cr);
cairo_set_source_surface (cr, surface, dx, dy);
cairo_paint (cr);
cairo_pop_group_to_source (cr);
cairo_paint (cr);
cairo_destroy (cr);
}
void
_gdk_broadway_window_translate (GdkWindow *window,
cairo_region_t *area,
gint dx,
gint dy)
{
GdkWindowImplBroadway *impl;
GdkBroadwayDisplay *broadway_display;
impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
if (impl->surface)
{
copy_region (impl->surface, area, dx, dy);
broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window));
if (_gdk_broadway_server_window_translate (broadway_display->server,
impl->id,
area, dx, dy))
queue_flush (window);
}
}
guint32
gdk_broadway_get_last_seen_time (GdkWindow *window)
{
@@ -1558,7 +1508,6 @@ gdk_window_impl_broadway_class_init (GdkWindowImplBroadwayClass *klass)
impl_class->input_shape_combine_region = gdk_window_broadway_input_shape_combine_region;
impl_class->set_static_gravities = gdk_window_broadway_set_static_gravities;
impl_class->queue_antiexpose = _gdk_broadway_window_queue_antiexpose;
impl_class->translate = _gdk_broadway_window_translate;
impl_class->destroy = _gdk_broadway_window_destroy;
impl_class->destroy_foreign = gdk_broadway_window_destroy_foreign;
impl_class->resize_cairo_surface = gdk_window_broadway_resize_cairo_surface;
+6 -8
View File
@@ -26,6 +26,7 @@
#define GDK_DISABLE_DEPRECATION_WARNINGS 1
#include "gdkversionmacros.h"
#include "gdkmain.h"
#include "gdkinternals.h"
@@ -382,9 +383,6 @@ gdk_display_open_default_libgtk_only (void)
g_return_val_if_fail (gdk_initialized, NULL);
if (gdk_display_manager_peek () == NULL)
return NULL;
display = gdk_display_get_default ();
if (display)
return display;
@@ -669,12 +667,12 @@ gdk_init (int *argc, char ***argv)
* </informalexample>
*
* Unfortunately, all of the above documentation holds with the X11
* backend only. With the Win32 backend, GDK and GTK+ calls should not
* be attempted from multiple threads at all. Combining the GDK lock
* with other locks such as the Python global interpreter lock can be
* complicated.
* backend only. With the Win32 or Quartz backends, GDK and GTK+ calls
* must occur only in the main thread (see below). When using Python,
* even on X11 combining the GDK lock with other locks such as the
* Python global interpreter lock can be complicated.
*
* For these reason, the threading support has been deprecated in
* For these reasons, the threading support has been deprecated in
* GTK+ 3.6. Instead of calling GTK+ directly from multiple threads,
* it is recommended to use g_idle_add(), g_main_context_invoke()
* and similar functions to make these calls from the main thread
-617
View File
@@ -1,617 +0,0 @@
/* This file lists all exported symbols. It is used to generate
* the gdk.def file used to control exports on Windows.
*/
gdk_add_option_entries_libgtk_only
gdk_app_launch_context_get_type
gdk_app_launch_context_new
gdk_app_launch_context_set_desktop
gdk_app_launch_context_set_display
gdk_app_launch_context_set_icon
gdk_app_launch_context_set_icon_name
gdk_app_launch_context_set_screen
gdk_app_launch_context_set_timestamp
gdk_atom_intern
gdk_atom_intern_static_string
gdk_atom_name
gdk_axis_use_get_type
gdk_beep
gdk_byte_order_get_type
gdk_cairo_create
gdk_cairo_get_clip_rectangle
gdk_cairo_rectangle
gdk_cairo_region
gdk_cairo_region_create_from_surface
gdk_cairo_set_source_color
gdk_cairo_set_source_pixbuf
gdk_cairo_set_source_rgba
gdk_cairo_set_source_window
gdk_color_copy
gdk_color_equal
gdk_color_free
gdk_color_get_type
gdk_color_hash
gdk_color_parse
gdk_color_to_string
gdk_crossing_mode_get_type
gdk_cursor_get_cursor_type
gdk_cursor_get_display
gdk_cursor_get_image
gdk_cursor_get_type
gdk_cursor_new
gdk_cursor_new_for_display
gdk_cursor_new_from_name
gdk_cursor_new_from_pixbuf
gdk_cursor_ref
gdk_cursor_type_get_type
gdk_cursor_unref
gdk_device_free_history
gdk_device_get_associated_device
gdk_device_get_axis
gdk_device_get_axis_use
gdk_device_get_axis_value
gdk_device_get_device_type
gdk_device_get_display
gdk_device_get_has_cursor
gdk_device_get_history
gdk_device_get_key
gdk_device_get_mode
gdk_device_get_name
gdk_device_get_n_axes
gdk_device_get_n_keys
gdk_device_get_position
gdk_device_get_source
gdk_device_get_state
gdk_device_get_type
gdk_device_get_window_at_position
gdk_device_grab
gdk_device_grab_info_libgtk_only
gdk_device_list_axes
gdk_device_list_slave_devices
gdk_device_manager_get_client_pointer
gdk_device_manager_get_display
gdk_device_manager_get_type
gdk_device_manager_list_devices
gdk_device_set_axis_use
gdk_device_set_key
gdk_device_set_mode
gdk_device_type_get_type
gdk_device_ungrab
gdk_device_warp
gdk_disable_multidevice
gdk_display_beep
gdk_display_close
gdk_display_device_is_grabbed
gdk_display_flush
gdk_display_get_app_launch_context
gdk_display_get_default
gdk_display_get_default_cursor_size
gdk_display_get_default_group
gdk_display_get_default_screen
gdk_display_get_device_manager
gdk_display_get_event
gdk_display_get_maximal_cursor_size
gdk_display_get_name
gdk_display_get_n_screens
gdk_display_get_pointer
gdk_display_get_screen
gdk_display_get_type
gdk_display_get_window_at_pointer
gdk_display_has_pending
gdk_display_is_closed
gdk_display_keyboard_ungrab
gdk_display_list_devices
gdk_display_manager_get
gdk_display_manager_peek
gdk_display_manager_get_default_display
gdk_display_manager_get_type
gdk_display_manager_list_displays
gdk_display_manager_open_display
gdk_display_manager_set_default_display
gdk_display_notify_startup_complete
gdk_display_open
gdk_display_open_default_libgtk_only
gdk_display_peek_event
gdk_display_pointer_is_grabbed
gdk_display_pointer_ungrab
gdk_display_put_event
gdk_display_request_selection_notification
gdk_display_set_double_click_distance
gdk_display_set_double_click_time
gdk_display_store_clipboard
gdk_display_supports_clipboard_persistence
gdk_display_supports_composite
gdk_display_supports_cursor_alpha
gdk_display_supports_cursor_color
gdk_display_supports_input_shapes
gdk_display_supports_selection_notification
gdk_display_supports_shapes
gdk_display_sync
gdk_display_warp_pointer
gdk_drag_abort
gdk_drag_action_get_type
gdk_drag_begin
gdk_drag_begin_for_device
gdk_drag_context_get_actions
gdk_drag_context_get_dest_window
gdk_drag_context_get_device
gdk_drag_context_get_protocol
gdk_drag_context_get_selected_action
gdk_drag_context_get_source_window
gdk_drag_context_get_suggested_action
gdk_drag_context_get_type
gdk_drag_context_list_targets
gdk_drag_context_set_device
gdk_drag_drop
gdk_drag_drop_succeeded
gdk_drag_find_window_for_screen
gdk_drag_get_selection
gdk_drag_motion
gdk_drag_protocol_get_type
gdk_drag_status
gdk_drop_finish
gdk_drop_reply
gdk_error_trap_pop
gdk_error_trap_pop_ignored
gdk_error_trap_push
gdk_event_copy
gdk_event_free
gdk_event_get
gdk_event_get_axis
gdk_event_get_button
gdk_event_get_click_count
gdk_event_get_coords
gdk_event_get_device
gdk_event_get_keycode
gdk_event_get_keyval
gdk_event_get_root_coords
gdk_event_get_screen
gdk_event_get_scroll_direction
gdk_event_get_scroll_deltas
gdk_event_get_source_device
gdk_event_get_state
gdk_event_get_time
gdk_event_get_event_sequence
gdk_event_get_type
gdk_event_handler_set
gdk_event_mask_get_type
gdk_event_new
gdk_event_peek
gdk_event_put
gdk_event_request_motions
gdk_event_set_device
gdk_event_set_screen
gdk_event_set_source_device
gdk_event_triggers_context_menu
gdk_events_get_angle
gdk_events_get_center
gdk_events_get_distance
gdk_events_pending
gdk_event_type_get_type
gdk_filter_return_get_type
gdk_flush
gdk_frame_clock_begin_updating
gdk_frame_clock_end_updating
gdk_frame_clock_get_current_timings
gdk_frame_clock_get_frame_counter
gdk_frame_clock_get_frame_time
gdk_frame_clock_get_history_start
gdk_frame_clock_get_refresh_info
gdk_frame_clock_get_timings
gdk_frame_clock_get_type
gdk_frame_clock_idle_get_type
gdk_frame_clock_phase_get_type
gdk_frame_clock_request_phase
gdk_frame_timings_get_complete
gdk_frame_timings_get_frame_counter
gdk_frame_timings_get_frame_time
gdk_frame_timings_get_predicted_presentation_time
gdk_frame_timings_get_presentation_time
gdk_frame_timings_get_refresh_interval
gdk_frame_timings_get_type
gdk_frame_timings_ref
gdk_frame_timings_unref
gdk_fullscreen_mode_get_type
gdk_get_default_root_window
gdk_get_display
gdk_get_display_arg_name
gdk_get_program_class
gdk_get_show_events
gdk_grab_ownership_get_type
gdk_grab_status_get_type
gdk_gravity_get_type
gdk_init
gdk_init_check
gdk_input_mode_get_type
gdk_input_source_get_type
gdk_keyboard_grab
gdk_keyboard_ungrab
gdk_keymap_add_virtual_modifiers
gdk_keymap_get_caps_lock_state
gdk_keymap_get_default
gdk_keymap_get_direction
gdk_keymap_get_entries_for_keycode
gdk_keymap_get_entries_for_keyval
gdk_keymap_get_for_display
gdk_keymap_get_modifier_mask
gdk_keymap_get_modifier_state
gdk_keymap_get_num_lock_state
gdk_keymap_get_type
gdk_keymap_have_bidi_layouts
gdk_keymap_lookup_key
gdk_keymap_map_virtual_modifiers
gdk_keymap_translate_keyboard_state
gdk_keyval_convert_case
gdk_keyval_from_name
gdk_keyval_is_lower
gdk_keyval_is_upper
gdk_keyval_name
gdk_keyval_to_lower
gdk_keyval_to_unicode
gdk_keyval_to_upper
gdk_list_visuals
gdk_modifier_intent_get_type
gdk_modifier_type_get_type
gdk_notify_startup_complete
gdk_notify_startup_complete_with_id
gdk_notify_type_get_type
gdk_offscreen_window_get_embedder
gdk_offscreen_window_get_surface
gdk_offscreen_window_get_type
gdk_offscreen_window_set_embedder
gdk_owner_change_get_type
gdk_pango_context_get
gdk_pango_context_get_for_screen
gdk_pango_layout_get_clip_region
gdk_pango_layout_line_get_clip_region
gdk_parse_args
gdk_pixbuf_get_from_surface
gdk_pixbuf_get_from_window
gdk_pointer_grab
gdk_pointer_is_grabbed
gdk_pointer_ungrab
gdk_pre_parse_libgtk_only
gdk_property_change
gdk_property_delete
gdk_property_get
gdk_property_state_get_type
gdk_prop_mode_get_type
gdk_query_depths
gdk_query_visual_types
gdk_rectangle_get_type
gdk_rectangle_intersect
gdk_rectangle_union
gdk_rgba_copy
gdk_rgba_equal
gdk_rgba_free
gdk_rgba_get_type
gdk_rgba_hash
gdk_rgba_parse
gdk_rgba_to_string
gdk_screen_get_active_window
gdk_screen_get_default
gdk_screen_get_display
gdk_screen_get_font_options
gdk_screen_get_height
gdk_screen_get_height_mm
gdk_screen_get_monitor_at_point
gdk_screen_get_monitor_at_window
gdk_screen_get_monitor_geometry
gdk_screen_get_monitor_workarea
gdk_screen_get_monitor_height_mm
gdk_screen_get_monitor_plug_name
gdk_screen_get_monitor_width_mm
gdk_screen_get_n_monitors
gdk_screen_get_number
gdk_screen_get_primary_monitor
gdk_screen_get_resolution
gdk_screen_get_rgba_visual
gdk_screen_get_root_window
gdk_screen_get_setting
gdk_screen_get_system_visual
gdk_screen_get_toplevel_windows
gdk_screen_get_type
gdk_screen_get_width
gdk_screen_get_width_mm
gdk_screen_get_window_stack
gdk_screen_height
gdk_screen_height_mm
gdk_screen_is_composited
gdk_screen_list_visuals
gdk_screen_make_display_name
gdk_screen_set_font_options
gdk_screen_set_resolution
gdk_screen_width
gdk_screen_width_mm
gdk_scroll_direction_get_type
gdk_selection_convert
gdk_selection_owner_get
gdk_selection_owner_get_for_display
gdk_selection_owner_set
gdk_selection_owner_set_for_display
gdk_selection_property_get
gdk_selection_send_notify
gdk_selection_send_notify_for_display
gdk_set_double_click_time
gdk_set_program_class
gdk_set_show_events
gdk_setting_action_get_type
gdk_setting_get
gdk_set_allowed_backends
gdk_status_get_type
gdk_synthesize_window_state
gdk_test_render_sync
gdk_test_simulate_button
gdk_test_simulate_key
gdk_text_property_to_utf8_list_for_display
gdk_threads_add_idle
gdk_threads_add_idle_full
gdk_threads_add_timeout
gdk_threads_add_timeout_full
gdk_threads_add_timeout_seconds
gdk_threads_add_timeout_seconds_full
gdk_threads_enter
gdk_threads_init
gdk_threads_leave
gdk_threads_set_lock_functions
gdk_unicode_to_keyval
gdk_utf8_to_string_target
gdk_visibility_state_get_type
gdk_visual_get_best
gdk_visual_get_best_depth
gdk_visual_get_best_type
gdk_visual_get_best_with_both
gdk_visual_get_best_with_depth
gdk_visual_get_best_with_type
gdk_visual_get_bits_per_rgb
gdk_visual_get_blue_pixel_details
gdk_visual_get_byte_order
gdk_visual_get_colormap_size
gdk_visual_get_depth
gdk_visual_get_green_pixel_details
gdk_visual_get_red_pixel_details
gdk_visual_get_screen
gdk_visual_get_system
gdk_visual_get_type
gdk_visual_get_visual_type
gdk_visual_type_get_type
#ifdef GDK_WINDOWING_WIN32
gdk_win32_handle_table_lookup
gdk_win32_icon_to_pixbuf_libgtk_only
gdk_win32_pixbuf_to_hicon_libgtk_only
gdk_win32_selection_add_targets
gdk_win32_set_modal_dialog_libgtk_only
gdk_win32_window_is_win32
gdk_win32_window_get_impl_hwnd
gdk_win32_window_get_handle
gdk_win32_window_get_type
gdk_win32_display_get_type
gdk_win32_window_foreign_new_for_display
gdk_win32_window_lookup_for_display
#endif
gdk_window_add_filter
gdk_window_at_pointer
gdk_window_attributes_type_get_type
gdk_window_beep
gdk_window_begin_move_drag
gdk_window_begin_move_drag_for_device
gdk_window_begin_paint_rect
gdk_window_begin_paint_region
gdk_window_begin_resize_drag
gdk_window_begin_resize_drag_for_device
gdk_window_window_class_get_type
gdk_window_configure_finished
gdk_window_constrain_size
gdk_window_coords_from_parent
gdk_window_coords_to_parent
gdk_window_create_similar_surface
gdk_window_deiconify
gdk_window_destroy
gdk_window_destroy_notify
gdk_window_edge_get_type
gdk_window_enable_synchronized_configure
gdk_window_end_paint
gdk_window_ensure_native
gdk_window_flush
gdk_window_focus
gdk_window_freeze_toplevel_updates_libgtk_only
gdk_window_freeze_updates
gdk_window_fullscreen
gdk_window_geometry_changed
gdk_window_get_accept_focus
gdk_window_get_background_pattern
gdk_window_get_children
gdk_window_get_clip_region
gdk_window_get_composited
gdk_window_get_cursor
gdk_window_get_decorations
gdk_window_get_device_cursor
gdk_window_get_device_events
gdk_window_get_device_position
gdk_window_get_display
gdk_window_get_drag_protocol
gdk_window_get_effective_parent
gdk_window_get_effective_toplevel
gdk_window_get_events
gdk_window_get_focus_on_map
gdk_window_get_frame_clock
gdk_window_get_frame_extents
gdk_window_get_fullscreen_mode
gdk_window_get_geometry
gdk_window_get_group
gdk_window_get_height
gdk_window_get_modal_hint
gdk_window_get_origin
gdk_window_get_parent
gdk_window_get_pointer
gdk_window_get_position
gdk_window_get_root_coords
gdk_window_get_root_origin
gdk_window_get_screen
gdk_window_get_source_events
gdk_window_get_state
gdk_window_get_support_multidevice
gdk_window_get_toplevel
gdk_window_get_type
gdk_window_get_type_hint
gdk_window_get_update_area
gdk_window_get_user_data
gdk_window_get_visible_region
gdk_window_get_visual
gdk_window_get_width
gdk_window_get_window_type
gdk_window_has_native
gdk_window_hide
gdk_window_hints_get_type
gdk_window_iconify
gdk_window_impl_get_type
#ifdef GDK_WINDOWING_X11
gdk_window_impl_x11_get_type
#endif
gdk_window_input_shape_combine_region
gdk_window_invalidate_maybe_recurse
gdk_window_invalidate_rect
gdk_window_invalidate_region
gdk_window_is_destroyed
gdk_window_is_input_only
gdk_window_is_shaped
gdk_window_is_viewable
gdk_window_is_visible
gdk_window_lower
gdk_window_maximize
gdk_window_merge_child_input_shapes
gdk_window_merge_child_shapes
gdk_window_move
gdk_window_move_region
gdk_window_move_resize
gdk_window_new
gdk_window_peek_children
gdk_window_process_all_updates
gdk_window_process_updates
gdk_window_raise
gdk_window_register_dnd
gdk_window_remove_filter
gdk_window_reparent
gdk_window_resize
gdk_window_restack
gdk_window_scroll
gdk_window_set_accept_focus
gdk_window_set_background
gdk_window_set_background_pattern
gdk_window_set_background_rgba
gdk_window_set_child_input_shapes
gdk_window_set_child_shapes
gdk_window_set_composited
gdk_window_set_cursor
gdk_window_set_debug_updates
gdk_window_set_decorations
gdk_window_set_device_cursor
gdk_window_set_device_events
gdk_window_set_events
gdk_window_set_focus_on_map
gdk_window_set_fullscreen_mode
gdk_window_set_functions
gdk_window_set_geometry_hints
gdk_window_set_group
gdk_window_set_icon_list
gdk_window_set_icon_name
gdk_window_set_keep_above
gdk_window_set_keep_below
gdk_window_set_modal_hint
gdk_window_set_opacity
gdk_window_set_override_redirect
gdk_window_set_role
gdk_window_set_skip_pager_hint
gdk_window_set_skip_taskbar_hint
gdk_window_set_source_events
gdk_window_set_startup_id
gdk_window_set_static_gravities
gdk_window_set_support_multidevice
gdk_window_set_title
gdk_window_set_transient_for
gdk_window_set_type_hint
gdk_window_set_urgency_hint
gdk_window_set_user_data
gdk_window_shape_combine_region
gdk_window_show
gdk_window_show_unraised
gdk_window_state_get_type
gdk_window_stick
gdk_window_thaw_toplevel_updates_libgtk_only
gdk_window_thaw_updates
gdk_window_type_get_type
gdk_window_type_hint_get_type
gdk_window_unfullscreen
gdk_window_unmaximize
gdk_window_unstick
gdk_window_withdraw
gdk_wm_decoration_get_type
gdk_wm_function_get_type
#ifdef GDK_WINDOWING_X11
gdk_x11_app_launch_context_get_type
gdk_x11_atom_to_xatom
gdk_x11_atom_to_xatom_for_display
gdk_x11_cursor_get_type
gdk_x11_cursor_get_xcursor
gdk_x11_cursor_get_xdisplay
gdk_x11_device_core_get_type
gdk_x11_device_get_id
gdk_x11_device_manager_core_get_type
gdk_x11_device_manager_lookup
gdk_x11_device_manager_xi2_get_type
gdk_x11_device_xi2_get_type
gdk_x11_display_broadcast_startup_message
gdk_x11_display_error_trap_pop
gdk_x11_display_error_trap_pop_ignored
gdk_x11_display_error_trap_push
gdk_x11_display_get_startup_notification_id
gdk_x11_display_get_type
gdk_x11_display_get_user_time
gdk_x11_display_get_xdisplay
gdk_x11_display_grab
gdk_x11_display_manager_get_type
gdk_x11_display_set_cursor_theme
gdk_x11_display_set_startup_notification_id
gdk_x11_display_string_to_compound_text
gdk_x11_display_text_property_to_text_list
gdk_x11_display_ungrab
gdk_x11_display_utf8_to_compound_text
gdk_x11_drag_context_get_type
gdk_x11_free_compound_text
gdk_x11_free_text_list
gdk_x11_get_default_root_xwindow
gdk_x11_get_default_screen
gdk_x11_get_default_xdisplay
gdk_x11_get_server_time
gdk_x11_get_xatom_by_name
gdk_x11_get_xatom_by_name_for_display
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
gdk_x11_screen_get_screen_number
gdk_x11_screen_get_type
gdk_x11_screen_get_window_manager_name
gdk_x11_screen_get_xscreen
gdk_x11_screen_lookup_visual
gdk_x11_screen_supports_net_wm_hint
gdk_x11_set_sm_client_id
gdk_x11_ungrab_server
gdk_x11_visual_get_type
gdk_x11_visual_get_xvisual
gdk_x11_window_foreign_new_for_display
gdk_x11_window_lookup_for_display
gdk_x11_window_get_type
gdk_x11_window_get_xid
gdk_x11_window_move_to_current_desktop
gdk_x11_window_set_theme_variant
gdk_x11_window_set_hide_titlebar_when_maximized
gdk_x11_window_set_user_time
gdk_x11_window_set_utf8_property
gdk_x11_xatom_to_atom
gdk_x11_xatom_to_atom_for_display
#endif
+6
View File
@@ -37,6 +37,7 @@ G_BEGIN_DECLS
#define GDK_IS_APP_LAUNCH_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_APP_LAUNCH_CONTEXT))
GDK_AVAILABLE_IN_ALL
GType gdk_app_launch_context_get_type (void);
GDK_DEPRECATED_IN_3_0_FOR(gdk_display_get_app_launch_context)
@@ -44,14 +45,19 @@ GdkAppLaunchContext *gdk_app_launch_context_new (void);
GDK_DEPRECATED_IN_3_0_FOR(gdk_display_get_app_launch_context)
void gdk_app_launch_context_set_display (GdkAppLaunchContext *context,
GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
void gdk_app_launch_context_set_screen (GdkAppLaunchContext *context,
GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
void gdk_app_launch_context_set_desktop (GdkAppLaunchContext *context,
gint desktop);
GDK_AVAILABLE_IN_ALL
void gdk_app_launch_context_set_timestamp (GdkAppLaunchContext *context,
guint32 timestamp);
GDK_AVAILABLE_IN_ALL
void gdk_app_launch_context_set_icon (GdkAppLaunchContext *context,
GIcon *icon);
GDK_AVAILABLE_IN_ALL
void gdk_app_launch_context_set_icon_name (GdkAppLaunchContext *context,
const char *icon_name);
+8
View File
@@ -30,26 +30,34 @@
G_BEGIN_DECLS
GDK_AVAILABLE_IN_ALL
cairo_t * gdk_cairo_create (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
gboolean gdk_cairo_get_clip_rectangle (cairo_t *cr,
GdkRectangle *rect);
GDK_AVAILABLE_IN_ALL
void gdk_cairo_set_source_rgba (cairo_t *cr,
const GdkRGBA *rgba);
GDK_AVAILABLE_IN_ALL
void gdk_cairo_set_source_pixbuf (cairo_t *cr,
const GdkPixbuf *pixbuf,
gdouble pixbuf_x,
gdouble pixbuf_y);
GDK_AVAILABLE_IN_ALL
void gdk_cairo_set_source_window (cairo_t *cr,
GdkWindow *window,
gdouble x,
gdouble y);
GDK_AVAILABLE_IN_ALL
void gdk_cairo_rectangle (cairo_t *cr,
const GdkRectangle *rectangle);
GDK_AVAILABLE_IN_ALL
void gdk_cairo_region (cairo_t *cr,
const cairo_region_t *region);
GDK_AVAILABLE_IN_ALL
cairo_region_t *
gdk_cairo_region_create_from_surface
(cairo_surface_t *surface);
+8
View File
@@ -31,6 +31,7 @@
#include <cairo.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
@@ -58,17 +59,24 @@ struct _GdkColor
#define GDK_TYPE_COLOR (gdk_color_get_type ())
GDK_AVAILABLE_IN_ALL
GType gdk_color_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GdkColor *gdk_color_copy (const GdkColor *color);
GDK_AVAILABLE_IN_ALL
void gdk_color_free (GdkColor *color);
GDK_AVAILABLE_IN_ALL
guint gdk_color_hash (const GdkColor *color);
GDK_AVAILABLE_IN_ALL
gboolean gdk_color_equal (const GdkColor *colora,
const GdkColor *colorb);
GDK_AVAILABLE_IN_ALL
gboolean gdk_color_parse (const gchar *spec,
GdkColor *color);
GDK_AVAILABLE_IN_ALL
gchar * gdk_color_to_string (const GdkColor *color);
+8
View File
@@ -213,25 +213,33 @@ typedef enum
/* Cursors
*/
GDK_AVAILABLE_IN_ALL
GType gdk_cursor_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GdkCursor* gdk_cursor_new_for_display (GdkDisplay *display,
GdkCursorType cursor_type);
#ifndef GDK_MULTIHEAD_SAFE
GDK_AVAILABLE_IN_ALL
GdkCursor* gdk_cursor_new (GdkCursorType cursor_type);
#endif
GDK_AVAILABLE_IN_ALL
GdkCursor* gdk_cursor_new_from_pixbuf (GdkDisplay *display,
GdkPixbuf *pixbuf,
gint x,
gint y);
GDK_AVAILABLE_IN_ALL
GdkCursor* gdk_cursor_new_from_name (GdkDisplay *display,
const gchar *name);
GDK_AVAILABLE_IN_ALL
GdkDisplay* gdk_cursor_get_display (GdkCursor *cursor);
GDK_DEPRECATED_IN_3_0_FOR(g_object_ref)
GdkCursor * gdk_cursor_ref (GdkCursor *cursor);
GDK_DEPRECATED_IN_3_0_FOR(g_object_unref)
void gdk_cursor_unref (GdkCursor *cursor);
GDK_AVAILABLE_IN_ALL
GdkPixbuf* gdk_cursor_get_image (GdkCursor *cursor);
GDK_AVAILABLE_IN_ALL
GdkCursorType gdk_cursor_get_cursor_type (GdkCursor *cursor);
+29
View File
@@ -22,6 +22,7 @@
#error "Only <gdk/gdk.h> can be included directly."
#endif
#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
@@ -141,75 +142,100 @@ struct _GdkTimeCoord
gdouble axes[GDK_MAX_TIMECOORD_AXES];
};
GDK_AVAILABLE_IN_ALL
GType gdk_device_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
const gchar * gdk_device_get_name (GdkDevice *device);
GDK_AVAILABLE_IN_ALL
gboolean gdk_device_get_has_cursor (GdkDevice *device);
/* Functions to configure a device */
GDK_AVAILABLE_IN_ALL
GdkInputSource gdk_device_get_source (GdkDevice *device);
GDK_AVAILABLE_IN_ALL
GdkInputMode gdk_device_get_mode (GdkDevice *device);
GDK_AVAILABLE_IN_ALL
gboolean gdk_device_set_mode (GdkDevice *device,
GdkInputMode mode);
GDK_AVAILABLE_IN_ALL
gint gdk_device_get_n_keys (GdkDevice *device);
GDK_AVAILABLE_IN_ALL
gboolean gdk_device_get_key (GdkDevice *device,
guint index_,
guint *keyval,
GdkModifierType *modifiers);
GDK_AVAILABLE_IN_ALL
void gdk_device_set_key (GdkDevice *device,
guint index_,
guint keyval,
GdkModifierType modifiers);
GDK_AVAILABLE_IN_ALL
GdkAxisUse gdk_device_get_axis_use (GdkDevice *device,
guint index_);
GDK_AVAILABLE_IN_ALL
void gdk_device_set_axis_use (GdkDevice *device,
guint index_,
GdkAxisUse use);
GDK_AVAILABLE_IN_ALL
void gdk_device_get_state (GdkDevice *device,
GdkWindow *window,
gdouble *axes,
GdkModifierType *mask);
GDK_AVAILABLE_IN_ALL
void gdk_device_get_position (GdkDevice *device,
GdkScreen **screen,
gint *x,
gint *y);
GDK_AVAILABLE_IN_ALL
GdkWindow *
gdk_device_get_window_at_position
(GdkDevice *device,
gint *win_x,
gint *win_y);
GDK_AVAILABLE_IN_ALL
gboolean gdk_device_get_history (GdkDevice *device,
GdkWindow *window,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
gint *n_events);
GDK_AVAILABLE_IN_ALL
void gdk_device_free_history (GdkTimeCoord **events,
gint n_events);
GDK_AVAILABLE_IN_ALL
gint gdk_device_get_n_axes (GdkDevice *device);
GDK_AVAILABLE_IN_ALL
GList * gdk_device_list_axes (GdkDevice *device);
GDK_AVAILABLE_IN_ALL
gboolean gdk_device_get_axis_value (GdkDevice *device,
gdouble *axes,
GdkAtom axis_label,
gdouble *value);
GDK_AVAILABLE_IN_ALL
gboolean gdk_device_get_axis (GdkDevice *device,
gdouble *axes,
GdkAxisUse use,
gdouble *value);
GDK_AVAILABLE_IN_ALL
GdkDisplay * gdk_device_get_display (GdkDevice *device);
GDK_AVAILABLE_IN_ALL
GdkDevice * gdk_device_get_associated_device (GdkDevice *device);
GDK_AVAILABLE_IN_ALL
GList * gdk_device_list_slave_devices (GdkDevice *device);
GDK_AVAILABLE_IN_ALL
GdkDeviceType gdk_device_get_device_type (GdkDevice *device);
GDK_AVAILABLE_IN_ALL
GdkGrabStatus gdk_device_grab (GdkDevice *device,
GdkWindow *window,
GdkGrabOwnership grab_ownership,
@@ -218,14 +244,17 @@ GdkGrabStatus gdk_device_grab (GdkDevice *device,
GdkCursor *cursor,
guint32 time_);
GDK_AVAILABLE_IN_ALL
void gdk_device_ungrab (GdkDevice *device,
guint32 time_);
GDK_AVAILABLE_IN_ALL
void gdk_device_warp (GdkDevice *device,
GdkScreen *screen,
gint x,
gint y);
GDK_AVAILABLE_IN_ALL
gboolean gdk_device_grab_info_libgtk_only (GdkDisplay *display,
GdkDevice *device,
GdkWindow **grab_window,
+1 -1
View File
@@ -330,7 +330,7 @@ gdk_device_manager_list_devices (GdkDeviceManager *device_manager,
* for this application. In X11, window managers may change this depending on the interaction
* pattern under the presence of several pointers.
*
* You should use this function sheldomly, only in code that isn't triggered by a #GdkEvent
* You should use this function seldomly, only in code that isn't triggered by a #GdkEvent
* and there aren't other means to get a meaningful #GdkDevice to operate on.
*
* Returns: (transfer none): The client pointer. This memory is
+4
View File
@@ -32,11 +32,15 @@ G_BEGIN_DECLS
#define GDK_IS_DEVICE_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_MANAGER))
GDK_AVAILABLE_IN_ALL
GType gdk_device_manager_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GdkDisplay * gdk_device_manager_get_display (GdkDeviceManager *device_manager);
GDK_AVAILABLE_IN_ALL
GList * gdk_device_manager_list_devices (GdkDeviceManager *device_manager,
GdkDeviceType type);
GDK_AVAILABLE_IN_ALL
GdkDevice * gdk_device_manager_get_client_pointer (GdkDeviceManager *device_manager);
G_END_DECLS
+34
View File
@@ -40,15 +40,20 @@ G_BEGIN_DECLS
#define GDK_DISPLAY_OBJECT(object) GDK_DISPLAY(object)
#endif
GDK_AVAILABLE_IN_ALL
GType gdk_display_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GdkDisplay *gdk_display_open (const gchar *display_name);
GDK_AVAILABLE_IN_ALL
const gchar * gdk_display_get_name (GdkDisplay *display);
GDK_DEPRECATED_IN_3_10
gint gdk_display_get_n_screens (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
GdkScreen * gdk_display_get_screen (GdkDisplay *display,
gint screen_num);
GDK_AVAILABLE_IN_ALL
GdkScreen * gdk_display_get_default_screen (GdkDisplay *display);
#ifndef GDK_MULTIDEVICE_SAFE
@@ -62,29 +67,42 @@ GDK_DEPRECATED_IN_3_0_FOR(gdk_display_device_is_grabbed)
gboolean gdk_display_pointer_is_grabbed (GdkDisplay *display);
#endif /* GDK_MULTIDEVICE_SAFE */
GDK_AVAILABLE_IN_ALL
gboolean gdk_display_device_is_grabbed (GdkDisplay *display,
GdkDevice *device);
GDK_AVAILABLE_IN_ALL
void gdk_display_beep (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
void gdk_display_sync (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
void gdk_display_flush (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
void gdk_display_close (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
gboolean gdk_display_is_closed (GdkDisplay *display);
GDK_DEPRECATED_IN_3_0_FOR(gdk_device_manager_list_devices)
GList * gdk_display_list_devices (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
GdkEvent* gdk_display_get_event (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
GdkEvent* gdk_display_peek_event (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
void gdk_display_put_event (GdkDisplay *display,
const GdkEvent *event);
GDK_AVAILABLE_IN_ALL
gboolean gdk_display_has_pending (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
void gdk_display_set_double_click_time (GdkDisplay *display,
guint msec);
GDK_AVAILABLE_IN_ALL
void gdk_display_set_double_click_distance (GdkDisplay *display,
guint distance);
GDK_AVAILABLE_IN_ALL
GdkDisplay *gdk_display_get_default (void);
#ifndef GDK_MULTIDEVICE_SAFE
@@ -105,36 +123,52 @@ void gdk_display_warp_pointer (GdkDisplay *disp
gint y);
#endif /* GDK_MULTIDEVICE_SAFE */
GDK_AVAILABLE_IN_ALL
GdkDisplay *gdk_display_open_default_libgtk_only (void);
GDK_AVAILABLE_IN_ALL
gboolean gdk_display_supports_cursor_alpha (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
gboolean gdk_display_supports_cursor_color (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
guint gdk_display_get_default_cursor_size (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
void gdk_display_get_maximal_cursor_size (GdkDisplay *display,
guint *width,
guint *height);
GDK_AVAILABLE_IN_ALL
GdkWindow *gdk_display_get_default_group (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
gboolean gdk_display_supports_selection_notification (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
gboolean gdk_display_request_selection_notification (GdkDisplay *display,
GdkAtom selection);
GDK_AVAILABLE_IN_ALL
gboolean gdk_display_supports_clipboard_persistence (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
void gdk_display_store_clipboard (GdkDisplay *display,
GdkWindow *clipboard_window,
guint32 time_,
const GdkAtom *targets,
gint n_targets);
GDK_AVAILABLE_IN_ALL
gboolean gdk_display_supports_shapes (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
gboolean gdk_display_supports_input_shapes (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
gboolean gdk_display_supports_composite (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
void gdk_display_notify_startup_complete (GdkDisplay *display,
const gchar *startup_id);
GDK_AVAILABLE_IN_ALL
GdkDeviceManager * gdk_display_get_device_manager (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
GdkAppLaunchContext *gdk_display_get_app_launch_context (GdkDisplay *display);
G_END_DECLS
+70 -120
View File
@@ -38,16 +38,16 @@
#endif
#ifdef GDK_WINDOWING_QUARTZ
/* We immediately include gdkquartzdisplaymanager.h here instead of
* gdkquartz.h so that we do not have to enable -xobjective-c for the
* "generic" GDK source code.
/* When the gdk_quartz_display_open function is removed We can
* immediately include gdkquartzdisplaymanager.h here instead of
* gdkprivate-quartz.h so that we won't have to enable -xobjective-c
* for the "generic" GDK source code.
* #include "quartz/gdkquartzdisplaymanager.h"
*/
#include "quartz/gdkquartzdisplaymanager.h"
#include "quartz/gdkprivate-quartz.h"
#endif
#ifdef GDK_WINDOWING_BROADWAY
#include "broadway/gdkbroadwaydisplaymanager.h"
#include "broadway/gdkprivate-broadway.h"
#endif
@@ -57,7 +57,6 @@
#endif
#ifdef GDK_WINDOWING_WAYLAND
#include "wayland/gdkwayland.h"
#include "wayland/gdkprivate-wayland.h"
#endif
@@ -131,24 +130,7 @@ static void gdk_display_manager_get_property (GObject *object,
static guint signals[LAST_SIGNAL] = { 0 };
static void g_initable_iface_init (GInitableIface *iface);
G_DEFINE_TYPE_WITH_CODE (GdkDisplayManager, gdk_display_manager, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, g_initable_iface_init))
static gboolean
gdk_display_manager_initable_init (GInitable *initable,
GCancellable *cancellable,
GError **error)
{
return TRUE;
}
static void
g_initable_iface_init (GInitableIface *iface)
{
iface->init = gdk_display_manager_initable_init;
}
G_DEFINE_TYPE (GdkDisplayManager, gdk_display_manager, G_TYPE_OBJECT)
static void
gdk_display_manager_class_init (GdkDisplayManagerClass *klass)
@@ -271,7 +253,32 @@ gdk_set_allowed_backends (const gchar *backends)
allowed_backends = g_strdup (backends);
}
static GdkDisplayManager *manager = NULL;
typedef struct _GdkBackend GdkBackend;
struct _GdkBackend {
const char *name;
GdkDisplay * (* open_display) (const char *name);
};
static GdkBackend gdk_backends[] = {
#ifdef GDK_WINDOWING_QUARTZ
{ "quartz", _gdk_quartz_display_open },
#endif
#ifdef GDK_WINDOWING_WIN32
{ "win32", _gdk_win32_display_open },
#endif
#ifdef GDK_WINDOWING_X11
{ "x11", _gdk_x11_display_open },
#endif
#ifdef GDK_WINDOWING_WAYLAND
{ "wayland", _gdk_wayland_display_open },
#endif
#ifdef GDK_WINDOWING_BROADWAY
{ "broadway", _gdk_broadway_display_open },
#endif
/* NULL-terminating this array so we can use commas above */
{ NULL, NULL }
};
/**
* gdk_display_manager_get:
@@ -293,97 +300,11 @@ static GdkDisplayManager *manager = NULL;
GdkDisplayManager*
gdk_display_manager_get (void)
{
gdk_display_manager_peek ();
static GdkDisplayManager *manager = NULL;
if (manager == NULL)
g_error ("No GDK backend found (%s)", allowed_backends);
return manager;
}
typedef struct _GdkBackend GdkBackend;
struct _GdkBackend {
const char *name;
GType (* get_backend_type) (void);
GdkDisplay * (* open_display) (const char *name);
};
GdkBackend gdk_backends[] = {
#ifdef GDK_WINDOWING_QUARTZ
{ "quartz", gdk_quartz_display_manager_get_type, _gdk_quartz_display_open },
#endif
#ifdef GDK_WINDOWING_WIN32
{ "win32", gdk_win32_display_manager_get_type, _gdk_win32_display_open },
#endif
#ifdef GDK_WINDOWING_X11
{ "x11", gdk_x11_display_manager_get_type, _gdk_x11_display_open },
#endif
#ifdef GDK_WINDOWING_WAYLAND
{ "wayland", gdk_wayland_display_manager_get_type, _gdk_wayland_display_open },
#endif
#ifdef GDK_WINDOWING_BROADWAY
{ "broadway", gdk_broadway_display_manager_get_type, _gdk_broadway_display_open },
#endif
/* NULL-terminating this array so we can use commas above */
{ NULL, NULL }
};
/**
* gdk_display_manager_peek:
*
* Gets the singleton #GdkDisplayManager object. If GDK could
* not be initialized, %NULL is returned.
*
* Returns: (transfer none): The global #GdkDisplayManager singleton,
* or %NULL if GDK could not be initialized. gdk_parse_args(),
* gdk_init(), or gdk_init_check() must have been called first
*
* Since: 3.10
*/
GdkDisplayManager *
gdk_display_manager_peek (void)
{
if (manager == NULL)
{
const gchar *backend_list;
gchar **backends;
gint i, j;
gboolean allow_any;
if (allowed_backends == NULL)
allowed_backends = "*";
allow_any = strstr (allowed_backends, "*") != NULL;
backend_list = g_getenv ("GDK_BACKEND");
if (backend_list == NULL)
backend_list = allowed_backends;
backends = g_strsplit (backend_list, ",", 0);
for (i = 0; manager == NULL && backends[i] != NULL; i++)
{
const gchar *backend = backends[i];
gboolean any = g_str_equal (backend, "*");
if (!allow_any && !any && !strstr (allowed_backends, backend))
continue;
for (j = 0; gdk_backends[j].name != NULL; j++)
{
if ((any && allow_any) ||
(any && strstr (allowed_backends, gdk_backends[j].name)) ||
g_str_equal (backend, gdk_backends[j].name))
{
GDK_NOTE (MISC, g_message ("Trying %s backend", gdk_backends[j].name));
manager = g_initable_new (gdk_backends[j].get_backend_type (), NULL, NULL, NULL);
if (manager)
break;
}
}
}
g_strfreev (backends);
}
manager = g_object_new (GDK_TYPE_DISPLAY_MANAGER, NULL);
return manager;
}
@@ -500,19 +421,48 @@ GdkDisplay *
gdk_display_manager_open_display (GdkDisplayManager *manager,
const gchar *name)
{
guint i;
const gchar *backend_list;
GdkDisplay *display;
gchar **backends;
gint i, j;
gboolean allow_any;
for (i = 0; gdk_backends[i].name != NULL; i++)
if (allowed_backends == NULL)
allowed_backends = "*";
allow_any = strstr (allowed_backends, "*") != NULL;
backend_list = g_getenv ("GDK_BACKEND");
if (backend_list == NULL)
backend_list = allowed_backends;
backends = g_strsplit (backend_list, ",", 0);
display = NULL;
for (i = 0; display == NULL && backends[i] != NULL; i++)
{
if (G_OBJECT_TYPE (manager) == gdk_backends[i].get_backend_type ())
const gchar *backend = backends[i];
gboolean any = g_str_equal (backend, "*");
if (!allow_any && !any && !strstr (allowed_backends, backend))
continue;
for (j = 0; gdk_backends[j].name != NULL; j++)
{
return gdk_backends[i].open_display (name);
if ((any && allow_any) ||
(any && strstr (allowed_backends, gdk_backends[j].name)) ||
g_str_equal (backend, gdk_backends[j].name))
{
GDK_NOTE (MISC, g_message ("Trying %s backend", gdk_backends[j].name));
display = gdk_backends[j].open_display (name);
if (display)
break;
}
}
}
g_assert_not_reached ();
g_strfreev (backends);
return NULL;
return display;
}
void
+6 -2
View File
@@ -40,15 +40,19 @@ G_BEGIN_DECLS
#define GDK_IS_DISPLAY_MANAGER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DISPLAY_MANAGER))
GDK_AVAILABLE_IN_ALL
GType gdk_display_manager_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GdkDisplayManager *gdk_display_manager_get (void);
GDK_AVAILABLE_IN_3_10
GdkDisplayManager *gdk_display_manager_peek (void);
GDK_AVAILABLE_IN_ALL
GdkDisplay * gdk_display_manager_get_default_display (GdkDisplayManager *manager);
GDK_AVAILABLE_IN_ALL
void gdk_display_manager_set_default_display (GdkDisplayManager *manager,
GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
GSList * gdk_display_manager_list_displays (GdkDisplayManager *manager);
GDK_AVAILABLE_IN_ALL
GdkDisplay * gdk_display_manager_open_display (GdkDisplayManager *manager,
const gchar *name);
+21
View File
@@ -89,43 +89,60 @@ typedef enum
} GdkDragProtocol;
GDK_AVAILABLE_IN_ALL
GType gdk_drag_context_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
void gdk_drag_context_set_device (GdkDragContext *context,
GdkDevice *device);
GDK_AVAILABLE_IN_ALL
GdkDevice * gdk_drag_context_get_device (GdkDragContext *context);
GDK_AVAILABLE_IN_ALL
GList *gdk_drag_context_list_targets (GdkDragContext *context);
GDK_AVAILABLE_IN_ALL
GdkDragAction gdk_drag_context_get_actions (GdkDragContext *context);
GDK_AVAILABLE_IN_ALL
GdkDragAction gdk_drag_context_get_suggested_action (GdkDragContext *context);
GDK_AVAILABLE_IN_ALL
GdkDragAction gdk_drag_context_get_selected_action (GdkDragContext *context);
GDK_AVAILABLE_IN_ALL
GdkWindow *gdk_drag_context_get_source_window (GdkDragContext *context);
GDK_AVAILABLE_IN_ALL
GdkWindow *gdk_drag_context_get_dest_window (GdkDragContext *context);
GDK_AVAILABLE_IN_ALL
GdkDragProtocol gdk_drag_context_get_protocol (GdkDragContext *context);
/* Destination side */
GDK_AVAILABLE_IN_ALL
void gdk_drag_status (GdkDragContext *context,
GdkDragAction action,
guint32 time_);
GDK_AVAILABLE_IN_ALL
void gdk_drop_reply (GdkDragContext *context,
gboolean accepted,
guint32 time_);
GDK_AVAILABLE_IN_ALL
void gdk_drop_finish (GdkDragContext *context,
gboolean success,
guint32 time_);
GDK_AVAILABLE_IN_ALL
GdkAtom gdk_drag_get_selection (GdkDragContext *context);
/* Source side */
GDK_AVAILABLE_IN_ALL
GdkDragContext * gdk_drag_begin (GdkWindow *window,
GList *targets);
GDK_AVAILABLE_IN_ALL
GdkDragContext * gdk_drag_begin_for_device (GdkWindow *window,
GdkDevice *device,
GList *targets);
GDK_AVAILABLE_IN_ALL
void gdk_drag_find_window_for_screen (GdkDragContext *context,
GdkWindow *drag_window,
GdkScreen *screen,
@@ -134,6 +151,7 @@ void gdk_drag_find_window_for_screen (GdkDragContext *context,
GdkWindow **dest_window,
GdkDragProtocol *protocol);
GDK_AVAILABLE_IN_ALL
gboolean gdk_drag_motion (GdkDragContext *context,
GdkWindow *dest_window,
GdkDragProtocol protocol,
@@ -142,10 +160,13 @@ gboolean gdk_drag_motion (GdkDragContext *context,
GdkDragAction suggested_action,
GdkDragAction possible_actions,
guint32 time_);
GDK_AVAILABLE_IN_ALL
void gdk_drag_drop (GdkDragContext *context,
guint32 time_);
GDK_AVAILABLE_IN_ALL
void gdk_drag_abort (GdkDragContext *context,
guint32 time_);
GDK_AVAILABLE_IN_ALL
gboolean gdk_drag_drop_succeeded (GdkDragContext *context);
G_END_DECLS
+2 -1
View File
@@ -7,6 +7,7 @@
#define __GDK_ENUM_TYPES_H__
#include <glib-object.h>
#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
/*** END file-header ***/
@@ -17,7 +18,7 @@ G_BEGIN_DECLS
/*** END file-production ***/
/*** BEGIN value-header ***/
GType @enum_name@_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL GType @enum_name@_get_type (void) G_GNUC_CONST;
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
/*** END value-header ***/
+27
View File
@@ -1186,24 +1186,36 @@ union _GdkEvent
GdkEventGrabBroken grab_broken;
};
GDK_AVAILABLE_IN_ALL
GType gdk_event_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
gboolean gdk_events_pending (void);
GDK_AVAILABLE_IN_ALL
GdkEvent* gdk_event_get (void);
GDK_AVAILABLE_IN_ALL
GdkEvent* gdk_event_peek (void);
GDK_AVAILABLE_IN_ALL
void gdk_event_put (const GdkEvent *event);
GDK_AVAILABLE_IN_ALL
GdkEvent* gdk_event_new (GdkEventType type);
GDK_AVAILABLE_IN_ALL
GdkEvent* gdk_event_copy (const GdkEvent *event);
GDK_AVAILABLE_IN_ALL
void gdk_event_free (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
guint32 gdk_event_get_time (const GdkEvent *event);
GDK_AVAILABLE_IN_ALL
gboolean gdk_event_get_state (const GdkEvent *event,
GdkModifierType *state);
GDK_AVAILABLE_IN_ALL
gboolean gdk_event_get_coords (const GdkEvent *event,
gdouble *x_win,
gdouble *y_win);
GDK_AVAILABLE_IN_ALL
gboolean gdk_event_get_root_coords (const GdkEvent *event,
gdouble *x_root,
gdouble *y_root);
@@ -1227,46 +1239,61 @@ gboolean gdk_event_get_scroll_deltas (const GdkEvent *event,
gdouble *delta_x,
gdouble *delta_y);
GDK_AVAILABLE_IN_ALL
gboolean gdk_event_get_axis (const GdkEvent *event,
GdkAxisUse axis_use,
gdouble *value);
GDK_AVAILABLE_IN_ALL
void gdk_event_set_device (GdkEvent *event,
GdkDevice *device);
GDK_AVAILABLE_IN_ALL
GdkDevice* gdk_event_get_device (const GdkEvent *event);
GDK_AVAILABLE_IN_ALL
void gdk_event_set_source_device (GdkEvent *event,
GdkDevice *device);
GDK_AVAILABLE_IN_ALL
GdkDevice* gdk_event_get_source_device (const GdkEvent *event);
GDK_AVAILABLE_IN_ALL
void gdk_event_request_motions (const GdkEventMotion *event);
GDK_AVAILABLE_IN_3_4
gboolean gdk_event_triggers_context_menu (const GdkEvent *event);
GDK_AVAILABLE_IN_ALL
gboolean gdk_events_get_distance (GdkEvent *event1,
GdkEvent *event2,
gdouble *distance);
GDK_AVAILABLE_IN_ALL
gboolean gdk_events_get_angle (GdkEvent *event1,
GdkEvent *event2,
gdouble *angle);
GDK_AVAILABLE_IN_ALL
gboolean gdk_events_get_center (GdkEvent *event1,
GdkEvent *event2,
gdouble *x,
gdouble *y);
GDK_AVAILABLE_IN_ALL
void gdk_event_handler_set (GdkEventFunc func,
gpointer data,
GDestroyNotify notify);
GDK_AVAILABLE_IN_ALL
void gdk_event_set_screen (GdkEvent *event,
GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
GdkScreen *gdk_event_get_screen (const GdkEvent *event);
GDK_AVAILABLE_IN_3_4
GdkEventSequence *gdk_event_get_event_sequence (const GdkEvent *event);
GDK_AVAILABLE_IN_ALL
void gdk_set_show_events (gboolean show_events);
GDK_AVAILABLE_IN_ALL
gboolean gdk_get_show_events (void);
#ifndef GDK_MULTIHEAD_SAFE
GDK_AVAILABLE_IN_ALL
gboolean gdk_setting_get (const gchar *name,
GValue *value);
+1
View File
@@ -74,6 +74,7 @@ typedef enum {
GDK_FRAME_CLOCK_PHASE_AFTER_PAINT = 1 << 6
} GdkFrameClockPhase;
GDK_AVAILABLE_IN_3_8
GType gdk_frame_clock_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_3_8
+11 -1
View File
@@ -384,6 +384,7 @@ gdk_frame_clock_paint_idle (void *data)
case GDK_FRAME_CLOCK_PHASE_LAYOUT:
if (priv->freeze_count == 0)
{
int iter;
#ifdef G_ENABLE_DEBUG
if ((_gdk_debug_flags & GDK_DEBUG_FRAMES) != 0)
{
@@ -394,11 +395,20 @@ gdk_frame_clock_paint_idle (void *data)
#endif /* G_ENABLE_DEBUG */
priv->phase = GDK_FRAME_CLOCK_PHASE_LAYOUT;
if (priv->requested & GDK_FRAME_CLOCK_PHASE_LAYOUT)
/* We loop in the layout phase, because we don't want to progress
* into the paint phase with invalid size allocations. This may
* happen in some situation like races between user window
* resizes and natural size changes.
*/
iter = 0;
while ((priv->requested & GDK_FRAME_CLOCK_PHASE_LAYOUT) &&
priv->freeze_count == 0 && iter++ < 4)
{
priv->requested &= ~GDK_FRAME_CLOCK_PHASE_LAYOUT;
g_signal_emit_by_name (G_OBJECT (clock), "layout");
}
if (iter == 5)
g_warning ("gdk-frame-clock: layout continuously requested, giving up after 4 tries");
}
case GDK_FRAME_CLOCK_PHASE_PAINT:
if (priv->freeze_count == 0)
+4 -26
View File
@@ -224,6 +224,7 @@ struct _GdkWindow
guint native_visibility : 2; /* the native visibility of a impl windows */
guint viewable : 1; /* mapped and all parents mapped */
guint applied_shape : 1;
guint in_update : 1;
GdkFullscreenMode fullscreen_mode;
/* The GdkWindow that has the impl, ref:ed if another window.
@@ -250,10 +251,6 @@ struct _GdkWindow
GdkCursor *cursor;
GHashTable *device_cursor;
GSList *implicit_paint;
GList *outstanding_moves;
cairo_region_t *shape;
cairo_region_t *input_shape;
@@ -269,10 +266,11 @@ struct _GdkWindow
guint num_offscreen_children;
GdkFrameClock *frame_clock; /* NULL to use from parent or default */
GdkWindowInvalidateHandlerFunc invalidate_handler;
};
#define GDK_WINDOW_TYPE(d) (((GDK_WINDOW (d)))->window_type)
#define GDK_WINDOW_DESTROYED(d) (GDK_WINDOW (d)->destroyed)
#define GDK_WINDOW_TYPE(d) ((((GdkWindow *)(d)))->window_type)
#define GDK_WINDOW_DESTROYED(d) (((GdkWindow *)(d))->destroyed)
extern gchar *_gdk_display_name;
extern gint _gdk_screen_number;
@@ -354,26 +352,6 @@ void _gdk_windowing_got_event (GdkDisplay *display,
#define GDK_WINDOW_IS_MAPPED(window) (((window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0)
#define GDK_TYPE_PAINTABLE (_gdk_paintable_get_type ())
#define GDK_PAINTABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_PAINTABLE, GdkPaintable))
#define GDK_IS_PAINTABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_PAINTABLE))
#define GDK_PAINTABLE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GDK_TYPE_PAINTABLE, GdkPaintableIface))
typedef struct _GdkPaintable GdkPaintable;
typedef struct _GdkPaintableIface GdkPaintableIface;
struct _GdkPaintableIface
{
GTypeInterface g_iface;
void (* begin_paint_region) (GdkPaintable *paintable,
GdkWindow *window,
const cairo_region_t *region);
void (* end_paint) (GdkPaintable *paintable);
};
GType _gdk_paintable_get_type (void) G_GNUC_CONST;
void _gdk_window_invalidate_for_expose (GdkWindow *window,
cairo_region_t *region);
+22 -1
View File
@@ -77,16 +77,20 @@ struct _GdkKeymapKey
* in the keymap and see what keyval it corresponds to.
*/
GDK_AVAILABLE_IN_ALL
GType gdk_keymap_get_type (void) G_GNUC_CONST;
#ifndef GDK_MULTIHEAD_SAFE
GDK_AVAILABLE_IN_ALL
GdkKeymap* gdk_keymap_get_default (void);
#endif
GDK_AVAILABLE_IN_ALL
GdkKeymap* gdk_keymap_get_for_display (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
guint gdk_keymap_lookup_key (GdkKeymap *keymap,
const GdkKeymapKey *key);
GDK_AVAILABLE_IN_ALL
gboolean gdk_keymap_translate_keyboard_state (GdkKeymap *keymap,
guint hardware_keycode,
GdkModifierType state,
@@ -95,24 +99,32 @@ gboolean gdk_keymap_translate_keyboard_state (GdkKeymap *keymap,
gint *effective_group,
gint *level,
GdkModifierType *consumed_modifiers);
GDK_AVAILABLE_IN_ALL
gboolean gdk_keymap_get_entries_for_keyval (GdkKeymap *keymap,
guint keyval,
GdkKeymapKey **keys,
gint *n_keys);
GDK_AVAILABLE_IN_ALL
gboolean gdk_keymap_get_entries_for_keycode (GdkKeymap *keymap,
guint hardware_keycode,
GdkKeymapKey **keys,
guint **keyvals,
gint *n_entries);
GDK_AVAILABLE_IN_ALL
PangoDirection gdk_keymap_get_direction (GdkKeymap *keymap);
GDK_AVAILABLE_IN_ALL
gboolean gdk_keymap_have_bidi_layouts (GdkKeymap *keymap);
GDK_AVAILABLE_IN_ALL
gboolean gdk_keymap_get_caps_lock_state (GdkKeymap *keymap);
GDK_AVAILABLE_IN_ALL
gboolean gdk_keymap_get_num_lock_state (GdkKeymap *keymap);
GDK_AVAILABLE_IN_3_4
guint gdk_keymap_get_modifier_state (GdkKeymap *keymap);
GDK_AVAILABLE_IN_ALL
void gdk_keymap_add_virtual_modifiers (GdkKeymap *keymap,
GdkModifierType *state);
GDK_AVAILABLE_IN_ALL
gboolean gdk_keymap_map_virtual_modifiers (GdkKeymap *keymap,
GdkModifierType *state);
GDK_AVAILABLE_IN_3_4
@@ -122,18 +134,27 @@ GdkModifierType gdk_keymap_get_modifier_mask (GdkKeymap *keymap,
/* Key values
*/
GDK_AVAILABLE_IN_ALL
gchar* gdk_keyval_name (guint keyval) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
guint gdk_keyval_from_name (const gchar *keyval_name);
GDK_AVAILABLE_IN_ALL
void gdk_keyval_convert_case (guint symbol,
guint *lower,
guint *upper);
GDK_AVAILABLE_IN_ALL
guint gdk_keyval_to_upper (guint keyval) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
guint gdk_keyval_to_lower (guint keyval) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
gboolean gdk_keyval_is_upper (guint keyval) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
gboolean gdk_keyval_is_lower (guint keyval) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
guint32 gdk_keyval_to_unicode (guint keyval) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
guint gdk_unicode_to_keyval (guint32 wc) G_GNUC_CONST;
+21
View File
@@ -40,29 +40,42 @@ G_BEGIN_DECLS
#define GDK_PRIORITY_EVENTS (G_PRIORITY_DEFAULT)
GDK_AVAILABLE_IN_ALL
void gdk_parse_args (gint *argc,
gchar ***argv);
GDK_AVAILABLE_IN_ALL
void gdk_init (gint *argc,
gchar ***argv);
GDK_AVAILABLE_IN_ALL
gboolean gdk_init_check (gint *argc,
gchar ***argv);
GDK_AVAILABLE_IN_ALL
void gdk_add_option_entries_libgtk_only (GOptionGroup *group);
GDK_AVAILABLE_IN_ALL
void gdk_pre_parse_libgtk_only (void);
GDK_AVAILABLE_IN_ALL
const gchar * gdk_get_program_class (void);
GDK_AVAILABLE_IN_ALL
void gdk_set_program_class (const gchar *program_class);
GDK_AVAILABLE_IN_ALL
void gdk_notify_startup_complete (void);
GDK_AVAILABLE_IN_ALL
void gdk_notify_startup_complete_with_id (const gchar* startup_id);
/* Push and pop error handlers for X errors
*/
GDK_AVAILABLE_IN_ALL
void gdk_error_trap_push (void);
/* warn unused because you could use pop_ignored otherwise */
GDK_AVAILABLE_IN_ALL
G_GNUC_WARN_UNUSED_RESULT gint gdk_error_trap_pop (void);
GDK_AVAILABLE_IN_ALL
void gdk_error_trap_pop_ignored (void);
GDK_AVAILABLE_IN_ALL
const gchar * gdk_get_display_arg_name (void);
GDK_DEPRECATED_IN_3_8_FOR(gdk_display_get_name (gdk_display_get_default ()))
@@ -93,20 +106,28 @@ GDK_DEPRECATED_IN_3_0_FOR(gdk_display_device_is_grabbed)
gboolean gdk_pointer_is_grabbed (void);
#endif /* GDK_MULTIDEVICE_SAFE */
GDK_AVAILABLE_IN_ALL
gint gdk_screen_width (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
gint gdk_screen_height (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
gint gdk_screen_width_mm (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
gint gdk_screen_height_mm (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
void gdk_set_double_click_time (guint msec);
GDK_AVAILABLE_IN_ALL
void gdk_beep (void);
#endif /* GDK_MULTIHEAD_SAFE */
GDK_AVAILABLE_IN_ALL
void gdk_flush (void);
GDK_AVAILABLE_IN_ALL
void gdk_disable_multidevice (void);
GDK_AVAILABLE_IN_3_10
-37
View File
@@ -555,42 +555,6 @@ gdk_offscreen_window_queue_antiexpose (GdkWindow *window,
return FALSE;
}
static void
gdk_offscreen_window_translate (GdkWindow *window,
cairo_region_t *area,
gint dx,
gint dy)
{
GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
if (offscreen->surface)
{
cairo_t *cr;
cr = cairo_create (offscreen->surface);
area = cairo_region_copy (area);
gdk_cairo_region (cr, area);
cairo_clip (cr);
/* NB: This is a self-copy and Cairo doesn't support that yet.
* So we do a litle trick.
*/
cairo_push_group (cr);
cairo_set_source_surface (cr, offscreen->surface, dx, dy);
cairo_paint (cr);
cairo_pop_group_to_source (cr);
cairo_paint (cr);
cairo_destroy (cr);
}
_gdk_window_add_damage (window, area);
}
static cairo_surface_t *
gdk_offscreen_window_resize_cairo_surface (GdkWindow *window,
cairo_surface_t *surface,
@@ -752,7 +716,6 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
impl_class->input_shape_combine_region = gdk_offscreen_window_input_shape_combine_region;
impl_class->set_static_gravities = gdk_offscreen_window_set_static_gravities;
impl_class->queue_antiexpose = gdk_offscreen_window_queue_antiexpose;
impl_class->translate = gdk_offscreen_window_translate;
impl_class->destroy = gdk_offscreen_window_destroy;
impl_class->destroy_foreign = NULL;
impl_class->resize_cairo_surface = gdk_offscreen_window_resize_cairo_surface;
+5
View File
@@ -23,13 +23,16 @@
#endif
#include <gdk/gdktypes.h>
#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
/************************************************************************/
GDK_AVAILABLE_IN_ALL
PangoContext *gdk_pango_context_get_for_screen (GdkScreen *screen);
#ifndef GDK_MULTIHEAD_SAFE
GDK_AVAILABLE_IN_ALL
PangoContext *gdk_pango_context_get (void);
#endif
@@ -40,11 +43,13 @@ PangoContext *gdk_pango_context_get (void);
* draw with the region as clip, only the given ranges are drawn.
*/
GDK_AVAILABLE_IN_ALL
cairo_region_t *gdk_pango_layout_line_get_clip_region (PangoLayoutLine *line,
gint x_origin,
gint y_origin,
const gint *index_ranges,
gint n_ranges);
GDK_AVAILABLE_IN_ALL
cairo_region_t *gdk_pango_layout_get_clip_region (PangoLayout *layout,
gint x_origin,
gint y_origin,
+4 -1
View File
@@ -30,17 +30,20 @@
#endif
#include <cairo.h>
#include <gdk/gdktypes.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
GDK_AVAILABLE_IN_ALL
GdkPixbuf *gdk_pixbuf_get_from_window (GdkWindow *window,
gint src_x,
gint src_y,
gint width,
gint height);
GDK_AVAILABLE_IN_ALL
GdkPixbuf *gdk_pixbuf_get_from_surface (cairo_surface_t *surface,
gint src_x,
gint src_y,
+2
View File
@@ -31,8 +31,10 @@ G_BEGIN_DECLS
const char * _gdk_atom_name_const (GdkAtom atom);
GDK_AVAILABLE_IN_ALL
void gdk_window_destroy_notify (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_synthesize_window_state (GdkWindow *window,
GdkWindowState unset_flags,
GdkWindowState set_flags);
+9
View File
@@ -30,6 +30,7 @@
#endif
#include <gdk/gdktypes.h>
#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
@@ -51,12 +52,16 @@ typedef enum
} GdkPropMode;
GDK_AVAILABLE_IN_ALL
GdkAtom gdk_atom_intern (const gchar *atom_name,
gboolean only_if_exists);
GDK_AVAILABLE_IN_ALL
GdkAtom gdk_atom_intern_static_string (const gchar *atom_name);
GDK_AVAILABLE_IN_ALL
gchar* gdk_atom_name (GdkAtom atom);
GDK_AVAILABLE_IN_ALL
gboolean gdk_property_get (GdkWindow *window,
GdkAtom property,
GdkAtom type,
@@ -67,6 +72,7 @@ gboolean gdk_property_get (GdkWindow *window,
gint *actual_format,
gint *actual_length,
guchar **data);
GDK_AVAILABLE_IN_ALL
void gdk_property_change (GdkWindow *window,
GdkAtom property,
GdkAtom type,
@@ -74,9 +80,11 @@ void gdk_property_change (GdkWindow *window,
GdkPropMode mode,
const guchar *data,
gint nelements);
GDK_AVAILABLE_IN_ALL
void gdk_property_delete (GdkWindow *window,
GdkAtom property);
GDK_AVAILABLE_IN_ALL
gint gdk_text_property_to_utf8_list_for_display (GdkDisplay *display,
GdkAtom encoding,
gint format,
@@ -84,6 +92,7 @@ gint gdk_text_property_to_utf8_list_for_display (GdkDisplay *display,
gint length,
gchar ***list);
GDK_AVAILABLE_IN_ALL
gchar *gdk_utf8_to_string_target (const gchar *str);
G_END_DECLS
+4
View File
@@ -30,18 +30,22 @@
#endif
#include <gdk/gdktypes.h>
#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
/* Rectangle utilities
*/
GDK_AVAILABLE_IN_ALL
gboolean gdk_rectangle_intersect (const GdkRectangle *src1,
const GdkRectangle *src2,
GdkRectangle *dest);
GDK_AVAILABLE_IN_ALL
void gdk_rectangle_union (const GdkRectangle *src1,
const GdkRectangle *src2,
GdkRectangle *dest);
GDK_AVAILABLE_IN_ALL
GType gdk_rectangle_get_type (void) G_GNUC_CONST;
#define GDK_TYPE_RECTANGLE (gdk_rectangle_get_type ())
+8
View File
@@ -30,6 +30,7 @@
#endif
#include <gdk/gdktypes.h>
#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
@@ -43,17 +44,24 @@ struct _GdkRGBA
#define GDK_TYPE_RGBA (gdk_rgba_get_type ())
GDK_AVAILABLE_IN_ALL
GType gdk_rgba_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GdkRGBA * gdk_rgba_copy (const GdkRGBA *rgba);
GDK_AVAILABLE_IN_ALL
void gdk_rgba_free (GdkRGBA *rgba);
GDK_AVAILABLE_IN_ALL
guint gdk_rgba_hash (gconstpointer p);
GDK_AVAILABLE_IN_ALL
gboolean gdk_rgba_equal (gconstpointer p1,
gconstpointer p2);
GDK_AVAILABLE_IN_ALL
gboolean gdk_rgba_parse (GdkRGBA *rgba,
const gchar *spec);
GDK_AVAILABLE_IN_ALL
gchar * gdk_rgba_to_string (const GdkRGBA *rgba);
+30
View File
@@ -38,26 +38,43 @@ G_BEGIN_DECLS
#define GDK_IS_SCREEN(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SCREEN))
GDK_AVAILABLE_IN_ALL
GType gdk_screen_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GdkVisual * gdk_screen_get_system_visual (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
GdkVisual * gdk_screen_get_rgba_visual (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
gboolean gdk_screen_is_composited (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
GdkWindow * gdk_screen_get_root_window (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
GdkDisplay * gdk_screen_get_display (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
gint gdk_screen_get_number (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
gint gdk_screen_get_width (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
gint gdk_screen_get_height (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
gint gdk_screen_get_width_mm (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
gint gdk_screen_get_height_mm (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
GList * gdk_screen_list_visuals (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
GList * gdk_screen_get_toplevel_windows (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
gchar * gdk_screen_make_display_name (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
gint gdk_screen_get_n_monitors (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
gint gdk_screen_get_primary_monitor (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
void gdk_screen_get_monitor_geometry (GdkScreen *screen,
gint monitor_num,
GdkRectangle *dest);
@@ -66,33 +83,46 @@ void gdk_screen_get_monitor_workarea (GdkScreen *screen,
gint monitor_num,
GdkRectangle *dest);
GDK_AVAILABLE_IN_ALL
gint gdk_screen_get_monitor_at_point (GdkScreen *screen,
gint x,
gint y);
GDK_AVAILABLE_IN_ALL
gint gdk_screen_get_monitor_at_window (GdkScreen *screen,
GdkWindow *window);
GDK_AVAILABLE_IN_ALL
gint gdk_screen_get_monitor_width_mm (GdkScreen *screen,
gint monitor_num);
GDK_AVAILABLE_IN_ALL
gint gdk_screen_get_monitor_height_mm (GdkScreen *screen,
gint monitor_num);
GDK_AVAILABLE_IN_ALL
gchar * gdk_screen_get_monitor_plug_name (GdkScreen *screen,
gint monitor_num);
GDK_AVAILABLE_IN_ALL
GdkScreen *gdk_screen_get_default (void);
GDK_AVAILABLE_IN_ALL
gboolean gdk_screen_get_setting (GdkScreen *screen,
const gchar *name,
GValue *value);
GDK_AVAILABLE_IN_ALL
void gdk_screen_set_font_options (GdkScreen *screen,
const cairo_font_options_t *options);
GDK_AVAILABLE_IN_ALL
const cairo_font_options_t *gdk_screen_get_font_options (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
void gdk_screen_set_resolution (GdkScreen *screen,
gdouble dpi);
GDK_AVAILABLE_IN_ALL
gdouble gdk_screen_get_resolution (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
GdkWindow *gdk_screen_get_active_window (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
GList *gdk_screen_get_window_stack (GdkScreen *screen);
G_END_DECLS
+9
View File
@@ -30,6 +30,7 @@
#endif
#include <gdk/gdktypes.h>
#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
@@ -152,18 +153,22 @@ G_BEGIN_DECLS
*/
#ifndef GDK_MULTIHEAD_SAFE
GDK_AVAILABLE_IN_ALL
gboolean gdk_selection_owner_set (GdkWindow *owner,
GdkAtom selection,
guint32 time_,
gboolean send_event);
GDK_AVAILABLE_IN_ALL
GdkWindow* gdk_selection_owner_get (GdkAtom selection);
#endif/* GDK_MULTIHEAD_SAFE */
GDK_AVAILABLE_IN_ALL
gboolean gdk_selection_owner_set_for_display (GdkDisplay *display,
GdkWindow *owner,
GdkAtom selection,
guint32 time_,
gboolean send_event);
GDK_AVAILABLE_IN_ALL
GdkWindow *gdk_selection_owner_get_for_display (GdkDisplay *display,
GdkAtom selection);
@@ -181,21 +186,25 @@ GdkWindow *gdk_selection_owner_get_for_display (GdkDisplay *display,
* Retrieves the contents of a selection in a given
* form.
*/
GDK_AVAILABLE_IN_ALL
void gdk_selection_convert (GdkWindow *requestor,
GdkAtom selection,
GdkAtom target,
guint32 time_);
GDK_AVAILABLE_IN_ALL
gint gdk_selection_property_get (GdkWindow *requestor,
guchar **data,
GdkAtom *prop_type,
gint *prop_format);
GDK_AVAILABLE_IN_ALL
void gdk_selection_send_notify (GdkWindow *requestor,
GdkAtom selection,
GdkAtom target,
GdkAtom property,
guint32 time_);
GDK_AVAILABLE_IN_ALL
void gdk_selection_send_notify_for_display (GdkDisplay *display,
GdkWindow *requestor,
GdkAtom selection,
+3
View File
@@ -39,13 +39,16 @@ G_BEGIN_DECLS
/* --- Gdk Test Utility API --- */
GDK_AVAILABLE_IN_ALL
void gdk_test_render_sync (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
gboolean gdk_test_simulate_key (GdkWindow *window,
gint x,
gint y,
guint keyval,
GdkModifierType modifiers,
GdkEventType key_pressrelease);
GDK_AVAILABLE_IN_ALL
gboolean gdk_test_simulate_button (GdkWindow *window,
gint x,
gint y,
+8 -1
View File
@@ -30,11 +30,12 @@
#endif
#include <gdk/gdktypes.h>
#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
#if defined(GDK_COMPILATION) || defined(GTK_COMPILATION)
#define GDK_THREADS_DEPRECATED
#define GDK_THREADS_DEPRECATED _GDK_EXTERN
#else
#define GDK_THREADS_DEPRECATED GDK_DEPRECATED_IN_3_6
#endif
@@ -49,25 +50,31 @@ GDK_THREADS_DEPRECATED
void gdk_threads_set_lock_functions (GCallback enter_fn,
GCallback leave_fn);
GDK_AVAILABLE_IN_ALL
guint gdk_threads_add_idle_full (gint priority,
GSourceFunc function,
gpointer data,
GDestroyNotify notify);
GDK_AVAILABLE_IN_ALL
guint gdk_threads_add_idle (GSourceFunc function,
gpointer data);
GDK_AVAILABLE_IN_ALL
guint gdk_threads_add_timeout_full (gint priority,
guint interval,
GSourceFunc function,
gpointer data,
GDestroyNotify notify);
GDK_AVAILABLE_IN_ALL
guint gdk_threads_add_timeout (guint interval,
GSourceFunc function,
gpointer data);
GDK_AVAILABLE_IN_ALL
guint gdk_threads_add_timeout_seconds_full (gint priority,
guint interval,
GSourceFunc function,
gpointer data,
GDestroyNotify notify);
GDK_AVAILABLE_IN_ALL
guint gdk_threads_add_timeout_seconds (guint interval,
GSourceFunc function,
gpointer data);
+30 -24
View File
@@ -30,6 +30,10 @@
#define GDK_MINOR_VERSION (@GTK_MINOR_VERSION@)
#define GDK_MICRO_VERSION (@GTK_MICRO_VERSION@)
#ifndef _GDK_EXTERN
#define _GDK_EXTERN extern
#endif
/**
* GDK_DISABLE_DEPRECATION_WARNINGS:
*
@@ -39,13 +43,13 @@
*/
#ifdef GDK_DISABLE_DEPRECATION_WARNINGS
#define GDK_DEPRECATED
#define GDK_DEPRECATED_FOR(f)
#define GDK_UNAVAILABLE(maj,min)
#define GDK_DEPRECATED _GDK_EXTERN
#define GDK_DEPRECATED_FOR(f) _GDK_EXTERN
#define GDK_UNAVAILABLE(maj,min) _GDK_EXTERN
#else
#define GDK_DEPRECATED G_DEPRECATED
#define GDK_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f)
#define GDK_UNAVAILABLE(maj,min) G_UNAVAILABLE(maj,min)
#define GDK_DEPRECATED G_DEPRECATED _GDK_EXTERN
#define GDK_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) _GDK_EXTERN
#define GDK_UNAVAILABLE(maj,min) G_UNAVAILABLE(maj,min) _GDK_EXTERN
#endif
/* XXX: Every new stable minor release bump should add a macro here */
@@ -179,90 +183,92 @@
#error "GDK_VERSION_MIN_REQUIRED must be >= GDK_VERSION_3_0"
#endif
#define GDK_AVAILABLE_IN_ALL _GDK_EXTERN
/* XXX: Every new stable minor release should add a set of macros here */
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_0
# define GDK_DEPRECATED_IN_3_0 GDK_DEPRECATED
# define GDK_DEPRECATED_IN_3_0_FOR(f) GDK_DEPRECATED_FOR(f)
#else
# define GDK_DEPRECATED_IN_3_0
# define GDK_DEPRECATED_IN_3_0_FOR(f)
# define GDK_DEPRECATED_IN_3_0 _GDK_EXTERN
# define GDK_DEPRECATED_IN_3_0_FOR(f) _GDK_EXTERN
#endif
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_0
# define GDK_AVAILABLE_IN_3_0 GDK_UNAVAILABLE(3, 0)
#else
# define GDK_AVAILABLE_IN_3_0
# define GDK_AVAILABLE_IN_3_0 _GDK_EXTERN
#endif
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_2
# define GDK_DEPRECATED_IN_3_2 GDK_DEPRECATED
# define GDK_DEPRECATED_IN_3_2_FOR(f) GDK_DEPRECATED_FOR(f)
#else
# define GDK_DEPRECATED_IN_3_2
# define GDK_DEPRECATED_IN_3_2_FOR(f)
# define GDK_DEPRECATED_IN_3_2 _GDK_EXTERN
# define GDK_DEPRECATED_IN_3_2_FOR(f) _GDK_EXTERN
#endif
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_2
# define GDK_AVAILABLE_IN_3_2 GDK_UNAVAILABLE(3, 2)
#else
# define GDK_AVAILABLE_IN_3_2
# define GDK_AVAILABLE_IN_3_2 _GDK_EXTERN
#endif
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_4
# define GDK_DEPRECATED_IN_3_4 GDK_DEPRECATED
# define GDK_DEPRECATED_IN_3_4_FOR(f) GDK_DEPRECATED_FOR(f)
#else
# define GDK_DEPRECATED_IN_3_4
# define GDK_DEPRECATED_IN_3_4_FOR(f)
# define GDK_DEPRECATED_IN_3_4 _GDK_EXTERN
# define GDK_DEPRECATED_IN_3_4_FOR(f) _GDK_EXTERN
#endif
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_4
# define GDK_AVAILABLE_IN_3_4 GDK_UNAVAILABLE(3, 4)
#else
# define GDK_AVAILABLE_IN_3_4
# define GDK_AVAILABLE_IN_3_4 _GDK_EXTERN
#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)
# define GDK_DEPRECATED_IN_3_6 _GDK_EXTERN
# define GDK_DEPRECATED_IN_3_6_FOR(f) _GDK_EXTERN
#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
# define GDK_AVAILABLE_IN_3_6 _GDK_EXTERN
#endif
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_8
# define GDK_DEPRECATED_IN_3_8 GDK_DEPRECATED
# define GDK_DEPRECATED_IN_3_8_FOR(f) GDK_DEPRECATED_FOR(f)
#else
# define GDK_DEPRECATED_IN_3_8
# define GDK_DEPRECATED_IN_3_8_FOR(f)
# define GDK_DEPRECATED_IN_3_8 _GDK_EXTERN
# define GDK_DEPRECATED_IN_3_8_FOR(f) _GDK_EXTERN
#endif
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_8
# define GDK_AVAILABLE_IN_3_8 GDK_UNAVAILABLE(3, 8)
#else
# define GDK_AVAILABLE_IN_3_8
# define GDK_AVAILABLE_IN_3_8 _GDK_EXTERN
#endif
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_10
# define GDK_DEPRECATED_IN_3_10 GDK_DEPRECATED
# define GDK_DEPRECATED_IN_3_10_FOR(f) GDK_DEPRECATED_FOR(f)
#else
# define GDK_DEPRECATED_IN_3_10
# define GDK_DEPRECATED_IN_3_10_FOR(f)
# define GDK_DEPRECATED_IN_3_10 _GDK_EXTERN
# define GDK_DEPRECATED_IN_3_10_FOR(f) _GDK_EXTERN
#endif
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_10
# define GDK_AVAILABLE_IN_3_10 GDK_UNAVAILABLE(3, 10)
#else
# define GDK_AVAILABLE_IN_3_10
# define GDK_AVAILABLE_IN_3_10 _GDK_EXTERN
#endif
#endif /* __GDK_VERSION_MACROS_H__ */
+21
View File
@@ -30,6 +30,7 @@
#endif
#include <gdk/gdktypes.h>
#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
@@ -78,41 +79,61 @@ typedef enum
* a particular visual.
*/
GDK_AVAILABLE_IN_ALL
GType gdk_visual_get_type (void) G_GNUC_CONST;
#ifndef GDK_MULTIHEAD_SAFE
GDK_AVAILABLE_IN_ALL
gint gdk_visual_get_best_depth (void);
GDK_AVAILABLE_IN_ALL
GdkVisualType gdk_visual_get_best_type (void);
GDK_AVAILABLE_IN_ALL
GdkVisual* gdk_visual_get_system (void);
GDK_AVAILABLE_IN_ALL
GdkVisual* gdk_visual_get_best (void);
GDK_AVAILABLE_IN_ALL
GdkVisual* gdk_visual_get_best_with_depth (gint depth);
GDK_AVAILABLE_IN_ALL
GdkVisual* gdk_visual_get_best_with_type (GdkVisualType visual_type);
GDK_AVAILABLE_IN_ALL
GdkVisual* gdk_visual_get_best_with_both (gint depth,
GdkVisualType visual_type);
GDK_AVAILABLE_IN_ALL
void gdk_query_depths (gint **depths,
gint *count);
GDK_AVAILABLE_IN_ALL
void gdk_query_visual_types (GdkVisualType **visual_types,
gint *count);
GDK_AVAILABLE_IN_ALL
GList* gdk_list_visuals (void);
#endif
GDK_AVAILABLE_IN_ALL
GdkScreen *gdk_visual_get_screen (GdkVisual *visual);
GDK_AVAILABLE_IN_ALL
GdkVisualType gdk_visual_get_visual_type (GdkVisual *visual);
GDK_AVAILABLE_IN_ALL
gint gdk_visual_get_depth (GdkVisual *visual);
GDK_AVAILABLE_IN_ALL
GdkByteOrder gdk_visual_get_byte_order (GdkVisual *visual);
GDK_AVAILABLE_IN_ALL
gint gdk_visual_get_colormap_size (GdkVisual *visual);
GDK_AVAILABLE_IN_ALL
gint gdk_visual_get_bits_per_rgb (GdkVisual *visual);
GDK_AVAILABLE_IN_ALL
void gdk_visual_get_red_pixel_details (GdkVisual *visual,
guint32 *mask,
gint *shift,
gint *precision);
GDK_AVAILABLE_IN_ALL
void gdk_visual_get_green_pixel_details (GdkVisual *visual,
guint32 *mask,
gint *shift,
gint *precision);
GDK_AVAILABLE_IN_ALL
void gdk_visual_get_blue_pixel_details (GdkVisual *visual,
guint32 *mask,
gint *shift,
+344 -1506
View File
File diff suppressed because it is too large Load Diff
+162
View File
@@ -507,77 +507,109 @@ struct _GdkWindowClass
/* Windows
*/
GDK_AVAILABLE_IN_ALL
GType gdk_window_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GdkWindow* gdk_window_new (GdkWindow *parent,
GdkWindowAttr *attributes,
gint attributes_mask);
GDK_AVAILABLE_IN_ALL
void gdk_window_destroy (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
GdkWindowType gdk_window_get_window_type (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
gboolean gdk_window_is_destroyed (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
GdkVisual * gdk_window_get_visual (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
GdkScreen * gdk_window_get_screen (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
GdkDisplay * gdk_window_get_display (GdkWindow *window);
#ifndef GDK_MULTIDEVICE_SAFE
GDK_DEPRECATED_IN_3_0_FOR(gdk_device_get_window_at_position)
GdkWindow* gdk_window_at_pointer (gint *win_x,
gint *win_y);
#endif /* GDK_MULTIDEVICE_SAFE */
GDK_AVAILABLE_IN_ALL
void gdk_window_show (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_hide (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_withdraw (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_show_unraised (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_move (GdkWindow *window,
gint x,
gint y);
GDK_AVAILABLE_IN_ALL
void gdk_window_resize (GdkWindow *window,
gint width,
gint height);
GDK_AVAILABLE_IN_ALL
void gdk_window_move_resize (GdkWindow *window,
gint x,
gint y,
gint width,
gint height);
GDK_AVAILABLE_IN_ALL
void gdk_window_reparent (GdkWindow *window,
GdkWindow *new_parent,
gint x,
gint y);
GDK_AVAILABLE_IN_ALL
void gdk_window_raise (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_lower (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_restack (GdkWindow *window,
GdkWindow *sibling,
gboolean above);
GDK_AVAILABLE_IN_ALL
void gdk_window_focus (GdkWindow *window,
guint32 timestamp);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_user_data (GdkWindow *window,
gpointer user_data);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_override_redirect (GdkWindow *window,
gboolean override_redirect);
GDK_AVAILABLE_IN_ALL
gboolean gdk_window_get_accept_focus (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_accept_focus (GdkWindow *window,
gboolean accept_focus);
GDK_AVAILABLE_IN_ALL
gboolean gdk_window_get_focus_on_map (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_focus_on_map (GdkWindow *window,
gboolean focus_on_map);
GDK_AVAILABLE_IN_ALL
void gdk_window_add_filter (GdkWindow *window,
GdkFilterFunc function,
gpointer data);
GDK_AVAILABLE_IN_ALL
void gdk_window_remove_filter (GdkWindow *window,
GdkFilterFunc function,
gpointer data);
GDK_AVAILABLE_IN_ALL
void gdk_window_scroll (GdkWindow *window,
gint dx,
gint dy);
GDK_AVAILABLE_IN_ALL
void gdk_window_move_region (GdkWindow *window,
const cairo_region_t *region,
gint dx,
gint dy);
GDK_AVAILABLE_IN_ALL
gboolean gdk_window_ensure_native (GdkWindow *window);
/*
* This allows for making shaped (partially transparent) windows
* - cool feature, needed for Drag and Drag for example.
*/
GDK_AVAILABLE_IN_ALL
void gdk_window_shape_combine_region (GdkWindow *window,
const cairo_region_t *shape_region,
gint offset_x,
@@ -590,9 +622,12 @@ void gdk_window_shape_combine_region (GdkWindow *window,
*
* - Raster
*/
GDK_AVAILABLE_IN_ALL
void gdk_window_set_child_shapes (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
gboolean gdk_window_get_composited (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_composited (GdkWindow *window,
gboolean composited);
@@ -603,13 +638,17 @@ void gdk_window_set_composited (GdkWindow *window,
*
* - Raster
*/
GDK_AVAILABLE_IN_ALL
void gdk_window_merge_child_shapes (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_input_shape_combine_region (GdkWindow *window,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_child_input_shapes (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_merge_child_input_shapes (GdkWindow *window);
@@ -619,111 +658,174 @@ void gdk_window_merge_child_input_shapes (GdkWindow *window);
* Note that a window that is_viewable below is not necessarily
* viewable in the X sense.
*/
GDK_AVAILABLE_IN_ALL
gboolean gdk_window_is_visible (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
gboolean gdk_window_is_viewable (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
gboolean gdk_window_is_input_only (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
gboolean gdk_window_is_shaped (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
GdkWindowState gdk_window_get_state (GdkWindow *window);
/* Set static bit gravity on the parent, and static
* window gravity on all children.
*/
GDK_AVAILABLE_IN_ALL
gboolean gdk_window_set_static_gravities (GdkWindow *window,
gboolean use_static);
/* GdkWindow */
/**
* GdkWindowInvalidateHandlerFunc:
* @window: a #GdkWindow
* @region: a #cairo_region_t
*
* Whenever some area of the window is invalidated (directly in the
* window or in a child window) this gets called with @region in
* the coordinate space of @window. You can use @region to just
* keep track of the dirty region, or you can actually change
* @region in case you are doing display tricks like showing
* a child in multiple places.
*
* Since: 3.10
*/
typedef void (*GdkWindowInvalidateHandlerFunc) (GdkWindow *window,
cairo_region_t *region);
GDK_AVAILABLE_IN_3_10
void gdk_window_set_invalidate_handler (GdkWindow *window,
GdkWindowInvalidateHandlerFunc handler);
GDK_AVAILABLE_IN_ALL
gboolean gdk_window_has_native (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_type_hint (GdkWindow *window,
GdkWindowTypeHint hint);
GDK_AVAILABLE_IN_ALL
GdkWindowTypeHint gdk_window_get_type_hint (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
gboolean gdk_window_get_modal_hint (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_modal_hint (GdkWindow *window,
gboolean modal);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_skip_taskbar_hint (GdkWindow *window,
gboolean skips_taskbar);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_skip_pager_hint (GdkWindow *window,
gboolean skips_pager);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_urgency_hint (GdkWindow *window,
gboolean urgent);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_geometry_hints (GdkWindow *window,
const GdkGeometry *geometry,
GdkWindowHints geom_mask);
GDK_AVAILABLE_IN_ALL
cairo_region_t *gdk_window_get_clip_region (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
cairo_region_t *gdk_window_get_visible_region(GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_begin_paint_rect (GdkWindow *window,
const GdkRectangle *rectangle);
GDK_AVAILABLE_IN_ALL
void gdk_window_begin_paint_region (GdkWindow *window,
const cairo_region_t *region);
GDK_AVAILABLE_IN_ALL
void gdk_window_end_paint (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_flush (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_title (GdkWindow *window,
const gchar *title);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_role (GdkWindow *window,
const gchar *role);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_startup_id (GdkWindow *window,
const gchar *startup_id);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_transient_for (GdkWindow *window,
GdkWindow *parent);
GDK_DEPRECATED_IN_3_4_FOR(gdk_window_set_background_rgba)
void gdk_window_set_background (GdkWindow *window,
const GdkColor *color);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_background_rgba (GdkWindow *window,
const GdkRGBA *rgba);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_background_pattern (GdkWindow *window,
cairo_pattern_t *pattern);
GDK_AVAILABLE_IN_ALL
cairo_pattern_t *gdk_window_get_background_pattern (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_cursor (GdkWindow *window,
GdkCursor *cursor);
GDK_AVAILABLE_IN_ALL
GdkCursor *gdk_window_get_cursor (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_device_cursor (GdkWindow *window,
GdkDevice *device,
GdkCursor *cursor);
GDK_AVAILABLE_IN_ALL
GdkCursor *gdk_window_get_device_cursor (GdkWindow *window,
GdkDevice *device);
GDK_AVAILABLE_IN_ALL
void gdk_window_get_user_data (GdkWindow *window,
gpointer *data);
GDK_AVAILABLE_IN_ALL
void gdk_window_get_geometry (GdkWindow *window,
gint *x,
gint *y,
gint *width,
gint *height);
GDK_AVAILABLE_IN_ALL
int gdk_window_get_width (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
int gdk_window_get_height (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_get_position (GdkWindow *window,
gint *x,
gint *y);
GDK_AVAILABLE_IN_ALL
gint gdk_window_get_origin (GdkWindow *window,
gint *x,
gint *y);
GDK_AVAILABLE_IN_ALL
void gdk_window_get_root_coords (GdkWindow *window,
gint x,
gint y,
gint *root_x,
gint *root_y);
GDK_AVAILABLE_IN_ALL
void gdk_window_coords_to_parent (GdkWindow *window,
gdouble x,
gdouble y,
gdouble *parent_x,
gdouble *parent_y);
GDK_AVAILABLE_IN_ALL
void gdk_window_coords_from_parent (GdkWindow *window,
gdouble parent_x,
gdouble parent_y,
gdouble *x,
gdouble *y);
GDK_AVAILABLE_IN_ALL
void gdk_window_get_root_origin (GdkWindow *window,
gint *x,
gint *y);
GDK_AVAILABLE_IN_ALL
void gdk_window_get_frame_extents (GdkWindow *window,
GdkRectangle *rect);
@@ -734,61 +836,94 @@ GdkWindow * gdk_window_get_pointer (GdkWindow *window,
gint *y,
GdkModifierType *mask);
#endif /* GDK_MULTIDEVICE_SAFE */
GDK_AVAILABLE_IN_ALL
GdkWindow * gdk_window_get_device_position (GdkWindow *window,
GdkDevice *device,
gint *x,
gint *y,
GdkModifierType *mask);
GDK_AVAILABLE_IN_ALL
GdkWindow * gdk_window_get_parent (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
GdkWindow * gdk_window_get_toplevel (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
GdkWindow * gdk_window_get_effective_parent (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
GdkWindow * gdk_window_get_effective_toplevel (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
GList * gdk_window_get_children (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
GList * gdk_window_peek_children (GdkWindow *window);
GDK_AVAILABLE_IN_3_10
GList * gdk_window_get_children_with_user_data (GdkWindow *window,
gpointer user_data);
GDK_AVAILABLE_IN_ALL
GdkEventMask gdk_window_get_events (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_events (GdkWindow *window,
GdkEventMask event_mask);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_device_events (GdkWindow *window,
GdkDevice *device,
GdkEventMask event_mask);
GDK_AVAILABLE_IN_ALL
GdkEventMask gdk_window_get_device_events (GdkWindow *window,
GdkDevice *device);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_source_events (GdkWindow *window,
GdkInputSource source,
GdkEventMask event_mask);
GDK_AVAILABLE_IN_ALL
GdkEventMask gdk_window_get_source_events (GdkWindow *window,
GdkInputSource source);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_icon_list (GdkWindow *window,
GList *pixbufs);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_icon_name (GdkWindow *window,
const gchar *name);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_group (GdkWindow *window,
GdkWindow *leader);
GDK_AVAILABLE_IN_ALL
GdkWindow* gdk_window_get_group (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_decorations (GdkWindow *window,
GdkWMDecoration decorations);
GDK_AVAILABLE_IN_ALL
gboolean gdk_window_get_decorations (GdkWindow *window,
GdkWMDecoration *decorations);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_functions (GdkWindow *window,
GdkWMFunction functions);
GDK_AVAILABLE_IN_ALL
cairo_surface_t *
gdk_window_create_similar_surface (GdkWindow *window,
cairo_content_t content,
int width,
int height);
GDK_AVAILABLE_IN_ALL
void gdk_window_beep (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_iconify (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_deiconify (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_stick (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_unstick (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_maximize (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_unmaximize (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_fullscreen (GdkWindow *window);
GDK_AVAILABLE_IN_3_8
void gdk_window_set_fullscreen_mode (GdkWindow *window,
@@ -796,19 +931,26 @@ void gdk_window_set_fullscreen_mode (GdkWindow *window,
GDK_AVAILABLE_IN_3_8
GdkFullscreenMode
gdk_window_get_fullscreen_mode (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_unfullscreen (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_keep_above (GdkWindow *window,
gboolean setting);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_keep_below (GdkWindow *window,
gboolean setting);
GDK_AVAILABLE_IN_ALL
void gdk_window_set_opacity (GdkWindow *window,
gdouble opacity);
GDK_AVAILABLE_IN_ALL
void gdk_window_register_dnd (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
GdkDragProtocol
gdk_window_get_drag_protocol(GdkWindow *window,
GdkWindow **target);
GDK_AVAILABLE_IN_ALL
void gdk_window_begin_resize_drag (GdkWindow *window,
GdkWindowEdge edge,
gint button,
@@ -823,6 +965,7 @@ void gdk_window_begin_resize_drag_for_device (GdkWindow *window,
gint root_x,
gint root_y,
guint32 timestamp);
GDK_AVAILABLE_IN_ALL
void gdk_window_begin_move_drag (GdkWindow *window,
gint button,
gint root_x,
@@ -837,9 +980,11 @@ void gdk_window_begin_move_drag_for_device (GdkWindow *window,
guint32 timestamp);
/* Interface for dirty-region queueing */
GDK_AVAILABLE_IN_ALL
void gdk_window_invalidate_rect (GdkWindow *window,
const GdkRectangle *rect,
gboolean invalidate_children);
GDK_AVAILABLE_IN_ALL
void gdk_window_invalidate_region (GdkWindow *window,
const cairo_region_t *region,
gboolean invalidate_children);
@@ -858,25 +1003,35 @@ void gdk_window_invalidate_region (GdkWindow *window,
typedef gboolean (*GdkWindowChildFunc) (GdkWindow *window,
gpointer user_data);
GDK_AVAILABLE_IN_ALL
void gdk_window_invalidate_maybe_recurse (GdkWindow *window,
const cairo_region_t *region,
GdkWindowChildFunc child_func,
gpointer user_data);
GDK_AVAILABLE_IN_ALL
cairo_region_t *gdk_window_get_update_area (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_freeze_updates (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_thaw_updates (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_freeze_toplevel_updates_libgtk_only (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_thaw_toplevel_updates_libgtk_only (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_process_all_updates (void);
GDK_AVAILABLE_IN_ALL
void gdk_window_process_updates (GdkWindow *window,
gboolean update_children);
/* Enable/disable flicker, so you can tell if your code is inefficient. */
GDK_AVAILABLE_IN_ALL
void gdk_window_set_debug_updates (gboolean setting);
GDK_AVAILABLE_IN_ALL
void gdk_window_constrain_size (GdkGeometry *geometry,
guint flags,
gint width,
@@ -889,19 +1044,26 @@ void gdk_window_enable_synchronized_configure (GdkWindow *window);
GDK_DEPRECATED_IN_3_8
void gdk_window_configure_finished (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
GdkWindow *gdk_get_default_root_window (void);
/* Offscreen redirection */
GDK_AVAILABLE_IN_ALL
cairo_surface_t *
gdk_offscreen_window_get_surface (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_offscreen_window_set_embedder (GdkWindow *window,
GdkWindow *embedder);
GDK_AVAILABLE_IN_ALL
GdkWindow *gdk_offscreen_window_get_embedder (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_geometry_changed (GdkWindow *window);
/* Multidevice support */
GDK_AVAILABLE_IN_ALL
void gdk_window_set_support_multidevice (GdkWindow *window,
gboolean support_multidevice);
GDK_AVAILABLE_IN_ALL
gboolean gdk_window_get_support_multidevice (GdkWindow *window);
/* Frame clock */
+3 -10
View File
@@ -101,6 +101,9 @@ struct _GdkWindowImplClass
gint *x,
gint *y,
GdkModifierType *mask);
gboolean (* begin_paint_region) (GdkWindow *window,
const cairo_region_t *region);
void (* end_paint) (GdkWindow *window);
cairo_region_t * (* get_shape) (GdkWindow *window);
cairo_region_t * (* get_input_shape) (GdkWindow *window);
@@ -125,16 +128,6 @@ struct _GdkWindowImplClass
gboolean (* queue_antiexpose) (GdkWindow *window,
cairo_region_t *update_area);
/* Called to move @area inside @window by @dx x @dy pixels. @area is
* guaranteed to be inside @window. If part of @area is not invisible or
* invalid, it is this function's job to queue expose events in those
* areas.
*/
void (* translate) (GdkWindow *window,
cairo_region_t *area,
gint dx,
gint dy);
/* Called to do the windowing system specific part of gdk_window_destroy(),
*
* window: The window being destroyed
+1
View File
@@ -9,6 +9,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/gdk \
-I$(top_builddir)/gdk \
$(GDK_HIDDEN_VISIBILITY_CFLAGS) \
$(GTK_DEBUG_FLAGS) \
$(GDK_DEP_CFLAGS) \
"-xobjective-c"
+1 -1
View File
@@ -21,7 +21,7 @@
#define __GDK_QUARTZ_DEVICE_MANAGER_CORE__
#include <gdkdevicemanagerprivate.h>
#include <gdkquartzdevicemanager-core.h>
#include "gdkquartzdevicemanager-core.h"
G_BEGIN_DECLS
+13
View File
@@ -336,4 +336,17 @@ gdk_quartz_display_class_init (GdkQuartzDisplayClass *class)
display_class->convert_selection = _gdk_quartz_display_convert_selection;
display_class->text_property_to_utf8_list = _gdk_quartz_display_text_property_to_utf8_list;
display_class->utf8_to_string_target = _gdk_quartz_display_utf8_to_string_target;
ProcessSerialNumber psn = { 0, kCurrentProcess };
void (*_gtk_quartz_framework_init_ptr) (void);
/* Make the current process a foreground application, i.e. an app
* with a user interface, in case we're not running from a .app bundle
*/
TransformProcessType (&psn, kProcessTransformToForegroundApplication);
/* Initialize GTK+ framework if there is one. */
_gtk_quartz_framework_init_ptr = dlsym (RTLD_DEFAULT, "_gtk_quartz_framework_init");
if (_gtk_quartz_framework_init_ptr)
_gtk_quartz_framework_init_ptr ();
}
-15
View File
@@ -43,18 +43,6 @@ G_DEFINE_TYPE (GdkQuartzDisplayManager, gdk_quartz_display_manager, GDK_TYPE_DIS
static void
gdk_quartz_display_manager_init (GdkQuartzDisplayManager *manager)
{
ProcessSerialNumber psn = { 0, kCurrentProcess };
void (*_gtk_quartz_framework_init_ptr) (void);
/* Make the current process a foreground application, i.e. an app
* with a user interface, in case we're not running from a .app bundle
*/
TransformProcessType (&psn, kProcessTransformToForegroundApplication);
/* Initialize GTK+ framework if there is one. */
_gtk_quartz_framework_init_ptr = dlsym (RTLD_DEFAULT, "_gtk_quartz_framework_init");
if (_gtk_quartz_framework_init_ptr)
_gtk_quartz_framework_init_ptr ();
}
static void
@@ -71,7 +59,4 @@ gdk_quartz_display_manager_class_init (GdkQuartzDisplayManagerClass *class)
GdkDisplayManagerClass *manager_class = GDK_DISPLAY_MANAGER_CLASS (class);
object_class->finalize = gdk_quartz_display_manager_finalize;
manager_class->atom_intern = _gdk_quartz_display_manager_atom_intern;
manager_class->get_atom_name = _gdk_quartz_display_manager_get_atom_name;
}
+1 -1
View File
@@ -21,7 +21,7 @@
#define __GDK_QUARTZ_DND__
#include <gdkdndprivate.h>
#include <gdkquartzdnd.h>
#include "gdkquartzdnd.h"
#include <AppKit/AppKit.h>
-8
View File
@@ -154,14 +154,6 @@ gint _gdk_quartz_display_text_property_to_utf8_list (GdkDisplay *disp
gchar * _gdk_quartz_display_utf8_to_string_target (GdkDisplay *displayt,
const gchar *str);
/* Display manager methods - events */
GdkAtom _gdk_quartz_display_manager_atom_intern (GdkDisplayManager *manager,
const gchar *atom_name,
gboolean copy_name);
gchar * _gdk_quartz_display_manager_get_atom_name (GdkDisplayManager *manager,
GdkAtom atom);
/* Screen */
GdkScreen *_gdk_quartz_screen_new (void);
void _gdk_quartz_screen_update_window_sizes (GdkScreen *screen);
-20
View File
@@ -148,26 +148,6 @@ intern_atom_internal (const gchar *atom_name, gboolean allocate)
return result;
}
GdkAtom
_gdk_quartz_display_manager_atom_intern (GdkDisplayManager *manager,
const gchar *atom_name,
gboolean copy_name)
{
return intern_atom_internal (atom_name, copy_name);
}
gchar *
_gdk_quartz_display_manager_get_atom_name (GdkDisplayManager *manager,
GdkAtom atom)
{
ensure_atom_tables ();
if (GPOINTER_TO_INT (atom) >= atoms_to_names->len)
return NULL;
return g_strdup (g_ptr_array_index (atoms_to_names, GPOINTER_TO_INT (atom)));
}
void
_gdk_quartz_window_delete_property (GdkWindow *window,
GdkAtom property)
+1
View File
@@ -53,6 +53,7 @@ typedef enum
GDK_OSX_NEW = 99
} GdkOSXVersion;
GDK_AVAILABLE_IN_ALL
GdkOSXVersion gdk_quartz_osx_version (void);
GdkAtom gdk_quartz_pasteboard_type_to_atom_libgtk_only (NSString *type);
+1
View File
@@ -42,6 +42,7 @@ typedef GdkCursor GdkQuartzCursor;
#endif
typedef struct _GdkQuartzCursorClass GdkQuartzCursorClass;
GDK_AVAILABLE_IN_ALL
GType gdk_quartz_cursor_get_type (void);
G_END_DECLS
+1
View File
@@ -36,6 +36,7 @@ G_BEGIN_DECLS
typedef struct _GdkQuartzDeviceCore GdkQuartzDeviceCore;
typedef struct _GdkQuartzDeviceCoreClass GdkQuartzDeviceCoreClass;
GDK_AVAILABLE_IN_ALL
GType gdk_quartz_device_core_get_type (void) G_GNUC_CONST;
G_END_DECLS
+1
View File
@@ -37,6 +37,7 @@ typedef struct _GdkQuartzDeviceManagerCore GdkQuartzDeviceManagerCore;
typedef struct _GdkQuartzDeviceManagerCoreClass GdkQuartzDeviceManagerCoreClass;
GDK_AVAILABLE_IN_ALL
GType gdk_quartz_device_manager_core_get_type (void) G_GNUC_CONST;
+1
View File
@@ -43,6 +43,7 @@ typedef GdkDisplay GdkQuartzDisplay;
typedef struct _GdkQuartzDisplayClass GdkQuartzDisplayClass;
GDK_AVAILABLE_IN_ALL
GType gdk_quartz_display_get_type (void);
G_END_DECLS
+1
View File
@@ -39,6 +39,7 @@ typedef GdkDisplayManager _GdkQuartzDisplayManager;
typedef struct _GdkDisplayManagerClass GdkQuartzDisplayManagerClass;
GDK_AVAILABLE_IN_ALL
GType gdk_quartz_display_manager_get_type (void);
G_END_DECLS
+2
View File
@@ -42,8 +42,10 @@ typedef GdkDragContext GdkQuartzDragContext;
typedef struct _GdkQuartzDragContextClass GdkQuartzDragContextClass;
GDK_AVAILABLE_IN_ALL
GType gdk_quartz_drag_context_get_type (void);
GDK_AVAILABLE_IN_ALL
id gdk_quartz_drag_context_get_dragging_info_libgtk_only (GdkDragContext *context);
G_END_DECLS
+1
View File
@@ -42,6 +42,7 @@ typedef GdkKeymap GdkQuartzKeymap;
#endif
typedef struct _GdkQuartzKeymapClass GdkQuartzKeymapClass;
GDK_AVAILABLE_IN_ALL
GType gdk_quartz_keymap_get_type (void);
G_END_DECLS
+1
View File
@@ -42,6 +42,7 @@ typedef GdkScreen GdkQuartzScreen;
typedef struct _GdkQuartzScreenClass GdkQuartzScreenClass;
GDK_AVAILABLE_IN_ALL
GType gdk_quartz_screen_get_type (void);
G_END_DECLS
+2
View File
@@ -28,7 +28,9 @@
G_BEGIN_DECLS
GDK_AVAILABLE_IN_ALL
NSImage *gdk_quartz_pixbuf_to_ns_image_libgtk_only (GdkPixbuf *pixbuf);
GDK_AVAILABLE_IN_ALL
NSEvent *gdk_quartz_event_get_nsevent (GdkEvent *event);
G_END_DECLS
+1
View File
@@ -43,6 +43,7 @@ typedef GdkVisual GdkQuartzVisual;
typedef struct _GdkQuartzVisualClass GdkQuartzVisualClass;
GDK_AVAILABLE_IN_ALL
GType gdk_quartz_visual_get_type (void);
G_END_DECLS
+3
View File
@@ -42,9 +42,12 @@ typedef GdkWindow GdkQuartzWindow;
#endif
typedef struct _GdkQuartzWindowClass GdkQuartzWindowClass;
GDK_AVAILABLE_IN_ALL
GType gdk_quartz_window_get_type (void);
GDK_AVAILABLE_IN_ALL
NSWindow *gdk_quartz_window_get_nswindow (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
NSView *gdk_quartz_window_get_nsview (GdkWindow *window);
G_END_DECLS
+10 -68
View File
@@ -364,19 +364,18 @@ gdk_window_impl_quartz_init (GdkWindowImplQuartz *impl)
impl->type_hint = GDK_WINDOW_TYPE_HINT_NORMAL;
}
static void
gdk_window_impl_quartz_begin_paint_region (GdkPaintable *paintable,
GdkWindow *window,
static gboolean
gdk_window_impl_quartz_begin_paint_region (GdkWindow *window,
const cairo_region_t *region)
{
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (paintable);
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->imp);
cairo_region_t *clipped_and_offset_region;
cairo_t *cr;
clipped_and_offset_region = cairo_region_copy (region);
cairo_region_intersect (clipped_and_offset_region,
window->clip_region_with_children);
window->clip_region);
cairo_region_translate (clipped_and_offset_region,
window->abs_x, window->abs_y);
@@ -415,12 +414,14 @@ gdk_window_impl_quartz_begin_paint_region (GdkPaintable *paintable,
done:
cairo_region_destroy (clipped_and_offset_region);
return FALSE;
}
static void
gdk_window_impl_quartz_end_paint (GdkPaintable *paintable)
gdk_window_impl_quartz_end_paint (GdkWindow *window)
{
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (paintable);
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
impl->begin_paint_count--;
@@ -536,13 +537,6 @@ _gdk_quartz_display_after_process_all_updates (GdkDisplay *display)
NSEnableScreenUpdates ();
}
static void
gdk_window_impl_quartz_paintable_init (GdkPaintableIface *iface)
{
iface->begin_paint_region = gdk_window_impl_quartz_begin_paint_region;
iface->end_paint = gdk_window_impl_quartz_end_paint;
}
static const gchar *
get_default_title (void)
{
@@ -2237,49 +2231,6 @@ gdk_quartz_window_queue_antiexpose (GdkWindow *window,
return FALSE;
}
static void
gdk_quartz_window_translate (GdkWindow *window,
cairo_region_t *area,
gint dx,
gint dy)
{
cairo_region_t *invalidate, *scrolled;
GdkWindowImplQuartz *impl = (GdkWindowImplQuartz *)window->impl;
GdkRectangle extents;
cairo_region_get_extents (area, &extents);
[impl->view scrollRect:NSMakeRect (extents.x - dx, extents.y - dy,
extents.width, extents.height)
by:NSMakeSize (dx, dy)];
if (impl->needs_display_region)
{
cairo_region_t *intersection;
/* Invalidate already invalidated area that was moved at new
* location.
*/
intersection = cairo_region_copy (impl->needs_display_region);
cairo_region_intersect (intersection, area);
cairo_region_translate (intersection, dx, dy);
gdk_quartz_window_set_needs_display_in_region (window, intersection);
cairo_region_destroy (intersection);
}
/* Calculate newly exposed area that needs invalidation */
scrolled = cairo_region_copy (area);
cairo_region_translate (scrolled, dx, dy);
invalidate = cairo_region_copy (area);
cairo_region_subtract (invalidate, scrolled);
cairo_region_destroy (scrolled);
gdk_quartz_window_set_needs_display_in_region (window, invalidate);
cairo_region_destroy (invalidate);
}
static void
gdk_quartz_window_set_focus_on_map (GdkWindow *window,
gboolean focus_on_map)
@@ -3078,12 +3029,13 @@ gdk_window_impl_quartz_class_init (GdkWindowImplQuartzClass *klass)
impl_class->input_shape_combine_region = gdk_window_quartz_input_shape_combine_region;
impl_class->set_static_gravities = gdk_window_quartz_set_static_gravities;
impl_class->queue_antiexpose = gdk_quartz_window_queue_antiexpose;
impl_class->translate = gdk_quartz_window_translate;
impl_class->destroy = gdk_quartz_window_destroy;
impl_class->destroy_foreign = gdk_quartz_window_destroy_foreign;
impl_class->resize_cairo_surface = gdk_window_quartz_resize_cairo_surface;
impl_class->get_shape = gdk_quartz_window_get_shape;
impl_class->get_input_shape = gdk_quartz_window_get_input_shape;
impl_class->begin_paint_region = gdk_window_impl_quartz_begin_paint_region;
impl_class->end_paint = gdk_window_impl_quartz_end_paint;
impl_class->focus = gdk_quartz_window_focus;
impl_class->set_type_hint = gdk_quartz_window_set_type_hint;
@@ -3159,19 +3111,9 @@ _gdk_window_impl_quartz_get_type (void)
(GInstanceInitFunc) gdk_window_impl_quartz_init,
};
const GInterfaceInfo paintable_info =
{
(GInterfaceInitFunc) gdk_window_impl_quartz_paintable_init,
NULL,
NULL
};
object_type = g_type_register_static (GDK_TYPE_WINDOW_IMPL,
"GdkWindowImplQuartz",
&object_info, 0);
g_type_add_interface_static (object_type,
GDK_TYPE_PAINTABLE,
&paintable_info);
}
return object_type;
+1 -1
View File
@@ -5,7 +5,7 @@
static void
test_unset_display (void)
{
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR))
if (g_test_trap_fork (0, 0))//G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR))
{
GdkDisplayManager *manager;
+1 -2
View File
@@ -10,6 +10,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/gdk \
-I$(top_builddir)/gdk \
$(GDK_HIDDEN_VISIBILITY_CFLAGS) \
$(GTK_DEBUG_FLAGS) \
$(GDK_DEP_CFLAGS)
@@ -24,7 +25,6 @@ libgdk_wayland_la_SOURCES = \
gdkdevice-wayland.c \
gdkdisplay-wayland.c \
gdkdisplay-wayland.h \
gdkdisplaymanager-wayland.c \
gdkdnd-wayland.c \
gdkeventsource.c \
gdkkeys-wayland.c \
@@ -40,7 +40,6 @@ libgdkinclude_HEADERS = \
libgdkwaylandinclude_HEADERS = \
gdkwaylanddevice.h \
gdkwaylanddisplay.h \
gdkwaylanddisplaymanager.h \
gdkwaylandselection.h \
gdkwaylandwindow.h
+2 -7
View File
@@ -260,8 +260,6 @@ gdk_wayland_display_dispose (GObject *object)
{
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (object);
_gdk_wayland_display_manager_remove_display (gdk_display_manager_get (),
GDK_DISPLAY (display_wayland));
g_list_foreach (display_wayland->input_devices,
(GFunc) g_object_run_dispose, NULL);
@@ -613,9 +611,6 @@ gdk_wayland_display_class_init (GdkWaylandDisplayClass * class)
static void
gdk_wayland_display_init (GdkWaylandDisplay *display)
{
_gdk_wayland_display_manager_add_display (gdk_display_manager_get (),
GDK_DISPLAY (display));
display->xkb_context = xkb_context_new (0);
}
@@ -655,14 +650,14 @@ _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *wayland_display)
g_assert (wayland_display->shm);
g_value_init (&v, G_TYPE_INT);
if (gdk_setting_get ("gtk-cursor-theme-size", &v))
if (gdk_screen_get_setting (wayland_display->screen, "gtk-cursor-theme-size", &v))
size = g_value_get_int (&v);
else
size = 32;
g_value_unset (&v);
g_value_init (&v, G_TYPE_STRING);
if (gdk_setting_get ("gtk-cursor-theme-name", &v))
if (gdk_screen_get_setting (wayland_display->screen, "gtk-cursor-theme-name", &v))
name = g_value_get_string (&v);
else
name = "default";
-131
View File
@@ -1,131 +0,0 @@
/* GDK - The GIMP Drawing Kit
* gdkdisplaymanager-wayland.c
*
* Copyright 2010 Red Hat, Inc.
*
* Author: Matthias clasen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include "gdkdisplaymanagerprivate.h"
#include "gdkdisplay-wayland.h"
#include "gdkprivate-wayland.h"
#include "gdkwayland.h"
#include "gdkinternals.h"
struct _GdkWaylandDisplayManager
{
GdkDisplayManager parent;
GSList *displays;
gboolean init_failed;
};
struct _GdkWaylandDisplayManagerClass
{
GdkDisplayManagerClass parent_class;
};
static void g_initable_iface_init (GInitableIface *iface);
G_DEFINE_TYPE_WITH_CODE (GdkWaylandDisplayManager, gdk_wayland_display_manager, GDK_TYPE_DISPLAY_MANAGER,
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, g_initable_iface_init))
static gboolean
gdk_wayland_display_manager_initable_init (GInitable *initable,
GCancellable *cancellable,
GError **error)
{
struct wl_display *wl_display;
/* Set by the compositor when launching a special client - and it gets reset
* by wl_display_connect so we must avoid calling it twice
*/
if (g_getenv ("WAYLAND_SOCKET"))
return TRUE;
/* check that a connection to the default display is possible */
wl_display = wl_display_connect (gdk_get_display_arg_name ());
if (!wl_display)
{
GDK_WAYLAND_DISPLAY_MANAGER (initable)->init_failed = TRUE;
return FALSE;
}
wl_display_disconnect (wl_display);
return TRUE;
}
void
g_initable_iface_init (GInitableIface *iface)
{
iface->init = gdk_wayland_display_manager_initable_init;
}
static void
gdk_wayland_display_manager_finalize (GObject *object)
{
if (GDK_WAYLAND_DISPLAY_MANAGER (object)->init_failed == FALSE)
g_error ("A GdkWaylandDisplayManager object was finalized. This should not happen");
G_OBJECT_CLASS (gdk_wayland_display_manager_parent_class)->finalize (object);
}
static void
gdk_wayland_display_manager_class_init (GdkWaylandDisplayManagerClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
object_class->finalize = gdk_wayland_display_manager_finalize;
}
static void
gdk_wayland_display_manager_init (GdkWaylandDisplayManager *manager)
{
}
void
_gdk_wayland_display_manager_add_display (GdkDisplayManager *manager,
GdkDisplay *display)
{
GdkWaylandDisplayManager *manager_wayland = GDK_WAYLAND_DISPLAY_MANAGER (manager);
if (manager_wayland->displays == NULL)
gdk_display_manager_set_default_display (manager, display);
manager_wayland->displays = g_slist_prepend (manager_wayland->displays, display);
}
void
_gdk_wayland_display_manager_remove_display (GdkDisplayManager *manager,
GdkDisplay *display)
{
GdkWaylandDisplayManager *manager_wayland = GDK_WAYLAND_DISPLAY_MANAGER (manager);
manager_wayland->displays = g_slist_remove (manager_wayland->displays, display);
if (gdk_display_manager_get_default_display (manager) == display)
{
if (manager_wayland->displays)
gdk_display_manager_set_default_display (manager, manager_wayland->displays->data);
else
gdk_display_manager_set_default_display (manager, NULL);
}
}
+2 -5
View File
@@ -164,11 +164,8 @@ void _gdk_wayland_screen_add_output (GdkScreen *screen,
struct wl_output *output);
void _gdk_wayland_screen_remove_output (GdkScreen *screen,
guint32 id);
void _gdk_wayland_display_manager_add_display (GdkDisplayManager *manager,
GdkDisplay *display);
void _gdk_wayland_display_manager_remove_display (GdkDisplayManager *manager,
GdkDisplay *display);
int _gdk_wayland_screen_get_output_refresh_rate (GdkScreen *screen,
struct wl_output *output);
void _gdk_wayland_window_set_device_grabbed (GdkWindow *window,
GdkDevice *device,

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