Compare commits

...

489 Commits

Author SHA1 Message Date
Federico Mena Quintero 586ac41c68 Get master's fixes for the file chooser 2009-10-01 15:59:06 -05: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
Federico Mena Quintero 988e4f1134 Fix thinkos in which fields get used
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-30 18:49:33 -05:00
Federico Mena Quintero f03c304a25 Oops, it's gsize, not GSize
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-30 18:39:33 -05:00
Federico Mena Quintero 87bb81887a Fix a g_strdup_printf()
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-30 17:55:12 -05: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
Federico Mena Quintero 5a80b1fb2d Put the list of column types in a macro
Every call to _gtk_file_system_model_new*() gets the same list of column types,
so we now keep the list in a macro instead of having duplicated copies all around.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-11 14:28:36 -05:00
Federico Mena Quintero f38a3c0d74 Clarify the arguments of g_file_query_info_async()
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-11 14:20:19 -05:00
Federico Mena Quintero 1a8c032dde Make copy_attribute() a function instead of a macro
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-11 13:32:08 -05:00
Federico Mena Quintero c6cb5eebdc Don't leak a treepath if the treeview is not populated yet
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-11 13:25:29 -05:00
Federico Mena Quintero b2cc6279b2 Factor out function to set a fixed size for the icon cell renderers
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-11 13:14:49 -05:00
Federico Mena Quintero 525bd57c67 Comment that the column order needs to be kept in sync across two functions
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-11 13:08:11 -05:00
Federico Mena Quintero e462f7957d Fix typo in a comment
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-11 13:03:34 -05:00
Federico Mena Quintero b525a47ad0 Make get_selected_file() return a ref'ed file
The old semantics was to return a GFile* owned by the file system model; the new
semantics is to hand out new references whenever possible.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-11 12:44:46 -05: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
Federico Mena Quintero ff2660ed80 In set_filter(), handle the case where the new filter is the same as the old filter
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-10 17:22:16 -05:00
Federico Mena Quintero 2216cbd9a3 s/get_is_visible/iter_is_visible for clarity
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-10 16:33:37 -05:00
Federico Mena Quintero 25509380c4 Remove obsolete comment
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-10 15:36:15 -05:00
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
Federico Mena Quintero fdafb0ec30 Make the code match the docs in _gtk_file_system_model_clear_cache()
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-04 13:53:46 -05:00
Federico Mena Quintero 49268a750f Free some missing fields in ::finalize()
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-04 13:42:46 -05:00
Federico Mena Quintero 616ad664f4 Clarify variable names in gtk_file_system_model_sort()
To comply with the i -> indexes; r -> rows convention.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-04 13:06:54 -05:00
Federico Mena Quintero eb70ceb551 Nothing to do for ref/unref_node
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-04 12:49:53 -05:00
Federico Mena Quintero 64319ec227 Clarify a couple of spots with comments
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-04 12:32:10 -05:00
Federico Mena Quintero f9939a13f8 Clarify array indexes vs. row numbers
There was some confusion between "index" as used for the model->files[] array,
and node->index as used for our 1-based row numbers.  Now we use "index" only
for indices in the model->files[] array, and node->row for row numbers.  Functions
and variables are renamed to clarify whether they refer to indexes or rows.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-04 12:01:16 -05: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
Federico Mena Quintero 8e3cea214e Big comment on how GtkFileSystemModel works
Let's have some documentation on the idea behind this beast...

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-03 18:34:17 -05:00
Federico Mena Quintero ba79bbcc65 Remove obsolete code to use a cached mime-type
The non-standard "filechooser::mime-type" was a remnant of the recent-files code using
a hand-built GFileInfo; now we just query the file info ourselves.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-03 12:09:09 -05: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
Federico Mena Quintero c79c73161c Fix thinko in node_should_be_visible()
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-02 18:26:00 -05:00
Federico Mena Quintero 66d7626930 Factory out functions to emit row_inserted, row_changed, row_deleted
This is to avoid temporary variables for the path/iter and to avoid duplicated code.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-02 17:10:46 -05: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
Federico Mena Quintero 79101f3588 When updating a file, handle the case where the old file info is the same as the new one
This prevents us from inadvertently losing the last ref to the info.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-02 15:23:21 -05:00
Federico Mena Quintero ec4ce57e87 When removing a file, also remove it from the file_lookup hash table
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-02 15:21:45 -05:00
Federico Mena Quintero c68c0e5a1c Comment on how the file_lookup hash table gets rebuilt on demand
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-02 14:51:02 -05:00
Federico Mena Quintero 8a013f6c3e Clarify the arguments to g_file_query_info_async()
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-02 13:58:47 -05:00
Federico Mena Quintero 299a997aea Show an error dialog when we can't read the folder's contents
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-09-02 13:43:03 -05: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
Federico Mena Quintero 2c9989c5d1 Clarify the code flow in gtk_file_system_model_got_files()
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-08-31 16:13:05 -05:00
Federico Mena Quintero 28ae6fd0be Remove the dir_thaw_source while disposing the model
Otherwise that timeout may trigger after the model has died.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-08-31 15:53:45 -05:00
Federico Mena Quintero 85346c0d99 Make _gtk_file_system_model_remove_file() static
It was only used internally by the model.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-08-31 15:11:44 -05:00
Federico Mena Quintero 3fc06dd8bb Make _gtk_file_system_model_add_file() static
It was only used internally by the model, anyway.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-08-31 15:08:43 -05: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
Federico Mena Quintero 1e865a99c1 Clarify the comments that some fields in GtkFileSystemModel can be NULL
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-08-26 19:27:40 -05:00
Federico Mena Quintero 8792f8092e Clarify the arguments to g_file_monitor_directory()
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-08-26 19:25:18 -05:00
Federico Mena Quintero 3352e4b955 Clarify an argument to g_file_enumerate_children_async()
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-08-26 19:14:07 -05:00
Federico Mena Quintero e5f16d59fc Fix and tighten an assertion
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-08-26 19:10:51 -05:00
Federico Mena Quintero 627ce4c77d Complete the documentation string for _gtk_file_system_model_new()
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-08-26 19:10:26 -05:00
Federico Mena Quintero 7d9460fc57 Start with a file array with a resonable preallocated size
g_array_new() doesn't reserve any size by default, so during the initial population
of the file array, we'll do more reallocs than strictly needed.  We'll start with
a reasonable preallocated size, in this case the number of files which we can
get in a single chunk out of GIO.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-08-26 18:52:24 -05:00
Federico Mena Quintero 7eedd893f0 Compute the node size only once to avoid the scary macro
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-08-26 18:42:49 -05:00
Federico Mena Quintero cae66dbe90 g_error() as soon as we catch an invalid column type
There's no point in running a GtkFileSystemModel with invalid column types.
This way we can also avoid clearing the memory of the column_types array.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-08-26 18:38:03 -05: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
Benjamin Otte 99ae34dbb4 Make number of validated rows depend on time, not on number of rows
Previously, do_validate_rows() validated 300 rows per iteration. While
this is usually not problematic, 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-10 10:51:39 +02:00
Benjamin Otte 6bd907a60a Improve show_and_select_files() function
The previous function enumerated the whole directory and used a lot of
outdated API to decide how to show files.
The new code queries the filesystem model to decide about this.
The now unused old functions were removed.
2009-07-01 10:33:10 +02:00
Benjamin Otte bfe2935455 Remove unused error argument from show_and_select_files() 2009-07-01 10:28:20 +02:00
Benjamin Otte 5f16b8c044 Enable the size column in recent files/search
Previously information about file sizes was not available for search
results and recent files, so the column was always hidden. As this
information is now available, we can stop the special handling and use
the same setting as in browse mode.
2009-07-01 10:24:41 +02:00
Benjamin Otte 34c0a31975 Use the faster accessor function in the sort functions
Use the faster _gtk_file_system_model_get_value() function instead of
gtk_tree_model_get() inside the sort functions. This gives a significant
speed-up when sorting large lists.
In a test case with 40.000 files, the sorting time went from ~5 seconds
to less than 0.5 seconds for my test case. There is 2 significant
problems with gtk_tree_model_get() that cause this:
1) The value is copied, which takes quite a bit of time for strings.
   ~25% of excessive time or ~1 second in my test
2) The tree model functions need to lookup the interface vfunc. And
   gtk_tree_model_get() doesn't do that only once, but multiple times
   (verifying column id, getting the actual value, ...)
   ~75% of excessive time or ~3 seconds in my test
2009-07-01 10:21:03 +02:00
Benjamin Otte fdeaab7124 Convert recent files to a GtkFileSystemModel
This does to the recent files what the last commit did to the search. It
uses a GtkFileSystemModel and its API niceties to show the recent files.
2009-07-01 10:15:14 +02:00
Benjamin Otte 0703eeab08 Convert search to use a GtkFileSystemModel
Replace the list model code with the file system model and use all the
file system model API niceties we get from that.
Also adds the function _gtk_file_system_model_add_and_query_file() which
g_file_query_info()'s the file before adding it, so it gets added with
the right information.
2009-07-01 10:11:00 +02:00
Benjamin Otte f73596a9b2 Don't count the "enter directory name" line as a selected file 2009-07-01 09:54:27 +02:00
Benjamin Otte 0b6393d572 Add a constructor to filesystem model that does not monitor a directory
This is in preparation for switching search and recent models to use
GtkFileSystemModel
2009-07-01 09:54:22 +02:00
Benjamin Otte 6e715f77ef Make the filesystem model filter API use a GtkFileFilter
This gets rid of the vfunc API and does exactly what the file chooser
wants.
2009-07-01 09:54:15 +02:00
Benjamin Otte 08f5202516 Only query the absolutely necessary attributes
Since the time taken by g_file_enumerate_children() depends a lot on the
attributes that are queried, we query the minimum attributes that need
to be queired to display the file chooser.

In particular, the attributes for loading the icon are ignored, as icons
are loaded on demand (see previous commit).
2009-07-01 09:54:05 +02:00
Benjamin Otte 04b7b41b75 Load icons on-demand
Because loading icons takes a noticable performance, this code loads the
pixbuf on demand and only loads icons for rows that are visible. There
is a few caveats to this:
- The pixbuf cell renderer must report the proer size even if the icon
  is not yet loaded. This is achieved by setting a fixed size.
- On theme changes the cahced pixbufs and the cell renderer must be
  updated to conform to the new theme.
2009-07-01 09:53:58 +02:00
Benjamin Otte e6dcb53237 Use the GtkTreeSortable of the filesystem model
Previously, there was a GtkTreeSortModel wrapped around the filesystem
model to make it sortable. As the new implementation implements the
GtkTreeSortable interface, we can use this instead.
2009-07-01 09:53:47 +02:00
Benjamin Otte 0725e54524 Clean up code to use the model directly
A lot of code special cases accesses to the tree view for the different
browse modes, which was previously necessary, because the models were
different. Now that they are identical in the first columns, there is no
such need anymore, and the functions don't need to be special cased.
2009-07-01 09:51:34 +02:00
Benjamin Otte 6c20020be6 Replace the cell data computations
Previously custom functions were used to compute the data passed to the
cell renderers. Now that all this data is saved by the tree models with
compatible nodes, the usual default attribute-to-column mapping can be
used.
With this, caching of the values can happen in the tree model, which
avoids costly lookups of icons or computation of strings. Last but not
least it avoids spurious bugs that could happen when strings changed
without anyone noticing, like the mtime when a new day begins.
2009-07-01 09:51:21 +02:00
Benjamin Otte 56f5382343 Consolidate tree models for different browse modes
All tree models in browse mode now share the first 10 column types
containing all the necessary information to display the model on screen.
Therefor it is now easy to just operate on the tree model associated
with the file tree view and in most cases it isn't necessary anymore to
special case the browse modes.
2009-07-01 09:50:44 +02:00
Benjamin Otte 585772c32e Simplify gtk_file_chooser_default_unselect_file() 2009-07-01 09:49:37 +02:00
Benjamin Otte 05c629ffe9 Creating the model no longer fails
So remove the code that checked for failure, as it's not needed anymore.
2009-07-01 09:48:32 +02:00
Benjamin Otte 69ff1d8a93 Implement new GtkFileSystemModel
The new model is mostly API-compatible with the old model (minimal
changes were required), but is a lot faster and has a lot of very
desirable features.
- the model does no longer support a tree, just a list of files in a
  given directory
- the storage has been moved to a GArray as opposed to a tree
- no more dependency on GtkFileSystem
- columns are managed by the creator of the model, so any number of
  nodes can be added as needed. This also makes the API more similar
  to GtkListStore.
- Values are filled on demand using a function given when creating the
  model.
- The function can decide to let the model cache returned values or
  decide to be called again the next time the value is queried.
- implements GtkTreeSortable
- _gtk_file_system_model_get_value() was added to significantly speed
  up value access, which is necessary when sorting large models.
