Compare commits

...

1276 Commits

Author SHA1 Message Date
Matthias Clasen
91673dafc2 2.18.8, third try 2010-03-15 19:26:48 -04:00
Matthias Clasen
4aa7bf6195 Updates 2010-03-15 18:36:16 -04:00
Matthias Clasen
132e224c70 Recompute label contents when the buffer changes
Also reset cursor positions to avoid assertions.
This fixes bug 612505, patch by Tristan Van Berkom.
(cherry picked from commit 233281fd39)
2010-03-15 18:36:16 -04:00
Matthias Clasen
bf3b7bd40b Fix the tests 2010-03-15 18:36:16 -04:00
Jorge González
8bdf95758f Updated Spanish translation 2010-03-14 23:19:10 +01:00
Kristian Rietveld
c8e5dbd4de Fix compile warning in gdk_cursor_new_from_pixmap
(cherry picked from commit f3a5bf48d4)
2010-03-14 11:02:39 +01:00
Kristian Rietveld
df3e8ec019 Start using NSInteger and NSUInteger
These have been introduced in Leopard and default to int and unsigned int.
In 64-bit Snow Leopard they are long and unsigned long.  This caused issues
with the getRectsBeingDrawn message which needs a pointer to a NSInteger
(long on 64-bit!) but we passed in an integer.  Surprisingly this problem
was visible when compiling with -O0 (segfault), but *not* when compiling
with -O1.  Other messages were NSInteger is now needed have also been
adapted.

Since NSInteger and NSUInteger are not available on Tiger, a define
has been added to add typedefs for these when they have not been defined
by the system headers.

(cherry picked from commit b2b70e5a8d)
2010-03-14 10:55:42 +01:00
Khaled Hosny
69101a9bec Updated Arabic translation 2010-03-13 23:56:11 +02:00
Daniel Nylander
21dfdd0475 Updated Swedish translation 2010-03-13 22:06:56 +01:00
Gil Forcada
8ff7f16945 Updated Catalan translation 2010-03-13 16:13:41 +01:00
Matej Urbančič
8325ece590 Updated Slovenian translation 2010-03-13 10:06:25 +01:00
Claude Paroz
92e9be5bcf Updated French translation 2010-03-13 09:55:47 +01:00
Mario Blättermann
c837564640 Updated German translation 2010-03-13 01:34:25 +01:00
Kristian Rietveld
2f66220326 Bug 598881 - Unimplemented GdkWindowImplIface methods crash gimp on OSX
Add dummy for _gdk_input_window_crossing ().  Set both input_window_destroy
and input_window_crossing pointers in the Impl struct.

Reported by John Ralls.
(cherry picked from commit 42ac226877)
2010-03-12 18:47:01 -05:00
Matthias Clasen
dd64c7a2b9 Recompute label contents when the buffer changes
Also reset cursor positions to avoid assertions.
This fixes bug 612505, patch by Tristan Van Berkom.
(cherry picked from commit 233281fd39)
2010-03-12 18:00:11 -05:00
Matthias Clasen
6bf6324626 Fix gdk_window_set_icon_name
A typo kept this from working on toplevel windows.
Reported in bug 612346.
(cherry picked from commit f73f9d802c)
2010-03-12 18:00:03 -05:00
Christian Dywan
6834ec00b0 Fix definition of GTK_VOLUME_BUTTON_CLASS cast
There is an extra 'e' there.
(cherry picked from commit f90abc4eed)
2010-03-12 17:59:47 -05:00
Matthias Clasen
68b278bf34 Don't scroll to insert after middle-click paste
Patch by Ignacio Casal Quinteiro, bug 612119.
(cherry picked from commit d84a831423)
2010-03-12 17:57:46 -05:00
Michael Natterer
121607ae04 gtk: remove begin-user-action/end-user-action around copying
Copying to the clipboard is not a buffer mutation, so calling
gtk_text_buffer_begin_user_action() and _end_user_action() is only
confusing apps which connect to these signals in order to build undo
stacks or otherwise track buffer changes. Most likely, these apps
either didn't notice the bugus undo step or simply work around it.
(cherry picked from commit 0a49865ec4)
2010-03-12 17:57:34 -05:00
Joanmarie Diggs
f687aafe58 Add/Remove ATK_STATE_SENSITIVE according to cells' state.
Bug #569042.
(cherry picked from commit 4759da2634)
2010-03-12 17:57:19 -05:00
Li Yuan
8ba7712b4e Return FALSE in signal handlers to make the signals be propagated
Bug #611686.
(cherry picked from commit 8c30affb6e)
2010-03-12 17:57:08 -05:00
Matthias Clasen
d3374dbc00 Protect against X errors when clearing the DND cache
This was reported as a problem in bug 609952.
(cherry picked from commit 325cbef27e)
2010-03-12 17:55:05 -05:00
Matthias Clasen
4623a485c7 Prevent a crash in the TGA loader
Reported in bug 609744.
(cherry picked from commit 33330ab332)
2010-03-12 17:54:49 -05:00
Matthias Clasen
9268b23522 Handle out-of-bounds parameters in gtk_assistant_get_nth_page
Better do what the docs say...fix by Tadej Borovšak, bug 610141.
(cherry picked from commit 06d02578f8)
2010-03-12 17:54:37 -05:00
Matthias Clasen
c94513e44b Fix a segfault in gtk_assistant_set_current_page
Reported by Tadej Borovšak in bug 610184
(cherry picked from commit ddcc305f4e)
2010-03-12 17:54:29 -05:00
Matthias Clasen
35938479ca Clarify the docs for gtk_info_bar_set_default_response
According to bug 610632
(cherry picked from commit c3f0cdcfcf)
2010-03-12 17:54:20 -05:00
Matthias Clasen
203d6d7a1e Add some padding in tool buttons
The default value of the icon-spacing style property was 0, which
is just not good. Themes are of course free to change this anyway.
Bug 610381.
(cherry picked from commit 9ce6db1297)
2010-03-12 17:54:04 -05:00
Carlos Garcia Campos
aa883e0295 [docs] Fix GtkPlug::embedded signal documentation
See bug #609650.
(cherry picked from commit 62758ff5ef)
2010-03-12 17:53:43 -05:00
Carlos Garcia Campos
1a5d7d968f Emit GtkPlug::embedded signal when plug/socket are in the same process too
Fixes bug #609650.
(cherry picked from commit e5fc3dcf64)
2010-03-12 17:53:30 -05:00
Tor Lillqvist
15b1dbdfcb Check for __MINGW64__ and not __MINGW64
Should fix bug #612308.
2010-03-12 11:44:32 +02:00
Matthias Clasen
39039a3500 Fix an infinite loop in gtk_dialog_map()
The new focus handling with links in labels tripped up the code
that tries to avoid focussing labels. Bug 612066
2010-03-08 18:27:37 +01:00
Piotr Drąg
bcc963d337 Updated Polish translation 2010-02-25 14:31:28 +01:00
Nils-Christoph Fiedler
de8f5fe394 Updated LowGerman translation 2010-02-25 13:02:31 +01:00
Nils-Christoph Fiedler
4059254f6b Updated LowGerman translation 2010-02-25 12:54:43 +01:00
Runa Bhattacharjee
623cd82d68 Updated Bengali India Translation 2010-02-19 16:24:47 +05:30
Manoj Kumar Giri
4473b45ded Updated Oriya Translation 2010-02-17 21:16:37 +05:30
Matthias Clasen
d53099bc38 Bump version 2010-02-12 21:15:35 -05:00
Matthias Clasen
a4dd814db7 2.18.7 2010-02-12 21:13:30 -05:00
Matthias Clasen
8fba4358fc Updates 2010-02-12 19:51:13 -05:00
Matthias Clasen
9149577e1a Avoid overlap of scale marks
This was reported to be a problem in bug 608807.
(cherry picked from commit 893408352d)
2010-02-12 19:31:24 -05:00
Matthias Clasen
dd9db7bd3d Avoid a crash when setting a tooltip on a GtkCalendar
The details code was assuming that it controls ::has-tooltip.
Reported by Bill Nottingham, bug 607344.
(cherry picked from commit 412beb4444)
2010-02-12 19:30:43 -05:00
Matthias Clasen
a14c8aba5d Fix a refcounting issues in GtkPlug
When the foreign window already has a GdkWindow, we forget to take
an extra references, leading to crashes later on. Patch by
Karl Tomlinson, bug 607061.
(cherry picked from commit beddf67e56)
2010-02-12 19:30:35 -05:00
Christian Persch
015476b770 Correctly clone the toolbutton's icon-name image widget
Bug #608162.
(cherry picked from commit 9497a198f7)
2010-02-12 19:30:21 -05:00
Matthias Clasen
da03774c48 Make DND work better with shaped windows
If mouse clicks go through, drag-and-drop should too...
Fixes bug 608615.
(cherry picked from commit 69aa7a6392)
2010-02-12 19:28:51 -05:00
Cody Russell
6c5c48bae2 Remove existing signal connections in gtk_drag_dest_unset().
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=608370
(cherry picked from commit 2147e57f46)
2010-02-12 19:28:27 -05:00
Christian Dywan
7ec1a0ac71 Do not update paned position if it's already at the given value
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=561816
(cherry picked from commit a23f581c5d)
2010-02-12 19:28:13 -05:00
Li Yuan
8c9844d255 Bug #608410. Set cursor position after inserting text.
(cherry picked from commit 899d425e50)
2010-02-12 19:27:22 -05:00
Matthias Clasen
1d4c18e9c4 Fix declaration of gtk_print_job_set_status
The problem was reported in bug 606698.
(cherry picked from commit 5e7801a304)
2010-02-12 19:22:26 -05:00
Steffen Macke
ae55f8a835 Fix menu bar problem in ms-windows theme engine on Windows 7
Patch from bug #591186. It won't have any effect in this branch as the
whole XP-and-later theming code is broken and disabled, but when/if
that is fixed, then this patch should help.
2010-02-09 12:27:10 +02:00
Tor Lillqvist
8b2c243af6 Use correct processorArchitecture for x86_64 in manifest file 2010-02-09 12:22:13 +02:00
Henrique P. Machado
9ca9d6c590 Updated Brazilian Portuguese Translation 2010-02-04 16:46:08 -03:00
Claudio Saavedra
a6a56e785c GtkTreeView: plug a leaking GtkTreeRowReference
This is exposed by overshooting in a HildonPannableArea. Leaking
a GtkTreeRowReference also means leaking the whole model, since
the GtkTreeModel reference count is increased for each row
reference.

Fixes bug #607770 - Leak in GtkTreeView with HildonPannableArea
(cherry picked from commit 52acceef56)
2010-01-22 18:01:10 +02:00
Alexander Larsson
bb63c9537b Avoid integer overflow in gdk_rectangle_intersect
If e.g. the right edge of the leftmost rectangle is near MIN_INT, and
the left edge of the rightmost rectangle is large then subtracting these
can lead to an integer overflow, making the resultant "width" falsely
positive, thus returning a very wide result instead of the expected
no-intersection result.

We avoid the overflow by not doing the subtraction unless we know the
result will be positive. There are still risks for overflow if x + width
or y + width is larger than MAXINT, but we won't ever overflow for valid
rects now.

This may fix #607687
(cherry picked from commit 3c618f2f1f)
2010-01-22 11:31:27 +01:00
Alexander Larsson
d867026219 When native window requests button presses request other button related events
We need to do this because otherwise the implicit button grab for this
(native) window will not deliver the button events not selected for
by this window. This is a problem because non-native child windows may
select using a wider event mask, and we can't emulate these events if we
don't get the native events.

Fixes bug #607508
(cherry picked from commit 3d9d002bed)
2010-01-20 15:41:58 +01:00
Alexander Larsson
9967831b8d Drop outstanding cairo surfaces when window is made native
Any old cairo_surface referencing the old impl window will be wrong
when we make a window native, so drop it.

This fixes bug #599511
(cherry picked from commit e31a6d1fea)
2010-01-19 16:47:23 +01:00
Alexander Larsson
1c5b9ffb2b Move common gdkwindow.c code into function gdk_window_drop_cairo_surface
This code is duplicated in several places, and more to come, so put
it all in one place.
(cherry picked from commit 46d25437a1)
2010-01-19 16:47:21 +01:00
Alexander Larsson
ed7db8ea55 Track direct window cairo access and avoid tricks when used
When a cairo surface is requested for direct window access (i.e. not
when double-buffering) we can't really track when the actual drawing happens
as cairo drawing is not virtualized. This means we can't properly flush
any outstanding window moves or implicit paints.

This actually causes problems with e.g. abiword (bug #606009) where they
draw without double-buffering. If you press down it scrolls the window
and then draws the caret, but the caret drawing does not flush the
outstanding move from the scroll, so the caret gets drawn on the wrong
screen.

We fix this by never allowing either implicit paints or outstanding window
moves on impl-windows where any windows related to it has an outstanding
direct cairo surface. Luckily this is not very common so in practice this
doesn't matter much.
(cherry picked from commit 841fa47715)
2010-01-19 15:41:45 +01:00
Russell Kyaw
68ccf1a0e9 Added Burmese translation for gtk+ properties 2010-01-19 16:31:59 +02:00
Russell Kyaw
ef0280dd2b Updated Burmese translation 2010-01-19 16:31:04 +02:00
Russell Kyaw
bbd83c60a9 Added Burmese translation 2010-01-19 16:21:15 +02:00
Simos Xenitellis
13edaa0d81 Added Burmese (my) to po/LINGUAS 2010-01-19 16:19:57 +02:00
Jorge González
75468514b0 Updated Spanish translation 2010-01-18 06:21:41 +01:00
Gil Forcada
782f00360c Minor update to Catalan translation 2010-01-17 23:50:43 +01:00
Matej Urbančič
cfd8f35ea7 Updated Slovenian translation 2010-01-15 19:42:49 +01:00
Alexander Larsson
f2fffaad71 Avoid drawing implicit paints to destroyed windows
It may happen that a window gets destroyed during painting, if so
we should not draw the implicit paint double-buffered pixmap to it
as that will cause a BadDrawable X error.

This fixes bug 600865
(cherry picked from commit f96e51db46)
2010-01-15 16:21:48 +01:00
Daniel Nylander
5fcae34f27 Updated Swedish translation 2010-01-13 08:08:53 +01:00
Mario Blättermann
2f68354008 Updated German translation 2010-01-12 21:27:48 +01:00
Matthias Clasen
280f191a75 Correct PRC6 and PRC9 envelope sizes
See bug 603144 for the full story.
(cherry picked from commit b6ff1abc93)
2010-01-12 01:11:33 -05:00
Matthias Clasen
2276e1e6db Bump version 2010-01-11 17:57:09 -05:00
Matthias Clasen
49c72dc016 2.18.6 2010-01-11 17:52:45 -05:00
Matthias Clasen
314fede98a Doc fixes 2010-01-11 17:16:54 -05:00
Matthias Clasen
f25813eaeb Updates 2010-01-11 16:10:11 -05:00
Matthias Clasen
0e17e8daa5 Plug a pixmap leak
We were getting our refcounts tangled up when setting drawable clips on
GCs with CSW, leading to a pretty bad pixmap leak. See bug 606143.
(cherry picked from commit d32b061895)
2010-01-11 10:27:17 -05:00
Matthias Clasen
30b4352d62 Try a little harder to survive close to OOM
(cherry picked from commit d85735a337)
2010-01-08 13:30:10 -05:00
Matthias Clasen
ee17312399 Avoid an FPE for ludicrous scale values
...just bail out early.
(cherry picked from commit 1d4c6ebe5f)
2010-01-08 13:30:02 -05:00
Matthias Clasen
e956191163 Setup libjpeg error handlers early enough
See bug 606068 for details.
(cherry picked from commit 9fc436d810)
2010-01-07 15:56:48 -05:00
Matthias Clasen
1eb83b8a69 Improve selection/arrow key behaviour in GtkTextView
This patch makes the text view behave more similar to entries.
Patch by Michael Natterer, see bug 50942
(cherry picked from commit c0d8b71bc5)
2010-01-07 15:54:57 -05:00
Benjamin Otte
f07fced38c Build adds not-yet-built libgtk-x11-2.0.la into the linker flags
Commit 9e7c91bf83 added a bit too many
LDFLAGS to the build of gtk-update-icon-cache, revert it to only use the
required ones. Bug 605036
(cherry picked from commit 3921834b96)
2010-01-07 15:54:23 -05:00
Matthias Clasen
aaad805038 Handle reading the create-folders property
(cherry picked from commit 4116baef32)
2010-01-07 15:53:23 -05:00
Matthias Clasen
b0225e7f09 Properly free damage events
This was reported in bug 605008
(cherry picked from commit 9d999fb89f)
2010-01-07 15:52:06 -05:00
Benjamin Otte
3f935d85d3 Fix up linker flags
This adds LDFLAGS everywhere where they were previously pulled in via
other libraries. This is however unsupported by modern linkers.
You can trigger these failures by building with gold (or, I'm told, with
very new ld).
(cherry picked from commit 9e7c91bf83)
2010-01-07 15:51:56 -05:00
Benjamin Otte
71cef6c8a0 Disconnect signal handlers on adjustment in destroy handler
Not removing the signal handler caused crashes if the adjustment
survived longer than the scrolled window and still emitted signals. This
could happen inside WebKit.
(cherry picked from commit ff1343a594)
2010-01-07 15:51:42 -05:00
Jean Brefort
af0f6dc778 fix critical in gtk_editable_insert_text 2010-01-07 16:45:20 +01:00
Shankar Prasad
5eba1d0675 Made couple of translation changes in kn.po 2010-01-07 14:06:23 +05:30
Amitakhya Phukan
6a135bf810 Updated Assamese translations. 2010-01-07 13:23:46 +05:30
Inaki Larranaga Murgoitio
4f59e4427d Updated Basque language 2010-01-05 13:20:02 +01:00
Jonh Wendell
eeaeb01590 Fix a memory leak in gtk_label_compose_effective_attrs() 2009-12-22 11:18:05 -03:00
Matthias Clasen
9ac1b6830c Fix a think in the CSW input extension handling
This was causing stack overflow due to an obvious infinite recursion.
See e.g. RH #548849.
(cherry picked from commit d2ce67734a)
2009-12-21 15:29:58 -05:00
Matthias Clasen
0d15334671 Fix a thinko in computing damage for segments
The code was not taking the endpoint of the first segment into account.
This was reported in bug 604747.
(cherry picked from commit aadb190b77)
2009-12-18 19:20:07 -05:00
Matthias Clasen
d97a72a22b Ensure native windows in gdk_property_change
Using X properties on non-toplevel windows is somewhat exotic,
but some people seem to do it, so better to keep it working.
See bug 604787.
(cherry picked from commit 7a9a3077e4)
2009-12-18 18:46:08 -05:00
Alexander Larsson
321c7d16c3 Actually send exposes from gdk_window_clear_area_e
(cherry picked from commit 7e9d89b555)
2009-12-18 15:38:22 +01:00
Philip Withnall
3470ef274d Updated British English translation 2009-12-15 17:33:25 +00:00
Sven Herzberg
19a95139ff Revert "let the close button reflect the page_complete status of SUMMARY pages"
This reverts commit da3b33f1a8.

This was accidentally commited and intended for master only.
2009-12-10 22:08:30 +01:00
Sven Herzberg
da3b33f1a8 let the close button reflect the page_complete status of SUMMARY pages
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=604289
In order to respect this properly, we have to restore the original
behavior by watching a flag to check if the user has already set this.

* gtk/gtkassistant.c: fix the bug by introducing a flag to check for
  non-automatic value setting
* tests/testassistant.c: updated the "generous assistant" to permit
  quick manual testing of this feature
2009-12-10 21:57:51 +01:00
Danielle Madeley
69bd84917c Fix GTK_TREE_MODEL_FILTER_GET_CLASS macro 2009-12-10 09:38:43 +11:00
Matthias Clasen
8ed0520df0 Bump version 2009-12-08 11:06:08 -05:00
Matthias Clasen
4483e2ee3b 2.18.5 2009-12-08 11:02:45 -05:00
Matthias Clasen
1d1132d02b Updates 2009-12-08 10:18:31 -05:00
Matthias Clasen
f0111dba73 Never do implicit paints for foreign windows
They don't need double buffer combination since they have no
client-side children, and creating pixmaps for them is risky
since they could disappear at any time.

May fix bug 598476 and 603652.
2009-12-08 10:13:06 -05:00
Matthias Clasen
141716164a Set colormap of offscreen pixmaps
This fixes problems in clutter-gtk. See bug 603619.
2009-12-08 10:03:19 -05:00
Alexander Larsson
d71364f386 Fix up last commit
(cherry picked from commit 22d1d0d507)
2009-12-08 12:29:44 +01:00
Alexander Larsson
98f044cf41 Handle input extension events when making a window native
It may happen when turning a client side window into a native window
that the window, or some of its children with the same native parent
have extension events enabled, and thus have an input window enabled
for the native parent which needs to change as the window is made
native.

We fix this by temporarily disabling extension events on all the affected
windows while we create the native window, and then reenable them afterwards.

This fixes: https://bugzilla.redhat.com/show_bug.cgi?id=544624
(cherry picked from commit 159214173d)
2009-12-08 12:24:07 +01:00
Alexander Larsson
229b44b875 Fix damage report for lines drawn on offscreen windows
All kinds of lines (lines, segments, arcs, etc) need to take into
account the line properties (width, miter limit, joins, caps, etc)
to get proper damage extents.

This is not really possible to do, but we can make it likely to work
with some ad-hoc estimates.

Fixes bug 603904.
(cherry picked from commit 98a9c5c69a)
2009-12-07 10:52:53 +01:00
Alexander Larsson
141366a040 Fix mouse pointer handling on multiple screens
The fix in 786b589d95 for the
"Cannot click buttons more than once without moving the mouse cursor"
did not correctly handle setups with multiple screens in one display.

We need to handle the case where the first XQueryPointer returns
a different root window than the default one.

This fixes bug 597386 (agaion)
(cherry picked from commit 48fc0f36c2)
2009-12-07 10:52:48 +01:00
Alexander Larsson
4a92edd10a Don't filter out BUTTON_MOTION event masks
We don't really need to filter these out, it was just a leftover
safety check to not override the GDK_POINTER_MOTION_MASK.

Furthermore when we changed behaviour to not always select for native
pointer motion it is actually wrong. We'll still get normal motion
events for the toplevel which we will emulate as button motion on the
child, but the button motion mask will not be inherited by implicit
grabs which makes us not get any motion events during grabs.

This fixes bug 601473
(cherry picked from commit b509f28559)
2009-12-02 11:34:39 +01:00
Matthias Clasen
b1861ddc6a Bump version 2009-12-01 00:02:53 -05:00
Matthias Clasen
516918e5ca 2.18.3 2009-12-01 00:00:32 -05:00
Matthias Clasen
12061ca351 Updates 2009-11-30 23:06:54 -05:00
Javier Jardón
54d1804267 [gdk/directfb] Made dfb_events_dispatch() thread save
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=591438
(cherry picked from commit ee2c797e70)
2009-11-30 22:39:29 -05:00
Matthias Clasen
42b5eb6246 Use a url label instead of a link button
This looks nicer, and allows us to make the url-hook work again
for the website url. Fixes bug 603201.
(cherry picked from commit 478ca88ae5)
2009-11-30 22:39:16 -05:00
Matthias Clasen
9df22c15ad Allow holding compose key while entering a sequence
This broke when we started allowing Super, Hyper and Meta as
accel modifiers. See bug 601959.
(cherry picked from commit c08ed56f13)
2009-11-30 22:39:06 -05:00
Matthew Barnes
def9343ce0 Bug 601869 - GtkUIManager assumes too much about popup menus
Check that the child of a popup menu item is actually a GtkAccelLabel
before setting its "accel-closure" property.
(cherry picked from commit 25a8c7316d)
2009-11-30 22:38:44 -05:00
Matthias Clasen
92289a5b43 Rework a broken workaround for a Java bug
This was committed to fix bug 568263, but it is not correct, as
pointed out in 601611.
(cherry picked from commit 6dfb21e616)
2009-11-30 22:38:33 -05:00
Matthias Clasen
b1dfeb6fca Handle reparenting out of a socket
Although it isnt' allowed by the XEMBED protocol, its possible
that the plug window will be reparented out of the socket without
the socket having done so. See bug 123569. Patch by David Jander.
(cherry picked from commit 84254039f2)
2009-11-30 22:38:20 -05:00
Matthias Clasen
066c3c42dd Allocate a large-enough and mask
We came up short when the image width is not a multiple of 8.
Bug 585383, fix by Felix Riemann.
(cherry picked from commit 869ee7f232)
2009-11-30 22:38:11 -05:00
Matthias Clasen
caded18ecf Be a bit more forgiving about invalid monitor number
By moving the g_return_if_fail() checks into individual monitor functions.
See bug 561130.
2009-11-30 22:38:01 -05:00
Matthias Clasen
b6138cc8c0 Short-circuit get_frame_extents for override-redirect windows
There's no reason to do our expensive round-trips for an override-redirect
window; just use local information. See bug 581145. Patch by Owen Taylor.
2009-11-30 22:37:53 -05:00
Christian Persch
7ef6a12b58 Implement gail_image_get_image_size for storage GICON and ICON_NAME
Bug #602724.
(cherry picked from commit 7abd4d1359)
2009-11-30 22:37:43 -05:00
Matthias Clasen
43ee7aade9 Remove misleading text about invisible text
Invisible text has been working reasonably well since 2.8.
(cherry picked from commit b72c2143b0)
2009-11-30 22:37:02 -05:00
Matthias Clasen
b796473068 Make level3 keys work again
We were not paying attention to consumed modifiers when adding
virtual modifiers. This fixes RH bug 537567.
2009-11-30 22:36:49 -05:00
Christian Persch
79f1257732 Make setting the icon-size property on GTK_IMAGE_GICON images work
Bug #602725.
(cherry picked from commit ba218a7789)
2009-11-30 22:36:37 -05:00
Michael Emmel
f9df0250d1 Fix for position bug
https://bugzilla.gnome.org/show_bug.cgi?id=590800
(cherry picked from commit 04d7d81056)
2009-11-30 22:28:02 -05:00
Alexander Larsson
f17f4cace4 Position new ui nodes correctly when existing dirty dead nodes exist
If you add a new ui node that was recently removed it will still be
in the tree, but marked dirty. In this case we previously just used
the old node, which meant it wouldn't get the same position as if
the dirty nodes had been processed first (and deleted) before the
new node was added.

We handle this by detecting this case and reposition the node as if
it was new.

https://bugzilla.gnome.org/show_bug.cgi?id=603128
(cherry picked from commit 7b19640d8f579da5d802d2a6f72128a6f29a5f33)
2009-11-30 14:21:21 +01:00
Nils-Christoph Fiedler
d7feac3cc2 Updated Low German translation 2009-11-28 13:39:27 +01:00
Nishibori Kiyotaka
5f9eb1a3a3 Updated Japanese translation 2009-11-26 23:03:07 +09:00
Matthias Clasen
c412fc78d0 Set scale_num only once
This modifies the previous commit to be according the upstream libjpeg
maintainers recommendations. See bug 588740.
2009-11-25 23:41:48 -05:00
Nils-Christoph Fiedler
f2807b7b7f Updated Low German translation 2009-11-22 20:53:06 +01:00
Tor Lillqvist
40fae81227 Restore optional debugging printout of normal events 2009-11-20 20:39:29 +02:00
Nils-Christoph Fiedler
a3ccd6bfee Updated Low German translation 2009-11-16 19:03:11 +01:00
Nils-Christoph Fiedler
092d2578ff Added Low German translation 2009-11-15 18:03:34 +01:00
Mario Blättermann
8c86703517 Added dummy Low German translation 2009-11-15 18:01:41 +01:00
Hans Breuer
5bd532e3e6 Fix _gdk_window_impl_new() for win32
The previous implementation was modifying the passed in window ("private") rather than deriving information from it. Also the type hints are now forwarded like in the X11 implementation instead of ignored.

The effect of the unfinished client-side-window porting was e.g. a crash with Dia's navigation window which happened to create a window with an apparent depth of zero.
2009-11-08 18:23:24 +01:00
Christian Dywan
248854947e Only set the accesible label if it is non-empty
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=599446
2009-11-06 10:21:32 +01:00
Matthias Clasen
547ce20360 Fix loading scaled-down jpegs
The assumption that scale_num will be automatically be 1 is no longer
with libjpeg7. So set it explicitly. Bug #588740.
2009-11-05 10:35:17 -05:00
Alexander Larsson
76cadc9d3a Don't unnecessarily clear windows with no exposure mask set
When we just invalidate some area from the app we don't need to clear
windows with no exposure mask, because that wouldn't have happened pre-csw
anyway. Additionally we can avoid such clearing for native windows in cases
where the xserver already did the clearing like on exposes or when resizing
toplevels.

This means we don't fully redraw a GtkSocket when it resizes, thus
avoiding flicker in gnome-mplayer as reported in this bug:
https://bugzilla.gnome.org/show_bug.cgi?id=598050
(cherry picked from commit 9e51c10edc)
2009-11-05 13:58:35 +01:00
Alexander Larsson
ace51e1426 Document clears_as_native and make the name more descriptive
(cherry picked from commit 9ae0d9a44f)
2009-11-05 13:58:30 +01:00
Alexander Larsson
92efb23b4b Add supports_native_bg to GdkWindowImpl
Backends that support native window background setting (and that clears
new window areas to this color/pixmap) should set this to true.

Currently only X11 supports this.
(cherry picked from commit 39993f147f)
2009-11-05 13:58:24 +01:00
Alexander Larsson
db8a34f16a Don't unnecessarily expose areas copied by native windowing system
When moving or scrolling a window with native children, there is no
need to expose the areas that are copied by the windowing system
as part of moving/resizing the native windows anyway.
(cherry picked from commit 4cd5c98942)
2009-11-05 13:58:08 +01:00
Alexander Larsson
8954a7daf5 Only send exposes on unmap if window really was unmapped
Exposing when you hide a hidden window is just a waste of time.
(cherry picked from commit a299797883)
2009-11-05 13:58:04 +01:00
Alexander Larsson
a68e02b7c7 Flush outstanding stuff when clearing directly on a window
Clearing will directly modify the contents of the window, so we need
to flush any outstanding moves or double-buffering.
(cherry picked from commit 8c1ea38d84)
2009-11-05 13:57:59 +01:00
Adrian Johnson
9d43f0fff0 Take printer margins into account on Windows
Fixes bug #381371.
2009-10-27 12:29:37 +02:00
Dumitru Mișu Moldovan
a21ab9d169 Updated Romanian translation 2009-10-26 22:48:18 +02:00
Dumitru Mișu Moldovan
51a3630acb Updated Romanian translation 2009-10-26 22:28:45 +02:00
Matthias Clasen
90f7a1ccfd Fix issues with symbolic colors in rc file parsing
Don't recreate the settings color hash every time, repopulate it
instead. This avoids invalidating the references held by RcContexts.
2009-10-25 23:53:50 -04:00
Matthias Clasen
d56f5a843d Fixes for the compose-parse.py script
Several fixes by Ray Strode and Peter Hutterer to make compose-parse.py
work with the current X.org Compose file.
2009-10-25 23:53:41 -04:00
Matthias Clasen
69a93aaf9c Update compose sequences
This patch includes additions to the X.org Compose file from the
last year. Patch by Peter Hutterer
2009-10-25 23:53:28 -04:00
Matthew Barnes
e3b14b6652 Bug 581150 - GtkIconView tries to paint items with invalid sizes
Run gtk_icon_view_layout() if necessary before attempting to paint the
icon view items during an expose event.  This ensures all the items have
valid sizes, as some themes don't take kindly to negative dimensions.
2009-10-23 19:56:21 -04:00
Tor Lillqvist
c3bc476174 Use correct type text/uri-list for the dropped files selection
Fixes bug #599321.
2009-10-23 13:43:18 +03:00
Luca Ferretti
23eaeaf922 Add translators comments for tab labels (closes 599118) 2009-10-21 22:06:14 +02:00
Luca Ferretti
624619cba8 Minor fixes 2009-10-21 22:04:56 +02:00
Federico Mena Quintero
e7e58a5301 bgo#563010 - Fix clearing the selection in GtkFileChooserButton
Previously the filename would get re-set on the button if one cleared the selection,
as an async cancellable was not getting canceled in that case.  Patch with
contributions from Milan Crha <mcrha@redhat.com>

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-10-21 12:31:25 -05:00
Matej Urbančič
69b525c6ff Updated Slovenian translation 2009-10-21 13:54:04 +02:00
Marek Kasik
ac6f5d27e6 A small correction of previous commit
Correct of a typo.
2009-10-19 22:28:40 +02:00
Leonid Kanter
f822714f98 Updated Russian translation 2009-10-19 19:35:13 +03:00
Leonid Kanter
15cdac8725 Updated Russian translation 2009-10-19 19:33:41 +03:00
Leonid Kanter
38f07a7a22 Updated Russian translation 2009-10-19 19:33:23 +03:00
Matthias Clasen
ebcffee813 Correct a small oversight
When changing themes, we also need to update the box spacing of
tooltips.
2009-10-18 20:39:43 -04:00
Tor Lillqvist
b3c11e8cf0 Use correct size for root window with multiple monitors
The root window width and height have already been correctly
initialised in _gdk_root_window_size_init() to cover all monitors, so
don't incorrectly re-initialise using GetSystemMetrics(SM_C[XY]SCREEN)
which only gives the size of the primary monitor anyway. (See MSDN.)

This fixes at least gdk_screen_get_{width,height}() which indirectly
affects at least the positioning of combo box pop-up menus on multiple
monitors.
2009-10-18 14:43:06 +03:00
Tor Lillqvist
975f101095 Delete a couple of leftover commented-out lines 2009-10-18 14:42:54 +03:00
Tor Lillqvist
28520601d5 Add missing newline to debugging output 2009-10-18 14:42:36 +03:00
Tor Lillqvist
880bec1717 Delete unused leftover static function 2009-10-18 12:11:49 +03:00
Tor Lillqvist
e341a8c5f9 More meaningful debugging output in gdk_win32_window_get_root_coords 2009-10-18 12:11:26 +03:00
Tor Lillqvist
1516e6205b Remove unused variables and static functions 2009-10-18 11:53:27 +03:00
Tor Lillqvist
6e6c4813b2 Correct function names in debugging output 2009-10-18 11:53:03 +03:00
Matthias Clasen
ff765f478d Don't omit GTK_ICON_SIZE_DIALOG 2009-10-18 02:09:08 -04:00
Matthias Clasen
a30b59229f Fix a problem in GtkImage size allocation
When GtkMisc padding is set on an image, the optimization for only
recalculating size after a clear() breaks, since the requisition is
not (0, 0). We need a separate 'need_calc' flag.
2009-10-18 01:39:22 -04:00
Matthias Clasen
e47847baac Bump version 2009-10-17 00:54:44 -04:00
Matthias Clasen
a8b26a8e87 2.18.3 2009-10-17 00:52:44 -04:00
Matthias Clasen
54856967db Updates 2009-10-16 21:52:07 -04:00
Rodrigo L. M. Flores
d5d2e34b2f Updated Brazilian Portuguese translation 2009-10-16 17:33:54 -03:00
Eitan Isaacson
1f91789951 Explicitly set the accessible name of GtkToolButton.
GAIL is not able to retrieve the correct button name alone, so it must be set in gtktoolbutton.c

https://bugzilla.gnome.org/show_bug.cgi?id=597596
2009-10-16 10:38:56 -04:00
Ivar Smolin
6c18744be1 Updating Estonian translation 2009-10-16 11:46:02 +03:00
Ivar Smolin
579d725947 Updating Estonian translation 2009-10-16 11:42:53 +03:00
David Planella
8ae3b32538 Updated Catalan translation from the master branch 2009-10-15 20:39:49 +02:00
David Planella
5b3929efda Updated Catalan translation 2009-10-15 20:39:11 +02:00
David Planella
8b9a272949 Updated Catalan translation from the master branch 2009-10-15 20:36:49 +02:00
David Planella
75933df105 Updated Catalan translation 2009-10-15 20:35:58 +02:00
Tor Lillqvist
97e9ee336b Don't use XP themes until they work 2009-10-13 21:32:04 +03:00
Tor Lillqvist
07e073bd7f Don't include gdkwin32.h when testing Objective-C++
Fixes bug #594644. If somebody actually some day needs to include
gdkwin32.h from an Objective-C++ program something needs to be done.
2009-10-09 14:34:41 +03:00
Matthias Clasen
b7be3e521a Make selecting the last character work again
This broke when I added link support. git bisect helped to track it
down.
2009-10-09 07:12:01 +02:00
Tor Lillqvist
d3eaae3a35 Create and install gtk-update-icon-cache.exe.manifest to avoid UAC 2009-10-08 15:40:45 +03:00
Tor Lillqvist
0ba0899b10 Don't ignore SIGPIPE unless it exists 2009-10-08 15:15:35 +03:00
Tor Lillqvist
70f6d0d4cc Fix the GDI+ gdk-pixbuf loader
Should fix bug #552678. Patch by Dominic Lachowicz, based on a clueful
response from Jason Copenhaver on Albeto Ruiz's blog
http://aruiz.typepad.com/siliconisland/2009/08/dear-lazyweb-gtk-need-gdi-help.html
2009-10-08 13:15:56 +03:00
Matthias Clasen
4ee18f8b94 Bump version 2009-10-05 17:44:25 -04:00
Matthias Clasen
68f25328e4 2.18.2 2009-10-05 17:42:00 -04:00
Matthias Clasen
c29e8f6cff Updates 2009-10-05 16:43:37 -04:00
Alexander Larsson
c5d0861179 Don't request window sizes with zero width or height
Zero width/height is unsupported and will magically be turned into one.
For instance, gtk_widget_size_allocate() will eventually do this magic
on the value stored in widget->allocation.

However, if we don't do this magic conversion early, then the value
returned from gtk_window_compute_configure_request() will not be
comparable with whats stored in widget->allocation. (I.E. they will
differ if width or height are zero).

This is dangerous, as we do such a comparison in gtk_window_move_resize().
Currently a change from e.g. 10x1 (current allocation) to 10x0 (new size)
will be expected to produce a ConfigureNotify, when it actually won't,
thus never thawing the frozen toplevel.

Fixes bug #588059
2009-10-05 22:07:06 +02:00
Alexander Larsson
786b589d95 Fix up _gdk_windowing_window_at_pointer coordinate reporting
We need to do a final XQueryWindow to get the coordinates inside the
windows rather than in the parent window.

This fixes bug #597386, "Cannot click buttons more than once...", which
failed due to the grab tracking stuff getting the wrong coordinates as
per the above.
2009-10-05 11:41:50 +02:00
Matthias Clasen
4581432387 Plug a memory leak
Valgrind reported a leak of regions from gdk_window_process_updates_internal.
2009-10-04 22:35:12 -04:00
Takayuki KUSANO
05ded28d7d Updated Japanese translation 2009-10-03 18:34:58 +09:00
Luca Ferretti
c3b22ee7c4 Updated Italian translation 2009-10-03 09:20:44 +02:00
Sebastian Dröge
59177b1932 Bug 596959 - DirectFB backend compilation broken with changes from 2.18.0 to 2.18.1
Fix compilation of the DirectFB backend after internal API changes of GDK.
2009-10-02 07:39:34 +02:00
Pascal Terjan
f3013bf6ed Call XReconfigureWMWindow with proper screen
Thanks gcc :

gdkwindow-x11.c:1731: warning: passing argument 3 of
'XReconfigureWMWindow' makes integer from pointer without a cast
/usr/include/X11/Xlib.h:1871: note: expected 'int' but argument is of
type 'struct GdkScreen *'

Signed-off-by: Pascal Terjan <pterjan@mandriva.com>
2009-10-01 18:36:43 +02:00
Matthias Clasen
97d15954ad Move SIGPIPE suppression to gtk_init and document it
Some people were unhappy with doing it deep inside the lpr print
backend at an unpredictable time, and SIGPIPE is almost never
wanted anyway.
2009-10-01 11:45:28 -04:00
Miloš Popović
42ad005847 Updated Serbian translation 2009-10-01 01:23:06 +00:00
Matthias Clasen
3b39aacd29 Bump version 2009-09-30 18:02:46 -04:00
Matthias Clasen
df3775821d 2.18.1 2009-09-30 18:00:21 -04:00
Matthias Clasen
121868f660 Updates 2009-09-30 16:28:02 -04:00
Petr Kovar
724b2bae64 Updated Czech translation 2009-09-30 21:23:10 +02:00
Adrian Johnson
7c3e8130c4 Correct the orientation of landscape pages
The convention for landscape pages, and required by PostScript
Language Reference Manual, is for landscape printing to rotate user
space 90 degrees counterclockwise. Part of bug 596423
2009-09-30 12:47:55 -04:00
Adrian Johnson
4261efda2b Emit PageOrientation DSC comment into PostScript print output
The PageOrientation DSC comment tells PostScript viewers such as gv or
evince the orientation to use when displaying the page. Part of bug 596423
2009-09-30 12:46:58 -04:00
Marek Kasik
dd52987d1f Speed up printer listing in the print dialog
Use shorter timeout for connection testing to avoid A 3-6 second
delay before the printers appear. Bug 594643
2009-09-30 12:43:40 -04:00
Gabor Kelemen
14f3006d12 Updated Hungarian translation 2009-09-30 16:49:55 +02:00
Kristian Rietveld
a4145bfeef Bug 588449 - DnD doesn't work on GDK/Quartz
Patch from Paul Davis.  This gets the basics of drag and drop properly
working on Mac OS X.
2009-09-30 15:07:37 +02:00
Christian Dywan
31771cc640 Add a note about tooltip theming
This should help to reduce the amount of confusion about how to
make a tooltip window appear like a tooltip. Bug 596080.
2009-09-30 08:45:30 -04:00
Kristian Rietveld
2518fbdc02 Fix compile warning in defaultvalue test 2009-09-30 13:09:22 +02:00
Kristian Rietveld
dc04e012cf Ignore certain GtkSettings in defaultvalues unit test
Like the other GtkSettings already registered, these are influenced from
the outside and cannot be properly tested.  The defaultvalues test
passes again now.
2009-09-30 13:05:33 +02:00
Kristian Rietveld
28d56cbbda Use boxed accessors for setting and retrieving cursor property 2009-09-30 13:00:28 +02:00
Kristian Rietveld
77fc6e3539 Bug 596580 - Blank rows in entry autocompletion
gtk_tree_model_build_level() always needs to emit row-inserted when
requested, this should not depend on whether the level has a parent
level or a virtual root, which is a check whether or not we need to
reference the node in the child model.  Furthermore, we also need
to emit row-has-child-toggled after row-inserted when appropriate.

When gtk_tree_model_filter_row_changed() pulls in the root level, it
must request build_level() to emit signals for this.  The refilter
function uses row_changed to process the changes, so build_level() in
the first call to row_changed() might pull in multiple new nodes in this
scenario, for all of these signals need to be emitted.  Of course,
build_level() will then also emit the signals for the node row_changed()
is processing, we should not emit a duplicate signal, this is now
accounted for.

Add a unit test for this.  For this small functionality to block the
row-changed signal has been implemented, so that we can simulate calls
to the refilter function using the current visible column setup.
2009-09-30 10:25:48 +02:00
Kristian Rietveld
3a69f6772b Pretty print non-matching signals in filter model test suite 2009-09-30 10:25:48 +02:00
Daniel Nylander
efd2814477 Updated Swedish translation 2009-09-30 09:58:00 +02:00
Thomas Jaeger
35845f1efe Interpret min_value == max_value correctly
https://bugzilla.gnome.org/show_bug.cgi?id=588649

Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>
2009-09-30 09:21:12 +02:00
Thomas Jaeger
70bd23537f Select for DeviceStateNotify
Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=588649
2009-09-30 09:21:11 +02:00
Thomas Jaeger
0178ebf739 Keep track of axis values
https://bugzilla.gnome.org/show_bug.cgi?id=588649
2009-09-30 09:21:10 +02:00
Jürg Billeter
ee25051f96 Support tracker 0.7
Make GtkSearchEngineTracker work with libtracker 0.6 and 0.7.
See bug 596081.
2009-09-30 00:43:51 -04:00
Xan Lopez
f0f39c34f8 Update last_window only when needed
_gtk_tooltip_handle_event, which is called for many events in the GTK+
main loop, calls gtk_tooltip_set_last_window, which keeps a weak
reference to the last window we passed through. If the window being
set is the same than the last one there's really no need to update our
weak reference, so add a check for that and exit early.
2009-09-29 23:45:03 -04:00
Thomas Jaeger
67728ac004 Filter out events that the current window didn't select for
Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=588649
2009-09-29 14:44:25 +02:00
Thomas Jaeger
51f2a99096 Always select all XInput motion events
Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=588649
2009-09-29 14:44:23 +02:00
Thomas Jaeger
acdecb6aa4 Report XInput button motion events until all buttons are released.
Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=588649
2009-09-29 14:44:21 +02:00
Thomas Jaeger
2635fb75c6 XInput allows up to 255 buttons
Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=588649
2009-09-29 14:44:18 +02:00
Thomas Jaeger
abf7742beb Refactor _gdk_input_other_event
Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=588649
2009-09-29 14:44:17 +02:00
Thomas Jaeger
bd51d930e8 Use strstr instead of g_strrstr.
Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>
2009-09-29 12:58:52 +02:00
Alexander Larsson
6fef640deb Only select for button and pointer event on toplevels
These event types propagate up the hierarchy anyway, so this means
we avoid setting it unnecessarily. This is especially important
for button press event, since only one client can select for this
on each window, causing X errors if two clients do it.
2009-09-29 12:58:42 +02:00
Claude Paroz
5a39fdbba1 Updated French translation 2009-09-29 12:03:40 +02:00
Amitakhya Phukan
987b45da7b Updating corrected Assamese translations. 2009-09-29 11:19:07 +05:30
Matthias Clasen
894e11e447 Always initialize out params
This was causing a crash in the appearance capplet, reported in
bug 596345.
2009-09-28 12:41:29 -04:00
Thomas Jaeger
7d196b3939 Improve detection of input device source type
This detection code is not 100% reliable, but it should fare much better
than the current code, which just compares the device name to a fixed
set of strings.  Many applications depend on erasers being recognized
reliably, so we start by checking for a device name containing the
substring 'eraser'.

Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>
2009-09-28 16:08:42 +02:00
Alexander Larsson
e81501ebea Sent button events don't cause passive grabs
Don't track sent button events as causing or removing
passive grabs.
2009-09-28 15:29:37 +02:00
Alexander Larsson
739121dee0 Remove unused grab_one_pointer_release_event var
We don't use this anymore, so just remove.
2009-09-28 15:26:19 +02:00
Alexander Larsson
5ebb32d1ff Extend _gdk_windowing_window_at_pointer to be able to get toplevels only
This has two advantages:
1) In many backends, this is faster as we can terminate the window
hierarchy traversal earlier
2) When used in gdkdisplay.c::get_current_toplevel() to get the
current toplevel that has the pointer we now correctly return
a toplevel with the pointer in it where the pointer is inside
some foreign subwindow of a toplevel window.

The second advantage fixes some bugs in client side event generation
when the pointer is inside such a foreign child window.
2009-09-28 15:21:54 +02:00
Cody Russell
fe188a18f3 Bug 596494 - New property "cursor" in 2.18's GdkWindow with wrong type?
Use a boxed paramspec with GDK_TYPE_CURSOR instead of a pointer paramspec.
2009-09-27 14:37:19 -05:00
Kristian Rietveld
f2d9f5a9e6 Remove unused variable 2009-09-27 13:44:10 +02:00
Kristian Rietveld
2f782de1b7 Bug 596012 - popup menu position is horribly off on gdk quartz with ...
Based on first patches by Christian Hergert.  Change
screen_get_monitor_geometry() so that it translates the layout of the screens
from Cocoa layout to GDK layout.  In Cocoa, the screen locations
are specified in Cocoa geometry, as well as that GDK uses a different way
to place individual monitors in the root window.  For now only monitors
that are laid out horizontally are supported (see the FIXMEs in the source),
in bug 596238 we will track future work to get things fully right.

Modify _gdk_quartz_window_get_inverted_screen_y() to take the differences
in screen layout between Cocoa and GDK into account.  Also this function
is subject to future work.
2009-09-27 13:44:10 +02:00
Matthias Clasen
f506752aff Handle child widgets correctly with multiple views
This was broken by an RTL fix in April.
2009-09-27 00:14:54 -04:00
Christian Hergert
17130a8ec9 Bug 517394 - Native resize grip steals button release ...
Explicitly handle resizing by leaving all events in the lower right 15x15
corner to Cocoa, if the window shows a resizing indicator.  Some
applications may have widgets allocated in this area.  Generally, these
widgets are likely larger than 15x15 so they can still be hit.  Often
scroll bars are found in this area and these can also be manipulated by
other means.  Since this is the only way of resizing windows on Mac OS X,
it is too important to keep it broken.
2009-09-25 21:52:13 +02:00
Kristian Rietveld
785e55f87d Bug 596250 - Gdkcursor-quartz.c doesn't implement GDK_BLANK_CURSOR
Support GDK_BLANK_CURSOR.  Patch by John Ralls.
2009-09-25 18:51:55 +02:00
Kristian Rietveld
cdec2caaf3 Send a motion-notify when a (new) main window became active
This motion-notify even will make sure that things like highlights are
set up correctly now that the window has become active.
2009-09-25 18:51:54 +02:00
Alexander Larsson
3bcf8b39fb On pointer grab request native events needed for event emulation
When we grab the pointer we need to request more events than what is
specified, otherwise our event emulation stop working and you won't
e.g. get crossing event unless you specified motion event mask.
2009-09-25 11:28:26 +02:00
Jorge González
f8aba14714 Updated Spanish translation 2009-09-25 08:16:56 +02:00
Ivar Smolin
06c208f8f1 Updating Estonian translation 2009-09-25 07:23:11 +03:00
Mario Blättermann
cdba018fe9 Updated German translation 2009-09-24 19:41:16 +02:00
Alexander Larsson
afc19eb4a7 Send expose events on foreign windows
F-Spot needs this as it draws on a foreign (screensaver) window, which
used to work.

I believe this is safe, because in all typical cases the expose
mask will not be set, so we won't do anything, and its what we used to
do.
2009-09-24 16:48:04 +02:00
Antón Méixome
402d60e5b4 Updated Galician Translation 2009-09-24 15:44:12 +02:00
Marek Kasik
a3e0766218 Add support for 'auth-info' attribute to the CUPS backend
Check for 'auth-info-required' attribute from printer attributes to
find out whether an authentization of user is needed.
Change password dialog of print backend to be able to require informations
requested thru 'auth-info-required' (#566522).
2009-09-24 15:34:56 +02:00
Matej Urbančič
9439a7ee0e Updated Slovenian translation 2009-09-24 12:46:51 +02:00
Ivar Smolin
c8f06be920 Updating Estonian translation 2009-09-24 13:28:31 +03:00
Gabor Kelemen
e1a47f4f43 Updated Hungarian translation 2009-09-24 12:26:34 +02:00
Jorge González
bde1767f8d Updated Spanish translation 2009-09-24 10:23:00 +02:00
Philip Withnall
29b6013e17 Updated British English translation 2009-09-23 23:12:50 +01:00
Philip Withnall
fc3f46856b Updated British English translation 2009-09-23 22:03:05 +01:00
Daniel Nylander
2c4d706350 Updated Swedish translation 2009-09-23 22:15:34 +02:00
Mario Blättermann
ac2ecf64bb Updated German translation 2009-09-23 21:39:40 +02:00
Claude Paroz
a2c2427562 Updated French translation 2009-09-23 21:01:38 +02:00
Marek Kasik
5f4915f624 Don't hang print dialog when remote CUPS printer is not available
This patch tests availability of remote host before getting ppd file
for selected printer (#586207). It also adds a state message for
failure of getting details.
2009-09-23 14:35:26 +02:00
Matthias Clasen
915957fca3 Bump version 2009-09-23 00:08:43 -04:00
Matthias Clasen
b841251ca7 2.18.0 2009-09-23 00:02:47 -04:00
Matthias Clasen
5a7dc8cc71 Updates 2009-09-22 22:19:06 -04:00
Matthias Clasen
d611674a55 Bump version to 2.18.0 2009-09-22 21:00:54 -04:00
andreas
7af7cefa2d Updated Afrikaans translation 2009-09-22 20:11:22 -03:00
David Planella
6546ef0ffa Updated Catalan translation 2009-09-22 20:08:40 +02:00
Rajesh Ranjan
4c0418c9a6 hindi update 2009-09-22 15:30:33 +05:30
Mart Raudsepp
0633ba0163 Fix more GtkEntry Since tags.
progress-border and invisible-char style properties had wrong amount
of colons for gtk-doc (signal markup instead of properties), so the
Since tags didn't seem to get picked up.
GtkEntry:invisible-char also had a wrong Since: 2.22, fixed to 2.18.
2009-09-22 11:25:28 +03:00
Mart Raudsepp
9ea2bfe73f Add missing Since: 2.16 for gtk_entry_[set/get]_icon_drag_source 2009-09-22 11:25:28 +03:00
Mart Raudsepp
797b4c8003 Fix a typo
previe => preview
2009-09-22 11:25:28 +03:00
Mart Raudsepp
9eeda3e21d GtkImage docs: Fix typo - widgte => widget 2009-09-22 11:25:28 +03:00
Mart Raudsepp
275001badc Pack the struct better, should save four bytes per GtkIconView 2009-09-22 11:25:28 +03:00
Luca Ferretti
d42d61ac73 Updated Italian translation 2009-09-21 22:43:03 +02:00
Kristian Rietveld
3043155796 Bug 550939 - GtkFileChooser listbox does not refresh selection
Make the quartz backend support the new queued translations.  We do this
by keeping our own copy of the region that has been set to need display.
Using this region we can intersect by the given area, translate this and also
set needs display for the resulting area.
2009-09-21 20:41:35 +02:00
Carlos Garnacho
bfc88240b4 Always report XInput events to the grab window if any.
The grab window should be the first option to send events to, else we may
get unpaired events, making display->ignore_core_events go crazy.

https://bugzilla.gnome.org/show_bug.cgi?id=588649
2009-09-21 20:04:22 +02:00
Carlos Garnacho
d37268c60f Block extended events to windows that didn't select them.
Now XSelectExtensionEvent() is called on the native window, so there
may be virtual windows inside that shouldn't receive extended events.

https://bugzilla.gnome.org/show_bug.cgi?id=588649
2009-09-21 20:04:22 +02:00
Carlos Garnacho
13c258f891 Fix x/y coordinates for extended events.
Extended events were being reported to virtual windows without taking into
account the position of the virtual window inside the native one.

https://bugzilla.gnome.org/show_bug.cgi?id=588649
2009-09-21 20:04:21 +02:00
Cody Russell
cb5e659ae4 revert some changes in directfb backend that broke API 2009-09-21 11:32:37 -05:00
Kristian Rietveld
95cb1cc86c Sensitivity event box should only be toggled if cell view is non-NULL 2009-09-21 12:59:44 +02:00
Christian Dywan
4ba1e08123 Restore initializing settings sizes, which was accidentally removed 2009-09-21 12:40:15 +02:00
Kjartan Maraas
39dec4e576 Updated Norwegian bokmål translation. 2009-09-21 11:58:21 +02:00
Matthias Clasen
508a44a0df Whitespace fixes 2009-09-20 22:53:58 -04:00
Matthias Clasen
5ed8cf50b8 Don't dereference a NULL error
This was pointed out in bug 595790.
2009-09-20 22:39:13 -04:00
Rajesh Ranjan
2e8b6757b1 maithili update, translated by Sangeeta Kumari 2009-09-20 12:43:35 +05:30
Rajesh Ranjan
e25ed50a44 maithili update, translated by Sangeeta Kumari 2009-09-20 12:41:52 +05:30
Chao-Hsiung Liao
cf5cc07c35 Updated Traditinal Chinese translation (Hong Kong and Taiwan) 2009-09-19 21:02:22 +08:00
Cody Russell
57fa8e8124 Move '-x objective-c++' from CXXFLAGS to CPPFLAGS 2009-09-18 22:37:22 -05:00
Owen Taylor
5f126bec3a Don't focus unmapped radio buttons
With Bug 302240, a check was added to avoid keynav to unrealized
radio buttons in the group, but that's not the right check - the
check should be on MAPPED instead, since a widget can be realized
even if it, or a parent, is hidden. Bug 595599
2009-09-18 16:37:43 -04:00
Dumitru Mișu Moldovan
aa43f80423 Updated Romanian translation 2009-09-18 22:57:47 +03:00
Christian Kirbach
0a39beedc9 Updated German translation 2009-09-18 21:38:06 +02:00
Dumitru Mișu Moldovan
921355f998 Updated Romanian translation 2009-09-18 22:34:21 +03:00
Luca Ferretti
3a3926c5c3 Updated Italian translation 2009-09-18 12:40:24 +02:00
Manoj Kumar Giri
327d2095ed Upadated Oriya Translation 2009-09-17 22:14:59 +05:30
Manoj Kumar Giri
9050d10957 Upadated Oriya Translation 2009-09-17 19:03:58 +05:30
Michael Natterer
659776ce35 Fix gdk_device_get_history() for the core pointer
When filtering out the events for "window" from the events we got for
our "impl_window", don't forget to adjust the returned number of
events because it might be smaller than what XGetMotionEvents has
returned, and free coords we allocated too much. Also if we filtered
away *all* events, return FALSE and get rid of the allocated history
entirely. Together fixes all sorts of mishehavior when painting in
GIMP, from coords going wild to plain crashes and infinite loops.
2009-09-17 11:38:14 +02:00
Maxim V. Dziumanenko
8251d6da8a Added Ukrainian translation 2009-09-16 16:29:10 +03:00
Maxim V. Dziumanenko
6e307ac532 Added Ukrainian translation 2009-09-16 16:28:29 +03:00
Maxim V. Dziumanenko
62b5b5fca2 Added Ukrainian translation 2009-09-16 16:01:56 +03:00
Matej Urbančič
ac1b35895f Updated Slovenian translation 2009-09-16 14:11:55 +02:00
Matej Urbančič
24a3172c10 Updated Slovenian translation 2009-09-16 14:11:12 +02:00
Djavan Fagundes
cd709a074a Corrected a typo in Brazilian Portuguese translation 2009-09-16 08:17:03 -03:00
Manoj Kumar Giri
46f369e951 Upadted Oriya Translation 2009-09-16 16:17:33 +05:30
Runa Bhattacharjee
6406f64e12 Updated Bengali India Translations 2009-09-16 16:07:29 +05:30
Marek Kasik
f6ed1487bd Let GTK+ handle SIGPIPE signal itself when printing with lpr
When a SIGPIPE signal is raised during printing with lpr,
application should not be killed by the signal but a standard
error-workflow should be performed (bug #503776).
2009-09-16 09:59:56 +02:00
Kristian Rietveld
d797dcc4dd Assign the size of the screen to the root window
On startup, the root window got assigned the size of the main screen.
But, the GdkScreen has the width of all screens/monitors connected to the
machine.  Change this so that in _gdk_windowing_window_init, we assign
the width/height of all monitors to the root window width, height.
Should fix bug 594738.
2009-09-16 08:48:49 +02:00
Kristian Rietveld
cf80feb3dd Do not test the event mask of implicit grabs
The quartz backend simulates the semantics of XGrabPointer, as a part of
this it checks the event mask of the grab.  However, implicit grabs on X
do not go through XGrabPointer and thus the quartz backend should not check
the event mask for these.  This fixes various "the UI got stuck" cases.
2009-09-16 08:48:49 +02:00
Amitakhya Phukan
e9d732bde7 Updating Assamese translations. 2009-09-16 11:41:07 +05:30
Amitakhya Phukan
3086e702d2 Updating Assamese translations 2009-09-16 11:35:58 +05:30
Sweta Kothari
57937268d9 Updated Gujarati Translations 2009-09-16 10:50:38 +05:30
Sandeep Shedmake
19966510a0 Updated Marathi Translations 2009-09-16 10:35:02 +05:30
Sandeep Shedmake
ec36494508 Updated Marathi Translations 2009-09-16 10:34:56 +05:30
Manoj Kumar Giri
b92c788dba Upadted Oriya Translation 2009-09-15 19:31:07 +05:30
Alexander Larsson
0ecd87fb78 Respect grab event mask for crossing events
In the case of a non-owner_events grab, use grab->event_mask rather
than the window even mask to decide whether to deliver the event
or not.
2009-09-15 14:40:35 +02:00
Runa Bhattacharjee
142d59904b Updated Bengali India Translations 2009-09-15 17:15:22 +05:30
Manoj Kumar Giri
d937bd7037 Upadted Oriya Translation 2009-09-15 14:50:19 +05:30
Manoj Kumar Giri
fbcb382df3 Upadted Oriya Translation 2009-09-15 13:15:50 +05:30
Runa Bhattacharjee
ff47468018 updated Bengali India translation 2009-09-14 23:26:44 +05:30
Michael Meeks
02b102cbbc fix whitespace error 2009-09-14 15:34:43 +01:00
Michael Meeks
db88f084bc fix race between fetching owner of composit selection, and
registering as a listener for changes; bug#594913
2009-09-14 15:33:59 +01:00
Alexander Larsson
7ab7ffa542 Automatically flush window when doing non-double-buffered expose
Applications using non-double-buffered drawing using cairo (e.g. Abiword)
can draw directly to the window using cairo and thus manage to avoid
the automatic flushing of outstanding moves. This can cause redraw
inconsistencies like bug 593507.

We fix this by always flushing when exposing non-double-buffered widgets.
2009-09-14 16:07:43 +02:00
Alexander Larsson
cfeba9c389 Make gdk_window_flush public
We need to call this from Gtk+, and its concievable that some other
app doing weird stuff could have a use for it.
2009-09-14 16:07:25 +02:00
Alexander Larsson
f473242e19 Better handling of window hierarchy changes from inside expose handler
If we move, resize or otherwise change a window from inside a (double
buffered)  expose handler we can run into issues with double buffered
paints that have already been ended but have not yet been commited
to the window from the implicit paint pixmap.

For instance, any copies of source regions due to a window scroll need
to take these into account, and any operation that causes some drawing at
a destination covered by the implicit paint region would be overdrawn
when the implicit paint is ended.

So, before we do any window-hierarchy changing operation while an implicit
paint is in effect we flush all moves and already commited paints.
2009-09-14 13:52:40 +02:00
Alexander Larsson
6d84fcab76 Handle expose events moving or resizing windows
When a window is moved or resized from a double-buffered expose handler
we can't really just copy the window region around, as the window
will be overdrawn with the double buffered region when the expose returns.

Instead we remove all regions with outstanding implicit paints from the
region to be copied and just mark this area as invalid to be redrawn
later.

This fixes bug 594880.
2009-09-14 13:52:40 +02:00
Alexander Larsson
2d2dc2c7e9 Factor out impl_window_add_update_area() to a function 2009-09-14 13:52:40 +02:00
Alexander Larsson
130a7743e3 Don't reenter gdk_window_process_updates_internal
Its not correct for recurse gdk_window_process_updates_internal, as
the outer instance will overdraw the inner. So, protect against
gdk_window_process_updates() being called while in an expose
handler.

This shouldn't be a repaint problem, as eventually the idle handler
will cause the updates to be processed.
2009-09-14 13:52:40 +02:00
Alexander Larsson
6716d46393 Bail out of window move/resize early if no change
This is not all that uncommon in size_allocate, so we want
to optimize this case.
2009-09-14 13:52:40 +02:00
Matthias Clasen
f10f6b8b0c Mention thread-safety issues 2009-09-13 23:32:46 -04:00
Matthias Clasen
8f16541d93 Fix gdk_display_beep
Since XBell() seems broken, just call XkbBell().
2009-09-13 23:16:44 -04:00
Kjartan Maraas
618764c1bb Update Norwegian bokmål translation. 2009-09-14 00:22:42 +02:00
Kenneth Nielsen
e7fa16281a Updated Danish translation 2009-09-13 02:52:10 +02:00
Bruce Cowan
93e379818c Updated British English translations 2009-09-12 19:27:38 +01:00
Aron Xu
3ce155580a Updated Simplified Chinese translation. 2009-09-12 23:59:39 +08:00
Aron Xu
1c45f32c9b Updated Simplified translation. 2009-09-12 23:43:04 +08:00
Vincent Untz
83719cbb90 Fix warning about pointer/int confusion
https://bugzilla.gnome.org/show_bug.cgi?id=594679
2009-09-12 13:23:09 +02:00
Ask H. Larsen
63742b3162 Updated Danish translation 2009-09-12 03:20:20 +02:00
Tor Lillqvist
e9f6b93ec1 Parse libtoolize --version more carefully
Some recent versions of libtoolize output a version blurb like:
  libtoolize (GNU libtool 1.3110 2009-07-01) 2.2.7a
Don't get confused by the numbers inside the parens.
2009-09-12 01:29:52 +03:00
Reinout van Schouwen
8c1f50cf14 Updated Dutch translation 2009-09-11 22:36:58 +02:00
Matthias Clasen
24df69b283 Add a note about tooltip limitations
Apparently Windows only shows the first 64 characters of tooltips
on statusicons. Bug 594600.
2009-09-11 12:47:32 -04:00
Kostas Papadimas
f5e2b3f971 Updated Greek translation. 2009-09-11 19:27:03 +03:00
Alexander Larsson
e1554d8466 Don't support the old handling of zero height/width in gdk_window_clear_area
We used to handle zero height/width specially in the non-double buffered
case due to the weird behaviour of XClearArea in this case. However
this is undocumented, incompatible with what happens on double-buffered
drawing, and just not a good API. So, we drop this behaviour, having
fixed gtkclist.c which used this.
2009-09-11 15:21:43 +02:00
Alexander Larsson
0df4283574 Don't use magic zero height/width argument to gdk_window_clear_area
This is an undocumented feature that we stopped supporting, and
anyway it likely only ever worked on X anyway.
2009-09-11 15:08:14 +02:00
Ani
0a46d331eb Updated Malayalam Translations 2009-09-11 12:08:06 +05:30
Ani
b4a5c05a25 Updated Malayalam Translations 2009-09-11 12:07:41 +05:30
Mario Blättermann
417776c348 Updated German translation 2009-09-10 21:06:15 +02:00
Matthias Clasen
d497e8ed74 Mention gdk_window_restack
It is probably worth mentioning this function by name, since we've
added it explicitly to easy porting...
2009-09-10 13:53:28 -04:00
Matthias Clasen
d409cf2bf3 Add more hints
Mention problems related to cairo and clipping.
2009-09-10 13:53:28 -04:00
Matthias Clasen
be22a62160 Cleanups
This commit removes dead code, mostly pointed out by clang.
2009-09-10 13:53:28 -04:00
Alexander Larsson
7124f5927a Don't send grab broken for implicit grabs on button release
This is how it used to work, you only get grab broken if someone
else gets a grab, or if the grabbed window gets destroyed or unmapped.
2009-09-10 19:27:45 +02:00
Alexander Larsson
c4d2c38238 Ensure recursing gdk_window_process_all_updates works
There are two issues here. First of all an ignored update didn't
use to unset update_idle which could cause all further idle repaints
to be ignored. (Bug #591583)

Secondly, if we ignore the process_all_updates we may end up not updating
the windows in update_windows unless something else triggers an update.
So, we handle this by checking for recursions and scheduling a new update
at the end of the outermost process_all_updates.
2009-09-10 13:56:54 +02:00
Gintautas Miliauskas
81334f3f96 Updated Lithuanian translation. 2009-09-10 13:46:13 +03:00
Bastien Nocera
b1d1e36855 Keysyms docs update
Mention XK_ prefixes as well.
2009-09-10 10:18:29 +01:00
Bastien Nocera
4ccd47f47e Avoid duplicate keysyms, ignore mispelled one
GDK_Select and GDK_Clear were duplicated, GDK_Calculater is
only useful for compulsive misspellers.
2009-09-10 10:16:44 +01:00
Sweta Kothari
43fbf646a8 Updated Gujarati Translations 2009-09-10 14:20:08 +05:30
Sweta Kothari
514742ac59 Updated Gujarati Translations 2009-09-10 12:57:02 +05:30
Kristian Rietveld
fef3c88e89 Unbreak GtkComboBox::button-sensitivity
Fixed the button-sensivity patch done to GtkComboBox to account for
changes in appearance (changes to the appears-as-list style property).
Also, in list-mode, the event box that has been created below the cell
view also needs to have its sensitivity updated.
2009-09-09 21:30:13 +02:00
Bastien Nocera
11898088a1 Bug 594668 - Add new Xorg keysyms
Add support for XF86keysym.h to gdkkeysyms-update.pl and
update the generated gdkkeysyms.h file for the latest sources.
2009-09-09 18:45:28 +01:00
Matthias Clasen
3dd459caea Accept "true" as a true value in printer settings
Some of the settings come directly from cups config files, which
have no case sensitivity requirement, so we should not be more
picky.  Bug 594652.
2009-09-09 11:52:07 -04:00
Matthias Clasen
aa9bb7d8e4 Deprecate gdk_event_get_graphics exposes
This function is only used in deprecated, broken widgets. Also,
fix up some of its implmentation that clang was complaining about.
2009-09-09 09:00:15 -04:00
Matthias Clasen
ebf73f4096 Remove a dead assignment
Pointed out by clang.
2009-09-09 00:53:32 -04:00
Matthias Clasen
d01dc74a85 Remove a dead assignment
Pointed out by clang.
2009-09-09 00:52:01 -04:00
Matthias Clasen
0ea5787fca Fix a typo 2009-09-09 00:03:15 -04:00
Matthias Clasen
308fade38c Make the custom paper size dialog not block the main dialog
This was causing problems in gedit, which uses window groups.
Bug 593678.
2009-09-09 00:03:14 -04:00
Kristian Rietveld
16c5339ea8 Don't access the parent level, there might not be one
Use the index instead, that can be -1.  A unit test has been added as
well.
2009-09-08 15:52:18 +02:00
Alexander Larsson
113d21801b Fix handling of window cursor wrt grabs
Even for grabs we need to recurse up to look for what cursor to use.
2009-09-08 11:48:20 +02:00
Paolo Borelli
4e78b4c7d1 One more unit test 2009-09-07 11:17:49 +02:00
Paolo Borelli
04a58d8757 Simple expander unit test 2009-09-07 09:14:21 +02:00
Kristian Rietveld
f77042aae2 Avoid recursive calls to gtk_tree_view_top_row_to_dy()
Commit 3f306a4042 made it possible for
gtk_tree_view_top_row_to_dy() to be called recursively.  (In a different
way than was already guarded for).  This caused a single test case in
the scrolling test suite to fail.  We now also guard for recursive calls at
the beginning of gtk_tree_view_top_row_to_dy().
2009-09-06 20:26:09 +02:00
Tomasz Dominikowski
3d3f8697c0 Updated Polish translation 2009-09-06 14:29:50 +02:00
Kristian Rietveld
a59c39f370 Bug 346800 - Rework sort/filter models to use indices to parents...
Rework the sort and filter models to store their reference to the parent
element as an array index instead of a pointer to an array element.
These pointers could become invalid with any array modification, whereas
indices do not.
2009-09-06 14:12:46 +02:00
Takayuki KUSANO
143b06c9d3 Update Japanese translation 2009-09-06 18:47:08 +09:00
Matthias Clasen
da00e171e7 Correct the initial event mask of the root window
This fixes bug 588455 where the panel stopped responding to Alt-F2 when
setting a transparent background.
2009-09-06 02:44:24 -04:00
Kristian Rietveld
d0051a46f7 Fix compiler warnings 2009-09-05 17:15:43 +02:00
Kristian Rietveld
855fee8f1f Fix memleak in filter model unit test
(There is one larger memleak left here, but this is a side effect of the
test case for bug 346800).
2009-09-05 17:15:43 +02:00
Kristian Rietveld
c2f6611e4b List work left to do in the filter model unit test 2009-09-05 17:15:43 +02:00
Kristian Rietveld
f483c5b7d6 Emit row-has-child-toggled when a first node becomes visible in a level
If we have a level with zero visible nodes and the first node becomes
visible in that level, then parent has just become a "real" parent node.
In such a case we need to emit row-has-child-toggled.  This only applies
to non-root levels that have a parent.  This problem was also found when
writing the unit test, the respective cases in the unit test have been
corrected.

This fixes bugs:
 Bug 372010 - Filtering not working properly
 Bug 525965 - Filtered and sorted GtkTreeView is missing rows
2009-09-05 17:15:42 +02:00
Kristian Rietveld
0c4f29e857 When the filter removes a node, it needs to remove its children too
In gtk_tree_model_filter_remove_node(), we check if the given elt has
children.  If so, this level will be freed.  This action is recursive.
2009-09-05 17:15:42 +02:00
Kristian Rietveld
bf573a1e1e Have the unit test check if the filter model emits the right signals 2009-09-05 17:15:42 +02:00
Kristian Rietveld
14c8149daf Properly handle cases where an ancestor node is invisible 2009-09-05 17:15:42 +02:00
Kristian Rietveld
bbb5bbb591 Extend filter model unit test with row-has-child-toggled testers 2009-09-05 17:15:42 +02:00
Kristian Rietveld
733e532c59 Correct handling of row-has-child-toggled signal
When a filter function is used that determines the visibility property
of a node using whether or it it has children, the state of this node
very likely changes when the filter model receives a
row-has-child-toggled signal.  Therefore, we need to handle state
changes in the row-has-child-toggled handler.
2009-09-05 17:15:42 +02:00
Kristian Rietveld
6606989019 Remove unused variable 2009-09-05 17:15:42 +02:00
Kristian Rietveld
5b766102fd More virtual root unit tests 2009-09-05 17:15:42 +02:00
Kristian Rietveld
7b1d2de75e Add a rather specially crafted test case 2009-09-05 17:15:42 +02:00
Kristian Rietveld
af73305d37 Marking nodes invisible after pulling in the root level is wrong 2009-09-05 17:15:42 +02:00
Kristian Rietveld
532eccabde Do not emit has-child-toggled when a root level node is removed 2009-09-05 17:15:42 +02:00
Kristian Rietveld
15fdf44501 Correct unfiltered test cases 2009-09-05 17:15:41 +02:00
Kristian Rietveld
18b20416e5 Check for successfull iterator retrieval 2009-09-05 17:15:41 +02:00
Kristian Rietveld
958f772c24 Refilter is required after setting visible column 2009-09-05 17:15:41 +02:00
Kristian Rietveld
2cca680c66 Correct /FilterModel/empty/vroot-show-nodes test case 2009-09-05 17:15:41 +02:00
Kristian Rietveld
d09c2ae965 Only emit row-inserted if all ancestors are visible 2009-09-05 17:15:41 +02:00
Kristian Rietveld
378a6dffce Generalize fixture setup code 2009-09-05 17:15:41 +02:00
Kristian Rietveld
b6559c31a7 Make a start with virtual root unit tests 2009-09-05 17:15:41 +02:00
Kristian Rietveld
93b29a9cff Add test cases for bugs 464173 and 529287 2009-09-05 17:15:41 +02:00
Kristian Rietveld
6f2aff35f7 Add unit test for bug 540201 2009-09-05 17:15:41 +02:00
Kristian Rietveld
81bc45ee69 Add a helper for inserting paths in the test tree store 2009-09-05 17:15:41 +02:00
Kristian Rietveld
923a6a8083 Start a testsuite for GtkTreeModelFilter 2009-09-05 17:15:41 +02:00
Matthias Clasen
05ef84e9d6 Fix fallout from automake version bump 2009-09-05 01:46:39 -04:00
Matthias Clasen
50945f0c21 Bump version 2009-09-05 00:36:49 -04:00
Matthias Clasen
e1cd3e0610 2.17.11 2009-09-05 00:35:08 -04:00
Matthias Clasen
d09d810261 Fix a typo 2009-09-04 23:27:37 -04:00
Matthias Clasen
bec0d570b0 Fix the build 2009-09-04 23:00:27 -04:00
Matthias Clasen
5c4f248ff9 Documentation additions 2009-09-04 22:53:03 -04:00
Matthias Clasen
96636bd8cd Updates 2009-09-04 22:47:59 -04:00
Matthias Clasen
d6f3af0777 Make gtk_combo_box_entry_set_text_column more forgiving
The assertions in there were unnecessarily restrictive. This has
been reported in bug 564160.
2009-09-04 22:20:28 -04:00
Matthias Clasen
6b7fef09ca Don't forget to set the client window on the slave 2009-09-04 20:34:09 -04:00
Matthias Clasen
5c14089225 Make window manager tracking work better
We were getting the new wm name with a 15 second delay, due to
some race. Reported in bug 593644.
2009-09-04 20:22:43 -04:00
Matthias Clasen
079cc21956 Avoid a segfault if license is NULL
The license field was introduced later on, so some out-of-tree loaders
may not set it. And Solaris printf() doesn't take NULL for a string...
Bug 594178.
2009-09-04 18:22:30 -04:00
Matthias Clasen
1c0ecc0380 Rework the way IM contexts are set
Add a function to obtain the effective context id, and reset the slave
only when the effective context id is different from the current context
id, when setting a client window and on focus in. This might fix
bug 593868 and bug 567124.
2009-09-04 18:09:44 -04:00
Matthias Clasen
ea98cdc164 Try again to allow newer automake 2009-09-04 15:13:09 -04:00
Matthias Clasen
8654ffd9db Revert "Add AM_PROG_CC_C_O"
This reverts commit 1606b82232.
2009-09-04 15:07:46 -04:00
Matthias Clasen
5cfe90d60c Revert "Accept automake 1.10 and 1.11"
This reverts commit 76dab7b3b7.
2009-09-04 15:07:46 -04:00
Alexander Larsson
812b3c451d Deprecate GDK_WINDOW_OBJECT and GdkWindowObject 2009-09-04 17:59:18 +02:00
Alexander Larsson
d0ac27fe5f Add function accessors for x11 window/pixmap impl 2009-09-04 17:59:17 +02:00
Alexander Larsson
0c7830aa42 Make public GDK_WINDOW_TYPE and GDK_WINDOW_DESTROYED use functions calls 2009-09-04 17:59:17 +02:00
Alexander Larsson
f64ef921da Add gdk_window_is_destroyed 2009-09-04 17:59:17 +02:00
Alexander Larsson
a10e90b799 Move _gdk_window_event_parent_of to gdkinternals.h
gdkprivate.h is in installed file and this function does not
need to be exported.
2009-09-04 17:59:17 +02:00
Matthias Clasen
76dab7b3b7 Accept automake 1.10 and 1.11
This was tested to work in bug 588788.
2009-09-04 11:53:07 -04:00
Matthias Clasen
1606b82232 Add AM_PROG_CC_C_O 2009-09-04 11:51:50 -04:00
Kristian Rietveld
a47aadb05e Protect gtk_text_view_scroll_mark_onscreen() from using invalid marks
Suggested by Paolo Borelli.
2009-09-04 17:40:12 +02:00
Kristian Rietveld
5ec80eb5ba Recalculate heights when a (new) separator func is set on GtkTreeView 2009-09-04 17:08:29 +02:00
Kristian Rietveld
dcc87f7a67 Move mark check to gtk_text_view_scroll_to_mark()
Also use a different means to check that the given mark is in the text
view's buffer.  This will also play nice with anonymous and NULL marks.
Suggested by Paolo Borelli.
2009-09-04 17:08:29 +02:00
Alexander Larsson
4adcb39f86 Ensure clip region valid before using it for emulating graphics exposures
If there is a drawable clip on it we don't want to use that.
2009-09-04 16:06:51 +02:00
Alexander Larsson
294e222fa8 Ensure gc clip region valid in _gdk_gc_update_context
There might be an old drawable clip on it, if so remove it.
2009-09-04 16:06:51 +02:00
Michael Natterer
6ee228a363 gtk_widget_set_property(): use accessors instead of setting flags
Use the newly added accessors to set the "can-focus", "can-default"
and "receives-default" properties.
2009-09-04 15:18:24 +02:00
Michael Natterer
026bea2293 gtk_widget_set_property(): use gtk_widget_set_visible()
Use the new API instead of show() and hide().
2009-09-04 14:54:13 +02:00
Michael Natterer
b81079d898 Bug 69872 - GTK_WIDGET_SET_FLAGS should be deprecated
Add gtk_widget_set_receives_default() and
gtk_widget_get_receives_default() as accessors for
GTK_RECEIVES_DEFAULT.
2009-09-04 14:50:35 +02:00
Kristian Rietveld
dc3fb714a0 Improve unsetting old buffer in gtk_text_view_set_buffer()
When unsetting the old buffer always set the buffer on the layout to
NULL.  More importantly, clear the pending scroll.  (The scroll is
handled in an idle, when not cleared an idle handler might touch the
layout later on, possibly corrupting the BTree).  Unref the buffer after
removing the selection from the clipboard, not before.  Patch merged
from maemo-gtk.
2009-09-04 14:06:59 +02:00
Kristian Rietveld
7a3d98324d Fail to scroll if the given mark is not in text view's current buffer
In gtk_text_view_queue_scroll() we need to verify if the given mark
exists in the text view's current buffer.  When not done, this can
result in corruption of the BTree data structure.  Patch merged from
maemo-gtk.
2009-09-04 14:06:58 +02:00
Kristian Rietveld
3a917a2a67 Update IM spot location before running _validate_onscreen()
Updating the IM spot location in gtk_text_view_value_changed() might
invalidate the layout, so we need to make sure that we update it before
validating the layout again.  Otherwise, the layout will be invalidated
right after validating it (possibly resulting in a failed
onscreen_validated assertion).  Patch merged from maemo-gtk.
2009-09-04 14:06:58 +02:00
Kristian Rietveld
4f219692ed Make toggle cell renderer follow insensitive state of widget
Likewise to other cell renderers, GtkCellRendererToggle now properly
follows the insensitive state of the widget requesting rendering.  It
does this by checking the state of the widget pointer, not by using
GtkCellRendererFlags (there exists an insensitive flags).  Later on, I
think we should move to using GtkCellRendererFlags and not the state of
the widget requesting rendering.  Patch merged from maemo-gtk.
2009-09-04 14:06:58 +02:00
Kristian Rietveld
6f20cf691e Propagate insensitive state to cell renderers in GtkCellView
If the cell view is insensitive, it needs to properly propagate this
insensitive state to the cell renderers using cell renderer flags.
Merged from maemo-gtk.
2009-09-04 14:06:58 +02:00
Kristian Rietveld
3f306a4042 Have tree view process exposes after adjustments have been updated
This was removed long ago by the patch in bug 101235.  On a hindsight,
all other scrollable widgets are processing exposes at this point, which
completely makes sense to me, so I am putting it back.
2009-09-04 14:06:58 +02:00
Alexander Larsson
223bcd23f7 Correct the antiexposure vs implicit paint flush race
The check for a possible implicit paint flush before queueing an
antiexposure was wrong. An implicit flush doesn't actually NULL
the implicit paint, se we have add a flag to explicitly track if
it is flushed.
2009-09-04 13:14:25 +02:00
Alexander Larsson
753f159aad Don't access region when it might be freed
Passing region into _gdk_gc_set_clip_region_internal takes ownership,
so don't use it after that. We can just as well just move the usage
above the call.
2009-09-04 13:10:35 +02:00
Alexander Larsson
587bc97d9c Fix warnings in gdk_window_restack 2009-09-04 11:08:46 +02:00
Christian Dywan
6b9a3c9057 Bug 584638 - Build of gtkupdateiconcache without NLS breaks
Wrap textdomain calls in updateiconcache.c in NLS conditionals.
2009-09-03 11:30:12 +02:00
Matthias Clasen
2f80806359 Fix the return type of gdk_selection_property_get
It returns the length of the property, not a boolean. Reported
in bug 593788.
2009-09-02 22:50:05 -04:00
Matthias Clasen
05d39e4085 Add a missing include
This was reported in bug 593606.
2009-09-02 22:14:47 -04:00
Matthias Clasen
908b6620bd Remove sincos use
It turns out to be not worth the portability pain. Bug 593877
2009-09-02 22:11:28 -04:00
Matthias Clasen
36a73586ce Fix a merge conflict 2009-09-02 21:39:36 -04:00
Matthias Clasen
4e6e46d621 Bump version 2009-09-02 21:37:47 -04:00
Matthias Clasen
781e878efb 2.17.10 2009-09-02 21:37:46 -04:00
Gabor Kelemen
e1b0e76196 Hungarian translation updated 2009-09-03 02:48:08 +02:00
Gabor Kelemen
4ab7255b0a Hungarian translation updated 2009-09-03 00:08:59 +02:00
Alexander Larsson
d5125660c1 Add test for gdk_window_restack 2009-09-02 23:39:57 +02:00
Alexander Larsson
d67a7eda16 Add gdk_window_restack
This lets you restack a window above or below a specified sibling.
At least eclipse wants this functionallity.
2009-09-02 23:38:55 +02:00
Alexander Larsson
45956aea21 Add gdk_cairo_reset_clip
This is required to get back the original drawable clip due to
non-native windows on a cairo_t.
2009-09-01 17:06:41 +02:00
Paolo Borelli
f97a33ad9c Move timer removal in dispose
Move removal of timer function in dispose to prevent potentially running
them on a diposed-but-not-finalized tooltip
2009-09-01 15:50:42 +02:00
Yaron Shahrabani
b31f1cd80a Updated Hebrew translation 2009-09-01 16:17:13 +03:00
Kjartan Maraas
ce0cfa2620 Update Norwegian bokmål translation. 2009-09-01 10:49:44 +02:00
Claude Paroz
42f2549303 Updated French translation 2009-09-01 09:43:36 +02:00
Matthias Clasen
32d59d174e Documentation fixes 2009-09-01 00:53:44 -04:00
Matthias Clasen
39c714ddc0 More updates 2009-09-01 00:01:13 -04:00
Matthias Clasen
036aada543 Fix the cups checks
This was reported in bug 593712.
2009-08-31 23:59:44 -04:00
Matthias Clasen
0b1a1e200f More updates 2009-08-31 23:02:49 -04:00
Matthias Clasen
9be22cb574 Document gdk_window_geometry_changed 2009-08-31 19:51:19 -04:00
Matthias Clasen
45d6752a3c Handle geometry change correctly
This makes sure that the button is properly prelighted when rotating it
underneath the pointer by using keynav on the scale.
2009-08-31 19:41:09 -04:00
Matthias Clasen
d22b79f1b6 Add another offscreen demo
This demo shows rendering multiple times, to achieve a reflection effect.
Inspired by an earlier demo by macslow.
2009-08-31 19:38:17 -04:00
Paolo Borelli
582b281761 Make sure the paper dialog is destroyed with the parent 2009-08-31 21:56:14 +02:00
Paolo Borelli
0bb51bca9b Remove unneeded call of begin/end user action
delete_interactive already uses them so no need to wrap the call.
2009-08-31 21:47:49 +02:00
Alexander Larsson
3e40146c04 Fix order of cairo clip setting when drawing text
We need to set the window clip region before applying the gc clip region,
otherwise we will reset the gc clip region. Fixes bug 593595
2009-08-31 16:39:54 +02:00
Alexander Larsson
36809d400f Describe how gdk_x11_drawable_get_xid() works wrt CSW in docs 2009-08-31 16:29:17 +02:00
krishnababu k
3959ae91d1 Updated Telugu Translations 2009-08-31 19:48:13 +05:30
krishnababu k
168e9d0708 Updated Telugu Translations 2009-08-31 19:47:32 +05:30
Alexander Larsson
21efe59aa0 Don't delay showing windows until viewable in GDK_NATIVE_WINDOWS mode
If all windows are native there is no need for delaying the operations
so we just do all shows/hides directly.
2009-08-31 15:06:01 +02:00
Alexander Larsson
b18afe9054 Don't propagate GDK_NATIVE_WINDOWS to child processes
Generally you only need to work around bugs in one specific app, so we
don't want to affect the applications that application will start.
Thus we unset GDK_NATIVE_WINDOWS after reading it.
2009-08-31 15:06:01 +02:00
Alexander Larsson
4d3b19fa7c Update shape handling
For toplevels, never apply clip as shape, instead apply shape.
This way we don't have to re-set it all the time as the window size
changes. Furthermore, this change fixes unsetting a shape on a
toplevel window which didn't actually unset the shape before.

Additionally we never apply clips as shape if the shape would just
be the same as the regular window size. This means we won't unnecessarily
add a useless shape to most native child windows (and additionally this
helps apps that do weird X stuff that don't expect these shaped windows).
2009-08-31 15:06:01 +02:00
Alexander Larsson
cc5b22cc81 Don't update window->shaped from backends
This is properly updated from the main code these days and
should not be touched by the backend code.
2009-08-31 15:06:01 +02:00
Alexander Larsson
154be115ec Use temporary impl_iface variable to make lines shorter
I.e. we use:
 impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
And then use impl_iface instead of the full macro when calling vfuncs.

Also, in some places we avoid getting the iface multiple times.
2009-08-31 15:06:01 +02:00
Alexander Larsson
397951cc85 Add and use gdk_window_is_toplevel when possible
This makes a lot of code cleaner and easier to understand
2009-08-31 15:06:01 +02:00
Alexander Larsson
028610b104 Add window type an shape to window print for nicer debugging 2009-08-31 15:06:01 +02:00
Alexander Larsson
d3d7070995 Support DEBUG_WINDOW_PRINTING even with GDK_NATIVE_WINDOWS 2009-08-31 15:06:00 +02:00
Piotr Drąg
c5621f857b Updated Polish translation 2009-08-31 14:51:43 +02:00
Runa Bhattacharjee
de89bf3e71 Updated Bengali India Translations 2009-08-31 17:59:19 +05:30
Shankar Prasad
e2f561aae0 Updated Kannada(kn) translation 2009-08-31 15:20:18 +05:30
Shankar Prasad
ced22b1540 Updated Kannada(kn) translation 2009-08-31 14:36:51 +05:30
Matthias Clasen
b6b64353a1 Add an migration chapter for CSW 2009-08-31 01:26:11 -04:00
Matthias Clasen
953d391a34 Cosmetic fixes 2009-08-31 01:08:31 -04:00
Matthias Clasen
f649237bf2 Minor doc fix 2009-08-31 00:55:57 -04:00
Matthias Clasen
5e5ab90a57 Improve CSW docs 2009-08-31 00:55:32 -04:00
Matthias Clasen
97d4b25d02 Add an offscreen window demo 2009-08-31 00:20:39 -04:00
Petr Kovar
ab93e1b8e8 Updated Czech translation 2009-08-30 18:31:22 +02:00
Matthias Clasen
2421e641f4 Warn when a parent is destroyed
Previously gdk_window_new would silently return NULL. Bug 590921.
2009-08-30 11:14:40 -04:00
Matthias Clasen
13147323d7 Forgotten part of the lpi change 2009-08-30 11:11:46 -04:00
Marek Kasik
f117777c20 Return meaningful default values for lpi and resolution
Change default values returned by gtk_print_settings_get_printer_lpi()
and gtk_print_settings_get_resolution{_x, _y}(). New values are 150 for
lpi and 300 for resolution (instead of 0) (#590861).
2009-08-29 21:34:05 -04:00
Marek Kasik
3b336186ee Add CUPS events as soon as possible when printing
CUPS events are added in prepare part of the main loop. These
events are initialized before their addition (#434318, #586466).
2009-08-29 21:32:01 -04:00
Paolo Borelli
2d8b8e054a buffer_backspace should delete \r\n in one go
Special case \r\n in gtk_text_buffer_backspace since \r should not be
reinserted even if we are deleting one char at a time. Also add
corresponding unit test. Fixes bug #544724.
2009-08-29 21:29:57 -04:00
Marek Kasik
f7cfe2bfea Emit "update-custom-widget" when the page setup changes
Previously, the signal was only emitted when the user selected
another printer. Bug 593001.
2009-08-29 21:19:44 -04:00
Christian Persch
2105d946cf Plug a mem leak
GtkWindow was leaking the startup_id, reported in bug 593317.
2009-08-29 21:19:44 -04:00
Davyd Madeley
44adf811ea [GtkSizeGroup] don't recurse into yourself 2009-08-30 10:47:52 +10:00
Christian Persch
a2420c7db5 Plug a mem leak
The filechooser was leaking tooltips. Reported in bug bug 593080.
2009-08-29 20:40:50 -04:00
Carlos Garcia Campos
c51830f453 Do not emit action-activated signal when there are not actions selected
This was causing problems for epiphanys location entry, reported
in bug 593481.
2009-08-29 20:36:28 -04:00
Pascal Terjan
047a91322c Show the icon window back after changing pixbuf
Otherwise, there is no way to get icons to show again after calling
_clear() once. Reported in bug 593135.
2009-08-29 20:27:23 -04:00
Matthias Clasen
a8715045ce Fix --enable-{cups,papi} handling
The configure script was not doing the right thing when these
options where explicitly given. Reported by Marvin Schmidt in bug 593012.
2009-08-29 20:23:07 -04:00
Matthias Clasen
7e4e2c636e Fix a documentation error
Reported by Eduard Bagrov in bug 592862.
2009-08-29 20:23:07 -04:00
Petr Kovar
64cd8c3f52 Updated Czech translation 2009-08-29 20:26:45 +02:00
Matthias Clasen
8005fd9e4d Updates 2009-08-29 14:02:37 -04:00
Matthias Clasen
ca3b8e8eda Updates 2009-08-29 13:22:15 -04:00
Matthias Clasen
145fdcbb9e Make beeps work again
Yay, beeps !
2009-08-29 13:06:04 -04:00
Tomasz Dominikowski
ca75ead34a Updated Polish translation 2009-08-29 15:21:45 +02:00
Michael Natterer
cc8927a589 Add gtk_widget_set_window()
New function as replacement for setting widget->window directly.
Should only be used in GtkWidget::realize().
2009-08-28 16:51:48 +02:00
Michael Natterer
0e52286d53 Bug 69872 - GTK_WIDGET_SET_FLAGS should be deprecated
Add gtk_widget_is_toplevel() for GTK_WIDGET_TOPLEVEL()
and gtk_widget_is_drawable() for GTK_WIDGET_DRAWABLE()
2009-08-28 16:27:26 +02:00
Manoj Kumar Giri
e6af9279f3 Updated Oriya Translation 2009-08-28 17:50:41 +05:30
Manoj Kumar Giri
6c3aca7345 Updated Oriya Translation 2009-08-28 17:41:59 +05:30
Kristian Rietveld
44469e4684 Make gtk_tree_view_real_set_cursor() handle non-existing paths
Such paths (eg. a child node that is collapsed) should be ignored.  This
is fixed by checking the return value of _gtk_tree_view_find_node(),
which returns a partial return value (the parent node) when it returns
TRUE.  Also added a unit test.
2009-08-28 11:04:54 +02:00
Miloš Popović
8d936d3cde Updated Serbian translation 2009-08-28 02:52:14 +02:00
Miloš Popović
25cf6517e8 Updated Serbian translation 2009-08-28 02:47:28 +02:00
Michael Natterer
591b37d7ce Add accessors for sealed member "flippable"
One step closer to makes GtkRange properly subclassable, but still
quite some accessors missing.
2009-08-27 21:14:21 +02:00
Michael Natterer
d30c31d6e1 marks_start_element(): initialize "value" to get rid of a compiler warning 2009-08-27 21:14:21 +02:00
Michael Natterer
6a278af6d2 Fix casts in calls to g_utf8_validate()
The "end" parameter is (const gchar **), not (const gchar *).
2009-08-27 21:14:21 +02:00
Tommi Vainikainen
3e5934e5c2 Updated Finnish translation 2009-08-27 22:13:02 +03:00
Kristian Rietveld
ec7187e039 Bug 543310 - set_enable_tree_lines doesn't work when a cellrenderer...
Reorder drawing in gtk_tree_view_bin_expose() so that the tree lines are
drawn after the cells have been drawn.  This is because cell-background
is handled in the cell renderer, so the tree lines need to be drawn
after this.
2009-08-27 18:12:54 +02:00
Kristian Rietveld
786b3914cd Bug 588199 - GtkTreeView rendering glitch while using a default ...
Contrary to what was believed before, do_validate_rows() does need to
queue a normal resize (including a redraw) when it has to.  The redraw
is required because of the size of the tree has changed because new
row(s) have been validated.
2009-08-27 18:12:54 +02:00
Kristian Rietveld
de1c79c721 Bug 592883 - Spin cell rendererer problem with double click
Block 2BUTTON and 3BUTTON press events using a button press event
handler in GtkCellRendererSpin, so that they won't be eaten and
processed by tree view.
2009-08-27 18:12:54 +02:00
Dan Winship
05b246accc fix gtk-doc syntax on GtkWidget:double-buffered, so Since gets picked up 2009-08-27 10:49:16 -04:00
Alexander Larsson
858e6bcd65 Allow x and y to be NULL in gdk_window_get_geometry
Fixes a crash reported in bug #593249
2009-08-27 13:34:00 +02:00
Alexander Larsson
1932f32ef2 Correct generation of broken grabs
We send a broken grab when a *parent* gets unmapped, not when
a child gets unmapped!
2009-08-27 13:32:01 +02:00
Alexander Larsson
41054425b9 Make sure we only send one grab broken event
We were incorrectly sending grab broken events in two places which
could cause multiple events for a single grab broken.
2009-08-27 13:32:01 +02:00
Benjamin Otte
51f140bfdc Document ownership for return value of gtk_file_chooser_get_file() 2009-08-27 11:53:24 +02:00
Benjamin Otte
4a0f78b72f Bug 592606 - Activate the default button in a respose-request callback
Previously the rightmost button with a proper response id was activated,
this is now only done if there is no default button set.

With this patch the right widget gets activated when there are multiple
widgets wth response ids conforming to is_stock_accept_response_id() as
the selected widget is made the new default widget before showing the
overwrite confirmation dialog.
2009-08-27 11:51:43 +02:00
Alexander Larsson
cf73930869 Don't unnecessarily set the event mask as that can cause X errors
For instance, two clients selecting for button events can cause BadAccess.
This fixes bug 592624, where a gdk_window_reparent caused us to re-set
the event mask, breaking the workaround for the mozilla BadAccess bug.
2009-08-26 14:53:27 +02:00
Alexander Larsson
2400e1440e Propagate the "send_event" flag for emulated events
This fixes bug 593011, where we were getting a bogus time on sent events
and the gnome-panel specifically looked for this and worked around it.
2009-08-26 10:36:26 +02:00
Mikel González
a2edc3c6bf Updated Asturian translation 2009-08-26 10:14:22 +02:00
Inaki Larranaga Murgoitio
ccf988e23d Updated Basque language 2009-08-26 10:15:35 +02:00
Rajesh Ranjan
4739118988 hindi updated by Rajesh Ranjan 2009-08-26 11:52:58 +05:30
Rajesh Ranjan
1937d1df5c hindi updated by Rajesh Ranjan 2009-08-26 11:51:44 +05:30
Alexander Larsson
7cc8cf2888 Fix cairo clipping to client side windows
When updating the clip region on cairo context (due to window changes or
paints of different sizes) we reset the old clip region, but this was
erronously done inside a cairo_save/cairo_restore pair, which made the
reset not take effect.

This fixes bug #592263.
2009-08-25 15:47:09 +02:00
Christian Dywan
c91cb2f71a Bug 592901 - Crash in JPEG pixbuf loader instead of error
Initialize the error structure early enough to ensure that it
propagates properly in the case of an error. Patch by Nokia.
2009-08-25 12:01:54 +02:00
ifelix
33c70e9b52 Updated Tamil Translations 2009-08-25 14:16:19 +05:30
ifelix
a202dc2e9f Updated Tamil Translations 2009-08-25 14:16:19 +05:30
Alexander Larsson
c2546c859d Clean up gdk_draw_drawable() composite handling
Instead of doing some magic in gdk_draw_drawable() to avoid double
offsetting when calling gdk_draw_drawable on the impl we call
the vfunc directly on the impl. Thus removing the weird magic from
gdk_draw_drawable().

I tested this with the testgtk test "text", where if the original magic
code is disabled typing a newline in the middle of a text line causes
the double offset issue to appear.
2009-08-25 10:37:18 +02:00
Alexander Larsson
c0084e2142 Fix clipping issue with clip masks
When the clip mask is completely inside the drawable clip region we
don't change the clip at all. However, we did set region_tag_applied,
so when the drawable clip was removed we removed the original clip mask.
This is no good, so we fix that by returning early in this case.

Fixes issue reported in bug #592752.
2009-08-25 10:37:18 +02:00
Alexander Larsson
0ad0646daf Fix clipping of drawn pixbufs in the no-render case
The fallback pixbuf rendering case ends up calling gdk_draw_image() on the
destination drawable wrapper, which resets the previously set clip region.
So, we need to manually get the impl and draw on that directly.

This fixes bug 592752 where we don't clip pixbuf rendering on non-render
Xservers.
2009-08-25 10:37:18 +02:00
Matthias Clasen
9e12297d69 Bump version 2009-08-24 19:45:14 -04:00
Matthias Clasen
e6cfb7b19f 2.17.9 2009-08-24 18:54:51 -04:00
Matthias Clasen
9bad2f70a4 Documentation fixes 2009-08-24 18:17:54 -04:00
Matthias Clasen
b09f8f6e30 Updates 2009-08-24 16:31:46 -04:00
Matthias Clasen
23b88f26b9 Document GDK_NATIVE_WINDOWS
Add a section in the release notes about it and list it
in the docs with all the other environment variables.
2009-08-24 15:20:57 -04:00
Gil Forcada
9d1dc2dae9 Minor fix to Catalan translation 2009-08-24 20:16:29 +02:00
Carles Ferrando
c268892e39 Updated Catalan (Valencian) translation 2009-08-24 20:16:02 +02:00
Gil Forcada
37c3413beb Minor fix to Catalan translation 2009-08-24 20:09:26 +02:00
Carles Ferrando
1f446d0658 Updated Catalan (Valencian) translation 2009-08-24 20:06:44 +02:00
Christian Persch
e8dcf330cc Preserve errno, and always use g_strerror()
Bug #592461.
2009-08-24 15:30:00 +02:00
Alexander Larsson
a79f929dd6 Add support for enabling only native windows
Some applications make weird assumtions on Gtk+ that do not work anymore
with the new client-side windows support. For instance SWT/Eclipse reorders
the stacking order of the X windows directly without telling gdk this,
which breaks gdk drawing as gdk now relies on knowing the stacking order
for window clipping.

This introduces a GDK_NATIVE_WINDOWS environment variable, which if set
causes Gtk+ to always use native windows. Its more compatible with
pre-csw Gtk+ behaviour if you do weird X-specific hacks, although it does
limit the size of GdkWindows to 65535x65535.
2009-08-24 15:22:29 +02:00
Denis Arnaud
deda8b97f6 Updated breton translation 2009-08-24 12:42:24 +02:00
Sweta Kothari
6dd6d44f98 Updated Gujarati Translations 2009-08-24 14:55:18 +05:30
Tor Lillqvist
17f9ba3a15 Update README.win32 2009-08-24 10:08:53 +03:00
Duarte Loreto
abf088f132 Updated Portuguese translation 2009-08-23 23:36:39 +01:00
Duarte Loreto
d1eea9cf1f Updated Portuguese translation 2009-08-23 23:21:56 +01:00
Jamil Ahmed
c45c51ecd9 Updated Bengali translation 2009-08-24 03:43:39 +07:00
Kristian Rietveld
4449acbb82 Remove broken logic in backwards walks in validate_visible_area()
In validate_visible_area() it was assumed that gtk_tree_path_prev()
would always return the correct path of the preceding node.  This is
obviously not true.  The if-clause has been removed so that we now
always use _gtk_tree_view_find_path() to get the path from the tree,
node.
2009-08-23 22:06:16 +02:00
Kristian Rietveld
7b4f09a589 Add a scrolling test case involving creating new rows in tree stores
Based on a bug report from Miroslav Rajcic, details are in the tree view
scrolling suite source code.
2009-08-23 22:06:16 +02:00
Kristian Rietveld
105e0be70e Rework naming of tests to make better use of path matching feature 2009-08-23 22:06:16 +02:00
Kristian Rietveld
a4a5d3da0e Change prefix of tree view scrolling tests into TreeView 2009-08-23 22:06:16 +02:00
Kristian Rietveld
ebc6a00015 Clean up code in gtk_tree_store_set_n_columns()
Clean up GtkTreeStore likewise as Benjamin Otte has done for
GtkListStore in commit 3c97f037.
2009-08-23 22:06:15 +02:00
Kristian Rietveld
9976554c6e Bug 528283 - Problems when using PageUp & PageDown to navigate...
Patch from Jonathan Matthew to make focus grabbing of page up/down,
home/end and left/right movements consistent with up/down.
2009-08-23 22:06:15 +02:00
Daniel Nylander
2f3cf2c449 Updated Swedish translation 2009-08-23 20:08:35 +02:00
Ivar Smolin
bb8fbde89f Updating Estonian translation 2009-08-23 19:41:38 +03:00
Kristian Rietveld
6320b12e8c Bug 526149 - GtkCellRendererAccel editing conflicts with mnemonics
GtkCellRendererAccel also needs to acquire the GTK+ grab in addition to
a GDK keyboard grab.  With the GDK keyboard grab, KeyPress and
KeyRelease events are delivered as usual, although we only want to
receive them for our grab widget.
2009-08-23 08:59:34 +02:00
Kristian Rietveld
f84df976a7 Bug 478519 - GtkTooltip segfaults on NULL gdk-display-current-tooltip
Make the tooltip code a bit more robust for a case that only occurs when
GTK+ is used from a language binding.  It looks like this case appears
because the memory management / ref counting is handled differently in
some of the language bindings.  Instead of asserting, we will fail
silently.  Also fix a think-o in gtk_tooltip_start_delay().  Patch from
O. Andrieu.
2009-08-22 23:21:44 +02:00
Changwoo Ryu
e86fab56df Update Korean translation 2009-08-23 01:33:10 +09:00
Theppitak Karoonboonyanan
7272169665 Updated Thai translation. 2009-08-22 23:09:28 +07:00
Alexander Shopov
8de2dbb440 Updated Bulgarian translation 2009-08-22 19:04:13 +03:00
Jorge González
61ea6875d2 Updated Spanish translation 2009-08-22 12:11:53 +02:00
A S Alam
9d611b1435 Updating Punjabi Translation Update 2009-08-22 07:34:04 +05:30
A S Alam
16f72308ec Updating Punjabi Translation Update 2009-08-22 07:21:13 +05:30
A S Alam
0fe210c6da Added Punjabi (Gurmukhi) Translaiton) by A S Alam 2009-08-22 07:19:38 +05:30
Kjartan Maraas
65ccceea9d Added Norwegian bokmål translation. 2009-08-21 13:41:16 +02:00
Li Yuan
0780a4975b Return state_set directly if there is no parent.
Bug #592403. Return state_set directly if there is no parent. Fix crash.
2009-08-21 15:29:51 +08:00
Matthias Clasen
e0a1e78a5a Silence the conversion from xatom to atom too 2009-08-20 18:06:35 -04:00
Shixin Zeng
277d840616 Deprecate also GdkFontPrivateWin32 2009-08-20 23:57:41 +03:00
Shixin Zeng
02457e3a93 Return value from non-void function 2009-08-20 23:56:52 +03:00
Shixin Zeng
bbe16ec60f Use g_object_ref/unref instead of deprecated specializations 2009-08-20 23:55:51 +03:00
Shixin Zeng
89a8fade6f Don't use stream before it is created 2009-08-20 23:53:57 +03:00
Shixin Zeng
e10db38f0d Put variable definitions at start of block 2009-08-20 23:51:38 +03:00
Alexander Larsson
428d7bd27b More reentrancy protection for process_updates
Protect against exposes destroying windows in some more places.
Hopefully this fixes bug 589367.
2009-08-20 17:09:08 +02:00
Antón Méixome
bbd96c5161 Updated Galician Translation 2009-08-19 16:26:24 +02:00
Seán de Búrca
dc7feb27e4 Updated Irish translation 2009-08-19 06:37:36 -06:00
Antón Méixome
97ec7f76df Updated Galician Translation 2009-08-19 13:39:19 +02:00
Leonardo Ferreira Fontenelle
e6e3d0adb3 Updated Brazilian Portuguese translation. 2009-08-18 22:15:12 -04:00
Andre Klapper
feb9580621 Add missing file. 2009-08-18 19:24:54 +02:00
Andre Klapper
7a76996606 Add missing file. 2009-08-18 19:22:38 +02:00
Marek Kasik
c21373dbe2 Use gtk-save icon for GtkPrintBackendFile
Use gtk-save icon instead of gtk-floppy for GtkPrintBackendFile.
2009-08-18 16:05:31 +02:00
Marek Kasik
3dc377a2ca Correctly select default printer when there is more than one (CUPS)
Select a local default printer if there is one instead of a remote
default printer (specified by the "printer-type" CUPS attribute)
(#591549).
2009-08-18 13:22:23 +02:00
Michael Natterer
9c151ba3e1 Shut up warning about calling gtk_object_get_type() having no effect 2009-08-18 12:10:03 +02:00
Matthias Clasen
9389d53504 Bump version 2009-08-17 23:53:36 -04:00
Matthias Clasen
a84f36028e 2.17.8 2009-08-17 23:51:50 -04:00
Matthias Clasen
93c8b1fdee Updates 2009-08-17 22:19:24 -04:00
Javier Jardón
c930f3a748 Support silent build rules with automake 1.11 (GnomeBug:591998)
Support silent build rules, requires at least automake-1.11.
Enable by either passing --enable-silent-rules to configure or
passing V=0 to make.
2009-08-17 20:15:23 +02:00
Matthias Clasen
270a95f12e Handle accelerators involving virtual modifiers better
The previous code would trigger on an unmodified 'S' key for a
'Super+S' accel. The current code avoids that at the cost of breaking
combinations like 'Mod4+Super+S' which are too exotic to worry about...
Bug 591526
2009-08-17 13:46:30 -04:00
Matthias Clasen
be83e8789c Tiny docs improvement
Mention that gdk_xid_table_lookup may return  NULL. Bug 591432.
2009-08-17 13:46:30 -04:00
Paolo Borelli
30ffad76f5 Bug 592003 - Shift+click should always modify selection
Shift-click inside an existing selection reduces the selection to the
range from the insert mark to the clicked point instead of removing the
selection. This makes GtkTextView more consistent with GtkEntry.
2009-08-17 17:07:50 +02:00
Alexander Larsson
f7185ec704 Don't crash on NULL parent
The parent window can be NULL, check for that before dereferencing.
2009-08-17 16:59:47 +02:00
Seán de Búrca
155140160c Updated Irish translation 2009-08-17 03:17:30 -06:00
Alexander Larsson
44b84fe12d Remove unused variable 2009-08-16 22:32:58 +02:00
Alexander Larsson
528546733f Fix gdk_window_get_geometry for native children with non-native parent
gdk_window_get_geometry calls the native function for all non-native
windows. This returns coords relative to the native parent. We need
to convert this to be relative to the client side parent.

This fixes DnD coordinates in firefox (bug 588437).
2009-08-16 22:27:19 +02:00
Paolo Borelli
03018f1d01 Fix memory leaks when using add_objects 2009-08-14 15:56:44 +02:00
Paolo Borelli
0696bc8e86 Fix memory leaks in unit tests 2009-08-14 15:56:44 +02:00
Paolo Borelli
6cfb23d185 Fix duplicated id detection in gtkbuilder
Fix memory handling of duplicated id hashtable and add unit test
2009-08-14 15:56:44 +02:00
Alexander Larsson
bd0755753a Always queue antiexposes after flushing outstanding moves
If antiexposures are queued and then we do the outstanding moves
we will queue translations that will affect incomming exposes
wrongly wrt the antiexposure. So, make sure we process the outstanding
moves before doing the antiexposure.

Additionally this commit adds a bunch of comments about how the
expose handling works and fixes a small bug that made us always
flush outstanding moves a little to early than necessary.
2009-08-14 12:09:02 +02:00
Alexander Larsson
f1f7df6443 Fix type mismatch warnings
Cast g_list_foreach args to GFunc.
2009-08-14 11:20:12 +02:00
Tor Lillqvist
341b8a4752 Initialize missing methods on Windows
Set the input_window_destroy and input_window_crossing methods of the
GdkWindowImplIface on Windows. Add implementation of
_gdk_input_crossing_event that is mostly dummy, though.
2009-08-13 22:49:35 +03:00
Cody Russell
a5f6b812be Add gtk_widget_set_allocation to gtkwidget.h and gtk.symbols 2009-08-13 11:22:57 -05:00
Cody Russell
5c89bbf3de Make the allocation parameter const 2009-08-13 11:21:15 -05:00
Cody Russell
2ba836defb Add widget->allocation setter method
Add gtk_widget_set_allocation() to be used by size_allocate() methods,
since widget->allocation is now sealed.  Bug #585211
2009-08-13 11:14:55 -05:00
Alexander Larsson
9f82243197 Make _gdk_window_process_updates_recurse reentrancy safe
Apps may change the window hierarchy while recursing over it by
destroying windows from the expose event handler. We need to copy
the children list and ref all the children while recursing.

This fixes some crashers in gedit (bug #589367, bug #591434)
2009-08-13 17:00:00 +02:00
Alexander Larsson
7667c4d8dc Fix leaks of clip region and outstanding moves
We're never freeing these, do so when destroying.
Fixes bug 589877
2009-08-13 16:49:58 +02:00
Matthias Clasen
9ec4fb60f2 Don't return uninitialized pointers
This was giving me segfaults somewhere else.
2009-08-13 09:47:20 -04:00
Alexander Larsson
939e55223c Ensure that queue_translation is paired with the right X operation
The X11 queue_translation operation uses NextRequest to get the serial
of the XCopyArea operation where the translation should end. However,
if the gc passed to gdk_draw_drawable has a non-flushed clip region
(which it commonly has now for the window clipping) then the next
operation will be the GC flush, not the XCopyArea.

To handle this right we now pass in the GC to be used to
queue_translation and ensure that it is flushed before calling
NextRequest().
2009-08-13 14:46:02 +02:00
Alexander Larsson
e25ac0b5cb Clarify comment 2009-08-13 14:46:01 +02:00
Alexander Larsson
043ca236f2 Invalidate old source in gdk_window_move_region
When we copy the region we need to also re-expose the areas of
the copied region that was not also in the destination.
And, we need to do this invalidation after the move, as the
move also moves any invalid area.
2009-08-13 14:46:01 +02:00
Alexander Larsson
8a517dc0bb Modify window system exposes wrt outstanding moves
If there are outstanding moves in an area that intersects
the source of an outstanding move we need to move the invalid
area correspondingly, otherwise we will expose the wrong area
as the outstanding move copy will happen before we expose
the invalid area.
2009-08-13 14:46:01 +02:00
Alexander Larsson
a3ee8271a9 Check for GraphicsExpose too in expose_serial_predicate
GraphicsExpose cause invalidation too, so we need to look for such
events in addition to normal Expose events.
2009-08-13 14:46:01 +02:00
Alexander Larsson
f019047402 Don't un-invalidate area that will be immediately invalidated again.
When moving an area we move any invalid region in this area to the
new place, but there really is no need to remove the old invalid
area as it would just be invalidated again (being newly exposed).
2009-08-13 14:46:01 +02:00
Alexander Larsson
ff558e2ec6 Remove C++ comment 2009-08-13 14:46:01 +02:00
Alexander Shopov
5745760450 Updated Bulgarian translation 2009-08-13 12:05:29 +03:00
Daniel Nylander
c167c7a613 Updated Swedish translation 2009-08-13 10:31:54 +02:00
Daniel Nylander
d2e14a7669 Updated Swedish translation 2009-08-13 10:29:36 +02:00
Daniel Nylander
8ad5076d7e Updated Swedish translation 2009-08-13 10:08:20 +02:00
Alexander Shopov
4327141289 Updated Bulgarian translation 2009-08-13 07:33:11 +03:00
Alexander Shopov
ee67900024 Updated Bulgarian translation 2009-08-13 07:16:05 +03:00
Leonardo Ferreira Fontenelle
d170ab22a6 Updated Brazilian Portuguese translation. 2009-08-12 23:02:15 -03:00
Benjamin Otte
e3bdf9291f Bug 590959 - Set child_has_focus flag properly (second try)
Previously, this flag wasn't cleared properly when the notebook lost
focus, but only when the notebook was focussed again later.
As this flag is only used to advance correctly focus pages by grabbing
focus to the new page after switching the page, this is not good.
In particular, it can cause a focus grab when programmatically switching
the notebook page and the focus is inside a completely different widget.

A previous attempt at this fix in
6e0af6c252 has been reverted in
dfe0c8c0ca because it didn't work
correctly.
2009-08-12 14:49:02 +02:00
Matthias Clasen
860fdbe3ba Bump version 2009-08-11 15:07:15 -04:00
Matthias Clasen
4df049d218 2.17.7 2009-08-11 15:06:02 -04:00
Matthias Clasen
bdffae7f6c Make setting the root cursor work again
This used to work, and CSW broke it. Bug 591462, 589844.
2009-08-11 14:19:35 -04:00
Matthias Clasen
f96d9132d6 Fix make check 2009-08-11 14:18:13 -04:00
Matthias Clasen
dffb6283a0 Updates 2009-08-11 12:47:09 -04:00
Alexander Larsson
fa21459066 Fix clearing of window background for some transparent notification icons
This extends the usage of the native clear region call such that its
called also for windows that have parent relative background all the
way up to a native window. That way we get true background relative
background clearing even to a foreign parent, which means that some
transparent notification icons look right again.
2009-08-11 15:41:23 +02:00
Alexander Larsson
60fa0da96d Implement fallback for old draw_drawable vfunc
GdkDrawable->draw_drawback was replaced with a new vfunc
draw_drawback_with_src that is now called from gdk_draw_drawable.
However, some code seems to call the vfunc directly (see bug #591288),
so make it chain to the new call.

Note that such direct vfunc calls are a bad idea and won't work for all
cases.
2009-08-11 12:58:48 +02:00
Alexander Larsson
f30cfd729a Show/Hide native window when updating viewable
This moves the native show/hide calls to the generic code
for calculating viewable rather than in its own separate code
called from gdk_window_show/hide. This simplifies the code a bit,
but most significantly it means things are correctly shown when
they become viewable for other reasons than a show/hide call.

For instance, this fixes bug 590442 (gvim embedding) where the
toplevel GtkPlug is mapped by the embedder and we didn't previously
pick up that the native children became viewable and should be shown.
2009-08-11 11:35:35 +02:00
Marek Kasik
70efa73311 Print when Enter pressed in certain GtkEntries of the print dialog
Print when Enter pressed in Name entry or Command Line entry in the
print dialog (#564695).
Add gtk_printer_option_set_activates_default() function and
gtk_printer_option_get_activates_default() function to control
behaviour of GtkPrinterOptionWidget.
2009-08-11 09:24:18 +02:00
Ivar Smolin
527e0937a8 Updating Estonian translation 2009-08-11 09:29:08 +03:00
Inaki Larranaga Murgoitio
f04a410dc5 Updated Basque language 2009-08-10 19:59:45 +02:00
Antón Méixome
321c034cd6 Updated Galician translation 2009-08-10 17:19:30 +02:00
Inaki Larranaga Murgoitio
67718230c7 Updated Basque language 2009-08-10 18:50:51 +02:00
Inaki Larranaga Murgoitio
4d49969d5f Updated Basque language 2009-08-10 18:49:34 +02:00
Alexander Larsson
19c1c11322 Don't invalidate unnecessary areas on raise
We used to invalidate the whole window when raised, but this is
unnecessary much, we now just invalidate the visible area minus the
previously visible area.

This also fixes a problem where expose calling raise caused a loop (#588438)
2009-08-10 15:35:33 +02:00
Alexander Larsson
0fc8c475a8 Remove old comment about guffaw scrolling
We no longer use guffaw scrolling since the client side windows
branch was merged.
2009-08-10 14:27:53 +02:00
Alexander Larsson
7f92684237 Don't ever invalidate the root window
This never worked before csw since the root window is never
set as IS_MAPPED, but with the new viewable check (which is
true for the root window) we could erronously queue exposes
on the root window.

This happened unexpectedly in bug 589369, where metacity
got a GraphicsExpose event on the root window due to some
graphics operation, queueing an expose which would be handled
by clearing that area. That is fixed with this commit.
2009-08-10 14:13:06 +02:00
Inaki Larranaga Murgoitio
c68194b951 Updated Basque language 2009-08-10 14:35:05 +02:00
Marek Kasik
d878dc8e1a Increment page sequence before print of the page, not after
When printing, increment page sequence before rendering of the page,
not after (#590084).
In opposite case it runs "end_page" function with wrong parameters when
drawing a page in another thread.
2009-08-10 11:37:32 +02:00
Javier Jardón
ec7c24d227 Remove some unused variables (GnomeBug:591218) 2009-08-10 11:06:54 +02:00
Matthias Clasen
54863bbba6 Correct a doc comment
Add 'papi' to the list of possible print backends, and mention 'file'
instead of 'pdf'.
2009-08-08 22:43:16 -04:00
Matthias Clasen
69fc109c22 Avoid some gratitious behaviour changes
Go back to allowing a lot of the WM-level functions on foreign windows,
since we used to allow that before csw. Fixes bug 589732.
2009-08-08 22:00:07 -04:00
Khaled Hosny
913c95a5b5 Updated Arabic translation 2009-08-08 21:32:20 +03:00
Seán de Búrca
a6632e9499 Updated Irish translation 2009-08-08 02:23:01 -06:00
Jorge González
f57e212695 Updated Spanish translation 2009-08-07 19:54:02 +02:00
Jorge González
ea746ed151 Updated Spanish translation 2009-08-07 19:29:25 +02:00
Jorge González
9124254974 Updated Spanish translation 2009-08-07 18:51:12 +02:00
Xan Lopez
dfe0c8c0ca Revert "Bug 590959 - Set child_has_focus flag properly"
This reverts commit 6e0af6c252.

The patch seems to break focus handling in some applications, like
Epiphany.
2009-08-07 15:51:17 +03:00
Michael Natterer
8296bf7035 Bug 69872 – GTK_WIDGET_SET_FLAGS should be deprecated
Add gtk_widget_has_grab() as replacement for GTK_WIDGET_HAS_GRAB().
2009-08-07 14:48:00 +02:00
Seán de Búrca
8a6bb818a4 Updated Irish translation 2009-08-07 02:27:58 -06:00
Carlos Garcia Campos
c775906e4a Add gtk_print_operation_get_n_pages_to_print()
It returns the number of pages that will be printed to allow tracking
the progress of a print operation. Fixes bgo#582964.
2009-08-07 09:42:03 +02:00
Seán de Búrca
d468aee5d9 Updated Irish translation 2009-08-07 01:17:14 -06:00
Michael Natterer
eb0a5721d9 Bug 69872 – GTK_WIDGET_SET_FLAGS should be deprecated
Add gtk_widget_get_visible(). For symmetry reasons and for convenience
when a widget's visibility state is available as a boolean condition,
also add gtk_widget_set_visible() (which simply calls show()/hide()).
2009-08-07 08:53:32 +02:00
Matthias Clasen
b514c6ac22 Fix a logic error in gdk_window_set_title on OS X
Also fix a similar error in gdk_window_set_transient_for.
This fixes bug 589738
2009-08-07 00:13:44 -04:00
Matthias Clasen
5002976fab Fix a logic error in gdk_window_set_title on OS X
This fixes bug 589738
2009-08-07 00:10:43 -04:00
Matthias Clasen
549ffcbf5c Add a GtkIconView::item-padding property
The property can be used to fine-tune who much space each column
needs. See bug 586100.
2009-08-06 23:56:30 -04:00
Matthias Clasen
ae37d2097e Emit GtkAssistant::apply before computing the next step
This fixes bug 589745.
2009-08-06 23:52:18 -04:00
Matthias Clasen
d769808cbb Fix a typo
This was reported in bug 586808.
2009-08-06 23:49:02 -04:00
Matthias Clasen
00c439dfcb Fix a typo
This was reported in bug 586347.
2009-08-06 23:44:00 -04:00
Pascal Terjan
f8171ce092 Update tooltip if no removable one is selected 2009-08-06 23:28:49 +02:00
Benjamin Otte
6e0af6c252 Bug 590959 - Set child_has_focus flag properly
Previously, this flag wasn't cleared properly when the notebook lost
focus, but only when the notebook was focussed again later.
As this flag is only used to advance correctly focus pages by grabbing
focus to the new page after switching the page, this is not good.
In particular, it can cause a focus grab when programmatically switching
the notebook page and the focus is inside a completely different widget.
2009-08-06 16:39:19 +02:00
Marek Kasik
c44b0d2f7a Check for details request before print
Checks for details request before sending a job to a printer.
Shows busy state indication (cursor + status field).
This avoids printing to wrong printer (bug #576601).
2009-08-06 09:11:31 +02:00
Marek Kasik
94bc87c637 Get default cover sheets from each printer separately
Fixes bug #590309.
Add default_cover_before string and default_cover_after string
to GtkPrinterCups and fill it when getting list of printers.
2009-08-05 10:34:27 +02:00
Jorge González
d4ac4f69d1 Updated Spanish translation 2009-08-04 19:31:33 +02:00
Jorge González
d6d39154a2 Updated Spanish translation 2009-08-04 19:31:27 +02:00
Ivar Smolin
e87a9021a2 Updating Estonian translation 2009-08-04 10:23:58 +03:00
Ivar Smolin
055c7aa454 Updating Estonian translation 2009-08-03 20:48:29 +03:00
Marek Kasik
39b960216c Add SVG support to GtkPrintBackendFile
This add support for printing to SVG 1.2 files (#357655).
2009-08-03 11:25:19 +02:00
Denis Arnaud
f29b9e2daf Updated breton translation 2009-08-03 06:07:58 +02:00
Kjartan Maraas
1fa297c82f Updated Norwegian bokmål translation. 2009-08-03 00:21:24 +02:00
Sam Thursfield
ad3be19251 Make gdk-pixbuf-csource work on Windows also in the build tree.
Patch from bug #590448.
2009-08-02 10:40:13 +03:00
Sam Thursfield
2f0dd2d806 Fix configure.in to work without --with-gdktarget on non-X11.
Patch from bug #590086.
2009-08-02 10:32:47 +03:00
Ivar Smolin
5ab28ed9fa Updating Estonian translation 2009-08-02 09:39:18 +03:00
Leonardo Ferreira Fontenelle
c009f49f93 Updated Brazilian Portuguese translation. 2009-08-02 01:27:31 -03:00
Kristian Rietveld
8c8e1daefa Add stubs for missing GDK windowing functions to Quartz backend
This seems to more or less fix the build.  On Tiger there are still issues
with libresolv missing on the link line, I will figure out what's up with
that soonish.
2009-07-31 21:22:54 +02:00
Yaron Sharabani
1946086d8b updated hebrew translation 2009-07-31 17:25:36 +03:00
Stefan Kost
493d386834 docs: don't invent new docbook tags, it is <type> not <typename> 2009-07-31 13:27:48 +03:00
Stefan Kost
bd439f65e2 docs: fix include by adding GtkLabel-links doc to expand_content_files 2009-07-31 10:33:04 +03:00
Kristian Rietveld
d743b2fbea Bug 586374 – code does not follow documentation
Properly invalidate iterators in iter_next, iter_children,
iter_nth_child and iter_parent when FALSE is returned.  ListStore was
actually already mostly in order as the GSequence pointers are very
strictly checked, but to be a little stricter we've added stamp = 0
lines.  TreeStore did not invalidate its iterators, so stamp = 0 lines
were added where appropriate.  Unit tests have been added to check this.

Fixes bug 586374, reported by Mike Gemunde.
2009-07-30 21:23:47 +02:00
Kristian Rietveld
a79ef0866b Bug 555109 – selection broken when typeahead active
gtk_tree_view_enter_notify() now "ignores" the synthesized crossing
events.  The synthesized crossing events always have (0, 0) as
coordinates, which messes things up.  This patch does not fix all issues,
at least it makes the behavior much more reasonable again.  Watch bug
555109 for further discussion on the issue.
2009-07-30 20:24:31 +02:00
Kristian Rietveld
bce2a5173d Bug 573321 – additional check in gtk_tree_model_filter_convert_*
Added checks to see whether the passed iterators are not the same in
convert_child_iter_to_iter() and iter_to_child_iter() functions in both
the sort and filter models.

Fixes bug 573321, suggestion by Vadim Godunko.
2009-07-30 20:24:31 +02:00
Kristian Rietveld
069a593b0f Bug 539377 – Unnecessary warnings when GtkTreeView is not realized
Adapt gtk_tree_view_get_path_at_pos() and
gtk_tree_view_get_drag_dest_row() to just return FALSE when bin_window
is NULL and not hit a warning.  Makes this case consistent with the tree
view not having a model.  Documentation has been updated to clarify
this, unit test has been added.

Fixes bug 539377, based on a patch by Bjorn Lindqvist.
2009-07-30 20:24:31 +02:00
Kristian Rietveld
ff10f9ce02 Bug 498010, 546005 - fix assertion in gtk_tree_view_set_cursor_on_cell
Instead of failing with warning on !tree_view->priv->tree, return
silently when tree_view->priv->model is NULL.  Clarified in the
documentation that for invalid paths (and every path is invalid when no
model is set), the function will fail silently although the current
cursor will be unset.

Fixes bugs 498010 and 546005.
2009-07-30 20:24:31 +02:00
Kristian Rietveld
531c7e535b Start general GtkTreeView unit tests
Includes a test case for bug 546005 to start with, logic provided by
Paul Pogonyshev and Bjorn Lindqvist.  In the future, we should maybe
merge treeview-scrolling.c with this one to create one large monolithic
tree view tester.
2009-07-30 20:24:31 +02:00
Pascal Terjan
a4514f993e Allow disabling New Folder button in File Choser
Bug #570516. Add a new property "create-folders" meaning that the
"New Folder" button should be displayed in the modes where it used
to be.
2009-07-30 16:58:42 +02:00
Matthias Clasen
d75ccb5c0d Correct a thinko
The xml way of saying %s is &percnt;s, not &amp;s.
2009-07-30 09:13:23 -04:00
Emmanuele Bassi
2d79405118 Bug #514260 – Better filtering for "Recently Used" files
Instead of refiltering the recently used files we should rebuild
the list altogether when the current GtkFileFilter changes; this
allows us to keep showing the maximum amount of recently used
files.

Fixes bug:

  http://bugzilla.gnome.org/show_bug.cgi?id=514260
2009-07-30 11:16:29 +01:00
Emmanuele Bassi
6f0f5f8dc7 Fix gdk_window_get_cursor() documentation
The 'Return value' annotation is missing from the documentation
of gdk_window_get_cursor().
2009-07-30 11:12:27 +01:00
Emmanuele Bassi
1811ecfb58 Add missing gdk_window_get_cursor to the GDK symbols 2009-07-30 11:12:26 +01:00
Kristian Rietveld
c035c122e2 Remove unused dirty iter discovery functions
gtk_tree_view_discover_dirty_iter() and gtk_tree_view_discover_iter()
have been in the tree forever, but unused since 1.3.8 or so.  I guess we
no longer need them, so removed them.  Fixes a compiler warning as well.
2009-07-30 12:02:18 +02:00
Michael Natterer
6007761549 Fix gtk_widget_get_allocation()
- add it to the header
- add the symbol to gtk.symbols
- fix coding style and check for allocation != NULL
2009-07-30 11:49:47 +02:00
Ivar Smolin
94f887390c Updating Estonian translation 2009-07-30 08:50:39 +03:00
Cody Russell
1780361b79 add gdk_window_get_cursor() 2009-07-29 22:38:36 -05:00
Cody Russell
4a73b41a34 add getter function for widget->allocation
Add gtk_widget_get_allocation() to retrieve a widget's allocation.
Needed as a step to enable GSEAL building.

This fixes bug #585211
2009-07-29 22:28:17 -05:00
Alejandro Piñeiro Iglesias
f22239c4aa Report ATK_STATE_SHOWING only when all parents are visible
Bug #509650. Checks if all the predecesors (the parent widget,
his parent, etc) are visible. Only reports ATK_STATE_SHOWING when
all parents are visible.
Signed-off-by: Li Yuan <li.yuan@sun.com>
2009-07-29 11:55:53 +08:00
Jamy
a96bf76db3 Updated breton translation 2009-07-28 13:46:41 +02:00
Jamy
29870ca2f9 Updated breton translation 2009-07-28 13:45:35 +02:00
Stefan Kost
0e6d121b83 docs: add missing <variablelist> tags
Fixes docbook validation for these files.
2009-07-28 11:21:49 +03:00
Stefan Kost
ed58c1028a docs: inline see_also to sections docs and add missing <variablelist>
This fixes docbook validation for the file.
2009-07-28 11:20:22 +03:00
Federico Mena Quintero
d55ff39ad0 bgo#161489 - In the file chooser, let the left/right arrow keys switch focus between the file list and shortcuts
Based on a patch by Christian Neumair <cneumair@gnome.org>

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-07-27 19:24:42 -05:00
Federico Mena Quintero
b50548e350 From the shortcuts pane, focus the GtkEntry and redirect unhandled keystrokes to it
This lets us do this:

1. click on a folder in the shortcuts pane
2. start typing a filename

Then, the typed filename will actually go to the filename entry, like
the user expects.  (Or to the search entry, in case the user clicked
on the Search shortcut.)

Also, removed the obsolete callback that made "/" and "~" typed in the
shortcuts pane bring up the location entry.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-07-27 19:12:41 -05:00
Federico Mena Quintero
0f5f7539f3 bgo#534462: Disable interactive search in the file chooser's shortcuts pane
People often do this:
1. Bring up a SAVE dialog
2. Click on a folder in the shortcuts pane
3. Start typing a filename
4. Oops!  The interactive-search entry in the shortcuts pane appears.

With this, the shortcuts pane will not bring up the interactive-search entry.  Then it
will be clear that you are not typing in the right place.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-07-27 19:12:41 -05:00
Daniel Nylander
00ff4d622b Updated Swedish translation 2009-07-28 02:22:30 +02:00
Cody Russell
313b6f39a6 _gdk_window_impl_new() on directfb 2009-07-27 15:39:28 -05:00
Kjartan Maraas
10e249f035 Fix translation 2009-07-27 16:36:56 +02:00
Hans Breuer
a7394dc887 Implement GdkDrawableImplWin32::draw_pixbuf 2009-07-26 19:14:08 +02:00
Hans Breuer
45344cdf7c Use G_DEFINE_TYPE (GdkDrawableImplWin32, ...) 2009-07-26 19:14:07 +02:00
Hans Breuer
c5c87a918f Some cursor work for csw(win32), more left to do 2009-07-26 19:14:06 +02:00
Hans Breuer
31357a7ab6 Enable big_window bench on win32, dialog for everyone 2009-07-26 19:14:05 +02:00
Hans Breuer
4d2c165b75 Formatting and removing commented/obsolete code 2009-07-26 19:14:04 +02:00
Philip Withnall
f9a1bfb7b9 Bug 589336 – Add GtkTreeViewColumn:sort-column-id property
Add the property, change notifications and documentation stubs.
2009-07-26 10:52:30 +01:00
Matthias Clasen
88d96c7246 Bump version 2009-07-24 23:51:47 -04:00
Matthias Clasen
a99a4d35e4 2.17.6 2009-07-24 23:49:37 -04:00
Matthias Clasen
012ff55b84 Updates 2009-07-24 22:52:21 -04:00
Alexander Larsson
a504784b4b Fix cairo rendering on large subwindows
We get the real pixmap size and use as cairo surface size rather
than doing some magic to try to get clipping on the right hand size
(and the magic looks wrong anyway).

The previous code could result in the width/height being to big for
the cairo 28.4 fix point size and thus not drawing anything.

This fixes bug #588076.
2009-07-24 21:44:57 +02:00
Li Yuan
ee876f94b1 Remove both SHOWING and SELECTED states when menuitem is not visible
Bug #582674 and Bug #574674. Remove SHOWING state also.
2009-07-24 16:23:57 +08:00
Li Yuan
de718dbe93 Remove ATK_STATE_SHOWING state when menuitem is not visible
When the menu is not selected, remove ATK_STATE_SHOWING state. And
emit state change signal if the menu is selected/unselected.
2009-07-24 16:17:59 +08:00
Matthias Clasen
9660bfe9da Fix issues with resize handles
The resize handles were not correctly redrawn and not positioned
correctly, initially.
2009-07-24 00:47:09 -04:00
Alexander Larsson
9d69355e6f Fix clipping of pixbuf drawing to windows
When the fallback for gdk_draw_pixbuf (gdk_drawable_real_draw_pixbuf)
is called with a window destination we have already applied any clip
regions and offsets for the window, but the window we get is a wrapper
and not an impl. We have to ensure we really draw to the impl, as
otherwise the pixbuf drawing will be clipped by client side subwindows.

This fixes bug 588553.
2009-07-23 22:03:15 +02:00
Alexander Larsson
e71c5d3ab5 Avoid unnecessary indirect call
Call klass->draw_pixbuf directly inside gdk_window_draw_pixbuf
instead of gdk_draw_pixbuf to avoid doing all checks twice.
2009-07-23 22:03:15 +02:00
Ivar Smolin
82ba9628e5 Updating Estonian translation 2009-07-23 19:08:44 +03:00
Daniel Nylander
141e983d24 Updated Swedish translation 2009-07-22 14:23:31 +02:00
Daniel Nylander
0c5e3b390b Updated Swedish translation 2009-07-22 13:51:09 +02:00
Tristan Van Berkom
cfc27be34e Slightly updated grammer in migrating-GtkBuilder.sgml
Just fixes the previous patch concerning using Glade if
possible before resorting to gtk-builder-convert to have
better grammer.
2009-07-21 12:54:33 -04:00
Javier Jardón
f4d1246700 Suggesto to use Glade instead gtk-builder-convert script (GnomeBug:587337)
* docs/reference/gtk/migrating-GtkBuilder.sgml
2009-07-21 12:54:32 -04:00
Cody Russell
d84b575cd0 Bug 589275 – [csw] Trying to destroy NULL regions
gdk_window_input_shape_combine_mask() can accept NULL for the mask
parameter, but it wasn't checking for NULL before passing the
resulting GdkRegion to gdk_region_destroy().  Fixes #589275
2009-07-21 11:44:25 -05:00
Alexander Larsson
18048308e4 Revert all handling of clip_region being unset for non-viewable windows
This is now handled by explicitly setting it to empty for all non-viewable
windows.

This reverts these commits:
82e609c2a0
36861cf608
454160ad9e
7adf894a29
ed2c837574
2009-07-20 23:26:02 +02:00
Alexander Larsson
3c03683e09 Set clip region to empty for non-viewable windows
This lets us avoid lots of viewable checks and still not waste
time computing clip regions for non-viewable windows
2009-07-20 23:15:34 +02:00
Alexander Larsson
82e609c2a0 Make gdk_window_begin/end_paint handle non-viewable windows
These are updated to not read clip region is not viewable
2009-07-20 22:36:02 +02:00
Alexander Larsson
36861cf608 Make gdk_drawable_get_visible/clip_region handle the !viewable case
We can't access ->clip_region for these cases as its not yet calculated.
2009-07-20 22:30:48 +02:00
Alexander Larsson
bf78db5690 Calculate clip region when window goes viewable
Since we're no longer calculating clip regions for non-viewable windows
we need to calculate it when it goes viewable.
2009-07-20 22:19:35 +02:00
Jorge González
6e4aff8608 Updated Spanish translation 2009-07-20 20:28:40 +02:00
Jorge González
6b3613d30c Updated Spanish translation 2009-07-20 20:27:43 +02:00
Jorge González
dbc80f47b1 Updated Spanish translation 2009-07-20 20:19:09 +02:00
Paolo Borelli
c564b3ef2b Microoptimization in interactive search handling 2009-07-20 15:54:48 +02:00
Paolo Borelli
48f1b45b62 Bug 588943 – set correct selection before emitting cursor-changed when searching
Make sure the correct selection is set when emitting cursor-changed
during an interactive search
2009-07-20 15:54:35 +02:00
Xan Lopez
3484246dc3 g_strdup_print does not exist, the function is g_strdup_printf. 2009-07-20 09:58:22 +03:00
Matthias Clasen
267d209441 Remove markup from translatable strings
Pointed out in bug 588964. String change !
2009-07-20 01:10:52 -04:00
Matthias Clasen
8430e215a7 Remove a duplicate include.
This was pointed out in bug 588897.
2009-07-20 00:31:20 -04:00
Matthias Clasen
d6afa6eff2 Fix a typo in the startup-id property definition
As well as some new GtkPrintOperation properties, which were not
correctly set up. This was noticed in bug 588958.
2009-07-19 23:52:58 -04:00
Matthias Clasen
4f49287659 Add a translator comment
This fixes bug 589035.
2009-07-19 23:21:52 -04:00
Alexander Larsson
aa47fca68f Exit remove_child_area when region is empty
When the region is empty we can return early, because there
is no more area to remove. This happens often for children
of scrolled windows (i.e. things that are clipped out.
2009-07-19 22:38:06 +02:00
Alexander Larsson
a057c03889 Optimize remove_child_area for children outside region
If a child is totally outside the current region, bail early instead
of doing costly calculations to subtract the child region.
2009-07-19 22:38:06 +02:00
Jorge González
ef8ce08edf Updated Spanish translation 2009-07-19 18:45:41 +02:00
Theppitak Karoonboonyanan
e87db9e44a Updated Thai translation. 2009-07-19 13:02:49 +07:00
Alexander Larsson
454160ad9e Fix read of non-initialized clip_region
Foreign children are always viewable but may not have a viewable
parent, so ensure we don't read the parent for them.
2009-07-18 23:15:57 +02:00
Alexander Larsson
7adf894a29 Don't read non-initialized clip region
The clip region is only initialized (and needed) for viewable windows.
2009-07-18 23:15:57 +02:00
Alexander Larsson
b36b7000f1 Only handle viewable windows in collect_native_child_region
There is no need to handle non-viewable windows and additionally
they may not have the clip region set yet.
2009-07-18 23:15:57 +02:00
Alexander Larsson
ed2c837574 Only apply clip_region shape for viewable windows
This fixes a problem where the clip region is not yet calculated
2009-07-18 23:15:57 +02:00
Alexander Larsson
7cbb573ca9 Only calculate clipping regions for viewable windows 2009-07-18 23:15:51 +02:00
Alexander Larsson
027f411150 Check for viewable to avoid doing work instead of mapped
This is now cheap and allows us to avoid more work.
2009-07-18 23:12:02 +02:00
Alexander Larsson
aa8693f2cb Track viewable for GdkWindow 2009-07-18 23:11:54 +02:00
Claude Paroz
7efa439fb3 Updated French translation
Contributed by Laurent Coudeur and Claude Paroz.
2009-07-18 20:45:09 +02:00
Alexander Larsson
db4dabf5e7 GDK_WINDOW_TYPE does a runtime typecheck, don't call it unnecessary
Looking at a profile the typecheck from GDK_WINDOW_TYPE stood out quite
a bit, which is fixed by not using it unnecessarily.
2009-07-18 15:06:27 +02:00
Jorge González
cf08a43eaa Updated Spanish translation 2009-07-18 14:40:07 +02:00
Jorge González
dd0d0753e9 Updated Spanish translation 2009-07-18 13:53:50 +02:00
Hans Breuer
1e765d2df0 Use perl to make gtkalias.h without warnings 2009-07-18 13:31:51 +02:00
Hans Breuer
f3668e96e7 Bug #588398 - Leak with testgtk::preview_(color|gray) and more
Revert to gdk_win32_ref_cairo_surface() implementation from gtk-2-16
and make _gdk_windowing_create_cairo_surface() simply delegate to it.
2009-07-18 13:13:13 +02:00
Matthias Clasen
630441030f Bump version 2009-07-17 23:11:12 -04:00
Matthias Clasen
37b1a1acf6 2.17.5 2009-07-17 23:08:51 -04:00
Michael Natterer
40408e74dd Two more getters for flags plus one new property
More stuff based on patches from Christian Dywan:
- gtk_widget_get_app_paintable()
- gtk_widget_get_double_buffered()
- r/w property "double-buffered"
2009-07-17 21:51:47 +02:00
Benjamin Otte
33ada9e938 Bug 588273 - Make number of validated rows depend on time, not row count
Previously, do_validate_rows() validated 300 rows per iteration. While
this is usually not problematic, as the typical tree view contains less
than 100 rows. Tree views with a lot of columns or complex cell
renderers could take inacceptably long, like:
- Epiphany's location bar entry completion has multiline and marked up
  text in every cell. Validating a single row took ~1.5ms here.
- In the list view in Nautilus, When enabling all columns, validating a
  single row would take ~3ms.
With 300 rows per iteration, that made those examples take 500ms/1s in a
signle main loop callback, and this obviously caused responsiveness
problems.

Now the code uses a timer and limits the time for validating rows to
30ms. This can cause less lines to be invalidated per call, so the
function might be called more often, but generally results in more
responsive applications.
2009-07-17 21:35:32 +02:00
Michael Natterer
74ca4e2482 Add API for more widget flags
Add the following functions based on a patch from Christian Dywan:
- gtk_widget_set/get_can_focus()
- gtk_widget_set/get_can_default()
- gtk_widget_has_default()
2009-07-17 21:20:14 +02:00
Matthias Clasen
c28d6b84fa Correct property types 2009-07-17 15:16:38 -04:00
Matthias Clasen
20dc8509f8 Complete the get_buffer() conversion
There was one direct buffer access in gtk_entry_real_delete_text
leftover, and it promptly made our testsuite fail.
2009-07-17 15:09:35 -04:00
Matthias Clasen
b923f9cf54 Updates 2009-07-17 14:31:00 -04:00
Matthias Clasen
b2c8cb55c2 Fix DND onto an empty icon view
This did not work due to a copy and paste bug from the time when
the treeview DND code was turned into iconview DND code. Fixes
bug 599484.
2009-07-17 13:30:37 -04:00
Hans Breuer
d0cf137ed9 More efficient version of _gdk_win32_window_queue_translation()
Don't create create an extraneous expose event for any scroll operation
that gtk+ does. Thanks to Alex for the hint.
2009-07-17 17:26:48 +02:00
Hans Breuer
d8d62ceb99 Fix inconsistent line-endings
They are causing trouble with core.autocrlf=true, see:
http://mail.gnome.org/archives/gtk-devel-list/2009-July/msg00041.html
2009-07-17 17:26:17 +02:00
Marek Kasik
98cdcce349 Change position of paper's dimensions according to reading direction
Change position of paper's dimensions in GtkPrintUnixDialog according
to reading direction.
2009-07-17 16:33:16 +02:00
Tristan Van Berkom
51149246c0 Fixed crashes when GtkEntry's internal buffer is not available (bug 588395)
To fix this I replaced the code that creates an internal buffer
at init and construction time with code that creates a buffer
at _get_buffer() time, this is the same as GtkTextView does and
fixes the crashes for me.
2009-07-16 23:52:46 -04:00
Matthias Clasen
7f83be8595 Make suitable GtkAssistant buttons default
We grab the default to the apply, forward or close buttons, as
appropriate. Also, make sure that the logic for setting the focus
to the best place on page change is applied to the initial page.
2009-07-16 22:06:40 -04:00
Matthias Clasen
c41e36ad8a Make jasper support optional
To enable it, one must now pass --with-libjasper to configure.
2009-07-16 20:54:42 -04:00
Tor Lillqvist
4d282879be Disable the GDI+ loaders by default as they are broken. 2009-07-16 22:05:17 +03:00
André Gondim
6a98939720 Updated Brazilian Portuguese translation. 2009-07-15 21:31:37 -03:00
Matthias Clasen
143b55c3cb Add a tooltip to the save folder combo
Add a tooltip that shows the full path of the current folder, to avoid
ambiguity. We only show the tooltip when the expander is collapsed to
avoid cluttering the full file chooser.
2009-07-15 19:17:36 -04:00
Matthias Clasen
a47c0754d7 Use G_CONST_RETURN for const return values 2009-07-15 18:29:13 -04:00
Matthias Clasen
9a3af66a21 Avoid gratitious behaviour change
gtk_entry_set_text() used to emit the ::delete-text, ::insert-text
signals. Changing to GtkEntryBuffer should not change this.
2009-07-15 18:25:02 -04:00
Matthias Clasen
b5dab96b45 Make GtkEntryBuffer::max-length and int property
This avoid a behaviour change in a corner case and should not make
any difference.
2009-07-15 16:12:09 -04:00
Matthias Clasen
b29fb1e609 Fix a typo 2009-07-14 22:33:14 -04:00
Michael Natterer
548f3a8c69 Add API for sealed member "visible" 2009-07-15 03:22:22 +02:00
Claude Paroz
2bd2a024ed Add missing files in POTFILES.in 2009-07-14 20:46:24 +02:00
Michael Natterer
2686930bfd Add gtk_widget_get_state() for accessing the sealed member "state" 2009-07-14 02:45:42 +02:00
Michael Natterer
8f60176229 Add API for some sealed widget flags
- gtk_widget_has_focus() for GTK_WIDGET_HAS_FOCUS()
- gtk_widget_get_sensitive() for GTK_WIDGET_SENSITIVE()
- gtk_widget_is_sensitive() for GTK_WIDGET_IS_SENSITIVE()
2009-07-14 02:12:40 +02:00
Michael Natterer
66ae394eb5 Add API for the sealed member "activatable" 2009-07-14 01:53:56 +02:00
Michael Natterer
dffc1bf19d Add API for sealed members xpad, ypad, xalign, yalign and sensitive 2009-07-14 01:45:03 +02:00
Michael Natterer
9e5b3a46b1 No need to have single-include guards in a private header 2009-07-14 01:33:52 +02:00
Matthias Clasen
0e8fe66f09 Fix some problems with prelighting of icons in entries 2009-07-13 14:48:10 -04:00
Matthias Clasen
ea3184f129 Make gtk_editable_get_chars work as before
It used to return actual entry contents, regardless of visiblity.
Make it do that again. This was reported in bug 588461.
2009-07-13 13:37:35 -04:00
Cody Russell
ecd961fcf7 more directfb updates 2009-07-13 08:36:40 -05:00
Kjartan Maraas
8e9436daae Updated Norwegian bokmål translation. 2009-07-13 11:16:46 +02:00
Hans Breuer
e7737dbd19 Implement _gdk_win32_window_destroy() and more cleanup
Implement _gdk_win32_window_destroy() by just renaming
_gdk_windowing_window_destroy(), removed superfuous stub.

Also cleaned up implementations of  gdk_win32_window_set_background()
and gdk_win32_window_set_back_pixmap() - removed stuff now done at the
respective gdk_window_*() function.
2009-07-13 09:45:07 +02:00
Hans Breuer
e96c161643 Implement _gdk_win32_window_queue_translation() 2009-07-13 09:45:06 +02:00
Hans Breuer
52941c5089 Mark gtk_custom_paper_unix_dialog_get_type() unix only 2009-07-13 09:45:06 +02:00
Hans Breuer
b72960f12d Bug #588388 - shape rendering is back
Just mapping exisiting implementations to new GdkWindow API.

http://bugzilla.gnome.org/show_bug.cgi?id=588388
2009-07-13 09:45:05 +02:00
Hans Breuer
4c2c45740d Make more use of defines in $(TOP)/build/win32/make.msc 2009-07-13 09:45:04 +02:00
Hans Breuer
c99b4e775b Bug #588379 - testgtk::panes does not change the cursor on mouse over
That one was easy, just removing Alex's #ifdef TODO_CSW ;)

http://bugzilla.gnome.org/show_bug.cgi?id=588379
2009-07-13 09:45:03 +02:00
Hans Breuer
e2000ac366 Bug #588373 - Menus broken by client-side-windows
Resurrcetion and adaption of find_window_for_mouse_event(). The window
receiving the WM_MOUSEMOVE, WM_?BUTTONDOWN is not necessarily the one
interested in GDK_(ENTER|MOTION|LEAVE)_NOTIFY

http://bugzilla.gnome.org/show_bug.cgi?id=588373

Also added some more more TODO_CSW and disabled print_event(): it can not
cope with the new _gdk_windowing_got_event() eating/morphing events.
2009-07-13 09:45:02 +02:00
Hans Breuer
fcdeab5456 Fix gccism - pointer arithmetic with void pointers 2009-07-13 09:45:01 +02:00
Hans Breuer
c6f9e39762 Fix c99ism - declaration in the mid of a block 2009-07-13 09:45:00 +02:00
Hans Breuer
b97ccecd5d Update msvc build 2009-07-13 09:45:00 +02:00
Hans Breuer
3750ecc821 Build more testapps, use G_PI instead of M_PI 2009-07-13 09:44:59 +02:00
Matthias Clasen
26e67850a7 Revert 8031432c09
We can't disallow single-includes unconditionally because gtkentrybuffer.h
is included in gtkentry.h.
2009-07-12 23:04:57 -04:00
Chao-Hsiung Liao
2c0e3be61f Updated Traditional Chinese (Hong Kong and Taiwan) 2009-07-12 15:41:40 +08:00
Jorge González
5b02063c9f Updated Spanish translation 2009-07-11 14:44:51 +02:00
Jorge González
31d6d3ea17 Updated Spanish translation 2009-07-11 14:44:43 +02:00
Matthias Clasen
d7f18ddad9 Remove outdated text from README.in
The PATCH and API keywords are no longer in use. Pointed out in 588229.
2009-07-10 22:29:50 -04:00
Matthias Clasen
417e5f86cf Bump version to 2.17.5 2009-07-10 19:45:21 -04:00
Matthias Clasen
4ff4eb544d 2.17.4 2009-07-10 19:42:44 -04:00
Alexander Larsson
d0366e5160 Don't draw to unviewable windows
The scrolling and region moving code needs to avoid drawing when the
window is mapped, which it did. However, it also needs to avoid
drawing when any of its parents are not mapped, which it didn't so
switch to using gdk_window_is_viewable().

This fixes the index rendering in evolution (#588169)
2009-07-11 00:33:52 +02:00
Matthias Clasen
c25ef64c70 Exclude GtkEntry::buffer from default value testing 2009-07-10 18:12:42 -04:00
Matthias Clasen
66f108874b Make pltcheck pass 2009-07-10 18:12:22 -04:00
Matthias Clasen
369ffae8dc Update 2009-07-10 14:39:07 -04:00
Michael Natterer
b664c328b4 Create a buffer in init() so subclasses can use the entry in their init() 2009-07-10 20:27:33 +02:00
Alexander Larsson
9063e5b3bf Ensure that windows used for selections are native
This fixes cut and paste in gvim (#588115)
2009-07-10 19:36:38 +02:00
Alexander Larsson
ccb09d1c6f Manually update toplevel_under_pointer when a grab changes to owner_events
When we ungrab the pointer we don't get enter events for the window the
pointer is in at the time of the ungrab, so we manually query for the
window the pointer is in. The same thing actually happens on re-grab if
the previous grab was !owner_events (meaning we don't get crossing events
for windows other than the grab) but the new grab is owner_events (and
thus non-grab windows need to get crossing events).

This factors out some common code and enables it also for the re-grab
to owner_events case.
2009-07-10 17:38:05 +02:00
Marek Kasik
0ef74c936f Add paper size combo and orientation combo to print dialog
Paper size combo and orientation combo can be added by
gtk_print_operation_set_embed_page_setup_dialog() to GtkPrinUnixDialog
now. This function induce calling of
gtk_print_unix_dailog_set_embed_page_setup_dialog() after creation of
dialog. These two functions control embed-page-setup-dialog properties
in GtkPrintOperation and in GtkPrintUnixDialog.
There is also new function gtk_print_unix_dialog_get_page_setup_set()
which says whether page setup was set by user.
Selected page setup is stored as default page setup in
GtkPrintOperation.
New class is added, its name is GtkCustomPaperUnixDialog. The class
manages custom sizes. It is derived from GtkPageSetupUnixDialog's
CustomPaperDialog structure.
Page layout preview is modified, so, it shows dimensions of current
page setup (mm or inch - depends on locale). It also shows the name of
actual paper if page setup dialog is not embedded (paper size combo is
not visible).
gtk-demo is actualized to include this new feature.
2009-07-10 11:28:31 +02:00
Cody Russell
6ca5430a74 Merge branch 'directfb-csw' 2009-07-10 03:21:28 +01:00
Cody Russell
e6605b091c get directfb building with csw 2009-07-09 23:53:26 +01:00
Maxim V. Dziumanenko
6445943ff9 Updated Ukrainian translation 2009-07-09 23:55:59 +03:00
Jorge González
8fbdbed18c Updated Spanish translation 2009-07-09 20:58:54 +02:00
Matthias Clasen
2bb2820272 Make link coloring in labels optional
Turns out that link coloring is expected for actual hypertext-like
use, but when using links just as 'mutant button', then it gets
in the way.
2009-07-09 13:59:35 -04:00
Michael Natterer
3d1f55b68d Add xevent->xcrossing.mode to GDK_NOTE() for enter and leave notify events 2009-07-09 17:59:41 +02:00
Alexander Larsson
305979d5a1 Remove accidentally added debug spew 2009-07-09 17:10:56 +02:00
Alexander Larsson
9044ec9bb9 Correctly set enter/leave events as detail=nonlinear
If we get a nonlinear enter/leave notify on the toplevel we need
to set nonlinear in all the events we send, even if the in-toplevel
tree is linear.

This fixes combobox menus popping down immediately when you click
(not hold). (bug #587559)
2009-07-09 17:06:46 +02:00
Michael Natterer
8031432c09 Disallow single-include unconditionally because this is a new file 2009-07-09 16:31:27 +02:00
Michael Natterer
becb5057fc Add single-include guard 2009-07-09 16:30:52 +02:00
Tino Meinen
690af10d65 Dutch translation updated 2009-07-09 11:36:05 +01:00
Tino Meinen
ba184fc5af Dutch translation updated 2009-07-09 11:35:03 +01:00
Maxim V. Dziumanenko
57032100bf Updated Ukrainian translation 2009-07-09 10:48:54 +03:00
Maxim V. Dziumanenko
d0f4532d90 Updated Ukrainian translation 2009-07-09 10:45:55 +03:00
Jorge González
a003b1b5f2 Updated Spanish translation 2009-07-09 07:36:52 +02:00
Stef Walter
eab02f697a GtkEntryBuffer holds text for GtkEntry
Adds a 'model' type buffer for GtkEntry in which the actual
textual data is stored. GtkEntryBuffer can be subclassed.

Among other things, this allows GtkEntry to be used for secrets
that need to be stored in non-pageable memory. It also allows
buffers to be shared by entries.

See bug #576801.
2009-07-08 20:41:53 -05:00
Alexander Larsson
9ef87ea11e Handle non-native windows in the gdk test utils
We need to add the non-native offset to the root coords when
sending events.
2009-07-08 18:47:43 +02:00
Alexander Larsson
a90d43bed6 Don't emulate map/unmap events for native windows
We really need to wait for the MapNotify from the xserver to ensure
that the window has been mapped, as it may be delayed by the WM, network
or similar things.

This fixes a problem in the /ui-tests/keys-events gtk test
2009-07-08 18:47:43 +02:00
Alexander Larsson
8ebf278ebb Fix defaultvalue test due to csw
Initialize GdkWindowAttr required fields. This makes sure toplevel
windows are not accidentally larger than 16bit.
2009-07-08 18:47:43 +02:00
Benjamin Otte
a0ab93ca13 Remove unused variable 2009-07-08 17:57:30 +02:00
Michael Natterer
2de23ea6cf Fix the remaining issues that broke the PLT check
Add internal API for the default button box layouts to so we don't
need to call deprectated GTK+ functions (which are invisible with
GTK_DISABLE_DEPRECATED).
2009-07-08 17:01:32 +02:00
Alexander Larsson
6fc6903c16 Move get_cells implementation from deprecated function
This way the deprecated function calls the new one instead of the other
way around, which fixes pltcheck.sh
2009-07-08 16:46:26 +02:00
Alexander Larsson
fb1aeab052 Move get_cells implementation from deprecated function
This way the deprecated function calls the new one instead of the other
way around, which fixes pltcheck.sh
2009-07-08 16:46:26 +02:00
Michael Natterer
11ec2ede56 Some indentation fixes and minor cleanup 2009-07-08 16:37:29 +02:00
Matthias Clasen
872152d56b Make gdk build with GDK_DISABLE_DEPRECATED
Turns out gdk_window_get_deskrelative_origin is now called in
gdk as well.
2009-07-08 09:54:39 -04:00
Kjartan Maraas
b6b9004885 Use g_object_unref instead of deprecated gdk_pixmap_unref 2009-07-08 15:48:51 +02:00
Nguyễn Thái Ngọc Duy
8c685884bd po/vi.po: updated key names 2009-07-08 13:42:16 +10:00
Ivar Smolin
ba44717959 Updating Estonian translation 2009-07-08 00:07:16 +03:00
Jorge González
a7681f4c1a Updated Spanish translation 2009-07-07 22:39:47 +02:00
Andre Klapper
a338c0f5ea Improve translator comment. Fixes bug #569393. 2009-07-07 16:37:07 +01:00
Alexander Larsson
62db28607b The shape is in window coordinate, so properly offset it when using it 2009-07-07 17:10:49 +02:00
Alexander Larsson
52e3d2cf0e Optimize clip-to-window with clipmask case when fully visible or obscured
This avoids creating alot of bitmaps in common trivial cases.
2009-07-07 17:10:49 +02:00
Alexander Larsson
2678a454e5 Make clipmasks work for pixbuf rendering
This is more important in the client side windows world, as clip masks
may be used for clipping to non-native subwindows. This fixes a bug
in aisleriot where it uses masked pixbuf drawing and it ends up drawing
over the moving card subwindow.
2009-07-07 17:10:49 +02:00
Alexander Larsson
5f12fe2b3b Add _gdk_gc_get_clip_mask
Internal function to get the clip mask of a gc (if set)
2009-07-07 17:10:49 +02:00
Daniel Nylander
a7e48466d4 Updated Swedish translation 2009-07-07 17:02:17 +02:00
Matthias Clasen
3b1a673ccd Reenable tests 2009-07-07 01:08:01 -04:00
Matthias Clasen
b55ac3523d Bump version 2009-07-07 01:07:27 -04:00
Matthias Clasen
b3969a3d75 2.17.3 2009-07-07 01:05:29 -04:00
Matthias Clasen
27f972cd34 Fix some distcheck issues 2009-07-07 00:29:14 -04:00
Matthias Clasen
1c6cd91b64 Temporarily turn of tests
Since there are some csw regressions.
2009-07-07 00:14:31 -04:00
Matthias Clasen
93556ea899 Make distcheck pass 2009-07-06 23:06:46 -04:00
Matthias Clasen
91701d685a Fix a typo 2009-07-06 21:37:42 -04:00
Matthias Clasen
2163081bc6 Update NEWS 2009-07-06 20:25:17 -04:00
David Zeuthen
200d5dde04 Bug 587485 – GMountOperation::show-processes support
- Add support for GMountOperation::show-processes

 - Implement process look up for the X11 target
2009-07-06 14:23:03 -04:00
Matthias Clasen
dab552dc22 Use gdk_display_sync instead of XSync 2009-07-06 02:03:21 -04:00
Matthias Clasen
42e7318b62 Fix redraw issues in GtkInfoBar
This was reported in bug 587716. I have no idea why this used
to work just fine for me...
2009-07-06 01:56:05 -04:00
Matthias Clasen
91868f5e76 Fix the doc build 2009-07-06 01:20:35 -04:00
Matthias Clasen
a213b00d8b More documentation fixes 2009-07-05 20:56:45 -04:00
Matthias Clasen
3b3e4e2a4b More small documentation fixups 2009-07-05 20:56:45 -04:00
Matthias Clasen
44bb1fb30e Small documentation fixes 2009-07-05 20:56:44 -04:00
Alexander Larsson
0e07d8b189 Hack that works around firefox plugin crash
It turns out that mozilla, as per the gtk2xt code selects for input on
the socket with a mask of 0x0fffff (for god knows why) which includes
ButtonPressMask, causing a BadAccess if someone else also selects for
this. As per the client-side windows merge we always normally selects
for button press so we can emulate it on client side children that
selects for button press. However, we don't need this for GtkSocket,
so we unselect it here, fixing the crashes in firefox.
2009-07-04 20:21:26 +02:00
Yaron Shahrabani
84c51a6089 Updated Hebrew translation 2009-07-04 20:49:39 +03:00
Hans Breuer
cd58baa7e3 Updated msvc build 2009-07-04 12:19:13 +02:00
Hans Breuer
7e116727d7 Fix condition to deliver root coords 2009-07-04 12:19:12 +02:00
Hans Breuer
23b1b350b0 Enable window creation with GDK_WINDOW_CHILD again 2009-07-04 12:19:11 +02:00
Hans Breuer
1bc0954495 Initialize 'private' before use 2009-07-04 12:19:10 +02:00
Hans Breuer
fbf0f2d0ec Fix includes for missing prototypes 2009-07-04 12:19:09 +02:00
Hans Breuer
37957aea34 Use G_PI rather than M_PI 2009-07-04 12:19:08 +02:00
Hans Breuer
bff092a0d5 Undef USE_MMX for msvc build 2009-07-04 12:19:07 +02:00
Hans Breuer
b11c4d9fae gtk_status_icon_get_title() must return a value 2009-07-04 12:19:06 +02:00
Hans Breuer
fbf73aada9 Updated msvc build 2009-07-04 12:19:05 +02:00
Hans Breuer
bbd62f4ad8 Conditionally define WS_EX_COMPOSITED 2009-07-04 12:19:04 +02:00
Matthias Clasen
6b56aea518 Add another bug ref 2009-07-03 15:22:02 -04:00
Matthias Clasen
8031910e21 Add doc stubs 2009-07-03 15:22:02 -04:00
Matthias Clasen
837e16789f Add new symbols 2009-07-03 15:22:02 -04:00
Matthias Clasen
6ba2dd8d60 Update for 2.17.3 2009-07-03 15:22:01 -04:00
Hendrik Richter
9503034262 Updated German translation. 2009-07-03 08:22:10 +02:00
Matthias Clasen
584c9c8a02 Make stock buttons have mnemonics again
We used to treat stock buttons as having an implicit use-underline.
A recent but fix lost that.
2009-07-01 19:02:45 -04:00
Matthias Clasen
bde64ecda2 Add a testcase for use-stock/use-underline in buttons
The fix for bug 586330 caused some unexpected behaviour changes, that
this testcase ought to illustrate.
2009-07-01 19:02:45 -04:00
Cody Russell
6060dab77a fix wrap width calculations that caused item height to be wrong
Fix by logari81 to the wrap width calculations fir GtkIconView. #490724
2009-07-01 13:17:51 -05:00
Alexander Larsson
2e3866b5b2 Make GdkDrawable draw_drawable backwards compat
Turns out pygtk build broke due to the argument addition to draw_drawable.
So, we now add a new vfunc for the new draw_drawable and are thus
backwards compat.
2009-07-01 19:50:49 +02:00
Alexander Larsson
0111030586 Merge branch 'client-side-windows' 2009-07-01 16:15:03 +02:00
Alexander Larsson
038398d493 Move new draw_drawable argument to end to make it more backwards compat 2009-07-01 16:13:31 +02:00
Alexander Larsson
10bf7ca744 Clean up embedding api
we now use gdk_offscreen_window_set_embedder() instead of a signal
to get the parent. This also replaces set_has_offscreen_changes.

Rename "parent" in all embedding related names to "embedder" to make it
more obviously different than the normal parent.

Rename gdk_window_get_offscreen_pixmap to gdk_offscreen_window_get_pixmap
to match the other offscreen calls.

Rename gdk_window_offscreen_children_changed to gdk_window_geometry_changed
as this is more descriptive.
2009-07-01 14:36:36 +02:00
Alexander Larsson
681c3c288b Remove debug spew, add TODO_CSW 2009-07-01 13:33:45 +02:00
Alexander Larsson
199582aed3 gdk_win32_blit, don't get the size of the impl 2009-07-01 13:33:06 +02:00
Alexander Larsson
b1df568239 Some win32 cleanups 2009-07-01 12:06:57 +02:00
Alexander Larsson
593d5441d4 Fix win32 GC set_region handling of reset_region 2009-07-01 12:06:04 +02:00
Benjamin Otte
3c97f037a9 clean up code in gtk_list_store_set_n_columns()
Previous code's messiness noted by Francisco Javier Taboada Aguado
in http://mail.gnome.org/archives/gtk-devel-list/2009-June/msg00001.html
2009-07-01 10:57:11 +02:00
Alexander Larsson
5341efd4d4 Make win32 backend build and minimally work 2009-07-01 10:28:06 +02:00
Alexander Larsson
11a96ce2f6 Don't use GDK_WINDOW_SCREEN, as its an X11 specific macro 2009-07-01 10:28:05 +02:00
Alexander Larsson
0c6f64a76c Don't return value from void function
This fixes the previous commit where the return value was removed.
2009-07-01 10:27:54 +02:00
Nguyễn Thái Ngọc Duy
89e3a9bc08 po/vi.po: updated Vietnamese translation 2009-07-01 14:15:19 +10:00
Alexander Larsson
413b39962f Add missing symbols to gdk.symbols 2009-06-30 12:40:51 +02:00
Alexander Larsson
b50dfa6923 Add gdk_window_get_root_coords to gdk.symbols 2009-06-30 10:55:06 +02:00
Alexander Larsson
3b6cf72f39 Move destroyed check to common code for get_origin & get_root_coords
Also remove weird return value from get_root_coords
2009-06-30 09:30:53 +02:00
Matthias Clasen
d78f449deb Improve printing example
Handle Documents folder being NULL, and handle output formats.
2009-06-28 16:58:00 -04:00
Matthias Clasen
8cca80d6a2 Improve handling of print-to-file uri
Going from print-to-file to a real printer and back used to nuke
an app-provided uri; now we keep the initial settings around to
avoid that.  Fixes bug 587086.
2009-06-28 16:14:21 -04:00
Matthias Clasen
1a42be00b4 Whitespace cleanups 2009-06-28 16:13:33 -04:00
Jorge Gonzalez
dea3b845b9 Updated Spanish translation 2009-06-27 14:57:54 +02:00
Benjamin Otte
271a635a2f make the size column resizable 2009-06-27 11:33:23 +02:00
Benjamin Otte
02ac8ea3af make sure the "Create folder" button doesn't get shown accidentally
Switching to search or recent files mode and back to browse mode made
the button visible previously
2009-06-27 11:32:57 +02:00
Benjamin Otte
6c18c25adb check for allowed NULL inside g_return_if_fail() statements
This patch replaces

if (foo != NULL)
  g_return_if_fail (GTK_IS_FOO (foo));

with

g_return_if_fail (foo == NULL || GTK_IS_FOO (foo));
2009-06-27 11:31:13 +02:00
Benjamin Otte
adf8db68c7 clarify the init value for the default sort column id
The patch is basically s/-2/GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID/
2009-06-27 11:30:06 +02:00
Benjamin Otte
655e0d8ddc unconditionally set right alignment for the size column 2009-06-27 11:29:36 +02:00
Benjamin Otte
4d49843317 remove unused variables 2009-06-27 11:28:07 +02:00
Alexander Larsson
64e7c7828d Don't hide foreign children when emulating visibility
We emulate visibility by unmapping (in X) all mapped (according to
gdk) windows that are not visible (all parents mapped). This is because
there may be client side windows inbetween the native windows in the
hierarchy, so you can't know a native window is visible just because
all the parent native windows are mapped.

However, we don't want to unmap foreign windows, as that may cause all
sort of unexpected issues. This should be safe, because generally the
parent of a foreign window is a native window (e.g. a socket), so its
gdk visibility state is the same as the Xserver one.

This fixes an issue with the GDM notification area where the unmap of
the plug caused spurious UnmapNotify events that confused GtkSocket and
caused icons to become one pixel wide.
2009-06-26 20:11:57 +02:00
Alexander Larsson
c84c0e92f8 Better implementation of native clear_area
Last commit was bad, as it didn't clip against client side
children. This implements such clipping first and then
only clears the rectangles that need to be cleared.
2009-06-26 17:07:24 +02:00
Alexander Larsson
0e548579de Implement gdk_window_clear_area natively for foreign windows
This fixes a redraw issue with the notification area in xfce4.
2009-06-26 15:45:53 +02:00
Alexander Larsson
4e902cd223 Clip cairo drawing against client-side child windows
This is how cairo works with native children.
This fixes an issue where the drag target outline is visible on the
evolution folder treeview when it isn't with native windows.
2009-06-26 14:20:05 +02:00
David Zeuthen
a92c9ce9a5 Bug 586691 – Better GtkInfoBar defaults
Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-06-25 15:23:40 -04:00
Ivar Smolin
986b78b667 Updating Estonian translation 2009-06-25 19:29:22 +03:00
Alexander Larsson
43bc999e6d Ensure that we always calculate clip regions for root windows
Without this we can't draw to them, which caused problems for e.g.
gnome-settings-daemon clearing the background when the desktop
background changed.

Note: We don't actually clip away child windows from the root window,
the clip is just based on the size of the root window.
2009-06-25 17:05:21 +02:00
Alexander Larsson
794f2815de Fix g_signal_emit calls
The switch to g_signal_emit was all messed up, I forgot to add signals[]
around the signal enum and did not pass in the detail quark.
2009-06-25 17:04:18 +02:00
Michael Natterer
f35c317b68 Fix warning about uninitialized variable plus spacing and indentation cleanup 2009-06-25 13:30:15 +02:00
Matthias Clasen
99b42cf006 Demo setting an output name for print to file
It turns out that no application is doing this, since it is not
obvious. Adding a demo here is at least a start.
2009-06-25 01:23:50 -04:00
Alexander Larsson
cf1c6bc2ed Fix typos 2009-06-24 20:59:29 +02:00
Alexander Larsson
955da9fc76 Factor out common code to sync_native_window_stack_position 2009-06-24 20:56:05 +02:00
Alexander Larsson
7969c1842a Remove old obsolete comment 2009-06-24 20:35:15 +02:00
Alexander Larsson
b093db8da9 Use g_signal_emit instead of g_signal_emit_by_name when possible 2009-06-24 20:33:13 +02:00
Alexander Larsson
8518aa2bf3 Rename accumulate_get_parent to accumulate_get_window
This function is used in several places, not just get_parent
2009-06-24 20:25:40 +02:00
Alexander Larsson
ca06216f20 Simplify _gdk_display_get_last_pointer_grab using g_list_last 2009-06-24 20:20:33 +02:00
Matthias Clasen
724ab58244 Add a way to turn off toggle spacing in menus
Reserving toggle space is nice for consistency in main menus
and context menus, but it gets in the way in special situations,
such as combo boxes, tabular menus, etc.
2009-06-24 01:01:51 -04:00
Marco Túlio Gontijo e Silva
839aa0421e Updated Brazilian Portuguese translation 2009-06-23 19:19:36 -03:00
Stanislav Brabec
a39b2dcee4 bgo#529908 - Sanitize handling of motion events in GtkNotebook
GtkNotebook used gdk_window_get_pointer() incorrectly, as it already
had coordinates from various GdkEvents.  Using get_pointer() means
that you get pointer positions *after* the event has happened, which
leads to visual out-of-sync results, or inadvertently detached tabs if
you click on them while your machine is being slow.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-23 14:36:22 -05:00
Bastien Nocera
b436f5b8a3 Bug 461944 – pressing the volume icon in full screen shuts down the sound
Don't pass the click on the button through to the scale when the
dock popup will be moved, otherwise we could end up changing the
sound in unexcepted ways (to zero for vertical popups at the bottom
of the screen for example).
2009-06-22 17:25:21 +01:00
Tristan Van Berkom
515a0b61a1 Accelerators failed for submenus (GNOME bug 582025)
gtk/gtkmenuitem.c: Override custom_tag_finished() for "accelerator" and search
the correct toplevel GtkWindow to attach accelerators to menu items.

gtk/gtkwidget.[ch]: Added _gtk_widget_buildable_finish_accelerator() to allow
subclasses to specify a toplevel window to associate with when parsing <accelerator>
tags
2009-06-22 12:19:56 -04:00
Matthias Clasen
d3ae855ce6 Forgotten header file 2009-06-22 11:46:03 -04:00
Matthias Clasen
af219b818f Don't force toggle size for tabular menus either 2009-06-22 10:00:19 -04:00
Matthias Clasen
8f57c91766 Remove extra padding from comboboxes
We do want to have consistent padding in menus in menubars and context
menus, but the menus used in comboboxes don't need the extra padding.
Add private GtkMenu API for turning this off. Bug 564063
2009-06-22 00:53:14 -04:00
Matthias Clasen
823151ba8c Fix 'Add to bookmarks' initial sensitivity
Make sure that we always call bookmarks_check_add_sensitivity() at
least once before popping up a newly created menu. Fixes bug 585858.
2009-06-21 23:30:27 -04:00
Jorge Gonzalez
05cef0731f Updated Spanish translation 2009-06-21 10:54:57 +02:00
Matthias Clasen
0e04566d54 Update some links in the tutorial
This fixes bug 585953.
2009-06-20 20:51:37 -04:00
Matthias Clasen
0f00d3fdb0 Reduce roundtrips
Setting a tooltip on a widget unfortunately triggers several roundtrips
to the X server. We reduce this overhead by only doing it if the
widget is visible, and by deferring to an idle. See bug 585626.
2009-06-20 16:34:54 -04:00
Matthias Clasen
374aa04954 Add a title property to GtkStatusIcon
This can be used to give ATs a string to display for tray icons.
See bug 585802.
2009-06-20 13:53:32 -04:00
Richard Hult
52ca2f29cc Update _gdk_windowing_pointer_grab 2009-06-20 11:50:10 +02:00
Richard Hult
56efcf62c4 Remove duplicate definition of GdkInputWindow 2009-06-20 11:50:10 +02:00
Richard Hult
f26fe5bb49 Update gdk_window_quartz_show, ..._get_origin, ..._get_pointer 2009-06-20 11:50:03 +02:00
Richard Hult
eb70b75118 Rename gdk_window_beep to _gdk_windowing_window_beep 2009-06-20 11:28:57 +02:00
Matthias Clasen
3dcb40e6be Correct a couple of typos 2009-06-19 09:14:18 -04:00
Federico Mena Quintero
3d527afadb bgo#586315 - gtk_file_chooser_list_shortcut_folders() was crashing
The virtual method list_shortcut_folders returns a GSList * of GFile *.
In turn, gtk_file_chooser_list_shortcut_folders() converts those to strings.

However, the delegate in gtkfilechooserutils.c was calling
gtk_file_chooser_list_shortcut_folders() every time, so we were trying
to convert invalid data.

Now we have an internal function that deals with GFile *.  That
function is called by the delegate, and the conversion is done only
once by the API entry points.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-18 21:57:54 -05:00
Matthias Clasen
6382eac6d8 Fix an oversight in mnemonic handling
In some situations, GtkButton would ignore the use-underline
property. This was reported in bug 586330.
2009-06-18 22:12:26 -04:00
Federico Mena Quintero
68171b506f Show the size column by default in the file chooser
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-18 19:48:38 -05:00
Ryan Lortie
6fe357965a Use g_mapped_file_unref()
- drop deprecated use of g_mapped_file_free()
  - bump glib version requirement
2009-06-18 15:11:57 -04:00
Alexander Larsson
0c7a26690d Fix spelling of synthesize 2009-06-18 20:58:13 +02:00
Federico Mena Quintero
3c75004474 Don't set the sort column when there is no model
We can't set the sort column when we load the GtkFileChooser's settings, as the
file models may not have been created yet.  Wait until the models are actually
present; then we can set the sort column.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-17 20:33:57 -05:00
Alexander Larsson
7303f3c9fd Merge branch 'master' into client-side-windows
This updates client-side-windows to the the latest soname
change for easier testing.

Conflicts:
	gdk/x11/gdkwindow-x11.c
	tests/Makefile.am
2009-06-17 12:56:05 +02:00
Benjamin Otte
1a385c50f0 fix compile warnings
Fallout from running make CFLAGS="-Werror"; mostly missing casts and
constness issues.
2009-06-17 10:28:03 +02:00
Alexander Larsson
c08bf93fe5 Don't reset window hints when showing multiple times
gdk_window_show() should only set the initial hints on the first
run, not if the window is already mapped when gdk_window_show is
called.
2009-06-16 21:34:37 +02:00
Daniel Nylander
272c30bbc2 Updated Swedish translation 2009-06-16 21:04:18 +02:00
Vincent Untz
d50cfd192b Use g_return_val_if_fail instead of g_return_if_fail 2009-06-16 18:40:01 +02:00
Matthias Clasen
3bf1c7adad More uses of the get_cell_renderers functions 2009-06-16 12:37:33 -04:00
Matthias Clasen
c12a8388f6 More instances of those deprecated functions 2009-06-16 12:21:36 -04:00
Matthias Clasen
6fc9f57848 Forgot one use in libgail 2009-06-16 11:48:16 -04:00
Matthias Clasen
d51132e584 Don't use deprecated api internally 2009-06-16 11:27:06 -04:00
Alexander Larsson
d44d5301a6 Remove ununsed variables 2009-06-12 12:47:20 +02:00
Alexander Larsson
bd0e95081f Always return FALSE from idle callback to avoid loop
In the destroyed window case in do_synthesize_crossing_event we didn't
return a value which can cause infinite "loops". Always return FALSE
to make sure the idle doesn't run again.
2009-06-12 12:45:31 +02:00
Alexander Larsson
56dfbd997e Handle gdk_window_beep on offscreen windows 2009-06-11 22:11:48 +02:00
Alexander Larsson
5dc6709ea0 Handle the window being destroyed in do_synthesize_crossing_event
This can happen since we ref the window and do the function in an idle.
2009-06-11 21:56:02 +02:00
Alexander Larsson
278e5bd170 Send crossing event due to geometry change in idle
Doing this directly had some issues with picking going recursive in
clutter-gtk. Furthermore, doing it in an idle means we can coalesce
multiple calls (which is common due to widget changes) in the same
toplevel to just one call.
2009-06-11 21:49:17 +02:00
Alexander Larsson
4987ca9235 Add gdk_window_offscreen_children_changed call
You can call this if you have offscreen children and the geometry of
them changed. This will cause re-picking of the active window sending
enter and leave events as needed.
2009-06-11 12:06:01 +02:00
Alexander Larsson
89e187e7c1 Use gdk_window_get_root_cords to get popup position for combobox
This makes us handle transformed offscreen widgets much better.
2009-06-08 20:01:05 +02:00
Alexander Larsson
4d54de336b Add gdk_window_get_root_coords
We want to be able to map any window coordinate to a root coordinate, not
just the origin, because you can't rely anymore on a simple translation
from window coordinates to parent with offscreen windows. This lets
us e.g. pop up menus in the right place even if they are popped up from
a no-window widget.
2009-06-08 20:01:05 +02:00
Alexander Larsson
a8549898ab Update event emulation to handle offscreen children
We use the offscreen signals for getting parent, picking
children at a point and mapping coordinates between windows
embedding offscreens and offscreens.

This means we have two hierarchies more or less, one visible to apps via
the standard APIs and for drawing where the offscreens are their own
separate toplevels, and another one for event handling where embedded
offscreens appear as if they were children of the embedding window.
2009-06-08 19:42:34 +02:00
Alexander Larsson
8670fbdbaa Implement the new offscreen signals in GtkOffscreenBox
This implements get-offscreen-parent, pick-offscreen-child,
to-parent and from-parent signals for GtkOffscreenBox
2009-06-08 19:40:47 +02:00
Alexander Larsson
904f0ccb7c Base pointer grab on get-offscreen-parent 2009-06-08 19:39:14 +02:00
Alexander Larsson
f195fbc221 Implement offscreen get_pointer with offscreen signals 2009-06-08 19:39:14 +02:00
Alexander Larsson
e1b52da0ab Add signals for offscreen window embedding
3 signals are for offscreen windows
get-offscreen-parent: Get the parent window an offscreen is embedded in
to-parent: Convert coordinates from offscreen to parent
from-parent: Convert coordinates from parent to offscreen

1 signal is for the window embedding offscreens:
pick-offscreen-child: This picks what (if any) offscreen is at a specific position

The last signal is only used if you call gdk_window_set_has_offscreen_children
to tell gdk that the window has embedded offscreen children.
Add get-pointer signal for offscreen window pointer getting

Apps using offscreen windows can connect to get-pointer on offscreen
windows in order to make gdk_window_get_pointer() return correct
values.

Add get-offscreen-parent signal

Add signals for from-parent and to-parent coordinate mapping

Add pick-offscreen-child signal
2009-06-08 19:39:06 +02:00
Alexander Larsson
4720bbc15e Make window_get_pointer a window impl virtual 2009-06-05 15:18:36 +02:00
Alexander Larsson
247e1945a0 window_get_pointer should return the direct child
We returned the innermost child that has the pointer, which is not right.
Only the direct child that has the pointer in it should be reported (if any).
2009-06-05 15:18:36 +02:00
Alexander Larsson
55ee12c296 Set the right parent root window for the offscreen windows 2009-06-05 15:18:36 +02:00
Alexander Larsson
cd7afc14fd Update GdkOffscreenWindow to new draw_drawable prototype
All rendering of drawables on offscreen was broken due to this change which
had not been implemented fully in offscreen windows.
2009-06-04 12:51:04 +02:00
Alexander Larsson
953be03acf Fix too many args warning
Apparently we missed one place when converting gdk_window_ensure_native
2009-06-03 14:50:10 +02:00
Alexander Larsson
9437138db2 Fix some warnings added by the input handling
Add casting and actually fix parenthisation of boolean expression
2009-06-03 11:24:27 +02:00
Alexander Larsson
609b03c517 Further clean up window drawing redirection/clipping
This combines the OFFSET_GC and various SETUP/RESTORE gc macros
to a single BEGIN/END_DRAW macro pair.
2009-06-01 14:48:11 +02:00
Alexander Larsson
1d739c2ff6 Fix up gdk_window_set_has_native rename issues
Seems like i forgot a bunch of things.
2009-06-01 14:47:38 +02:00
Alexander Larsson
e123931a65 Add more GdkWindow implementation docs 2009-06-01 13:38:04 +02:00
Alexander Larsson
a84cc4e9f3 Whitespace cleanup gdkwindow.c
Almost everything here changed anyway, so might as well clean it up.
2009-06-01 12:04:36 +02:00
Alexander Larsson
287b821705 Rename gdk_window_set_has_native to gdk_window_ensure_native
This also removes the (unimplemented) possibility to change a window to
non-native. This seems generally not very useful, and there are some problems
with it, for instance if two "users" need a window to be native and then
one of the "users" doesn't need it anymore it can't change it back, because
it is unaware of the other reason the window is native.
2009-06-01 11:57:59 +02:00
Alexander Larsson
d1f5050262 Make disabled xinput work again 2009-05-29 16:45:06 +02:00
Alexander Larsson
7372379c24 Initial version of input support 2009-05-29 16:39:12 +02:00
Alexander Larsson
a6e3da1319 Add some test for draw_drawable graphics exposures 2009-05-27 17:10:37 +02:00
Alexander Larsson
0b586a5ad7 Add support for client side graphics exposures in gdk_draw_drawable 2009-05-27 17:10:32 +02:00
Alexander Larsson
44c7264bc7 Add _gdk_gc_get_exposures 2009-05-27 17:06:46 +02:00
Alexander Larsson
8cb385cd31 Add support for visibility notification 2009-05-26 20:53:48 +02:00
Alexander Larsson
6c76f8f6ce Add gdk_region_rect_equal to compare a region with a rect 2009-05-26 20:48:10 +02:00
Alexander Larsson
8a689f2e15 Handle flushing implicit paint while there is a paint outstanding
If a native window or a window with a native subwindow is moved or resized
then the client window moves and implicit paints need to be flushed since
the native window move will copy/overwrite data. This may happen while there
is an outstanding paint if the move is inside an expose event (weird, but
flash embedded in webkit hit this).

Right now we're asserting here, but the right fix is to allow this but
to not flush the parts that are currently in a (non-implicit) paint. This
means we flush all results from previous not-yet-flushed exposes, but not
the ones being drawn.
2009-05-26 11:30:46 +02:00
Alexander Larsson
7698daf97a Merge branch 'master' into client-side-windows
Conflicts:
	gdk/x11/gdkwindow-x11.c
2009-05-25 14:30:01 +02:00
Cody Russell
1288ef1707 Grab changes 2009-04-02 10:16:30 +02:00
Cody Russell
f4331caf83 grabs 2009-04-02 10:16:30 +02:00
Cody Russell
49a0ec6e95 Updates 2009-04-02 10:16:30 +02:00
Cody Russell
08961c4def Get width/height from GetSystemMetrics() 2009-04-02 10:16:30 +02:00
Alexander Larsson
d64b51de4d Fix coordinates for background clearing when redirecting
Backport from svn of this fix
2009-04-02 10:16:30 +02:00
Richard Hult
730a44a516 Tweak the click-through handling so active apps get it (but not inactive ones) 2009-04-02 10:16:30 +02:00
Richard Hult
255756cfc8 Improve explicit drawing and flushing (fixes GtkRuler)
Use the same code path to get a CGContext for both gdk_draw_* and
gdk_cairo_create and make sure we unlockFocus in both cases. This
fixes the broken rendering in GtkRuler. Also use an average of flush
intervals when checking whether we can flush or not, since otherwise
we get too sensitive and block almost all explicit flushes that are
caused by mouse movements for example.
2009-04-02 10:16:30 +02:00
Alexander Larsson
255ec543b1 Ensure offscreen windows are not used as non-toplevels 2009-04-02 10:16:30 +02:00
Alexander Larsson
532818909c Move the new parts of GdkWindowObject to a private header
Unfortunately the old GdkWindowObject is public and accessed
from macros, etc. So, we publish a limited copy of GdkWindowObject
and use the full one internally when building gdk.
2009-04-02 10:16:30 +02:00
Alexander Larsson
2c877d4c2d Remove offscreen hooks support
In the new world offscreen windows are not put in the hierarchy, but are
rather toplevels for themselves. Offscreen hooks don't make any sense
in this model.
2009-04-02 10:16:30 +02:00
Alexander Larsson
b48c9f37fb Make offscreen windows not be in hierarchy
In the new world offscreen windows are a form of toplevels. So,
they don't have a parent, nor do we use the offscreen hooks.
2009-04-02 10:16:30 +02:00
Alexander Larsson
1208c2fa11 Fix x vs y typo 2009-04-02 10:16:29 +02:00
Cody Russell
3fdd1333b2 Misc stuff 2009-04-02 10:16:29 +02:00
Cody Russell
a93c6cd6e1 CSW Win32 work in progress - builds but does not work yet. 2009-04-02 10:16:29 +02:00
Richard Hult
97996ff00c Only add up native subwindow offsets for gdk_window_quartz_get_origin 2009-04-02 10:16:29 +02:00
Richard Hult
0092c1ebf0 Limit manual flushing so we don't get hit by quartz' fps limiting 2009-04-02 10:16:29 +02:00
Richard Hult
9af5f2b495 Disable/enable screen updates around process_all_updates to speed up rendering 2009-04-02 10:16:29 +02:00
Richard Hult
53b3343d1b Get the right event window for non-grabbed windows too 2009-04-02 10:16:29 +02:00
Richard Hult
6af4450641 Try to reduce risk of triggering the "beam sync" penalty in quartz 2009-04-02 10:16:29 +02:00
Alexander Larsson
05d3fc6bbd Try to combine consecutive window moves into one
It often happens that we move region A to B and then we move a subset
of B to C. When possible we'd like to replace this with a move from
A directly to C, and a suplimentary move from A to the areas of B not
overwritten by C.

Getting an optimal move combiner seems quite complicated, but this
simple approach gets most of the interesting cases right and isn't
all to complicated.
2009-04-02 10:16:29 +02:00
Alexander Larsson
f0fb3f450f Free region also if its empty (we're taking ownership now) 2009-04-02 10:16:29 +02:00
Alexander Larsson
c35e0e11da Move unnecessary window copies to the right place
This code got placed wrong, it should happen when processing updates
on the impl window so it affects the whole expose, not in begin_updates.
2009-04-02 10:16:28 +02:00
Alexander Larsson
51010ca066 Remove invalid source area from copy in move_region_on_impl
There is no need to copy something that is already invalid and will
be marked as invalid in the destination anyway, so we remove this
area from the region to copy.
2009-04-02 10:16:28 +02:00
Alexander Larsson
e4b26d3231 Move GdkWindowRegionMove construction/destruction to separate functions 2009-04-02 10:16:28 +02:00
Alexander Larsson
3866ea0539 Use clearer names for GdkWindowRegionMove members 2009-04-02 10:16:28 +02:00
Alexander Larsson
184dbd5782 queue expose translations after the actual pixel copy
The expose translation is useful for tracking how outstanding
invalid (exposed on server) areas are copied, and how we need to
compensate for that on the client side to redraw the right area.

So, we should queue the translation at the time we actually move
the bits on the server side, not when moving the window on the
client side.

Also, clean up some naming of parameters.
2009-04-02 10:16:28 +02:00
Alexander Larsson
fb3032af04 Fix order of outstanding moves in queue
The last added move should be done last, so we need to append moves
not prepend
2009-04-02 10:16:28 +02:00
Alexander Larsson
5742005aa1 Make outstanding window moves work with the new model
We now copy outstanding window moves directly on the window and
not to an intermediary pixmap, this means our previous code to
combine window copies was wrong (it relied on each copy not
destroying the source date).

Furthermore, we can't just remove all the update area from the
destination of the outstanding moves, as sometimes things get
copied into that area and then used as the source of another
copy.

We replace the previous window copy combining with a naive
version that just queues each move, just to get things right.
Further work to optimize copies is possible.

Also, we don't remove copy destinations that are used as source
for later copies.

We also clean up the memory management by not having
move_region_on_impl taking ownership of the passed in region.
2009-04-02 10:16:28 +02:00
Alexander Larsson
5ccc8b2ff1 Don't clear background on no exposure mask if NULL background pixmap set
This is the same as background None in X, i.e. never draw the background.
2009-04-02 10:16:28 +02:00
Alexander Larsson
96bc993786 Don't event process updates for foreign windows 2009-04-02 10:16:28 +02:00
Alexander Larsson
8690d19f03 Don't touch private->parent after its been change
The backend reparent may change private->parent, so we must use
the old saved value.
2009-04-02 10:16:27 +02:00
Alexander Larsson
7d51b4179d Clear background on expose with no EXPOSURE_MASK
Apps that set no exposure mask rely on the system clearing things
to the window background, so we need to do this ourselves.

Also, don't do this on foreign windows, as they are not controlled
by us. In fact don't do exposes on foreign windows either.
2009-04-02 10:16:27 +02:00
Alexander Larsson
16b4c3ade8 Call backend show() in gdk_window_show even if window is mapped
This is required for the GtkSocket code, as it shows the plug child
even though the current cached state is (wrongly) that its already
mapped.

This makes blink work for non-local case in testsocket.
2009-04-02 10:16:27 +02:00
Alexander Larsson
aa20a6b0b5 Refactor background clearing code so we can clear a general region 2009-04-02 10:16:25 +02:00
Alexander Larsson
490cbf84cd Be more explicit about when to flush moves
Also makes the non-doublebuffered case work better by flushing before we
call _gdk_windowing_window_process_updates_recurse.
2009-04-02 10:15:33 +02:00
Alexander Larsson
22da9d08da Destroy native children when recursing from a destroy on a virtual window
Native descendants of a virtual children are not automatically destroyed
with the parent as if it was a native window, so we need to handle
the native recursion tracking manually in _gdk_window_destroy_hierarchy()
2009-04-02 10:15:33 +02:00
Alexander Larsson
d35b723261 Only translate native motion events to motion events
Crossing events don't have the device field, which we would like to
pass on, so only do motion events from motion events.
2009-04-02 10:15:33 +02:00
Alexander Larsson
50a5f6046d Don't set the background for input only window
This is not allowed and will cause X errors.
2009-04-02 10:15:33 +02:00
Alexander Larsson
a7b6139029 Fix assert, it was checking the wrong window
We keep the update freeze count in the impl_window, not in
child windows.
2009-04-02 10:15:33 +02:00
Alexander Larsson
c72e93de16 Workaround X11 clipping bug
It turns out that XCopyArea handling of obscured source regions is
buggy. It clears the destination area even outside the GC clip
region. We work around this for the pixmap->window case as that
can happen in gtk+ and is easy to work around.

X Bug report at:
http://lists.freedesktop.org/archives/xorg/2009-February/043318.html
2009-04-02 10:15:33 +02:00
Alexander Larsson
53511cb653 Enable custom event masks for native windows
Some apps really need to set custom event masks on native child windows,
for example emacs sets the event masks with gdk, but then reads out
the raw X events via a filter, so gdk event emulation doesn't work for that.

When we get motion or button events we map back from the event position and
window to the toplevel before doing anything, because a toplevel native window
could e.g. overlap a child window or whatever.
2009-04-02 10:15:32 +02:00
Alexander Larsson
fe3c410048 Filter out all native grab/ungrab events with detail INFERIOR
These are generated when we get an implicit grab on a native
child window, and we can't filter them with _has_grab() because
they are sent before the button press event where we detect
the implicit grab.

This makes clicks work in the flash plugin again
2009-04-02 10:15:32 +02:00
Richard Hult
f51a3f5e33 Make owner_events grabs work again, use the pointer window, not the event window 2009-04-02 10:15:32 +02:00
Richard Hult
6d1a8853c4 Don't ignore all events when inactive, only clicks 2009-04-02 10:15:32 +02:00
Richard Hult
41d40786b1 Relax the check for ignoring events above the content view 2009-04-02 10:15:32 +02:00
Richard Hult
651335bc7e Remove workaround for missing enter events on newly popped up windows
The reason for the issue was that we got entered/exited events for the
title bar buttons. Now we properly ignore those instead.
2009-04-02 10:15:32 +02:00
Richard Hult
aeeb54ddf0 Remove re-declared variable 2009-04-02 10:15:32 +02:00
Richard Hult
64195589dc Remove unused code and fix some indentation 2009-04-02 10:15:32 +02:00
Richard Hult
6d01d16d48 Button press and release can share the same fill_button_event call 2009-04-02 10:15:32 +02:00
Richard Hult
77ee2feda2 Remove tracking of "current mouse window", this is handled in the common code now 2009-04-02 10:15:32 +02:00
Richard Hult
3c7a37d10d Remove old cursor setting and make it work with client-side windows 2009-04-02 10:15:32 +02:00
Richard Hult
e6f2a809b2 Update for latest changes in the common code for grab tracking 2009-04-02 10:15:32 +02:00
Richard Hult
f455b478e7 Ignore all events if the app is not active 2009-04-02 10:15:31 +02:00
Richard Hult
2c043566fc When breaking grabs on deactivation, the unset should be implicit 2009-04-02 10:15:31 +02:00
Richard Hult
30f83d8398 Use _gdk_display_unset_has_*_grab in break_all_grabs() 2009-04-02 10:15:31 +02:00
Richard Hult
65aef2099a Use cooca to convert coordinats from event window to grab window instead of homegrown code 2009-04-02 10:15:31 +02:00
Richard Hult
a180f7588f Replace quartz specific keyboard grab code with common code 2009-04-02 10:15:31 +02:00
Richard Hult
f06d432ebe Cast to avoid warning 2009-04-02 10:15:31 +02:00
Richard Hult
06e583e536 Remove unused variable 2009-04-02 10:15:31 +02:00
Richard Hult
152614966f Use the common pointer grab code instead of tracking it ourselves 2009-04-02 10:15:31 +02:00
Richard Hult
55c71f18a4 Use isKeyWindow instead of isMainWindow for the non-click-through check 2009-04-02 10:15:31 +02:00
Richard Hult
e8d6ac71b7 Apply non-click-through policy on unfocused windows even if the app is active 2009-04-02 10:15:31 +02:00
Richard Hult
c36625879b Fix coords returned by _gdk_windowing_window_get_pointer, fixes scribble demo 2009-04-02 10:15:31 +02:00
Richard Hult
ccd982f8bd Remove unused remainders from the old implicit grab code 2009-04-02 10:15:31 +02:00
Richard Hult
79d9a8f960 Get implicit grabs working 2009-04-02 10:15:31 +02:00
Richard Hult
3d72fe16c0 Leave AppKit events unhandled 2009-04-02 10:15:30 +02:00
Richard Hult
0fc2c36ee7 Use event_type we already have instead of regetting it 2009-04-02 10:15:30 +02:00
Richard Hult
7abde8388f Get the correct root coordinates for events 2009-04-02 10:15:30 +02:00
Alexander Larsson
20c81eca6a Return ignoring of native grab/ungrab events when we don't have a grab
It turns out we really have to ignore grab/ungrab events or we'll
report double crossing events when we grab or ungrab.

However, we also can't ignore crossing events from grabs from other clients
as that leads to missed enter/leave events on e.g. alt-tab in metacity.

Fortunately we now track grabs very precisely, so we know with certainty
whether we have a grab at the time (serial) of the native crossing events,
and only if we do we ignore them.
2009-04-02 10:15:30 +02:00
Alexander Larsson
53269a5042 Handle crossing events with subwindows unknown to gdk
If we get crossing events with subwindow unexpectedly being NULL
that means there is a native subwindow that gdk doesn't know about.
We track these and forward them, with the correct virtual window
events inbetween.

This is important to get right, as metacity uses gdk for the frame
windows, but gdk doesn't know about the client windows reparented
into the frame.
2009-04-02 10:15:30 +02:00
Alexander Larsson
7776c87f3f enable motion hints - use last sent request
We were using the next request, but there is no guarantee
on is sent. This caused trouble in e.g. the handlebox dragging.
2009-04-02 10:15:30 +02:00
Alexander Larsson
7b67393b8a Make sure we report grab broken on window destroy 2009-04-02 10:15:30 +02:00
Alexander Larsson
025b6aa741 Report the steady state in gdk_display_pointer_is_grabbed
For instance if we grab the pointer and then check if its grabbed
so that we know to ungrab we don't care that the grab is not
yet active, so report the steady state (i.e. the last grab)
2009-04-02 10:15:30 +02:00
Alexander Larsson
5be3f38535 Move implicit grab tracking totally to common code 2009-04-02 10:15:30 +02:00
Alexander Larsson
d6ad734c7f Don't send crossing events to destroyed windows 2009-04-02 10:15:30 +02:00
Alexander Larsson
26cbf87d7d New approach for grab tracking code
We try to track the exact grab state, i.e. whats valid on the client
now and whats comming soon via the xserver roundtrip (and when).
2009-04-02 10:15:30 +02:00
Alexander Larsson
526ff6dd68 Ref windows during _gdk_x11_roundtrip_async 2009-04-02 10:15:29 +02:00
Alexander Larsson
abb7a32fbe Fix up indentation 2009-04-02 10:15:29 +02:00
Alexander Larsson
1cc4712ea1 Move bitfield in GdkWindowImplX11 to make struct more compact 2009-04-02 10:15:29 +02:00
Alexander Larsson
a6e647863d Only sync the display if creating a native window implicitly 2009-04-02 10:15:29 +02:00
Alexander Larsson
e631d2d2d4 Sync the display when creating a native window.
This is needed because we want to be able to use the xid immediately
even from another process or another connection to the display.
2009-04-02 10:15:29 +02:00
Alexander Larsson
089c9ca2f1 Don't warn about unexpected events on foreign windows
We don't really control these events so its not wrong per se
to have them generate stuff we don't expect.
2009-04-02 10:15:29 +02:00
Alexander Larsson
bfd29e62b5 Update clip region etc, when creating a foreign window 2009-04-02 10:15:29 +02:00
Alexander Larsson
177b53a079 Fix typo in gdk_window_input_shape_combine_region 2009-04-02 10:15:29 +02:00
Alexander Larsson
8b7d8431aa Make gdk_window_get_toplevel() for CHILD window with root as parent
Having GDK_WINDOW_CHILD windows with root as the parent apparently works,
and metacity uses it. The current gdk_window_get_toplevel() returns the
root window for that, which is wrong, so we check that explicitly.
2009-04-02 10:15:29 +02:00
Alexander Larsson
33c0c1fba8 Don't mess with any events on the root window.
This causes all sorts of weirdness with pointer_over_window
being the rootwindow and then crashing gdk_window_get_toplevel() later.

With this metacity stops crashing madly.
2009-04-02 10:15:29 +02:00
Alexander Larsson
6e56179b03 Don't crash if window->parent is NULL
This happens for events on the root window.
2009-04-02 10:15:28 +02:00
Alexander Larsson
d9fcda1072 Don't recursively set bg none on the parent when e.g. moving children
To avoid drawing the window background of other windows in the area
where the window was we set the bg to none recursively. However, this
is quite costly it the moved window has many siblings. Furthermore, it
is uncommon that siblings overlap, so this cost has little gain.

So, we only set bg None on the parent, which means that there will
be some more flicker in the uncommon case of overlapping siblings.
2009-04-02 10:15:28 +02:00
Alexander Larsson
de2d5f299d Simplify do_move_region_bits_on_impl by removing unused arguments 2009-04-02 10:15:28 +02:00
Alexander Larsson
8de6ae26e4 Remove_gdk_pixmap_set_as_backing etc, as this is not used anymore
We don't copy from a window to a pixmap anymore, so all the code
for this can be removed.
2009-04-02 10:15:28 +02:00
Alexander Larsson
e542f734a8 Fix warning about XChangeProperty argument type 2009-04-02 10:15:28 +02:00
Alexander Larsson
3eb2b62120 Remove unused code 2009-04-02 10:15:28 +02:00
Alexander Larsson
75cb664049 Fix warning about wrong type in assignment 2009-04-02 10:15:28 +02:00
Alexander Larsson
482b333d92 Fix warning due to typo 2009-04-02 10:15:28 +02:00
Alexander Larsson
b272456023 Remove unused label 2009-04-02 10:15:28 +02:00
Alexander Larsson
a006d85928 Avoid warnings about non-handled GDK_EVENT_LAST enum 2009-04-02 10:15:28 +02:00
Alexander Larsson
a711f51629 Fix setting of private->shaped when setting input shape
I.e. it should only be set/unset when setting ShapeBounding.
2009-04-02 10:15:28 +02:00
Alexander Larsson
fe6f46c589 Don't look for EXPOSE mask set to disable bg none setting
We always set EXPOSE in the client-side-windows world, so this
doesn't make sense anymore.
2009-04-02 10:15:28 +02:00
Alexander Larsson
cc32207534 Fix typos in X11 details of new OSX APIs 2009-04-02 10:15:27 +02:00
Alexander Larsson
5ca1865f5d Don't ignore native CROSSING_GRAB/UNGRAB events
These are sent when someone else grabs the pointer, and we don't
want to miss these expose events. For instance, we missed enter
and leave events on alt-tab.

There were some issues with these wrt out-of-sync grab information
in the client, but that should now be handled. So, it should work
or at least be fixable if we find some bug.
2009-04-02 10:15:27 +02:00
Alexander Larsson
016c5fd081 Track pointer grabs on Xserver time
After a successful grab/ungrab we wait for an xserver
roundtrip until we change the tracked grab in GdkDisplay.
This way that data is always up-to-date wrt events comming in.
2009-04-02 10:15:27 +02:00
Alexander Larsson
d2c1c0a8db Add _gdk_x11_roundtrip_async 2009-04-02 10:15:27 +02:00
Richard Hult
24aa1620bf Update for changes in the paintable interface
Get rid of invalidate_maybe_recurse and process_updates. Implement
_gdk_windowing_{before,after}_process_all_updates(), and keep track of
when we're inside process_all_updates in the common code so we know
when to flush windows. Implement
_gdk_windowing_window_process_updates_recurse by means of
setNeedsDisplayInRect: displayIfNeeded. Use the added window argument
in begin_paint_region to get the right window (the paintable is always
the impl window now).
2009-04-02 10:15:27 +02:00
Richard Hult
65b5644cda Call _gdk_window_process_updates_recurse() in drawRect instead of creating our own expose events 2009-04-02 10:15:27 +02:00
Richard Hult
1a47356485 Remove invalidate_maybe_recurse and process_updates from the paintable interface
Replace them with two new functions
_gdk_windowing_{before,after}_process_all_updates() that are called
around the guts of gdk_window_process_all_updates(). Add empty ones
for X11 (nothing more needed), quartz ones will be implemented next.
2009-04-02 10:15:27 +02:00
Richard Hult
1ee03b35d0 Expose _gdk_window_process_updates_recurse for backends
We use this in the added windowing function
_gdk_windowing_window_process_updates_recurse. The X11 implementation
just calls _gdk_window_process_updates_recurse directly, but at least
quartz will need to do some more work.
2009-04-02 10:15:27 +02:00
Richard Hult
72d4403eed Add a window argument to begin_paint_region in the paintable interface
The paintable itself is now the impl window, which can be different
from the window.
2009-04-02 10:15:27 +02:00
Richard Hult
95cbc754d4 Setup ->impl_window on the root window 2009-04-02 10:15:27 +02:00
Richard Hult
9e0899bd2f Add gdk_windowing_window_get_next_serial 2009-04-02 10:15:27 +02:00
Richard Hult
19951c064e Remove gdk_keyboard_grab_info_libgtk_only which moved to the common code 2009-04-02 10:15:26 +02:00
Richard Hult
defc779df5 Add serial argument to _gdk_windowing_got_event 2009-04-02 10:15:26 +02:00
Alexander Larsson
32a070d09a Fix gdk_window_has_no_impl typo 2009-04-02 10:15:26 +02:00
Alexander Larsson
ca1aeff814 Only set cursors on toplevel.
This fixes a problem where we used to set them on a native window, but we
never unset it becase when the pointer moved to another native window
we just set the cursor on that window. Always setting on the toplevel
fixes this.
2009-04-02 10:15:26 +02:00
Alexander Larsson
e24c9e291d Switch motion hint emulation to be serial based.
For backends not supporting serials, just have
_gdk_windowing_window_get_next_serial return zero.
2009-04-02 10:15:26 +02:00
Alexander Larsson
19cd4d6af8 Revert "Convert all pending X events in _gdk_events_queue"
This reverts commit 7cc15ec6ea1504133dfe6febbdb12615550bb966.

Its risky to convert all the events in a go like this, as it
increases the out-of-order issues. It also isn't a full solution
to the motion hint issue as it will only work for the events
we happen to convert. It would be better to use serials to
handle motion hinting.
2009-04-02 10:15:26 +02:00
Alexander Larsson
6a0d317866 Keep track of the impl windows wrapper directly with a ref
This is needed so that the ->wrapper of the impl window doesn't
go away while there are virtual windows referencing the impl
window.
2009-04-02 10:15:26 +02:00
Alexander Larsson
cf54a2c68e Ungrab keyboard if virtual window is hidden or destroyed 2009-04-02 10:15:26 +02:00
Alexander Larsson
290de401a5 Move keyboard grab state tracking code to common code 2009-04-02 10:15:26 +02:00
Alexander Larsson
e60af9d315 Move keyboard grab info to common code
This is the first stage in tracking keyboard grabs in the common code.
This lets us handle destroying or unmapping virtual window with a
keyboard grab.
2009-04-02 10:15:26 +02:00
Alexander Larsson
c0ad534d81 Convert all pending X events in _gdk_events_queue
If we only convert the first then motion hint emulation won't
work since we don't see the next motion even until we've
fully handled this one.

However, this changes a behaviour that has been like this since
the mists of time. I don't know if it could cause other issues.
I haven't seen any yet though.
2009-04-02 10:15:25 +02:00
Alexander Larsson
cb05af0a61 Implement GDK_POINTER_MOTION_HINT_MASK support 2009-04-02 10:15:25 +02:00
Alexander Larsson
d267452bb7 New flicker flicker fixing approach
There was a performance problem with the old flicker fixing
approach. For moved windows we copied the window data to the double
buffer pixmap and then back to the window with the rest of the
expose data. In some cases the copy from window data to pixmap was
very slow because the pixmap was allocated in system memory and
the window in video memory.

The new approach is to delay all window moves and then replay them
after the expose has drawn to the double buffer pixmap but before
drawing it to the window. Furthermore, we remove all exposed areas
from the destination of the delayed moves so we won't copy something
just to then immediately draw over it.

This makes scrolling in firefox fast, and it makes tests/flicker not
show any (detectable) flicker.
2009-04-02 10:15:25 +02:00
Alexander Larsson
3155fdcd41 gdk_window_process_updates_internal only needs to flush outstanding moves 2009-04-02 10:15:25 +02:00
Alexander Larsson
4455db353f Split out the flushing of outstanding moves
Some places need to only flush the outstanding moves, split
this into gdk_window_flush_outstanding_move
2009-04-02 10:15:25 +02:00
Alexander Larsson
a9fd3ae249 Flush any outstanding stuff in the window in non-buffered get_internal_paint_info case
We return the raw window drawable, so its likely the app will do some
weird stuff to it, like draw using non-gdk operations. We don't want
the app to see any half-drawn state, so flush everything.

This fixes a scroll issue in firefox at least.
2009-04-02 10:15:25 +02:00
Alexander Larsson
815f0d7605 Clip exposed area to the visible region.
This avoids extra work, and it means we won't allocate large pixmaps
for double buffering.
2009-04-02 10:15:25 +02:00
Alexander Larsson
7da48afcaa Don't allow native window > 65535 pixels 2009-04-02 10:15:25 +02:00
Richard Hult
89f1cb5178 First cut at getting events working 2009-04-02 10:15:25 +02:00
Richard Hult
08bc1864cc Attempt to implement draw_drawable with src = dest = window 2009-04-02 10:15:25 +02:00
Richard Hult
2ea8ea2f0d Remove unused function _gdk_quartz_window_scroll 2009-04-02 10:15:24 +02:00
Richard Hult
80c8976c28 Fix typos that broke loading without lazy symbol lookup 2009-04-02 10:15:24 +02:00
Richard Hult
7ab3435a58 Remove autoreleasepool in drawRect, not necessary 2009-04-02 10:15:24 +02:00
Richard Hult
f12a992be2 Only setup tracking rect for toplevels, we only want enter/leave for those 2009-04-02 10:15:24 +02:00
Richard Hult
348abef6f2 Don't use drawable_get,release_context in _gdk_windowing_create_cairo_surface
This fixes a mismatch in save/release gstate for the CGContext. If
this function is ever used for pixmaps, we need to add support for
that, probably will have to do so soon.
2009-04-02 10:15:24 +02:00
Richard Hult
edb35763a2 Get rid of all the synthesized crossing events except for ANCESTOR one on the toplevel 2009-04-02 10:15:24 +02:00
Richard Hult
330e790fb2 Rename _gdk_quartz_events_send_map_events to ..._event 2009-04-02 10:15:24 +02:00
Richard Hult
32555badb5 Clean up some whitespace 2009-04-02 10:15:24 +02:00
Richard Hult
54e6878001 Add fill_crossing_event to be used soon 2009-04-02 10:15:24 +02:00
Richard Hult
c3637ab20f Only send map events for toplevels 2009-04-02 10:15:24 +02:00
Richard Hult
8e8aa53298 Add enter/leave notify to get_event_mask_from_ns_event now that those are handled like other events 2009-04-02 10:15:24 +02:00
Richard Hult
da8666d745 Clean up the scroll support a little 2009-04-02 10:15:24 +02:00
Richard Hult
25b311bac3 Make the various fill_*_event functions consistent 2009-04-02 10:15:24 +02:00
Richard Hult
4c01ca7ddd Rework the event translation to look more like X11
Put the event in the queue with a pending flag, remove again if not
handled.
2009-04-02 10:15:24 +02:00
Richard Hult
036e045d53 Update the window size after getting windowDidResize 2009-04-02 10:15:23 +02:00
Richard Hult
e7eb75c0ca Remove the old workarond for broken tracking rects
The one that puts windows outside the screen and moves them in when
showing. It might not be needed anymore and the workaround doesn't
work with the client-side window branch anyway because the window is
already mapped when we get showed for some reason.
2009-04-02 10:15:23 +02:00
Richard Hult
257dea55a7 Handle NULL event mask in _gdk_windowing_window_at_pointer 2009-04-02 10:15:23 +02:00
Richard Hult
19b1f6a93a Fix bug from first patch round, get private from window, not from impl 2009-04-02 10:15:23 +02:00
Richard Hult
e9d3f22ac8 Offset subviews with the parent's abs coordinate 2009-04-02 10:15:23 +02:00
Richard Hult
546a1e4cd6 Change window check to quartz window check in gdkinput 2009-04-02 10:15:23 +02:00
Richard Hult
5eacab593b Setup iface for queue_translation/antiexpose 2009-04-02 10:15:23 +02:00
Richard Hult
0e1f51ecd1 Add quartz window check macro 2009-04-02 10:15:23 +02:00
Richard Hult
a362be9979 Add stubs for queue_translation/antiexpose 2009-04-02 10:15:23 +02:00
Richard Hult
cb8a3386c7 Implement _gdk_windowing_create_cairo_surface 2009-04-02 10:15:23 +02:00
Richard Hult
f080825430 Remove gdk_display_pointer_is_grabbed and gdk_pointer_grab_info_libgtk_only 2009-04-02 10:15:23 +02:00
Richard Hult
47ed2c553d Remove gdk_window_set_child_input_shapes 2009-04-02 10:15:23 +02:00
Richard Hult
cede19dc65 Update more toplevel checks and update set_background and back_pixmap 2009-04-02 10:15:23 +02:00
Richard Hult
68640f9e99 Add mask argument to _gdk_windowing_window_at_pointer, and update more checks 2009-04-02 10:15:22 +02:00
Richard Hult
068b6f88e0 Update gdk_window_get_deskrelative_origin, gdk_window_get_root_origin, gdk_window_get_frame_extents 2009-04-02 10:15:22 +02:00
Richard Hult
3f7e3a22f5 Update gdk_window_quartz_set_background and gdk_window_quartz_set_back_pixmap 2009-04-02 10:15:22 +02:00
Richard Hult
4cf7fe5832 Add more toplevel window checks 2009-04-02 10:15:22 +02:00
Richard Hult
93d1d51e3b Update set_urgency_hint/geometry_hints/modal_hint/set_skip_taskbar_hint/set_skip_pager_hint 2009-04-02 10:15:22 +02:00
Richard Hult
27a80094bc Update gdk_window_set_type_hint and gdk_window_get_type_hint 2009-04-02 10:15:22 +02:00
Richard Hult
ff86156762 Update gdk_window_focus 2009-04-02 10:15:22 +02:00
Richard Hult
1e5a22dabe Remove gdk_window_quartz_clear_area 2009-04-02 10:15:22 +02:00
Richard Hult
f5806eac0c Update gdk_window_quartz_reparent 2009-04-02 10:15:22 +02:00
Richard Hult
2517076f76 Update gtk_window_quartz_hide 2009-04-02 10:15:22 +02:00
Richard Hult
afdb3f2ee8 Update signature for gdk_window_quartz_show and adapt the implementation 2009-04-02 10:15:22 +02:00
Richard Hult
650223ca3b Rename _gdk_windowing_window_destroy to _gdk_quartz_window_destroy and add to the impl iface 2009-04-02 10:15:22 +02:00
Richard Hult
b20991af9b Update _gdk_window_impl_new and add private variables where we changed impl to private 2009-04-02 10:15:22 +02:00
Richard Hult
b1b358c820 Remove width/height from GdkWindowImplQuartz and use those in GdkWindowObject 2009-04-02 10:15:22 +02:00
Richard Hult
774cebae69 Remove get_size and get_visible region 2009-04-02 10:15:21 +02:00
Richard Hult
1ee805f7be Don't init size in gdk_window_impl_quartz_init 2009-04-02 10:15:21 +02:00
Richard Hult
57214245da Include check for offscreen windows in WINDOW_IS_TOPLEVEL 2009-04-02 10:15:21 +02:00
Richard Hult
ff9822a833 Add reset_origin argument to _gdk_windowing_gc_set_clip_region 2009-04-02 10:15:21 +02:00
Alexander Larsson
13766991a7 testwindows - support for manually selecting window pos and size 2009-04-02 10:15:21 +02:00
Alexander Larsson
4ec5b7648b Fix typo in pixmap window backing
It should be backing_y_offset, not backing_x_offset for exposure_y_offset.
2009-04-02 10:15:21 +02:00
Alexander Larsson
d82cee80c3 Don't send expose events if region is empty 2009-04-02 10:15:21 +02:00
Alexander Larsson
8a0ef57ba3 Don't expose a temporary grab during a scrollwheel button press/release cycle.
If we do this there is a short window where we think there is a grab, and
if we generate a client side pointer motion event in this time (e.g. from
a window move) we could be delivering that according to the grab. But in
the Xserver that grab is infinitely short as it sends Press and then
Release immediately.

To see a problem from this, try using the scrollwheel to quickly scroll
in the testgtk list of buttons.
2009-04-02 10:15:21 +02:00
Alexander Larsson
7cebc68bde Handle native children correctly in gdk_window_scroll
This is basically the same fix as was done for
gdk_window_move_resize_internal. We make sure not to move the native
child window contents twice and we don't copy data that was overwritten
by the moving of the native child windows.
2009-04-02 10:15:21 +02:00
Alexander Larsson
c2ee81ea86 Add support for scrolling to testwindows 2009-04-02 10:15:21 +02:00
Alexander Larsson
50d9a9018a Ifdef out x11 specific code 2009-04-02 10:15:21 +02:00
Alexander Larsson
e718893611 Fix performance issue with find_native_sibling_above
It keep recursing a lot, unnecessary
2009-04-02 10:15:20 +02:00
Alexander Larsson
b298ebc415 Fix resize of native children
We now set the size to the right value before calling move_resize, so
the check for if the move_resize is just a move broke. Always call
move_resize()
2009-04-02 10:15:20 +02:00
Alexander Larsson
1084b8e6a1 Call backend move_resize with the right coords/size
We calculated and set the new position and size, just pass that.
This avoids parsing the "special values" again
2009-04-02 10:15:20 +02:00
Alexander Larsson
5fa1855a83 Make _gdk_x11_window_tmp_unset_parent_bg not change above the toplevel window 2009-04-02 10:15:20 +02:00
Alexander Larsson
905d328933 Make moving subwindows correctly handle native windows
Whenever a native window is moved this causes an immediate change in
the window (the window content is copied). This change conflicts can
conflict with outstanding moves or other cached changed, so we need
to flush all outstanding moves in the related windows.

To simplify the code for window move/resize the toplevel version was
split out to its own function.

Move native windows after recomputing so that we get the right new
shape before moving (and the implied copy). This means we're not
copying too much data.

Take into account the area of a moved window that contains native
subwindows, as these affect things in two ways:

First of all we shouldn't copy the original window location, as that
is copied by the native window move.

Secondly, we can't copy things  that would end up copying from the
native window move destination, as the data that used to be there is
now destroyed by the native window move.
2009-04-02 10:15:20 +02:00
Alexander Larsson
df4f4c14c7 do_move_region_bits_on_impl needs to copy from overlapping native windows too
It can happen that another native window is re-shaped over the region to
be moved, this will not destroy the data (since we're unsetting the background
when we reshape), but it will mean we need to read from this window.

We already used INCLUDE_INFERIORS, but that only handle subwindows. We fix
this by doing the copy on the toplevel, offsetting the copy to compensate for
this.
2009-04-02 10:15:20 +02:00
Alexander Larsson
6b15e248fa move_region_on_impl - shortcut if region is empty 2009-04-02 10:15:20 +02:00
Alexander Larsson
ed9cd90b72 Fix various problem with temporarily unsetting background
All the calls that unset private->parent failed if that was
not a native window (impl), instead we need to find the impl window
for the parent. Add some helper functions for this and use them.

For move/resize of child windows, we really need to recursively unset
on the parent, because moving the window could expose other native
children of the parent.

In do_shape_combine_region, only unset background if we're changing
the bounding shape (i.e. not the input shape)
2009-04-02 10:15:20 +02:00
Alexander Larsson
3c5c7f4b4d Avoid extending implicit paint size due to empty regions not working well with gdk_rectangle_union on clipbox 2009-04-02 10:15:20 +02:00
Alexander Larsson
c31ef39d76 Don't flicker when unsetting shape (using bg none) 2009-04-02 10:15:20 +02:00
Alexander Larsson
9f3e348e32 Make testwindows support multiple selected windows 2009-04-02 10:15:19 +02:00
Alexander Larsson
ef3d1893b6 Always set the shape when creating a native window.
This is not always done by recompute_visible_regions, as
the clip region doesn't change.
2009-04-02 10:15:19 +02:00
Alexander Larsson
c967cabc35 Avoid lots of unnecessary computation when moving toplevel windows
There is no need to do all these computations when moving toplevels
as that can't really change any visible regions. Nor will it cause
any exposes we need to handle.
2009-04-02 10:15:19 +02:00
Alexander Larsson
cdb405dfcf Restack native window after reparent put it on top 2009-04-02 10:15:19 +02:00
Alexander Larsson
c1884ce403 Fix up native window handling in gdk_window_lower too 2009-04-02 10:15:19 +02:00
Alexander Larsson
28c4518cca Fix up gdk_window_raise and native window creation to not move native window above windows outside the non-native parent 2009-04-02 10:15:19 +02:00
Alexander Larsson
377ca19c9f Add restack_under method to GdkWindomImpl 2009-04-02 10:15:19 +02:00
Alexander Larsson
cce1ff8eb8 Move all backend specific raise/lower code into _internal helpers 2009-04-02 10:15:19 +02:00
Alexander Larsson
e918b64088 Make sure we handle clipping in gdk_window_draw_pixbuf if gc == NULL 2009-04-02 10:15:19 +02:00
Alexander Larsson
78bbac87ed Send expose events to exposed area when changing the window shape 2009-04-02 10:15:19 +02:00
Alexander Larsson
82b181e643 Force native windows for all windows used with input events 2009-04-02 10:15:18 +02:00
Alexander Larsson
283160c712 Make xfree gdkinput code compile 2009-04-02 10:15:18 +02:00
Alexander Larsson
d6ecaca166 Handle GDK_WA_CURSOR in non-native window creation 2009-04-02 10:15:18 +02:00
Alexander Larsson
764ceead66 Include inferiors when moving window parts 2009-04-02 10:15:18 +02:00
Alexander Larsson
1ad01acbf2 Add _gdk_drawable_get_subwindow_scratch_gc as a way to get cached gcs with GDK_INCLUDE_INFERIORS 2009-04-02 10:15:18 +02:00
Alexander Larsson
4d187531e4 Set bg none while changing so we don't draw the bg color 2009-04-02 10:15:18 +02:00
Alexander Larsson
4e207a0336 tests/testwindows - play with GdkWindows 2009-04-02 10:15:18 +02:00
Alexander Larsson
5378324a18 Ref imp even in non-native windows and don't NULL out in destroy so that get_screen works after destroy. 2009-04-02 10:15:18 +02:00
Alexander Larsson
e63de13f40 Correct type checks on gdk_window_set_group entry. 2009-04-02 10:15:18 +02:00
Alexander Larsson
40827b99db When creating native window, set the native background 2009-04-02 10:15:18 +02:00
Alexander Larsson
959d940812 Need to split up impl changing and reparenting so we can recompute abs_x/y inbetween 2009-04-02 10:15:17 +02:00
Alexander Larsson
26569bd54f Avoid flickering by using more temp unset bg 2009-04-02 10:15:17 +02:00
Alexander Larsson
c8bdac7508 Recompute abs_x/y before reparenting windows due to new native window parent 2009-04-02 10:15:17 +02:00
Alexander Larsson
acf1954f12 Don't destroy NULL region 2009-04-02 10:15:17 +02:00
Alexander Larsson
4202cc0c60 Fix gdk_window_get_root_origin and gdk_window_get_frame_extents when called on non-toplevels 2009-04-02 10:15:17 +02:00
Alexander Larsson
ed5564ee3a Ensure we show native window when creating them for already visible windows 2009-04-02 10:15:17 +02:00
Alexander Larsson
d73859fe16 Move native window showing/hiding out of is_impl, we may need to do this for emulated windows too 2009-04-02 10:15:17 +02:00
Alexander Larsson
9f2c97dd80 Ensure that we always invalidate newly exposed areas, as X may not (due to temp bg none) 2009-04-02 10:15:17 +02:00
Alexander Larsson
4a0cb4a240 Various fixes for native windows:
move_region_on_impl() - doesn't need to copy anything if dx/dy == 0
Ensure that we queue an update when invalidating an empty area but we have outstanding moves
Temporarily unset background when moving native child windows
2009-04-02 10:15:17 +02:00
Alexander Larsson
76e23f00da Update abs_x/y before moving native children 2009-04-02 10:15:17 +02:00
Alexander Larsson
4442463481 Move all native children (recursively) in gdk_window_scroll 2009-04-02 10:15:16 +02:00
Alexander Larsson
f6e1b0ac17 Ensure that we're properly hiding impl window if one of its parent non-impl windows are hidden
Also, add some debug printing code to list the GdkWindow tree
2009-04-02 10:15:16 +02:00
Alexander Larsson
a38e797941 Don't remove composited childrens area when processing updates
Handle shape when processing updates
Make sure we reset the old clips before setting new cairo clips
2009-04-02 10:15:16 +02:00
Alexander Larsson
890503099f Handle mask == NULL in shape_combine_mask 2009-04-02 10:15:16 +02:00
Alexander Larsson
d7e369c27a Implement input shapes 2009-04-02 10:15:16 +02:00
Alexander Larsson
e14e05addc Remove shape_combine_mask from backend. Make X11 backend use XShapeCombineMask directly to unset region 2009-04-02 10:15:16 +02:00
Alexander Larsson
4ba2b181bf Implement shaped windows 2009-04-02 10:15:16 +02:00
Alexander Larsson
062da50b9f Add _gdk_windowing_window_get_shape 2009-04-02 10:15:16 +02:00
Alexander Larsson
0d540e935b Create _gdk_drawable_create_cairo_surface to ugly typechecking 2009-04-02 10:15:15 +02:00
Alexander Larsson
0ba99e6e7b Make gdk_windowing_window_destroy a GdkWindowImpl method 2009-04-02 10:15:15 +02:00
Alexander Larsson
36ce54878b Make _gdk_windowing_window_queue_translation a GdkWindiwImpl call 2009-04-02 10:15:15 +02:00
Alexander Larsson
f22211c881 Remove unnecessary clear_area method in GdkWindowImpl 2009-04-02 10:15:15 +02:00
Alexander Larsson
d093be43e7 For implicit grabs, we grab the *event* window, not the pointer window 2009-04-02 10:15:15 +02:00
Alexander Larsson
83ee69740e Handle cursors right with grabs 2009-04-02 10:15:15 +02:00
Alexander Larsson
7b2b9a0219 Implement cursors 2009-04-02 10:15:15 +02:00
Alexander Larsson
f2b50ff638 Fix crossing event order and some details 2009-04-02 10:15:15 +02:00
Alexander Larsson
b771c9924d New approach to motion event handling 2009-04-02 10:15:11 +02:00
Alexander Larsson
afc81c9e64 gdk_window_draw_points() - make sure we use the offset points 2009-04-02 10:14:08 +02:00
Alexander Larsson
d74d94ce69 Implement flicker free handling of window moves/resizes 2009-04-02 10:14:08 +02:00
Alexander Larsson
1f5e104495 Add _gdk_pixmap_set_as_backing which is a way to get GraphicsExposures on pixmaps reported to the window they are backing store for 2009-04-02 10:14:08 +02:00
Alexander Larsson
5587130d48 Don't access event after freeing it 2009-04-02 10:14:08 +02:00
Alexander Larsson
1babb5400b Share the code to copy impl window regions w/ update_area 2009-04-02 10:14:08 +02:00
Alexander Larsson
dc0e339697 Don't actually clear background when mapped, as that causes ugly flashed. Just queue a repaint.
This is what the X backend does too.
2009-04-02 10:14:08 +02:00
Alexander Larsson
ee4211b9a8 Move flushing code to non-implicit-paint only call.
This is in preparation for other types of buffering
2009-04-02 10:14:08 +02:00
Alexander Larsson
62a52f8fd3 Don't include composited childen in window clip region, update region when setting composited 2009-04-02 10:14:08 +02:00
Alexander Larsson
191e8d1587 Ensure native window if composite requested 2009-04-02 10:14:08 +02:00
Alexander Larsson
a9ca08f6eb Don't draw on input_only windows 2009-04-02 10:14:07 +02:00
Alexander Larsson
bb709321f0 Store colormap on impl window (necessary for e.g. foreign windows) 2009-04-02 10:14:07 +02:00
Alexander Larsson
2fa6f32d8e When reparenting, remove from old parent before setting the new parent
(otherwise we remove from the wrong parent)
2009-04-02 10:14:07 +02:00
Alexander Larsson
7536708c4b Don't sent native MotionHint masks on pointer grabs as then we won't get enought motion events reported. 2009-04-02 10:14:07 +02:00
Alexander Larsson
533d3058b8 Fix some return value warnings 2009-04-02 10:14:07 +02:00
Alexander Larsson
ede9c2cf74 Handle gdk_window_get_impl_window on root window 2009-04-02 10:14:07 +02:00
Alexander Larsson
077eab6edf Clear to end of window if passing zero width or height to gdk_window_clear_area (fixes clist/ctree clearing) 2009-04-02 10:14:07 +02:00
Alexander Larsson
ec5d176278 Move gdk_window_get_deskrelative_origin to the GdkWindowImpl and make the common code handle abs_x/y 2009-04-02 10:14:07 +02:00
Alexander Larsson
891440d288 The double get_composite_drawable case can happen for pixmap targets too, so move the code to gdk_draw_drawable 2009-04-02 10:14:07 +02:00
Alexander Larsson
b6e84d3105 Fix draw_drawable being offset when using window as source (testgtk text test) 2009-04-02 10:14:07 +02:00
Alexander Larsson
ac637d9d15 gdk_bitmap_create_from_data - drawable may be NULL 2009-04-02 10:14:06 +02:00
Alexander Larsson
be863a9056 gdk_pixmap_new - drawable may be NULL 2009-04-02 10:14:06 +02:00
Alexander Larsson
51d4efd8d2 gdk_pixmap_draw_pixbuf - gc may be NULL 2009-04-02 10:14:06 +02:00
Alexander Larsson
c7554a2c76 Don't convert foreign windows to child when reparented to non-toplevel 2009-04-02 10:14:06 +02:00
Alexander Larsson
b647c6e5fd Track clip_mask in GdkGC. Fix gdk_gc_add_drawable_clip to handle clip masks 2009-04-02 10:14:06 +02:00
Alexander Larsson
864649157d Move _gdk_gc_remove_drawable_clip from after each time its set to before each pixmap set and when adding a new different region
This means we can avoid changing the clip if we're drawing with the same gc to the same clip region
2009-04-02 10:14:06 +02:00
Alexander Larsson
e9ee842db1 Move drawable clip tracking into GdkGC 2009-04-02 10:14:06 +02:00
Alexander Larsson
5ff017e64e Move clip offsetting into _gdk_gc_intersect_clip_region 2009-04-02 10:14:06 +02:00
Alexander Larsson
6a82287005 Fix coordinates reported from gdk_window_get_pointer (had sign reversed) 2009-04-02 10:14:06 +02:00
Alexander Larsson
47acf79494 Actually report x/y_root against the root window 2009-04-02 10:14:06 +02:00
Alexander Larsson
2e3661e453 Avoid crash by not passing in NULL mask pointer to _gdk_windowing_get_pointer 2009-04-02 10:14:05 +02:00
Alexander Larsson
3a6d68e836 Add g_warning to not yet supported code 2009-04-02 10:14:05 +02:00
Alexander Larsson
aee3c571b0 Ensure we have native window before reparenting to toplevel 2009-04-02 10:14:05 +02:00
Alexander Larsson
2b9dc3338a Fix up keyboard grab handling 2009-04-02 10:14:05 +02:00
Alexander Larsson
d47ee4d797 Grab pointer on toplevel window, not on nearest native, so that we always get all events on toplevel 2009-04-02 10:14:05 +02:00
Alexander Larsson
f39bdc7e0f Make sure we change the event mask on native window if they change between toplevel and child 2009-04-02 10:14:05 +02:00
Alexander Larsson
07f76be87a Change assert to warning with some information 2009-04-02 10:14:05 +02:00
Alexander Larsson
6b1d7fd53d Make synchronized_configure work for child windows (used by in-process plugs) and ensures a native window exist 2009-04-02 10:14:05 +02:00
Alexander Larsson
346acdca54 Never set shapes on foreign windows 2009-04-02 10:14:05 +02:00
Alexander Larsson
ec4f8baa08 For foreign parents, use the real parent not the root (which is what we list as parent in the APIs) 2009-04-02 10:14:05 +02:00
Alexander Larsson
d326a638fb Really create a native window when getting xid 2009-04-02 10:14:04 +02:00
Alexander Larsson
32cd341f60 Export gdk_window_set_has_native 2009-04-02 10:14:04 +02:00
Alexander Larsson
8fc7a9547c Create native window when requesting xid 2009-04-02 10:14:04 +02:00
Alexander Larsson
579d81dc01 Add testcase showing Gtk+ flickering a lot 2009-04-02 10:14:04 +02:00
Alexander Larsson
e2d31e1447 Add offscreen testcase 2009-04-02 10:14:04 +02:00
Alexander Larsson
eabac453e6 Initial client-side-windows work
The history before this was kind of twisted as several different
approaches were tested, so that was all squashed into this initial
commit to hide the uninteresting changes and files that were later
removed.
2009-04-02 10:14:01 +02:00
Alexander Larsson
e2a2ba9d98 Revert patch that conflicts with client-side-windows work
Revert commit f4090b5c84, as that
conflicts with the client-side-windows work. Furthermore, that
change is already applied as part of the client-side-windows work.
2009-04-02 10:06:01 +02:00
557 changed files with 242760 additions and 153481 deletions

658
NEWS
View File

@@ -1,3 +1,661 @@
Overview of Changes from GTK+ 2.18.7 to 2.18.8
==============================================
* Bugs fixed:
612066 empathy hangs when clicked on information about contact...
569042 gailbooleancell does not seem to attend to changes...
609650 GtkPlug Embedded signal is not emitted when plug/socket...
609744 crash at parse_data_for_row_pseudocolor
609952 destroying a notebook window when the last tab got dragged...
610141 gtk_assistant_get_nth_page() function fails to deliver...
610184 gtk_assistant_set_current_page() segfaults...
610381 More space between toolbar icon and label
610632 gtk_info_bar_set_default_response problem
611686 focus_in/focus_out in gailtreeview.c should return FALSE...
612119 Do not scroll when middle pasting
612308 GTK+ Build error: redefinition of 'struct IPrintDialogCallback'
612346 gdk_window_set_icon_name doesn't work
612505 Entry layout not updated when underlying buffer changes
598881 Unimplemented GdkWindowImplIface methods crash gimp on OSX
* Updated translations:
Bengali India
Low German
Oriya
Polish
Overview of Changes from GTK+ 2.18.6 to 2.18.7
==============================================
* Bugs fixed:
600865 gnome-panel crashed with "BadPixmap (invalid Pixmap...
606698 Misplaced declaration of gtk_print_job_set_status
606009 weirdness with clipping in abiword - csw
607770 Leak in GtkTreeView with HildonPannableArea
603144 Suspected wrong builtin page size: Chinese PRC6 and PRC9...
607687 f-spot crashes when using themes using the pixmap engine
608807 Marks on GtkScale widgets can overlap
607508 Cannot drag windows around in pager applet any more
608615 DnD events sent to wrong window
599511 gtk_selection_owner_set causes graphical corruption...
607344 GtkCalendar: crash when using tooltips via glade
608410 GOK types backwards in text entry fields
591186 GTK Menu Bar is unreadable under Windows 7
607061 GtkPlug socket window is sometimes incorrectly unref'd...
608370 dnd drag-dest signal handlers don't get correctly dis...
608162 gtktoolbutton doesn't create right proxy menu item...
561816 Optimize gtk_paned_set_position notifications
* Translation updates:
Brazilian Portuguese
Burmese
Catalan
German
Slovenian
Spanish
Swedish
Overview of Changes from GTK+ 2.18.5 to 2.18.6
==============================================
* Client-side windows:
- Send expose events from gdk_window_clear_area_e
- Ensure native windows in gdk_property_change
- Properly compute damage when drawing line segments
- Fix an infinite recursion causing stack overflows
* Bugs fixed:
50942 selection/arrow key improvement
604747 Using gdk_draw_line, the expose area of damage...
604787 property-notify-event is not delivered...
605008 the region of damage event doens't be copied...
605036 commit adds not-yet-built libgtk-x11-2.0.la...
606068 Setup libjpeg error handling earlier...
606143 aisleriot grows X server without bounds
* Translation update:
Assamese
Basque
British English
Kannada
Overview of Changes from GTK+ 2.18.4 to 2.18.5
==============================================
* Bugs fixed:
603652 Sporadic crashes with GtkSocket
598476 gnome-screensaver crashes when entering password...
601473 GDK_BUTTON?_MOTION_MASK appears to be broken
597386 Cannot click buttons more than once without...
603619 the colormap of offscreen's pixmap doesn't...
603904 gdk_draw_line doesn't have expose area.
Overview of Changes from GTK+ 2.18.3 to 2.18.4
==============================================
* Client-side windows:
- Avoid some unnecessary exposes
- Avoid unnecessary redraws related to clearing windows
* Bugs fixed:
563010 Fix clearing the selection in GtkFileChooserButton
581150 GtkIconView tries to paint items with invalid sizes
601869 GtkUIManager assumes too much about popup menus
581145 Wrong positioning for fullscreen gedit toolbar animation
599118 Translators comment for "Finishing" labels
599321 gtk_selection_data_get_uris is broken on Windows
381371 Print margins not correct in WIN32 - not allowing...
599446 atk_object_set_name () assertion in gtk_tool_button_set_label
602725 fix setting icon-size on GICON images
588740 JPEG images open with blur effect?
602724 gailimage doesn't handle GTK_IMAGE_{GICON,ICON_NAME}...
561130 get_monitor_geometry segfaults if called with non-existant...
585383 Segfault in gdk_pixbuf__ico_image_save
123569 Catch contents being reparented out of socket
601611 gtk_selection_data_get_targets() reads X Atom data as GdkAtoms
601959 must release compose key before continuing compose sequence
603201 gtk_about_dialog_set_url_hook has no effect anymore
591438 dfb_events_dispatch is not thread safe
603128 Adding new UI that was recently removed may cause wrong order
* Updated translations:
Low German
Romanian
Russian
Slovenian
Overview of Changes from GTK+ 2.18.2 to 2.18.3
==============================================
* Make selecting the last character in a label work again
* Set accessible names on tool buttons
* Win32:
- Fix the GDI+ pixbuf loader
- Disable XP themes for now
- Build fixes
* Updated translations:
Brazilian Portuguese
Catalan
Estonian
Overview of Changes from GTK+ 2.18.1 to 2.18.2
==============================================
* GTK+ now ignores SIGPIPE in gtk_init(). Previously
this was done deep in the lpr printbackend.
* Fix compilation of the DirectFB backend.
* Bugs fixed:
597386 Cannot click buttons more than once...
588059 sometimes notification icons are not visible with csw
* Updated translations:
Italian
Japanese
Serbian
Overview of Changes from GTK+ 2.18.0 to 2.18.1
==============================================
* Client-side Windows:
- Fix a problem with the F-Spot screensaver
- Request native events that are necessary for grab emulation
- Fixes for input device and extended input event handling
- Allow up to 255 buttons in extended input events
* OS X:
- Improve handling of multi-monitor setups
- Basic DND works
- Other improvements
* Filechooser:
- Support Tracker 0.7 in the search code
* Bugs fixed:
596423 Landscape pages are the wrong way around
588449 DnD doesn't work on GDK/Quartz
596080 Mention "gtk-tooltip" in gtk_widget_set_tooltip_window
596580 Blank rows in entry autocompletion
588649 extended input events sent to widgets that didn't...
596081 Update tracker support for version 0.7
596345 clicking empty space in backgrounds...
596494 New property "cursor" in 2.18's GdkWindow with wrong...
596012 popup menu position is horribly off on gdk quartz...
596250 Gdkcursor-quartz.c doesn't implement GDK_BLANK_CURSOR
586207 Printing dialog with a CUPS printer connected...
* Translation updates:
Assamese
British English
Czech
Estonian
French
Galician
German
Hungarian
Slovenian
Spanish
Swedish
Overview of Changes from GTK+ 2.17.11 to 2.18.0
===============================================
* Add GtkTreeModelFilter testsuite and fix multiple bugs
* Client-side windows:
- Fix issues around recursion and gdk_window_process_updates
- Fix issues with grabs and cursors
- Handle window hierarchy and geometry changes in expose handlers
- New function, gdk_window_flush, that may be needed in certain
situations
- Automatically flush windows when doing non-double-buffered exposes
* Quartz backend:
- Fix various 'stuck UI' issues
- Fix the size of the root window
* Bugs fixed:
588455 run application broken when setting background color...
346800 Rework sort/filter models to use indices to parents
593678 select "Manage Custom Sizes" from print dialog hangs gedit
594652 gtk printer dialog does not understand boolean printer options
594668 Add new Xorg keysyms
591583 Padre (a wxPerl+Gtk IDE) hangs when editing Perl code...
594600 Windows only allows 64-character system-tray tooltips
594679 Fix warning in testwindows.c
594880 Drawing issues in ExoIconView
593507 AbiWord's main drawing area not exposed properly
594913 is_composited race ...
594738 Windows often do not respond to events on dual-head
503776 crash when trying to print to non-existent lpr printer
595599 Don't focus unmapped radio buttons
595790 Segfault in gtkiconfactory.c on NULL GError
588649 extended input events sent to widgets that didn't...
550939 GtkFileChooser listbox does not refresh selection
* New deprecation:
gdk_event_get_graphics_exposes has been deprecated
* Updated translations:
Afrikaans
Assamese
Bengali India
Brazilian Portuguese
British English
Catalan
Danish
Dutch
German
Greek
Gujarati
Hindi
Italian
Japanese
Lithuanian
Maithili
Malayalam
Marathi
Norwegian bokmål
Oriya
Polish
Romanian
Simplified Chinese
Slovenian
Traditional Chinese
Ukrainian
Overview of Changes from GTK+ 2.17.10 to 2.17.11
================================================
* Client-side windows:
- Add gdk_cairo_reset_clip that lets you get back the original
drawable clip
- Add gdk_window_restack to more conveniently restack child windows
- Add gdk_window_is_destroyed as a replacement for GDK_WINDOW_DESTROYED
- Deprecated GDK_WINDOW_OBJECT and GdkWindowObject
* GSEAL:
- Add gtk_widget_set_receives_default and gtk_widget_get_receives_default
accessors for GTK_RECEIVES_DEFAULT
* GtkTreeView:
- Correctly propagate insensitive state to cell renderers
* GtkTextView:
- Merge a number of scrolling-related fixes from Maemo
* Bugs fixed:
564160 gtk_combo_box_entry_set_text_column too restrictive
593868 gtk_im_multicontext_set_client_window recreate a new slave...
593644 gdk_x11_screen_get_window_manager_name should not cache...
594178 gdk-pixbuf-query-loaders segfault in write_loader_info
567124 proposal to delay doing something related to immodule...
588788 GTK+ compilation should work with automake1.10
584638 Build of gtkupdateiconcache without NLS breaks
593788 misprint in the returning value of gdk_selection_property_get
593606 Missing include in gtk/gtkcellrendereraccel.c
593877 Undefined symbols while compilation
* Translation updates:
French
Hebrew
Hungarian
Norwegian bokmål
Overview of Changes from GTK+ 2.17.9 to 2.17.10
===============================================
* Client-side windows:
- Regression fixes continue
- Multiple clipping issues have been fixed
- gdk_window_beep() works again
- gtk-demo now has a few offscreen window demos
* GSEAL:
- Several more getters and setters have been added:
gtk_widget_is_toplevel(), gtk_widget_is_drawable(), gtk_widget_set_window()
* Bugs fixed:
592752 aisleriot card drag start makes card appear behind...
592901 Crash in JPEG pixbuf loader instead of error
592263 redraw problem in text view
593011 Cannot move applet with middle click
592624 BadAccess from gdk_window_x11_set_events
592606 Activate the default button in a respose-request callback
593249 emacs and acroread don't work properly
592883 Spin cell rendererer problem with double click
588199 GtkTreeView rendering glitch while using a default...
543310 set_enable_tree_lines doesn't work when a cellrenderer...
589636 csw broke DND from panel menus
593595 broken clip handling in GtkLabel
590921 NULL should not be a valid return value for gdk_window_new()
590861 cups_printer_create_cairo_surface() sets a fallback resolution...
544724 delete new line requires two keystrokes
593001 Emit 'update-custom-widget' on page setup change
593317 gtkwindow leaks startup ID
593080 mem leak
593481 GtkEntryCompletion action-activated signal is emitted...
593135 gtk_entry_set_icon_from_pixbuf only works one time
593012 configure doesn't handle --enable-{cups,papi} correctly
592862 There is a misprint on the returning value of gdk_pixmap_lookup()
586466 GtkPrintOperation printing fails if it is the only event source
434318 printer detail acquisition needs events
593712 configure fails to to check properly for cups...
* Translation updates:
Asturian
Basque
Bengali India
Czech
Finnish
Hindi
Kannada
Oriya
Polish
Serbian
Tamil
Telugu
Overview of Changes from GTK+ 2.17.8 to 2.17.9
==============================================
* Client-side windows:
- Add a compatibility mode that falls back to always using native windows,
triggered by the GDK_NATIVE_WINDOWS environment variable
* Bugs fixed:
589367 gedit crashed with SIGSEGV in IA__g_list_last()
478519 GtkTooltip segfaults on NULL gdk-display-current-tooltip.
592461 preserve errno and use g_strerror
592403 crash when close the second terminal...
591549 Default printer in a network
526149 GtkCellRendererAccel editing conflicts with mnemonics
528283 Problems when using PageUp & PageDown to navigate Playlists pane
* Updated translations:
Bengali
Brazilian Portuguese
Breton
Bulgarian
Catalan
Estonian
Galician
Irish
Korean
Norwegian bokmål
Portuguese
Punjabi
Spanish
Swedish
Thai
Overview of Changes from GTK+ 2.17.7 to 2.17.8
==============================================
* Client-side windows:
- various fixes to expose handling
- fix memory leaks
* Minor API additions:
- New setter as part of the GSEAL effort: gtk_widget_set_allocation
* Bugs fixed:
585211 Add accessor function for GtkWidget->allocation
588437 gtk 2.17.3 causes dragging in firefox bookmarks sidebar t...
589367 gedit crashed with SIGSEGV in IA__g_list_last()
589877 Client side windows leak gdk regions
590959 Set child_has_focus flag properly
591432 There is incomplete information on the returning value of...
591434 firefox-3.5 crashed with SIGSEGV in _gdk_window_process_u...
591526 Accelerator keys with <super> modifier also triggered by ...
591751 bad memory access with duplicated id
591998 Support silent build rules with automake 1.11
592003 Shift+click should always modify selection
* Updated translations:
Brazilian
Bulgarian
Irish
Swedish
Overview of Changes from GTK+ 2.17.6 to 2.17.7
==============================================
* Client-side windows: a number of regressions related to embedding
have been fixed
* Printing: The file backend supports SVG output
* Minor API additions:
- GtkIconView gained an icon-padding property that can be used to fine-tune
how much space each column needs
- GtkTreeViewColumn grew a sort-column-id property that can be used to set
up sort columns in GtkBuilder files
- GdkWindow gained a cursor property and associated getter
- GtkFileChooser has a create-folders property to allow disabling the
"New Folder" button
- gtk_print_operation_get_n_pages_to_print: returns the number of pages
that are being printed
- New getters and setters as part of the GSEAL effort:
gtk_widget_get_allocation, gtk_widget_get_visible, gtk_widget_set_visible
* Bugs fixed:
589336 Add GtkTreeViewColumn:sort-column-id property
534462 Disable interactive search in the file chooser's shortcuts pane
161489 n the file chooser, let the left/right arrow keys switch focus...
514260 Better filtering for "Recently Used" files
509650 ATK_STATE_SHOWING state is not set properly on menu items
586374 code does not follow documentation (-> carshes when using...
590442 csw broke gvim x11 embedding
498010 gtk_tree_view_set_cursor fails if model!=NULL
555109 Synthesized crossing events should have proper coordinates
570516 Can't disable folder creation
573321 additional check in gtk_tree_model_filter_convert_child_i...
576601 Double clicking prints to the wrong printer
586100 ITEM_PADDING breaks vertical icon views
588438 awn uses 100% cpu with gtk+ 2.17.3 (csw)
589732 behavior change of gdk_window_get_type_hint
589745 Apply message in GtkAssistant
590084 print to FILE with multiple pages per sheet has bad results
590086 configure.in is broken on non-X platforms
590309 Default cover pages for CUPS printers incorrectly set
590448 [win32] build fails because gdk-pixbuf manges a path
590959 Set child_has_focus flag properly
591288 compat problem with draw_drawable being NULL
539377 Unnecessary warnings when GtkTreeView is not realized.
546005 priv->tree is not created for unrealized (I think) treeview
564695 Pressing enter key in print to file "Name" box does not p...
591218 Remove some unused variables
357655 "Print to SVG file" for GtkPrintOperation
591462 gdk_window_set_cursor doesn't work on the root window
* Updated translations:
Basque
Brazilian Portuguese
Breton
Estonian
Galician
Hebrew
Norwegian bokmål
Spanish
Swedish
Overview of Changes from GTK+ 2.17.5 to 2.17.6
==============================================
* Client-side windows:
- Several optimizations, such as client-side tracking of
viewable windows
- Clipping for drawing pixbufs on windows has been fixed
- Rendering to large subwindows has been fixed
* Changes that are relevant for translators:
- Markup has been removed from several strings
* Bugs fixed:
588398 Leak with testgtk::preview_(color|gray) and more
588943 set correct selection before emitting cursor-changed...
588076 Gnumeric fonts stopped working on upgrading gtk+ 2.17.2 -...
574674 GtkMenuItem gets Selected and Focused states when SelectC...
582674 Menu item and menu accessibles retain "showing" state aft...
588553 [csw] gdk_draw_pixbuf doesnt draw outside expose events s...
588897 Strange include x11/gdkx.h
588958 Typo in startup-id window property
589035 Context needed for a propoer translation
589275 [csw] Trying to destroy NULL regions
588964 Remove markup from translatable string in gtkfilechooserd...
587337 Suggest to use Glade instead gtk-builder-convert script
* Updated translations:
Estonian
French
Spanish
Swedish
Thai
Overview of Changes from GTK+ 2.17.4 to 2.17.5
==============================================
* Client-side windows:
- Quite a few fixes have happened for the win32 and directfb backends
* GSEAL:
- Accessors have been added for sealed members in GtkCellRenderer and
GtkWidget
* Changes that are relevant for distributors:
- The jpeg2000 pixbuf loader is now optional. Pass --with-libjasper
to configure to build it
* Bugs fixed
588373 Menus broken by client-side-windows
588379 testgtk::panes does not change the cursor on mouse over
588388 shape rendering is back
588461 gtk_editable_get_chars() behaviour change in 2.17.4
588666 Incorrect clamping of max_length
588665 insert-text signal is not emitted
588395 Crash when opening a GtkBuilder file
524066 Mandatory jpeg2000?
527583 GtkAssistant should set buttons as default widget
588694 Missing % in C code
588484 Iconview DnD fails when Destination is empty
583522 Trivial error in GtkBuilder migration documentation
150951 collapsed save dialog needs to indicate filesystem...
* Updated translations:
Brazilian Portuguese
Norwegian bokmål
Spanish
Traditional Chinese
Overview of Changes from GTK+ 2.17.3 to 2.17.4
==============================================
* GtkEntry now has model-view separation, with GtkEntryBuffer.
One intended use case for this is to support 'secure memory'
for password entries.
* The print dialog can now optionally include the page setup
controls, avoiding the need for a separate page setup dialog
in many applications.
* Coloring of visited links in GtkLabel can now be turned off, with
the ::track-visited-links property.
* Support for clipmasks in gdk_draw_pixbuf now works, this will
introduce visual changes in code that uses clipmasks when drawing
pixbufs. However, since this never worked that is unlikely to happen.
Old code using gdk_pixbuf_render_threshold_alpha masks when rendering
pixbufs will now produce truncated results at the edges.
* A number of regressions from the client-side window merge have
been fixed.
* The directfb GDK backend has been fixed to build with csw.
* Bugs fixed:
569393 gtk calendar localization YM note is wrong
587559 Popup closes immediately
551409 Print dialog should include page size and orientation
588115 gvim clipboard broken
* Updated translations:
Dutch
Estonian
Spanish
Ukrainian
Vietnamese
Overview of Changes from GTK+ 2.17.2 to 2.17.3
==============================================
* GtkFileChooser:
- Shows the size column by default now
* GtkStatusIcon:
- Has a title property, which can be used by ATs when they
read status icons
* GtkInfoBar:
- The default theme now includes color definitions for infobars
- The ::use-tooltip-style style property has been removed
* GtkMountOperation now supports interaction during unmount operations.
* The client-side windows branch has been merged; GDK now maintains
its own window hierarchy client-side, and only uses X windows where
unavoidable. Some of the benefits of this change are
- Reduced flicker
- The ability to do transformed and animated rendering of widgets
- Easier embedding of GTK+ widgets e.g. into Clutter scene graphs
This is a fundamental change to the way GDK works, so watch out for
regressions.
* Bugs fixed:
586315 Crash in GTK+ 2.14 when calling gtk.FileChooser.list_shor...
461944 pressing the volume icon in full screen shuts down the sound
490724 iconview item's height would be changed event with same m...
564063 regression: Left margin in popup menus
582025 Accelerators fail for submenus
585626 Setting widget tooltip hammers X11 server on any TCP/IP X...
585802 Add API to make GtkStatusIcon accessible with a name
585858 right-click Add-to-Booksmarks is sometimes greyed out
586330 GtkButton ignores user_underline when an image is set
318807 Offscreen windows and window redirection
587716 GtkInfoBar broken on resize
587485 GMountOperation::show-processes support
* Updated translations
Brazilian Portuguese
Estonian
Hebrew
Spanish
Swedish
Vietnamese
Overview of Changes from GTK+ 2.17.1 to 2.17.2
==============================================

View File

@@ -34,6 +34,21 @@ Release notes for 2.18
old custom_widget. Custom_widget does not get destroyed when the
tooltip goes away.
* JPEG2000 support is no longer enabled by default. It must be
explicitly turned on, by passing --with-libjasper to configure.
* GDK has been reworked to implement 'client-side windows'. This offers
exciting new possibilities, such as transformed, offscreen rendering,
but it breaks some long-standing assumptions that applications may
have about GDK windows. Setting the environment variable
GDK_NATIVE_WINDOWS makes GDK create a native X11 window for each
GDK window, which might make problematic applications work better.
* GTK+ calls signal (SIGPIPE, SIG_IGN) during initialization, to ignore
SIGPIPE signals, since these are almost never wanted in graphical
applications. If you do need to handle SIGPIPE for some reason, reset
the handler after gtk_init(), but notice that other libraries (e.g.
libdbus or gvfs) might do similar things.
Release notes for 2.16
======================
@@ -427,8 +442,4 @@ report.
Otherwise, enter a new bug report that describes the patch, and attach
the patch to that bug report.
Bug reports containing patches should include the PATCH keyword in their
keyword fields. If the patch adds to or changes the GTK+ programming
interface, the API keyword should also be included.
Patches should be in unified diff form. (The -u option to GNU diff.)
Patches should be in unified diff form. (The -up option to GNU diff.)

View File

@@ -1,117 +1,184 @@
The Win32 backend in GTK+ is not as stable or correct as the X11 one.
For prebuilt runtime and developer packages see
http://ftp.gnome.org/pub/gnome/binaries/win32/
Building GTK+ on Win32
======================
First you obviously need developer packages for the compile-time
dependencies: Pango, atk, glib, gettext-runtime, libiconv, libpng,
zlib, libtiff at least. See
http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies .
After installing the dependencies, there are two ways to build GTK+
for win32.
1) GNU tools, ./configure && make install
-----------------------------------------
This requires you have mingw and MSYS.
Use the configure script, and the resulting Makefiles (which use
libtool and gcc to do the compilation). I use this myself, but it can
be hard to setup correctly.
The full script I run to build GTK+ 2.10 unpacked from a source
distribution is as below. This is from bulding GTK+ 2.10.9, slightly
edited to make it match this 2.11 development branch. Actually I don't
use any script like this to build the development branch, as I don't
distribute any binaries from development branches.
MOD=gtk+
VER=2.10.9
THIS=$MOD-$VER
HEX=`echo $THIS | md5sum | cut -d' ' -f1`
TARGET=c:/devel/target/$HEX
DEPS="`/devel/src/tml/latest.sh glib atk cairo pango`"
sed -e 's/need_relink=yes/need_relink=no # no way --tml/' <ltmain.sh >ltmain.temp && mv ltmain.temp ltmain.sh
usedev
usemsvs6
MY_PKG_CONFIG_PATH=""
for D in $DEPS; do
PATH=/devel/dist/$D/bin:$PATH
MY_PKG_CONFIG_PATH=/devel/dist/$D/lib/pkgconfig:$MY_PKG_CONFIG_PATH
done
PKG_CONFIG_PATH=$MY_PKG_CONFIG_PATH:$PKG_CONFIG_PATH CC='gcc -mtune=pentium3 -mthreads' CPPFLAGS='-I/opt/gnu/include -I/opt/gnuwin32/include -I/opt/misc/include' LDFLAGS='-L/opt/gnu/lib -L/opt/gnuwin32/lib -L/opt/misc/lib -Wl,--enable-auto-image-base' LIBS=-lintl CFLAGS=-O2 ./configure --with-gdktarget=win32 --enable-debug=yes --disable-gtk-doc --disable-static --prefix=$TARGET &&
libtoolcacheize &&
unset MY_PKG_CONFIG_PATH &&
PATH=/devel/target/$HEX/bin:.libs:$PATH make install &&
(cd $TARGET/bin; strip --strip-unneeded *.dll *.exe) &&
(cd $TARGET/lib/gtk-2.0/2.10.0/loaders; strip --strip-unneeded *.dll) &&
(cd $TARGET/lib/gtk-2.0/2.10.0/immodules; strip --strip-unneeded *.dll) &&
(cd $TARGET/lib/gtk-2.0/2.10.0/engines; strip --strip-unneeded *.dll) &&
PATH=$TARGET/bin:$PATH gdk-pixbuf-query-loaders >$TARGET/etc/gtk-2.0/gdk-pixbuf.loaders &&
grep -v -E 'Automatically generated|Created by|LoaderDir =' <$TARGET/etc/gtk-2.0/gdk-pixbuf.loaders >$TARGET/etc/gtk-2.0/gdk-pixbuf.loaders.temp &&
mv $TARGET/etc/gtk-2.0/gdk-pixbuf.loaders.temp $TARGET/etc/gtk-2.0/gdk-pixbuf.loaders &&
grep -v -E 'Automatically generated|Created by|ModulesPath =' <$TARGET/etc/gtk-2.0/gtk.immodules >$TARGET/etc/gtk-2.0/gtk.immodules.temp &&
mv $TARGET/etc/gtk-2.0/gtk.immodules.temp $TARGET/etc/gtk-2.0/gtk.immodules &&
./gtk-zip.sh &&
(cd /devel/src/tml && zip /tmp/$MOD-dev-$VER.zip make/$THIS.make) &&
manifestify /tmp/$MOD*-$VER.zip
You should not just copy the above blindly. There are some things in
the script that are very specific to *my* build setup on *my* current
machine. For instance the "latest.sh" script, the "usedev" and
"usemsvs6" shell functions, the /devel/dist folder. The above script
is really just meant for reference, to give an idea. You really need
to understand what things like PKG_CONFIG_PATH are and set them up
properly after installing the dependencies before building GTK+.
As you see above, after running configure, one can just say "make
install", like on Unix. A post-build fix is needed, running
gdk-pixbuf-query-loaders once more to get a correct gdk-pixbuf.loaders
file.
2) Microsoft's tools
--------------------
Use the Microsoft compiler, cl and Make, nmake. Say nmake -f
makefile.msc in gdk and gtk. Be prepared to manually edit various
makefile.msc files, and the makefile snippets in build/win32.
Alternative 1 also generates Microsoft import libraries (.lib), if you
have lib.exe available. It might also work for cross-compilation from
Unix.
I use method 1 myself. Hans Breuer has been taking care of the MSVC
makefiles. At times, we disagree a bit about various issues, and for
instance the makefile.msc files might not produce identically named
DLLs and import libraries as the "autoconfiscated" makefiles and
libtool do. If this bothers you, you will have to fix the makefiles.
Using GTK+ on Win32
===================
To use GTK+ on Win32, you also need either one of the above mentioned
compilers. Other compilers might work, but don't count on it. Look for
prebuilt developer packages (DLLs, import libraries, headers) on the
above website.
Multi-threaded use of GTK+ on Win32
===================================
Multi-threaded GTK+ programs might work on Windows in special simple
cases, but not in general. Sorry. If you have all GTK+ and GDK calls
in the same thread, it might work. Otherwise, probably not at
all. Possible ways to fix this are being investigated.
Wintab
======
The tablet support uses the Wintab API. The Wintab development kit is
no longer required. The wintab.h header file is bundled with GTK+
sources. Unfortunately it seems that only Wacom tablets come with
support for the Wintab API nowadays.
--Tor Lillqvist <tml@iki.fi>, <tml@novell.com>
The Win32 backend in GTK+ is not as stable or correct as the X11 one.
For prebuilt runtime and developer packages see
http://ftp.gnome.org/pub/gnome/binaries/win32/
Building GTK+ on Win32
======================
First you obviously need developer packages for the compile-time
dependencies: Pango, atk, glib, gettext-runtime, libiconv, libpng,
zlib, libtiff at least. See
http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies .
After installing the dependencies, there are two ways to build GTK+
for win32.
1) GNU tools, ./configure && make install
-----------------------------------------
This requires you have mingw and MSYS.
Use the configure script, and the resulting Makefiles (which use
libtool and gcc to do the compilation). I use this myself, but it can
be hard to setup correctly.
The full script I run to build GTK+ 2.16 unpacked from a source
distribution is as below. This is from bulding GTK+ 2.16.5. I don't
use any script like this to build the development branch, as I don't
distribute any binaries from development branches.
# This is a shell script that calls functions and scripts from
# tml@iki.fi's personal work envíronment. It is not expected to be
# usable unmodified by others, and is included only for reference.
MOD=gtk+
VER=2.16.5
REV=1
ARCH=win32
THIS=${MOD}_${VER}-${REV}_${ARCH}
RUNZIP=${MOD}_${VER}-${REV}_${ARCH}.zip
DEVZIP=${MOD}-dev_${VER}-${REV}_${ARCH}.zip
HEX=`echo $THIS | md5sum | cut -d' ' -f1`
TARGET=c:/devel/target/$HEX
usedev
usemsvs6
(
set -x
DEPS=`latest --arch=${ARCH} glib atk cairo pango libpng zlib libtiff jpeg`
PROXY_LIBINTL=`latest --arch=${ARCH} proxy-libintl`
PKG_CONFIG_PATH=
for D in $DEPS; do
PATH=/devel/dist/${ARCH}/$D/bin:$PATH
[ -d /devel/dist/${ARCH}/$D/lib/pkgconfig ] && PKG_CONFIG_PATH=/devel/dist/${ARCH}/$D/lib/pkgconfig:$PKG_CONFIG_PATH
done
LIBPNG=`latest --arch=${ARCH} libpng`
ZLIB=`latest --arch=${ARCH} zlib`
LIBTIFF=`latest --arch=${ARCH} libtiff`
JPEG=`latest --arch=${ARCH} jpeg`
patch -p0 <<'EOF'
EOF
lt_cv_deplibs_check_method='pass_all' \
CC='gcc -mtune=pentium3 -mthreads' \
CPPFLAGS="-I/devel/dist/${ARCH}/${LIBPNG}/include \
-I/devel/dist/${ARCH}/${ZLIB}/include \
-I/devel/dist/${ARCH}/${LIBTIFF}/include \
-I/devel/dist/${ARCH}/${JPEG}/include \
-I/devel/dist/${ARCH}/${PROXY_LIBINTL}/include" \
LDFLAGS="-L/devel/dist/${ARCH}/${LIBPNG}/lib \
-L/devel/dist/${ARCH}/${ZLIB}/lib \
-L/devel/dist/${ARCH}/${LIBTIFF}/lib \
-L/devel/dist/${ARCH}/${JPEG}/lib \
-L/devel/dist/${ARCH}/${PROXY_LIBINTL}/lib -Wl,--exclude-libs=libintl.a \
-Wl,--enable-auto-image-base" \
LIBS=-lintl \
CFLAGS=-O2 \
./configure \
--with-gdktarget=win32 \
--disable-gdiplus \
--with-included-immodules \
--without-libjasper \
--enable-debug=yes \
--enable-explicit-deps=no \
--disable-gtk-doc \
--disable-static \
--prefix=$TARGET &&
libtoolcacheize &&
rm gtk/gtk.def &&
(PATH="$PWD/gdk-pixbuf/.libs:/devel/target/$HEX/bin:$PATH" make -j3 install || (rm .libtool-cache* && PATH="/devel/target/$HEX/bin:$PATH" make -j3 install)) &&
PATH="/devel/target/$HEX/bin:$PATH" gdk-pixbuf-query-loaders >/devel/target/$HEX/etc/gtk-2.0/gdk-pixbuf.loaders &&
grep -v -E 'Automatically generated|Created by|LoaderDir =' <$TARGET/etc/gtk-2.0/gdk-pixbuf.loaders >$TARGET/etc/gtk-2.0/gdk-pixbuf.loaders.temp &&
mv $TARGET/etc/gtk-2.0/gdk-pixbuf.loaders.temp $TARGET/etc/gtk-2.0/gdk-pixbuf.loaders &&
grep -v -E 'Automatically generated|Created by|ModulesPath =' <$TARGET/etc/gtk-2.0/gtk.immodules >$TARGET/etc/gtk-2.0/gtk.immodules.temp &&
mv $TARGET/etc/gtk-2.0/gtk.immodules.temp $TARGET/etc/gtk-2.0/gtk.immodules &&
./gtk-zip.sh &&
mv /tmp/${MOD}-${VER}.zip /tmp/$RUNZIP &&
mv /tmp/${MOD}-dev-${VER}.zip /tmp/$DEVZIP
) 2>&1 | tee /devel/src/tml/packaging/$THIS.log
(cd /devel && zip /tmp/$DEVZIP src/tml/packaging/$THIS.{sh,log}) &&
manifestify /tmp/$RUNZIP /tmp/$DEVZIP
You should not just copy the above blindly. There are some things in
the script that are very specific to *my* build setup on *my* current
machine. For instance the "latest" command, the "usedev" and
"usemsvs6" shell functions, the /devel/dist folder. The above script
is really just meant for reference, to give an idea. You really need
to understand what things like PKG_CONFIG_PATH are and set them up
properly after installing the dependencies before building GTK+.
As you see above, after running configure, one can just say "make
install", like on Unix. A post-build fix is needed, running
gdk-pixbuf-query-loaders once more to get a correct gdk-pixbuf.loaders
file.
For a 64-bit build you need to remove the gtk/gtk.def file and let it
be regenerated by the makefilery. This is because the 64-bit GTK dll
has a slightly different list of exported function names. This is on
purpose and not a bug. The API is the same at the source level, and
the same #defines of some function names to actually have a _utf8
suffix is used (just to keep the header simpler). But the
corresponding non-suffixed function to maintain ABI stability are not
needed in the 64-bit case (because there are no older EXEs around that
would require such for ABI stability).
2) Microsoft's tools
--------------------
Use the Microsoft compiler, cl and Make, nmake. Say nmake -f
makefile.msc in gdk and gtk. Be prepared to manually edit various
makefile.msc files, and the makefile snippets in build/win32.
Alternative 1 also generates Microsoft import libraries (.lib), if you
have lib.exe available. It might also work for cross-compilation from
Unix.
I use method 1 myself. Hans Breuer has been taking care of the MSVC
makefiles. At times, we disagree a bit about various issues, and for
instance the makefile.msc files might not produce identically named
DLLs and import libraries as the "autoconfiscated" makefiles and
libtool do. If this bothers you, you will have to fix the makefiles.
Using GTK+ on Win32
===================
To use GTK+ on Win32, you also need either one of the above mentioned
compilers. Other compilers might work, but don't count on it. Look for
prebuilt developer packages (DLLs, import libraries, headers) on the
above website.
Multi-threaded use of GTK+ on Win32
===================================
Multi-threaded GTK+ programs might work on Windows in special simple
cases, but not in general. Sorry. If you have all GTK+ and GDK calls
in the same thread, it might work. Otherwise, probably not at
all. Possible ways to fix this are being investigated.
Wintab
======
The tablet support uses the Wintab API. The Wintab development kit is
no longer required. The wintab.h header file is bundled with GTK+
sources. Unfortunately it seems that only Wacom tablets come with
support for the Wintab API nowadays.
--Tor Lillqvist <tml@iki.fi>, <tml@novell.com>

View File

@@ -14,7 +14,10 @@ DIE=0
have_libtool=false
if libtoolize --version < /dev/null > /dev/null 2>&1 ; then
libtool_version=`libtoolize --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
libtool_version=`libtoolize --version |
head -1 |
sed -e 's/^\(.*\)([^)]*)\(.*\)$/\1\2/g' \
-e 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
case $libtool_version in
1.4*|1.5*|2.2*)
have_libtool=true
@@ -45,16 +48,24 @@ fi
DIE=1
}
if automake-1.7 --version < /dev/null > /dev/null 2>&1 ; then
if automake-1.11 --version < /dev/null > /dev/null 2>&1 ; then
AUTOMAKE=automake-1.11
ACLOCAL=aclocal-1.11
else if automake-1.10 --version < /dev/null > /dev/null 2>&1 ; then
AUTOMAKE=automake-1.10
ACLOCAL=aclocal-1.10
else if automake-1.7 --version < /dev/null > /dev/null 2>&1 ; then
AUTOMAKE=automake-1.7
ACLOCAL=aclocal-1.7
else
echo
echo "You must have automake 1.7.x installed to compile $PROJECT."
echo "You must have automake 1.7.x, 1,10.x or 1.11.x installed to compile $PROJECT."
echo "Install the appropriate package for your distribution,"
echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
DIE=1
fi
fi
fi
if test "$DIE" -eq 1; then
exit 1

View File

@@ -269,7 +269,11 @@
/* #undef USE_MEDIALIB25 */
/* Define to 1 if XXM is available and should be used */
#define USE_MMX 1
#ifndef _MSC_VER
# define USE_MMX 1
#else
# undef USE_MMX
#endif
/* Define to 1 if no XInput should be used */
/* #undef XINPUT_NONE */

View File

@@ -11,9 +11,9 @@ AC_PREREQ(2.54)
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
m4_define([gtk_major_version], [2])
m4_define([gtk_minor_version], [17])
m4_define([gtk_micro_version], [3])
m4_define([gtk_interface_age], [0])
m4_define([gtk_minor_version], [18])
m4_define([gtk_micro_version], [8])
m4_define([gtk_interface_age], [8])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
m4_define([gtk_version],
@@ -31,7 +31,7 @@ m4_define([gtk_api_version], [2.0])
m4_define([gtk_binary_version], [2.10.0])
# required versions of other packages
m4_define([glib_required_version], [2.19.7])
m4_define([glib_required_version], [2.21.3])
m4_define([pango_required_version], [1.20])
m4_define([atk_required_version], [1.13.0])
m4_define([cairo_required_version], [1.6])
@@ -49,6 +49,11 @@ cflags_set=${CFLAGS+set}
AM_INIT_AUTOMAKE(no-define)
AM_CONFIG_HEADER(config.h)
# Support silent build rules, requires at least automake-1.11. Enable
# by either passing --enable-silent-rules to configure or passing V=0
# to make
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])])
#
# For each of the libraries we build, we define the following
@@ -124,6 +129,7 @@ AC_CANONICAL_HOST
MATH_LIB=-lm
AC_MSG_CHECKING([for native Win32])
LIB_EXE_MACHINE_FLAG=X86
EXE_MANIFEST_ARCHITECTURE=X86
case "$host" in
*-*-mingw*)
os_win32=yes
@@ -132,6 +138,7 @@ case "$host" in
case "$host" in
x86_64-*-*)
LIB_EXE_MACHINE_FLAG=X64
EXE_MANIFEST_ARCHITECTURE=AMD64
;;
esac
;;
@@ -142,6 +149,7 @@ esac
AC_MSG_RESULT([$os_win32])
AC_SUBST(LIB_EXE_MACHINE_FLAG)
AC_SUBST(EXE_MANIFEST_ARCHITECTURE)
case $host in
*-*-linux*)
@@ -302,6 +310,7 @@ AM_SANITY_CHECK
# Checks for programs.
AC_ISC_POSIX
AM_PROG_CC_STDC
AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_MAKE_SET
@@ -574,6 +583,7 @@ case $host in
;;
esac
AC_SUBST(MATH_LIB)
#
# see bug 162979
#
@@ -825,12 +835,13 @@ AC_ARG_WITH(libtiff,
[AC_HELP_STRING([--without-libtiff],
[disable TIFF loader for gdk-pixbuf])])
AC_ARG_WITH(libjasper,
[AC_HELP_STRING([--without-libjasper],
[disable JPEG2000 loader for gdk-pixbuf])])
[AC_HELP_STRING([--with-libjasper],
[enable JPEG2000 loader for gdk-pixbuf])])
AC_ARG_ENABLE(gdiplus,
[AC_HELP_STRING([--disable-gdiplus],
[disable GDI+ loaders for gdk-pixbuf])])
[AC_HELP_STRING([--enable-gdiplus],
[enble GDI+ loaders for gdk-pixbuf (currently known to be broken)])],,
[enable_gdiplus=no])
AM_CONDITIONAL(BUILD_GDIPLUS_LOADERS, [ test x$os_win32 = xyes && test x$enable_gdiplus != xno ])
@@ -940,11 +951,11 @@ dnl Test for libpng
fi
dnl Test for libjasper
if test x$with_libjasper != xno && test -z "$LIBJASPER"; then
if test x$with_libjasper = xyes && test -z "$LIBJASPER"; then
AC_CHECK_LIB(jasper, jas_init, LIBJASPER=-ljasper, [], -ljpeg)
fi
if test x$with_libjasper != xno && test -z "$LIBJASPER"; then
if test x$with_libjasper = xyes && test -z "$LIBJASPER"; then
AC_MSG_ERROR([
*** Checks for JPEG2000 loader failed. You can build without it by passing
*** --without-libjasper to configure])
@@ -1317,7 +1328,6 @@ GDK_PIXBUF_XLIB_PACKAGES=
GDK_PIXBUF_XLIB_EXTRA_CFLAGS=
GDK_PIXBUF_XLIB_EXTRA_LIBS=
X_PACKAGES=fontconfig
GDK_EXTRA_LIBS="$GDK_WLIBS"
GDK_EXTRA_CFLAGS=
@@ -1326,6 +1336,8 @@ GTK_DEP_PACKAGES_FOR_X=
GTK_DEP_LIBS_FOR_X=
if test "x$gdktarget" = "xx11"; then
X_PACKAGES=fontconfig
#
# We use fontconfig very peripherally when decoding the default
# settings.
@@ -1626,6 +1638,8 @@ if test "x$gdktarget" = "xx11"; then
AM_CONDITIONAL(USE_X11, true)
else
XPACKAGES=
AM_CONDITIONAL(XINPUT_XFREE, false)
AM_CONDITIONAL(USE_X11, false)
AM_CONDITIONAL(HAVE_X11R6, false)
@@ -1832,10 +1846,19 @@ AC_ARG_ENABLE(cups,
[disable cups print backend])],,
[enable_cups=auto])
if test "x$enable_cups" = "xauto"
then
if test "x$enable_cups" = "xno"; then
AM_CONDITIONAL(HAVE_CUPS, false)
else
AC_PATH_PROG(CUPS_CONFIG, cups-config, no)
if test "x$CUPS_CONFIG" != "xno"; then
if test "x$CUPS_CONFIG" = "xno"; then
if test "x$enable_cups" = "xauto"; then
AM_CONDITIONAL(HAVE_CUPS, false)
else
AC_MSG_ERROR([
*** cups not found.
])
fi
else
CUPS_CFLAGS=`$CUPS_CONFIG --cflags | sed 's/-O[0-9]*//' | sed 's/-m[^\t]*//g'`
CUPS_LIBS=`$CUPS_CONFIG --libs`
@@ -1855,26 +1878,24 @@ then
AC_SUBST(CUPS_LIBS)
AC_CHECK_HEADER(cups/cups.h,,AC_MSG_ERROR([[*** Sorry, cups-config present but cups/cups.h missing.]]))
AM_CONDITIONAL(HAVE_CUPS, true)
gtk_save_cflags="$CFLAGS"
CFLAGS="$CUPS_CFLAGS"
AC_TRY_COMPILE([#include <cups/http.h>],
[http_t http; char *s = http.authstring;],
[AC_DEFINE(HAVE_HTTP_AUTHSTRING, [],
[Define if cups http_t authstring field is accessible])],)
CFLAGS="$gtk_save_cflags"
AC_SUBST(HAVE_HTTP_AUTHSTRING)
gtk_save_libs="$LIBS"
LIBS="$CUPS_LIBS"
AC_CHECK_FUNCS(httpGetAuthString)
LIBS="$gtk_save_libs"
fi
AM_CONDITIONAL(HAVE_CUPS, test "x$CUPS_CONFIG" != "xno")
gtk_save_cflags="$CFLAGS"
CFLAGS="$CUPS_CFLAGS"
AC_TRY_COMPILE([#include <cups/http.h>],
[http_t http; char *s = http.authstring;],
[AC_DEFINE(HAVE_HTTP_AUTHSTRING, [],
[Define if cups http_t authstring field is accessible])],)
CFLAGS="$gtk_save_cflags"
AC_SUBST(HAVE_HTTP_AUTHSTRING)
gtk_save_libs="$LIBS"
LIBS="$CUPS_LIBS"
AC_CHECK_FUNCS(httpGetAuthString)
LIBS="$gtk_save_libs"
else
AM_CONDITIONAL(HAVE_CUPS, false)
fi
# Checks to see if we should compile with PAPI backend for GTK+
@@ -1885,23 +1906,27 @@ AC_ARG_ENABLE(papi,
[disable papi print backend])],,
[enable_papi=auto])
if test "x$enable_papi" = "xauto"
then
if test "x$enable_papi" = "xno"; then
AM_CONDITIONAL(HAVE_PAPI, false)
else
AC_MSG_CHECKING(libpapi)
AC_CHECK_LIB(papi, papiServiceCreate, have_papi=yes, have_papi=no)
if test $have_papi = yes; then
AC_DEFINE([HAVE_PAPI], [], [Define to 1 if libpapi available])
fi
AM_CONDITIONAL(HAVE_PAPI, test $have_papi = yes)
else
AM_CONDITIONAL(HAVE_PAPI, false)
if test "x$enable_papi" = "xyes" -a "x$have_papi" = "xno"; then
AC_MSG_ERROR([
*** papi not found.
])
fi
fi
AM_CONDITIONAL(HAVE_PAPI_CUPS, test $have_papi = yes && test "x$CUPS_CONFIG" != "xno")
AM_CONDITIONAL(HAVE_PAPI_CUPS, test "x$have_papi" = "xyes" -a "x$CUPS_CONFIG" != "xno")
gtk_save_cppflags="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS"
CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS $GDK_DEP_CFLAGS"
AC_CHECK_HEADER(cairo-pdf.h,,AC_MSG_ERROR([
*** Can't find cairo-pdf.h. You must build Cairo with the pdf
*** backend enabled.]))

View File

@@ -19,7 +19,9 @@ DEPS = \
LDADDS = \
$(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la \
$(top_builddir)/gdk/$(gdktargetlib) \
$(top_builddir)/gtk/$(gtktargetlib)
$(top_builddir)/gtk/$(gtktargetlib) \
$(GTK_DEP_LIBS) \
$(MATH_LIB)
noinst_PROGRAMS = \
testpixbuf-drawable \

View File

@@ -17,15 +17,19 @@ demos = \
dialog.c \
drawingarea.c \
editable_cells.c \
entry_buffer.c \
entry_completion.c \
expander.c \
hypertext.c \
iconview.c \
iconview_edit.c \
images.c \
links.c \
infobar.c \
links.c \
list_store.c \
menus.c \
offscreen_window.c \
offscreen_window2.c \
panes.c \
pickers.c \
pixbufs.c \
@@ -56,7 +60,8 @@ DEPS = \
LDADDS = \
$(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la \
$(top_builddir)/gdk/$(gdktargetlib) \
$(top_builddir)/gtk/$(gtktargetlib)
$(top_builddir)/gtk/$(gtktargetlib) \
$(GTK_DEP_LIBS)
bin_PROGRAMS = gtk-demo

View File

@@ -203,6 +203,10 @@ do_clipboard (GtkWidget *do_widget)
GtkClipboard *clipboard;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Clipboard demo");
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);

View File

@@ -0,0 +1,65 @@
/* Entry/Entry Buffer
*
* GtkEntryBuffer provides the text content in a GtkEntry.
*
*/
#include <gtk/gtk.h>
static GtkWidget *window = NULL;
GtkWidget *
do_entry_buffer (GtkWidget *do_widget)
{
GtkWidget *vbox;
GtkWidget *label;
GtkWidget *entry;
GtkEntryBuffer *buffer;
if (!window)
{
window = gtk_dialog_new_with_buttons ("GtkEntryBuffer",
GTK_WINDOW (do_widget),
0,
GTK_STOCK_CLOSE,
GTK_RESPONSE_NONE,
NULL);
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
g_signal_connect (window, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_vbox_new (FALSE, 5);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label), "Entries share a buffer. Typing in one is reflected in the other.");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
/* Create a buffer */
buffer = gtk_entry_buffer_new (NULL, 0);
/* Create our first entry */
entry = gtk_entry_new_with_buffer (buffer);
gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0);
/* Create the second entry */
entry = gtk_entry_new_with_buffer (buffer);
gtk_entry_set_visibility (GTK_ENTRY (entry), FALSE);
gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0);
g_object_unref (buffer);
}
if (!GTK_WIDGET_VISIBLE (window))
gtk_widget_show_all (window);
else
gtk_widget_destroy (window);
return window;
}

104
demos/gtk-demo/infobar.c Normal file
View File

@@ -0,0 +1,104 @@
/* Info bar
*
* Info bar widgets are used to report important messages to the user.
*/
#include <gtk/gtk.h>
static GtkWidget *window = NULL;
static void
on_bar_response (GtkInfoBar *info_bar,
gint response_id,
gpointer user_data)
{
GtkWidget *dialog;
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_INFO,
GTK_BUTTONS_OK,
"You clicked a button on an info bar");
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
"Your response has id %d", response_id);
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
}
GtkWidget *
do_infobar (GtkWidget *do_widget)
{
GtkWidget *frame;
GtkWidget *bar;
GtkWidget *vbox;
GtkWidget *vbox2;
GtkWidget *label;
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Info Bars");
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), vbox);
bar = gtk_info_bar_new ();
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_INFO);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_INFO");
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0);
bar = gtk_info_bar_new ();
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_WARNING);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_WARNING");
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0);
bar = gtk_info_bar_new_with_buttons (GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
g_signal_connect (bar, "response", G_CALLBACK (on_bar_response), window);
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_QUESTION);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_QUESTION");
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0);
bar = gtk_info_bar_new ();
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_ERROR);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_ERROR");
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0);
bar = gtk_info_bar_new ();
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_OTHER);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_OTHER");
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0);
frame = gtk_frame_new ("Info bars");
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 8);
vbox2 = gtk_vbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
gtk_container_add (GTK_CONTAINER (frame), vbox2);
/* Standard message dialog */
label = gtk_label_new ("An example of different info bars");
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0);
}
if (!GTK_WIDGET_VISIBLE (window))
{
gtk_widget_show_all (window);
}
else
{
gtk_widget_destroy (window);
window = NULL;
}
return window;
}

View File

@@ -43,11 +43,11 @@ activate_link (GtkWidget *label,
return FALSE;
}
static GtkWidget *window = NULL;
GtkWidget *
do_links (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
GtkWidget *box;
GtkWidget *label;
if (!window)
@@ -55,11 +55,10 @@ do_links (GtkWidget *do_widget)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Links");
gtk_container_set_border_width (GTK_CONTAINER (window), 12);
g_signal_connect (window, "destroy",
G_CALLBACK(gtk_widget_destroyed), &window);
g_signal_connect (window, "delete-event",
G_CALLBACK (gtk_true), NULL);
G_CALLBACK (gtk_widget_destroyed), &window);
label = gtk_label_new ("Some <a href=\"http://en.wikipedia.org/wiki/Text\""
"title=\"plain text\">text</a> may be marked up\n"

View File

@@ -2,10 +2,10 @@
*
* There are several widgets involved in displaying menus. The
* GtkMenuBar widget is a menu bar, which normally appears horizontally
* at the top of an application, but can also be layed out vertically.
* The GtkMenu widget is the actual menu that pops up. Both GtkMenuBar
* and GtkMenu are subclasses of GtkMenuShell; a GtkMenuShell contains
* menu items (GtkMenuItem). Each menu item contains text and/or images
* at the top of an application, but can also be layed out vertically.
* The GtkMenu widget is the actual menu that pops up. Both GtkMenuBar
* and GtkMenu are subclasses of GtkMenuShell; a GtkMenuShell contains
* menu items (GtkMenuItem). Each menu item contains text and/or images
* and can be selected by the user.
*
* There are several kinds of menu item, including plain GtkMenuItem,
@@ -22,7 +22,6 @@
* GtkUIManager provides a higher-level interface for creating menu bars
* and menus; while you can construct menus manually, most people don't
* do that. There's a separate demo for GtkUIManager.
*
*/
#include <gtk/gtk.h>
@@ -118,37 +117,35 @@ change_orientation (GtkWidget *button,
}
}
static GtkWidget *window = NULL;
GtkWidget *
do_menus (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
GtkWidget *box;
GtkWidget *box1;
GtkWidget *box2;
GtkWidget *button;
if (!window)
{
GtkWidget *menubar;
GtkWidget *menu;
GtkWidget *menuitem;
GtkAccelGroup *accel_group;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Menus");
g_signal_connect (window, "destroy",
G_CALLBACK(gtk_widget_destroyed), &window);
g_signal_connect (window, "delete-event",
G_CALLBACK (gtk_true), NULL);
accel_group = gtk_accel_group_new ();
gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
gtk_window_set_title (GTK_WINDOW (window), "menus");
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
box = gtk_hbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), box);
gtk_widget_show (box);
@@ -156,18 +153,18 @@ do_menus (GtkWidget *do_widget)
box1 = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (box), box1);
gtk_widget_show (box1);
menubar = gtk_menu_bar_new ();
gtk_box_pack_start (GTK_BOX (box1), menubar, FALSE, TRUE, 0);
gtk_widget_show (menubar);
menu = create_menu (2, TRUE);
menuitem = gtk_menu_item_new_with_label ("test\nline2");
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
gtk_widget_show (menuitem);
menuitem = gtk_menu_item_new_with_label ("foo");
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), create_menu (3, TRUE));
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
@@ -178,7 +175,7 @@ do_menus (GtkWidget *do_widget)
gtk_menu_item_set_right_justified (GTK_MENU_ITEM (menuitem), TRUE);
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
gtk_widget_show (menuitem);
box2 = gtk_vbox_new (FALSE, 10);
gtk_container_set_border_width (GTK_CONTAINER (box2), 10);
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0);

View File

@@ -0,0 +1,579 @@
/* Offscreen windows/Rotated button
*
* Offscreen windows can be used to transform parts of a widget
* hierarchy. Note that the rotated button is fully functional.
*/
#include <math.h>
#include <gtk/gtk.h>
#define GTK_TYPE_ROTATED_BIN (gtk_rotated_bin_get_type ())
#define GTK_ROTATED_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ROTATED_BIN, GtkRotatedBin))
#define GTK_ROTATED_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ROTATED_BIN, GtkRotatedBinClass))
#define GTK_IS_ROTATED_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ROTATED_BIN))
#define GTK_IS_ROTATED_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ROTATED_BIN))
#define GTK_ROTATED_BIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ROTATED_BIN, GtkRotatedBinClass))
typedef struct _GtkRotatedBin GtkRotatedBin;
typedef struct _GtkRotatedBinClass GtkRotatedBinClass;
struct _GtkRotatedBin
{
GtkContainer container;
GtkWidget *child;
GdkWindow *offscreen_window;
gdouble angle;
};
struct _GtkRotatedBinClass
{
GtkContainerClass parent_class;
};
GType gtk_rotated_bin_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_rotated_bin_new (void);
void gtk_rotated_bin_set_angle (GtkRotatedBin *bin,
gdouble angle);
/*** implementation ***/
static void gtk_rotated_bin_realize (GtkWidget *widget);
static void gtk_rotated_bin_unrealize (GtkWidget *widget);
static void gtk_rotated_bin_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void gtk_rotated_bin_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static gboolean gtk_rotated_bin_damage (GtkWidget *widget,
GdkEventExpose *event);
static gboolean gtk_rotated_bin_expose (GtkWidget *widget,
GdkEventExpose *offscreen);
static void gtk_rotated_bin_add (GtkContainer *container,
GtkWidget *child);
static void gtk_rotated_bin_remove (GtkContainer *container,
GtkWidget *widget);
static void gtk_rotated_bin_forall (GtkContainer *container,
gboolean include_internals,
GtkCallback callback,
gpointer callback_data);
static GType gtk_rotated_bin_child_type (GtkContainer *container);
G_DEFINE_TYPE (GtkRotatedBin, gtk_rotated_bin, GTK_TYPE_CONTAINER);
static void
to_child (GtkRotatedBin *bin,
double widget_x,
double widget_y,
double *x_out,
double *y_out)
{
GtkAllocation child_area;
double x, y, xr, yr;
double c, s;
double w, h;
s = sin (bin->angle);
c = cos (bin->angle);
child_area = bin->child->allocation;
w = c * child_area.width + s * child_area.height;
h = s * child_area.width + c * child_area.height;
x = widget_x;
y = widget_y;
x -= (w - child_area.width) / 2;
y -= (h - child_area.height) / 2;
x -= child_area.width / 2;
y -= child_area.height / 2;
xr = x * c + y * s;
yr = y * c - x * s;
x = xr;
y = yr;
x += child_area.width / 2;
y += child_area.height / 2;
*x_out = x;
*y_out = y;
}
static void
to_parent (GtkRotatedBin *bin,
double offscreen_x,
double offscreen_y,
double *x_out,
double *y_out)
{
GtkAllocation child_area;
double x, y, xr, yr;
double c, s;
double w, h;
s = sin (bin->angle);
c = cos (bin->angle);
child_area = bin->child->allocation;
w = c * child_area.width + s * child_area.height;
h = s * child_area.width + c * child_area.height;
x = offscreen_x;
y = offscreen_y;
x -= child_area.width / 2;
y -= child_area.height / 2;
xr = x * c - y * s;
yr = x * s + y * c;
x = xr;
y = yr;
x += child_area.width / 2;
y += child_area.height / 2;
x -= (w - child_area.width) / 2;
y -= (h - child_area.height) / 2;
*x_out = x;
*y_out = y;
}
static void
gtk_rotated_bin_class_init (GtkRotatedBinClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
widget_class->realize = gtk_rotated_bin_realize;
widget_class->unrealize = gtk_rotated_bin_unrealize;
widget_class->size_request = gtk_rotated_bin_size_request;
widget_class->size_allocate = gtk_rotated_bin_size_allocate;
widget_class->expose_event = gtk_rotated_bin_expose;
g_signal_override_class_closure (g_signal_lookup ("damage-event", GTK_TYPE_WIDGET),
GTK_TYPE_ROTATED_BIN,
g_cclosure_new (G_CALLBACK (gtk_rotated_bin_damage),
NULL, NULL));
container_class->add = gtk_rotated_bin_add;
container_class->remove = gtk_rotated_bin_remove;
container_class->forall = gtk_rotated_bin_forall;
container_class->child_type = gtk_rotated_bin_child_type;
}
static void
gtk_rotated_bin_init (GtkRotatedBin *bin)
{
GTK_WIDGET_UNSET_FLAGS (bin, GTK_NO_WINDOW);
}
GtkWidget *
gtk_rotated_bin_new (void)
{
return g_object_new (GTK_TYPE_ROTATED_BIN, NULL);
}
static GdkWindow *
pick_offscreen_child (GdkWindow *offscreen_window,
double widget_x,
double widget_y,
GtkRotatedBin *bin)
{
GtkAllocation child_area;
double x, y;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
to_child (bin, widget_x, widget_y, &x, &y);
child_area = bin->child->allocation;
if (x >= 0 && x < child_area.width &&
y >= 0 && y < child_area.height)
return bin->offscreen_window;
}
return NULL;
}
static void
offscreen_window_to_parent (GdkWindow *offscreen_window,
double offscreen_x,
double offscreen_y,
double *parent_x,
double *parent_y,
GtkRotatedBin *bin)
{
to_parent (bin, offscreen_x, offscreen_y, parent_x, parent_y);
}
static void
offscreen_window_from_parent (GdkWindow *window,
double parent_x,
double parent_y,
double *offscreen_x,
double *offscreen_y,
GtkRotatedBin *bin)
{
to_child (bin, parent_x, parent_y, offscreen_x, offscreen_y);
}
static void
gtk_rotated_bin_realize (GtkWidget *widget)
{
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
GdkWindowAttr attributes;
gint attributes_mask;
gint border_width;
GtkRequisition child_requisition;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
border_width = GTK_CONTAINER (widget)->border_width;
attributes.x = widget->allocation.x + border_width;
attributes.y = widget->allocation.y + border_width;
attributes.width = widget->allocation.width - 2 * border_width;
attributes.height = widget->allocation.height - 2 * border_width;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.event_mask = gtk_widget_get_events (widget)
| GDK_EXPOSURE_MASK
| GDK_POINTER_MOTION_MASK
| GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK
| GDK_SCROLL_MASK
| GDK_ENTER_NOTIFY_MASK
| GDK_LEAVE_NOTIFY_MASK;
attributes.visual = gtk_widget_get_visual (widget);
attributes.colormap = gtk_widget_get_colormap (widget);
attributes.wclass = GDK_INPUT_OUTPUT;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);
gdk_window_set_user_data (widget->window, widget);
g_signal_connect (widget->window, "pick-embedded-child",
G_CALLBACK (pick_offscreen_child), bin);
attributes.window_type = GDK_WINDOW_OFFSCREEN;
child_requisition.width = child_requisition.height = 0;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
attributes.width = bin->child->allocation.width;
attributes.height = bin->child->allocation.height;
}
bin->offscreen_window = gdk_window_new (gtk_widget_get_root_window (widget),
&attributes, attributes_mask);
gdk_window_set_user_data (bin->offscreen_window, widget);
if (bin->child)
gtk_widget_set_parent_window (bin->child, bin->offscreen_window);
gdk_offscreen_window_set_embedder (bin->offscreen_window, widget->window);
g_signal_connect (bin->offscreen_window, "to-embedder",
G_CALLBACK (offscreen_window_to_parent), bin);
g_signal_connect (bin->offscreen_window, "from-embedder",
G_CALLBACK (offscreen_window_from_parent), bin);
widget->style = gtk_style_attach (widget->style, widget->window);
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
gtk_style_set_background (widget->style, bin->offscreen_window, GTK_STATE_NORMAL);
gdk_window_show (bin->offscreen_window);
}
static void
gtk_rotated_bin_unrealize (GtkWidget *widget)
{
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
gdk_window_set_user_data (bin->offscreen_window, NULL);
gdk_window_destroy (bin->offscreen_window);
bin->offscreen_window = NULL;
GTK_WIDGET_CLASS (gtk_rotated_bin_parent_class)->unrealize (widget);
}
static GType
gtk_rotated_bin_child_type (GtkContainer *container)
{
GtkRotatedBin *bin = GTK_ROTATED_BIN (container);
if (bin->child)
return G_TYPE_NONE;
return GTK_TYPE_WIDGET;
}
static void
gtk_rotated_bin_add (GtkContainer *container,
GtkWidget *widget)
{
GtkRotatedBin *bin = GTK_ROTATED_BIN (container);
if (!bin->child)
{
gtk_widget_set_parent_window (widget, bin->offscreen_window);
gtk_widget_set_parent (widget, GTK_WIDGET (bin));
bin->child = widget;
}
else
g_warning ("GtkRotatedBin cannot have more than one child\n");
}
static void
gtk_rotated_bin_remove (GtkContainer *container,
GtkWidget *widget)
{
GtkRotatedBin *bin = GTK_ROTATED_BIN (container);
gboolean was_visible;
was_visible = GTK_WIDGET_VISIBLE (widget);
if (bin->child == widget)
{
gtk_widget_unparent (widget);
bin->child = NULL;
if (was_visible && GTK_WIDGET_VISIBLE (container))
gtk_widget_queue_resize (GTK_WIDGET (container));
}
}
static void
gtk_rotated_bin_forall (GtkContainer *container,
gboolean include_internals,
GtkCallback callback,
gpointer callback_data)
{
GtkRotatedBin *bin = GTK_ROTATED_BIN (container);
g_return_if_fail (callback != NULL);
if (bin->child)
(*callback) (bin->child, callback_data);
}
void
gtk_rotated_bin_set_angle (GtkRotatedBin *bin,
gdouble angle)
{
g_return_if_fail (GTK_IS_ROTATED_BIN (bin));
bin->angle = angle;
gtk_widget_queue_resize (GTK_WIDGET (bin));
gdk_window_geometry_changed (bin->offscreen_window);
}
static void
gtk_rotated_bin_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
GtkRequisition child_requisition;
double s, c;
double w, h;
child_requisition.width = 0;
child_requisition.height = 0;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
gtk_widget_size_request (bin->child, &child_requisition);
s = sin (bin->angle);
c = cos (bin->angle);
w = c * child_requisition.width + s * child_requisition.height;
h = s * child_requisition.width + c * child_requisition.height;
requisition->width = GTK_CONTAINER (widget)->border_width * 2 + w;
requisition->height = GTK_CONTAINER (widget)->border_width * 2 + h;
}
static void
gtk_rotated_bin_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
gint border_width;
gint w, h;
gdouble s, c;
widget->allocation = *allocation;
border_width = GTK_CONTAINER (widget)->border_width;
w = allocation->width - border_width * 2;
h = allocation->height - border_width * 2;
if (GTK_WIDGET_REALIZED (widget))
gdk_window_move_resize (widget->window,
allocation->x + border_width,
allocation->y + border_width,
w, h);
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
GtkRequisition child_requisition;
GtkAllocation child_allocation;
s = sin (bin->angle);
c = cos (bin->angle);
gtk_widget_get_child_requisition (bin->child, &child_requisition);
child_allocation.x = 0;
child_allocation.y = 0;
child_allocation.height = child_requisition.height;
if (c == 0.0)
child_allocation.width = h / s;
else if (s == 0.0)
child_allocation.width = w / c;
else
child_allocation.width = MIN ((w - s * child_allocation.height) / c,
(h - c * child_allocation.height) / s);
if (GTK_WIDGET_REALIZED (widget))
gdk_window_move_resize (bin->offscreen_window,
child_allocation.x,
child_allocation.y,
child_allocation.width,
child_allocation.height);
child_allocation.x = child_allocation.y = 0;
gtk_widget_size_allocate (bin->child, &child_allocation);
}
}
static gboolean
gtk_rotated_bin_damage (GtkWidget *widget,
GdkEventExpose *event)
{
gdk_window_invalidate_rect (widget->window, NULL, FALSE);
return TRUE;
}
static gboolean
gtk_rotated_bin_expose (GtkWidget *widget,
GdkEventExpose *event)
{
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
gint width, height;
gdouble s, c;
gdouble w, h;
if (GTK_WIDGET_DRAWABLE (widget))
{
if (event->window == widget->window)
{
GdkPixmap *pixmap;
GtkAllocation child_area;
cairo_t *cr;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
pixmap = gdk_offscreen_window_get_pixmap (bin->offscreen_window);
child_area = bin->child->allocation;
cr = gdk_cairo_create (widget->window);
/* transform */
s = sin (bin->angle);
c = cos (bin->angle);
w = c * child_area.width + s * child_area.height;
h = s * child_area.width + c * child_area.height;
cairo_translate (cr, (w - child_area.width) / 2, (h - child_area.height) / 2);
cairo_translate (cr, child_area.width / 2, child_area.height / 2);
cairo_rotate (cr, bin->angle);
cairo_translate (cr, -child_area.width / 2, -child_area.height / 2);
/* clip */
gdk_drawable_get_size (pixmap, &width, &height);
cairo_rectangle (cr, 0, 0, width, height);
cairo_clip (cr);
/* paint */
gdk_cairo_set_source_pixmap (cr, pixmap, 0, 0);
cairo_paint (cr);
cairo_destroy (cr);
}
}
else if (event->window == bin->offscreen_window)
{
gtk_paint_flat_box (widget->style, event->window,
GTK_STATE_NORMAL, GTK_SHADOW_NONE,
&event->area, widget, "blah",
0, 0, -1, -1);
if (bin->child)
gtk_container_propagate_expose (GTK_CONTAINER (widget),
bin->child,
event);
}
}
return FALSE;
}
/*** ***/
static void
scale_changed (GtkRange *range,
GtkRotatedBin *bin)
{
gtk_rotated_bin_set_angle (bin, gtk_range_get_value (range));
}
static GtkWidget *window = NULL;
GtkWidget *
do_offscreen_window (GtkWidget *do_widget)
{
if (!window)
{
GtkWidget *bin, *vbox, *scale, *button;
GdkColor black;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Rotated widget");
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
gdk_color_parse ("black", &black);
gtk_widget_modify_bg (window, GTK_STATE_NORMAL, &black);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
vbox = gtk_vbox_new (0, FALSE);
scale = gtk_hscale_new_with_range (0, G_PI/2, 0.01);
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
button = gtk_button_new_with_label ("A Button");
bin = gtk_rotated_bin_new ();
g_signal_connect (scale, "value-changed", G_CALLBACK (scale_changed), bin);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), bin, TRUE, TRUE, 0);
gtk_container_add (GTK_CONTAINER (bin), button);
}
if (!GTK_WIDGET_VISIBLE (window))
gtk_widget_show_all (window);
else
{
gtk_widget_destroy (window);
window = NULL;
}
return window;
}

View File

@@ -0,0 +1,500 @@
/* Offscreen windows/Effects
*
* Offscreen windows can be used to render elements multiple times to achieve
* various effects.
*/
#include <gtk/gtk.h>
#define GTK_TYPE_MIRROR_BIN (gtk_mirror_bin_get_type ())
#define GTK_MIRROR_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MIRROR_BIN, GtkMirrorBin))
#define GTK_MIRROR_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MIRROR_BIN, GtkMirrorBinClass))
#define GTK_IS_MIRROR_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MIRROR_BIN))
#define GTK_IS_MIRROR_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MIRROR_BIN))
#define GTK_MIRROR_BIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MIRROR_BIN, GtkMirrorBinClass))
typedef struct _GtkMirrorBin GtkMirrorBin;
typedef struct _GtkMirrorBinClass GtkMirrorBinClass;
struct _GtkMirrorBin
{
GtkContainer container;
GtkWidget *child;
GdkWindow *offscreen_window;
};
struct _GtkMirrorBinClass
{
GtkContainerClass parent_class;
};
GType gtk_mirror_bin_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_mirror_bin_new (void);
/*** implementation ***/
static void gtk_mirror_bin_realize (GtkWidget *widget);
static void gtk_mirror_bin_unrealize (GtkWidget *widget);
static void gtk_mirror_bin_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void gtk_mirror_bin_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static gboolean gtk_mirror_bin_damage (GtkWidget *widget,
GdkEventExpose *event);
static gboolean gtk_mirror_bin_expose (GtkWidget *widget,
GdkEventExpose *offscreen);
static void gtk_mirror_bin_add (GtkContainer *container,
GtkWidget *child);
static void gtk_mirror_bin_remove (GtkContainer *container,
GtkWidget *widget);
static void gtk_mirror_bin_forall (GtkContainer *container,
gboolean include_internals,
GtkCallback callback,
gpointer callback_data);
static GType gtk_mirror_bin_child_type (GtkContainer *container);
G_DEFINE_TYPE (GtkMirrorBin, gtk_mirror_bin, GTK_TYPE_CONTAINER);
static void
to_child (GtkMirrorBin *bin,
double widget_x,
double widget_y,
double *x_out,
double *y_out)
{
*x_out = widget_x;
*y_out = widget_y;
}
static void
to_parent (GtkMirrorBin *bin,
double offscreen_x,
double offscreen_y,
double *x_out,
double *y_out)
{
*x_out = offscreen_x;
*y_out = offscreen_y;
}
static void
gtk_mirror_bin_class_init (GtkMirrorBinClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
widget_class->realize = gtk_mirror_bin_realize;
widget_class->unrealize = gtk_mirror_bin_unrealize;
widget_class->size_request = gtk_mirror_bin_size_request;
widget_class->size_allocate = gtk_mirror_bin_size_allocate;
widget_class->expose_event = gtk_mirror_bin_expose;
g_signal_override_class_closure (g_signal_lookup ("damage-event", GTK_TYPE_WIDGET),
GTK_TYPE_MIRROR_BIN,
g_cclosure_new (G_CALLBACK (gtk_mirror_bin_damage),
NULL, NULL));
container_class->add = gtk_mirror_bin_add;
container_class->remove = gtk_mirror_bin_remove;
container_class->forall = gtk_mirror_bin_forall;
container_class->child_type = gtk_mirror_bin_child_type;
}
static void
gtk_mirror_bin_init (GtkMirrorBin *bin)
{
GTK_WIDGET_UNSET_FLAGS (bin, GTK_NO_WINDOW);
}
GtkWidget *
gtk_mirror_bin_new (void)
{
return g_object_new (GTK_TYPE_MIRROR_BIN, NULL);
}
static GdkWindow *
pick_offscreen_child (GdkWindow *offscreen_window,
double widget_x,
double widget_y,
GtkMirrorBin *bin)
{
GtkAllocation child_area;
double x, y;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
to_child (bin, widget_x, widget_y, &x, &y);
child_area = bin->child->allocation;
if (x >= 0 && x < child_area.width &&
y >= 0 && y < child_area.height)
return bin->offscreen_window;
}
return NULL;
}
static void
offscreen_window_to_parent (GdkWindow *offscreen_window,
double offscreen_x,
double offscreen_y,
double *parent_x,
double *parent_y,
GtkMirrorBin *bin)
{
to_parent (bin, offscreen_x, offscreen_y, parent_x, parent_y);
}
static void
offscreen_window_from_parent (GdkWindow *window,
double parent_x,
double parent_y,
double *offscreen_x,
double *offscreen_y,
GtkMirrorBin *bin)
{
to_child (bin, parent_x, parent_y, offscreen_x, offscreen_y);
}
static void
gtk_mirror_bin_realize (GtkWidget *widget)
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
GdkWindowAttr attributes;
gint attributes_mask;
gint border_width;
GtkRequisition child_requisition;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
border_width = GTK_CONTAINER (widget)->border_width;
attributes.x = widget->allocation.x + border_width;
attributes.y = widget->allocation.y + border_width;
attributes.width = widget->allocation.width - 2 * border_width;
attributes.height = widget->allocation.height - 2 * border_width;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.event_mask = gtk_widget_get_events (widget)
| GDK_EXPOSURE_MASK
| GDK_POINTER_MOTION_MASK
| GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK
| GDK_SCROLL_MASK
| GDK_ENTER_NOTIFY_MASK
| GDK_LEAVE_NOTIFY_MASK;
attributes.visual = gtk_widget_get_visual (widget);
attributes.colormap = gtk_widget_get_colormap (widget);
attributes.wclass = GDK_INPUT_OUTPUT;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);
gdk_window_set_user_data (widget->window, widget);
g_signal_connect (widget->window, "pick-embedded-child",
G_CALLBACK (pick_offscreen_child), bin);
attributes.window_type = GDK_WINDOW_OFFSCREEN;
child_requisition.width = child_requisition.height = 0;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
attributes.width = bin->child->allocation.width;
attributes.height = bin->child->allocation.height;
}
bin->offscreen_window = gdk_window_new (gtk_widget_get_root_window (widget),
&attributes, attributes_mask);
gdk_window_set_user_data (bin->offscreen_window, widget);
if (bin->child)
gtk_widget_set_parent_window (bin->child, bin->offscreen_window);
gdk_offscreen_window_set_embedder (bin->offscreen_window, widget->window);
g_signal_connect (bin->offscreen_window, "to-embedder",
G_CALLBACK (offscreen_window_to_parent), bin);
g_signal_connect (bin->offscreen_window, "from-embedder",
G_CALLBACK (offscreen_window_from_parent), bin);
widget->style = gtk_style_attach (widget->style, widget->window);
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
gtk_style_set_background (widget->style, bin->offscreen_window, GTK_STATE_NORMAL);
gdk_window_show (bin->offscreen_window);
}
static void
gtk_mirror_bin_unrealize (GtkWidget *widget)
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
gdk_window_set_user_data (bin->offscreen_window, NULL);
gdk_window_destroy (bin->offscreen_window);
bin->offscreen_window = NULL;
GTK_WIDGET_CLASS (gtk_mirror_bin_parent_class)->unrealize (widget);
}
static GType
gtk_mirror_bin_child_type (GtkContainer *container)
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (container);
if (bin->child)
return G_TYPE_NONE;
return GTK_TYPE_WIDGET;
}
static void
gtk_mirror_bin_add (GtkContainer *container,
GtkWidget *widget)
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (container);
if (!bin->child)
{
gtk_widget_set_parent_window (widget, bin->offscreen_window);
gtk_widget_set_parent (widget, GTK_WIDGET (bin));
bin->child = widget;
}
else
g_warning ("GtkMirrorBin cannot have more than one child\n");
}
static void
gtk_mirror_bin_remove (GtkContainer *container,
GtkWidget *widget)
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (container);
gboolean was_visible;
was_visible = GTK_WIDGET_VISIBLE (widget);
if (bin->child == widget)
{
gtk_widget_unparent (widget);
bin->child = NULL;
if (was_visible && GTK_WIDGET_VISIBLE (container))
gtk_widget_queue_resize (GTK_WIDGET (container));
}
}
static void
gtk_mirror_bin_forall (GtkContainer *container,
gboolean include_internals,
GtkCallback callback,
gpointer callback_data)
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (container);
g_return_if_fail (callback != NULL);
if (bin->child)
(*callback) (bin->child, callback_data);
}
static void
gtk_mirror_bin_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
GtkRequisition child_requisition;
child_requisition.width = 0;
child_requisition.height = 0;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
gtk_widget_size_request (bin->child, &child_requisition);
requisition->width = GTK_CONTAINER (widget)->border_width * 2 + child_requisition.width + 10;
requisition->height = GTK_CONTAINER (widget)->border_width * 2 + child_requisition.height * 2 + 10;
}
static void
gtk_mirror_bin_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
gint border_width;
gint w, h;
widget->allocation = *allocation;
border_width = GTK_CONTAINER (widget)->border_width;
w = allocation->width - border_width * 2;
h = allocation->height - border_width * 2;
if (GTK_WIDGET_REALIZED (widget))
gdk_window_move_resize (widget->window,
allocation->x + border_width,
allocation->y + border_width,
w, h);
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
GtkRequisition child_requisition;
GtkAllocation child_allocation;
gtk_widget_get_child_requisition (bin->child, &child_requisition);
child_allocation.x = 0;
child_allocation.y = 0;
child_allocation.height = child_requisition.height;
child_allocation.width = child_requisition.width;
if (GTK_WIDGET_REALIZED (widget))
gdk_window_move_resize (bin->offscreen_window,
allocation->x + border_width,
allocation->y + border_width,
child_allocation.width, child_allocation.height);
gtk_widget_size_allocate (bin->child, &child_allocation);
}
}
static gboolean
gtk_mirror_bin_damage (GtkWidget *widget,
GdkEventExpose *event)
{
gdk_window_invalidate_rect (widget->window, NULL, FALSE);
return TRUE;
}
static gboolean
gtk_mirror_bin_expose (GtkWidget *widget,
GdkEventExpose *event)
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
gint width, height;
if (GTK_WIDGET_DRAWABLE (widget))
{
if (event->window == widget->window)
{
GdkPixmap *pixmap;
cairo_t *cr;
cairo_matrix_t matrix;
cairo_pattern_t *mask;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
pixmap = gdk_offscreen_window_get_pixmap (bin->offscreen_window);
gdk_drawable_get_size (pixmap, &width, &height);
cr = gdk_cairo_create (widget->window);
cairo_save (cr);
cairo_rectangle (cr, 0, 0, width, height);
cairo_clip (cr);
/* paint the offscreen child */
gdk_cairo_set_source_pixmap (cr, pixmap, 0, 0);
cairo_paint (cr);
cairo_restore (cr);
cairo_matrix_init (&matrix, 1.0, 0.0, 0.3, 1.0, 0.0, 0.0);
cairo_matrix_scale (&matrix, 1.0, -1.0);
cairo_matrix_translate (&matrix, -10, - 3 * height - 10);
cairo_transform (cr, &matrix);
cairo_rectangle (cr, 0, height, width, height);
cairo_clip (cr);
gdk_cairo_set_source_pixmap (cr, pixmap, 0, height);
/* create linear gradient as mask-pattern to fade out the source */
mask = cairo_pattern_create_linear (0.0, height, 0.0, 2*height);
cairo_pattern_add_color_stop_rgba (mask, 0.0, 0.0, 0.0, 0.0, 0.0);
cairo_pattern_add_color_stop_rgba (mask, 0.25, 0.0, 0.0, 0.0, 0.01);
cairo_pattern_add_color_stop_rgba (mask, 0.5, 0.0, 0.0, 0.0, 0.25);
cairo_pattern_add_color_stop_rgba (mask, 0.75, 0.0, 0.0, 0.0, 0.5);
cairo_pattern_add_color_stop_rgba (mask, 1.0, 0.0, 0.0, 0.0, 1.0);
/* paint the reflection */
cairo_mask (cr, mask);
cairo_pattern_destroy (mask);
cairo_destroy (cr);
}
}
else if (event->window == bin->offscreen_window)
{
gtk_paint_flat_box (widget->style, event->window,
GTK_STATE_NORMAL, GTK_SHADOW_NONE,
&event->area, widget, "blah",
0, 0, -1, -1);
if (bin->child)
gtk_container_propagate_expose (GTK_CONTAINER (widget),
bin->child,
event);
}
}
return FALSE;
}
/*** ***/
static GtkWidget *window = NULL;
GtkWidget *
do_offscreen_window2 (GtkWidget *do_widget)
{
if (!window)
{
GtkWidget *bin, *vbox;
GtkWidget *hbox, *entry, *applybutton, *backbutton;
GtkSizeGroup *group;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Effects");
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
vbox = gtk_vbox_new (0, FALSE);
bin = gtk_mirror_bin_new ();
group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
hbox = gtk_hbox_new (FALSE, 6);
backbutton = gtk_button_new ();
gtk_container_add (GTK_CONTAINER (backbutton),
gtk_image_new_from_stock (GTK_STOCK_GO_BACK, 4));
gtk_size_group_add_widget (group, backbutton);
entry = gtk_entry_new ();
gtk_size_group_add_widget (group, entry);
applybutton = gtk_button_new ();
gtk_size_group_add_widget (group, applybutton);
gtk_container_add (GTK_CONTAINER (applybutton),
gtk_image_new_from_stock (GTK_STOCK_APPLY, 4));
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_box_pack_start (GTK_BOX (vbox), bin, TRUE, TRUE, 0);
gtk_container_add (GTK_CONTAINER (bin), hbox);
gtk_box_pack_start (GTK_BOX (hbox), backbutton, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), applybutton, FALSE, FALSE, 0);
}
if (!GTK_WIDGET_VISIBLE (window))
gtk_widget_show_all (window);
else
{
gtk_widget_destroy (window);
window = NULL;
}
return window;
}

View File

@@ -13,19 +13,19 @@
#define HEADER_HEIGHT (10*72/25.4)
#define HEADER_GAP (3*72/25.4)
typedef struct
typedef struct
{
gchar *filename;
gdouble font_size;
gint lines_per_page;
gint lines_per_page;
gchar **lines;
gint num_lines;
gint num_pages;
} PrintData;
static void
begin_print (GtkPrintOperation *operation,
begin_print (GtkPrintOperation *operation,
GtkPrintContext *context,
gpointer user_data)
{
@@ -35,9 +35,9 @@ begin_print (GtkPrintOperation *operation,
double height;
height = gtk_print_context_get_height (context) - HEADER_HEIGHT - HEADER_GAP;
data->lines_per_page = floor (height / data->font_size);
g_file_get_contents (data->filename, &contents, NULL, NULL);
data->lines = g_strsplit (contents, "\n", 0);
@@ -46,7 +46,7 @@ begin_print (GtkPrintOperation *operation,
i = 0;
while (data->lines[i] != NULL)
i++;
data->num_lines = i;
data->num_pages = (data->num_lines - 1) / data->lines_per_page + 1;
@@ -72,10 +72,10 @@ draw_page (GtkPrintOperation *operation,
width = gtk_print_context_get_width (context);
cairo_rectangle (cr, 0, 0, width, HEADER_HEIGHT);
cairo_set_source_rgb (cr, 0.8, 0.8, 0.8);
cairo_fill_preserve (cr);
cairo_set_source_rgb (cr, 0, 0, 0);
cairo_set_line_width (cr, 1);
cairo_stroke (cr);
@@ -107,19 +107,19 @@ draw_page (GtkPrintOperation *operation,
pango_layout_get_pixel_size (layout, &text_width, &text_height);
cairo_move_to (cr, width - text_width - 4, (HEADER_HEIGHT - text_height) / 2);
pango_cairo_show_layout (cr, layout);
g_object_unref (layout);
layout = gtk_print_context_create_pango_layout (context);
desc = pango_font_description_from_string ("monospace");
pango_font_description_set_size (desc, data->font_size * PANGO_SCALE);
pango_layout_set_font_description (layout, desc);
pango_font_description_free (desc);
cairo_move_to (cr, 0, HEADER_HEIGHT + HEADER_GAP);
line = page_nr * data->lines_per_page;
for (i = 0; i < data->lines_per_page && line < data->num_lines; i++)
for (i = 0; i < data->lines_per_page && line < data->num_lines; i++)
{
pango_layout_set_text (layout, data->lines[line], -1);
pango_cairo_show_layout (cr, layout);
@@ -131,7 +131,7 @@ draw_page (GtkPrintOperation *operation,
}
static void
end_print (GtkPrintOperation *operation,
end_print (GtkPrintOperation *operation,
GtkPrintContext *context,
gpointer user_data)
{
@@ -147,7 +147,9 @@ GtkWidget *
do_printing (GtkWidget *do_widget)
{
GtkPrintOperation *operation;
GtkPrintSettings *settings;
PrintData *data;
gchar *uri, *dir, *ext;
GError *error = NULL;
operation = gtk_print_operation_new ();
@@ -155,37 +157,55 @@ do_printing (GtkWidget *do_widget)
data->filename = demo_find_file ("printing.c", NULL);
data->font_size = 12.0;
g_signal_connect (G_OBJECT (operation), "begin-print",
g_signal_connect (G_OBJECT (operation), "begin-print",
G_CALLBACK (begin_print), data);
g_signal_connect (G_OBJECT (operation), "draw-page",
g_signal_connect (G_OBJECT (operation), "draw-page",
G_CALLBACK (draw_page), data);
g_signal_connect (G_OBJECT (operation), "end-print",
g_signal_connect (G_OBJECT (operation), "end-print",
G_CALLBACK (end_print), data);
gtk_print_operation_set_use_full_page (operation, FALSE);
gtk_print_operation_set_unit (operation, GTK_UNIT_POINTS);
gtk_print_operation_set_embed_page_setup (operation, TRUE);
settings = gtk_print_settings_new ();
dir = g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS);
if (dir == NULL)
dir = g_get_home_dir ();
if (g_strcmp0 (gtk_print_settings_get (settings, GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT), "ps") == 0)
ext = ".ps";
else if (g_strcmp0 (gtk_print_settings_get (settings, GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT), "svg") == 0)
ext = ".svg";
else
ext = ".pdf";
uri = g_strconcat ("file://", dir, "/", "gtk-demo", ext, NULL);
gtk_print_settings_set (settings, GTK_PRINT_SETTINGS_OUTPUT_URI, uri);
gtk_print_operation_set_print_settings (operation, settings);
gtk_print_operation_run (operation, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, GTK_WINDOW (do_widget), &error);
g_object_unref (operation);
g_object_unref (settings);
g_free (uri);
if (error)
{
GtkWidget *dialog;
dialog = gtk_message_dialog_new (GTK_WINDOW (do_widget),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
"%s", error->message);
g_error_free (error);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
gtk_widget_show (dialog);
gtk_widget_show (dialog);
}
return NULL;
}

View File

@@ -211,15 +211,15 @@ do_rotated_text (GtkWidget *do_widget)
label = gtk_label_new (text);
gtk_container_add (GTK_CONTAINER (box), label);
gtk_label_set_angle (label, 45);
gtk_label_set_angle (GTK_LABEL (label), 45);
/* Set up fancy stuff on the label */
layout = gtk_label_get_layout (label);
layout = gtk_label_get_layout (GTK_LABEL (label));
pango_cairo_context_set_shape_renderer (pango_layout_get_context (layout),
fancy_shape_renderer,
NULL, NULL);
attrs = create_fancy_attr_list_for_layout (layout);
gtk_label_set_attributes (label, attrs);
gtk_label_set_attributes (GTK_LABEL (label), attrs);
pango_attr_list_unref (attrs);
}

View File

@@ -103,5 +103,9 @@
<index id="api-index-2-16" role="2.16">
<title>Index of new symbols in 2.16</title>
<xi:include href="xml/api-index-2.16.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-2-18" role="2.18">
<title>Index of new symbols in 2.18</title>
<xi:include href="xml/api-index-2.18.xml"><xi:fallback /></xi:include>
</index>
</book>

View File

@@ -640,6 +640,7 @@ gdk_window_at_pointer
gdk_window_show
gdk_window_show_unraised
gdk_window_hide
gdk_window_is_destroyed
gdk_window_is_visible
gdk_window_is_viewable
gdk_window_get_state
@@ -661,6 +662,8 @@ gdk_window_resize
gdk_window_move_resize
gdk_window_scroll
gdk_window_move_region
gdk_window_flush
gdk_window_ensure_native
gdk_window_reparent
gdk_window_clear
gdk_window_clear_area
@@ -668,6 +671,7 @@ gdk_window_clear_area_e
gdk_window_copy_area
gdk_window_raise
gdk_window_lower
gdk_window_restack
gdk_window_focus
gdk_window_register_dnd
gdk_window_begin_resize_drag
@@ -719,6 +723,7 @@ gdk_window_set_background
gdk_window_set_back_pixmap
GDK_PARENT_RELATIVE
gdk_window_set_cursor
gdk_window_get_cursor
gdk_window_set_colormap
gdk_window_get_user_data
gdk_window_get_geometry
@@ -739,6 +744,7 @@ gdk_window_get_colormap
gdk_window_get_type
gdk_window_get_origin
gdk_window_get_deskrelative_origin
gdk_window_get_root_coords
gdk_window_get_pointer
GdkModifierType
gdk_window_get_parent
@@ -767,6 +773,10 @@ GdkPointerHooks
gdk_set_pointer_hooks
<SUBSECTION>
gdk_offscreen_window_get_pixmap
gdk_offscreen_window_set_embedder
gdk_offscreen_window_get_embedder
gdk_window_geometry_changed
gdk_window_redirect_to_drawable
gdk_window_remove_redirection
@@ -905,6 +915,7 @@ gdk_cairo_set_source_pixbuf
gdk_cairo_set_source_pixmap
gdk_cairo_rectangle
gdk_cairo_region
gdk_cairo_reset_clip
</SECTION>
<SECTION>
@@ -931,6 +942,7 @@ gdk_region_get_clipbox
gdk_region_get_rectangles
gdk_region_empty
gdk_region_equal
gdk_region_rect_equal
gdk_region_point_in
gdk_region_rect_in
GdkOverlapType

View File

@@ -85,3 +85,12 @@ Cairo paths and to use pixbufs as sources for drawing operations.
@region:
<!-- ##### FUNCTION gdk_cairo_reset_clip ##### -->
<para>
</para>
@cr:
@drawable:

View File

@@ -94,6 +94,7 @@ for the possible window states
was added in 2.8.
@GDK_DAMAGE: the content of the window has been changed. This event type
was added in 2.14.
@GDK_EVENT_LAST: marks the end of the GdkEventType enumeration. Added in 2.18
<!-- ##### ENUM GdkEventMask ##### -->
<para>

View File

@@ -15,6 +15,11 @@ header file. <filename>&lt;gdk/gdkkeysyms.h&gt;</filename> is not included in <f
it must be included independently, because the file is quite large.
</para>
<para>
Key values are regularly updated from the upstream X.org X11 implementation,
so new values are added regularly. They will be prefixed with GDK_ rather than
XF86XK_ or XK_ (for older symbols).
</para>
<para>
Key values can be converted into a string representation using
gdk_keyval_name(). The reverse function, converting a string to a key value,
is provided by gdk_keyval_from_name().

View File

@@ -175,6 +175,16 @@ included in the region, while areas overlapped an even number of times are not.
@Returns:
<!-- ##### FUNCTION gdk_region_rect_equal ##### -->
<para>
</para>
@region:
@rectangle:
@Returns:
<!-- ##### FUNCTION gdk_region_point_in ##### -->
<para>

View File

@@ -8,10 +8,18 @@ Onscreen display areas in the target window system
<para>
A #GdkWindow is a rectangular region on the screen. It's a low-level object,
used to implement high-level objects such as #GtkWidget and #GtkWindow on the
GTK+ level. A #GtkWindow is a toplevel window, the thing a user might think of
as a "window" with a titlebar and so on; a #GtkWindow may contain many #GdkWindow.
GTK+ level. A #GtkWindow is a toplevel window, the thing a user might think of
as a "window" with a titlebar and so on; a #GtkWindow may contain many #GdkWindow.
For example, each #GtkButton has a #GdkWindow associated with it.
</para>
<refsect2 id="COMPOSITED-WINDOWS"><title>Composited Windows</title>
<para>
Normally, the windowing system takes care of rendering the contents of a child
window onto its parent window. This mechanism can be intercepted by calling
gdk_window_set_composited() on the child window. For a
<firstterm>composited</firstterm> window it is the responsibility of the
application to render the window contents at the right spot.
</para>
<example id="composited-window-example"><title>Composited windows</title>
<programlisting><![CDATA[
#include <gtk/gtk.h>
@@ -54,7 +62,7 @@ transparent_expose (GtkWidget *widget,
* this handler is called after the red has been drawn. If it was
* called before then GTK would just blindly paint over our work.
*
* Note: if the child window has children, then you need a cairo 1.16
* Note: if the child window has children, then you need a cairo 1.6
* feature to make this work correctly.
*/
static gboolean
@@ -153,10 +161,10 @@ main (int argc, char **argv)
]]>
</programlisting></example>
<para>
In the example <xref linkend="composited-window-example"/>, a button is
placed inside of an event box inside of a window. The event box is
set as composited and therefore is no longer automatically drawn to
the screen.
In the example <xref linkend="composited-window-example"/>, a button is
placed inside of an event box inside of a window. The event box is
set as composited and therefore is no longer automatically drawn to
the screen.
</para>
<para>
When the contents of the event box change, an expose event is
@@ -168,8 +176,31 @@ that it wishes.
<para>
In our case, we merge the contents with a 50% transparency. We
also set the background colour of the window to red. The effect is
that the background shows through the button.
that the background shows through the button.
</para>
</refsect2>
<refsect2 id="OFFSCREEN-WINDOWS"><title>Offscreen Windows</title>
<para>
Offscreen windows are more general than composited windows, since they
allow not only to modify the rendering of the child window onto its parent,
but also to apply coordinate transformations.
</para>
<para>
To integrate an offscreen window into a window hierarchy, one has to call
gdk_window_set_embedder() and handle a number of signals. The
gdk_offscreen_window_set_embedder() and handle a number of signals. The
#GdkWindow::pick-embedded-child signal on the embedder window is used to
select an offscreen child at given coordinates, and the #GdkWindow::to-embedder
and #GdkWindow::from-embedder signals on the offscreen window are used to
translate coordinates between the embedder and the offscreen window.
</para>
<para>
For rendering an offscreen window onto its embedder, the contents of the
offscreen window are available as a pixmap, via
gdk_offscreen_window_get_pixmap().
</para>
</refsect2>
<!-- ##### SECTION See_Also ##### -->
<para>
@@ -189,6 +220,43 @@ these types.
</para>
<!-- ##### SIGNAL GdkWindow::from-embedder ##### -->
<para>
</para>
@gdkwindow: the object which received the signal.
@arg1:
@arg2:
@arg3:
@arg4:
<!-- ##### SIGNAL GdkWindow::pick-embedded-child ##### -->
<para>
</para>
@gdkwindow: the object which received the signal.
@arg1:
@arg2:
@Returns:
<!-- ##### SIGNAL GdkWindow::to-embedder ##### -->
<para>
</para>
@gdkwindow: the object which received the signal.
@arg1:
@arg2:
@arg3:
@arg4:
<!-- ##### ARG GdkWindow:cursor ##### -->
<para>
</para>
<!-- ##### ENUM GdkWindowType ##### -->
<para>
Describes the kind of window.
@@ -200,6 +268,7 @@ Describes the kind of window.
@GDK_WINDOW_DIALOG: useless/deprecated compatibility type
@GDK_WINDOW_TEMP: override redirect temporary window (used to implement #GtkMenu)
@GDK_WINDOW_FOREIGN: foreign window (see gdk_window_foreign_new())
@GDK_WINDOW_OFFSCREEN: offscreen window (see <xref linkend="OFFSCREEN-WINDOWS"/>). Since 2.18
<!-- ##### ENUM GdkWindowClass ##### -->
<para>
@@ -497,6 +566,15 @@ Deprecated equivalent of g_object_unref()
@window:
<!-- ##### FUNCTION gdk_window_is_destroyed ##### -->
<para>
</para>
@window:
@Returns:
<!-- ##### FUNCTION gdk_window_is_visible ##### -->
<para>
@@ -685,6 +763,23 @@ Deprecated equivalent of g_object_unref()
@dy:
<!-- ##### FUNCTION gdk_window_flush ##### -->
<para>
</para>
@window:
<!-- ##### FUNCTION gdk_window_ensure_native ##### -->
<para>
</para>
@window:
@Returns:
<!-- ##### FUNCTION gdk_window_reparent ##### -->
<para>
@@ -764,6 +859,16 @@ Deprecated equivalent to gdk_draw_drawable(), see that function for docs
@window:
<!-- ##### FUNCTION gdk_window_restack ##### -->
<para>
</para>
@window:
@sibling:
@above:
<!-- ##### FUNCTION gdk_window_focus ##### -->
<para>
@@ -1200,6 +1305,15 @@ window.
@cursor:
<!-- ##### FUNCTION gdk_window_get_cursor ##### -->
<para>
</para>
@window:
@Returns:
<!-- ##### MACRO gdk_window_set_colormap ##### -->
<para>
Deprecated equivalent to gdk_drawable_set_colormap()
@@ -1384,6 +1498,18 @@ Deprecated equivalent of gdk_drawable_get_type().
@Returns:
<!-- ##### FUNCTION gdk_window_get_root_coords ##### -->
<para>
</para>
@window:
@x:
@y:
@root_x:
@root_y:
<!-- ##### FUNCTION gdk_window_get_pointer ##### -->
<para>
@@ -1659,12 +1785,39 @@ Applications should never have any reason to use this facility
@Returns:
<!--
Local variables:
mode: sgml
sgml-parent-document: ("../gdk-docs.sgml" "book" "refsect2" "")
End:
-->
<!-- ##### FUNCTION gdk_offscreen_window_get_pixmap ##### -->
<para>
</para>
@window:
@Returns:
<!-- ##### FUNCTION gdk_offscreen_window_set_embedder ##### -->
<para>
</para>
@window:
@embedder:
<!-- ##### FUNCTION gdk_offscreen_window_get_embedder ##### -->
<para>
</para>
@window:
@Returns:
<!-- ##### FUNCTION gdk_window_geometry_changed ##### -->
<para>
</para>
@window:
<!-- ##### FUNCTION gdk_window_redirect_to_drawable ##### -->
@@ -1690,3 +1843,11 @@ End:
@window:
<!--
Local variables:
mode: sgml
sgml-parent-document: ("../gdk-docs.sgml" "book" "refsect2" "")
End:
-->

View File

@@ -129,6 +129,7 @@ content_files = \
drawing-model.xml \
glossary.xml \
migrating-checklist.sgml \
migrating-ClientSideWindows.sgml \
migrating-GtkAboutDialog.sgml \
migrating-GtkAction.sgml \
migrating-GtkAssistant.sgml \
@@ -159,6 +160,7 @@ expand_content_files = \
drawing-model.xml \
glossary.xml \
migrating-checklist.sgml \
migrating-ClientSideWindows.sgml \
migrating-GtkAction.sgml \
migrating-GtkComboBox.sgml \
migrating-GtkEntry-icons.sgml \
@@ -168,6 +170,7 @@ expand_content_files = \
migrating-GtkColorButton.sgml \
migrating-GtkAssistant.sgml \
migrating-GtkRecentChooser.sgml \
migrating-GtkLabel-links.sgml \
migrating-GtkLinkButton.sgml \
migrating-GtkBuilder.sgml \
migrating-GtkTooltip.sgml \

View File

@@ -177,6 +177,7 @@ that is, GUI components such as #GtkButton or #GtkTextView.
<chapter id="NumericEntry">
<title>Numeric/Text Data Entry</title>
<xi:include href="xml/gtkentry.xml" />
<xi:include href="xml/gtkentrybuffer.xml" />
<xi:include href="xml/gtkentrycompletion.xml" />
<xi:include href="xml/gtkhscale.xml" />
<xi:include href="xml/gtkvscale.xml" />
@@ -434,6 +435,7 @@ that is, GUI components such as #GtkButton or #GtkTextView.
<xi:include href="xml/migrating-GtkTooltip.sgml" />
<xi:include href="xml/migrating-GtkEntry-icons.sgml" />
<xi:include href="xml/migrating-GtkLabel-links.sgml" />
<xi:include href="xml/migrating-ClientSideWindows.sgml" />
</part>
<part>

View File

@@ -1268,7 +1268,10 @@ gtk_old_editable_get_type
<TITLE>GtkEntry</TITLE>
GtkEntry
gtk_entry_new
gtk_entry_new_with_buffer
gtk_entry_new_with_max_length
gtk_entry_get_buffer
gtk_entry_set_buffer
gtk_entry_set_text
gtk_entry_append_text
gtk_entry_prepend_text
@@ -1342,6 +1345,34 @@ GTK_ENTRY_GET_CLASS
gtk_entry_get_type
</SECTION>
<SECTION>
<FILE>gtkentrybuffer</FILE>
<TITLE>GtkEntryBuffer</TITLE>
GtkEntryBuffer
gtk_entry_buffer_new
gtk_entry_buffer_get_text
gtk_entry_buffer_set_text
gtk_entry_buffer_get_bytes
gtk_entry_buffer_get_length
gtk_entry_buffer_get_max_length
gtk_entry_buffer_set_max_length
gtk_entry_buffer_insert_text
gtk_entry_buffer_delete_text
gtk_entry_buffer_emit_deleted_text
gtk_entry_buffer_emit_inserted_text
<SUBSECTION Standard>
GTK_ENTRY_BUFFER
GTK_IS_ENTRY_BUFFER
GTK_TYPE_ENTRY_BUFFER
GTK_ENTRY_BUFFER_CLASS
GTK_IS_ENTRY_BUFFER_CLASS
GTK_ENTRY_BUFFER_GET_CLASS
GTK_ENTRY_BUFFER_MAX_SIZE
<SUBSECTION Private>
gtk_entry_buffer_get_type
</SECTION>
<SECTION>
<FILE>gtkentrycompletion</FILE>
<TITLE>GtkEntryCompletion</TITLE>
@@ -1452,6 +1483,8 @@ gtk_file_chooser_set_show_hidden
gtk_file_chooser_get_show_hidden
gtk_file_chooser_set_do_overwrite_confirmation
gtk_file_chooser_get_do_overwrite_confirmation
gtk_file_chooser_set_create_folders
gtk_file_chooser_get_create_folders
gtk_file_chooser_set_current_name
gtk_file_chooser_get_filename
gtk_file_chooser_set_filename
@@ -1939,6 +1972,8 @@ gtk_icon_view_set_column_spacing
gtk_icon_view_get_column_spacing
gtk_icon_view_set_margin
gtk_icon_view_get_margin
gtk_icon_view_set_item_padding
gtk_icon_view_get_item_padding
gtk_icon_view_select_path
gtk_icon_view_unselect_path
gtk_icon_view_path_is_selected
@@ -2275,6 +2310,8 @@ gtk_label_set_use_underline
gtk_label_set_single_line_mode
gtk_label_set_angle
gtk_label_get_current_uri
gtk_label_set_track_visited_links
gtk_label_get_track_visited_links
<SUBSECTION Standard>
GTK_LABEL
GTK_IS_LABEL
@@ -2420,6 +2457,8 @@ gtk_menu_get_title
gtk_menu_set_monitor
gtk_menu_get_monitor
gtk_menu_get_tearoff_state
gtk_menu_set_reserve_toggle_size
gtk_menu_get_reserve_toggle_size
<SUBSECTION>
gtk_menu_popdown
gtk_menu_reposition
@@ -2594,7 +2633,6 @@ gtk_message_dialog_get_type
GtkInfoBar
gtk_info_bar_new
gtk_info_bar_new_with_buttons
gtk_info_bar_set_contents
gtk_info_bar_add_action_widget
gtk_info_bar_add_button
gtk_info_bar_add_buttons
@@ -3035,6 +3073,8 @@ gtk_range_set_lower_stepper_sensitivity
gtk_range_get_lower_stepper_sensitivity
gtk_range_set_upper_stepper_sensitivity
gtk_range_get_upper_stepper_sensitivity
gtk_range_get_flippable
gtk_range_set_flippable
<SUBSECTION Standard>
GTK_RANGE
GTK_IS_RANGE
@@ -3595,6 +3635,8 @@ gtk_status_icon_set_tooltip_markup
gtk_status_icon_get_tooltip_markup
gtk_status_icon_set_has_tooltip
gtk_status_icon_get_has_tooltip
gtk_status_icon_set_title
gtk_status_icon_get_title
gtk_status_icon_set_visible
gtk_status_icon_get_visible
gtk_status_icon_set_blinking
@@ -4991,6 +5033,14 @@ gtk_cell_renderer_editing_canceled
gtk_cell_renderer_stop_editing
gtk_cell_renderer_get_fixed_size
gtk_cell_renderer_set_fixed_size
gtk_cell_renderer_get_visible
gtk_cell_renderer_set_visible
gtk_cell_renderer_get_sensitive
gtk_cell_renderer_set_sensitive
gtk_cell_renderer_get_alignment
gtk_cell_renderer_set_alignment
gtk_cell_renderer_get_padding
gtk_cell_renderer_set_padding
<SUBSECTION Standard>
GTK_CELL_RENDERER
@@ -5096,6 +5146,9 @@ gtk_cell_renderer_toggle_get_radio
gtk_cell_renderer_toggle_set_radio
gtk_cell_renderer_toggle_get_active
gtk_cell_renderer_toggle_set_active
gtk_cell_renderer_toggle_get_activatable
gtk_cell_renderer_toggle_set_activatable
<SUBSECTION Standard>
GTK_CELL_RENDERER_TOGGLE
GTK_IS_CELL_RENDERER_TOGGLE
@@ -5525,6 +5578,30 @@ gtk_widget_set_has_tooltip
gtk_widget_trigger_tooltip_query
gtk_widget_get_snapshot
gtk_widget_get_window
gtk_widget_get_allocation
gtk_widget_set_allocation
gtk_widget_get_app_paintable
gtk_widget_get_can_default
gtk_widget_set_can_default
gtk_widget_get_can_focus
gtk_widget_set_can_focus
gtk_widget_get_double_buffered
gtk_widget_get_has_window
gtk_widget_set_has_window
gtk_widget_get_sensitive
gtk_widget_is_sensitive
gtk_widget_get_state
gtk_widget_get_visible
gtk_widget_set_visible
gtk_widget_has_default
gtk_widget_has_focus
gtk_widget_has_grab
gtk_widget_is_drawable
gtk_widget_is_toplevel
gtk_widget_set_window
gtk_widget_set_receives_default
gtk_widget_get_receives_default
<SUBSECTION>
gtk_requisition_copy
gtk_requisition_free
@@ -6550,6 +6627,7 @@ gtk_print_operation_set_print_settings
gtk_print_operation_get_print_settings
gtk_print_operation_set_job_name
gtk_print_operation_set_n_pages
gtk_print_operation_get_n_pages_to_print
gtk_print_operation_set_current_page
gtk_print_operation_set_use_full_page
gtk_print_operation_set_unit
@@ -6568,6 +6646,8 @@ gtk_print_operation_set_support_selection
gtk_print_operation_get_support_selection
gtk_print_operation_set_has_selection
gtk_print_operation_get_has_selection
gtk_print_operation_set_embed_page_setup
gtk_print_operation_get_embed_page_setup
gtk_print_run_page_setup_dialog
GtkPageSetupDoneFunc
gtk_print_run_page_setup_dialog_async
@@ -6616,6 +6696,9 @@ gtk_print_unix_dialog_set_support_selection
gtk_print_unix_dialog_get_support_selection
gtk_print_unix_dialog_set_has_selection
gtk_print_unix_dialog_get_has_selection
gtk_print_unix_dialog_set_embed_page_setup
gtk_print_unix_dialog_get_embed_page_setup
gtk_print_unix_dialog_get_page_setup_set
GtkPrintCapabilities
gtk_print_unix_dialog_set_manual_capabilities
gtk_print_unix_dialog_get_manual_capabilities

View File

@@ -48,6 +48,7 @@ gtk_curve_get_type
gtk_dialog_get_type
gtk_drawing_area_get_type
gtk_editable_get_type
gtk_entry_buffer_get_type
gtk_entry_completion_get_type
gtk_entry_get_type
gtk_event_box_get_type

View File

@@ -0,0 +1,70 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<chapter id="gtk-migrating-ClientSideWindows">
<title>Migrating to client-side windows</title>
<para>
In version 2.18, GDK has been changed to use client-side windows. This
means that there is no longer a 1-1 correspondence between #GdkWindows
and windows in the underlying window system. In particular, it is no
longer correct to assume that each window has an associated XID.
Code that makes this assumption can sometimes be fixed by calling
gdk_window_ensure_native() on the windows in question.
Calling gdk_x11_drawable_get_xid() (or GDK_WINDOW_XID()) from the
X11-specific API on a non-native window will explicitly call
gdk_window_ensure_native(), so old code using this will continue to
work. A small gotcha is that the GDK_WINDOW_XID() call is no longer a
trivial accessor for the XID of the window, and thus must not be called
from another thread without taking locking precautions.
</para>
<para>
GDK looks for the <envar>GDK_NATIVE_WINDOWS</envar> environment variable
and makes all windows native if it is set. It also tries to be more
compatible with the way prior versions worked in some other ways.
</para>
<para>
Some applications assume that they can just operate on the X windows
corresponding to their GDK windows without ever telling GDK. One
example that we've seen is changing the child window stacking order
using XRestackWindows(). Fixing this properly requires to fix the code
to use GDK functions to achieve whatever it is trying to achieve.
To make this easier in the case of stacking order changes, we've added
a gdk_window_restack() function.
</para>
<para>
One change that can cause problems for some applications is that GDK
is more aggressive about optimizing away expose events. Code that does
more than just repainting exposed areas in response to expose events
may be affected by this.
</para>
<para>
Problems can also occur when using cairo for drawing. One thing that can
go wrong is clip handling. If you ever need to reset the clip region on
a cairo_t (i.e. use cairo_reset_clip()), you have to to use
gdk_cairo_reset_clip() instead. The reason for this is that the cairo_reset_clip() call will remove the initial clip region that limits your drawing to
the client-side window at hand, so you will end up drawing over stuff
outside the window. You also need to use gdk_cairo_reset_clip() if you
use a cairo_t that was not allocated in a double-buffered expose handler
and keep it in use after window hierarchy changes (resizing, moving,
stacking order changes). The easiest fix for this kind of problem is to
simply create a new cairo context for each expose event.
</para>
<para>
Due to a weird API in XClearArea the gdk_window_clear_area() call handled
a specified width or height of zero to mean "to end of window" for
non-double-buffered drawing. This has been changed to be consistent with
the docs and what happens in the double-buffered case. All code in GTK+
that relied on this has been fixed, but it is possible (although unlikely)
that third party applications rely on this. If you need to do this, just
implement it yourself using gdk_drawable_get_size().
</para>
</chapter>

View File

@@ -13,21 +13,18 @@
</para>
<para>
A good way to start a migration from libglade to GtkBuilder is
to run the <link linkend="gtk-builder-convert">gtk-builder-convert</link>
utility on your glade file, and inspect the resulting output.
If your code uses the @root parameter of glade_xml_new(), you
may want to split your glade file into multiple GtkBuilder files
by using the <option>--root</option> option of
<application>gtk-builder-convert</application>. Alternatively, you
can use gtk_builder_add_objects_from_file() to construct only certain
A good way to start a migration from libglade to GtkBuilder is using
<application>glade3</application> to convert your .glade file.
If your code uses the @root parameter of glade_xml_new(),
you can use gtk_builder_add_objects_from_file() to construct only certain
objects from a GtkBuilder file.
</para>
<para>
Alternatively, you can open the glade file with
<application>glade3</application> and then save it in GtkBuilder
format. This is supported by glade3 since version 3.6.
Alternatively, GTK+ also offers the
<link linkend="gtk-builder-convert">gtk-builder-convert</link> script you can use
to do the conversion; in which case you should be careful to inspect the output
and make sure you didn't lose any data.
</para>
<table pgwide="1" frame="topbot">
@@ -53,7 +50,7 @@ GError* error = NULL;
GtkBuilder* builder = gtk_builder_new (<!-- -->);
if (!gtk_builder_add_from_file (builder, FILE, &amp;error))
{
g_warning ("Couldn't load builder file: %amp;s", error->message);
g_warning ("Couldn't load builder file: &percnt;s", error->message);
g_error_free (error);
}
</screen>

View File

@@ -7,10 +7,10 @@
<title>Migrating from SexyIconEntry to GtkEntry</title>
<para>
GTK+ 2.16 supports showing icons inside a #GtkEntry, similar to
SexyIconEntry. Porting from SexyIconEntry to GtkEntry is relatively
straightforward. The main difference between the two APIs is that
SexyIconEntry uses #GtkImage widgets in a somewhat awkward way as
GTK+ 2.16 supports showing icons inside a #GtkEntry, similar to
SexyIconEntry. Porting from SexyIconEntry to GtkEntry is relatively
straightforward. The main difference between the two APIs is that
SexyIconEntry uses #GtkImage widgets in a somewhat awkward way as
storage vehicles for icons, while GtkEntry allows to specify icons
via pixbufs, stock ids, icon names or #GIcons. So, if your code uses
e.g.:
@@ -130,7 +130,7 @@ text_changed_cb (GtkEntry *entry,
gtk_entry_set_icon_from_stock (GTK_ENTRY (entry),
GTK_ENTRY_ICON_SECONDARY,
GTK_STOCK_CLEAR);
g_signal_connect (entry, "icon-pressed",
g_signal_connect (entry, "icon-press",
G_CALLBACK (icon_pressed_cb), NULL);
g_signal_connect (entry, "notify::text",
G_CALLBACK (text_changed_cb), find_button);

View File

@@ -130,7 +130,7 @@
<structname>GtkIconView</structname>:
<itemizedlist>
<listitem><para>
<typename>GnomeIconListMode</typename> is replaced by the
<type>GnomeIconListMode</type> is replaced by the
<link linkend="GtkIconView--orientation">orientation</link>
property of <structname>GtkIconView</structname>
</para></listitem>

View File

@@ -341,6 +341,16 @@ nevertheless.
</para>
</formalpara>
<formalpara>
<title><envar>GDK_NATIVE_WINDOWS</envar></title>
<para>
If set, GDK creates all windows as native windows. This can help
applications that make assumptions about 1-1 correspondence between
GDK windows and X11 windows.
</para>
</formalpara>
<formalpara>
<title><envar>XDG_DATA_HOME</envar>, <envar>XDG_DATA_DIRS</envar></title>

View File

@@ -1033,6 +1033,25 @@ You may not attach these to signals created with the
</para>
<!-- ##### STRUCT GtkEntryBufferClass ##### -->
<para>
</para>
@parent_class:
@inserted_text:
@deleted_text:
@get_text:
@get_length:
@insert_text:
@delete_text:
@_gtk_reserved0:
@_gtk_reserved1:
@_gtk_reserved2:
@_gtk_reserved3:
@_gtk_reserved4:
@_gtk_reserved5:
<!-- ##### ARG GtkFileChooser:file-system ##### -->
<para>
@@ -3866,14 +3885,6 @@ fundamental type.
@group_cycling:
@Returns:
<!-- ##### FUNCTION gtk_widget_get_allocation ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_get_usize ##### -->
<para>

View File

@@ -282,3 +282,79 @@ it cannot be individually modified.
@height:
<!-- ##### FUNCTION gtk_cell_renderer_get_visible ##### -->
<para>
</para>
@cell:
@Returns:
<!-- ##### FUNCTION gtk_cell_renderer_set_visible ##### -->
<para>
</para>
@cell:
@visible:
<!-- ##### FUNCTION gtk_cell_renderer_get_sensitive ##### -->
<para>
</para>
@cell:
@Returns:
<!-- ##### FUNCTION gtk_cell_renderer_set_sensitive ##### -->
<para>
</para>
@cell:
@sensitive:
<!-- ##### FUNCTION gtk_cell_renderer_get_alignment ##### -->
<para>
</para>
@cell:
@xalign:
@yalign:
<!-- ##### FUNCTION gtk_cell_renderer_set_alignment ##### -->
<para>
</para>
@cell:
@xalign:
@yalign:
<!-- ##### FUNCTION gtk_cell_renderer_get_padding ##### -->
<para>
</para>
@cell:
@xpad:
@ypad:
<!-- ##### FUNCTION gtk_cell_renderer_set_padding ##### -->
<para>
</para>
@cell:
@xpad:
@ypad:

View File

@@ -103,3 +103,21 @@ property. When activated, it emits the toggled signal.
@setting:
<!-- ##### FUNCTION gtk_cell_renderer_toggle_get_activatable ##### -->
<para>
</para>
@toggle:
@Returns:
<!-- ##### FUNCTION gtk_cell_renderer_toggle_set_activatable ##### -->
<para>
</para>
@toggle:
@setting:

View File

@@ -173,6 +173,11 @@ The #GtkEntry-struct struct contains only private data.
</para>
<!-- ##### ARG GtkEntry:buffer ##### -->
<para>
</para>
<!-- ##### ARG GtkEntry:caps-lock-warning ##### -->
<para>
@@ -401,6 +406,15 @@ The #GtkEntry-struct struct contains only private data.
@Returns:
<!-- ##### FUNCTION gtk_entry_new_with_buffer ##### -->
<para>
</para>
@buffer:
@Returns:
<!-- ##### FUNCTION gtk_entry_new_with_max_length ##### -->
<para>
</para>
@@ -409,6 +423,24 @@ The #GtkEntry-struct struct contains only private data.
@Returns:
<!-- ##### FUNCTION gtk_entry_get_buffer ##### -->
<para>
</para>
@entry:
@Returns:
<!-- ##### FUNCTION gtk_entry_set_buffer ##### -->
<para>
</para>
@entry:
@buffer:
<!-- ##### FUNCTION gtk_entry_set_text ##### -->
<para>

View File

@@ -0,0 +1,168 @@
<!-- ##### SECTION Title ##### -->
GtkEntryBuffer
<!-- ##### SECTION Short_Description ##### -->
<!-- ##### SECTION Long_Description ##### -->
<para>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GtkEntryBuffer ##### -->
<para>
</para>
<!-- ##### SIGNAL GtkEntryBuffer::deleted-text ##### -->
<para>
</para>
@entrybuffer: the object which received the signal.
@arg1:
@arg2:
<!-- ##### SIGNAL GtkEntryBuffer::inserted-text ##### -->
<para>
</para>
@entrybuffer: the object which received the signal.
@arg1:
@arg2:
@arg3:
<!-- ##### ARG GtkEntryBuffer:length ##### -->
<para>
</para>
<!-- ##### ARG GtkEntryBuffer:max-length ##### -->
<para>
</para>
<!-- ##### ARG GtkEntryBuffer:text ##### -->
<para>
</para>
<!-- ##### FUNCTION gtk_entry_buffer_new ##### -->
<para>
</para>
@initial_chars:
@n_initial_chars:
@Returns:
<!-- ##### FUNCTION gtk_entry_buffer_get_text ##### -->
<para>
</para>
@buffer:
@Returns:
<!-- ##### FUNCTION gtk_entry_buffer_set_text ##### -->
<para>
</para>
@buffer:
@chars:
@n_chars:
<!-- ##### FUNCTION gtk_entry_buffer_get_bytes ##### -->
<para>
</para>
@buffer:
@Returns:
<!-- ##### FUNCTION gtk_entry_buffer_get_length ##### -->
<para>
</para>
@buffer:
@Returns:
<!-- ##### FUNCTION gtk_entry_buffer_get_max_length ##### -->
<para>
</para>
@buffer:
@Returns:
<!-- ##### FUNCTION gtk_entry_buffer_set_max_length ##### -->
<para>
</para>
@buffer:
@max_length:
<!-- ##### FUNCTION gtk_entry_buffer_insert_text ##### -->
<para>
</para>
@buffer:
@position:
@chars:
@n_chars:
@Returns:
<!-- ##### FUNCTION gtk_entry_buffer_delete_text ##### -->
<para>
</para>
@buffer:
@position:
@n_chars:
@Returns:
<!-- ##### FUNCTION gtk_entry_buffer_emit_deleted_text ##### -->
<para>
</para>
@buffer:
@position:
@n_chars:
<!-- ##### FUNCTION gtk_entry_buffer_emit_inserted_text ##### -->
<para>
</para>
@buffer:
@position:
@chars:
@n_chars:

View File

@@ -677,6 +677,11 @@ gtk_widget_destroy (chooser);
</para>
<!-- ##### ARG GtkFileChooser:create-folders ##### -->
<para>
</para>
<!-- ##### ARG GtkFileChooser:do-overwrite-confirmation ##### -->
<para>
@@ -875,6 +880,24 @@ gtk_widget_destroy (chooser);
@Returns:
<!-- ##### FUNCTION gtk_file_chooser_set_create_folders ##### -->
<para>
</para>
@chooser:
@create_folders:
<!-- ##### FUNCTION gtk_file_chooser_get_create_folders ##### -->
<para>
</para>
@chooser:
@Returns:
<!-- ##### FUNCTION gtk_file_chooser_set_current_name ##### -->
<para>

View File

@@ -109,6 +109,11 @@ private fields and should not be directly accessed.
</para>
<!-- ##### ARG GtkIconView:item-padding ##### -->
<para>
</para>
<!-- ##### ARG GtkIconView:item-width ##### -->
<para>
@@ -491,6 +496,24 @@ selected rows. It will be called on every selected row in the view.
@Returns:
<!-- ##### FUNCTION gtk_icon_view_set_item_padding ##### -->
<para>
</para>
@icon_view:
@item_padding:
<!-- ##### FUNCTION gtk_icon_view_get_item_padding ##### -->
<para>
</para>
@icon_view:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_select_path ##### -->
<para>

View File

@@ -196,7 +196,7 @@ functions), but they will all return %NULL values.
@GTK_IMAGE_ANIMATION: the widget contains a #GdkPixbufAnimation
@GTK_IMAGE_ICON_NAME: the widget contains a named icon.
This image type was added in GTK+ 2.6
@GTK_IMAGE_GICON: the widgte contains a #GIcon.
@GTK_IMAGE_GICON: the widget contains a #GIcon.
This image type was added in GTK+ 2.14
<!-- ##### FUNCTION gtk_image_get_icon_set ##### -->

View File

@@ -301,6 +301,11 @@ described below.
</para>
<!-- ##### ARG GtkLabel:track-visited-links ##### -->
<para>
</para>
<!-- ##### ARG GtkLabel:use-markup ##### -->
<para>
@@ -746,3 +751,21 @@ Sets the text within the GtkLabel widget.
@Returns:
<!-- ##### FUNCTION gtk_label_set_track_visited_links ##### -->
<para>
</para>
@label:
@track_links:
<!-- ##### FUNCTION gtk_label_get_track_visited_links ##### -->
<para>
</para>
@label:
@Returns:

View File

@@ -119,6 +119,11 @@ should be accessed using the functions below.
</para>
<!-- ##### ARG GtkMenu:reserve-toggle-size ##### -->
<para>
</para>
<!-- ##### ARG GtkMenu:tearoff-state ##### -->
<para>
@@ -354,6 +359,24 @@ See gtk_menu_set_accel_group().
@Returns:
<!-- ##### FUNCTION gtk_menu_set_reserve_toggle_size ##### -->
<para>
</para>
@menu:
@reserve_toggle_size:
<!-- ##### FUNCTION gtk_menu_get_reserve_toggle_size ##### -->
<para>
</para>
@menu:
@Returns:
<!-- ##### FUNCTION gtk_menu_popdown ##### -->
<para>
Removes the menu from the screen.

View File

@@ -19,19 +19,21 @@ A GtkToolItem containing a button with an additional dropdown menu
<!-- ##### SECTION See_Also ##### -->
<para>
<varlistentry>
<term>#GtkToolbar</term>
<listitem><para>The toolbar widget</para></listitem>
<term>#GtkToolButton</term>
<listitem>
<para>
The parent class of #GtkMenuToolButton. The properties
"label_widget", "label", "icon_widget", and "stock_id" on
#GtkToolButton determine the label and icon used on
#GtkMenuToolButton<!-- -->s.
</para>
</listitem>
</varlistentry>
<variablelist>
<varlistentry>
<term>#GtkToolbar</term>
<listitem><para>The toolbar widget</para></listitem>
<term>#GtkToolButton</term>
<listitem>
<para>
The parent class of #GtkMenuToolButton. The properties
"label_widget", "label", "icon_widget", and "stock_id" on
#GtkToolButton determine the label and icon used on
#GtkMenuToolButton<!-- -->s.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<!-- ##### SECTION Stability_Level ##### -->

View File

@@ -208,6 +208,11 @@ Printing support was added in GTK+ 2.10.
</para>
<!-- ##### ARG GtkPrintOperation:embed-page-setup ##### -->
<para>
</para>
<!-- ##### ARG GtkPrintOperation:export-filename ##### -->
<para>
@@ -228,6 +233,11 @@ Printing support was added in GTK+ 2.10.
</para>
<!-- ##### ARG GtkPrintOperation:n-pages-to-print ##### -->
<para>
</para>
<!-- ##### ARG GtkPrintOperation:print-settings ##### -->
<para>
@@ -414,6 +424,15 @@ The #GQuark used for #GtkPrintError errors.
@n_pages:
<!-- ##### FUNCTION gtk_print_operation_get_n_pages_to_print ##### -->
<para>
</para>
@op:
@Returns:
<!-- ##### FUNCTION gtk_print_operation_set_current_page ##### -->
<para>
@@ -576,6 +595,24 @@ The #GQuark used for #GtkPrintError errors.
@Returns:
<!-- ##### FUNCTION gtk_print_operation_set_embed_page_setup ##### -->
<para>
</para>
@op:
@embed:
<!-- ##### FUNCTION gtk_print_operation_get_embed_page_setup ##### -->
<para>
</para>
@op:
@Returns:
<!-- ##### FUNCTION gtk_print_run_page_setup_dialog ##### -->
<para>

View File

@@ -90,6 +90,11 @@ The GtkPrintUnixDialog implementation of the GtkBuildable interface exposes its
</para>
<!-- ##### ARG GtkPrintUnixDialog:embed-page-setup ##### -->
<para>
</para>
<!-- ##### ARG GtkPrintUnixDialog:has-selection ##### -->
<para>
@@ -239,6 +244,33 @@ The GtkPrintUnixDialog implementation of the GtkBuildable interface exposes its
@Returns:
<!-- ##### FUNCTION gtk_print_unix_dialog_set_embed_page_setup ##### -->
<para>
</para>
@dialog:
@embed:
<!-- ##### FUNCTION gtk_print_unix_dialog_get_embed_page_setup ##### -->
<para>
</para>
@dialog:
@Returns:
<!-- ##### FUNCTION gtk_print_unix_dialog_get_page_setup_set ##### -->
<para>
</para>
@dialog:
@Returns:
<!-- ##### ENUM GtkPrintCapabilities ##### -->
<para>
An enum for specifying which features the print dialog should offer.
@@ -256,7 +288,7 @@ formats are supported.
the printer in PDF format
@GTK_PRINT_CAPABILITY_GENERATE_PS: The program will send the document to
the printer in Postscript format
@GTK_PRINT_CAPABILITY_PREVIEW: Print dialog will offer a previe
@GTK_PRINT_CAPABILITY_PREVIEW: Print dialog will offer a preview
@GTK_PRINT_CAPABILITY_NUMBER_UP: Print dialog will offer printing multiple
pages per sheet. Since 2.12
@GTK_PRINT_CAPABILITY_NUMBER_UP_LAYOUT: Print dialog will allow to rearrange

View File

@@ -346,3 +346,21 @@ at the end of range widgets.
@Returns:
<!-- ##### FUNCTION gtk_range_get_flippable ##### -->
<para>
</para>
@range:
@Returns:
<!-- ##### FUNCTION gtk_range_set_flippable ##### -->
<para>
</para>
@range:
@flippable:

View File

@@ -23,7 +23,7 @@ realized at least once. The following example demonstrates a way to do this:
<informalexample><programlisting>
gtk_init (&amp;argc, &amp;argv);
/&ast; make sure the type is realized &ast/
/&ast; make sure the type is realized &ast;/
g_type_class_unref (g_type_class_ref (GTK_TYPE_IMAGE_MENU_ITEM));
g_object_set (gtk_settings_get_default (), "gtk-menu-images", FALSE, NULL);

View File

@@ -172,6 +172,11 @@ on Win32 doesn't allow to embed arbitrary widgets.
</para>
<!-- ##### ARG GtkStatusIcon:title ##### -->
<para>
</para>
<!-- ##### ARG GtkStatusIcon:tooltip-markup ##### -->
<para>
@@ -420,6 +425,24 @@ on Win32 doesn't allow to embed arbitrary widgets.
@Returns:
<!-- ##### FUNCTION gtk_status_icon_set_title ##### -->
<para>
</para>
@status_icon:
@title:
<!-- ##### FUNCTION gtk_status_icon_get_title ##### -->
<para>
</para>
@status_icon:
@Returns:
<!-- ##### FUNCTION gtk_status_icon_set_visible ##### -->
<para>

View File

@@ -22,8 +22,8 @@ See <application>gtk-demo</application> for numerous examples.
</para>
<para>
The "invisible" property was not implemented for GTK+ 2.0; it's
planned to be implemented in future releases.
The "invisible" property was not implemented for GTK+ 2.0.
It is working (with minor issues) since 2.8.
</para>
<!-- ##### SECTION See_Also ##### -->

View File

@@ -19,25 +19,27 @@ A GtkToolItem containing a toggle button
<!-- ##### SECTION See_Also ##### -->
<para>
<varlistentry>
<term>#GtkToolbar</term>
<listitem><para>The toolbar widget</para></listitem>
<term>#GtkToolButton</term>
<listitem>
<para>
The parent class of #GtkToggleToolButton. The properties
"label_widget", "label", "icon_widget", and "stock_id" on
#GtkToolButton determine the label and icon used on
#GtkToggleToolButton<!-- -->s.
</para>
</listitem>
<term>#GtkSeparatorToolItem</term>
<listitem>
<para>A subclass of #GtkToolItem that separates groups of
items on a toolbar.
</para>
</listitem>
</varlistentry>
<variablelist>
<varlistentry>
<term>#GtkToolbar</term>
<listitem><para>The toolbar widget</para></listitem>
<term>#GtkToolButton</term>
<listitem>
<para>
The parent class of #GtkToggleToolButton. The properties
"label_widget", "label", "icon_widget", and "stock_id" on
#GtkToolButton determine the label and icon used on
#GtkToggleToolButton<!-- -->s.
</para>
</listitem>
<term>#GtkSeparatorToolItem</term>
<listitem>
<para>A subclass of #GtkToolItem that separates groups of
items on a toolbar.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<!-- ##### SECTION Stability_Level ##### -->

View File

@@ -12,23 +12,6 @@ GtkToolItem
<!-- ##### SECTION See_Also ##### -->
<para>
<varlistentry>
<term>#GtkToolbar</term>
<listitem><para>The toolbar widget</para></listitem>
</varlistentry>
<varlistentry>
<term>#GtkToolButton</term>
<listitem><para>A subclass of #GtkToolItem that displays buttons on
the toolbar</para></listitem>
</varlistentry>
<varlistentry>
<term>#GtkSeparatorToolItem</term>
<listitem><para>A subclass of #GtkToolItem that separates groups of
items on a toolbar</para></listitem>
</varlistentry>
</para>
<!-- ##### SECTION Stability_Level ##### -->

View File

@@ -112,6 +112,11 @@ calling gtk_tree_view_column_set_cell_data_func()
</para>
<!-- ##### ARG GtkTreeViewColumn:sort-column-id ##### -->
<para>
</para>
<!-- ##### ARG GtkTreeViewColumn:sort-indicator ##### -->
<para>

View File

@@ -693,6 +693,11 @@ internal child "accessible" of a <structname>GtkWidget</structname>.
</para>
<!-- ##### ARG GtkWidget:double-buffered ##### -->
<para>
</para>
<!-- ##### ARG GtkWidget:events ##### -->
<para>
@@ -2636,6 +2641,213 @@ This function is deprecated; it does nothing.
@Returns:
<!-- ##### FUNCTION gtk_widget_get_allocation ##### -->
<para>
</para>
@widget:
@allocation:
<!-- ##### FUNCTION gtk_widget_set_allocation ##### -->
<para>
</para>
@widget:
@allocation:
<!-- ##### FUNCTION gtk_widget_get_app_paintable ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_get_can_default ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_set_can_default ##### -->
<para>
</para>
@widget:
@can_default:
<!-- ##### FUNCTION gtk_widget_get_can_focus ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_set_can_focus ##### -->
<para>
</para>
@widget:
@can_focus:
<!-- ##### FUNCTION gtk_widget_get_double_buffered ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_get_has_window ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_set_has_window ##### -->
<para>
</para>
@widget:
@has_window:
<!-- ##### FUNCTION gtk_widget_get_sensitive ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_is_sensitive ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_get_state ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_get_visible ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_set_visible ##### -->
<para>
</para>
@widget:
@visible:
<!-- ##### FUNCTION gtk_widget_has_default ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_has_focus ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_has_grab ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_is_drawable ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_is_toplevel ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_set_window ##### -->
<para>
</para>
@widget:
@window:
<!-- ##### FUNCTION gtk_widget_set_receives_default ##### -->
<para>
</para>
@widget:
@receives_default:
<!-- ##### FUNCTION gtk_widget_get_receives_default ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_requisition_copy ##### -->
<para>

View File

@@ -17,7 +17,8 @@ LDADDS = \
$(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la \
$(top_builddir)/gdk/$(gdktargetlib) \
$(top_builddir)/gtk/$(gtktargetlib) \
$(GTK_DEP_LIBS)
$(GTK_DEP_LIBS) \
$(GDK_DEP_LIBS)
if USE_X11
noinst_PROGRAMS = \

View File

@@ -37,14 +37,14 @@ source code release of GTK+. For binary distributions, please check with
your vendor.</para>
<para>A copy is available online for reference at <ulink
url="http://www.gtk.org/tutorial/">http://www.gtk.org/tutorial</ulink>.</para>
url="http://www.gtk.org/documentation.html#Tutorials">http://www.gtk.org/documentation.html#Tutorials</ulink>. You can also find other GTK+ tutorials there.</para>
<para>A packaged verion of this tutorial is available from
<para>A packaged version of this tutorial is available from
<ulink url="ftp://ftp.gtk.org/pub/gtk/tutorial/">
ftp://ftp.gtk.org/pub/gtk/tutorial</ulink> which contains the tutorial in
various different formats. This
package is primary for those people wanting to have the tutorial
available for offline reference and for printing.</para>
various different formats. This package is primary for those people wanting
to have the tutorial available for offline reference and for printing. Note
that the packaged version may be older than the online version.</para>
</chapter>

View File

@@ -277,6 +277,13 @@ correct_prefix (gchar **path)
if (strncmp (*path, GTK_PREFIX "/", strlen (GTK_PREFIX "/")) == 0 ||
strncmp (*path, GTK_PREFIX "\\", strlen (GTK_PREFIX "\\")) == 0)
{
gchar *tem = NULL;
if (strlen(*path) > 5 && strncmp (*path - 5, ".libs", 5) == 0)
{
/* We are being run from inside the build tree, and shouldn't mess about. */
return;
}
/* This is an entry put there by gdk-pixbuf-query-loaders on the
* packager's system. On Windows a prebuilt GTK+ package can be
* installed in a random location. The gdk-pixbuf.loaders file
@@ -284,7 +291,7 @@ correct_prefix (gchar **path)
* builder's machine. Replace the build-time prefix with the
* installation prefix on this machine.
*/
gchar *tem = *path;
tem = *path;
*path = g_strconcat (get_toplevel (), tem + strlen (GTK_PREFIX), NULL);
g_free (tem);
}
@@ -2452,7 +2459,7 @@ gchar *
gdk_pixbuf_format_get_description (GdkPixbufFormat *format)
{
gchar *domain;
gchar *description;
const gchar *description;
g_return_val_if_fail (format != NULL, NULL);
if (format->domain != NULL)

View File

@@ -31,6 +31,18 @@
#define LOAD_BUFFER_SIZE 65536
struct _GdipContext {
GdkPixbufModuleUpdatedFunc updated_func;
GdkPixbufModulePreparedFunc prepared_func;
GdkPixbufModuleSizeFunc size_func;
gpointer user_data;
GByteArray *buffer;
IStream *stream;
HGLOBAL hg;
};
typedef struct _GdipContext GdipContext;
static GdiplusStartupFunc GdiplusStartup;
static GdipCreateBitmapFromStreamFunc GdipCreateBitmapFromStream;
static GdipBitmapGetPixelFunc GdipBitmapGetPixel;
@@ -339,21 +351,20 @@ gdip_pixbuf_to_bitmap (GdkPixbuf *pixbuf)
}
static GpBitmap *
gdip_buffer_to_bitmap (const gchar *buffer, size_t size, GError **error)
gdip_buffer_to_bitmap (GdipContext *context, GError **error)
{
HRESULT hr;
HGLOBAL hg = NULL;
GpBitmap *bitmap = NULL;
IStream *stream = NULL;
GpStatus status;
guint64 size64 = size;
guint64 size64 = context->buffer->len;
hg = gdip_buffer_to_hglobal (buffer, size, error);
hg = gdip_buffer_to_hglobal (context->buffer->data, context->buffer->len, error);
if (!hg)
return NULL;
IStream_SetSize (stream, *(ULARGE_INTEGER *)&size64);
hr = CreateStreamOnHGlobal (hg, FALSE, (LPSTREAM *)&stream);
if (!SUCCEEDED (hr)) {
@@ -361,29 +372,35 @@ gdip_buffer_to_bitmap (const gchar *buffer, size_t size, GError **error)
GlobalFree (hg);
return NULL;
}
IStream_SetSize (stream, *(ULARGE_INTEGER *)&size64);
status = GdipCreateBitmapFromStream (stream, &bitmap);
if (Ok != status)
if (Ok != status) {
gdip_set_error_from_gpstatus (error, GDK_PIXBUF_ERROR_FAILED, status);
IStream_Release (stream);
GlobalFree (hg);
return NULL;
}
IStream_Release (stream);
GlobalFree (hg);
context->stream = stream;
context->hg = hg;
return bitmap;
}
static GpImage *
gdip_buffer_to_image (const gchar *buffer, size_t size, GError **error)
gdip_buffer_to_image (GdipContext *context, GError **error)
{
HRESULT hr;
HGLOBAL hg = NULL;
GpImage *image = NULL;
IStream *stream = NULL;
GpStatus status;
guint64 size64 = size;
guint64 size64 = context->buffer->len;
hg = gdip_buffer_to_hglobal (buffer, size, error);
hg = gdip_buffer_to_hglobal (context->buffer->data, context->buffer->len, error);
if (!hg)
return NULL;
@@ -399,11 +416,15 @@ gdip_buffer_to_image (const gchar *buffer, size_t size, GError **error)
IStream_SetSize (stream, *(ULARGE_INTEGER *)&size64);
status = GdipLoadImageFromStream (stream, &image);
if (Ok != status)
if (Ok != status) {
gdip_set_error_from_gpstatus (error, GDK_PIXBUF_ERROR_FAILED, status);
IStream_Release (stream);
GlobalFree (hg);
return NULL;
}
IStream_Release (stream);
GlobalFree (hg);
context->stream = stream;
context->hg = hg;
return image;
}
@@ -590,24 +611,14 @@ gdip_bitmap_get_n_loops (GpBitmap *bitmap, guint *loops)
return success;
}
/*************************************************************************/
/*************************************************************************/
struct _GdipContext {
GdkPixbufModuleUpdatedFunc updated_func;
GdkPixbufModulePreparedFunc prepared_func;
GdkPixbufModuleSizeFunc size_func;
gpointer user_data;
GByteArray *buffer;
};
typedef struct _GdipContext GdipContext;
static void
destroy_gdipcontext (GdipContext *context)
{
if (context != NULL) {
if (context->stream != NULL) {
IStream_Release(context->stream);
GlobalFree (context->hg);
}
g_byte_array_free (context->buffer, TRUE);
g_free (context);
}
@@ -806,9 +817,8 @@ gdk_pixbuf__gdip_image_stop_load (gpointer data, GError **error)
{
GdipContext *context = (GdipContext *)data;
GpBitmap *bitmap = NULL;
GByteArray *image_buffer = context->buffer;
bitmap = gdip_buffer_to_bitmap ((gchar *)image_buffer->data, image_buffer->len, error);
bitmap = gdip_buffer_to_bitmap (context, error);
if (!bitmap) {
destroy_gdipcontext (context);
@@ -823,7 +833,6 @@ static gboolean
gdk_pixbuf__gdip_image_stop_vector_load (gpointer data, GError **error)
{
GdipContext *context = (GdipContext *)data;
GByteArray *image_buffer = context->buffer;
GpImage *metafile;
GpGraphics *graphics;
@@ -832,7 +841,7 @@ gdk_pixbuf__gdip_image_stop_vector_load (gpointer data, GError **error)
float metafile_xres, metafile_yres;
guint width, height;
metafile = gdip_buffer_to_image ((gchar *)image_buffer->data, image_buffer->len, error);
metafile = gdip_buffer_to_image (context, error);
if (!metafile) {
destroy_gdipcontext (context);
g_set_error_literal (error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_CORRUPT_IMAGE, _("Couldn't load metafile"));

View File

@@ -220,7 +220,7 @@ gif_read (GifContext *context, guchar *buffer, size_t len)
G_FILE_ERROR,
g_file_error_from_errno (save_errno),
_("Failure reading GIF: %s"),
strerror (save_errno));
g_strerror (save_errno));
}
#ifdef IO_GIFDEBUG

View File

@@ -1011,12 +1011,12 @@ fill_entry (IconEntry *icon,
return FALSE;
}
if ((icon->xor_rowstride % 4) != 0)
if ((icon->xor_rowstride % 4) != 0)
icon->xor_rowstride = 4 * ((icon->xor_rowstride / 4) + 1);
icon->xor = g_new0 (guchar, icon->xor_rowstride * icon->height);
icon->and_rowstride = icon->width / 8;
if ((icon->and_rowstride % 4) != 0)
icon->and_rowstride = (icon->width + 7) / 8;
if ((icon->and_rowstride % 4) != 0)
icon->and_rowstride = 4 * ((icon->and_rowstride / 4) + 1);
icon->and = g_new0 (guchar, icon->and_rowstride * icon->height);

View File

@@ -468,7 +468,6 @@ gdk_pixbuf__jpeg_image_load (FILE *f, GError **error)
cinfo.err = jpeg_std_error (&jerr.pub);
jerr.pub.error_exit = fatal_error_handler;
jerr.pub.output_message = output_message_handler;
jerr.error = error;
if (sigsetjmp (jerr.setjmp_buffer, 1)) {
@@ -657,6 +656,13 @@ gdk_pixbuf__jpeg_image_begin_load (GdkPixbufModuleSizeFunc size_func,
context->src_initialized = FALSE;
context->in_output = FALSE;
/* From jpeglib.h: "NB: you must set up the error-manager
* BEFORE calling jpeg_create_xxx". */
context->cinfo.err = jpeg_std_error (&context->jerr.pub);
context->jerr.pub.error_exit = fatal_error_handler;
context->jerr.pub.output_message = output_message_handler;
context->jerr.error = error;
/* create libjpeg structures */
jpeg_create_decompress (&context->cinfo);
@@ -669,14 +675,7 @@ gdk_pixbuf__jpeg_image_begin_load (GdkPixbufModuleSizeFunc size_func,
return NULL;
}
memset (context->cinfo.src, 0, sizeof (my_source_mgr));
src = (my_src_ptr) context->cinfo.src;
context->cinfo.err = jpeg_std_error (&context->jerr.pub);
context->jerr.pub.error_exit = fatal_error_handler;
context->jerr.pub.output_message = output_message_handler;
context->jerr.error = error;
src = (my_src_ptr) context->cinfo.src;
src->pub.init_source = init_source;
src->pub.fill_input_buffer = fill_input_buffer;
@@ -922,6 +921,7 @@ gdk_pixbuf__jpeg_image_load_increment (gpointer data,
}
}
cinfo->scale_num = 1;
for (cinfo->scale_denom = 2; cinfo->scale_denom <= 8; cinfo->scale_denom *= 2) {
jpeg_calc_output_dimensions (cinfo);
if (cinfo->output_width < width || cinfo->output_height < height) {
@@ -1190,11 +1190,11 @@ real_save_jpeg (GdkPixbuf *pixbuf,
}
/* set up error handling */
cinfo.err = jpeg_std_error (&(jerr.pub));
jerr.pub.error_exit = fatal_error_handler;
jerr.pub.output_message = output_message_handler;
jerr.error = error;
cinfo.err = jpeg_std_error (&(jerr.pub));
if (sigsetjmp (jerr.setjmp_buffer, 1)) {
jpeg_destroy_compress (&cinfo);
g_free (buf);

View File

@@ -679,7 +679,13 @@ static gboolean try_colormap(TGAContext *ctx, GError **err)
static guint n;
g_return_val_if_fail(ctx != NULL, FALSE);
g_return_val_if_fail(ctx->cmap_size > 0, TRUE);
if (ctx->cmap_size == 0) {
g_set_error_literal(err, GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
_("Image is corrupted or truncated"));
return FALSE;
}
ctx->cmap = g_try_malloc(sizeof(TGAColormap));
if (!ctx->cmap) {

View File

@@ -596,7 +596,7 @@ pixbuf_create_from_xpm (const gchar * (*get_buf) (enum buf_op op, gpointer handl
if ((!buffer) || (strlen (buffer) < wbytes))
continue;
for (n = 0, cnt = 0, xcnt = 0; n < wbytes; n += cpp, xcnt++) {
for (n = 0, xcnt = 0; n < wbytes; n += cpp, xcnt++) {
strncpy (pixel_str, &buffer[n], cpp);
pixel_str[cpp] = 0;

View File

@@ -15,11 +15,12 @@ GDK_PIXBUF_VER = 2.0
# but not yet -DINCLUDE_png
##USEGDIP=1
# to get _working_ include modules we need respective defines ...
#
BUILT_IN_FORMATS = \
!IFDEF USEGDIP
-DINCLUDE_gdiplus \
!ELSE
-DINCLUDE_bmp -DINCLUDE_gif -DINCLUDE_ico -DINCLUDE_jpeg -DINCLUDE_tiff \
-DINCLUDE_bmp -DINCLUDE_gif -DINCLUDE_ico -DINCLUDE_jpeg -DINCLUDE_tiff \
!ENDIF
-DINCLUDE_png \
-DINCLUDE_xpm -DINCLUDE_wbmp \

View File

@@ -1251,11 +1251,20 @@ pixops_process (guchar *dest_buf,
int i, j;
int x, y; /* X and Y position in source (fixed_point) */
guchar **line_bufs = g_new (guchar *, filter->y.n);
int *filter_weights = make_filter_table (filter);
guchar **line_bufs;
int *filter_weights;
int x_step = (1 << SCALE_SHIFT) / scale_x; /* X step in source (fixed point) */
int y_step = (1 << SCALE_SHIFT) / scale_y; /* Y step in source (fixed point) */
int x_step;
int y_step;
x_step = (1 << SCALE_SHIFT) / scale_x; /* X step in source (fixed point) */
y_step = (1 << SCALE_SHIFT) / scale_y; /* Y step in source (fixed point) */
if (x_step == 0 || y_step == 0)
return; /* overflow, bail out */
line_bufs = g_new (guchar *, filter->y.n);
filter_weights = make_filter_table (filter);
int check_shift = check_size ? get_check_shift (check_size) : 0;

View File

@@ -119,17 +119,20 @@ loader_sanity_check (const char *path, GdkPixbufFormat *info, GdkPixbufModule *v
return 0;
}
static void
static void
write_loader_info (const char *path, GdkPixbufFormat *info)
{
const GdkPixbufModulePattern *pattern;
char **mime;
char **ext;
char **mime;
char **ext;
g_printf("\"%s\"\n", path);
g_printf ("\"%s\" %u \"%s\" \"%s\" \"%s\"\n",
info->name, info->flags,
info->domain ? info->domain : GETTEXT_PACKAGE, info->description, info->license);
g_printf ("\"%s\" %u \"%s\" \"%s\" \"%s\"\n",
info->name,
info->flags,
info->domain ? info->domain : GETTEXT_PACKAGE,
info->description,
info->license ? info->license : "");
for (mime = info->mime_types; *mime; mime++) {
g_printf ("\"%s\" ", *mime);
}

View File

@@ -120,6 +120,7 @@ gdk_c_sources = \
gdkintl.h \
gdkkeys.c \
gdkkeyuni.c \
gdkoffscreenwindow.c \
gdkpango.c \
gdkpixbuf-drawable.c \
gdkpixbuf-render.c \
@@ -151,10 +152,10 @@ gdk_built_sources = \
gdkincludedir = $(includedir)/gtk-2.0/gdk
gdkinclude_HEADERS = $(gdk_public_h_sources) $(gdk_built_public_sources)
# gdkmarshalers.c is not here because it is currently an empty file
common_sources = \
$(gdk_c_sources) \
gdkenumtypes.c \
gdkmarshalers.c \
gdkmarshalers.h
libgdk_directfb_2_0_la_SOURCES = $(common_sources)
@@ -268,11 +269,11 @@ gdkenumtypes.c: @REBUILD@ $(gdk_public_h_sources) gdkenumtypes.c.template
# Marshaller generation
#
gdkmarshalers.h: @REBUILD@ gdkmarshalers.list
$(GLIB_GENMARSHAL) --prefix=gdk_marshal $(srcdir)/gdkmarshalers.list --header > gdkmarshalers-h.tmp \
$(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
(echo "#include \"gdkalias.h\""; $(GLIB_GENMARSHAL) --prefix=gdk_marshal $(srcdir)/gdkmarshalers.list --body) > gdkmarshalers-c.tmp \
(echo "#include \"gdkalias.h\""; $(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --body) > gdkmarshalers-c.tmp \
&& mv gdkmarshalers-c.tmp gdkmarshalers.c \
|| ( rm -f gdkmarshalers-c.tmp && exit 1 )

View File

@@ -68,12 +68,14 @@ extern gboolean gdk_directfb_monochrome_fonts;
void gdk_directfb_window_set_opacity (GdkWindow *window,
guchar opacity);
#ifndef GDK_DISABLE_DEPRECATED
GdkWindow * gdk_directfb_window_new (GdkWindow *parent,
GdkWindowAttr *attributes,
gint attributes_mask,
DFBWindowCapabilities window_caps,
DFBWindowOptions window_options,
DFBSurfaceCapabilities surface_caps);
#endif /* GDK_DISABLE_DEPRECATED */
GdkVisual * gdk_directfb_visual_by_format (DFBSurfacePixelFormat pixel_format);

View File

@@ -57,9 +57,8 @@ const GOptionEntry _gdk_windowing_args[] =
{ NULL}
};
/**
Main entry point for gdk in 2.6 args are parsed
**/
/* Main entry point for gdk in 2.6 args are parsed
*/
GdkDisplay * gdk_display_open (const gchar *display_name)
{
IDirectFB *directfb;
@@ -378,16 +377,18 @@ gdk_directfb_pointer_ungrab (guint32 time,
g_object_unref (old_grab_window);
}
gint
gdk_display_pointer_is_grabbed (GdkDisplay *display)
{
return _gdk_directfb_pointer_grab_window != NULL;
}
void
gdk_display_pointer_ungrab (GdkDisplay *display,guint32 time)
gdk_display_pointer_ungrab (GdkDisplay *display,
guint32 time)
{
gdk_directfb_pointer_ungrab (time, _gdk_directfb_pointer_implicit_grab);
GdkPointerGrabInfo *grab = _gdk_display_get_last_pointer_grab (display);
if (grab)
{
grab->serial_end = 0;
}
_gdk_display_pointer_grab_update (display, 0);
}

View File

@@ -1600,6 +1600,32 @@ gdk_directfb_cairo_surface_destroy (void *data)
impl->cairo_surface = NULL;
}
void
_gdk_windowing_set_cairo_surface_size (cairo_surface_t *surface,
int width,
int height)
{
}
cairo_surface_t *
_gdk_windowing_create_cairo_surface (GdkDrawable *drawable,
int width,
int height)
{
GdkDrawableImplDirectFB *impl;
IDirectFB *dfb;
cairo_surface_t *ret;
impl = GDK_DRAWABLE_IMPL_DIRECTFB (drawable);
dfb = GDK_DISPLAY_DFB (gdk_drawable_get_display (drawable))->directfb;
ret = cairo_directfb_surface_create (dfb, impl->surface);
cairo_surface_set_user_data (ret,
&gdk_directfb_cairo_key, drawable,
gdk_directfb_cairo_surface_destroy);
return ret;
}
static cairo_surface_t *
gdk_directfb_ref_cairo_surface (GdkDrawable *drawable)

View File

@@ -184,6 +184,8 @@ dfb_events_dispatch (void)
GdkDisplay *display = gdk_display_get_default ();
GdkEvent *event;
GDK_THREADS_ENTER ();
while ((event = _gdk_event_unqueue (display)) != NULL)
{
if (_gdk_event_func)
@@ -191,6 +193,8 @@ dfb_events_dispatch (void)
gdk_event_free (event);
}
GDK_THREADS_LEAVE ();
}
static gboolean

View File

@@ -351,7 +351,8 @@ gc_unset_clip_mask (GdkGC *gc)
void
_gdk_windowing_gc_set_clip_region (GdkGC *gc,
const GdkRegion *region)
const GdkRegion *region,
gboolean reset_origin)
{
GdkGCDirectFB *data;
@@ -367,10 +368,13 @@ _gdk_windowing_gc_set_clip_region (GdkGC *gc,
else
temp_region_reset (&data->clip_region);
gc->clip_x_origin = 0;
gc->clip_y_origin = 0;
data->values.clip_x_origin = 0;
data->values.clip_y_origin = 0;
if (reset_origin)
{
gc->clip_x_origin = 0;
gc->clip_y_origin = 0;
data->values.clip_x_origin = 0;
data->values.clip_y_origin = 0;
}
gc_unset_clip_mask (gc);
}

View File

@@ -37,7 +37,6 @@ extern GdkModifierType _gdk_directfb_modifiers;
extern int _gdk_directfb_mouse_x, _gdk_directfb_mouse_y;
typedef struct _GdkAxisInfo GdkAxisInfo;
typedef struct _GdkInputWindow GdkInputWindow;
/* information about a device axis */
struct _GdkAxisInfo

View File

@@ -59,9 +59,8 @@
void
_gdk_windowing_init (void)
{
/**
Not that usable called before parse_args
**/
/* Not that usable called before parse_args
*/
}
void
@@ -370,76 +369,15 @@ gdk_error_trap_pop (void)
return 0;
}
/**
* gdk_pointer_grab_info_libgtk_only:
* @grab_window: location to store current grab window
* @owner_events: location to store boolean indicating whether
* the @owner_events flag to gdk_pointer_grab() was %TRUE.
*
* Determines information about the current pointer grab.
* This is not public API and must not be used by applications.
*
* Return value: %TRUE if this application currently has the
* pointer grabbed.
**/
gboolean
gdk_pointer_grab_info_libgtk_only (GdkDisplay *display,GdkWindow **grab_window,
gboolean *owner_events)
{
if (_gdk_directfb_pointer_grab_window)
{
if (grab_window)
*grab_window = (GdkWindow *)_gdk_directfb_pointer_grab_window;
if (owner_events)
*owner_events = _gdk_directfb_pointer_grab_owner_events;
return TRUE;
}
return FALSE;
}
/**
* gdk_keyboard_grab_info_libgtk_only:
* @grab_window: location to store current grab window
* @owner_events: location to store boolean indicating whether
* the @owner_events flag to gdk_keyboard_grab() was %TRUE.
*
* Determines information about the current keyboard grab.
* This is not public API and must not be used by applications.
*
* Return value: %TRUE if this application currently has the
* keyboard grabbed.
**/
gboolean
gdk_keyboard_grab_info_libgtk_only (GdkDisplay *display,GdkWindow **grab_window,
gboolean *owner_events)
{
if (_gdk_directfb_keyboard_grab_window)
{
if (grab_window)
*grab_window = (GdkWindow *) _gdk_directfb_keyboard_grab_window;
if (owner_events)
*owner_events = _gdk_directfb_keyboard_grab_owner_events;
return TRUE;
}
return FALSE;
}
GdkGrabStatus
gdk_keyboard_grab (GdkWindow *window,
gint owner_events,
guint32 time)
{
return gdk_directfb_keyboard_grab(gdk_display_get_default(),
window,
owner_events,
time);
return gdk_directfb_keyboard_grab (gdk_display_get_default(),
window,
owner_events,
time);
}
/*
@@ -467,35 +405,25 @@ gdk_keyboard_grab (GdkWindow *window,
GdkGrabStatus
gdk_display_pointer_grab (GdkDisplay *display,GdkWindow *window,
gint owner_events,
GdkEventMask event_mask,
GdkWindow *confine_to,
GdkCursor *cursor,
guint32 time)
_gdk_windowing_pointer_grab (GdkWindow *window,
GdkWindow *native,
gboolean owner_events,
GdkEventMask event_mask,
GdkWindow *confine_to,
GdkCursor *cursor,
guint32 time)
{
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
g_return_val_if_fail (confine_to == NULL || GDK_IS_WINDOW (confine_to), 0);
return gdk_directfb_pointer_grab (window,
owner_events,
event_mask,
confine_to,
cursor,
time,
FALSE);
}
GdkGrabStatus
gdk_pointer_grab (GdkWindow * window,
gint owner_events,
GdkEventMask event_mask,
GdkWindow * confine_to,
GdkCursor * cursor,
guint32 time)
{
return gdk_directfb_pointer_grab(window, owner_events,event_mask,
confine_to,cursor,time,FALSE);
_gdk_display_add_pointer_grab (_gdk_display,
window,
native,
owner_events,
event_mask,
confine_to,
cursor,
time);
}
#define __GDK_MAIN_X11_C__

View File

@@ -114,10 +114,10 @@ gdk_pixmap_impl_directfb_finalize (GObject *object)
}
GdkPixmap*
gdk_pixmap_new (GdkDrawable *drawable,
gint width,
gint height,
gint depth)
_gdk_pixmap_new (GdkDrawable *drawable,
gint width,
gint height,
gint depth)
{
DFBSurfacePixelFormat format;
IDirectFBSurface *surface;
@@ -196,10 +196,10 @@ gdk_pixmap_new (GdkDrawable *drawable,
}
GdkPixmap *
gdk_bitmap_create_from_data (GdkDrawable *drawable,
const gchar *data,
gint width,
gint height)
_gdk_bitmap_create_from_data (GdkDrawable *drawable,
const gchar *data,
gint width,
gint height)
{
GdkPixmap *pixmap;
@@ -249,13 +249,13 @@ gdk_bitmap_create_from_data (GdkDrawable *drawable,
}
GdkPixmap*
gdk_pixmap_create_from_data (GdkDrawable *drawable,
const gchar *data,
gint width,
gint height,
gint depth,
const GdkColor *fg,
const GdkColor *bg)
_gdk_pixmap_create_from_data (GdkDrawable *drawable,
const gchar *data,
gint width,
gint height,
gint depth,
const GdkColor *fg,
const GdkColor *bg)
{
GdkPixmap *pixmap;

File diff suppressed because it is too large Load Diff

View File

@@ -206,6 +206,14 @@ gdk_pre_parse_libgtk_only (void)
}
#endif /* G_ENABLE_DEBUG */
if (getenv ("GDK_NATIVE_WINDOWS"))
{
_gdk_native_windows = TRUE;
/* Ensure that this is not propagated
to spawned applications */
g_unsetenv ("GDK_NATIVE_WINDOWS");
}
g_type_init ();
/* Do any setup particular to the windowing system

View File

@@ -22,7 +22,9 @@
#if IN_HEADER(__GDK_EVENTS_H__)
#if IN_FILE(__GDK_EVENTS_X11_C__)
gdk_add_client_message_filter
#ifndef GDK_DISABLE_DEPRECATED
gdk_event_get_graphics_expose
#endif
gdk_events_pending
#endif
#endif
@@ -69,9 +71,6 @@ gdk_get_use_xshm
gdk_set_use_xshm
#endif
gdk_keyboard_grab
gdk_keyboard_grab_info_libgtk_only
gdk_pointer_grab
gdk_pointer_grab_info_libgtk_only
#endif
#endif
@@ -85,6 +84,9 @@ gdk_pointer_is_grabbed
gdk_pointer_ungrab
gdk_event_send_client_message
gdk_event_send_clientmessage_toall
gdk_keyboard_grab_info_libgtk_only
gdk_pointer_grab_info_libgtk_only
gdk_display_pointer_is_grabbed
#endif
#endif
@@ -254,12 +256,6 @@ gdk_visual_type_get_type G_GNUC_CONST
#endif
#endif
#if IN_HEADER(__GDK_PIXMAP_H__)
#if IN_FILE(__GDK_PIXMAP_X11_C__)
gdk_bitmap_create_from_data
#endif
#endif
#if IN_HEADER(__GDK_FONT_H__)
#if IN_FILE(__GDK_FONT_C__)
#ifndef GDK_DISABLE_DEPRECATED
@@ -305,6 +301,7 @@ gdk_fontset_load_for_display
#if IN_HEADER(__GDK_CAIRO_H__)
#if IN_FILE(__GDK_CAIRO_C__)
gdk_cairo_create
gdk_cairo_reset_clip
gdk_cairo_set_source_color
gdk_cairo_set_source_pixbuf
gdk_cairo_set_source_pixmap
@@ -466,7 +463,6 @@ gdk_display_get_default_screen
gdk_display_get_name
gdk_display_get_n_screens
gdk_display_get_screen
gdk_display_pointer_is_grabbed
gdk_display_pointer_ungrab
gdk_display_keyboard_ungrab
gdk_display_open
@@ -657,6 +653,7 @@ gdk_window_get_events
gdk_window_set_events
gdk_window_raise
gdk_window_lower
gdk_window_restack
gdk_window_move
gdk_window_resize
gdk_window_move_resize
@@ -665,12 +662,19 @@ gdk_window_move_region
gdk_window_set_background
gdk_window_set_back_pixmap
gdk_window_set_cursor
gdk_window_get_cursor
gdk_window_get_geometry
gdk_window_get_origin
gdk_window_get_root_coords
gdk_window_get_deskrelative_origin
gdk_window_shape_combine_mask
gdk_window_shape_combine_region
gdk_window_set_child_shapes
gdk_window_merge_child_shapes
gdk_window_input_shape_combine_mask
gdk_window_input_shape_combine_region
gdk_window_set_child_input_shapes
gdk_window_merge_child_input_shapes
gdk_window_set_static_gravities
gdk_window_reparent
gdk_window_add_filter
@@ -683,6 +687,7 @@ gdk_window_clear_area_e
gdk_window_constrain_size
gdk_window_destroy
gdk_window_end_paint
gdk_window_flush
gdk_window_foreign_new
gdk_window_freeze_toplevel_updates_libgtk_only
gdk_window_freeze_updates
@@ -699,6 +704,7 @@ gdk_window_get_toplevels
gdk_window_get_update_area
gdk_window_get_user_data
gdk_window_get_window_type
gdk_window_is_destroyed
gdk_window_invalidate_maybe_recurse
gdk_window_invalidate_rect
gdk_window_invalidate_region
@@ -716,6 +722,24 @@ gdk_window_set_user_data
gdk_window_thaw_toplevel_updates_libgtk_only
gdk_window_thaw_updates
gdk_window_set_composited
gdk_pointer_grab
gdk_window_beep
gdk_window_geometry_changed
gdk_window_ensure_native
#endif
#endif
#if IN_HEADER(__GDK_WINDOW_H__)
#if IN_FILE(__GDK_OFFSCREEN_WINDOW_C__)
gdk_offscreen_window_get_pixmap
gdk_offscreen_window_set_embedder
gdk_offscreen_window_get_embedder
#endif
#endif
#if IN_HEADER(__GDK_INTERNALS_H__)
#if IN_FILE(__GDK_OFFSCREEN_WINDOW_C__)
gdk_offscreen_window_get_type G_GNUC_CONST
#endif
#endif
@@ -733,7 +757,6 @@ gdk_window_lookup
gdk_window_lookup_for_display
#ifndef GDK_DISABLE_DEPRECATED
gdk_window_set_hints
gdk_window_get_deskrelative_origin
#endif
gdk_window_get_type_hint
gdk_window_set_type_hint
@@ -748,15 +771,12 @@ gdk_window_set_startup_id
gdk_window_set_transient_for
gdk_window_get_root_origin
gdk_window_get_frame_extents
gdk_window_input_shape_combine_mask
gdk_window_input_shape_combine_region
gdk_window_set_override_redirect
gdk_window_set_accept_focus
gdk_window_set_focus_on_map
gdk_window_set_icon_list
gdk_window_set_icon
gdk_window_set_icon_name
gdk_window_beep
gdk_window_set_opacity
gdk_window_iconify
gdk_window_deiconify
@@ -773,8 +793,6 @@ gdk_window_set_group
gdk_window_get_decorations
gdk_window_set_decorations
gdk_window_set_functions
gdk_window_set_child_input_shapes
gdk_window_merge_child_input_shapes
gdk_window_begin_move_drag
gdk_window_begin_resize_drag
gdk_window_enable_synchronized_configure
@@ -925,23 +943,24 @@ gdk_pixbuf_render_to_drawable_alpha
#if IN_HEADER(__GDK_PIXMAP_H__)
#if IN_FILE(__GDK_PIXMAP_C__)
gdk_bitmap_create_from_data
gdk_pixmap_colormap_create_from_xpm
gdk_pixmap_create_from_data
gdk_pixmap_create_from_xpm
gdk_pixmap_colormap_create_from_xpm_d
gdk_pixmap_create_from_xpm_d
gdk_pixmap_get_type G_GNUC_CONST
gdk_pixmap_new
#endif
#endif
#if IN_HEADER(__GDK_PIXMAP_H__)
#if IN_FILE(__GDK_PIXMAP_X11_C__)
gdk_pixmap_create_from_data
gdk_pixmap_foreign_new
gdk_pixmap_foreign_new_for_display
gdk_pixmap_foreign_new_for_screen
gdk_pixmap_lookup
gdk_pixmap_lookup_for_display
gdk_pixmap_new
#endif
#endif
@@ -951,6 +970,7 @@ gdk_region_copy
gdk_region_destroy
gdk_region_empty
gdk_region_equal
gdk_region_rect_equal
gdk_region_get_clipbox
gdk_region_get_rectangles
gdk_region_intersect
@@ -1202,6 +1222,8 @@ gdk_x11_display_get_startup_notification_id
#if IN_FILE(__GDK_DRAWABLE_X11_C__)
gdk_x11_drawable_get_xdisplay
gdk_x11_drawable_get_xid
gdk_x11_window_get_drawable_impl
gdk_x11_pixmap_get_drawable_impl
#endif
#if IN_FILE(__GDK_FONT_X11_C__)

View File

@@ -50,11 +50,43 @@ gdk_cairo_create (GdkDrawable *drawable)
surface = _gdk_drawable_ref_cairo_surface (drawable);
cr = cairo_create (surface);
if (GDK_DRAWABLE_GET_CLASS (drawable)->set_cairo_clip)
GDK_DRAWABLE_GET_CLASS (drawable)->set_cairo_clip (drawable, cr);
cairo_surface_destroy (surface);
return cr;
}
/**
* gdk_cairo_reset_clip:
* @cr: a #cairo_t
* @drawable: a #GdkDrawable
*
* Resets the clip region for a Cairo context created by gdk_cairo_create().
*
* This resets the clip region to the "empty" state for the given drawable.
* This is required for non-native windows since a direct call to
* cairo_reset_clip() would unset the clip region inherited from the
* drawable (i.e. the window clip region), and thus let you e.g.
* draw outside your window.
*
* This is rarely needed though, since most code just create a new cairo_t
* using gdk_cairo_create() each time they want to draw something.
*
* Since: 2.18
**/
void
gdk_cairo_reset_clip (cairo_t *cr,
GdkDrawable *drawable)
{
cairo_reset_clip (cr);
if (GDK_DRAWABLE_GET_CLASS (drawable)->set_cairo_clip)
GDK_DRAWABLE_GET_CLASS (drawable)->set_cairo_clip (drawable, cr);
}
/**
* gdk_cairo_set_source_color:
* @cr: a #cairo_t

View File

@@ -31,6 +31,8 @@
G_BEGIN_DECLS
cairo_t *gdk_cairo_create (GdkDrawable *drawable);
void gdk_cairo_reset_clip (cairo_t *cr,
GdkDrawable *drawable);
void gdk_cairo_set_source_color (cairo_t *cr,
const GdkColor *color);

View File

@@ -22,9 +22,11 @@
*/
#include "config.h"
#include <math.h>
#include <glib.h>
#include "gdk.h" /* gdk_event_send_client_message() */
#include "gdkdisplay.h"
#include "gdkwindowimpl.h"
#include "gdkinternals.h"
#include "gdkmarshalers.h"
#include "gdkscreen.h"
@@ -60,6 +62,14 @@ static GdkWindow* singlehead_default_window_get_pointer (GdkWindow *window
static GdkWindow* singlehead_default_window_at_pointer (GdkScreen *screen,
gint *win_x,
gint *win_y);
static GdkWindow *gdk_window_real_window_get_pointer (GdkDisplay *display,
GdkWindow *window,
gint *x,
gint *y,
GdkModifierType *mask);
static GdkWindow *gdk_display_real_get_window_at_pointer (GdkDisplay *display,
gint *win_x,
gint *win_y);
static guint signals[LAST_SIGNAL] = { 0 };
@@ -67,8 +77,8 @@ static char *gdk_sm_client_id;
static const GdkDisplayPointerHooks default_pointer_hooks = {
_gdk_windowing_get_pointer,
_gdk_windowing_window_get_pointer,
_gdk_windowing_window_at_pointer
gdk_window_real_window_get_pointer,
gdk_display_real_get_window_at_pointer
};
static const GdkDisplayPointerHooks singlehead_pointer_hooks = {
@@ -110,7 +120,7 @@ gdk_display_class_init (GdkDisplayClass *class)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GdkDisplayClass, closed),
NULL, NULL,
gdk_marshal_VOID__BOOLEAN,
_gdk_marshal_VOID__BOOLEAN,
G_TYPE_NONE,
1,
G_TYPE_BOOLEAN);
@@ -434,6 +444,25 @@ _gdk_get_sm_client_id (void)
return gdk_sm_client_id;
}
void
_gdk_display_enable_motion_hints (GdkDisplay *display)
{
gulong serial;
if (display->pointer_info.motion_hint_serial != 0)
{
serial = _gdk_windowing_window_get_next_serial (display);
/* We might not actually generate the next request, so
make sure this triggers always, this may cause it to
trigger slightly too early, but this is just a hint
anyway. */
if (serial > 0)
serial--;
if (serial < display->pointer_info.motion_hint_serial)
display->pointer_info.motion_hint_serial = serial;
}
}
/**
* gdk_display_get_pointer:
* @display: a #GdkDisplay
@@ -473,6 +502,68 @@ gdk_display_get_pointer (GdkDisplay *display,
*mask = tmp_mask;
}
static GdkWindow *
gdk_display_real_get_window_at_pointer (GdkDisplay *display,
gint *win_x,
gint *win_y)
{
GdkWindow *window;
gint x, y;
window = _gdk_windowing_window_at_pointer (display, &x, &y, NULL, FALSE);
/* This might need corrections, as the native window returned
may contain client side children */
if (window)
{
double xx, yy;
window = _gdk_window_find_descendant_at (window,
x, y,
&xx, &yy);
x = floor (xx + 0.5);
y = floor (yy + 0.5);
}
*win_x = x;
*win_y = y;
return window;
}
static GdkWindow *
gdk_window_real_window_get_pointer (GdkDisplay *display,
GdkWindow *window,
gint *x,
gint *y,
GdkModifierType *mask)
{
GdkWindowObject *private;
gint tmpx, tmpy;
GdkModifierType tmp_mask;
gboolean normal_child;
private = (GdkWindowObject *) window;
normal_child = GDK_WINDOW_IMPL_GET_IFACE (private->impl)->get_pointer (window,
&tmpx, &tmpy,
&tmp_mask);
/* We got the coords on the impl, convert to the window */
tmpx -= private->abs_x;
tmpy -= private->abs_y;
if (x)
*x = tmpx;
if (y)
*y = tmpy;
if (mask)
*mask = tmp_mask;
if (normal_child)
return _gdk_window_find_child_at (window, tmpx, tmpy);
return NULL;
}
/**
* gdk_display_get_window_at_pointer:
* @display: a #GdkDisplay
@@ -586,8 +677,8 @@ singlehead_default_window_get_pointer (GdkWindow *window,
gint *y,
GdkModifierType *mask)
{
return _gdk_windowing_window_get_pointer (gdk_drawable_get_display (window),
window, x, y, mask);
return gdk_window_real_window_get_pointer (gdk_drawable_get_display (window),
window, x, y, mask);
}
static GdkWindow*
@@ -595,8 +686,8 @@ singlehead_default_window_at_pointer (GdkScreen *screen,
gint *win_x,
gint *win_y)
{
return _gdk_windowing_window_at_pointer (gdk_screen_get_display (screen),
win_x, win_y);
return gdk_display_real_get_window_at_pointer (gdk_screen_get_display (screen),
win_x, win_y);
}
/**
@@ -632,5 +723,561 @@ gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks)
return (GdkPointerHooks *)result;
}
static void
generate_grab_broken_event (GdkWindow *window,
gboolean keyboard,
gboolean implicit,
GdkWindow *grab_window)
{
g_return_if_fail (window != NULL);
if (!GDK_WINDOW_DESTROYED (window))
{
GdkEvent event;
event.type = GDK_GRAB_BROKEN;
event.grab_broken.window = window;
event.grab_broken.send_event = 0;
event.grab_broken.keyboard = keyboard;
event.grab_broken.implicit = implicit;
event.grab_broken.grab_window = grab_window;
gdk_event_put (&event);
}
}
GdkPointerGrabInfo *
_gdk_display_get_last_pointer_grab (GdkDisplay *display)
{
GList *l;
l = g_list_last (display->pointer_grabs);
if (l == NULL)
return NULL;
else
return (GdkPointerGrabInfo *)l->data;
}
GdkPointerGrabInfo *
_gdk_display_add_pointer_grab (GdkDisplay *display,
GdkWindow *window,
GdkWindow *native_window,
gboolean owner_events,
GdkEventMask event_mask,
unsigned long serial_start,
guint32 time,
gboolean implicit)
{
GdkPointerGrabInfo *info, *other_info;
GList *l;
info = g_new0 (GdkPointerGrabInfo, 1);
info->window = g_object_ref (window);
info->native_window = g_object_ref (native_window);
info->serial_start = serial_start;
info->serial_end = G_MAXULONG;
info->owner_events = owner_events;
info->event_mask = event_mask;
info->time = time;
info->implicit = implicit;
/* Find the first grab that has a larger start time (if any) and insert
* before that. I.E we insert after already existing grabs with same
* start time */
for (l = display->pointer_grabs; l != NULL; l = l->next)
{
other_info = l->data;
if (info->serial_start < other_info->serial_start)
break;
}
display->pointer_grabs =
g_list_insert_before (display->pointer_grabs, l, info);
/* Make sure the new grab end before next grab */
if (l)
{
other_info = l->data;
info->serial_end = other_info->serial_start;
}
/* Find any previous grab and update its end time */
l = g_list_find (display->pointer_grabs, info);
l = l->prev;
if (l)
{
other_info = l->data;
other_info->serial_end = serial_start;
}
return info;
}
static void
free_pointer_grab (GdkPointerGrabInfo *info)
{
g_object_unref (info->window);
g_object_unref (info->native_window);
g_free (info);
}
/* _gdk_synthesize_crossing_events only works inside one toplevel.
This function splits things into two calls if needed, converting the
coordinates to the right toplevel */
static void
synthesize_crossing_events (GdkDisplay *display,
GdkWindow *src_window,
GdkWindow *dest_window,
GdkCrossingMode crossing_mode,
guint32 time,
gulong serial)
{
GdkWindow *src_toplevel, *dest_toplevel;
GdkModifierType state;
int x, y;
/* We use the native crossing events if all native */
if (_gdk_native_windows)
return;
if (src_window)
src_toplevel = gdk_window_get_toplevel (src_window);
else
src_toplevel = NULL;
if (dest_window)
dest_toplevel = gdk_window_get_toplevel (dest_window);
else
dest_toplevel = NULL;
if (src_toplevel == NULL && dest_toplevel == NULL)
return;
if (src_toplevel == NULL ||
src_toplevel == dest_toplevel)
{
/* Same toplevels */
gdk_window_get_pointer (dest_toplevel,
&x, &y, &state);
_gdk_synthesize_crossing_events (display,
src_window,
dest_window,
crossing_mode,
x, y, state,
time,
NULL,
serial, FALSE);
}
else if (dest_toplevel == NULL)
{
gdk_window_get_pointer (src_toplevel,
&x, &y, &state);
_gdk_synthesize_crossing_events (display,
src_window,
NULL,
crossing_mode,
x, y, state,
time,
NULL,
serial, FALSE);
}
else
{
/* Different toplevels */
gdk_window_get_pointer (src_toplevel,
&x, &y, &state);
_gdk_synthesize_crossing_events (display,
src_window,
NULL,
crossing_mode,
x, y, state,
time,
NULL,
serial, FALSE);
gdk_window_get_pointer (dest_toplevel,
&x, &y, &state);
_gdk_synthesize_crossing_events (display,
NULL,
dest_window,
crossing_mode,
x, y, state,
time,
NULL,
serial, FALSE);
}
}
static GdkWindow *
get_current_toplevel (GdkDisplay *display,
int *x_out, int *y_out,
GdkModifierType *state_out)
{
GdkWindow *pointer_window;
int x, y;
GdkModifierType state;
pointer_window = _gdk_windowing_window_at_pointer (display, &x, &y, &state, TRUE);
if (pointer_window != NULL &&
(GDK_WINDOW_DESTROYED (pointer_window) ||
GDK_WINDOW_TYPE (pointer_window) == GDK_WINDOW_ROOT ||
GDK_WINDOW_TYPE (pointer_window) == GDK_WINDOW_FOREIGN))
pointer_window = NULL;
*x_out = x;
*y_out = y;
*state_out = state;
return pointer_window;
}
static void
switch_to_pointer_grab (GdkDisplay *display,
GdkPointerGrabInfo *grab,
GdkPointerGrabInfo *last_grab,
guint32 time,
gulong serial)
{
GdkWindow *src_window, *pointer_window, *new_toplevel;
GList *old_grabs;
GdkModifierType state;
int x, y;
/* Temporarily unset pointer to make sure we send the crossing events below */
old_grabs = display->pointer_grabs;
display->pointer_grabs = NULL;
if (grab)
{
/* New grab is in effect */
/* We need to generate crossing events for the grab.
* However, there are never any crossing events for implicit grabs
* TODO: ... Actually, this could happen if the pointer window
* doesn't have button mask so a parent gets the event...
*/
if (!grab->implicit)
{
/* We send GRAB crossing events from the window under the pointer to the
grab window. Except if there is an old grab then we start from that */
if (last_grab)
src_window = last_grab->window;
else
src_window = display->pointer_info.window_under_pointer;
if (src_window != grab->window)
{
synthesize_crossing_events (display,
src_window, grab->window,
GDK_CROSSING_GRAB, time, serial);
}
/* !owner_event Grabbing a window that we're not inside, current status is
now NULL (i.e. outside grabbed window) */
if (!grab->owner_events && display->pointer_info.window_under_pointer != grab->window)
_gdk_display_set_window_under_pointer (display, NULL);
}
grab->activated = TRUE;
}
if (last_grab)
{
new_toplevel = NULL;
if (grab == NULL /* ungrab */ ||
(!last_grab->owner_events && grab->owner_events) /* switched to owner_events */ )
{
/* We force check what window we're in, and update the toplevel_under_pointer info,
* as that won't get told of this change with toplevel enter events.
*/
if (display->pointer_info.toplevel_under_pointer)
g_object_unref (display->pointer_info.toplevel_under_pointer);
display->pointer_info.toplevel_under_pointer = NULL;
new_toplevel = get_current_toplevel (display, &x, &y, &state);
if (new_toplevel)
{
/* w is now toplevel and x,y in toplevel coords */
display->pointer_info.toplevel_under_pointer = g_object_ref (new_toplevel);
display->pointer_info.toplevel_x = x;
display->pointer_info.toplevel_y = y;
display->pointer_info.state = state;
}
}
if (grab == NULL) /* Ungrabbed, send events */
{
pointer_window = NULL;
if (new_toplevel)
{
/* Find (possibly virtual) child window */
pointer_window =
_gdk_window_find_descendant_at (new_toplevel,
x, y,
NULL, NULL);
}
if (pointer_window != last_grab->window)
synthesize_crossing_events (display,
last_grab->window, pointer_window,
GDK_CROSSING_UNGRAB, time, serial);
/* We're now ungrabbed, update the window_under_pointer */
_gdk_display_set_window_under_pointer (display, pointer_window);
}
}
display->pointer_grabs = old_grabs;
}
void
_gdk_display_pointer_grab_update (GdkDisplay *display,
gulong current_serial)
{
GdkPointerGrabInfo *current_grab, *next_grab;
guint32 time;
time = display->last_event_time;
while (display->pointer_grabs != NULL)
{
current_grab = display->pointer_grabs->data;
if (current_grab->serial_start > current_serial)
return; /* Hasn't started yet */
if (current_grab->serial_end > current_serial)
{
/* This one hasn't ended yet.
its the currently active one or scheduled to be active */
if (!current_grab->activated)
switch_to_pointer_grab (display, current_grab, NULL, time, current_serial);
break;
}
next_grab = NULL;
if (display->pointer_grabs->next)
{
/* This is the next active grab */
next_grab = display->pointer_grabs->next->data;
if (next_grab->serial_start > current_serial)
next_grab = NULL; /* Actually its not yet active */
}
if ((next_grab == NULL && current_grab->implicit_ungrab) ||
(next_grab != NULL && current_grab->window != next_grab->window))
generate_grab_broken_event (GDK_WINDOW (current_grab->window),
FALSE, current_grab->implicit,
next_grab? next_grab->window : NULL);
/* Remove old grab */
display->pointer_grabs =
g_list_delete_link (display->pointer_grabs,
display->pointer_grabs);
switch_to_pointer_grab (display,
next_grab, current_grab,
time, current_serial);
free_pointer_grab (current_grab);
}
}
static GList *
find_pointer_grab (GdkDisplay *display,
gulong serial)
{
GdkPointerGrabInfo *grab;
GList *l;
for (l = display->pointer_grabs; l != NULL; l = l->next)
{
grab = l->data;
if (serial >= grab->serial_start && serial < grab->serial_end)
return l;
}
return NULL;
}
GdkPointerGrabInfo *
_gdk_display_has_pointer_grab (GdkDisplay *display,
gulong serial)
{
GList *l;
l = find_pointer_grab (display, serial);
if (l)
return l->data;
return NULL;
}
/* Returns true if last grab was ended
* If if_child is non-NULL, end the grab only if the grabbed
* window is the same as if_child or a descendant of it */
gboolean
_gdk_display_end_pointer_grab (GdkDisplay *display,
gulong serial,
GdkWindow *if_child,
gboolean implicit)
{
GdkPointerGrabInfo *grab;
GList *l;
l = find_pointer_grab (display, serial);
if (l == NULL)
return FALSE;
grab = l->data;
if (grab &&
(if_child == NULL ||
_gdk_window_event_parent_of (if_child, grab->window)))
{
grab->serial_end = serial;
grab->implicit_ungrab = implicit;
return l->next == NULL;
}
return FALSE;
}
void
_gdk_display_set_has_keyboard_grab (GdkDisplay *display,
GdkWindow *window,
GdkWindow *native_window,
gboolean owner_events,
unsigned long serial,
guint32 time)
{
if (display->keyboard_grab.window != NULL &&
display->keyboard_grab.window != window)
generate_grab_broken_event (display->keyboard_grab.window,
TRUE, FALSE, window);
display->keyboard_grab.window = window;
display->keyboard_grab.native_window = native_window;
display->keyboard_grab.owner_events = owner_events;
display->keyboard_grab.serial = serial;
display->keyboard_grab.time = time;
}
void
_gdk_display_unset_has_keyboard_grab (GdkDisplay *display,
gboolean implicit)
{
if (implicit)
generate_grab_broken_event (display->keyboard_grab.window,
TRUE, FALSE, NULL);
display->keyboard_grab.window = NULL;
}
/**
* gdk_keyboard_grab_info_libgtk_only:
* @display: the display for which to get the grab information
* @grab_window: location to store current grab window
* @owner_events: location to store boolean indicating whether
* the @owner_events flag to gdk_keyboard_grab() was %TRUE.
*
* Determines information about the current keyboard grab.
* This is not public API and must not be used by applications.
*
* Return value: %TRUE if this application currently has the
* keyboard grabbed.
**/
gboolean
gdk_keyboard_grab_info_libgtk_only (GdkDisplay *display,
GdkWindow **grab_window,
gboolean *owner_events)
{
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
if (display->keyboard_grab.window)
{
if (grab_window)
*grab_window = display->keyboard_grab.window;
if (owner_events)
*owner_events = display->keyboard_grab.owner_events;
return TRUE;
}
else
return FALSE;
}
/**
* gdk_pointer_grab_info_libgtk_only:
* @display: the #GdkDisplay for which to get the grab information
* @grab_window: location to store current grab window
* @owner_events: location to store boolean indicating whether
* the @owner_events flag to gdk_pointer_grab() was %TRUE.
*
* Determines information about the current pointer grab.
* This is not public API and must not be used by applications.
*
* Return value: %TRUE if this application currently has the
* pointer grabbed.
**/
gboolean
gdk_pointer_grab_info_libgtk_only (GdkDisplay *display,
GdkWindow **grab_window,
gboolean *owner_events)
{
GdkPointerGrabInfo *info;
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
/* What we're interested in is the steady state (ie last grab),
because we're interested e.g. if we grabbed so that we
can ungrab, even if our grab is not active just yet. */
info = _gdk_display_get_last_pointer_grab (display);
if (info)
{
if (grab_window)
*grab_window = info->window;
if (owner_events)
*owner_events = info->owner_events;
return TRUE;
}
else
return FALSE;
}
/**
* gdk_display_pointer_is_grabbed:
* @display: a #GdkDisplay
*
* Test if the pointer is grabbed.
*
* Returns: %TRUE if an active X pointer grab is in effect
*
* Since: 2.2
*/
gboolean
gdk_display_pointer_is_grabbed (GdkDisplay *display)
{
GdkPointerGrabInfo *info;
g_return_val_if_fail (GDK_IS_DISPLAY (display), TRUE);
/* What we're interested in is the steady state (ie last grab),
because we're interested e.g. if we grabbed so that we
can ungrab, even if our grab is not active just yet. */
info = _gdk_display_get_last_pointer_grab (display);
return (info && !info->implicit);
}
#define __GDK_DISPLAY_C__
#include "gdkaliasdef.c"

View File

@@ -43,6 +43,33 @@ typedef struct _GdkDisplayPointerHooks GdkDisplayPointerHooks;
#define GDK_IS_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DISPLAY))
#define GDK_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DISPLAY, GdkDisplayClass))
/* Tracks information about the keyboard grab on this display */
typedef struct
{
GdkWindow *window;
GdkWindow *native_window;
gulong serial;
gboolean owner_events;
guint32 time;
} GdkKeyboardGrabInfo;
/* Tracks information about which window and position the pointer last was in.
* This is useful when we need to synthesize events later.
* Note that we track toplevel_under_pointer using enter/leave events,
* so in the case of a grab, either with owner_events==FALSE or with the
* pointer in no clients window the x/y coordinates may actually be outside
* the window.
*/
typedef struct
{
GdkWindow *toplevel_under_pointer; /* The toplevel window with mouse inside, tracked via native events */
GdkWindow *window_under_pointer; /* The window that last got sent a normal enter event */
gdouble toplevel_x, toplevel_y;
guint32 state;
guint32 button;
gulong motion_hint_serial; /* 0 == didn't deliver hinted motion event */
} GdkPointerWindowInfo;
struct _GdkDisplay
{
GObject parent_instance;
@@ -64,10 +91,18 @@ struct _GdkDisplay
const GdkDisplayPointerHooks *pointer_hooks; /* Current hooks for querying pointer */
guint closed : 1; /* Whether this display has been closed */
guint ignore_core_events : 1; /* Don't send core motion and button event */
guint double_click_distance; /* Maximum distance between clicks in pixels */
gint button_x[2]; /* The last 2 button click positions. */
gint button_y[2];
GList *pointer_grabs;
GdkKeyboardGrabInfo keyboard_grab;
GdkPointerWindowInfo pointer_info;
/* Last reported event time from server */
guint32 last_event_time;
};
struct _GdkDisplayClass

View File

@@ -92,7 +92,7 @@ gdk_display_manager_class_init (GdkDisplayManagerClass *klass)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GdkDisplayManagerClass, display_opened),
NULL, NULL,
gdk_marshal_VOID__OBJECT,
_gdk_marshal_VOID__OBJECT,
G_TYPE_NONE,
1,
GDK_TYPE_DISPLAY);

View File

@@ -61,6 +61,15 @@ static void gdk_drawable_real_draw_pixbuf (GdkDrawable *draw
GdkRgbDither dither,
gint x_dither,
gint y_dither);
static void gdk_drawable_real_draw_drawable (GdkDrawable *drawable,
GdkGC *gc,
GdkDrawable *src,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
G_DEFINE_ABSTRACT_TYPE (GdkDrawable, gdk_drawable, G_TYPE_OBJECT)
@@ -74,6 +83,7 @@ gdk_drawable_class_init (GdkDrawableClass *klass)
klass->get_clip_region = gdk_drawable_real_get_visible_region;
klass->get_visible_region = gdk_drawable_real_get_visible_region;
klass->draw_pixbuf = gdk_drawable_real_draw_pixbuf;
klass->draw_drawable = gdk_drawable_real_draw_drawable;
}
static void
@@ -150,7 +160,8 @@ gdk_drawable_get_size (GdkDrawable *drawable,
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
GDK_DRAWABLE_GET_CLASS (drawable)->get_size (drawable, width, height);
if (GDK_DRAWABLE_GET_CLASS (drawable)->get_size != NULL)
GDK_DRAWABLE_GET_CLASS (drawable)->get_size (drawable, width, height);
}
/**
@@ -652,13 +663,26 @@ gdk_draw_drawable (GdkDrawable *drawable,
&composite_x_offset,
&composite_y_offset);
GDK_DRAWABLE_GET_CLASS (drawable)->draw_drawable (drawable, gc, composite,
xsrc - composite_x_offset,
ysrc - composite_y_offset,
xdest, ydest,
width, height);
/* TODO: For non-native windows this may copy stuff from other overlapping
windows. We should clip that and (for windows with bg != None) clear that
area in the destination instead. */
if (GDK_DRAWABLE_GET_CLASS (drawable)->draw_drawable_with_src)
GDK_DRAWABLE_GET_CLASS (drawable)->draw_drawable_with_src (drawable, gc,
composite,
xsrc - composite_x_offset,
ysrc - composite_y_offset,
xdest, ydest,
width, height,
src);
else /* backwards compat for old out-of-tree implementations of GdkDrawable (are there any?) */
GDK_DRAWABLE_GET_CLASS (drawable)->draw_drawable (drawable, gc,
composite,
xsrc - composite_x_offset,
ysrc - composite_y_offset,
xdest, ydest,
width, height);
g_object_unref (composite);
}
@@ -727,9 +751,6 @@ gdk_draw_image (GdkDrawable *drawable,
* On older X servers, rendering pixbufs with an alpha channel involves round
* trips to the X server, and may be somewhat slow.
*
* The clip mask of @gc is ignored, but clip rectangles and clip regions work
* fine.
*
* If GDK is built with the Sun mediaLib library, the gdk_draw_pixbuf
* function is accelerated using mediaLib, which provides hardware
* acceleration on Intel, AMD, and Sparc chipsets. If desired, mediaLib
@@ -871,7 +892,7 @@ real_draw_glyphs (GdkDrawable *drawable,
cairo_t *cr;
cr = gdk_cairo_create (drawable);
_gdk_gc_update_context (gc, cr, NULL, NULL, TRUE);
_gdk_gc_update_context (gc, cr, NULL, NULL, TRUE, drawable);
if (matrix)
{
@@ -995,7 +1016,7 @@ gdk_draw_trapezoids (GdkDrawable *drawable,
g_return_if_fail (n_trapezoids == 0 || trapezoids != NULL);
cr = gdk_cairo_create (drawable);
_gdk_gc_update_context (gc, cr, NULL, NULL, TRUE);
_gdk_gc_update_context (gc, cr, NULL, NULL, TRUE, drawable);
for (i = 0; i < n_trapezoids; i++)
{
@@ -1185,7 +1206,7 @@ gdk_drawable_real_get_image (GdkDrawable *drawable,
return gdk_drawable_copy_to_image (drawable, NULL, x, y, 0, 0, width, height);
}
static GdkDrawable*
static GdkDrawable *
gdk_drawable_real_get_composite_drawable (GdkDrawable *drawable,
gint x,
gint y,
@@ -1484,6 +1505,31 @@ composite_565 (guchar *src_buf,
}
}
/* Implementation of the old vfunc in terms of the new one
in case someone calls it directly (which they shouldn't!) */
static void
gdk_drawable_real_draw_drawable (GdkDrawable *drawable,
GdkGC *gc,
GdkDrawable *src,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height)
{
GDK_DRAWABLE_GET_CLASS (drawable)->draw_drawable_with_src (drawable,
gc,
src,
xsrc,
ysrc,
xdest,
ydest,
width,
height,
src);
}
static void
gdk_drawable_real_draw_pixbuf (GdkDrawable *drawable,
GdkGC *gc,
@@ -1503,6 +1549,7 @@ gdk_drawable_real_draw_pixbuf (GdkDrawable *drawable,
GdkRegion *clip;
GdkRegion *drect;
GdkRectangle tmp_rect;
GdkDrawable *real_drawable;
g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
g_return_if_fail (pixbuf->colorspace == GDK_COLORSPACE_RGB);
@@ -1575,7 +1622,19 @@ gdk_drawable_real_draw_pixbuf (GdkDrawable *drawable,
/* Actually draw */
if (!gc)
gc = _gdk_drawable_get_scratch_gc (drawable, FALSE);
/* Drawable is a wrapper here, but at this time we
have already retargeted the destination to any
impl window and set the clip, so what we really
want to do is draw directly on the impl, ignoring
client side subwindows. We also use the impl
in the pixmap target case to avoid resetting the
already set clip on the GC. */
if (GDK_IS_WINDOW (drawable))
real_drawable = GDK_WINDOW_OBJECT (drawable)->impl;
else
real_drawable = GDK_PIXMAP_OBJECT (drawable)->impl;
if (pixbuf->has_alpha)
{
GdkVisual *visual = gdk_drawable_get_visual (drawable);
@@ -1645,7 +1704,7 @@ gdk_drawable_real_draw_pixbuf (GdkDrawable *drawable,
image->bpl,
visual->byte_order,
width1, height1);
gdk_draw_image (drawable, gc, image,
gdk_draw_image (real_drawable, gc, image,
xs0, ys0,
dest_x + x0, dest_y + y0,
width1, height1);
@@ -1686,7 +1745,7 @@ gdk_drawable_real_draw_pixbuf (GdkDrawable *drawable,
{
guchar *buf = pixbuf->pixels + src_y * pixbuf->rowstride + src_x * 4;
gdk_draw_rgb_32_image_dithalign (drawable, gc,
gdk_draw_rgb_32_image_dithalign (real_drawable, gc,
dest_x, dest_y,
width, height,
dither,
@@ -1697,7 +1756,7 @@ gdk_drawable_real_draw_pixbuf (GdkDrawable *drawable,
{
guchar *buf = pixbuf->pixels + src_y * pixbuf->rowstride + src_x * 3;
gdk_draw_rgb_image_dithalign (drawable, gc,
gdk_draw_rgb_image_dithalign (real_drawable, gc,
dest_x, dest_y,
width, height,
dither,
@@ -1771,5 +1830,81 @@ _gdk_drawable_get_scratch_gc (GdkDrawable *drawable,
}
}
/**
* _gdk_drawable_get_subwindow_scratch_gc:
* @drawable: A #GdkDrawable
*
* Returns a #GdkGC suitable for drawing on @drawable. The #GdkGC has
* the standard values for @drawable, except for the graphics_exposures
* field which is %TRUE and the subwindow mode which is %GDK_INCLUDE_INFERIORS.
*
* The foreground color of the returned #GdkGC is undefined. The #GdkGC
* must not be altered in any way, except to change its foreground color.
*
* Return value: A #GdkGC suitable for drawing on @drawable
*
* Since: 2.18
**/
GdkGC *
_gdk_drawable_get_subwindow_scratch_gc (GdkDrawable *drawable)
{
GdkScreen *screen;
gint depth;
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
screen = gdk_drawable_get_screen (drawable);
g_return_val_if_fail (!screen->closed, NULL);
depth = gdk_drawable_get_depth (drawable) - 1;
if (!screen->subwindow_gcs[depth])
{
GdkGCValues values;
GdkGCValuesMask mask;
values.graphics_exposures = TRUE;
values.subwindow_mode = GDK_INCLUDE_INFERIORS;
mask = GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW;
screen->subwindow_gcs[depth] =
gdk_gc_new_with_values (drawable, &values, mask);
}
return screen->subwindow_gcs[depth];
}
/*
* _gdk_drawable_get_source_drawable:
* @drawable: a #GdkDrawable
*
* Returns a drawable for the passed @drawable that is guaranteed to be
* usable to create a pixmap (e.g.: not an offscreen window).
*
* Since: 2.16
*/
GdkDrawable *
_gdk_drawable_get_source_drawable (GdkDrawable *drawable)
{
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
if (GDK_DRAWABLE_GET_CLASS (drawable)->get_source_drawable)
return GDK_DRAWABLE_GET_CLASS (drawable)->get_source_drawable (drawable);
return drawable;
}
cairo_surface_t *
_gdk_drawable_create_cairo_surface (GdkDrawable *drawable,
int width,
int height)
{
return GDK_DRAWABLE_GET_CLASS (drawable)->create_cairo_surface (drawable,
width, height);
}
#define __GDK_DRAW_C__
#include "gdkaliasdef.c"

View File

@@ -200,10 +200,27 @@ struct _GdkDrawableClass
cairo_surface_t *(*ref_cairo_surface) (GdkDrawable *drawable);
GdkDrawable *(*get_source_drawable) (GdkDrawable *drawable);
void (*set_cairo_clip) (GdkDrawable *drawable,
cairo_t *cr);
cairo_surface_t * (*create_cairo_surface) (GdkDrawable *drawable,
int width,
int height);
void (*draw_drawable_with_src) (GdkDrawable *drawable,
GdkGC *gc,
GdkDrawable *src,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height,
GdkDrawable *original_src);
/* Padding for future expansion */
void (*_gdk_reserved4) (void);
void (*_gdk_reserved5) (void);
void (*_gdk_reserved6) (void);
void (*_gdk_reserved7) (void);
void (*_gdk_reserved9) (void);
void (*_gdk_reserved10) (void);
@@ -212,7 +229,6 @@ struct _GdkDrawableClass
void (*_gdk_reserved13) (void);
void (*_gdk_reserved14) (void);
void (*_gdk_reserved15) (void);
void (*_gdk_reserved16) (void);
};
struct _GdkTrapezoid

View File

@@ -120,6 +120,63 @@ _gdk_event_queue_append (GdkDisplay *display,
return display->queued_tail;
}
/**
* _gdk_event_queue_insert_after:
* @display: a #GdkDisplay
* @sibling: Append after this event.
* @event: Event to append.
*
* Appends an event after the specified event, or if it isn't in
* the queue, onto the tail of the event queue.
*
* Returns: the newly appended list node.
*
* Since: 2.16
*/
GList*
_gdk_event_queue_insert_after (GdkDisplay *display,
GdkEvent *sibling,
GdkEvent *event)
{
GList *prev = g_list_find (display->queued_events, sibling);
if (prev && prev->next)
{
display->queued_events = g_list_insert_before (display->queued_events, prev->next, event);
return prev->next;
}
else
return _gdk_event_queue_append (display, event);
}
/**
* _gdk_event_queue_insert_after:
* @display: a #GdkDisplay
* @sibling: Append after this event.
* @event: Event to append.
*
* Appends an event before the specified event, or if it isn't in
* the queue, onto the tail of the event queue.
*
* Returns: the newly appended list node.
*
* Since: 2.16
*/
GList*
_gdk_event_queue_insert_before (GdkDisplay *display,
GdkEvent *sibling,
GdkEvent *event)
{
GList *next = g_list_find (display->queued_events, sibling);
if (next)
{
display->queued_events = g_list_insert_before (display->queued_events, next, event);
return next->prev;
}
else
return _gdk_event_queue_append (display, event);
}
/**
* _gdk_event_queue_remove_link:
* @display: a #GdkDisplay
@@ -414,6 +471,7 @@ gdk_event_copy (const GdkEvent *event)
break;
case GDK_EXPOSE:
case GDK_DAMAGE:
if (event->expose.region)
new_event->expose.region = gdk_region_copy (event->expose.region);
break;
@@ -491,6 +549,7 @@ gdk_event_free (GdkEvent *event)
break;
case GDK_EXPOSE:
case GDK_DAMAGE:
if (event->expose.region)
gdk_region_destroy (event->expose.region);
break;
@@ -575,6 +634,7 @@ gdk_event_get_time (const GdkEvent *event)
case GDK_SETTING:
case GDK_OWNER_CHANGE:
case GDK_GRAB_BROKEN:
case GDK_EVENT_LAST:
/* return current time */
break;
}
@@ -653,6 +713,7 @@ gdk_event_get_state (const GdkEvent *event,
case GDK_SETTING:
case GDK_OWNER_CHANGE:
case GDK_GRAB_BROKEN:
case GDK_EVENT_LAST:
/* no state field */
break;
}
@@ -884,9 +945,17 @@ gdk_event_get_axis (const GdkEvent *event,
void
gdk_event_request_motions (const GdkEventMotion *event)
{
GdkDisplay *display;
g_return_if_fail (event != NULL);
if (event->type == GDK_MOTION_NOTIFY && event->is_hint)
gdk_device_get_state (event->device, event->window, NULL, NULL);
{
gdk_device_get_state (event->device, event->window, NULL, NULL);
display = gdk_drawable_get_display (event->window);
_gdk_display_enable_motion_hints (display);
}
}
/**
@@ -1101,13 +1170,16 @@ gdk_synthesize_click (GdkDisplay *display,
gint nclicks)
{
GdkEvent temp_event;
GdkEvent *event_copy;
GList *link;
g_return_if_fail (event != NULL);
temp_event = *event;
temp_event.type = (nclicks == 2) ? GDK_2BUTTON_PRESS : GDK_3BUTTON_PRESS;
gdk_display_put_event (display, &temp_event);
event_copy = gdk_event_copy (&temp_event);
link = _gdk_event_queue_append (display, event_copy);
}
void
@@ -1196,6 +1268,9 @@ gdk_synthesize_window_state (GdkWindow *window,
((GdkWindowObject*) window)->state = temp_event.window_state.new_window_state;
if (temp_event.window_state.changed_mask & GDK_WINDOW_STATE_WITHDRAWN)
_gdk_window_update_viewable (window);
/* We only really send the event to toplevels, since
* all the window states don't apply to non-toplevels.
* Non-toplevels do use the GDK_WINDOW_STATE_WITHDRAWN flag

View File

@@ -151,7 +151,8 @@ typedef enum
GDK_SETTING = 33,
GDK_OWNER_CHANGE = 34,
GDK_GRAB_BROKEN = 35,
GDK_DAMAGE = 36
GDK_DAMAGE = 36,
GDK_EVENT_LAST /* helper variable for decls */
} GdkEventType;
/* Event masks. (Used to select what types of events a window
@@ -518,7 +519,9 @@ gboolean gdk_events_pending (void);
GdkEvent* gdk_event_get (void);
GdkEvent* gdk_event_peek (void);
#ifndef GDK_DISABLE_DEPRECATED
GdkEvent* gdk_event_get_graphics_expose (GdkWindow *window);
#endif
void gdk_event_put (const GdkEvent *event);
GdkEvent* gdk_event_new (GdkEventType type);

View File

@@ -43,12 +43,24 @@ struct _GdkGCPrivate
{
GdkRegion *clip_region;
GdkFill fill;
guint32 region_tag_applied;
int region_tag_offset_x;
int region_tag_offset_y;
GdkRegion *old_clip_region;
GdkPixmap *old_clip_mask;
GdkBitmap *stipple;
GdkPixmap *tile;
GdkPixmap *clip_mask;
guint32 fg_pixel;
guint32 bg_pixel;
guint subwindow_mode : 1;
guint fill : 2;
guint exposures : 2;
};
#define GDK_GC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDK_TYPE_GC, GdkGCPrivate))
@@ -150,6 +162,8 @@ _gdk_gc_init (GdkGC *gc,
gc->clip_x_origin = values->clip_x_origin;
if (values_mask & GDK_GC_CLIP_Y_ORIGIN)
gc->clip_y_origin = values->clip_y_origin;
if ((values_mask & GDK_GC_CLIP_MASK) && values->clip_mask)
priv->clip_mask = g_object_ref (values->clip_mask);
if (values_mask & GDK_GC_TS_X_ORIGIN)
gc->ts_x_origin = values->ts_x_origin;
if (values_mask & GDK_GC_TS_Y_ORIGIN)
@@ -172,6 +186,12 @@ _gdk_gc_init (GdkGC *gc,
priv->fg_pixel = values->foreground.pixel;
if (values_mask & GDK_GC_BACKGROUND)
priv->bg_pixel = values->background.pixel;
if (values_mask & GDK_GC_SUBWINDOW)
priv->subwindow_mode = values->subwindow_mode;
if (values_mask & GDK_GC_EXPOSURES)
priv->exposures = values->graphics_exposures;
else
priv->exposures = TRUE;
gc->colormap = gdk_drawable_get_colormap (drawable);
if (gc->colormap)
@@ -183,9 +203,15 @@ gdk_gc_finalize (GObject *object)
{
GdkGC *gc = GDK_GC (object);
GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
if (priv->clip_region)
gdk_region_destroy (priv->clip_region);
if (priv->old_clip_region)
gdk_region_destroy (priv->old_clip_region);
if (priv->clip_mask)
g_object_unref (priv->clip_mask);
if (priv->old_clip_mask)
g_object_unref (priv->old_clip_mask);
if (gc->colormap)
g_object_unref (gc->colormap);
if (priv->tile)
@@ -269,6 +295,12 @@ gdk_gc_set_values (GdkGC *gc,
priv = GDK_GC_GET_PRIVATE (gc);
if ((values_mask & GDK_GC_CLIP_X_ORIGIN) ||
(values_mask & GDK_GC_CLIP_Y_ORIGIN) ||
(values_mask & GDK_GC_CLIP_MASK) ||
(values_mask & GDK_GC_SUBWINDOW))
_gdk_gc_remove_drawable_clip (gc);
if (values_mask & GDK_GC_CLIP_X_ORIGIN)
gc->clip_x_origin = values->clip_x_origin;
if (values_mask & GDK_GC_CLIP_Y_ORIGIN)
@@ -279,6 +311,14 @@ gdk_gc_set_values (GdkGC *gc,
gc->ts_y_origin = values->ts_y_origin;
if (values_mask & GDK_GC_CLIP_MASK)
{
if (priv->clip_mask)
{
g_object_unref (priv->clip_mask);
priv->clip_mask = NULL;
}
if (values->clip_mask)
priv->clip_mask = g_object_ref (values->clip_mask);
if (priv->clip_region)
{
gdk_region_destroy (priv->clip_region);
@@ -313,6 +353,10 @@ gdk_gc_set_values (GdkGC *gc,
priv->fg_pixel = values->foreground.pixel;
if (values_mask & GDK_GC_BACKGROUND)
priv->bg_pixel = values->background.pixel;
if (values_mask & GDK_GC_SUBWINDOW)
priv->subwindow_mode = values->subwindow_mode;
if (values_mask & GDK_GC_EXPOSURES)
priv->exposures = values->graphics_exposures;
GDK_GC_GET_CLASS (gc)->set_values (gc, values, values_mask);
}
@@ -542,18 +586,160 @@ gdk_gc_set_clip_mask (GdkGC *gc,
gdk_gc_set_values (gc, &values, GDK_GC_CLIP_MASK);
}
/* Takes ownership of passed in region */
static void
_gdk_gc_set_clip_region_internal (GdkGC *gc,
GdkRegion *region)
_gdk_gc_set_clip_region_real (GdkGC *gc,
GdkRegion *region,
gboolean reset_origin)
{
GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
if (priv->clip_mask)
{
g_object_unref (priv->clip_mask);
priv->clip_mask = NULL;
}
if (priv->clip_region)
gdk_region_destroy (priv->clip_region);
priv->clip_region = region;
_gdk_windowing_gc_set_clip_region (gc, region);
_gdk_windowing_gc_set_clip_region (gc, region, reset_origin);
}
/* Doesn't copy region, allows not to reset origin */
void
_gdk_gc_set_clip_region_internal (GdkGC *gc,
GdkRegion *region,
gboolean reset_origin)
{
_gdk_gc_remove_drawable_clip (gc);
_gdk_gc_set_clip_region_real (gc, region, reset_origin);
}
void
_gdk_gc_add_drawable_clip (GdkGC *gc,
guint32 region_tag,
GdkRegion *region,
int offset_x,
int offset_y)
{
GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
if (priv->region_tag_applied == region_tag &&
offset_x == priv->region_tag_offset_x &&
offset_y == priv->region_tag_offset_y)
return; /* Already appied this drawable region */
if (priv->region_tag_applied)
_gdk_gc_remove_drawable_clip (gc);
region = gdk_region_copy (region);
if (offset_x != 0 || offset_y != 0)
gdk_region_offset (region, offset_x, offset_y);
if (priv->clip_mask)
{
int w, h;
GdkPixmap *new_mask;
GdkGC *tmp_gc;
GdkColor black = {0, 0, 0, 0};
GdkRectangle r;
GdkOverlapType overlap;
gdk_drawable_get_size (priv->clip_mask, &w, &h);
r.x = 0;
r.y = 0;
r.width = w;
r.height = h;
/* Its quite common to expose areas that are completely in or outside
* the region, so we try to avoid allocating bitmaps that are just fully
* set or completely unset.
*/
overlap = gdk_region_rect_in (region, &r);
if (overlap == GDK_OVERLAP_RECTANGLE_PART)
{
/* The region and the mask intersect, create a new clip mask that
includes both areas */
priv->old_clip_mask = g_object_ref (priv->clip_mask);
new_mask = gdk_pixmap_new (priv->old_clip_mask, w, h, -1);
tmp_gc = _gdk_drawable_get_scratch_gc ((GdkDrawable *)new_mask, FALSE);
gdk_gc_set_foreground (tmp_gc, &black);
gdk_draw_rectangle (new_mask, tmp_gc, TRUE, 0, 0, -1, -1);
_gdk_gc_set_clip_region_internal (tmp_gc, region, TRUE); /* Takes ownership of region */
gdk_draw_drawable (new_mask,
tmp_gc,
priv->old_clip_mask,
0, 0,
0, 0,
-1, -1);
gdk_gc_set_clip_region (tmp_gc, NULL);
gdk_gc_set_clip_mask (gc, new_mask);
g_object_unref (new_mask);
}
else if (overlap == GDK_OVERLAP_RECTANGLE_OUT)
{
/* No intersection, set empty clip region */
GdkRegion *empty = gdk_region_new ();
gdk_region_destroy (region);
priv->old_clip_mask = g_object_ref (priv->clip_mask);
priv->clip_region = empty;
_gdk_windowing_gc_set_clip_region (gc, empty, FALSE);
}
else
{
/* Completely inside region, don't set unnecessary clip */
gdk_region_destroy (region);
return;
}
}
else
{
priv->old_clip_region = priv->clip_region;
priv->clip_region = region;
if (priv->old_clip_region)
gdk_region_intersect (region, priv->old_clip_region);
_gdk_windowing_gc_set_clip_region (gc, priv->clip_region, FALSE);
}
priv->region_tag_applied = region_tag;
priv->region_tag_offset_x = offset_x;
priv->region_tag_offset_y = offset_y;
}
void
_gdk_gc_remove_drawable_clip (GdkGC *gc)
{
GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
if (priv->region_tag_applied)
{
priv->region_tag_applied = 0;
if (priv->old_clip_mask)
{
gdk_gc_set_clip_mask (gc, priv->old_clip_mask);
g_object_unref (priv->old_clip_mask);
priv->old_clip_mask = NULL;
if (priv->clip_region)
{
g_object_unref (priv->clip_region);
priv->clip_region = NULL;
}
}
else
{
_gdk_gc_set_clip_region_real (gc, priv->old_clip_region, FALSE);
priv->old_clip_region = NULL;
}
}
}
/**
@@ -573,12 +759,14 @@ gdk_gc_set_clip_rectangle (GdkGC *gc,
g_return_if_fail (GDK_IS_GC (gc));
_gdk_gc_remove_drawable_clip (gc);
if (rectangle)
region = gdk_region_rectangle (rectangle);
else
region = NULL;
_gdk_gc_set_clip_region_internal (gc, region);
_gdk_gc_set_clip_region_real (gc, region, TRUE);
}
/**
@@ -598,12 +786,14 @@ gdk_gc_set_clip_region (GdkGC *gc,
g_return_if_fail (GDK_IS_GC (gc));
_gdk_gc_remove_drawable_clip (gc);
if (region)
copy = gdk_region_copy (region);
else
copy = NULL;
_gdk_gc_set_clip_region_internal (gc, copy);
_gdk_gc_set_clip_region_real (gc, copy, TRUE);
}
/**
@@ -624,6 +814,24 @@ _gdk_gc_get_clip_region (GdkGC *gc)
return GDK_GC_GET_PRIVATE (gc)->clip_region;
}
/**
* _gdk_gc_get_clip_mask:
* @gc: a #GdkGC
*
* Gets the current clip mask for @gc, if any.
*
* Return value: the clip mask for the GC, or %NULL.
* (if a clip region is set, the return will be %NULL)
* This value is owned by the GC and must not be freed.
**/
GdkBitmap *
_gdk_gc_get_clip_mask (GdkGC *gc)
{
g_return_val_if_fail (GDK_IS_GC (gc), NULL);
return GDK_GC_GET_PRIVATE (gc)->clip_mask;
}
/**
* _gdk_gc_get_fill:
* @gc: a #GdkGC
@@ -640,6 +848,14 @@ _gdk_gc_get_fill (GdkGC *gc)
return GDK_GC_GET_PRIVATE (gc)->fill;
}
gboolean
_gdk_gc_get_exposures (GdkGC *gc)
{
g_return_val_if_fail (GDK_IS_GC (gc), FALSE);
return GDK_GC_GET_PRIVATE (gc)->exposures;
}
/**
* _gdk_gc_get_tile:
* @gc: a #GdkGC
@@ -723,13 +939,27 @@ gdk_gc_set_subwindow (GdkGC *gc,
GdkSubwindowMode mode)
{
GdkGCValues values;
GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
g_return_if_fail (GDK_IS_GC (gc));
/* This could get called a lot to reset the subwindow mode in
the client side clipping, so bail out early */
if (priv->subwindow_mode == mode)
return;
values.subwindow_mode = mode;
gdk_gc_set_values (gc, &values, GDK_GC_SUBWINDOW);
}
GdkSubwindowMode
_gdk_gc_get_subwindow (GdkGC *gc)
{
GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
return priv->subwindow_mode;
}
/**
* gdk_gc_set_exposures:
* @gc: a #GdkGC.
@@ -890,6 +1120,26 @@ gdk_gc_copy (GdkGC *dst_gc,
dst_priv->clip_region = gdk_region_copy (src_priv->clip_region);
else
dst_priv->clip_region = NULL;
dst_priv->region_tag_applied = src_priv->region_tag_applied;
if (dst_priv->old_clip_region)
gdk_region_destroy (dst_priv->old_clip_region);
if (src_priv->old_clip_region)
dst_priv->old_clip_region = gdk_region_copy (src_priv->old_clip_region);
else
dst_priv->old_clip_region = NULL;
if (src_priv->clip_mask)
dst_priv->clip_mask = g_object_ref (src_priv->clip_mask);
else
dst_priv->clip_mask = NULL;
if (src_priv->old_clip_mask)
dst_priv->old_clip_mask = g_object_ref (src_priv->old_clip_mask);
else
dst_priv->old_clip_mask = NULL;
dst_priv->fill = src_priv->fill;
@@ -907,6 +1157,8 @@ gdk_gc_copy (GdkGC *dst_gc,
dst_priv->fg_pixel = src_priv->fg_pixel;
dst_priv->bg_pixel = src_priv->bg_pixel;
dst_priv->subwindow_mode = src_priv->subwindow_mode;
dst_priv->exposures = src_priv->exposures;
}
/**
@@ -1117,6 +1369,8 @@ gc_get_background (GdkGC *gc,
* the fill mode will be forced to %GDK_STIPPLED
* @gc_changed: pass %FALSE if the @gc has not changed since the
* last call to this function
* @target_drawable: The drawable you're drawing in. If passed in
* this is used for client side window clip emulation.
*
* Set the attributes of a cairo context to match those of a #GdkGC
* as far as possible. Some aspects of a #GdkGC, such as clip masks
@@ -1127,7 +1381,8 @@ _gdk_gc_update_context (GdkGC *gc,
cairo_t *cr,
const GdkColor *override_foreground,
GdkBitmap *override_stipple,
gboolean gc_changed)
gboolean gc_changed,
GdkDrawable *target_drawable)
{
GdkGCPrivate *priv;
GdkFill fill;
@@ -1142,6 +1397,8 @@ _gdk_gc_update_context (GdkGC *gc,
priv = GDK_GC_GET_PRIVATE (gc);
_gdk_gc_remove_drawable_clip (gc);
fill = priv->fill;
if (override_stipple && fill != GDK_OPAQUE_STIPPLED)
fill = GDK_STIPPLED;
@@ -1232,6 +1489,10 @@ _gdk_gc_update_context (GdkGC *gc,
return;
cairo_reset_clip (cr);
/* The reset above resets the window clip rect, so we want to re-set that */
if (target_drawable && GDK_DRAWABLE_GET_CLASS (target_drawable)->set_cairo_clip)
GDK_DRAWABLE_GET_CLASS (target_drawable)->set_cairo_clip (target_drawable, cr);
if (priv->clip_region)
{
cairo_save (cr);
@@ -1246,6 +1507,7 @@ _gdk_gc_update_context (GdkGC *gc,
cairo_clip (cr);
}
}

View File

@@ -39,6 +39,7 @@ GList *_gdk_default_filters = NULL;
gchar *_gdk_display_name = NULL;
gint _gdk_screen_number = -1;
gchar *_gdk_display_arg_name = NULL;
gboolean _gdk_native_windows = FALSE;
GSList *_gdk_displays = NULL;

View File

@@ -107,6 +107,7 @@ extern gint _gdk_error_code;
extern gint _gdk_error_warnings;
extern guint _gdk_debug_flags;
extern gboolean _gdk_native_windows;
#ifdef G_ENABLE_DEBUG
@@ -170,6 +171,114 @@ struct _GdkEventPrivate
gpointer windowing_data;
};
/* Tracks information about the pointer grab on this display */
typedef struct
{
GdkWindow *window;
GdkWindow *native_window;
gulong serial_start;
gulong serial_end; /* exclusive, i.e. not active on serial_end */
gboolean owner_events;
guint event_mask;
gboolean implicit;
guint32 time;
gboolean activated;
gboolean implicit_ungrab;
} GdkPointerGrabInfo;
typedef struct _GdkInputWindow GdkInputWindow;
/* Private version of GdkWindowObject. The initial part of this strucuture
is public for historical reasons. Don't change that part */
typedef struct _GdkWindowPaint GdkWindowPaint;
struct _GdkWindowObject
{
/* vvvvvvv THIS PART IS PUBLIC. DON'T CHANGE vvvvvvvvvvvvvv */
GdkDrawable parent_instance;
GdkDrawable *impl; /* window-system-specific delegate object */
GdkWindowObject *parent;
gpointer user_data;
gint x;
gint y;
gint extension_events;
GList *filters;
GList *children;
GdkColor bg_color;
GdkPixmap *bg_pixmap;
GSList *paint_stack;
GdkRegion *update_area;
guint update_freeze_count;
guint8 window_type;
guint8 depth;
guint8 resize_count;
GdkWindowState state;
guint guffaw_gravity : 1;
guint input_only : 1;
guint modal_hint : 1;
guint composited : 1;
guint destroyed : 2;
guint accept_focus : 1;
guint focus_on_map : 1;
guint shaped : 1;
GdkEventMask event_mask;
guint update_and_descendants_freeze_count;
GdkWindowRedirect *redirect;
/* ^^^^^^^^^^ THIS PART IS PUBLIC. DON'T CHANGE ^^^^^^^^^^ */
/* The GdkWindowObject that has the impl, ref:ed if another window.
* This ref is required to keep the wrapper of the impl window alive
* for as long as any GdkWindow references the impl. */
GdkWindowObject *impl_window;
int abs_x, abs_y; /* Absolute offset in impl */
gint width, height;
guint32 clip_tag;
GdkRegion *clip_region; /* Clip region (wrt toplevel) in window coords */
GdkRegion *clip_region_with_children; /* Clip region in window coords */
GdkCursor *cursor;
gint8 toplevel_window_type;
guint synthesize_crossing_event_queued : 1;
guint effective_visibility : 2;
guint visibility : 2; /* The visibility wrt the toplevel (i.e. based on clip_region) */
guint native_visibility : 2; /* the native visibility of a impl windows */
guint viewable : 1; /* mapped and all parents mapped */
guint applied_shape : 1;
guint num_offscreen_children;
GdkWindowPaint *implicit_paint;
GdkInputWindow *input_window; /* only set for impl windows */
GList *outstanding_moves;
GdkRegion *shape;
GdkRegion *input_shape;
cairo_surface_t *cairo_surface;
guint outstanding_surfaces; /* only set on impl window */
};
#define GDK_WINDOW_TYPE(d) (((GdkWindowObject*)(GDK_WINDOW (d)))->window_type)
#define GDK_WINDOW_DESTROYED(d) (((GdkWindowObject*)(GDK_WINDOW (d)))->destroyed)
extern GdkEventFunc _gdk_event_func; /* Callback for events */
extern gpointer _gdk_event_data;
extern GDestroyNotify _gdk_event_notify;
@@ -182,15 +291,21 @@ extern gchar *_gdk_display_arg_name;
void _gdk_events_queue (GdkDisplay *display);
GdkEvent* _gdk_event_unqueue (GdkDisplay *display);
GList* _gdk_event_queue_find_first (GdkDisplay *display);
void _gdk_event_queue_remove_link (GdkDisplay *display,
GList *node);
GList* _gdk_event_queue_prepend (GdkDisplay *display,
GdkEvent *event);
GList* _gdk_event_queue_append (GdkDisplay *display,
GdkEvent *event);
void _gdk_event_button_generate (GdkDisplay *display,
GdkEvent *event);
GList* _gdk_event_queue_find_first (GdkDisplay *display);
void _gdk_event_queue_remove_link (GdkDisplay *display,
GList *node);
GList* _gdk_event_queue_prepend (GdkDisplay *display,
GdkEvent *event);
GList* _gdk_event_queue_append (GdkDisplay *display,
GdkEvent *event);
GList* _gdk_event_queue_insert_after (GdkDisplay *display,
GdkEvent *after_event,
GdkEvent *event);
GList* _gdk_event_queue_insert_before(GdkDisplay *display,
GdkEvent *after_event,
GdkEvent *event);
void _gdk_event_button_generate (GdkDisplay *display,
GdkEvent *event);
void _gdk_windowing_event_data_copy (const GdkEvent *src,
GdkEvent *dst);
@@ -227,28 +342,60 @@ GdkImage *_gdk_drawable_copy_to_image (GdkDrawable *drawable,
cairo_surface_t *_gdk_drawable_ref_cairo_surface (GdkDrawable *drawable);
GdkDrawable *_gdk_drawable_get_source_drawable (GdkDrawable *drawable);
cairo_surface_t * _gdk_drawable_create_cairo_surface (GdkDrawable *drawable,
int width,
int height);
/* GC caching */
GdkGC *_gdk_drawable_get_scratch_gc (GdkDrawable *drawable,
gboolean graphics_exposures);
GdkGC *_gdk_drawable_get_subwindow_scratch_gc (GdkDrawable *drawable);
void _gdk_gc_update_context (GdkGC *gc,
cairo_t *cr,
const GdkColor *override_foreground,
GdkBitmap *override_stipple,
gboolean gc_changed);
gboolean gc_changed,
GdkDrawable *target_drawable);
/*************************************
* Interfaces used by windowing code *
*************************************/
GdkWindow *_gdk_window_new (GdkWindow *window,
GdkWindowAttr *attributes,
gint attributes_mask);
void _gdk_window_destroy (GdkWindow *window,
gboolean foreign_destroy);
void _gdk_window_clear_update_area (GdkWindow *window);
GdkPixmap *_gdk_pixmap_new (GdkDrawable *drawable,
gint width,
gint height,
gint depth);
GdkPixmap *_gdk_pixmap_create_from_data (GdkDrawable *drawable,
const gchar *data,
gint width,
gint height,
gint depth,
const GdkColor *fg,
const GdkColor *bg);
GdkPixmap *_gdk_bitmap_create_from_data (GdkDrawable *drawable,
const gchar *data,
gint width,
gint height);
void _gdk_screen_close (GdkScreen *screen);
void _gdk_window_impl_new (GdkWindow *window,
GdkWindow *real_parent,
GdkScreen *screen,
GdkVisual *visual,
GdkEventMask event_mask,
GdkWindowAttr *attributes,
gint attributes_mask);
void _gdk_window_destroy (GdkWindow *window,
gboolean foreign_destroy);
void _gdk_window_clear_update_area (GdkWindow *window);
void _gdk_window_update_size (GdkWindow *window);
gboolean _gdk_window_update_viewable (GdkWindow *window);
void _gdk_window_process_updates_recurse (GdkWindow *window,
GdkRegion *expose_region);
void _gdk_screen_close (GdkScreen *screen);
const char *_gdk_get_sm_client_id (void);
@@ -258,11 +405,23 @@ void _gdk_gc_init (GdkGC *gc,
GdkGCValuesMask values_mask);
GdkRegion *_gdk_gc_get_clip_region (GdkGC *gc);
GdkBitmap *_gdk_gc_get_clip_mask (GdkGC *gc);
gboolean _gdk_gc_get_exposures (GdkGC *gc);
GdkFill _gdk_gc_get_fill (GdkGC *gc);
GdkPixmap *_gdk_gc_get_tile (GdkGC *gc);
GdkBitmap *_gdk_gc_get_stipple (GdkGC *gc);
guint32 _gdk_gc_get_fg_pixel (GdkGC *gc);
guint32 _gdk_gc_get_bg_pixel (GdkGC *gc);
void _gdk_gc_add_drawable_clip (GdkGC *gc,
guint32 region_tag,
GdkRegion *region,
int offset_x,
int offset_y);
void _gdk_gc_remove_drawable_clip (GdkGC *gc);
void _gdk_gc_set_clip_region_internal (GdkGC *gc,
GdkRegion *region,
gboolean reset_origin);
GdkSubwindowMode _gdk_gc_get_subwindow (GdkGC *gc);
/*****************************************
* Interfaces provided by windowing code *
@@ -284,60 +443,50 @@ void _gdk_windowing_set_default_display (GdkDisplay *display);
gchar *_gdk_windowing_substitute_screen_number (const gchar *display_name,
gint screen_number);
gulong _gdk_windowing_window_get_next_serial (GdkDisplay *display);
void _gdk_windowing_window_get_offsets (GdkWindow *window,
gint *x_offset,
gint *y_offset);
GdkRegion *_gdk_windowing_window_get_shape (GdkWindow *window);
GdkRegion *_gdk_windowing_window_get_input_shape(GdkWindow *window);
GdkRegion *_gdk_windowing_get_shape_for_mask (GdkBitmap *mask);
void _gdk_windowing_window_beep (GdkWindow *window);
void _gdk_windowing_get_pointer (GdkDisplay *display,
GdkScreen **screen,
gint *x,
gint *y,
GdkModifierType *mask);
GdkWindow* _gdk_windowing_window_get_pointer (GdkDisplay *display,
GdkWindow *window,
gint *x,
gint *y,
GdkModifierType *mask);
GdkWindow* _gdk_windowing_window_at_pointer (GdkDisplay *display,
gint *win_x,
gint *win_y);
gint *win_y,
GdkModifierType *mask,
gboolean get_toplevel);
GdkGrabStatus _gdk_windowing_pointer_grab (GdkWindow *window,
GdkWindow *native,
gboolean owner_events,
GdkEventMask event_mask,
GdkWindow *confine_to,
GdkCursor *cursor,
guint32 time);
void _gdk_windowing_got_event (GdkDisplay *display,
GList *event_link,
GdkEvent *event,
gulong serial);
void _gdk_windowing_window_process_updates_recurse (GdkWindow *window,
GdkRegion *expose_region);
void _gdk_windowing_before_process_all_updates (void);
void _gdk_windowing_after_process_all_updates (void);
/* Return the number of bits-per-pixel for images of the specified depth. */
gint _gdk_windowing_get_bits_for_depth (GdkDisplay *display,
gint depth);
void _gdk_window_reparent (GdkWindow *window,
GdkWindow *new_parent,
gint x,
gint y);
#define GDK_WINDOW_IS_MAPPED(window) ((((GdkWindowObject*)window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0)
/* Called before processing updates for a window. This gives the windowing
* layer a chance to save the region for later use in avoiding duplicate
* exposes. The return value indicates whether the function has a saved
* the region; if the result is TRUE, then the windowing layer is responsible
* for destroying the region later.
*/
gboolean _gdk_windowing_window_queue_antiexpose (GdkWindow *window,
GdkRegion *area);
/* Called to do the windowing system specific part of gdk_window_destroy(),
*
* window: The window being destroyed
* recursing: If TRUE, then this is being called because a parent
* was destroyed. This generally means that the call to the windowing system
* to destroy the window can be omitted, since it will be destroyed as a result
* of the parent being destroyed. Unless @foreign_destroy
*
* foreign_destroy: If TRUE, the window or a parent was destroyed by some external
* agency. The window has already been destroyed and no windowing
* system calls should be made. (This may never happen for some
* windowing systems.)
*/
void _gdk_windowing_window_destroy (GdkWindow *window,
gboolean recursing,
gboolean foreign_destroy);
/* Called when gdk_window_destroy() is called on a foreign window
* or an ancestor of the foreign window. It should generally reparent
@@ -365,15 +514,9 @@ struct _GdkPaintableIface
GTypeInterface g_iface;
void (* begin_paint_region) (GdkPaintable *paintable,
GdkWindow *window,
const GdkRegion *region);
void (* end_paint) (GdkPaintable *paintable);
void (* invalidate_maybe_recurse) (GdkPaintable *paintable,
const GdkRegion *region,
gboolean (*child_func) (GdkWindow *, gpointer),
gpointer user_data);
void (* process_updates) (GdkPaintable *paintable,
gboolean update_children);
};
GType _gdk_paintable_get_type (void) G_GNUC_CONST;
@@ -387,6 +530,7 @@ GType _gdk_pixmap_impl_get_type (void) G_GNUC_CONST;
* _gdk_windowing_gc_set_clip_region:
* @gc: a #GdkGC
* @region: the new clip region
* @reset_origin: if TRUE, reset the clip_x/y_origin values to 0
*
* Do any window-system specific processing necessary
* for a change in clip region. Since the clip origin
@@ -398,7 +542,8 @@ GType _gdk_pixmap_impl_get_type (void) G_GNUC_CONST;
* will already return the new region.
**/
void _gdk_windowing_gc_set_clip_region (GdkGC *gc,
const GdkRegion *region);
const GdkRegion *region,
gboolean reset_origin);
/**
* _gdk_windowing_gc_copy:
@@ -435,6 +580,102 @@ char *_gdk_windowing_get_startup_notify_id (GAppLaunchContext *context,
void _gdk_windowing_launch_failed (GAppLaunchContext *context,
const char *startup_notify_id);
GdkPointerGrabInfo *_gdk_display_get_active_pointer_grab (GdkDisplay *display);
void _gdk_display_pointer_grab_update (GdkDisplay *display,
gulong current_serial);
GdkPointerGrabInfo *_gdk_display_get_last_pointer_grab (GdkDisplay *display);
GdkPointerGrabInfo *_gdk_display_add_pointer_grab (GdkDisplay *display,
GdkWindow *window,
GdkWindow *native_window,
gboolean owner_events,
GdkEventMask event_mask,
unsigned long serial_start,
guint32 time,
gboolean implicit);
GdkPointerGrabInfo * _gdk_display_has_pointer_grab (GdkDisplay *display,
gulong serial);
gboolean _gdk_display_end_pointer_grab (GdkDisplay *display,
gulong serial,
GdkWindow *if_child,
gboolean implicit);
void _gdk_display_set_has_keyboard_grab (GdkDisplay *display,
GdkWindow *window,
GdkWindow *native_window,
gboolean owner_events,
unsigned long serial,
guint32 time);
void _gdk_display_unset_has_keyboard_grab (GdkDisplay *display,
gboolean implicit);
void _gdk_display_enable_motion_hints (GdkDisplay *display);
void _gdk_window_invalidate_for_expose (GdkWindow *window,
GdkRegion *region);
void _gdk_windowing_set_cairo_surface_size (cairo_surface_t *surface,
int width,
int height);
cairo_surface_t * _gdk_windowing_create_cairo_surface (GdkDrawable *drawable,
int width,
int height);
GdkWindow * _gdk_window_find_child_at (GdkWindow *window,
int x, int y);
GdkWindow * _gdk_window_find_descendant_at (GdkWindow *toplevel,
double x, double y,
double *found_x,
double *found_y);
void _gdk_window_add_damage (GdkWindow *toplevel,
GdkRegion *damaged_region);
GdkEvent * _gdk_make_event (GdkWindow *window,
GdkEventType type,
GdkEvent *event_in_queue,
gboolean before_event);
gboolean _gdk_window_event_parent_of (GdkWindow *parent,
GdkWindow *child);
void _gdk_synthesize_crossing_events (GdkDisplay *display,
GdkWindow *src,
GdkWindow *dest,
GdkCrossingMode mode,
gint toplevel_x,
gint toplevel_y,
GdkModifierType mask,
guint32 time_,
GdkEvent *event_in_queue,
gulong serial,
gboolean non_linear);
void _gdk_display_set_window_under_pointer (GdkDisplay *display,
GdkWindow *window);
void _gdk_synthesize_crossing_events_for_geometry_change (GdkWindow *changed_window);
GdkRegion *_gdk_window_calculate_full_clip_region (GdkWindow *window,
GdkWindow *base_window,
gboolean do_children,
gint *base_x_offset,
gint *base_y_offset);
gboolean _gdk_window_has_impl (GdkWindow *window);
GdkWindow * _gdk_window_get_impl_window (GdkWindow *window);
GdkWindow *_gdk_window_get_input_window_for_event (GdkWindow *native_window,
GdkEventType event_type,
int x, int y,
gulong serial);
GdkRegion *_gdk_region_new_from_yxbanded_rects (GdkRectangle *rects, int n_rects);
/*****************************
* offscreen window routines *
*****************************/
GType gdk_offscreen_window_get_type (void);
void _gdk_offscreen_window_new (GdkWindow *window,
GdkScreen *screen,
GdkVisual *visual,
GdkWindowAttr *attributes,
gint attributes_mask);
/************************************
* Initialization and exit routines *

View File

@@ -1,13 +1,15 @@
#!/usr/bin/env perl
# Updates http://svn.gnome.org/viewcvs/gtk%2B/trunk/gdk/gdkkeysyms.h?view=log from upstream (X.org 7.x),
# Updates http://git.gnome.org/cgit/gtk+/tree/gdk/gdkkeysyms.h from upstream (X.org 7.x),
# from http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=keysymdef.h
#
# Author : Simos Xenitellis <simos at gnome dot org>.
# Authos : Bastien Nocera <hadess@hadess.net>
# Version : 1.2
#
# Input : http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=keysymdef.h
# Output : http://svn.gnome.org/svn/gtk+/trunk/gdk/gdkkeysyms.h
# Input : http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h
# Output : http://git.gnome.org/cgit/gtk+/tree/gdk/gdkkeysyms.h
#
# Notes : It downloads keysymdef.h from the Internet, if not found locally,
# Notes : and creates an updated gdkkeysyms.h
@@ -33,6 +35,20 @@ else
print "as found at http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob;f=keysymdef.h\n\n";
}
if ( ! -f "XF86keysym.h" )
{
print "Trying to download XF86keysym.h from\n";
print "http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h\n";
die "Unable to download keysymdef.h from http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h\n"
unless system("wget -c -O XF86keysym.h \"http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h\"") == 0;
print " done.\n\n";
}
else
{
print "We are using existing XF86keysym.h found in this directory.\n";
print "It is assumed that you took care and it is a recent version\n";
print "as found at http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob;f=XF86keysym.h\n\n";
}
if ( -f "gdkkeysyms.h" )
{
@@ -41,7 +57,7 @@ if ( -f "gdkkeysyms.h" )
die "Exiting...\n\n";
}
# Source: http://cvs.freedesktop.org/xorg/xc/include/keysymdef.h
# Source: http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob;f=keysymdef.h
die "Could not open file keysymdef.h: $!\n" unless open(IN_KEYSYMDEF, "<:utf8", "keysymdef.h");
# Output: gtk+/gdk/gdkkeysyms.h
@@ -50,7 +66,7 @@ die "Could not open file gdkkeysyms.h: $!\n" unless open(OUT_GDKKEYSYMS, ">:utf8
print OUT_GDKKEYSYMS<<EOF;
/* GDK - The GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
* Copyright (C) 2005, 2006, 2007 GNOME Foundation
* Copyright (C) 2005, 2006, 2007, 2009 GNOME Foundation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -69,9 +85,11 @@ print OUT_GDKKEYSYMS<<EOF;
*/
/*
* File auto-generated from script http://svn.gnome.org/viewcvs/gtk%2B/trunk/gdk/gdkkeysyms-update.pl
* File auto-generated from script http://git.gnome.org/cgit/gtk+/tree/gdk/gdkkeysyms-update.pl
* using the input file
* http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=keysymdef.h
* and
* http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h
*/
/*
@@ -106,9 +124,50 @@ while (<IN_KEYSYMDEF>)
printf OUT_GDKKEYSYMS "#define %s 0x%03x\n", $keysymelements[1], hex($keysymelements[2]);
}
close IN_KEYSYMDEF;
#$gdksyms{"0"} = "0000";
close IN_KEYSYMDEF;
# Source: http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob;f=XF86keysym.h
die "Could not open file XF86keysym.h: $!\n" unless open(IN_XF86KEYSYM, "<:utf8", "XF86keysym.h");
while (<IN_XF86KEYSYM>)
{
next if ( ! /^#define / );
@keysymelements = split(/\s+/);
die "Internal error, no \@keysymelements: $_\n" unless @keysymelements;
$_ = $keysymelements[1];
die "Internal error, was expecting \"XF86XK_*\", found: $_\n" if ( ! /^XF86XK_/ );
# Work-around https://bugs.freedesktop.org/show_bug.cgi?id=11193
if ($_ eq "XF86XK_XF86BackForward") {
$keysymelements[1] = "XF86XK_AudioForward";
}
# XF86XK_Clear could end up a dupe of XK_Clear
# XF86XK_Select could end up a dupe of XK_Select
if ($_ eq "XF86XK_Clear") {
$keysymelements[1] = "XF86XK_WindowClear";
}
if ($_ eq "XF86XK_Select") {
$keysymelements[1] = "XF86XK_SelectButton";
}
# Ignore XF86XK_Q
next if ( $_ eq "XF86XK_Q");
# XF86XK_Calculater is misspelled, and a dupe
next if ( $_ eq "XF86XK_Calculater");
$_ = $keysymelements[2];
die "Internal error, was expecting \"0x*\", found: $_\n" if ( ! /^0x/ );
$keysymelements[1] =~ s/^XF86XK_/GDK_/g;
printf OUT_GDKKEYSYMS "#define %s 0x%03x\n", $keysymelements[1], hex($keysymelements[2]);
}
close IN_XF86KEYSYM;
print OUT_GDKKEYSYMS<<EOF;

File diff suppressed because it is too large Load Diff

View File

@@ -1,2 +1,6 @@
VOID:OBJECT
VOID:BOOLEAN
VOID:POINTER,POINTER,POINTER
OBJECT:VOID
OBJECT:DOUBLE,DOUBLE
VOID:DOUBLE,DOUBLE,POINTER,POINTER

1306
gdk/gdkoffscreenwindow.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -214,7 +214,8 @@ get_cairo_context (GdkPangoRenderer *gdk_renderer,
priv->cr,
color,
priv->stipple[part],
priv->gc_changed);
priv->gc_changed,
priv->drawable);
}
priv->last_part = part;

View File

@@ -77,7 +77,8 @@ static void gdk_pixmap_draw_drawable (GdkDrawable *drawable,
gint xdest,
gint ydest,
gint width,
gint height);
gint height,
GdkPixmap *original_src);
static void gdk_pixmap_draw_points (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
@@ -145,6 +146,9 @@ static GdkImage* gdk_pixmap_copy_to_image (GdkDrawable *drawable,
gint height);
static cairo_surface_t *gdk_pixmap_ref_cairo_surface (GdkDrawable *drawable);
static cairo_surface_t *gdk_pixmap_create_cairo_surface (GdkDrawable *drawable,
int width,
int height);
static GdkVisual* gdk_pixmap_real_get_visual (GdkDrawable *drawable);
static gint gdk_pixmap_real_get_depth (GdkDrawable *drawable);
@@ -199,7 +203,7 @@ gdk_pixmap_class_init (GdkPixmapObjectClass *klass)
drawable_class->draw_polygon = gdk_pixmap_draw_polygon;
drawable_class->draw_text = gdk_pixmap_draw_text;
drawable_class->draw_text_wc = gdk_pixmap_draw_text_wc;
drawable_class->draw_drawable = gdk_pixmap_draw_drawable;
drawable_class->draw_drawable_with_src = gdk_pixmap_draw_drawable;
drawable_class->draw_points = gdk_pixmap_draw_points;
drawable_class->draw_segments = gdk_pixmap_draw_segments;
drawable_class->draw_lines = gdk_pixmap_draw_lines;
@@ -216,6 +220,7 @@ gdk_pixmap_class_init (GdkPixmapObjectClass *klass)
drawable_class->get_visual = gdk_pixmap_real_get_visual;
drawable_class->_copy_to_image = gdk_pixmap_copy_to_image;
drawable_class->ref_cairo_surface = gdk_pixmap_ref_cairo_surface;
drawable_class->create_cairo_surface = gdk_pixmap_create_cairo_surface;
}
static void
@@ -229,6 +234,54 @@ gdk_pixmap_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
GdkPixmap *
gdk_pixmap_new (GdkDrawable *drawable,
gint width,
gint height,
gint depth)
{
GdkDrawable *source_drawable;
if (drawable)
source_drawable = _gdk_drawable_get_source_drawable (drawable);
else
source_drawable = NULL;
return _gdk_pixmap_new (source_drawable, width, height, depth);
}
GdkPixmap *
gdk_bitmap_create_from_data (GdkDrawable *drawable,
const gchar *data,
gint width,
gint height)
{
GdkDrawable *source_drawable;
if (drawable)
source_drawable = _gdk_drawable_get_source_drawable (drawable);
else
source_drawable = NULL;
return _gdk_bitmap_create_from_data (source_drawable, data, width, height);
}
GdkPixmap*
gdk_pixmap_create_from_data (GdkDrawable *drawable,
const gchar *data,
gint width,
gint height,
gint depth,
const GdkColor *fg,
const GdkColor *bg)
{
GdkDrawable *source_drawable;
source_drawable = _gdk_drawable_get_source_drawable (drawable);
return _gdk_pixmap_create_from_data (source_drawable,
data, width, height,
depth, fg,bg);
}
static GdkGC *
gdk_pixmap_create_gc (GdkDrawable *drawable,
GdkGCValues *values,
@@ -249,6 +302,7 @@ gdk_pixmap_draw_rectangle (GdkDrawable *drawable,
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
_gdk_gc_remove_drawable_clip (gc);
gdk_draw_rectangle (private->impl, gc, filled,
x, y, width, height);
}
@@ -266,6 +320,7 @@ gdk_pixmap_draw_arc (GdkDrawable *drawable,
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
_gdk_gc_remove_drawable_clip (gc);
gdk_draw_arc (private->impl, gc, filled,
x, y,
width, height, angle1, angle2);
@@ -280,6 +335,7 @@ gdk_pixmap_draw_polygon (GdkDrawable *drawable,
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
_gdk_gc_remove_drawable_clip (gc);
gdk_draw_polygon (private->impl, gc, filled, points, npoints);
}
@@ -294,6 +350,7 @@ gdk_pixmap_draw_text (GdkDrawable *drawable,
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
_gdk_gc_remove_drawable_clip (gc);
gdk_draw_text (private->impl, font, gc,
x, y, text, text_length);
}
@@ -309,6 +366,7 @@ gdk_pixmap_draw_text_wc (GdkDrawable *drawable,
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
_gdk_gc_remove_drawable_clip (gc);
gdk_draw_text_wc (private->impl, font, gc,
x, y, text, text_length);
}
@@ -322,13 +380,19 @@ gdk_pixmap_draw_drawable (GdkDrawable *drawable,
gint xdest,
gint ydest,
gint width,
gint height)
gint height,
GdkPixmap *original_src)
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
gdk_draw_drawable (private->impl, gc, src, xsrc, ysrc,
xdest, ydest,
width, height);
_gdk_gc_remove_drawable_clip (gc);
/* Call the method directly to avoid getting the composite drawable again */
GDK_DRAWABLE_GET_CLASS (private->impl)->draw_drawable_with_src (private->impl, gc,
src,
xsrc, ysrc,
xdest, ydest,
width, height,
original_src);
}
static void
@@ -339,6 +403,7 @@ gdk_pixmap_draw_points (GdkDrawable *drawable,
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
_gdk_gc_remove_drawable_clip (gc);
gdk_draw_points (private->impl, gc, points, npoints);
}
@@ -350,6 +415,7 @@ gdk_pixmap_draw_segments (GdkDrawable *drawable,
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
_gdk_gc_remove_drawable_clip (gc);
gdk_draw_segments (private->impl, gc, segs, nsegs);
}
@@ -361,6 +427,7 @@ gdk_pixmap_draw_lines (GdkDrawable *drawable,
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
_gdk_gc_remove_drawable_clip (gc);
gdk_draw_lines (private->impl, gc, points, npoints);
}
@@ -374,6 +441,7 @@ gdk_pixmap_draw_glyphs (GdkDrawable *drawable,
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
_gdk_gc_remove_drawable_clip (gc);
gdk_draw_glyphs (private->impl, gc, font, x, y, glyphs);
}
@@ -388,6 +456,7 @@ gdk_pixmap_draw_glyphs_transformed (GdkDrawable *drawable,
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
_gdk_gc_remove_drawable_clip (gc);
gdk_draw_glyphs_transformed (private->impl, gc, matrix, font, x, y, glyphs);
}
@@ -404,6 +473,7 @@ gdk_pixmap_draw_image (GdkDrawable *drawable,
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
_gdk_gc_remove_drawable_clip (gc);
gdk_draw_image (private->impl, gc, image, xsrc, ysrc, xdest, ydest,
width, height);
}
@@ -424,6 +494,8 @@ gdk_pixmap_draw_pixbuf (GdkDrawable *drawable,
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
if (gc)
_gdk_gc_remove_drawable_clip (gc);
gdk_draw_pixbuf (private->impl, gc, pixbuf,
src_x, src_y, dest_x, dest_y, width, height,
dither, x_dither, y_dither);
@@ -437,6 +509,7 @@ gdk_pixmap_draw_trapezoids (GdkDrawable *drawable,
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
_gdk_gc_remove_drawable_clip (gc);
gdk_draw_trapezoids (private->impl, gc, trapezoids, n_trapezoids);
}
@@ -515,6 +588,17 @@ gdk_pixmap_ref_cairo_surface (GdkDrawable *drawable)
return _gdk_drawable_ref_cairo_surface (((GdkPixmapObject*)drawable)->impl);
}
static cairo_surface_t *
gdk_pixmap_create_cairo_surface (GdkDrawable *drawable,
int width,
int height)
{
return _gdk_windowing_create_cairo_surface (GDK_PIXMAP_OBJECT(drawable)->impl,
width, height);
}
static GdkBitmap *
make_solid_mask (GdkScreen *screen, gint width, gint height)
{

View File

@@ -34,8 +34,10 @@ G_BEGIN_DECLS
#define GDK_PARENT_RELATIVE_BG ((GdkPixmap *)1L)
#define GDK_NO_BG ((GdkPixmap *)2L)
#define GDK_WINDOW_TYPE(d) (((GdkWindowObject*)(GDK_WINDOW (d)))->window_type)
#define GDK_WINDOW_DESTROYED(d) (((GdkWindowObject*)(GDK_WINDOW (d)))->destroyed)
#ifndef GDK_COMPILATION
#define GDK_WINDOW_TYPE(d) (gdk_window_get_window_type (GDK_WINDOW (d)))
#define GDK_WINDOW_DESTROYED(d) (gdk_window_is_destroyed (GDK_WINDOW (d)))
#endif
void gdk_window_destroy_notify (GdkWindow *window);

View File

@@ -79,7 +79,7 @@ gdk_rectangle_intersect (const GdkRectangle *src1,
GdkRectangle *dest)
{
gint dest_x, dest_y;
gint dest_w, dest_h;
gint dest_x2, dest_y2;
gint return_val;
g_return_val_if_fail (src1 != NULL, FALSE);
@@ -89,17 +89,17 @@ gdk_rectangle_intersect (const GdkRectangle *src1,
dest_x = MAX (src1->x, src2->x);
dest_y = MAX (src1->y, src2->y);
dest_w = MIN (src1->x + src1->width, src2->x + src2->width) - dest_x;
dest_h = MIN (src1->y + src1->height, src2->y + src2->height) - dest_y;
dest_x2 = MIN (src1->x + src1->width, src2->x + src2->width);
dest_y2 = MIN (src1->y + src1->height, src2->y + src2->height);
if (dest_w > 0 && dest_h > 0)
if (dest_x2 > dest_x && dest_y2 > dest_y)
{
if (dest)
{
dest->x = dest_x;
dest->y = dest_y;
dest->width = dest_w;
dest->height = dest_h;
dest->width = dest_x2 - dest_x;
dest->height = dest_y2 - dest_y;
}
return_val = TRUE;
}

View File

@@ -96,6 +96,7 @@ static void miRegionOp (GdkRegion *newReg,
overlapFunc overlapFn,
nonOverlapFunc nonOverlap1Fn,
nonOverlapFunc nonOverlap2Fn);
static void miSetExtents (GdkRegion *pReg);
/**
* gdk_region_new:
@@ -122,6 +123,31 @@ gdk_region_new (void)
return temp;
}
GdkRegion *
_gdk_region_new_from_yxbanded_rects (GdkRectangle *rects,
int num_rects)
{
GdkRegion *temp;
int i;
temp = g_slice_new (GdkRegion);
temp->rects = g_new (GdkRegionBox, num_rects);
temp->size = num_rects;
temp->numRects = num_rects;
for (i = 0; i < num_rects; i++)
{
temp->rects[i].x1 = rects[i].x;
temp->rects[i].y1 = rects[i].y;
temp->rects[i].x2 = rects[i].x + rects[i].width;
temp->rects[i].y2 = rects[i].y + rects[i].height;
}
miSetExtents (temp);
return temp;
}
/**
* gdk_region_rectangle:
* @rectangle: a #GdkRectangle
@@ -1555,6 +1581,32 @@ gdk_region_equal (const GdkRegion *region1,
return TRUE;
}
/**
* gdk_region_rect_equal:
* @region: a #GdkRegion
* @rectangle: a #GdkRectangle
*
* Finds out if a regions is the same as a rectangle.
*
* Returns: %TRUE if @region and @rectangle are equal.
*
* Since: 2.18
*/
gboolean
gdk_region_rect_equal (const GdkRegion *region,
const GdkRectangle *rectangle)
{
g_return_val_if_fail (region != NULL, FALSE);
g_return_val_if_fail (rectangle != NULL, FALSE);
if (region->numRects != 1) return FALSE;
else if (region->extents.x1 != rectangle->x) return FALSE;
else if (region->extents.y1 != rectangle->y) return FALSE;
else if (region->extents.x2 != rectangle->x + rectangle->width) return FALSE;
else if (region->extents.y2 != rectangle->y + rectangle->height) return FALSE;
return TRUE;
}
/**
* gdk_region_point_in:
* @region: a #GdkRegion

View File

@@ -77,6 +77,8 @@ void gdk_region_get_rectangles (const GdkRegion *region,
gboolean gdk_region_empty (const GdkRegion *region);
gboolean gdk_region_equal (const GdkRegion *region1,
const GdkRegion *region2);
gboolean gdk_region_rect_equal (const GdkRegion *region,
const GdkRectangle *rectangle);
gboolean gdk_region_point_in (const GdkRegion *region,
int x,
int y);

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