2009-07-01 09:47:45 +02:00
Benjamin Otte 27ab4f7937 move GtkFileSystemModel private stuff out of the private header 2009-06-30 14:55:27 +02:00
Benjamin Otte 278d1063c7 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-06-30 13:31:54 +02:00
376 changed files with 63613 additions and 60652 deletions
+270
View File
@@ -1,3 +1,273 @@
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
==============================================
+12
View File
@@ -37,6 +37,18 @@ Release notes for 2.18
* 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
======================
+184 -117
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>
+14 -3
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
+47 -30
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], [7])
m4_define([gtk_interface_age], [0])
m4_define([gtk_minor_version], [18])
m4_define([gtk_micro_version], [2])
m4_define([gtk_interface_age], [2])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
m4_define([gtk_version],
@@ -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
@@ -302,6 +307,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
@@ -1836,10 +1842,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`
@@ -1859,26 +1874,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+
@@ -1889,19 +1902,23 @@ 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 $GDK_DEP_CFLAGS"
+2
View File
@@ -28,6 +28,8 @@ demos = \
links.c \
list_store.c \
menus.c \
offscreen_window.c \
offscreen_window2.c \
panes.c \
pickers.c \
pixbufs.c \
+4
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);
+4 -4
View File
@@ -43,10 +43,11 @@ activate_link (GtkWidget *label,
return FALSE;
}
static GtkWidget *window = NULL;
GtkWidget *
do_links (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
GtkWidget *label;
if (!window)
@@ -54,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"
+16 -19
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);
+579
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;
}
+500
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;
}
+5
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,7 @@ 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
@@ -669,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
@@ -720,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
@@ -911,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>
@@ -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:
+5
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().
+76 -9
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>
@@ -237,7 +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. Since 2.18
@GDK_WINDOW_OFFSCREEN: offscreen window (see <xref linkend="OFFSCREEN-WINDOWS"/>). Since 2.18
<!-- ##### ENUM GdkWindowClass ##### -->
<para>
@@ -535,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>
@@ -723,6 +763,14 @@ Deprecated equivalent of g_object_unref()
@dy:
<!-- ##### FUNCTION gdk_window_flush ##### -->
<para>
</para>
@window:
<!-- ##### FUNCTION gdk_window_ensure_native ##### -->
<para>
@@ -811,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>
@@ -1247,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()
+2
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 \
+1
View File
@@ -435,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>
+37
View File
@@ -3074,6 +3074,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
@@ -5032,6 +5034,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
@@ -5137,6 +5147,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
@@ -5566,6 +5579,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
@@ -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>
+10
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>
-8
View File
@@ -3885,14 +3885,6 @@ fundamental type.
@group_cycling:
@Returns:
<!-- ##### FUNCTION gtk_widget_get_allocation ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### FUNCTION gtk_widget_get_usize ##### -->
<para>
@@ -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:
@@ -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:
+1 -1
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 ##### -->
@@ -288,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
+18
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:
+207
View File
@@ -2641,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>
+2 -1
View File
@@ -277,6 +277,7 @@ 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. */
@@ -290,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);
}
+3 -2
View File
@@ -353,7 +353,6 @@ gdip_buffer_to_bitmap (const gchar *buffer, size_t size, GError **error)
if (!hg)
return NULL;
IStream_SetSize (stream, *(ULARGE_INTEGER *)&size64);
hr = CreateStreamOnHGlobal (hg, FALSE, (LPSTREAM *)&stream);
if (!SUCCEEDED (hr)) {
@@ -361,7 +360,9 @@ 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)
+1 -1
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
+1 -2
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)) {
@@ -1190,11 +1189,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);
+1 -1
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;
+9 -6
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);
}
+2
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);
+228
View File
@@ -351,6 +351,213 @@ _gdk_windowing_window_init (void)
}
GdkWindow *
gdk_directfb_window_new (GdkWindow *parent,
GdkWindowAttr *attributes,
gint attributes_mask,
DFBWindowCapabilities window_caps,
DFBWindowOptions window_options,
DFBSurfaceCapabilities surface_caps)
{
GdkWindow *window;
GdkWindowObject *private;
GdkWindowObject *parent_private;
GdkWindowImplDirectFB *impl;
GdkWindowImplDirectFB *parent_impl;
GdkVisual *visual;
DFBWindowDescription desc;
gint x, y;
g_return_val_if_fail (attributes != NULL, NULL);
D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", __FUNCTION__, parent );
if (!parent || attributes->window_type != GDK_WINDOW_CHILD)
parent = _gdk_parent_root;
window = g_object_new (GDK_TYPE_WINDOW, NULL);
private = GDK_WINDOW_OBJECT (window);
private->impl = g_object_new (_gdk_window_impl_get_type (), NULL);
parent_private = GDK_WINDOW_OBJECT (parent);
parent_impl = GDK_WINDOW_IMPL_DIRECTFB (parent_private->impl);
private->parent = parent_private;
x = (attributes_mask & GDK_WA_X) ? attributes->x : 0;
y = (attributes_mask & GDK_WA_Y) ? attributes->y : 0;
gdk_window_set_events (window, attributes->event_mask | GDK_STRUCTURE_MASK);
impl = GDK_WINDOW_IMPL_DIRECTFB (private->impl);
impl->drawable.wrapper = GDK_DRAWABLE (window);
impl->gdkWindow = window;
private->x = x;
private->y = y;
_gdk_directfb_calc_abs (window);
impl->drawable.width = MAX (1, attributes->width);
impl->drawable.height = MAX (1, attributes->height);
private->window_type = attributes->window_type;
desc.flags = 0;
if (attributes_mask & GDK_WA_VISUAL)
visual = attributes->visual;
else
visual = gdk_drawable_get_visual (parent);
switch (attributes->wclass)
{
case GDK_INPUT_OUTPUT:
private->input_only = FALSE;
desc.flags |= DWDESC_PIXELFORMAT;
desc.pixelformat = ((GdkVisualDirectFB *) visual)->format;
if (DFB_PIXELFORMAT_HAS_ALPHA (desc.pixelformat))
{
desc.flags |= DWDESC_CAPS;
desc.caps = DWCAPS_ALPHACHANNEL;
}
break;
case GDK_INPUT_ONLY:
private->input_only = TRUE;
desc.flags |= DWDESC_CAPS;
desc.caps = DWCAPS_INPUTONLY;
break;
default:
g_warning ("gdk_window_new: unsupported window class\n");
_gdk_window_destroy (window, FALSE);
return NULL;
}
switch (private->window_type)
{
case GDK_WINDOW_TOPLEVEL:
case GDK_WINDOW_DIALOG:
case GDK_WINDOW_TEMP:
desc.flags |= ( DWDESC_WIDTH | DWDESC_HEIGHT |
DWDESC_POSX | DWDESC_POSY );
desc.posx = x;
desc.posy = y;
desc.width = impl->drawable.width;
desc.height = impl->drawable.height;
#if 0
if (window_caps)
{
if (! (desc.flags & DWDESC_CAPS))
{
desc.flags |= DWDESC_CAPS;
desc.caps = DWCAPS_NONE;
}
desc.caps |= window_caps;
}
if (surface_caps)
{
desc.flags |= DWDESC_SURFACE_CAPS;
desc.surface_caps = surface_caps;
}
#endif
if (!create_directfb_window (impl, &desc, window_options))
{
g_assert(0);
_gdk_window_destroy (window, FALSE);
return NULL;
}
if (desc.caps != DWCAPS_INPUTONLY)
{
impl->window->SetOpacity(impl->window, 0x00 );
}
break;
case GDK_WINDOW_CHILD:
impl->window=NULL;
if (!private->input_only && parent_impl->drawable.surface)
{
DFBRectangle rect =
{ x, y, impl->drawable.width, impl->drawable.height };
parent_impl->drawable.surface->GetSubSurface (parent_impl->drawable.surface,
&rect,
&impl->drawable.surface);
}
break;
default:
g_warning ("gdk_window_new: unsupported window type: %d",
private->window_type);
_gdk_window_destroy (window, FALSE);
return NULL;
}
if (impl->drawable.surface)
{
GdkColormap *colormap;
impl->drawable.surface->GetPixelFormat (impl->drawable.surface,
&impl->drawable.format);
private->depth = DFB_BITS_PER_PIXEL(impl->drawable.format);
if ((attributes_mask & GDK_WA_COLORMAP) && attributes->colormap)
{
colormap = attributes->colormap;
}
else
{
if (gdk_visual_get_system () == visual)
colormap = gdk_colormap_get_system ();
else
colormap =gdk_drawable_get_colormap (parent);
}
gdk_drawable_set_colormap (GDK_DRAWABLE (window), colormap);
}
else
{
impl->drawable.format = ((GdkVisualDirectFB *)visual)->format;
private->depth = visual->depth;
}
gdk_window_set_cursor (window, ((attributes_mask & GDK_WA_CURSOR) ?
(attributes->cursor) : NULL));
if (parent_private)
parent_private->children = g_list_prepend (parent_private->children,
window);
/* we hold a reference count on ourselves */
g_object_ref (window);
if (impl->window)
{
impl->window->GetID (impl->window, &impl->dfb_id);
gdk_directfb_window_id_table_insert (impl->dfb_id, window);
gdk_directfb_event_windows_add (window);
}
if (attributes_mask & GDK_WA_TYPE_HINT)
gdk_window_set_type_hint (window, attributes->type_hint);
return window;
}
void
_gdk_window_impl_new (GdkWindow *window,
GdkWindow *real_parent,
@@ -1892,6 +2099,26 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display,
if (win_y)
*win_y = wy;
if (get_toplevel)
{
GdkWindowObject *w = (GdkWindowObject *)retval;
/* Requested toplevel, find it. */
/* TODO: This can be implemented more efficient by never
recursing into children in the first place */
if (w)
{
/* Convert to toplevel */
while (w->parent != NULL &&
w->parent->window_type != GDK_WINDOW_ROOT)
{
*win_x += w->x;
*win_y += w->y;
w = w->parent;
}
retval = (GdkWindow *)w;
}
}
return retval;
}
@@ -1957,6 +2184,7 @@ gdk_directfb_window_input_shape_combine_region (GdkWindow *window,
static void
gdk_directfb_window_queue_translation (GdkWindow *window,
GdkGC *gc,
GdkRegion *region,
gint dx,
gint dy)
+8
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
+8
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
@@ -299,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
@@ -650,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
@@ -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
@@ -1216,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__)
+28
View File
@@ -59,6 +59,34 @@ gdk_cairo_create (GdkDrawable *drawable)
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
+2
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);
+14 -30
View File
@@ -510,7 +510,7 @@ gdk_display_real_get_window_at_pointer (GdkDisplay *display,
GdkWindow *window;
gint x, y;
window = _gdk_windowing_window_at_pointer (display, &x, &y, NULL);
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 */
@@ -836,6 +836,10 @@ synthesize_crossing_events (GdkDisplay *display,
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);
@@ -909,34 +913,20 @@ get_current_toplevel (GdkDisplay *display,
GdkModifierType *state_out)
{
GdkWindow *pointer_window;
GdkWindowObject *w;
int x, y;
GdkModifierType state;
pointer_window = _gdk_windowing_window_at_pointer (display, &x, &y, &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;
w = (GdkWindowObject *)pointer_window;
if (w)
{
/* Convert to toplevel */
while (w->parent != NULL &&
w->parent->window_type != GDK_WINDOW_ROOT)
{
x += w->x;
y += w->y;
w = w->parent;
}
}
*x_out = x;
*y_out = y;
*state_out = state;
return (GdkWindow *)w;
return pointer_window;
}
static void
@@ -1033,11 +1023,6 @@ switch_to_pointer_grab (GdkDisplay *display,
/* We're now ungrabbed, update the window_under_pointer */
_gdk_display_set_window_under_pointer (display, pointer_window);
if (last_grab->implicit_ungrab)
generate_grab_broken_event (last_grab->window,
FALSE, TRUE,
NULL);
}
}
@@ -1061,9 +1046,7 @@ _gdk_display_pointer_grab_update (GdkDisplay *display,
if (current_grab->serial_start > current_serial)
return; /* Hasn't started yet */
if (current_grab->serial_end > current_serial ||
(current_grab->serial_end == current_serial &&
current_grab->grab_one_pointer_release_event))
if (current_grab->serial_end > current_serial)
{
/* This one hasn't ended yet.
its the currently active one or scheduled to be active */
@@ -1085,13 +1068,12 @@ _gdk_display_pointer_grab_update (GdkDisplay *display,
next_grab = NULL; /* Actually its not yet active */
}
if (next_grab == NULL ||
current_grab->window != next_grab->window)
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,
@@ -1138,7 +1120,9 @@ _gdk_display_has_pointer_grab (GdkDisplay *display,
return NULL;
}
/* Returns true if last grab was ended */
/* 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,
@@ -1156,7 +1140,7 @@ _gdk_display_end_pointer_grab (GdkDisplay *display,
grab = l->data;
if (grab &&
(if_child == NULL ||
_gdk_window_event_parent_of (grab->window, if_child)))
_gdk_window_event_parent_of (if_child, grab->window)))
{
grab->serial_end = serial;
grab->implicit_ungrab = implicit;
+8 -17
View File
@@ -634,7 +634,7 @@ gdk_draw_drawable (GdkDrawable *drawable,
gint width,
gint height)
{
GdkDrawable *composite, *composite_impl;
GdkDrawable *composite;
gint composite_x_offset = 0;
gint composite_y_offset = 0;
@@ -663,24 +663,13 @@ gdk_draw_drawable (GdkDrawable *drawable,
&composite_x_offset,
&composite_y_offset);
/* The draw_drawable call below is will recurse into gdk_draw_drawable again,
* specifying the right impl for the destination. This means the composite
* we got here will be fed to get_composite_drawable again, which is a problem
* for window as that causes double the composite offset. Avoid this by passing
* in the impl directly.
*/
if (GDK_IS_WINDOW (composite))
composite_impl = GDK_WINDOW_OBJECT (src)->impl;
else
composite_impl = composite;
/* 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_impl,
composite,
xsrc - composite_x_offset,
ysrc - composite_y_offset,
xdest, ydest,
@@ -688,7 +677,7 @@ gdk_draw_drawable (GdkDrawable *drawable,
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_impl,
composite,
xsrc - composite_x_offset,
ysrc - composite_y_offset,
xdest, ydest,
@@ -1638,12 +1627,14 @@ gdk_drawable_real_draw_pixbuf (GdkDrawable *drawable,
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. */
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 = drawable;
real_drawable = GDK_PIXMAP_OBJECT (drawable)->impl;
if (pixbuf->has_alpha)
{
GdkVisual *visual = gdk_drawable_get_visual (drawable);
+2
View File
@@ -519,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);
+24 -7
View File
@@ -648,7 +648,7 @@ _gdk_gc_add_drawable_clip (GdkGC *gc,
GdkColor black = {0, 0, 0, 0};
GdkRectangle r;
GdkOverlapType overlap;
gdk_drawable_get_size (priv->clip_mask, &w, &h);
r.x = 0;
@@ -659,7 +659,7 @@ _gdk_gc_add_drawable_clip (GdkGC *gc,
/* 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)
{
@@ -683,11 +683,19 @@ _gdk_gc_add_drawable_clip (GdkGC *gc,
}
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);
gdk_region_destroy (empty);
}
else
{
/* Completely inside region, don't set unnecessary clip */
gdk_region_destroy (region);
return;
}
}
else
@@ -696,7 +704,7 @@ _gdk_gc_add_drawable_clip (GdkGC *gc,
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);
}
@@ -718,6 +726,12 @@ _gdk_gc_remove_drawable_clip (GdkGC *gc)
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
{
@@ -1382,6 +1396,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;
@@ -1472,6 +1488,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);
@@ -1487,9 +1507,6 @@ _gdk_gc_update_context (GdkGC *gc,
cairo_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);
}
+1
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;
+9 -3
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
@@ -184,7 +185,6 @@ typedef struct
gboolean activated;
gboolean implicit_ungrab;
gboolean grab_one_pointer_release_event;
} GdkPointerGrabInfo;
typedef struct _GdkInputWindow GdkInputWindow;
@@ -261,6 +261,7 @@ struct _GdkWindowObject
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;
@@ -274,6 +275,8 @@ struct _GdkWindowObject
cairo_surface_t *cairo_surface;
};
#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;
@@ -457,7 +460,8 @@ void _gdk_windowing_get_pointer (GdkDisplay *display,
GdkWindow* _gdk_windowing_window_at_pointer (GdkDisplay *display,
gint *win_x,
gint *win_y,
GdkModifierType *mask);
GdkModifierType *mask,
gboolean get_toplevel);
GdkGrabStatus _gdk_windowing_pointer_grab (GdkWindow *window,
GdkWindow *native,
gboolean owner_events,
@@ -605,7 +609,7 @@ void _gdk_display_enable_motion_hints (GdkDisplay *display);
void _gdk_window_invalidate_for_expose (GdkWindow *window,
const GdkRegion *region);
GdkRegion *region);
void _gdk_windowing_set_cairo_surface_size (cairo_surface_t *surface,
int width,
@@ -628,6 +632,8 @@ 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,
+65 -6
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;
+830 -637
View File
File diff suppressed because it is too large Load Diff
+10 -8
View File
@@ -601,7 +601,6 @@ _gdk_offscreen_window_new (GdkWindow *window,
GdkWindowAttr *attributes,
gint attributes_mask)
{
GdkWindowObject *parent_private;
GdkWindowObject *private;
GdkOffscreenWindow *offscreen;
@@ -615,7 +614,6 @@ _gdk_offscreen_window_new (GdkWindow *window,
if (private->parent != NULL && GDK_WINDOW_DESTROYED (private->parent))
return;
parent_private = (GdkWindowObject*) private->parent;
private->impl = g_object_new (GDK_TYPE_OFFSCREEN_WINDOW, NULL);
offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
offscreen->wrapper = window;
@@ -650,7 +648,6 @@ gdk_offscreen_window_reparent (GdkWindow *window,
GdkWindowObject *private = (GdkWindowObject *)window;
GdkWindowObject *new_parent_private = (GdkWindowObject *)new_parent;
GdkWindowObject *old_parent;
GdkOffscreenWindow *offscreen;
gboolean was_mapped;
if (new_parent)
@@ -664,8 +661,6 @@ gdk_offscreen_window_reparent (GdkWindow *window,
return FALSE;
}
offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
was_mapped = GDK_WINDOW_IS_MAPPED (window);
gdk_window_hide (window);
@@ -837,6 +832,8 @@ gdk_offscreen_window_get_pointer (GdkWindow *window,
* add a reference to it.
*
* Returns: The offscreen pixmap, or %NULL if not offscreen
*
* Since: 2.18
*/
GdkPixmap *
gdk_offscreen_window_get_pixmap (GdkWindow *window)
@@ -1119,9 +1116,6 @@ gdk_offscreen_window_get_geometry (GdkWindow *window,
gint *depth)
{
GdkWindowObject *private = (GdkWindowObject *)window;
GdkOffscreenWindow *offscreen;
offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
g_return_if_fail (window == NULL || GDK_IS_WINDOW (window));
@@ -1149,6 +1143,7 @@ gdk_offscreen_window_queue_antiexpose (GdkWindow *window,
static void
gdk_offscreen_window_queue_translation (GdkWindow *window,
GdkGC *gc,
GdkRegion *area,
gint dx,
gint dy)
@@ -1160,6 +1155,13 @@ gdk_offscreen_window_queue_translation (GdkWindow *window,
* @window: a #GdkWindow
* @embedder: the #GdkWindow that @window gets embedded in
*
* Sets @window to be embedded in @embedder.
*
* To fully embed an offscreen window, in addition to calling this
* function, it is also necessary to handle the #GdkWindow::pick-embedded-child
* signal on the @embedder and the #GdkWindow::to-embedder and
* #GdkWindow::from-embedder signals on @window.
*
* Since: 2.18
*/
void
+8 -4
View File
@@ -385,10 +385,14 @@ gdk_pixmap_draw_drawable (GdkDrawable *drawable,
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
_gdk_gc_remove_drawable_clip (gc);
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
+4 -5
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);
@@ -43,9 +45,6 @@ void gdk_synthesize_window_state (GdkWindow *window,
GdkWindowState unset_flags,
GdkWindowState set_flags);
gboolean _gdk_window_event_parent_of (GdkWindow *parent,
GdkWindow *child);
/* Tests whether a pair of x,y may cause overflows when converted to Pango
* units (multiplied by PANGO_SCALE). We don't allow the entire range, leave
* some space for additions afterwards, to be safe...
+1 -1
View File
@@ -86,7 +86,7 @@ void gdk_selection_convert (GdkWindow *requestor,
GdkAtom selection,
GdkAtom target,
guint32 time_);
gboolean gdk_selection_property_get (GdkWindow *requestor,
gint gdk_selection_property_get (GdkWindow *requestor,
guchar **data,
GdkAtom *prop_type,
gint *prop_format);
+1036 -322
View File
File diff suppressed because it is too large Load Diff
+9
View File
@@ -258,9 +258,12 @@ typedef struct _GdkWindowObjectClass GdkWindowObjectClass;
#define GDK_IS_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW))
#define GDK_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW))
#define GDK_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW, GdkWindowObjectClass))
#ifndef GDK_DISABLE_DEPRECATED
#define GDK_WINDOW_OBJECT(object) ((GdkWindowObject *) GDK_WINDOW (object))
#ifndef GDK_COMPILATION
/* We used to export all of GdkWindowObject, but we don't want to keep doing so.
However, there are various parts of it accessed by macros and other code,
so we keep the old exported version public, but in reality it is larger. */
@@ -316,6 +319,7 @@ struct _GdkWindowObject
GdkWindowRedirect *redirect;
};
#endif
#endif
struct _GdkWindowObjectClass
{
@@ -330,6 +334,7 @@ GdkWindow* gdk_window_new (GdkWindow *parent,
gint attributes_mask);
void gdk_window_destroy (GdkWindow *window);
GdkWindowType gdk_window_get_window_type (GdkWindow *window);
gboolean gdk_window_is_destroyed (GdkWindow *window);
GdkWindow* gdk_window_at_pointer (gint *win_x,
gint *win_y);
void gdk_window_show (GdkWindow *window);
@@ -364,6 +369,9 @@ void gdk_window_clear_area_e (GdkWindow *window,
gint height);
void gdk_window_raise (GdkWindow *window);
void gdk_window_lower (GdkWindow *window);
void gdk_window_restack (GdkWindow *window,
GdkWindow *sibling,
gboolean above);
void gdk_window_focus (GdkWindow *window,
guint32 timestamp);
void gdk_window_set_user_data (GdkWindow *window,
@@ -501,6 +509,7 @@ void gdk_window_begin_paint_rect (GdkWindow *window,
void gdk_window_begin_paint_region (GdkWindow *window,
const GdkRegion *region);
void gdk_window_end_paint (GdkWindow *window);
void gdk_window_flush (GdkWindow *window);
void gdk_window_set_title (GdkWindow *window,
const gchar *title);
+4
View File
@@ -51,6 +51,9 @@ struct _GdkWindowImplIface
void (* lower) (GdkWindow *window);
void (* restack_under) (GdkWindow *window,
GList *native_siblings);
void (* restack_toplevel) (GdkWindow *window,
GdkWindow *sibling,
gboolean above);
void (* move_resize) (GdkWindow *window,
gboolean with_move,
@@ -118,6 +121,7 @@ struct _GdkWindowImplIface
gboolean (* queue_antiexpose) (GdkWindow *window,
GdkRegion *update_area);
void (* queue_translation) (GdkWindow *window,
GdkGC *gc,
GdkRegion *area,
gint dx,
gint dy);
+7
View File
@@ -72,6 +72,13 @@
if (NSEqualRects (rect, NSZeroRect))
return;
/* Clear our own bookkeeping of regions that need display */
if (impl->needs_display_region)
{
gdk_region_destroy (impl->needs_display_region);
impl->needs_display_region = NULL;
}
[self getRectsBeingDrawn:&drawn_rects count:&count];
/* Note: arbitrary limit here to not degrade performace too much. It would
+30
View File
@@ -401,8 +401,29 @@ drag_operation_to_drag_action (NSDragOperation operation)
{
GdkDragAction result = 0;
/* GDK and Quartz drag operations do not map 1:1.
* This mapping represents about the best that we
* can come up.
*
* Note that NSDragOperationPrivate and GDK_ACTION_PRIVATE
* have almost opposite meanings: the GDK one means that the
* destination is solely responsible for the action; the Quartz
* one means that the source and destination will agree
* privately on the action. NSOperationGeneric is close in meaning
* to GDK_ACTION_PRIVATE but there is a problem: it will be
* sent for any ordinary drag, and likely not understood
* by any intra-widget drag (since the source & dest are the
* same).
*/
if (operation & NSDragOperationGeneric)
result |= GDK_ACTION_MOVE;
if (operation & NSDragOperationCopy)
result |= GDK_ACTION_COPY;
if (operation & NSDragOperationMove)
result |= GDK_ACTION_MOVE;
if (operation & NSDragOperationLink)
result |= GDK_ACTION_LINK;
return result;
}
@@ -414,6 +435,10 @@ drag_action_to_drag_operation (GdkDragAction action)
if (action & GDK_ACTION_COPY)
result |= NSDragOperationCopy;
if (action & GDK_ACTION_LINK)
result |= NSDragOperationLink;
if (action & GDK_ACTION_MOVE)
result |= NSDragOperationMove;
return result;
}
@@ -425,6 +450,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
GDK_DRAG_CONTEXT_PRIVATE (current_context)->dragging_info = sender;
current_context->suggested_action = drag_operation_to_drag_action ([sender draggingSourceOperationMask]);
current_context->actions = current_context->suggested_action;
}
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
@@ -450,6 +476,10 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
- (void)draggingEnded:(id <NSDraggingInfo>)sender
{
/* leave a note for the source about what action was taken */
if (_gdk_quartz_drag_source_context && current_context)
_gdk_quartz_drag_source_context->action = current_context->action;
if (current_context)
g_object_unref (current_context);
current_context = NULL;
+20 -1
View File
@@ -45,6 +45,21 @@ gdk_quartz_cursor_new_from_nscursor (NSCursor *nscursor,
return cursor;
}
static GdkCursor *
create_blank_cursor (void)
{
NSCursor *nscursor;
NSImage *nsimage;
NSSize size = { 1.0, 1.0 };
nsimage = [[NSImage alloc] initWithSize:size];
nscursor = [[NSCursor alloc] initWithImage:nsimage
hotSpot:NSMakePoint(0.0, 0.0)];
[nsimage release];
return gdk_quartz_cursor_new_from_nscursor (nscursor, GDK_BLANK_CURSOR);
}
static gboolean
get_bit (const guchar *data,
gint width,
@@ -79,7 +94,7 @@ create_builtin_cursor (GdkCursorType cursor_type)
NSImage *image;
NSCursor *nscursor;
if (cursor_type >= G_N_ELEMENTS (xcursors))
if (cursor_type >= G_N_ELEMENTS (xcursors) || cursor_type < 0)
return NULL;
cursor = cached_xcursors[cursor_type];
@@ -210,6 +225,10 @@ gdk_cursor_new_for_display (GdkDisplay *display,
case GDK_HAND2:
nscursor = [NSCursor pointingHandCursor];
break;
case GDK_CURSOR_IS_PIXMAP:
return NULL;
case GDK_BLANK_CURSOR:
return create_blank_cursor ();
default:
return gdk_cursor_ref (create_builtin_cursor (cursor_type));
}
+6
View File
@@ -101,6 +101,12 @@ gdk_drag_context_unref (GdkDragContext *context)
GdkDragContext *_gdk_quartz_drag_source_context = NULL;
GdkDragContext *
gdk_quartz_drag_source_context ()
{
return _gdk_quartz_drag_source_context;
}
GdkDragContext *
gdk_drag_begin (GdkWindow *window,
GList *targets)
+39 -3
View File
@@ -33,6 +33,9 @@
#include "gdkkeysyms.h"
#include "gdkprivate-quartz.h"
#define GRIP_WIDTH 15
#define GRIP_HEIGHT 15
/* This is the window corresponding to the key window */
static GdkWindow *current_keyboard_window;
@@ -498,7 +501,11 @@ find_window_for_ns_event (NSEvent *nsevent,
grab = _gdk_display_get_last_pointer_grab (display);
if (grab)
{
if ((grab->event_mask & get_event_mask_from_ns_event (nsevent)) == 0)
/* Implicit grabs do not go through XGrabPointer and thus the
* event mask should not be checked.
*/
if (!grab->implicit
&& (grab->event_mask & get_event_mask_from_ns_event (nsevent)) == 0)
return NULL;
if (grab->owner_events)
@@ -560,8 +567,6 @@ find_window_for_ns_event (NSEvent *nsevent,
if (*y < 0)
return NULL;
/* FIXME: Also need to leave resize events to cocoa somehow? */
/* As for owner events, we need to use the toplevel under the
* pointer, not the window from the NSEvent.
*/
@@ -570,7 +575,38 @@ find_window_for_ns_event (NSEvent *nsevent,
&x_tmp, &y_tmp);
if (toplevel_under_pointer)
{
GdkWindowObject *toplevel_private;
GdkWindowImplQuartz *toplevel_impl;
toplevel = toplevel_under_pointer;
toplevel_private = (GdkWindowObject *)toplevel;
toplevel_impl = (GdkWindowImplQuartz *)toplevel_private->impl;
if ([toplevel_impl->toplevel showsResizeIndicator])
{
NSRect frame;
/* If the resize indicator is visible and the event
* is in the lower right 15x15 corner, we leave these
* events to Cocoa as to be handled as resize events.
* Applications may have widgets in this area. These
* will most likely be larger than 15x15 and for
* scroll bars there are also other means to move
* the scroll bar. Since the resize indicator is
* the only way of resizing windows on Mac OS, it
* is too important to not make functional.
*/
frame = [toplevel_impl->view bounds];
if (x_tmp > frame.size.width - GRIP_WIDTH
&& x_tmp < frame.size.width
&& y_tmp > frame.size.height - GRIP_HEIGHT
&& y_tmp < frame.size.height)
{
return NULL;
}
}
*x = x_tmp;
*y = y_tmp;
}
+27
View File
@@ -24,10 +24,37 @@
void
_gdk_quartz_window_queue_translation (GdkWindow *window,
GdkGC *gc,
GdkRegion *area,
gint dx,
gint dy)
{
GdkWindowObject *private = (GdkWindowObject *)window;
GdkWindowImplQuartz *impl = (GdkWindowImplQuartz *)private->impl;
int i, n_rects;
GdkRegion *intersection;
GdkRectangle *rects;
/* We will intersect the known region that needs display with the given
* area. This intersection will be translated by dx, dy. For the end
* result, we will also set that it needs display.
*/
if (!impl->needs_display_region)
return;
intersection = gdk_region_copy (impl->needs_display_region);
gdk_region_intersect (intersection, area);
gdk_region_offset (intersection, dx, dy);
gdk_region_get_rectangles (intersection, &rects, &n_rects);
for (i = 0; i < n_rects; i++)
_gdk_quartz_window_set_needs_display_in_rect (window, &rects[i]);
g_free (rects);
gdk_region_destroy (intersection);
}
gboolean
+4
View File
@@ -149,6 +149,9 @@ void _gdk_quartz_window_did_resign_main (GdkWindow *window);
void _gdk_quartz_window_debug_highlight (GdkWindow *window,
gint number);
void _gdk_quartz_window_set_needs_display_in_rect (GdkWindow *window,
GdkRectangle *rect);
/* Events */
typedef enum {
GDK_QUARTZ_EVENT_SUBTYPE_EVENTLOOP
@@ -187,6 +190,7 @@ void _gdk_quartz_window_scroll (GdkWindow *window,
gint dx,
gint dy);
void _gdk_quartz_window_queue_translation (GdkWindow *window,
GdkGC *gc,
GdkRegion *area,
gint dx,
gint dy);
+31 -1
View File
@@ -82,6 +82,13 @@ gdk_screen_set_default_colormap (GdkScreen *screen,
g_object_unref (old_colormap);
}
/* FIXME: note on the get_width() and the get_height() methods. For
* now we only support screen layouts where the screens are laid out
* horizontally. Mac OS X also supports laying out the screens vertically
* and the screens having "non-standard" offsets from eachother. In the
* future we need a much more sophiscated algorithm to translate these
* layouts to GDK coordinate space and GDK screen layout.
*/
gint
gdk_screen_get_width (GdkScreen *screen)
{
@@ -221,6 +228,8 @@ screen_get_monitor_geometry (GdkScreen *screen,
NSArray *array;
NSScreen *nsscreen;
NSRect rect;
NSRect largest_rect;
int i;
GDK_QUARTZ_ALLOC_POOL;
@@ -229,10 +238,31 @@ screen_get_monitor_geometry (GdkScreen *screen,
rect = [nsscreen frame];
dest->x = rect.origin.x;
dest->y = rect.origin.y;
dest->width = rect.size.width;
dest->height = rect.size.height;
/* FIXME: as stated above the get_width() and get_height() functions
* in this file, we only support horizontal screen layouts for now.
*/
/* Find the monitor with the largest height. All monitors should be
* offset to this one in the GDK screen space instead of offset to
* the screen with the menu bar.
*/
largest_rect = [[array objectAtIndex:0] frame];
for (i = 1; i < [array count]; i++)
{
NSRect rect = [[array objectAtIndex:i] frame];
if (rect.size.height > largest_rect.size.height)
largest_rect = [[array objectAtIndex:i] frame];
}
if (largest_rect.size.height - rect.size.height == 0)
dest->y = 0;
else
dest->y = largest_rect.size.height - rect.size.height + largest_rect.origin.y;
if (in_mm)
{
dest->x = get_mm_from_pixels (nsscreen, dest->x);
+134 -21
View File
@@ -347,12 +347,30 @@ gdk_window_impl_quartz_end_paint (GdkPaintable *paintable)
}
}
void
_gdk_quartz_window_set_needs_display_in_rect (GdkWindow *window,
GdkRectangle *rect)
{
GdkWindowObject *private;
GdkWindowImplQuartz *impl;
private = GDK_WINDOW_OBJECT (window);
impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
if (!impl->needs_display_region)
impl->needs_display_region = gdk_region_new ();
gdk_region_union_with_rect (impl->needs_display_region, rect);
[impl->view setNeedsDisplayInRect:NSMakeRect (rect->x, rect->y,
rect->width, rect->height)];
}
void
_gdk_windowing_window_process_updates_recurse (GdkWindow *window,
GdkRegion *region)
{
GdkWindowObject *private = (GdkWindowObject *)window;
GdkWindowImplQuartz *impl = (GdkWindowImplQuartz *)private->impl;
int i, n_rects;
GdkRectangle *rects;
@@ -389,10 +407,7 @@ _gdk_windowing_window_process_updates_recurse (GdkWindow *window,
gdk_region_get_rectangles (region, &rects, &n_rects);
for (i = 0; i < n_rects; i++)
{
[impl->view setNeedsDisplayInRect:NSMakeRect (rects[i].x, rects[i].y,
rects[i].width, rects[i].height)];
}
_gdk_quartz_window_set_needs_display_in_rect (window, &rects[i]);
g_free (rects);
@@ -639,9 +654,16 @@ _gdk_quartz_window_is_ancestor (GdkWindow *ancestor,
gint
_gdk_quartz_window_get_inverted_screen_y (gint y)
{
NSRect rect = [[NSScreen mainScreen] frame];
int index;
GdkRectangle gdk_rect;
NSScreen *main_screen = [NSScreen mainScreen];
NSRect rect = [main_screen frame];
return rect.size.height - y;
index = [[NSScreen screens] indexOfObject:main_screen];
gdk_screen_get_monitor_geometry (_gdk_screen, index, &gdk_rect);
return gdk_rect.height - y + rect.origin.y + gdk_rect.y;
}
static GdkWindow *
@@ -732,13 +754,76 @@ _gdk_quartz_window_find_child (GdkWindow *window,
return NULL;
}
static void
generate_motion_event (GdkWindow *window)
{
NSPoint point;
NSPoint screen_point;
NSWindow *nswindow;
GdkQuartzView *view;
GdkWindowObject *private;
GdkEvent *event;
gint x, y, x_root, y_root;
gdouble xx, yy;
GList *node;
GdkWindow *pointer_window;
event = gdk_event_new (GDK_MOTION_NOTIFY);
event->any.window = NULL;
event->any.send_event = TRUE;
private = (GdkWindowObject *)window;
nswindow = ((GdkWindowImplQuartz *)private->impl)->toplevel;
view = (GdkQuartzView *)[nswindow contentView];
screen_point = [NSEvent mouseLocation];
x_root = screen_point.x;
y_root = _gdk_quartz_window_get_inverted_screen_y (screen_point.y);
point = [nswindow convertScreenToBase:screen_point];
x = point.x;
y = private->height - point.y;
pointer_window = _gdk_window_find_descendant_at (window, x, y,
&xx, &yy);
event->any.type = GDK_MOTION_NOTIFY;
event->motion.window = window;
event->motion.time = GDK_CURRENT_TIME;
event->motion.x = x;
event->motion.y = y;
event->motion.x_root = x_root;
event->motion.y_root = y_root;
/* FIXME event->axes */
event->motion.state = 0;
event->motion.is_hint = FALSE;
event->motion.device = _gdk_display->core_pointer;
if (event->any.window)
g_object_ref (event->any.window);
node = _gdk_event_queue_append (gdk_display_get_default (), event);
_gdk_windowing_got_event (gdk_display_get_default (), node, event, 0);
}
void
_gdk_quartz_window_did_become_main (GdkWindow *window)
{
main_window_stack = g_slist_remove (main_window_stack, window);
if (GDK_WINDOW_OBJECT (window)->window_type != GDK_WINDOW_TEMP)
main_window_stack = g_slist_prepend (main_window_stack, window);
{
main_window_stack = g_slist_prepend (main_window_stack, window);
/* We just became the active window, send a motion-notify
* event so things like highlights get set up correctly.
* This motion-notify is sent to the key window.
*/
generate_motion_event (window);
}
clear_toplevel_order ();
}
@@ -945,7 +1030,6 @@ _gdk_windowing_window_init (void)
GdkWindowObject *private;
GdkWindowImplQuartz *impl;
GdkDrawableImplQuartz *drawable_impl;
NSRect rect;
g_assert (_gdk_root == NULL);
@@ -955,16 +1039,20 @@ _gdk_windowing_window_init (void)
private->impl = g_object_new (_gdk_window_impl_get_type (), NULL);
private->impl_window = private;
/* Note: This needs to be reworked for multi-screen support. */
impl = GDK_WINDOW_IMPL_QUARTZ (GDK_WINDOW_OBJECT (_gdk_root)->impl);
rect = [[NSScreen mainScreen] frame];
/* The size of the root window should be the same as the size of
* the screen it belongs to.
*
* FIXME: Of course this needs to be updated when you change the monitor
* configuration (add another one, remove one, etc).
*/
private->x = 0;
private->y = 0;
private->abs_x = 0;
private->abs_y = 0;
private->width = rect.size.width;
private->height = rect.size.height;
private->width = gdk_screen_get_width (_gdk_screen);
private->height = gdk_screen_get_height (_gdk_screen);
private->state = 0; /* We don't want GDK_WINDOW_STATE_WITHDRAWN here */
private->window_type = GDK_WINDOW_ROOT;
@@ -1290,12 +1378,7 @@ move_resize_window_internal (GdkWindow *window,
gdk_region_get_rectangles (expose_region, &rects, &n_rects);
for (n = 0; n < n_rects; ++n)
{
[impl->view setNeedsDisplayInRect:NSMakeRect (rects[n].x,
rects[n].y,
rects[n].width,
rects[n].height)];
}
_gdk_quartz_window_set_needs_display_in_rect (window, &rects[n]);
g_free (rects);
}
@@ -1541,6 +1624,14 @@ gdk_window_quartz_lower (GdkWindow *window)
}
}
static void
gdk_window_quartz_restack_toplevel (GdkWindow *window,
GdkWindow *sibling,
gboolean above)
{
/* FIXME: Implement this */
}
static void
gdk_window_quartz_set_background (GdkWindow *window,
const GdkColor *color)
@@ -1847,7 +1938,8 @@ GdkWindow *
_gdk_windowing_window_at_pointer (GdkDisplay *display,
gint *win_x,
gint *win_y,
GdkModifierType *mask)
GdkModifierType *mask,
gboolean get_toplevel)
{
GdkWindow *found_window;
gint x, y;
@@ -1885,6 +1977,26 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display,
if (mask)
*mask = tmp_mask;
if (get_toplevel)
{
GdkWindowObject *w = (GdkWindowObject *)found_window;
/* Requested toplevel, find it. */
/* TODO: This can be implemented more efficient by never
recursing into children in the first place */
if (w)
{
/* Convert to toplevel */
while (w->parent != NULL &&
w->parent->window_type != GDK_WINDOW_ROOT)
{
*win_x += w->x;
*win_y += w->y;
w = w->parent;
}
found_window = (GdkWindow *)w;
}
}
return found_window;
}
@@ -2907,6 +3019,7 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface)
iface->get_events = gdk_window_quartz_get_events;
iface->raise = gdk_window_quartz_raise;
iface->lower = gdk_window_quartz_lower;
iface->restack_toplevel = gdk_window_quartz_restack_toplevel;
iface->move_resize = gdk_window_quartz_move_resize;
iface->set_background = gdk_window_quartz_set_background;
iface->set_back_pixmap = gdk_window_quartz_set_back_pixmap;
+2
View File
@@ -59,6 +59,8 @@ struct _GdkWindowImplQuartz
/* Sorted by z-order */
GList *sorted_children;
GdkRegion *needs_display_region;
};
struct _GdkWindowImplQuartzClass
+6 -6
View File
@@ -214,10 +214,10 @@ gdk_win32_set_colormap (GdkDrawable *drawable,
return;
if (impl->colormap)
gdk_colormap_unref (impl->colormap);
g_object_unref (impl->colormap);
impl->colormap = colormap;
if (impl->colormap)
gdk_colormap_ref (impl->colormap);
g_object_ref (impl->colormap);
}
/* Drawing
@@ -494,7 +494,7 @@ draw_tiles (GdkDrawable *drawable,
gdk_win32_hdc_release (drawable, gc, mask);
gdk_win32_hdc_release (tile, gc_copy, mask);
gdk_gc_unref (gc_copy);
g_object_unref (gc_copy);
}
static void
@@ -629,11 +629,11 @@ generic_draw (GdkDrawable *drawable,
gdk_draw_rectangle (tile_pixmap, tile_gc, TRUE,
0, 0, width, height);
}
gdk_gc_unref (stipple_gc);
g_object_unref (stipple_gc);
}
gdk_gc_unref (mask_gc);
gdk_gc_unref (tile_gc);
g_object_unref (mask_gc);
g_object_unref (tile_gc);
mask_hdc = CreateCompatibleDC (hdc);
+2 -2
View File
@@ -266,7 +266,7 @@ _gdk_win32_copy_to_image (GdkDrawable *drawable,
(FALSE,
GDK_DRAWABLE_IMPL_WIN32 (GDK_PIXMAP_OBJECT (image->windowing_data)->impl),
gc, drawable, src_x, src_y, dest_x, dest_y, width, height);
gdk_gc_unref (gc);
g_object_unref (gc);
return image;
}
@@ -392,7 +392,7 @@ gdk_win32_image_destroy (GdkImage *image)
GDK_NOTE (IMAGE, g_print ("gdk_win32_image_destroy: %p\n",
GDK_PIXMAP_HBITMAP (pixmap)));
gdk_pixmap_unref (pixmap);
g_object_unref (pixmap);
image->windowing_data = NULL;
}
+6 -2
View File
@@ -108,12 +108,16 @@ GdkTimeCoord ** _gdk_device_allocate_history (GdkDevice *device,
/* The following functions are provided by each implementation
* (just wintab for now)
*/
void _gdk_input_configure_event (GdkWindow *window);
void _gdk_input_enter_event (GdkWindow *window);
void _gdk_input_configure_event (GdkWindow *window);
void _gdk_input_enter_event (GdkWindow *window);
gboolean _gdk_input_other_event (GdkEvent *event,
MSG *msg,
GdkWindow *window);
void _gdk_input_crossing_event (GdkWindow *window,
gboolean enter);
/* These should be in gdkinternals.h */
GdkInputWindow *_gdk_input_window_find (GdkWindow *window);
+28
View File
@@ -310,6 +310,34 @@ _gdk_input_window_destroy (GdkWindow *window)
g_free(input_window);
}
void
_gdk_input_crossing_event (GdkWindow *window,
gboolean enter)
{
GdkWindowObject *priv = (GdkWindowObject *)window;
GdkInputWindow *input_window;
gint root_x, root_y;
if (enter)
{
#if 0
/* No idea what to do... */
#if 0
gdk_input_check_proximity(display);
#endif
input_window = priv->input_window;
if (input_window != NULL)
{
_gdk_input_get_root_relative_geometry (window, &root_x, &root_y);
input_window->root_x = root_x;
input_window->root_y = root_y;
}
#endif
}
else
_gdk_input_ignore_core = FALSE;
}
void
_gdk_input_exit (void)
{
+1 -1
View File
@@ -428,7 +428,7 @@ _gdk_pixmap_create_from_data (GdkDrawable *drawable,
GDK_DRAWABLE_IMPL_WIN32 (GDK_PIXMAP_OBJECT (result)->impl),
gc, source, 0, 0, 0, 0, width, height);
g_object_unref (source);
gdk_gc_unref (gc);
g_object_unref (gc);
GDK_NOTE (PIXMAP, g_print ("gdk_pixmap_create_from_data: %dx%dx%d=%p\n",
width, height, depth,
+4
View File
@@ -138,6 +138,8 @@ struct _GdkWin32SingleFont
FONTSIGNATURE fs;
};
#ifndef GDK_DISABLE_DEPRECATED
struct _GdkFontPrivateWin32
{
GdkFontPrivate base;
@@ -145,6 +147,8 @@ struct _GdkFontPrivateWin32
GSList *names;
};
#endif /* GDK_DISABLE_DEPRECATED */
struct _GdkVisualClass
{
GObjectClass parent_class;
+19 -9
View File
@@ -2092,6 +2092,14 @@ gdk_win32_window_restack_under (GdkWindow *window,
// ### TODO
}
static void
gdk_win32_window_restack_toplevel (GdkWindow *window,
GdkWindow *sibling,
gboolean above)
{
// ### TODO
}
void
gdk_window_get_root_origin (GdkWindow *window,
gint *x,
@@ -2253,7 +2261,8 @@ GdkWindow*
_gdk_windowing_window_at_pointer (GdkDisplay *display,
gint *win_x,
gint *win_y,
GdkModifierType *mask)
GdkModifierType *mask,
gboolean get_toplevel)
{
GdkWindow *window;
POINT point, pointc;
@@ -2275,6 +2284,11 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display,
ScreenToClient (hwnd, &point);
do {
if (get_toplevel &&
(window = gdk_win32_handle_table_lookup ((GdkNativeWindow) hwnd)) != NULL &&
GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
break;
hwndc = ChildWindowFromPoint (hwnd, point);
ClientToScreen (hwnd, &point);
ScreenToClient (hwndc, &point);
@@ -2353,8 +2367,6 @@ gdk_win32_window_shape_combine_mask (GdkWindow *window,
GDK_NOTE (MISC, g_print ("gdk_window_shape_combine_mask: %p: none\n",
GDK_WINDOW_HWND (window)));
SetWindowRgn (GDK_WINDOW_HWND (window), NULL, TRUE);
private->shaped = FALSE;
}
else
{
@@ -2368,8 +2380,6 @@ gdk_win32_window_shape_combine_mask (GdkWindow *window,
hrgn = _gdk_win32_bitmap_to_hrgn (mask);
do_shape_combine_region (window, hrgn, x, y);
private->shaped = TRUE;
}
}
@@ -3422,8 +3432,6 @@ gdk_win32_window_shape_combine_region (GdkWindow *window,
GDK_NOTE (MISC, g_print ("gdk_window_shape_combine_region: %p: none\n",
GDK_WINDOW_HWND (window)));
SetWindowRgn (GDK_WINDOW_HWND (window), NULL, TRUE);
private->shaped = FALSE;
}
else
{
@@ -3436,8 +3444,6 @@ gdk_win32_window_shape_combine_region (GdkWindow *window,
hrgn));
do_shape_combine_region (window, hrgn, offset_x, offset_y);
private->shaped = TRUE;
}
}
@@ -3576,6 +3582,7 @@ _gdk_win32_window_queue_antiexpose (GdkWindow *window,
*/
static void
_gdk_win32_window_queue_translation (GdkWindow *window,
GdkGC *gc,
GdkRegion *area,
gint dx,
gint dy)
@@ -3641,6 +3648,7 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface)
iface->raise = gdk_win32_window_raise;
iface->lower = gdk_win32_window_lower;
iface->restack_under = gdk_win32_window_restack_under;
iface->restack_toplevel = gdk_win32_window_restack_toplevel;
iface->move_resize = gdk_win32_window_move_resize;
iface->set_background = gdk_win32_window_set_background;
iface->set_back_pixmap = gdk_win32_window_set_back_pixmap;
@@ -3656,4 +3664,6 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface)
iface->queue_antiexpose = _gdk_win32_window_queue_antiexpose;
iface->queue_translation = _gdk_win32_window_queue_translation;
iface->destroy = _gdk_win32_window_destroy;
iface->input_window_destroy = _gdk_input_window_destroy;
iface->input_window_crossing = _gdk_input_crossing_event;
}
+3 -4
View File
@@ -402,8 +402,7 @@ gdk_display_open (const gchar *display_name)
_gdk_dnd_init (display);
for (i = 0; i < ScreenCount (display_x11->xdisplay); i++)
gdk_display_request_selection_notification (display,
GDK_SCREEN_X11 (display_x11->screens[i])->cm_selection_atom);
_gdk_x11_screen_setup (display_x11->screens[i]);
g_signal_emit_by_name (gdk_display_manager_get(),
"display_opened", display);
@@ -690,8 +689,8 @@ void
gdk_display_beep (GdkDisplay *display)
{
g_return_if_fail (GDK_IS_DISPLAY (display));
XBell (GDK_DISPLAY_XDISPLAY (display), 0);
XkbBell (GDK_DISPLAY_XDISPLAY (display), None, 0, None);
}
/**
+11
View File
@@ -956,6 +956,17 @@ gdk_x11_drawable_get_xid (GdkDrawable *drawable)
return ((GdkDrawableImplX11 *)impl)->xid;
}
GdkDrawable *
gdk_x11_window_get_drawable_impl (GdkWindow *window)
{
return ((GdkWindowObject *)window)->impl;
}
GdkDrawable *
gdk_x11_pixmap_get_drawable_impl (GdkPixmap *pixmap)
{
return ((GdkPixmapObject *)pixmap)->impl;
}
/* Code for accelerated alpha compositing using the RENDER extension.
* It's a bit long because there are lots of possibilities for
* what's the fastest depending on the available picture formats,
+2
View File
@@ -92,6 +92,8 @@ void _gdk_x11_convert_to_format (guchar *src_buf,
/* Note that the following take GdkDrawableImplX11, not the wrapper drawable */
void _gdk_x11_drawable_finish (GdkDrawable *drawable);
void _gdk_x11_drawable_update_size (GdkDrawable *drawable);
GdkDrawable *gdk_x11_window_get_drawable_impl (GdkWindow *window);
GdkDrawable *gdk_x11_pixmap_get_drawable_impl (GdkPixmap *pixmap);
G_END_DECLS
+45 -48
View File
@@ -305,6 +305,8 @@ graphics_expose_predicate (Display *display,
*
* Return value: a #GdkEventExpose if a GraphicsExpose was received, or %NULL if a
* NoExpose event was received.
*
* Deprecated:2.18
**/
GdkEvent*
gdk_event_get_graphics_expose (GdkWindow *window)
@@ -1032,28 +1034,31 @@ gdk_event_translate (GdkDisplay *display,
}
}
}
if (screen_x11 && screen_x11->wmspec_check_window != None &&
xwindow == screen_x11->wmspec_check_window)
{
if (xevent->type == DestroyNotify)
{
screen_x11->wmspec_check_window = None;
g_free (screen_x11->window_manager_name);
screen_x11->window_manager_name = g_strdup ("unknown");
/* careful, reentrancy */
_gdk_x11_screen_window_manager_changed (GDK_SCREEN (screen_x11));
if (xevent->type == DestroyNotify)
{
int i, n;
n = gdk_display_get_n_screens (display);
for (i = 0; i < n; i++)
{
screen = gdk_display_get_screen (display, i);
screen_x11 = GDK_SCREEN_X11 (screen);
if (screen_x11->wmspec_check_window == xwindow)
{
screen_x11->wmspec_check_window = None;
screen_x11->last_wmspec_check_time = 0;
g_free (screen_x11->window_manager_name);
screen_x11->window_manager_name = g_strdup ("unknown");
/* careful, reentrancy */
_gdk_x11_screen_window_manager_changed (screen);
return_val = FALSE;
goto done;
}
}
/* Eat events on this window unless someone had wrapped
* it as a foreign window
*/
if (window == NULL)
{
return_val = FALSE;
goto done;
}
}
if (window &&
@@ -1595,13 +1600,13 @@ gdk_event_translate (GdkDisplay *display,
xevent->xexpose.x, xevent->xexpose.y,
xevent->xexpose.width, xevent->xexpose.height,
event->any.send_event ? " (send)" : ""));
if (window_private == NULL)
{
return_val = FALSE;
break;
}
{
GdkRectangle expose_rect;
@@ -1610,25 +1615,10 @@ gdk_event_translate (GdkDisplay *display,
expose_rect.width = xevent->xexpose.width;
expose_rect.height = xevent->xexpose.height;
if (return_exposes)
{
event->expose.type = GDK_EXPOSE;
event->expose.area = expose_rect;
event->expose.region = gdk_region_rectangle (&expose_rect);
event->expose.window = window;
event->expose.count = xevent->xexpose.count;
return_val = TRUE;
}
else
{
_gdk_window_process_expose (window, xevent->xexpose.serial, &expose_rect);
return_val = FALSE;
}
return_val = FALSE;
_gdk_window_process_expose (window, xevent->xexpose.serial, &expose_rect);
return_val = FALSE;
}
break;
case GraphicsExpose:
@@ -2629,23 +2619,24 @@ fetch_net_wm_check_window (GdkScreen *screen)
guchar *data;
Window *xwindow;
GTimeVal tv;
gint error;
screen_x11 = GDK_SCREEN_X11 (screen);
display = screen_x11->display;
g_return_if_fail (GDK_DISPLAY_X11 (display)->trusted_client);
g_get_current_time (&tv);
if (ABS (tv.tv_sec - screen_x11->last_wmspec_check_time) < 15)
return; /* we've checked recently */
screen_x11->last_wmspec_check_time = tv.tv_sec;
data = NULL;
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), screen_x11->xroot_window,
XGetWindowProperty (screen_x11->xdisplay, screen_x11->xroot_window,
gdk_x11_get_xatom_by_name_for_display (display, "_NET_SUPPORTING_WM_CHECK"),
0, G_MAXLONG, False, XA_WINDOW, &type, &format,
0, G_MAXLONG, False, XA_WINDOW, &type, &format,
&n_items, &bytes_after, &data);
if (type != XA_WINDOW)
@@ -2664,22 +2655,28 @@ fetch_net_wm_check_window (GdkScreen *screen)
}
gdk_error_trap_push ();
/* Find out if this WM goes away, so we can reset everything. */
XSelectInput (screen_x11->xdisplay, *xwindow, StructureNotifyMask);
gdk_display_sync (display);
if (gdk_error_trap_pop () == Success)
error = gdk_error_trap_pop ();
if (!error)
{
screen_x11->wmspec_check_window = *xwindow;
screen_x11->need_refetch_net_supported = TRUE;
screen_x11->need_refetch_wm_name = TRUE;
/* Careful, reentrancy */
_gdk_x11_screen_window_manager_changed (GDK_SCREEN (screen_x11));
}
else if (error == BadWindow)
{
/* Leftover property, try again immediately, new wm may be starting up */
screen_x11->last_wmspec_check_time = 0;
}
XFree (xwindow);
XFree (xwindow);
}
/**
+16 -15
View File
@@ -60,26 +60,24 @@ _gdk_window_move_resize_child (GdkWindow *window,
gint width,
gint height)
{
GdkWindowImplX11 *impl;
GdkWindowObject *obj;
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
impl = GDK_WINDOW_IMPL_X11 (GDK_WINDOW_OBJECT (window)->impl);
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
obj = GDK_WINDOW_OBJECT (window);
if (width > 65535 ||
height > 65535)
{
g_warning ("Native children wider or taller than 65535 pixels are not supported");
if (width > 65535)
width = 65535;
if (height > 65535)
height = 65535;
}
obj->x = x;
obj->y = y;
obj->width = width;
@@ -89,7 +87,6 @@ _gdk_window_move_resize_child (GdkWindow *window,
the window won't be visible anyway and thus it will be shaped
to nothing */
_gdk_x11_window_tmp_unset_parent_bg (window);
_gdk_x11_window_tmp_unset_bg (window, TRUE);
XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window),
@@ -108,7 +105,7 @@ expose_serial_predicate (Display *xdisplay,
{
gulong *serial = (gulong *)arg;
if (xev->xany.type == Expose)
if (xev->xany.type == Expose || xev->xany.type == GraphicsExpose)
*serial = MIN (*serial, xev->xany.serial);
return False;
@@ -231,6 +228,7 @@ gdk_window_queue (GdkWindow *window,
void
_gdk_x11_window_queue_translation (GdkWindow *window,
GdkGC *gc,
GdkRegion *area,
gint dx,
gint dy)
@@ -241,6 +239,11 @@ _gdk_x11_window_queue_translation (GdkWindow *window,
item->u.translate.dx = dx;
item->u.translate.dy = dy;
/* Ensure that the gc is flushed so that we get the right
serial from NextRequest in gdk_window_queue, i.e. the
the serial for the XCopyArea, not the ones from flushing
the gc. */
_gdk_x11_gc_flush (gc);
gdk_window_queue (window, item);
}
@@ -262,20 +265,18 @@ _gdk_window_process_expose (GdkWindow *window,
gulong serial,
GdkRectangle *area)
{
GdkWindowImplX11 *impl;
GdkRegion *invalidate_region = gdk_region_rectangle (area);
GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (GDK_WINDOW_DISPLAY (window));
impl = GDK_WINDOW_IMPL_X11 (GDK_WINDOW_OBJECT (window)->impl);
if (display_x11->translate_queue)
{
GList *tmp_list = display_x11->translate_queue->head;
while (tmp_list)
{
GdkWindowQueueItem *item = tmp_list->data;
GList *next = tmp_list->next;
/* an overflow-safe (serial < item->serial) */
if (serial - item->serial > (gulong) G_MAXLONG)
{
@@ -286,7 +287,7 @@ _gdk_window_process_expose (GdkWindow *window,
if (item->u.translate.area)
{
GdkRegion *intersection;
intersection = gdk_region_copy (invalidate_region);
gdk_region_intersect (intersection, item->u.translate.area);
gdk_region_subtract (invalidate_region, intersection);
@@ -314,7 +315,7 @@ _gdk_window_process_expose (GdkWindow *window,
if (!gdk_region_empty (invalidate_region))
_gdk_window_invalidate_for_expose (window, invalidate_region);
gdk_region_destroy (invalidate_region);
}
+140 -60
View File
@@ -44,6 +44,10 @@ static void gdk_input_translate_coordinates (GdkDevicePrivate *gdkd
gdouble *axis_out,
gdouble *x_out,
gdouble *y_out);
static void gdk_input_update_axes (GdkDevicePrivate *gdkdev,
gint axes_count,
gint first_axis,
gint *axis_data);
static guint gdk_input_translate_state (guint state,
guint device_state);
@@ -111,17 +115,15 @@ gdk_input_device_new (GdkDisplay *display,
tmp_name = g_ascii_strdown (gdkdev->info.name, -1);
if (!strcmp (tmp_name, "pointer"))
gdkdev->info.source = GDK_SOURCE_MOUSE;
else if (!strcmp (tmp_name, "wacom") ||
!strcmp (tmp_name, "pen"))
gdkdev->info.source = GDK_SOURCE_PEN;
else if (!strcmp (tmp_name, "eraser"))
if (strstr (tmp_name, "eraser"))
gdkdev->info.source = GDK_SOURCE_ERASER;
else if (!strcmp (tmp_name, "cursor"))
else if (strstr (tmp_name, "cursor"))
gdkdev->info.source = GDK_SOURCE_CURSOR;
else
else if (strstr (tmp_name, "wacom") ||
strstr (tmp_name, "pen"))
gdkdev->info.source = GDK_SOURCE_PEN;
else
gdkdev->info.source = GDK_SOURCE_MOUSE;
g_free(tmp_name);
@@ -137,7 +139,8 @@ gdk_input_device_new (GdkDisplay *display,
gdkdev->info.has_cursor = 0;
gdkdev->needs_update = FALSE;
gdkdev->claimed = FALSE;
gdkdev->button_state = 0;
memset(gdkdev->button_state, 0, sizeof (gdkdev->button_state));
gdkdev->button_count = 0;
class = device->inputclassinfo;
for (i=0;i<device->num_classes;i++)
@@ -176,6 +179,7 @@ gdk_input_device_new (GdkDisplay *display,
XValuatorInfo *xvi = (XValuatorInfo *)class;
gdkdev->info.num_axes = xvi->num_axes;
gdkdev->axes = g_new (GdkAxisInfo, xvi->num_axes);
gdkdev->axis_data = g_new0 (gint, xvi->num_axes);
gdkdev->info.axes = g_new0 (GdkDeviceAxis, xvi->num_axes);
for (j=0;j<xvi->num_axes;j++)
{
@@ -267,49 +271,14 @@ _gdk_input_common_find_events (GdkDevicePrivate *gdkdev,
if (class != 0)
classes[i++] = class;
}
if (mask & GDK_POINTER_MOTION_MASK)
if (mask & (GDK_POINTER_MOTION_MASK |
GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK |
GDK_BUTTON3_MOTION_MASK | GDK_BUTTON_MOTION_MASK))
{
DeviceMotionNotify (gdkdev->xdevice, gdkdev->motionnotify_type, class);
DeviceMotionNotify (gdkdev->xdevice, gdkdev->motionnotify_type, class);
if (class != 0)
classes[i++] = class;
}
else
if (mask & (GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK |
GDK_BUTTON3_MOTION_MASK | GDK_BUTTON_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK))
{
/* Make sure gdkdev->motionnotify_type is set */
DeviceMotionNotify (gdkdev->xdevice, gdkdev->motionnotify_type, class);
}
if (mask & GDK_BUTTON1_MOTION_MASK)
{
DeviceButton1Motion (gdkdev->xdevice, 0, class);
if (class != 0)
classes[i++] = class;
}
if (mask & GDK_BUTTON2_MOTION_MASK)
{
DeviceButton2Motion (gdkdev->xdevice, 0, class);
if (class != 0)
classes[i++] = class;
}
if (mask & GDK_BUTTON3_MOTION_MASK)
{
DeviceButton3Motion (gdkdev->xdevice, 0, class);
if (class != 0)
classes[i++] = class;
}
if (mask & GDK_BUTTON_MOTION_MASK)
{
DeviceButtonMotion (gdkdev->xdevice, 0, class);
if (class != 0)
classes[i++] = class;
}
if (mask & GDK_POINTER_MOTION_HINT_MASK)
{
/* We'll get into trouble if the macros change, but at least we'll
know about it, and we avoid warnings now */
DevicePointerMotionHint (gdkdev->xdevice, 0, class);
DeviceStateNotify (gdkdev->xdevice, gdkdev->devicestatenotify_type, class);
if (class != 0)
classes[i++] = class;
}
@@ -413,6 +382,19 @@ _gdk_input_common_init (GdkDisplay *display,
return TRUE;
}
static void
gdk_input_update_axes (GdkDevicePrivate *gdkdev,
gint axes_count,
gint first_axis,
gint *axis_data)
{
int i;
g_return_if_fail (first_axis >= 0 && first_axis + axes_count <= gdkdev->info.num_axes);
for (i = 0; i < axes_count; i++)
gdkdev->axis_data[first_axis + i] = axis_data[i];
}
static void
gdk_input_translate_coordinates (GdkDevicePrivate *gdkdev,
GdkWindow *window,
@@ -427,7 +409,7 @@ gdk_input_translate_coordinates (GdkDevicePrivate *gdkdev,
int x_axis = 0;
int y_axis = 0;
double device_width, device_height;
double device_width, device_height, x_min, y_min;
double x_offset, y_offset, x_scale, y_scale;
priv = (GdkWindowObject *) window;
@@ -449,15 +431,34 @@ gdk_input_translate_coordinates (GdkDevicePrivate *gdkdev,
}
device_width = gdkdev->axes[x_axis].max_value - gdkdev->axes[x_axis].min_value;
if (device_width > 0)
{
x_min = gdkdev->axes[x_axis].min_value;
}
else
{
device_width = gdk_screen_get_width (gdk_drawable_get_screen (window));
x_min = 0;
}
device_height = gdkdev->axes[y_axis].max_value - gdkdev->axes[y_axis].min_value;
if (device_height > 0)
{
y_min = gdkdev->axes[y_axis].min_value;
}
else
{
device_height = gdk_screen_get_height (gdk_drawable_get_screen (window));
y_min = 0;
}
if (gdkdev->info.mode == GDK_MODE_SCREEN)
{
x_scale = gdk_screen_get_width (gdk_drawable_get_screen (window)) / device_width;
y_scale = gdk_screen_get_height (gdk_drawable_get_screen (window)) / device_height;
x_offset = - impl_window->input_window->root_x;
y_offset = - impl_window->input_window->root_y;
x_offset = - impl_window->input_window->root_x - priv->abs_x;
y_offset = - impl_window->input_window->root_y - priv->abs_y;
}
else /* GDK_MODE_WINDOW */
{
@@ -506,14 +507,12 @@ gdk_input_translate_coordinates (GdkDevicePrivate *gdkdev,
switch (gdkdev->info.axes[i].use)
{
case GDK_AXIS_X:
axis_out[i] = x_offset + x_scale * (axis_data[x_axis] -
gdkdev->axes[x_axis].min_value);
axis_out[i] = x_offset + x_scale * (axis_data[x_axis] - x_min);
if (x_out)
*x_out = axis_out[i];
break;
case GDK_AXIS_Y:
axis_out[i] = y_offset + y_scale * (axis_data[y_axis] -
gdkdev->axes[y_axis].min_value);
axis_out[i] = y_offset + y_scale * (axis_data[y_axis] - y_min);
if (y_out)
*y_out = axis_out[i];
break;
@@ -558,22 +557,33 @@ _gdk_input_common_other_event (GdkEvent *event,
{
XDeviceButtonEvent *xdbe = (XDeviceButtonEvent *)(xevent);
g_return_val_if_fail (xdbe->button < 256, FALSE);
if (xdbe->type == gdkdev->buttonpress_type)
{
event->button.type = GDK_BUTTON_PRESS;
gdkdev->button_state |= 1 << xdbe->button;
if (!(gdkdev->button_state[xdbe->button/8] & 1 << (xdbe->button%8)))
{
gdkdev->button_state[xdbe->button/8] |= 1 << (xdbe->button%8);
gdkdev->button_count++;
}
}
else
{
event->button.type = GDK_BUTTON_RELEASE;
gdkdev->button_state &= ~(1 << xdbe->button);
if (gdkdev->button_state[xdbe->button/8] & 1 << (xdbe->button%8))
{
gdkdev->button_state[xdbe->button/8] &= ~(1 << (xdbe->button%8));
gdkdev->button_count--;
}
}
event->button.device = &gdkdev->info;
event->button.window = window;
event->button.time = xdbe->time;
event->button.axes = g_new (gdouble, gdkdev->info.num_axes);
gdk_input_translate_coordinates (gdkdev, window, xdbe->axis_data,
gdk_input_update_axes (gdkdev, xdbe->axes_count, xdbe->first_axis,
xdbe->axis_data);
gdk_input_translate_coordinates (gdkdev, window, gdkdev->axis_data,
event->button.axes,
&event->button.x, &event->button.y);
event->button.x_root = event->button.x + priv->abs_x + input_window->root_x;
@@ -675,7 +685,8 @@ _gdk_input_common_other_event (GdkEvent *event,
event->motion.device = &gdkdev->info;
event->motion.axes = g_new (gdouble, gdkdev->info.num_axes);
gdk_input_translate_coordinates(gdkdev,window,xdme->axis_data,
gdk_input_update_axes (gdkdev, xdme->axes_count, xdme->first_axis, xdme->axis_data);
gdk_input_translate_coordinates(gdkdev, window, gdkdev->axis_data,
event->motion.axes,
&event->motion.x,&event->motion.y);
event->motion.x_root = event->motion.x + priv->abs_x + input_window->root_x;
@@ -706,6 +717,26 @@ _gdk_input_common_other_event (GdkEvent *event,
return TRUE;
}
if (xevent->type == gdkdev->devicestatenotify_type)
{
int i;
XDeviceStateNotifyEvent *xdse = (XDeviceStateNotifyEvent *)(xevent);
XInputClass *input_class = (XInputClass *)xdse->data;
for (i=0; i<xdse->num_classes; i++)
{
if (input_class->class == ValuatorClass)
gdk_input_update_axes (gdkdev, gdkdev->info.num_axes, 0,
((XValuatorState *)input_class)->valuators);
input_class = (XInputClass *)(((char *)input_class)+input_class->length);
}
GDK_NOTE (EVENTS,
g_print ("device state notify:\t\twindow: %ld device: %ld\n",
xdse->window,
xdse->deviceid));
return FALSE;
}
if (xevent->type == gdkdev->proximityin_type ||
xevent->type == gdkdev->proximityout_type)
{
@@ -729,6 +760,55 @@ _gdk_input_common_other_event (GdkEvent *event,
return FALSE; /* wasn't one of our event types */
}
gboolean
_gdk_input_common_event_selected (GdkEvent *event,
GdkWindow *window,
GdkDevicePrivate *gdkdev)
{
GdkWindowObject *priv = (GdkWindowObject *) window;
switch (event->type) {
case GDK_BUTTON_PRESS:
return priv->extension_events & GDK_BUTTON_PRESS_MASK;
case GDK_BUTTON_RELEASE:
return priv->extension_events & GDK_BUTTON_RELEASE_MASK;
case GDK_KEY_PRESS:
return priv->extension_events & GDK_KEY_PRESS_MASK;
case GDK_KEY_RELEASE:
return priv->extension_events & GDK_KEY_RELEASE_MASK;
case GDK_MOTION_NOTIFY:
if (priv->extension_events & GDK_POINTER_MOTION_MASK)
return TRUE;
if (gdkdev->button_count && (priv->extension_events & GDK_BUTTON_MOTION_MASK))
return TRUE;
if ((gdkdev->button_state[0] & 1 << 1) && (priv->extension_events & GDK_BUTTON1_MOTION_MASK))
return TRUE;
if ((gdkdev->button_state[0] & 1 << 2) && (priv->extension_events & GDK_BUTTON2_MOTION_MASK))
return TRUE;
if ((gdkdev->button_state[0] & 1 << 3) && (priv->extension_events & GDK_BUTTON3_MOTION_MASK))
return TRUE;
return FALSE;
case GDK_PROXIMITY_IN:
return priv->extension_events & GDK_PROXIMITY_IN_MASK;
case GDK_PROXIMITY_OUT:
return priv->extension_events & GDK_PROXIMITY_OUT_MASK;
default:
return FALSE;
}
}
gboolean
_gdk_device_get_history (GdkDevice *device,
GdkWindow *window,
+17 -14
View File
@@ -237,7 +237,6 @@ _gdk_input_other_event (GdkEvent *event,
GdkWindowObject *priv;
GdkInputWindow *iw;
GdkDevicePrivate *gdkdev;
gint return_val;
GdkEventType event_type;
int x, y;
GdkDisplay *display = GDK_WINDOW_DISPLAY (event_window);
@@ -256,40 +255,43 @@ _gdk_input_other_event (GdkEvent *event,
if (event_type == GDK_NOTHING)
return FALSE;
window = _gdk_window_get_input_window_for_event (event_window,
event_type,
x, y,
xevent->xany.serial);
/* If we're not getting any event window its likely because we're outside the
window and there is no grab. We should still report according to the
implicit grab though. */
iw = ((GdkWindowObject *)event_window)->input_window;
if (window == NULL)
window = iw->button_down_window;
if (iw->button_down_window)
window = iw->button_down_window;
else
window = _gdk_window_get_input_window_for_event (event_window,
event_type,
x, y,
xevent->xany.serial);
priv = (GdkWindowObject *)window;
if (window == NULL)
return FALSE;
if (gdkdev->info.mode == GDK_MODE_DISABLED ||
priv->extension_events == 0 ||
!(gdkdev->info.has_cursor || (priv->extension_events & GDK_ALL_DEVICES_MASK)))
return FALSE;
if (!display->ignore_core_events && priv->extension_events != 0)
gdk_input_check_proximity (GDK_WINDOW_DISPLAY (window));
return_val = _gdk_input_common_other_event (event, xevent, window, gdkdev);
if (!_gdk_input_common_other_event (event, xevent, window, gdkdev))
return FALSE;
if (return_val && event->type == GDK_BUTTON_PRESS)
if (event->type == GDK_BUTTON_PRESS)
iw->button_down_window = window;
if (return_val && event->type == GDK_BUTTON_RELEASE)
if (event->type == GDK_BUTTON_RELEASE && !gdkdev->button_count)
iw->button_down_window = NULL;
if (return_val && event->type == GDK_PROXIMITY_OUT &&
if (event->type == GDK_PROXIMITY_OUT &&
display->ignore_core_events)
gdk_input_check_proximity (GDK_WINDOW_DISPLAY (window));
return return_val;
return _gdk_input_common_event_selected(event, window, gdkdev);
}
gint
@@ -367,10 +369,11 @@ _gdk_input_grab_pointer (GdkWindow *window,
{
gdkdev = (GdkDevicePrivate *)tmp_list->data;
if (!GDK_IS_CORE (gdkdev) && gdkdev->xdevice &&
((gdkdev->button_state != 0) || need_ungrab))
((gdkdev->button_count != 0) || need_ungrab))
{
XUngrabDevice (display_impl->xdisplay, gdkdev->xdevice, time);
gdkdev->button_state = 0;
memset(gdkdev->button_state, 0, sizeof (gdkdev->button_state));
gdkdev->button_count = 0;
}
tmp_list = tmp_list->next;
+25 -5
View File
@@ -120,7 +120,9 @@ gdk_device_dispose (GObject *object)
gdkdev->xdevice = NULL;
}
g_free (gdkdev->axes);
g_free (gdkdev->axis_data);
gdkdev->axes = NULL;
gdkdev->axis_data = NULL;
#endif /* !XINPUT_NONE */
g_free (gdkdev->info.name);
@@ -266,7 +268,6 @@ gdk_device_get_history (GdkDevice *device,
GdkWindow *impl_window;
gboolean result = FALSE;
int tmp_n_events = 0;
int i, j;
g_return_val_if_fail (GDK_WINDOW_IS_X11 (window), FALSE);
@@ -284,9 +285,12 @@ gdk_device_get_history (GdkDevice *device,
if (xcoords)
{
GdkWindowObject *priv = (GdkWindowObject *)window;
int i, j;
coords = _gdk_device_allocate_history (device, tmp_n_events);
j = 0;
for (i=0; i<tmp_n_events; i++)
for (i = 0; i < tmp_n_events; i++)
{
if (impl_coord_in_window (window, xcoords[i].x, xcoords[i].y))
{
@@ -299,16 +303,32 @@ gdk_device_get_history (GdkDevice *device,
XFree (xcoords);
result = TRUE;
/* free the events we allocated too much */
for (i = j; i < tmp_n_events; i++)
{
g_free (coords[i]);
coords[i] = NULL;
}
tmp_n_events = j;
if (tmp_n_events > 0)
{
result = TRUE;
}
else
{
gdk_device_free_history (coords, tmp_n_events);
coords = NULL;
}
}
else
result = FALSE;
}
else
result = _gdk_device_get_history (device, window, start, stop, &coords, &tmp_n_events);
if (n_events)
*n_events = tmp_n_events;
if (events)
*events = coords;
else if (coords)
+7 -2
View File
@@ -73,6 +73,7 @@ struct _GdkDevicePrivate
#ifndef XINPUT_NONE
/* information about the axes */
GdkAxisInfo *axes;
gint *axis_data;
/* Information about XInput device */
XDevice *xdevice;
@@ -82,14 +83,15 @@ struct _GdkDevicePrivate
int buttonpress_type, buttonrelease_type, keypress_type,
keyrelease_type, motionnotify_type, proximityin_type,
proximityout_type, changenotify_type;
proximityout_type, changenotify_type, devicestatenotify_type;
/* true if we need to select a different set of events, but
can't because this is the core pointer */
gint needs_update;
/* Mask of buttons (used for button grabs) */
gint button_state;
char button_state[32];
gint button_count;
/* true if we've claimed the device as active. (used only for XINPUT_GXI) */
gint claimed;
@@ -178,6 +180,9 @@ gint _gdk_input_common_other_event (GdkEvent *event
XEvent *xevent,
GdkWindow *window,
GdkDevicePrivate *gdkdev);
gboolean _gdk_input_common_event_selected (GdkEvent *event,
GdkWindow *window,
GdkDevicePrivate *gdkdev);
#endif /* !XINPUT_NONE */
+1 -1
View File
@@ -427,7 +427,7 @@ gdk_pixmap_foreign_new (GdkNativeWindow anid)
* For example in the X backend, a native pixmap handle is an Xlib
* <type>XID</type>.
*
* Return value: the #GdkWindow wrapper for the native window,
* Return value: the #GdkPixmap wrapper for the native pixmap,
* or %NULL if there is none.
**/
GdkPixmap*
+1
View File
@@ -130,6 +130,7 @@ void _gdk_window_process_expose (GdkWindow *window,
gboolean _gdk_x11_window_queue_antiexpose (GdkWindow *window,
GdkRegion *area);
void _gdk_x11_window_queue_translation (GdkWindow *window,
GdkGC *gc,
GdkRegion *area,
gint dx,
gint dy);
+3 -1
View File
@@ -296,7 +296,9 @@ gdk_x11_xatom_to_atom_for_display (GdkDisplay *display,
GdkAtom virtual_atom = GDK_NONE;
g_return_val_if_fail (GDK_IS_DISPLAY (display), GDK_NONE);
g_return_val_if_fail (xatom != None, GDK_NONE);
if (xatom == None)
return GDK_NONE;
if (display->closed)
return GDK_NONE;
+17 -3
View File
@@ -377,7 +377,7 @@ get_monitor (GdkScreen *screen,
*
* Gets the width in millimeters of the specified monitor, if available.
*
* Returns the width of the monitor, or -1 if not available
* Returns: the width of the monitor, or -1 if not available
*
* Since: 2.14
*/
@@ -989,8 +989,6 @@ _gdk_x11_screen_new (GdkDisplay *display,
screen_x11->wmspec_check_window = None;
/* we want this to be always non-null */
screen_x11->window_manager_name = g_strdup ("unknown");
screen_x11->cm_selection_atom = make_cm_atom (screen_number);
screen_x11->is_composited = check_is_composited (display, screen_x11);
init_multihead (screen);
init_randr_support (screen);
@@ -1001,6 +999,22 @@ _gdk_x11_screen_new (GdkDisplay *display,
return screen;
}
/*
* It is important that we first request the selection
* notification, and then setup the initial state of
* is_composited to avoid a race condition here.
*/
void
_gdk_x11_screen_setup (GdkScreen *screen)
{
GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (screen);
screen_x11->cm_selection_atom = make_cm_atom (screen_x11->screen_num);
gdk_display_request_selection_notification (screen_x11->display,
screen_x11->cm_selection_atom);
screen_x11->is_composited = check_is_composited (screen_x11->display, screen_x11);
}
/**
* gdk_screen_is_composited:
* @screen: a #GdkScreen
+1
View File
@@ -122,6 +122,7 @@ GType _gdk_screen_x11_get_type (void);
GdkScreen * _gdk_x11_screen_new (GdkDisplay *display,
gint screen_number);
void _gdk_x11_screen_setup (GdkScreen *screen);
void _gdk_x11_screen_window_manager_changed (GdkScreen *screen);
void _gdk_x11_screen_size_changed (GdkScreen *screen,
XEvent *event);
+30 -13
View File
@@ -419,7 +419,6 @@ void
_gdk_windowing_window_init (GdkScreen * screen)
{
GdkWindowObject *private;
GdkWindowImplX11 *impl;
GdkDrawableImplX11 *draw_impl;
GdkScreenX11 *screen_x11;
@@ -436,7 +435,6 @@ _gdk_windowing_window_init (GdkScreen * screen)
private->impl = g_object_new (_gdk_window_impl_get_type (), NULL);
private->impl_window = private;
impl = GDK_WINDOW_IMPL_X11 (private->impl);
draw_impl = GDK_DRAWABLE_IMPL_X11 (private->impl);
draw_impl->screen = screen;
@@ -455,6 +453,10 @@ _gdk_windowing_window_init (GdkScreen * screen)
private->width = WidthOfScreen (screen_x11->xscreen);
private->height = HeightOfScreen (screen_x11->xscreen);
private->viewable = TRUE;
/* see init_randr_support() in gdkscreen-x11.c */
private->event_mask = GDK_STRUCTURE_MASK;
_gdk_window_update_size (screen_x11->root_window);
_gdk_xid_table_insert (screen_x11->display,
@@ -1597,11 +1599,9 @@ gdk_window_x11_reparent (GdkWindow *window,
{
GdkWindowObject *window_private;
GdkWindowObject *parent_private;
GdkWindowObject *old_parent_private;
GdkWindowImplX11 *impl;
window_private = (GdkWindowObject*) window;
old_parent_private = (GdkWindowObject*)window_private->parent;
parent_private = (GdkWindowObject*) new_parent;
impl = GDK_WINDOW_IMPL_X11 (window_private->impl);
@@ -1715,6 +1715,21 @@ gdk_window_x11_restack_under (GdkWindow *window,
g_free (windows);
}
static void
gdk_window_x11_restack_toplevel (GdkWindow *window,
GdkWindow *sibling,
gboolean above)
{
XWindowChanges changes;
changes.sibling = GDK_WINDOW_XID (sibling);
changes.stack_mode = above ? Above : Below;
XReconfigureWMWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
gdk_screen_get_number (GDK_WINDOW_SCREEN (window)),
CWStackMode | CWSibling, &changes);
}
static void
gdk_window_x11_lower (GdkWindow *window)
{
@@ -3200,7 +3215,8 @@ GdkWindow*
_gdk_windowing_window_at_pointer (GdkDisplay *display,
gint *win_x,
gint *win_y,
GdkModifierType *mask)
GdkModifierType *mask,
gboolean get_toplevel)
{
GdkWindow *window;
GdkScreen *screen;
@@ -3236,6 +3252,10 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display,
while (xwindow)
{
xwindow_last = xwindow;
if (get_toplevel &&
(window = gdk_window_lookup_for_display (display, xwindow)) != NULL &&
GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
break;
XQueryPointer (xdisplay, xwindow,
&root, &xwindow, &rootx, &rooty, &winx, &winy, &xmask);
}
@@ -3295,6 +3315,10 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display,
while (xwindow)
{
xwindow_last = xwindow;
if (get_toplevel &&
(window = gdk_window_lookup_for_display (display, xwindow)) != NULL &&
GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
break;
gdk_error_trap_push ();
XQueryPointer (xdisplay, xwindow,
&root, &xwindow, &rootx, &rooty, &winx, &winy, &xmask);
@@ -3424,9 +3448,6 @@ do_shape_combine_region (GdkWindow *window,
? gdk_display_supports_shapes (GDK_WINDOW_DISPLAY (window))
: gdk_display_supports_input_shapes (GDK_WINDOW_DISPLAY (window)))
{
if (shape == ShapeBounding)
private->shaped = FALSE;
if (shape == ShapeBounding)
{
_gdk_x11_window_tmp_unset_parent_bg (window);
@@ -3454,9 +3475,6 @@ do_shape_combine_region (GdkWindow *window,
gint n_rects = 0;
XRectangle *xrects = NULL;
if (shape == ShapeBounding)
private->shaped = TRUE;
_gdk_region_get_xrectangles (shape_region,
0, 0,
&xrects, &n_rects);
@@ -5513,7 +5531,6 @@ _gdk_windowing_window_set_composited (GdkWindow *window,
{
#if defined(HAVE_XCOMPOSITE) && defined(HAVE_XDAMAGE) && defined (HAVE_XFIXES)
GdkWindowObject *private = (GdkWindowObject *) window;
GdkDisplayX11 *x11_display;
GdkWindowImplX11 *impl;
GdkDisplay *display;
Display *dpy;
@@ -5522,7 +5539,6 @@ _gdk_windowing_window_set_composited (GdkWindow *window,
impl = GDK_WINDOW_IMPL_X11 (private->impl);
display = gdk_screen_get_display (GDK_DRAWABLE_IMPL_X11 (impl)->screen);
x11_display = GDK_DISPLAY_X11 (display);
dpy = GDK_DISPLAY_XDISPLAY (display);
xid = GDK_WINDOW_XWINDOW (private);
@@ -5568,6 +5584,7 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface)
iface->raise = gdk_window_x11_raise;
iface->lower = gdk_window_x11_lower;
iface->restack_under = gdk_window_x11_restack_under;
iface->restack_toplevel = gdk_window_x11_restack_toplevel;
iface->move_resize = gdk_window_x11_move_resize;
iface->set_background = gdk_window_x11_set_background;
iface->set_back_pixmap = gdk_window_x11_set_back_pixmap;
+4 -2
View File
@@ -40,6 +40,8 @@ extern Display *gdk_display;
Display *gdk_x11_drawable_get_xdisplay (GdkDrawable *drawable);
XID gdk_x11_drawable_get_xid (GdkDrawable *drawable);
GdkDrawable *gdk_x11_window_get_drawable_impl (GdkWindow *window);
GdkDrawable *gdk_x11_pixmap_get_drawable_impl (GdkPixmap *pixmap);
Display *gdk_x11_image_get_xdisplay (GdkImage *image);
XImage *gdk_x11_image_get_ximage (GdkImage *image);
Display *gdk_x11_colormap_get_xdisplay (GdkColormap *colormap);
@@ -105,10 +107,10 @@ gint gdk_x11_get_default_screen (void);
#define GDK_DISPLAY_XDISPLAY(display) (gdk_x11_display_get_xdisplay (display))
#define GDK_WINDOW_XDISPLAY(win) (gdk_x11_drawable_get_xdisplay (((GdkWindowObject *)win)->impl))
#define GDK_WINDOW_XDISPLAY(win) (gdk_x11_drawable_get_xdisplay (gdk_x11_window_get_drawable_impl (win)))
#define GDK_WINDOW_XID(win) (gdk_x11_drawable_get_xid (win))
#define GDK_WINDOW_XWINDOW(win) (gdk_x11_drawable_get_xid (win))
#define GDK_PIXMAP_XDISPLAY(win) (gdk_x11_drawable_get_xdisplay (((GdkPixmapObject *)win)->impl))
#define GDK_PIXMAP_XDISPLAY(win) (gdk_x11_drawable_get_xdisplay (gdk_x11_pixmap_get_drawable_impl (win)))
#define GDK_PIXMAP_XID(win) (gdk_x11_drawable_get_xid (win))
#define GDK_DRAWABLE_XDISPLAY(win) (gdk_x11_drawable_get_xdisplay (win))
#define GDK_DRAWABLE_XID(win) (gdk_x11_drawable_get_xid (win))
+11 -7
View File
@@ -77,14 +77,16 @@ _gdk_xid_table_remove (GdkDisplay *display,
g_hash_table_remove (display_x11->xid_ht, &xid);
}
/**
/**
* gdk_xid_table_lookup_for_display:
* @display: the #GdkDisplay.
* @xid: an X id.
*
* Returns the GDK object associated with the given X id.
*
* Returns: a GDK object associated with the given X id.
* Return value: the associated Gdk object, which may be a #GdkPixmap,
* a #GdkWindow or a #GdkFont or %NULL if no object is associated
* with the X id.
*
* Since: 2.2
*/
@@ -109,12 +111,14 @@ gdk_xid_table_lookup_for_display (GdkDisplay *display,
/**
* gdk_xid_table_lookup:
* @xid: an X id.
*
* Returns the Gdk object associated with the given X id.
*
*
* Returns the Gdk object associated with the given X id for the default
* display.
*
* Return value: the associated Gdk object, which may be a #GdkPixmap,
* a #GdkWindow or a #GdkFont.
**/
* a #GdkWindow or a #GdkFont or %NULL if no object is associated
* with the X id.
*/
gpointer
gdk_xid_table_lookup (XID xid)
{
+8
View File
@@ -3294,6 +3294,7 @@ gtk_radio_tool_button_set_group
#if IN_FILE(__GTK_RANGE_C__)
gtk_range_get_adjustment
gtk_range_get_fill_level
gtk_range_get_flippable
gtk_range_get_inverted
gtk_range_get_lower_stepper_sensitivity
gtk_range_get_restrict_to_fill_level
@@ -3304,6 +3305,7 @@ gtk_range_get_upper_stepper_sensitivity
gtk_range_get_value
gtk_range_set_adjustment
gtk_range_set_fill_level
gtk_range_set_flippable
gtk_range_set_increments
gtk_range_set_inverted
gtk_range_set_lower_stepper_sensitivity
@@ -4988,6 +4990,7 @@ gtk_widget_get_pango_context
gtk_widget_get_parent
gtk_widget_get_parent_window
gtk_widget_get_pointer
gtk_widget_get_receives_default
gtk_widget_get_root_window
gtk_widget_get_screen
gtk_widget_get_sensitive
@@ -5016,6 +5019,8 @@ gtk_widget_intersect
gtk_widget_is_ancestor
gtk_widget_is_focus
gtk_widget_is_sensitive
gtk_widget_is_toplevel
gtk_widget_is_drawable
gtk_widget_keynav_failed
gtk_widget_list_accel_closures
gtk_widget_list_mnemonic_labels
@@ -5058,6 +5063,7 @@ gtk_widget_reset_rc_styles
gtk_widget_reset_shapes
gtk_widget_send_expose
gtk_widget_set_accel_path
gtk_widget_set_allocation
gtk_widget_set_app_paintable
gtk_widget_set_child_visible
gtk_widget_set_colormap
@@ -5073,6 +5079,7 @@ gtk_widget_set_name
gtk_widget_set_no_show_all
gtk_widget_set_parent
gtk_widget_set_parent_window
gtk_widget_set_receives_default
gtk_widget_set_redraw_on_allocate
gtk_widget_set_scroll_adjustments
gtk_widget_set_sensitive
@@ -5083,6 +5090,7 @@ gtk_widget_set_tooltip_markup
gtk_widget_set_tooltip_text
gtk_widget_set_tooltip_window
gtk_widget_set_visible
gtk_widget_set_window
gtk_widget_shape_combine_mask
gtk_widget_input_shape_combine_mask
gtk_widget_show
+10 -3
View File
@@ -380,7 +380,12 @@ parse_object (GMarkupParseContext *context,
data->inside_requested_object = TRUE;
}
else
return;
{
g_free (object_class);
g_free (object_id);
g_free (constructor);
return;
}
}
object_info = g_slice_new0 (ObjectInfo);
@@ -404,7 +409,8 @@ parse_object (GMarkupParseContext *context,
return;
}
g_hash_table_insert (data->object_ids, object_id, GINT_TO_POINTER (line));
g_hash_table_insert (data->object_ids, g_strdup (object_id), GINT_TO_POINTER (line));
}
static void
@@ -1128,7 +1134,8 @@ _gtk_builder_parser_parse_buffer (GtkBuilder *builder,
data->builder = builder;
data->filename = filename;
data->domain = g_strdup (domain);
data->object_ids = g_hash_table_new (g_str_hash, g_str_equal);
data->object_ids = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify)g_free, NULL);
data->requested_objects = NULL;
if (requested_objs)
+8 -4
View File
@@ -887,10 +887,12 @@ gtk_cell_renderer_set_visible (GtkCellRenderer *cell,
*
* Returns the cell renderer's visibility.
*
* Returns: %TRUE if the cell renderer is visible
*
* Since: 2.18
**/
*/
gboolean
gtk_cell_renderer_get_visible (GtkCellRenderer *cell)
gtk_cell_renderer_get_visible (GtkCellRenderer *cell)
{
g_return_val_if_fail (GTK_IS_CELL_RENDERER (cell), FALSE);
@@ -925,10 +927,12 @@ gtk_cell_renderer_set_sensitive (GtkCellRenderer *cell,
*
* Returns the cell renderer's sensitivity.
*
* Returns: %TRUE if the cell renderer is sensitive
*
* Since: 2.18
**/
*/
gboolean
gtk_cell_renderer_get_sensitive (GtkCellRenderer *cell)
gtk_cell_renderer_get_sensitive (GtkCellRenderer *cell)
{
g_return_val_if_fail (GTK_IS_CELL_RENDERER (cell), FALSE);
+5
View File
@@ -24,6 +24,7 @@
#include "gtkcellrendereraccel.h"
#include "gtklabel.h"
#include "gtkeventbox.h"
#include "gtkmain.h"
#include "gtkprivate.h"
#include "gdk/gdkkeysyms.h"
#include "gtkalias.h"
@@ -470,6 +471,7 @@ grab_key_callback (GtkWidget *widget,
edited = TRUE;
out:
gtk_grab_remove (accel->grab_widget);
gdk_display_keyboard_ungrab (display, event->time);
gdk_display_pointer_ungrab (display, event->time);
@@ -497,6 +499,7 @@ ungrab_stuff (GtkWidget *widget,
{
GdkDisplay *display = gtk_widget_get_display (widget);
gtk_grab_remove (accel->grab_widget);
gdk_display_keyboard_ungrab (display, GDK_CURRENT_TIME);
gdk_display_pointer_ungrab (display, GDK_CURRENT_TIME);
@@ -606,6 +609,8 @@ gtk_cell_renderer_accel_start_editing (GtkCellRenderer *cell,
gtk_widget_show_all (accel->edit_widget);
gtk_grab_add (accel->grab_widget);
g_signal_connect (G_OBJECT (accel->edit_widget), "unrealize",
G_CALLBACK (ungrab_stuff), accel);
+19
View File
@@ -271,6 +271,21 @@ gtk_cell_renderer_spin_key_press_event (GtkWidget *widget,
return FALSE;
}
static gboolean
gtk_cell_renderer_spin_button_press_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
/* Block 2BUTTON and 3BUTTON here, so that they won't be eaten
* by tree view.
*/
if (event->type == GDK_2BUTTON_PRESS
|| event->type == GDK_3BUTTON_PRESS)
return TRUE;
return FALSE;
}
static GtkCellEditable *
gtk_cell_renderer_spin_start_editing (GtkCellRenderer *cell,
GdkEvent *event,
@@ -296,6 +311,10 @@ gtk_cell_renderer_spin_start_editing (GtkCellRenderer *cell,
spin = gtk_spin_button_new (priv->adjustment,
priv->climb_rate, priv->digits);
g_signal_connect (spin, "button-press-event",
G_CALLBACK (gtk_cell_renderer_spin_button_press_event),
NULL);
if (cell_text->text)
gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin),
g_ascii_strtod (cell_text->text, NULL));
+1 -1
View File
@@ -349,7 +349,7 @@ gtk_cell_renderer_toggle_render (GtkCellRenderer *cell,
else
shadow = celltoggle->active ? GTK_SHADOW_IN : GTK_SHADOW_OUT;
if (!cell->sensitive)
if (GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE || !cell->sensitive)
{
state = GTK_STATE_INSENSITIVE;
}
+2
View File
@@ -438,6 +438,8 @@ gtk_cell_view_expose (GtkWidget *widget,
if (GTK_WIDGET_STATE (widget) == GTK_STATE_PRELIGHT)
state = GTK_CELL_RENDERER_PRELIT;
else if (GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE)
state = GTK_CELL_RENDERER_INSENSITIVE;
else
state = 0;
+8 -2
View File
@@ -5925,8 +5925,14 @@ draw_rows (GtkCList *clist,
}
if (!area)
gdk_window_clear_area (clist->clist_window, 0,
ROW_TOP_YPIXEL (clist, i), 0, 0);
{
int w, h, y;
gdk_drawable_get_size (GDK_DRAWABLE (clist->clist_window), &w, &h);
y = ROW_TOP_YPIXEL (clist, i);
gdk_window_clear_area (clist->clist_window,
0, y,
w, h - y);
}
}
static void
+10
View File
@@ -379,6 +379,8 @@ static gboolean gtk_combo_box_menu_button_press (GtkWidget *widget,
gpointer user_data);
static void gtk_combo_box_menu_item_activate (GtkWidget *item,
gpointer user_data);
static void gtk_combo_box_update_sensitivity (GtkComboBox *combo_box);
static void gtk_combo_box_menu_row_inserted (GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
@@ -2862,6 +2864,7 @@ gtk_combo_box_menu_setup (GtkComboBox *combo_box,
gtk_combo_box_sync_cells (combo_box, GTK_CELL_LAYOUT (priv->column));
gtk_combo_box_update_title (combo_box);
gtk_combo_box_update_sensitivity (combo_box);
}
static void
@@ -3215,6 +3218,11 @@ gtk_combo_box_update_sensitivity (GtkComboBox *combo_box)
}
gtk_widget_set_sensitive (combo_box->priv->button, sensitive);
/* In list-mode, we also need to update sensitivity of the event box */
if (GTK_IS_TREE_VIEW (combo_box->priv->tree_view)
&& combo_box->priv->cell_view)
gtk_widget_set_sensitive (combo_box->priv->box, sensitive);
}
static void
@@ -3755,6 +3763,8 @@ gtk_combo_box_list_setup (GtkComboBox *combo_box)
combo_box);
gtk_widget_show (priv->tree_view);
gtk_combo_box_update_sensitivity (combo_box);
}
static void
+3 -2
View File
@@ -368,9 +368,10 @@ void
gtk_combo_box_entry_set_text_column (GtkComboBoxEntry *entry_box,
gint text_column)
{
GtkTreeModel *model = gtk_combo_box_get_model (GTK_COMBO_BOX (entry_box));
g_return_if_fail (text_column >= 0);
g_return_if_fail (text_column < gtk_tree_model_get_n_columns (gtk_combo_box_get_model (GTK_COMBO_BOX (entry_box))));
g_return_if_fail (entry_box->priv->text_column == -1);
g_return_if_fail (model == NULL || text_column < gtk_tree_model_get_n_columns (model));
entry_box->priv->text_column = text_column;
+3 -6
View File
@@ -375,14 +375,11 @@ _gtk_custom_paper_unix_dialog_new (GtkWindow *parent,
result = g_object_new (GTK_TYPE_CUSTOM_PAPER_UNIX_DIALOG,
"title", title,
"transient-for", parent,
"modal", parent != NULL,
"destroy-with-parent", TRUE,
NULL);
if (parent)
{
gtk_window_set_modal (GTK_WINDOW (result), TRUE);
gtk_window_set_transient_for (GTK_WINDOW (result), parent);
}
return result;
}
+96 -38
View File
@@ -63,6 +63,11 @@ static GtkDragDestInfo *gtk_drag_get_dest_info (GdkDragContext *context,
gboolean create);
static void gtk_drag_source_site_destroy (gpointer data);
static GtkDragSourceInfo *gtk_drag_get_source_info (GdkDragContext *context,
gboolean create);
extern GdkDragContext *gdk_quartz_drag_source_context (); /* gdk/quartz/gdkdnd-quartz.c */
struct _GtkDragSourceSite
{
GdkModifierType start_button_mask;
@@ -89,13 +94,16 @@ struct _GtkDragSourceSite
struct _GtkDragSourceInfo
{
GtkWidget *source_widget;
GtkWidget *widget;
GtkTargetList *target_list; /* Targets for drag data */
GdkDragAction possible_actions; /* Actions allowed by source */
GdkDragContext *context; /* drag context */
NSEvent *nsevent; /* what started it */
gint hot_x, hot_y; /* Hot spot for drag */
GdkPixbuf *icon_pixbuf;
gboolean success;
gboolean delete;
};
struct _GtkDragDestSite
@@ -233,19 +241,24 @@ gtk_drag_get_data (GtkWidget *widget,
}
}
GtkWidget *
gtk_drag_get_source_widget (GdkDragContext *context)
{
return NULL;
}
void
gtk_drag_finish (GdkDragContext *context,
gboolean success,
gboolean del,
guint32 time)
{
GtkDragSourceInfo *info;
GdkDragContext* source_context = gdk_quartz_drag_source_context ();
if (source_context)
{
info = gtk_drag_get_source_info (source_context, FALSE);
if (info)
{
info->success = success;
info->delete = del;
}
}
}
static void
@@ -307,6 +320,22 @@ gtk_drag_clear_source_info (GdkDragContext *context)
g_object_set_qdata (G_OBJECT (context), dest_info_quark, NULL);
}
GtkWidget *
gtk_drag_get_source_widget (GdkDragContext *context)
{
GtkDragSourceInfo *info;
GdkDragContext* real_source_context = gdk_quartz_drag_source_context();
if (!real_source_context)
return NULL;
info = gtk_drag_get_source_info (real_source_context, FALSE);
if (!info)
return NULL;
return info->source_widget;
}
/*************************************************************
* gtk_drag_highlight_expose:
* Callback for expose_event for highlighted widgets.
@@ -1031,6 +1060,45 @@ gtk_drag_dest_find_target (GtkWidget *widget,
return GDK_NONE;
}
static gboolean
gtk_drag_begin_idle (gpointer arg)
{
GdkDragContext* context = (GdkDragContext*) arg;
GtkDragSourceInfo* info = gtk_drag_get_source_info (context, FALSE);
NSWindow *nswindow;
NSPasteboard *pasteboard;
GtkDragSourceOwner *owner;
NSPoint point;
g_assert (info != NULL);
pasteboard = [NSPasteboard pasteboardWithName:NSDragPboard];
owner = [[GtkDragSourceOwner alloc] initWithInfo:info];
[pasteboard declareTypes:_gtk_quartz_target_list_to_pasteboard_types (info->target_list) owner:owner];
if ((nswindow = get_toplevel_nswindow (info->source_widget)) == NULL)
return FALSE;
/* Ref the context. It's unreffed when the drag has been aborted */
g_object_ref (info->context);
/* FIXME: If the event isn't a mouse event, use the global cursor position instead */
point = [info->nsevent locationInWindow];
[nswindow dragImage:_gtk_quartz_create_image_from_pixbuf (info->icon_pixbuf)
at:point
offset:NSMakeSize(0, 0)
event:info->nsevent
pasteboard:pasteboard
source:nswindow
slideBack:YES];
[info->nsevent release];
return FALSE;
}
static GdkDragContext *
gtk_drag_begin_internal (GtkWidget *widget,
GtkDragSourceSite *site,
@@ -1042,16 +1110,13 @@ gtk_drag_begin_internal (GtkWidget *widget,
GtkDragSourceInfo *info;
GdkDragContext *context;
NSWindow *nswindow;
NSPasteboard *pasteboard;
GtkDragSourceOwner *owner;
NSEvent *nsevent;
NSPoint point;
context = gdk_drag_begin (NULL, NULL);
context->is_source = TRUE;
info = gtk_drag_get_source_info (context, TRUE);
info->source_widget = g_object_ref (widget);
info->widget = g_object_ref (widget);
info->target_list = target_list;
gtk_target_list_ref (target_list);
@@ -1086,13 +1151,13 @@ gtk_drag_begin_internal (GtkWidget *widget,
GdkPixbuf *pixbuf;
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, 1, 1);
gdk_pixbuf_fill (pixbuf, 0xffffff);
gtk_drag_set_icon_pixbuf (context,
pixbuf,
gdk_pixbuf_fill (pixbuf, 0xffffff);
gtk_drag_set_icon_pixbuf (context,
pixbuf,
0, 0);
g_object_unref (pixbuf);
g_object_unref (pixbuf);
}
break;
case GTK_IMAGE_PIXBUF:
@@ -1117,31 +1182,17 @@ gtk_drag_begin_internal (GtkWidget *widget,
}
}
gdk_pointer_ungrab (0);
pasteboard = [NSPasteboard pasteboardWithName:NSDragPboard];
owner = [[GtkDragSourceOwner alloc] initWithInfo:info];
[pasteboard declareTypes:_gtk_quartz_target_list_to_pasteboard_types (target_list) owner:owner];
/* Ref the context. It's unreffed when the drag has been aborted */
g_object_ref (info->context);
nswindow = get_toplevel_nswindow (widget);
info->nsevent = [nswindow currentEvent];
[info->nsevent retain];
/* FIXME: If the event isn't a mouse event, use the global cursor position instead */
nsevent = [nswindow currentEvent];
point = [nsevent locationInWindow];
/* drag will begin in an idle handler to avoid nested run loops */
[nswindow dragImage:_gtk_quartz_create_image_from_pixbuf (info->icon_pixbuf)
at:point
offset:NSMakeSize(0, 0)
event:nsevent
pasteboard:pasteboard
source:nswindow
slideBack:YES];
g_idle_add_full (G_PRIORITY_HIGH_IDLE, gtk_drag_begin_idle, context, NULL);
return info->context;
gdk_pointer_ungrab (0);
return context;
}
GdkDragContext *
@@ -1773,6 +1824,9 @@ gtk_drag_source_info_destroy (GtkDragSourceInfo *info)
g_signal_emit_by_name (info->widget, "drag-end",
info->context);
if (info->source_widget)
g_object_unref (info->source_widget);
if (info->widget)
g_object_unref (info->widget);
@@ -1794,6 +1848,10 @@ drag_drop_finished_idle_cb (gpointer data)
static void
gtk_drag_drop_finished (GtkDragSourceInfo *info)
{
if (info->success && info->delete)
g_signal_emit_by_name (info->source_widget, "drag-data-delete",
info->context);
/* Workaround for the fact that the NS API blocks until the drag is
* over. This way the context is still valid when returning from
* drag_begin, even if it will still be quite useless. See bug #501588.

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