Compare commits

...

126 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
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
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
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
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
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
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
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
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
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
247 changed files with 25059 additions and 22839 deletions
+46 -2
View File
@@ -1,5 +1,49 @@
Overview of Changes from GTK+ 2.17.11 to 2.17.12
================================================
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
+5
View File
@@ -44,6 +44,11 @@ Release notes for 2.18
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
======================
+2 -2
View File
@@ -12,8 +12,8 @@ AC_PREREQ(2.54)
m4_define([gtk_major_version], [2])
m4_define([gtk_minor_version], [18])
m4_define([gtk_micro_version], [0])
m4_define([gtk_interface_age], [0])
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],
+20
View File
@@ -2099,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;
}
+4 -20
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 */
@@ -913,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
@@ -1060,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 */
+2 -2
View File
@@ -185,7 +185,6 @@ typedef struct
gboolean activated;
gboolean implicit_ungrab;
gboolean grab_one_pointer_release_event;
} GdkPointerGrabInfo;
typedef struct _GdkInputWindow GdkInputWindow;
@@ -461,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,
+74 -29
View File
@@ -468,10 +468,11 @@ gdk_window_class_init (GdkWindowObjectClass *klass)
/* Properties */
g_object_class_install_property (object_class,
PROP_CURSOR,
g_param_spec_pointer ("cursor",
P_("Cursor"),
P_("Cursor"),
G_PARAM_READWRITE));
g_param_spec_boxed ("cursor",
P_("Cursor"),
P_("Cursor"),
GDK_TYPE_CURSOR,
G_PARAM_READWRITE));
/**
* GdkWindow::pick-embedded-child:
@@ -612,7 +613,7 @@ gdk_window_set_property (GObject *object,
switch (prop_id)
{
case PROP_CURSOR:
gdk_window_set_cursor (window, g_value_get_pointer (value));
gdk_window_set_cursor (window, g_value_get_boxed (value));
break;
default:
@@ -632,7 +633,7 @@ gdk_window_get_property (GObject *object,
switch (prop_id)
{
case PROP_CURSOR:
g_value_set_pointer (value, gdk_window_get_cursor (window));
g_value_set_boxed (value, gdk_window_get_cursor (window));
break;
default:
@@ -1162,28 +1163,64 @@ get_native_event_mask (GdkWindowObject *private)
return private->event_mask;
else
{
return
/* We need thse for all native window so we can emulate
events on children: */
GdkEventMask mask;
/* Do whatever the app asks to, since the app
* may be asking for weird things for native windows,
* but filter out things that override the special
* requests below. */
mask = private->event_mask &
~(GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_MOTION_MASK |
GDK_BUTTON1_MOTION_MASK |
GDK_BUTTON2_MOTION_MASK |
GDK_BUTTON3_MOTION_MASK);
/* We need thse for all native windows so we can
emulate events on children: */
mask |=
GDK_EXPOSURE_MASK |
GDK_VISIBILITY_NOTIFY_MASK |
GDK_POINTER_MOTION_MASK |
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
GDK_SCROLL_MASK |
/* Then do whatever the app asks to, since the app
* may be asking for weird things for native windows,
* but filter out things that override the above
* requests somehow. */
(private->event_mask &
~(GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_MOTION_MASK |
GDK_BUTTON1_MOTION_MASK |
GDK_BUTTON2_MOTION_MASK |
GDK_BUTTON3_MOTION_MASK));
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK;
/* Additionally we select for pointer and button events
* for toplevels as we need to get these to emulate
* them for non-native subwindows. Even though we don't
* select on them for all native windows we will get them
* as the events are propagated out to the first window
* that select for them.
* Not selecting for button press on all windows is an
* important thing, because in X only one client can do
* so, and we don't want to unexpectedly prevent another
* client from doing it.
*/
if (gdk_window_is_toplevel (private))
mask |=
GDK_POINTER_MOTION_MASK |
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_SCROLL_MASK;
return mask;
}
}
static GdkEventMask
get_native_grab_event_mask (GdkEventMask grab_mask)
{
/* Similar to the above but for pointer events only */
return
GDK_POINTER_MOTION_MASK |
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
GDK_SCROLL_MASK |
(grab_mask &
~(GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_MOTION_MASK |
GDK_BUTTON1_MOTION_MASK |
GDK_BUTTON2_MOTION_MASK |
GDK_BUTTON3_MOTION_MASK));
}
/* Puts the native window in the right order wrt the other native windows
* in the hierarchy, given the position it has in the client side data.
* This is useful if some operation changed the stacking order.
@@ -5023,12 +5060,17 @@ _gdk_window_process_updates_recurse (GdkWindow *window,
g_object_unref (window);
}
else if (private->bg_pixmap != GDK_NO_BG)
else if (private->bg_pixmap != GDK_NO_BG &&
private->window_type != GDK_WINDOW_FOREIGN)
{
/* No exposure mask set, so nothing will be drawn, the
* app relies on the background being what it specified
* for the window. So, we need to clear this manually.
*
* For foreign windows if expose is not set that generally
* means some other client paints them, so don't clear
* there.
*
* We use begin/end_paint around the clear so that we can
* piggyback on the implicit paint */
@@ -5066,8 +5108,7 @@ gdk_window_process_updates_internal (GdkWindow *window)
GdkRegion *update_area = private->update_area;
private->update_area = NULL;
if (_gdk_event_func && gdk_window_is_viewable (window) &&
private->window_type != GDK_WINDOW_FOREIGN)
if (_gdk_event_func && gdk_window_is_viewable (window))
{
GdkRegion *expose_region;
gboolean end_implicit;
@@ -9560,7 +9601,7 @@ gdk_pointer_grab (GdkWindow * window,
res = _gdk_windowing_pointer_grab (window,
native,
owner_events,
event_mask,
get_native_grab_event_mask (event_mask),
confine_to,
cursor,
time);
@@ -9945,6 +9986,7 @@ proxy_button_event (GdkEvent *source_event,
&toplevel_x, &toplevel_y);
if (type == GDK_BUTTON_PRESS &&
!source_event->any.send_event &&
_gdk_display_has_pointer_grab (display, serial) == NULL)
{
pointer_window =
@@ -10154,6 +10196,7 @@ _gdk_windowing_got_event (GdkDisplay *display,
if (_gdk_native_windows)
{
if (event->type == GDK_BUTTON_PRESS &&
!event->any.send_event &&
_gdk_display_has_pointer_grab (display, serial) == NULL)
{
_gdk_display_add_pointer_grab (display,
@@ -10167,7 +10210,8 @@ _gdk_windowing_got_event (GdkDisplay *display,
_gdk_display_pointer_grab_update (display,
serial);
}
if (event->type == GDK_BUTTON_RELEASE)
if (event->type == GDK_BUTTON_RELEASE &&
!event->any.send_event)
{
button_release_grab =
_gdk_display_has_pointer_grab (display, serial);
@@ -10290,7 +10334,8 @@ _gdk_windowing_got_event (GdkDisplay *display,
unlink_event = proxy_button_event (event,
serial);
if (event->type == GDK_BUTTON_RELEASE)
if (event->type == GDK_BUTTON_RELEASE &&
!event->any.send_event)
{
button_release_grab =
_gdk_display_has_pointer_grab (display, serial);
+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)
+34 -2
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;
@@ -564,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.
*/
@@ -574,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;
}
+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);
+95 -5
View File
@@ -654,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 *
@@ -747,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 ();
}
@@ -960,7 +1030,6 @@ _gdk_windowing_window_init (void)
GdkWindowObject *private;
GdkWindowImplQuartz *impl;
GdkDrawableImplQuartz *drawable_impl;
NSRect rect;
g_assert (_gdk_root == NULL);
@@ -1869,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;
@@ -1907,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;
}
+7 -1
View File
@@ -2261,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;
@@ -2283,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);
+138 -58
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,7 +431,26 @@ 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)
{
@@ -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,
+9 -8
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);
@@ -280,18 +279,19 @@ _gdk_input_other_event (GdkEvent *event,
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
@@ -369,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;
+2
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);
+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 */
+11 -2
View File
@@ -1726,7 +1726,7 @@ gdk_window_x11_restack_toplevel (GdkWindow *window,
changes.stack_mode = above ? Above : Below;
XReconfigureWMWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
GDK_WINDOW_SCREEN (window),
gdk_screen_get_number (GDK_WINDOW_SCREEN (window)),
CWStackMode | CWSibling, &changes);
}
@@ -3215,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;
@@ -3251,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);
}
@@ -3310,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);
+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.
+659 -2300
View File
File diff suppressed because it is too large Load Diff
+2 -66
View File
@@ -194,17 +194,13 @@ struct _GtkFileChooserDefault
GtkWidget *search_entry;
GtkSearchEngine *search_engine;
GtkQuery *search_query;
GtkListStore *search_model;
GtkTreeModelFilter *search_model_filter;
GtkTreeModelSort *search_model_sort;
GtkFileSystemModel *search_model;
/* OPERATION_MODE_RECENT */
GtkWidget *recent_hbox;
GtkRecentManager *recent_manager;
GtkListStore *recent_model;
GtkFileSystemModel *recent_model;
guint load_recent_id;
GtkTreeModelFilter *recent_model_filter;
GtkTreeModelSort *recent_model_sort;
GtkWidget *filter_combo_hbox;
GtkWidget *filter_combo;
@@ -232,14 +228,11 @@ struct _GtkFileChooserDefault
*/
GtkTreeModel *shortcuts_combo_filter_model;
GtkTreeModelSort *sort_model;
/* Handles */
GSList *loading_shortcuts;
GSList *reload_icon_cancellables;
GCancellable *file_list_drag_data_received_cancellable;
GCancellable *update_current_folder_cancellable;
GCancellable *show_and_select_files_cancellable;
GCancellable *should_respond_get_info_cancellable;
GCancellable *file_exists_get_info_cancellable;
GCancellable *update_from_entry_cancellable;
@@ -316,63 +309,6 @@ struct _GtkFileChooserDefault
};
/* GtkFileSystemModel private */
typedef struct _FileModelNode FileModelNode;
struct _GtkFileSystemModel
{
GObject parent_instance;
GtkFileSystem *file_system;
gchar *attributes;
FileModelNode *roots;
GtkFolder *root_folder;
GFile *root_file;
GtkFileSystemModelFilter filter_func;
gpointer filter_data;
GSList *idle_clears;
GSource *idle_clear_source;
gushort max_depth;
GSList *pending_cancellables;
guint show_hidden : 1;
guint show_folders : 1;
guint show_files : 1;
guint folders_only : 1;
guint has_editable : 1;
};
struct _FileModelNode
{
GFile *file;
FileModelNode *next;
GFileInfo *info;
GtkFolder *folder;
FileModelNode *children;
FileModelNode *parent;
GtkFileSystemModel *model;
guint ref_count;
guint n_referenced_children;
gushort depth;
guint has_dummy : 1;
guint is_dummy : 1;
guint is_visible : 1;
guint loaded : 1;
guint idle_clear : 1;
guint load_pending : 1;
};
G_END_DECLS
#endif /* __GTK_FILE_CHOOSER_PRIVATE_H__ */
+1636 -1610
View File
File diff suppressed because it is too large Load Diff
+42 -29
View File
@@ -21,7 +21,8 @@
#ifndef __GTK_FILE_SYSTEM_MODEL_H__
#define __GTK_FILE_SYSTEM_MODEL_H__
#include "gtkfilesystem.h"
#include <gio/gio.h>
#include <gtk/gtkfilefilter.h>
#include <gtk/gtktreemodel.h>
G_BEGIN_DECLS
@@ -34,46 +35,58 @@ typedef struct _GtkFileSystemModel GtkFileSystemModel;
GType _gtk_file_system_model_get_type (void) G_GNUC_CONST;
typedef enum {
GTK_FILE_SYSTEM_MODEL_INFO,
GTK_FILE_SYSTEM_MODEL_DISPLAY_NAME,
GTK_FILE_SYSTEM_MODEL_N_COLUMNS
} GtkFileSystemModelColumns;
typedef gboolean (*GtkFileSystemModelGetValue) (GtkFileSystemModel *model,
GFile *file,
GFileInfo *info,
int column,
GValue *value,
gpointer user_data);
GtkFileSystemModel *_gtk_file_system_model_new (GtkFileSystem *file_system,
GFile *root_file,
gint max_depth,
const gchar *attributes,
GError **error);
GtkFileSystemModel *_gtk_file_system_model_new (GtkFileSystemModelGetValue get_func,
gpointer get_data,
guint n_columns,
...);
GtkFileSystemModel *_gtk_file_system_model_new_for_directory(GFile * dir,
const gchar * attributes,
GtkFileSystemModelGetValue get_func,
gpointer get_data,
guint n_columns,
...);
GCancellable * _gtk_file_system_model_get_cancellable (GtkFileSystemModel *model);
gboolean _gtk_file_system_model_iter_is_visible (GtkFileSystemModel *model,
GtkTreeIter *iter);
GFileInfo * _gtk_file_system_model_get_info (GtkFileSystemModel *model,
GtkTreeIter *iter);
gboolean _gtk_file_system_model_get_iter_for_file(GtkFileSystemModel *model,
GtkTreeIter *iter,
GFile *file);
GFile * _gtk_file_system_model_get_file (GtkFileSystemModel *model,
GtkTreeIter *iter);
const GValue * _gtk_file_system_model_get_value (GtkFileSystemModel *model,
GtkTreeIter * iter,
int column);
void _gtk_file_system_model_add_and_query_file (GtkFileSystemModel *model,
GFile *file,
const char *attributes);
void _gtk_file_system_model_update_file (GtkFileSystemModel *model,
GFile *file,
GFileInfo *info,
gboolean requires_resort);
void _gtk_file_system_model_set_show_hidden (GtkFileSystemModel *model,
gboolean show_hidden);
void _gtk_file_system_model_set_show_folders (GtkFileSystemModel *model,
gboolean show_folders);
void _gtk_file_system_model_set_show_files (GtkFileSystemModel *model,
gboolean show_files);
void _gtk_file_system_model_freeze_updates (GtkFileSystemModel *model);
void _gtk_file_system_model_thaw_updates (GtkFileSystemModel *model);
void _gtk_file_system_model_clear_cache (GtkFileSystemModel *model,
int column);
typedef gboolean (*GtkFileSystemModelFilter) (GtkFileSystemModel *model,
GFile *file,
GFileInfo *info,
gpointer user_data);
void _gtk_file_system_model_set_filter (GtkFileSystemModel *model,
GtkFileSystemModelFilter filter,
gpointer user_data);
typedef void (*GtkFileSystemModelPathFunc) (GtkFileSystemModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer user_data);
void _gtk_file_system_model_path_do (GtkFileSystemModel *model,
GFile *file,
GtkFileSystemModelPathFunc func,
gpointer user_data);
void _gtk_file_system_model_set_filter (GtkFileSystemModel *model,
GtkFileFilter *filter);
void _gtk_file_system_model_add_editable (GtkFileSystemModel *model,
GtkTreeIter *iter);
+7 -7
View File
@@ -3469,6 +3469,9 @@ gtk_icon_view_get_item_at_coords (GtkIconView *icon_view,
GList *items, *l;
GdkRectangle box;
if (cell_at_pos)
*cell_at_pos = NULL;
for (items = icon_view->priv->items; items; items = items->next)
{
GtkIconViewItem *item = items->data;
@@ -3483,12 +3486,12 @@ gtk_icon_view_get_item_at_coords (GtkIconView *icon_view,
for (l = icon_view->priv->cell_list; l; l = l->next)
{
GtkIconViewCellInfo *info = (GtkIconViewCellInfo *)l->data;
if (!info->cell->visible)
continue;
gtk_icon_view_get_cell_box (icon_view, item, info, &box);
if ((x >= box.x && x <= box.x + box.width &&
y >= box.y && y <= box.y + box.height) ||
(x >= box.x &&
@@ -3498,14 +3501,11 @@ gtk_icon_view_get_item_at_coords (GtkIconView *icon_view,
{
if (cell_at_pos)
*cell_at_pos = info;
return item;
}
}
if (cell_at_pos)
*cell_at_pos = NULL;
if (only_in_cell)
return NULL;
}
+11
View File
@@ -686,6 +686,8 @@ do_post_parse_initialization (int *argc,
gettext_initialization ();
signal (SIGPIPE, SIG_IGN);
if (g_fatal_warnings)
{
GLogLevelFlags fatal_mask;
@@ -985,6 +987,15 @@ gtk_init_check (int *argc,
* the GUI for some reason. If you want your program to fall back to a
* textual interface you want to call gtk_init_check() instead.
* </para></note>
*
* <note><para>
* Since 2.18, GTK+ calls <literal>signal (SIGPIPE, SIG_IGN)</literal>
* 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.
* </para></note>
**/
void
gtk_init (int *argc, char ***argv)
+1
View File
@@ -111,3 +111,4 @@ VOID:UINT,STRING,UINT
VOID:UINT,UINT
VOID:VOID
OBJECT:OBJECT,INT,INT
VOID:POINTER,POINTER,POINTER,POINTER,STRING
+81 -83
View File
@@ -50,9 +50,8 @@ struct _GtkPrintBackendPrivate
guint printer_list_requested : 1;
guint printer_list_done : 1;
GtkPrintBackendStatus status;
char *hostname;
char *username;
char *password;
char **auth_info_required;
char **auth_info;
};
enum {
@@ -359,8 +358,10 @@ static GList * fallback_printer_list_papers (GtkPrinter
static GtkPageSetup * fallback_printer_get_default_page_size (GtkPrinter *printer);
static GtkPrintCapabilities fallback_printer_get_capabilities (GtkPrinter *printer);
static void request_password (GtkPrintBackend *backend,
const gchar *hostname,
const gchar *username,
gpointer auth_info_required,
gpointer auth_info_default,
gpointer auth_info_display,
gpointer auth_info_visible,
const gchar *prompt);
static void
@@ -441,8 +442,8 @@ gtk_print_backend_class_init (GtkPrintBackendClass *class)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkPrintBackendClass, request_password),
NULL, NULL,
_gtk_marshal_VOID__STRING_STRING_STRING,
G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
_gtk_marshal_VOID__POINTER_POINTER_POINTER_POINTER_STRING,
G_TYPE_NONE, 5, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_STRING);
}
static void
@@ -455,9 +456,8 @@ gtk_print_backend_init (GtkPrintBackend *backend)
priv->printers = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify) g_free,
(GDestroyNotify) g_object_unref);
priv->hostname = NULL;
priv->username = NULL;
priv->password = NULL;
priv->auth_info_required = NULL;
priv->auth_info = NULL;
}
static void
@@ -662,40 +662,29 @@ gtk_print_backend_print_stream (GtkPrintBackend *backend,
}
void
gtk_print_backend_set_password (GtkPrintBackend *backend,
const gchar *hostname,
const gchar *username,
const gchar *password)
gtk_print_backend_set_password (GtkPrintBackend *backend,
gchar **auth_info_required,
gchar **auth_info)
{
g_return_if_fail (GTK_IS_PRINT_BACKEND (backend));
if (GTK_PRINT_BACKEND_GET_CLASS (backend)->set_password)
GTK_PRINT_BACKEND_GET_CLASS (backend)->set_password (backend, hostname, username, password);
GTK_PRINT_BACKEND_GET_CLASS (backend)->set_password (backend, auth_info_required, auth_info);
}
static void
store_password (GtkEntry *entry,
GtkPrintBackend *backend)
store_entry (GtkEntry *entry,
gpointer user_data)
{
GtkPrintBackendPrivate *priv = backend->priv;
gchar **data = (gchar **) user_data;
if (priv->password != NULL)
if (*data != NULL)
{
memset (priv->password, 0, strlen (priv->password));
g_free (priv->password);
memset (*data, 0, strlen (*data));
g_free (*data);
}
priv->password = g_strdup (gtk_entry_get_text (entry));
}
static void
store_username (GtkEntry *entry,
GtkPrintBackend *backend)
{
GtkPrintBackendPrivate *priv = backend->priv;
g_free (priv->username);
priv->username = g_strdup (gtk_entry_get_text (entry));
*data = g_strdup (gtk_entry_get_text (entry));
}
static void
@@ -704,21 +693,24 @@ password_dialog_response (GtkWidget *dialog,
GtkPrintBackend *backend)
{
GtkPrintBackendPrivate *priv = backend->priv;
gint i;
if (response_id == GTK_RESPONSE_OK)
gtk_print_backend_set_password (backend, priv->hostname, priv->username, priv->password);
gtk_print_backend_set_password (backend, priv->auth_info_required, priv->auth_info);
else
gtk_print_backend_set_password (backend, priv->hostname, priv->username, NULL);
gtk_print_backend_set_password (backend, priv->auth_info_required, NULL);
if (priv->password != NULL)
{
memset (priv->password, 0, strlen (priv->password));
g_free (priv->password);
priv->password = NULL;
}
for (i = 0; i < g_strv_length (priv->auth_info_required); i++)
if (priv->auth_info[i] != NULL)
{
memset (priv->auth_info[i], 0, strlen (priv->auth_info[i]));
g_free (priv->auth_info[i]);
priv->auth_info[i] = NULL;
}
g_free (priv->auth_info);
priv->auth_info = NULL;
g_free (priv->username);
priv->username = NULL;
g_strfreev (priv->auth_info_required);
gtk_widget_destroy (dialog);
@@ -726,16 +718,27 @@ password_dialog_response (GtkWidget *dialog,
}
static void
request_password (GtkPrintBackend *backend,
const gchar *hostname,
const gchar *username,
const gchar *prompt)
request_password (GtkPrintBackend *backend,
gpointer auth_info_required,
gpointer auth_info_default,
gpointer auth_info_display,
gpointer auth_info_visible,
const gchar *prompt)
{
GtkPrintBackendPrivate *priv = backend->priv;
GtkWidget *dialog, *username_box, *password_box, *main_box, *label, *icon, *vbox,
*password_prompt, *username_prompt,
*password_entry, *username_entry;
GtkWidget *dialog, *box, *main_box, *label, *icon, *vbox, *entry;
GtkWidget *focus = NULL;
gchar *markup;
gint length;
gint i;
gchar **ai_required = (gchar **) auth_info_required;
gchar **ai_default = (gchar **) auth_info_default;
gchar **ai_display = (gchar **) auth_info_display;
gboolean *ai_visible = (gboolean *) auth_info_visible;
priv->auth_info_required = g_strdupv (ai_required);
length = g_strv_length (ai_required);
priv->auth_info = g_new0 (gchar *, length);
dialog = gtk_dialog_new_with_buttons ( _("Authentication"), NULL, GTK_DIALOG_MODAL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
@@ -766,27 +769,6 @@ request_password (GtkPrintBackend *backend,
g_free (markup);
/* Right - 2. */
username_box = gtk_hbox_new (TRUE, 0);
username_prompt = gtk_label_new (_("Username:"));
gtk_misc_set_alignment (GTK_MISC (username_prompt), 0.0, 0.5);
username_entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (username_entry), username);
/* Right - 3. */
password_box = gtk_hbox_new (TRUE, 0);
password_prompt = gtk_label_new (_("Password:"));
gtk_misc_set_alignment (GTK_MISC (password_prompt), 0.0, 0.5);
password_entry = gtk_entry_new ();
gtk_entry_set_visibility (GTK_ENTRY (password_entry), FALSE);
gtk_entry_set_activates_default (GTK_ENTRY (password_entry), TRUE);
/* Packing */
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), main_box, TRUE, FALSE, 0);
@@ -794,26 +776,42 @@ request_password (GtkPrintBackend *backend,
gtk_box_pack_start (GTK_BOX (main_box), vbox, FALSE, FALSE, 6);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 6);
gtk_box_pack_start (GTK_BOX (vbox), username_box, FALSE, TRUE, 6);
gtk_box_pack_start (GTK_BOX (vbox), password_box, FALSE, TRUE, 6);
/* Right - 2. */
for (i = 0; i < length; i++)
{
priv->auth_info[i] = g_strdup (ai_default[i]);
if (ai_display[i] != NULL)
{
box = gtk_hbox_new (TRUE, 0);
gtk_box_pack_start (GTK_BOX (username_box), username_prompt, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (username_box), username_entry, TRUE, TRUE, 0);
label = gtk_label_new (ai_display[i]);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (password_box), password_prompt, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (password_box), password_entry, TRUE, TRUE, 0);
entry = gtk_entry_new ();
focus = entry;
if (ai_default[i] != NULL)
gtk_entry_set_text (GTK_ENTRY (entry), ai_default[i]);
gtk_widget_grab_focus (password_entry);
gtk_entry_set_visibility (GTK_ENTRY (entry), ai_visible[i]);
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
priv->hostname = g_strdup (hostname);
priv->username = g_strdup (username);
gtk_box_pack_start (GTK_BOX (vbox), box, FALSE, TRUE, 6);
g_signal_connect (password_entry, "changed",
G_CALLBACK (store_password), backend);
gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (box), entry, TRUE, TRUE, 0);
g_signal_connect (username_entry, "changed",
G_CALLBACK (store_username), backend);
g_signal_connect (entry, "changed",
G_CALLBACK (store_entry), &(priv->auth_info[i]));
}
}
if (focus != NULL)
{
gtk_widget_grab_focus (focus);
focus = NULL;
}
g_object_ref (backend);
g_signal_connect (G_OBJECT (dialog), "response",
+8 -8
View File
@@ -121,15 +121,16 @@ struct _GtkPrintBackendClass
void (*printer_status_changed) (GtkPrintBackend *backend,
GtkPrinter *printer);
void (*request_password) (GtkPrintBackend *backend,
const gchar *hostname,
const gchar *username,
gpointer auth_info_required,
gpointer auth_info_default,
gpointer auth_info_display,
gpointer auth_info_visible,
const gchar *prompt);
/* not a signal */
void (*set_password) (GtkPrintBackend *backend,
const gchar *hostname,
const gchar *username,
const gchar *password);
gchar **auth_info_required,
gchar **auth_info);
/* Padding for future expansion */
void (*_gtk_reserved1) (void);
@@ -153,9 +154,8 @@ void gtk_print_backend_print_stream (GtkPrintBackend *pri
GList * gtk_print_backend_load_modules (void);
void gtk_print_backend_destroy (GtkPrintBackend *print_backend);
void gtk_print_backend_set_password (GtkPrintBackend *backend,
const gchar *hostname,
const gchar *username,
const gchar *password);
gchar **auth_info_required,
gchar **auth_info);
/* Backend-only functions for GtkPrintBackend */
+8 -8
View File
@@ -177,11 +177,11 @@ _gtk_print_context_rotate_according_to_orientation (GtkPrintContext *context)
case GTK_PAGE_ORIENTATION_PORTRAIT:
break;
case GTK_PAGE_ORIENTATION_LANDSCAPE:
cairo_translate (cr, width, 0);
cairo_translate (cr, 0, height);
cairo_matrix_init (&matrix,
0, 1,
-1, 0,
0, 0);
0, -1,
1, 0,
0, 0);
cairo_transform (cr, &matrix);
break;
case GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT:
@@ -193,11 +193,11 @@ _gtk_print_context_rotate_according_to_orientation (GtkPrintContext *context)
cairo_transform (cr, &matrix);
break;
case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE:
cairo_translate (cr, 0, height);
cairo_translate (cr, width, 0);
cairo_matrix_init (&matrix,
0, -1,
1, 0,
0, 0);
0, 1,
-1, 0,
0, 0);
cairo_transform (cr, &matrix);
break;
}
+19 -2
View File
@@ -91,9 +91,26 @@ unix_start_page (GtkPrintOperation *op,
(op->priv->page_position % op->priv->manual_number_up == 0))
{
if (type == CAIRO_SURFACE_TYPE_PS)
cairo_ps_surface_set_size (op_unix->surface, w, h);
{
cairo_ps_surface_set_size (op_unix->surface, w, h);
cairo_ps_surface_dsc_begin_page_setup (op_unix->surface);
switch (gtk_page_setup_get_orientation (page_setup))
{
case GTK_PAGE_ORIENTATION_PORTRAIT:
case GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT:
cairo_ps_surface_dsc_comment (op_unix->surface, "%%PageOrientation: Portrait");
break;
case GTK_PAGE_ORIENTATION_LANDSCAPE:
case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE:
cairo_ps_surface_dsc_comment (op_unix->surface, "%%PageOrientation: Landscape");
break;
}
}
else if (type == CAIRO_SURFACE_TYPE_PDF)
cairo_pdf_surface_set_size (op_unix->surface, w, h);
{
cairo_pdf_surface_set_size (op_unix->surface, w, h);
}
}
}
+18 -10
View File
@@ -596,7 +596,7 @@ gtk_print_unix_dialog_destroy (GtkPrintUnixDialog *dialog)
}
static void
disconnect_printer_details_request (GtkPrintUnixDialog *dialog)
disconnect_printer_details_request (GtkPrintUnixDialog *dialog, gboolean details_failed)
{
GtkPrintUnixDialogPrivate *priv = dialog->priv;
@@ -606,12 +606,20 @@ disconnect_printer_details_request (GtkPrintUnixDialog *dialog)
priv->request_details_tag);
priv->request_details_tag = 0;
set_busy_cursor (dialog, FALSE);
gtk_list_store_set (GTK_LIST_STORE (priv->printer_list),
g_object_get_data (G_OBJECT (priv->request_details_printer),
"gtk-print-tree-iter"),
PRINTER_LIST_COL_STATE,
gtk_printer_get_state_message (priv->request_details_printer),
-1);
if (details_failed)
gtk_list_store_set (GTK_LIST_STORE (priv->printer_list),
g_object_get_data (G_OBJECT (priv->request_details_printer),
"gtk-print-tree-iter"),
PRINTER_LIST_COL_STATE,
_("Getting printer information failed"),
-1);
else
gtk_list_store_set (GTK_LIST_STORE (priv->printer_list),
g_object_get_data (G_OBJECT (priv->request_details_printer),
"gtk-print-tree-iter"),
PRINTER_LIST_COL_STATE,
gtk_printer_get_state_message (priv->request_details_printer),
-1);
g_object_unref (priv->request_details_printer);
priv->request_details_printer = NULL;
}
@@ -626,7 +634,7 @@ gtk_print_unix_dialog_finalize (GObject *object)
GList *node;
unschedule_idle_mark_conflicts (dialog);
disconnect_printer_details_request (dialog);
disconnect_printer_details_request (dialog, FALSE);
if (priv->current_printer)
{
@@ -1781,7 +1789,7 @@ printer_details_acquired (GtkPrinter *printer,
{
GtkPrintUnixDialogPrivate *priv = dialog->priv;
disconnect_printer_details_request (dialog);
disconnect_printer_details_request (dialog, !success);
if (success)
{
@@ -1809,7 +1817,7 @@ selected_printer_changed (GtkTreeSelection *selection,
priv->waiting_for_printer = NULL;
}
disconnect_printer_details_request (dialog);
disconnect_printer_details_request (dialog, FALSE);
printer = NULL;
if (gtk_tree_selection_get_selected (selection, NULL, &filter_iter))
+68 -29
View File
@@ -31,9 +31,15 @@
typedef struct _TrackerClient TrackerClient;
typedef enum
{
TRACKER_0_6 = 1 << 0,
TRACKER_0_7 = 1 << 1
} TrackerVersion;
typedef void (*TrackerArrayReply) (char **result, GError *error, gpointer user_data);
static TrackerClient * (*tracker_connect) (gboolean enable_warnings) = NULL;
static TrackerClient * (*tracker_connect) (gboolean enable_warnings, gint timeout) = NULL;
static void (*tracker_disconnect) (TrackerClient *client) = NULL;
static int (*tracker_get_version) (TrackerClient *client, GError **error) = NULL;
static void (*tracker_cancel_last_call) (TrackerClient *client) = NULL;
@@ -52,22 +58,24 @@ static struct TrackerDlMapping
{
const char *fn_name;
gpointer *fn_ptr_ref;
TrackerVersion versions;
} tracker_dl_mapping[] =
{
#define MAP(a) { #a, (gpointer *)&a }
MAP (tracker_connect),
MAP (tracker_disconnect),
MAP (tracker_get_version),
MAP (tracker_cancel_last_call),
MAP (tracker_search_metadata_by_text_async),
MAP (tracker_search_metadata_by_text_and_location_async),
#define MAP(a,v) { #a, (gpointer *)&a, v }
MAP (tracker_connect, TRACKER_0_6 | TRACKER_0_7),
MAP (tracker_disconnect, TRACKER_0_6 | TRACKER_0_7),
MAP (tracker_get_version, TRACKER_0_6),
MAP (tracker_cancel_last_call, TRACKER_0_6 | TRACKER_0_7),
MAP (tracker_search_metadata_by_text_async, TRACKER_0_6 | TRACKER_0_7),
MAP (tracker_search_metadata_by_text_and_location_async, TRACKER_0_6 | TRACKER_0_7),
#undef MAP
};
static void
static TrackerVersion
open_libtracker (void)
{
static gboolean done = FALSE;
static TrackerVersion version = 0;
if (!done)
{
@@ -78,16 +86,29 @@ open_libtracker (void)
done = TRUE;
flags = G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL;
tracker = g_module_open ("libtrackerclient.so.0", flags);
tracker = g_module_open ("libtracker-client-0.7.so.0", flags);
version = TRACKER_0_7;
if (!tracker)
tracker = g_module_open ("libtracker.so.0", flags);
{
tracker = g_module_open ("libtrackerclient.so.0", flags);
version = TRACKER_0_6;
}
if (!tracker)
return;
{
tracker = g_module_open ("libtracker.so.0", flags);
version = TRACKER_0_6;
}
if (!tracker)
return 0;
for (i = 0; i < G_N_ELEMENTS (tracker_dl_mapping); i++)
{
if ((tracker_dl_mapping[i].versions & version) == 0)
continue;
if (!g_module_symbol (tracker, tracker_dl_mapping[i].fn_name,
tracker_dl_mapping[i].fn_ptr_ref))
{
@@ -98,10 +119,12 @@ open_libtracker (void)
for (i = 0; i < G_N_ELEMENTS (tracker_dl_mapping); i++)
tracker_dl_mapping[i].fn_ptr_ref = NULL;
return;
return 0;
}
}
}
return version;
}
struct _GtkSearchEngineTrackerPrivate
@@ -109,6 +132,7 @@ struct _GtkSearchEngineTrackerPrivate
GtkQuery *query;
TrackerClient *client;
gboolean query_pending;
TrackerVersion version;
};
G_DEFINE_TYPE (GtkSearchEngineTracker, _gtk_search_engine_tracker, GTK_TYPE_SEARCH_ENGINE);
@@ -161,7 +185,11 @@ search_callback (gchar **results,
{
gchar *uri;
uri = g_filename_to_uri (*results_p, NULL, NULL);
if (tracker->priv->version == TRACKER_0_6)
uri = g_filename_to_uri (*results_p, NULL, NULL);
else
uri = *results_p;
if (uri)
hit_uris = g_list_prepend (hit_uris, uri);
}
@@ -170,7 +198,8 @@ search_callback (gchar **results,
_gtk_search_engine_finished (GTK_SEARCH_ENGINE (tracker));
g_strfreev (results);
g_list_foreach (hit_uris, (GFunc)g_free, NULL);
if (tracker->priv->version == TRACKER_0_6)
g_list_foreach (hit_uris, (GFunc)g_free, NULL);
g_list_free (hit_uris);
}
@@ -195,9 +224,14 @@ gtk_search_engine_tracker_start (GtkSearchEngine *engine)
location = NULL;
if (location_uri)
{
location = g_filename_from_uri (location_uri, NULL, NULL);
g_free (location_uri);
}
if (tracker->priv->version == TRACKER_0_6)
{
location = g_filename_from_uri (location_uri, NULL, NULL);
g_free (location_uri);
}
else
location = location_uri;
}
if (location)
{
@@ -287,34 +321,39 @@ _gtk_search_engine_tracker_new (void)
{
GtkSearchEngineTracker *engine;
TrackerClient *tracker_client;
TrackerVersion version;
GError *err = NULL;
open_libtracker ();
version = open_libtracker ();
if (!tracker_connect)
return NULL;
tracker_client = tracker_connect (FALSE);
tracker_client = tracker_connect (FALSE, -1);
if (!tracker_client)
return NULL;
if (!tracker_get_version)
return NULL;
tracker_get_version (tracker_client, &err);
if (err != NULL)
if (version == TRACKER_0_6)
{
g_error_free (err);
tracker_disconnect (tracker_client);
return NULL;
if (!tracker_get_version)
return NULL;
tracker_get_version (tracker_client, &err);
if (err != NULL)
{
g_error_free (err);
tracker_disconnect (tracker_client);
return NULL;
}
}
engine = g_object_new (GTK_TYPE_SEARCH_ENGINE_TRACKER, NULL);
engine->priv->client = tracker_client;
engine->priv->query_pending = FALSE;
engine->priv->version = version;
return GTK_SEARCH_ENGINE (engine);
}
+33 -30
View File
@@ -1812,56 +1812,59 @@ allocate_child_widgets (GtkTextLayout *text_layout,
{
PangoLayout *layout = display->layout;
PangoLayoutIter *run_iter;
run_iter = pango_layout_get_iter (layout);
do
{
PangoLayoutRun *run = pango_layout_iter_get_run_readonly (run_iter);
if (run && is_shape (run))
{
gint byte_index;
GtkTextIter text_iter;
GtkTextChildAnchor *anchor = 0;
GList *widgets = 0;
/* The pango iterator iterates in visual order.
GtkTextChildAnchor *anchor = NULL;
GList *widgets = NULL;
GList *l;
/* The pango iterator iterates in visual order.
* We use the byte index to find the child widget.
*/
byte_index = pango_layout_iter_get_index (run_iter);
line_display_index_to_iter (text_layout, display, &text_iter, byte_index, 0);
anchor = gtk_text_iter_get_child_anchor (&text_iter);
widgets = gtk_text_child_anchor_get_widgets (anchor);
if (widgets)
if (anchor)
widgets = gtk_text_child_anchor_get_widgets (anchor);
for (l = widgets; l; l = l->next)
{
PangoRectangle extents;
GtkWidget *child = widgets->data;
GtkWidget *child = l->data;
/* We emit "allocate_child" with the x,y of
* the widget with respect to the top of the line
* and the left side of the buffer
*/
pango_layout_iter_get_run_extents (run_iter,
NULL,
&extents);
g_signal_emit (text_layout,
signals[ALLOCATE_CHILD],
0,
child,
PANGO_PIXELS (extents.x) + display->x_offset,
PANGO_PIXELS (extents.y) + display->top_margin);
g_list_free (widgets);
if (_gtk_anchored_child_get_layout (child) == text_layout)
{
/* We emit "allocate_child" with the x,y of
* the widget with respect to the top of the line
* and the left side of the buffer
*/
pango_layout_iter_get_run_extents (run_iter,
NULL,
&extents);
g_signal_emit (text_layout,
signals[ALLOCATE_CHILD],
0,
child,
PANGO_PIXELS (extents.x) + display->x_offset,
PANGO_PIXELS (extents.y) + display->top_margin);
}
}
g_list_free (widgets);
}
}
while (pango_layout_iter_next_run (run_iter));
pango_layout_iter_free (run_iter);
}
+3
View File
@@ -768,6 +768,9 @@ static void
gtk_tooltip_set_last_window (GtkTooltip *tooltip,
GdkWindow *window)
{
if (tooltip->last_window == window)
return;
if (tooltip->last_window)
g_object_remove_weak_pointer (G_OBJECT (tooltip->last_window),
(gpointer *) &tooltip->last_window);
+32 -19
View File
@@ -534,6 +534,7 @@ gtk_tree_model_filter_build_level (GtkTreeModelFilter *filter,
{
if (gtk_tree_model_filter_visible (filter, &iter))
{
GtkTreeIter f_iter;
FilterElt filter_elt;
filter_elt.offset = i;
@@ -548,26 +549,29 @@ gtk_tree_model_filter_build_level (GtkTreeModelFilter *filter,
g_array_append_val (new_level->array, filter_elt);
new_level->visible_nodes++;
f_iter.stamp = filter->priv->stamp;
f_iter.user_data = new_level;
f_iter.user_data2 = &(g_array_index (new_level->array, FilterElt, new_level->array->len - 1));
if (new_level->parent_level || filter->priv->virtual_root)
gtk_tree_model_filter_ref_node (GTK_TREE_MODEL (filter), &f_iter);
if (emit_inserted)
{
GtkTreeIter f_iter;
GtkTreePath *f_path;
GtkTreeIter children;
f_iter.stamp = filter->priv->stamp;
f_iter.user_data = new_level;
f_iter.user_data2 = &(g_array_index (new_level->array, FilterElt, new_level->array->len - 1));
f_path = gtk_tree_model_get_path (GTK_TREE_MODEL (filter),
&f_iter);
gtk_tree_model_row_inserted (GTK_TREE_MODEL (filter),
f_path, &f_iter);
gtk_tree_path_free (f_path);
gtk_tree_model_filter_ref_node (GTK_TREE_MODEL (filter), &f_iter);
if (emit_inserted)
{
GtkTreePath *f_path;
f_path = gtk_tree_model_get_path (GTK_TREE_MODEL (filter),
&f_iter);
gtk_tree_model_row_inserted (GTK_TREE_MODEL (filter),
f_path, &f_iter);
gtk_tree_path_free (f_path);
}
if (gtk_tree_model_iter_children (filter->priv->child_model,
&children, &iter))
gtk_tree_model_filter_update_children (filter,
new_level,
FILTER_ELT (f_iter.user_data2));
}
}
i++;
@@ -1224,6 +1228,7 @@ gtk_tree_model_filter_row_changed (GtkTreeModel *c_model,
gboolean requested_state;
gboolean current_state;
gboolean free_c_path = FALSE;
gboolean signals_emitted = FALSE;
g_return_if_fail (c_path != NULL || c_iter != NULL);
@@ -1310,7 +1315,13 @@ gtk_tree_model_filter_row_changed (GtkTreeModel *c_model,
{
FilterLevel *root;
gtk_tree_model_filter_build_level (filter, NULL, -1, FALSE);
gtk_tree_model_filter_build_level (filter, NULL, -1, TRUE);
/* We will only proceed below if the item is found. If the item
* is found, we can be sure row-inserted has just been emitted
* for it.
*/
signals_emitted = TRUE;
root = FILTER_LEVEL (filter->priv->root);
}
@@ -1349,7 +1360,8 @@ gtk_tree_model_filter_row_changed (GtkTreeModel *c_model,
gtk_tree_path_free (path);
path = gtk_tree_model_get_path (GTK_TREE_MODEL (filter), &iter);
gtk_tree_model_row_inserted (GTK_TREE_MODEL (filter), path, &iter);
if (!signals_emitted)
gtk_tree_model_row_inserted (GTK_TREE_MODEL (filter), path, &iter);
if (level->parent_level && level->visible_nodes == 1)
{
@@ -1366,7 +1378,8 @@ gtk_tree_model_filter_row_changed (GtkTreeModel *c_model,
&iter);
}
if (gtk_tree_model_iter_children (c_model, &children, c_iter))
if (!signals_emitted
&& gtk_tree_model_iter_children (c_model, &children, c_iter))
gtk_tree_model_filter_update_children (filter, level, elt);
}
+3
View File
@@ -10603,6 +10603,9 @@ gtk_widget_real_set_has_tooltip (GtkWidget *widget,
* the default tooltip window. If @custom_window is %NULL, the default
* tooltip window will be used.
*
* If the custom window should have the default theming it needs to
* have the name "gtk-tooltip", see gtk_widget_set_name().
*
* Since: 2.12
*/
void
+6 -3
View File
@@ -173,8 +173,8 @@ test_type (gconstpointer data)
/* Default invisible char is determined at runtime */
if (g_type_is_a (type, GTK_TYPE_ENTRY) &&
strcmp (pspec->name, "invisible-char") == 0 ||
strcmp (pspec->name, "buffer") == 0)
(strcmp (pspec->name, "invisible-char") == 0 ||
strcmp (pspec->name, "buffer") == 0))
continue;
/* Gets set to the cwd */
@@ -239,7 +239,10 @@ test_type (gconstpointer data)
strcmp (pspec->name, "gtk-icon-theme-name") == 0 ||
strcmp (pspec->name, "gtk-im-module") == 0 ||
strcmp (pspec->name, "gtk-key-theme-name") == 0 ||
strcmp (pspec->name, "gtk-theme-name") == 0))
strcmp (pspec->name, "gtk-theme-name") == 0 ||
strcmp (pspec->name, "gtk-sound-theme-name") == 0 ||
strcmp (pspec->name, "gtk-enable-input-feedback-sounds") == 0 ||
strcmp (pspec->name, "gtk-enable-event-sounds") == 0))
continue;
if (g_type_is_a (type, GTK_TYPE_SPIN_BUTTON) &&
+285 -6
View File
@@ -105,6 +105,34 @@ typedef enum
}
SignalName;
static const char *
signal_name_to_string (SignalName signal)
{
switch (signal)
{
case ROW_INSERTED:
return "row-inserted";
case ROW_DELETED:
return "row-deleted";
case ROW_CHANGED:
return "row-changed";
case ROW_HAS_CHILD_TOGGLED:
return "row-has-child-toggled";
case ROWS_REORDERED:
return "rows-reordered";
default:
/* Fall through */
break;
}
return "(unknown)";
}
typedef struct
{
SignalName signal;
@@ -152,22 +180,46 @@ signal_monitor_generic_handler (SignalMonitor *m,
{
Signal *s;
g_return_if_fail (m->client == model);
g_return_if_fail (!g_queue_is_empty (m->queue));
if (g_queue_is_empty (m->queue))
{
g_error ("Signal queue empty\n");
g_assert_not_reached ();
}
if (m->client != model)
{
g_error ("Model mismatch; expected %p, got %p\n",
m->client, model);
g_assert_not_reached ();
}
s = g_queue_peek_tail (m->queue);
#if 0
/* For debugging: output signals that are coming in. Leaks memory. */
g_print ("signal=%d path=%s\n", signal, gtk_tree_path_to_string (path));
#endif
s = g_queue_peek_tail (m->queue);
if (s->signal != signal
|| gtk_tree_path_compare (s->path, path) != 0)
{
gchar *path_str, *s_path_str;
g_return_if_fail (s->signal == signal);
s_path_str = gtk_tree_path_to_string (s->path);
path_str = gtk_tree_path_to_string (path);
g_error ("Signals don't match; expected signal %s path %s, got signal %s path %s\n",
signal_name_to_string (s->signal), s_path_str,
signal_name_to_string (signal), path_str);
g_free (s_path_str);
g_free (path_str);
g_assert_not_reached ();
}
s = g_queue_pop_tail (m->queue);
g_return_if_fail (!gtk_tree_path_compare (path, s->path));
signal_free (s);
}
@@ -315,8 +367,19 @@ typedef struct
GtkTreeModelFilter *filter;
SignalMonitor *monitor;
guint block_signals : 1;
} FilterTest;
static void
filter_test_store_signal (FilterTest *fixture)
{
if (fixture->block_signals)
g_signal_stop_emission_by_name (fixture->store, "row-changed");
}
static void
filter_test_setup_generic (FilterTest *fixture,
gconstpointer test_data,
@@ -329,6 +392,9 @@ filter_test_setup_generic (FilterTest *fixture,
fixture->store = create_tree_store (depth, !empty);
g_signal_connect_swapped (fixture->store, "row-changed",
G_CALLBACK (filter_test_store_signal), fixture);
/* Please forgive me for casting const away. */
filter = gtk_tree_model_filter_new (GTK_TREE_MODEL (fixture->store),
(GtkTreePath *)vroot);
@@ -576,6 +642,18 @@ filter_test_enable_filter (FilterTest *fixture)
gtk_tree_model_filter_refilter (fixture->filter);
}
static void
filter_test_block_signals (FilterTest *fixture)
{
fixture->block_signals = TRUE;
}
static void
filter_test_unblock_signals (FilterTest *fixture)
{
fixture->block_signals = FALSE;
}
static void
filter_test_teardown (FilterTest *fixture,
gconstpointer test_data)
@@ -1125,6 +1203,86 @@ empty_show_nodes (FilterTest *fixture,
check_level_length (fixture->filter, "0:0:0", 0);
}
static void
empty_show_multiple_nodes (FilterTest *fixture,
gconstpointer user_data)
{
GtkTreeIter iter;
GtkTreePath *changed_path;
check_filter_model (fixture);
check_level_length (fixture->filter, NULL, 0);
signal_monitor_append_signal (fixture->monitor, ROW_INSERTED, "0");
signal_monitor_append_signal (fixture->monitor, ROW_HAS_CHILD_TOGGLED, "0");
signal_monitor_append_signal (fixture->monitor, ROW_INSERTED, "1");
signal_monitor_append_signal (fixture->monitor, ROW_HAS_CHILD_TOGGLED, "1");
signal_monitor_append_signal (fixture->monitor, ROW_CHANGED, "1");
signal_monitor_append_signal (fixture->monitor, ROW_HAS_CHILD_TOGGLED, "1");
/* We simulate a change in visible func condition with this. The
* visibility state of multiple nodes changes at once, we emit row-changed
* for these nodes (and others) after that.
*/
filter_test_block_signals (fixture);
set_path_visibility (fixture, "3", TRUE);
set_path_visibility (fixture, "4", TRUE);
filter_test_unblock_signals (fixture);
changed_path = gtk_tree_path_new ();
gtk_tree_path_append_index (changed_path, 2);
gtk_tree_model_get_iter (GTK_TREE_MODEL (fixture->store),
&iter, changed_path);
gtk_tree_model_row_changed (GTK_TREE_MODEL (fixture->store),
changed_path, &iter);
gtk_tree_path_next (changed_path);
gtk_tree_model_iter_next (GTK_TREE_MODEL (fixture->store), &iter);
gtk_tree_model_row_changed (GTK_TREE_MODEL (fixture->store),
changed_path, &iter);
gtk_tree_path_next (changed_path);
gtk_tree_model_iter_next (GTK_TREE_MODEL (fixture->store), &iter);
gtk_tree_model_row_changed (GTK_TREE_MODEL (fixture->store),
changed_path, &iter);
gtk_tree_path_free (changed_path);
check_filter_model (fixture);
check_level_length (fixture->filter, NULL, 2);
check_level_length (fixture->filter, "0", 0);
set_path_visibility (fixture, "3:2:2", TRUE);
check_filter_model (fixture);
check_level_length (fixture->filter, NULL, 2);
check_level_length (fixture->filter, "0", 0);
signal_monitor_append_signal (fixture->monitor, ROW_INSERTED, "0:0");
signal_monitor_append_signal (fixture->monitor, ROW_HAS_CHILD_TOGGLED, "0");
signal_monitor_append_signal (fixture->monitor, ROW_HAS_CHILD_TOGGLED, "0:0");
set_path_visibility (fixture, "3:2", TRUE);
check_filter_model (fixture);
check_level_length (fixture->filter, NULL, 2);
check_level_length (fixture->filter, "0", 1);
check_level_length (fixture->filter, "0:0", 1);
check_level_length (fixture->filter, "0:0:0", 0);
signal_monitor_append_signal (fixture->monitor, ROW_DELETED, "0");
set_path_visibility (fixture, "3", FALSE);
check_filter_model (fixture);
check_level_length (fixture->filter, NULL, 1);
signal_monitor_append_signal (fixture->monitor, ROW_INSERTED, "0");
signal_monitor_append_signal (fixture->monitor, ROW_HAS_CHILD_TOGGLED, "0");
set_path_visibility (fixture, "3:2:1", TRUE);
set_path_visibility (fixture, "3", TRUE);
check_filter_model (fixture);
check_level_length (fixture->filter, NULL, 2);
check_level_length (fixture->filter, "0", 1);
check_level_length (fixture->filter, "0:0", 2);
check_level_length (fixture->filter, "0:0:0", 0);
}
static void
empty_vroot_show_nodes (FilterTest *fixture,
gconstpointer user_data)
@@ -1169,6 +1327,117 @@ empty_vroot_show_nodes (FilterTest *fixture,
check_level_length (fixture->filter, "0:1", 0);
}
static void
empty_vroot_show_multiple_nodes (FilterTest *fixture,
gconstpointer user_data)
{
GtkTreeIter iter;
GtkTreePath *changed_path;
GtkTreePath *path = (GtkTreePath *)user_data;
check_filter_model_with_root (fixture, path);
check_level_length (fixture->filter, NULL, 0);
/* We simulate a change in visible func condition with this. The
* visibility state of multiple nodes changes at once, we emit row-changed
* for these nodes (and others) after that.
*/
filter_test_block_signals (fixture);
set_path_visibility (fixture, "2", TRUE);
set_path_visibility (fixture, "3", TRUE);
filter_test_unblock_signals (fixture);
changed_path = gtk_tree_path_new ();
gtk_tree_path_append_index (changed_path, 1);
gtk_tree_model_get_iter (GTK_TREE_MODEL (fixture->store),
&iter, changed_path);
gtk_tree_model_row_changed (GTK_TREE_MODEL (fixture->store),
changed_path, &iter);
gtk_tree_path_next (changed_path);
gtk_tree_model_iter_next (GTK_TREE_MODEL (fixture->store), &iter);
gtk_tree_model_row_changed (GTK_TREE_MODEL (fixture->store),
changed_path, &iter);
gtk_tree_path_next (changed_path);
gtk_tree_model_iter_next (GTK_TREE_MODEL (fixture->store), &iter);
gtk_tree_model_row_changed (GTK_TREE_MODEL (fixture->store),
changed_path, &iter);
gtk_tree_path_next (changed_path);
gtk_tree_model_iter_next (GTK_TREE_MODEL (fixture->store), &iter);
gtk_tree_model_row_changed (GTK_TREE_MODEL (fixture->store),
changed_path, &iter);
gtk_tree_path_free (changed_path);
check_filter_model_with_root (fixture, path);
check_level_length (fixture->filter, NULL, 0);
set_path_visibility (fixture, "2:2:2", TRUE);
check_filter_model_with_root (fixture, path);
check_level_length (fixture->filter, NULL, 0);
signal_monitor_append_signal (fixture->monitor, ROW_INSERTED, "0");
signal_monitor_append_signal (fixture->monitor, ROW_HAS_CHILD_TOGGLED, "0");
signal_monitor_append_signal (fixture->monitor, ROW_INSERTED, "1");
signal_monitor_append_signal (fixture->monitor, ROW_HAS_CHILD_TOGGLED, "1");
/* Again, we simulate a call to refilter */
filter_test_block_signals (fixture);
set_path_visibility (fixture, "2:2", TRUE);
set_path_visibility (fixture, "2:3", TRUE);
filter_test_unblock_signals (fixture);
changed_path = gtk_tree_path_new ();
gtk_tree_path_append_index (changed_path, 2);
gtk_tree_path_append_index (changed_path, 1);
gtk_tree_model_get_iter (GTK_TREE_MODEL (fixture->store),
&iter, changed_path);
gtk_tree_model_row_changed (GTK_TREE_MODEL (fixture->store),
changed_path, &iter);
gtk_tree_path_next (changed_path);
gtk_tree_model_iter_next (GTK_TREE_MODEL (fixture->store), &iter);
gtk_tree_model_row_changed (GTK_TREE_MODEL (fixture->store),
changed_path, &iter);
gtk_tree_path_next (changed_path);
gtk_tree_model_iter_next (GTK_TREE_MODEL (fixture->store), &iter);
gtk_tree_model_row_changed (GTK_TREE_MODEL (fixture->store),
changed_path, &iter);
gtk_tree_path_next (changed_path);
gtk_tree_model_iter_next (GTK_TREE_MODEL (fixture->store), &iter);
gtk_tree_model_row_changed (GTK_TREE_MODEL (fixture->store),
changed_path, &iter);
gtk_tree_path_free (changed_path);
check_filter_model_with_root (fixture, path);
check_level_length (fixture->filter, NULL, 2);
check_level_length (fixture->filter, "0", 1);
check_level_length (fixture->filter, "0:0", 0);
set_path_visibility (fixture, "3", TRUE);
check_filter_model_with_root (fixture, path);
check_level_length (fixture->filter, NULL, 2);
signal_monitor_append_signal (fixture->monitor, ROW_DELETED, "0");
set_path_visibility (fixture, "2:2", FALSE);
check_filter_model_with_root (fixture, path);
check_level_length (fixture->filter, NULL, 1);
signal_monitor_append_signal (fixture->monitor, ROW_INSERTED, "0");
signal_monitor_append_signal (fixture->monitor, ROW_HAS_CHILD_TOGGLED, "0");
set_path_visibility (fixture, "2:2:1", TRUE);
set_path_visibility (fixture, "2:2", TRUE);
check_filter_model_with_root (fixture, path);
check_level_length (fixture->filter, NULL, 2);
check_level_length (fixture->filter, "0", 2);
check_level_length (fixture->filter, "0:1", 0);
}
static void
unfiltered_hide_single (FilterTest *fixture,
@@ -2607,12 +2876,22 @@ main (int argc,
filter_test_setup_empty,
empty_show_nodes,
filter_test_teardown);
g_test_add ("/FilterModel/empty/show-multiple-nodes",
FilterTest, NULL,
filter_test_setup_empty,
empty_show_multiple_nodes,
filter_test_teardown);
g_test_add ("/FilterModel/empty/show-nodes/vroot",
FilterTest, gtk_tree_path_new_from_indices (2, -1),
filter_test_setup_empty,
empty_vroot_show_nodes,
filter_test_teardown);
g_test_add ("/FilterModel/empty/show-multiple-nodes/vroot",
FilterTest, gtk_tree_path_new_from_indices (2, -1),
filter_test_setup_empty,
empty_vroot_show_multiple_nodes,
filter_test_teardown);
g_test_add ("/FilterModel/unfiltered/hide-single",
@@ -187,6 +187,10 @@ gtk_cups_request_new_with_username (http_t *connection,
"requesting-user-name",
NULL, cupsUser ());
request->auth_info_required = NULL;
request->auth_info = NULL;
request->need_auth_info = FALSE;
cupsLangFree (language);
return request;
@@ -241,6 +245,7 @@ gtk_cups_request_free (GtkCupsRequest *request)
}
g_free (request->username);
g_strfreev (request->auth_info_required);
gtk_cups_result_free (request->result);
@@ -99,6 +99,9 @@ struct _GtkCupsRequest
gint own_http : 1;
gint need_password : 1;
gint need_auth_info : 1;
gchar **auth_info_required;
gchar **auth_info;
GtkCupsPasswordState password_state;
};
+333 -27
View File
@@ -94,6 +94,8 @@ typedef struct
GtkCupsRequest *request;
GPollFD *data_poll;
GtkPrintBackendCups *backend;
GtkPrintCupsResponseCallbackFunc callback;
gpointer callback_data;
} GtkPrintCupsDispatchWatch;
@@ -110,6 +112,7 @@ struct _GtkPrintBackendCups
guint list_printers_poll;
guint list_printers_pending : 1;
gint list_printers_attempts;
guint got_default_printer : 1;
guint default_printer_poll;
GtkCupsConnectionTest *cups_connection_test;
@@ -154,7 +157,7 @@ static GList * cups_printer_list_papers (GtkPrinter
static GtkPageSetup * cups_printer_get_default_page_size (GtkPrinter *printer);
static void cups_printer_request_details (GtkPrinter *printer);
static gboolean cups_request_default_printer (GtkPrintBackendCups *print_backend);
static void cups_request_ppd (GtkPrinter *printer);
static gboolean cups_request_ppd (GtkPrinter *printer);
static void cups_printer_get_hard_margins (GtkPrinter *printer,
double *top,
double *bottom,
@@ -179,13 +182,13 @@ static cairo_surface_t * cups_printer_create_cairo_surface (GtkPrinter
gdouble height,
GIOChannel *cache_io);
static void gtk_print_backend_cups_set_password (GtkPrintBackend *backend,
const gchar *hostname,
const gchar *username,
const gchar *password);
static void gtk_print_backend_cups_set_password (GtkPrintBackend *backend,
gchar **auth_info_required,
gchar **auth_info);
void overwrite_and_free (gpointer data);
static gboolean is_address_local (const gchar *address);
void overwrite_and_free (gpointer data);
static gboolean is_address_local (const gchar *address);
static gboolean request_auth_info (gpointer data);
static void
gtk_print_backend_cups_register_type (GTypeModule *module)
@@ -557,6 +560,9 @@ gtk_print_backend_cups_print_stream (GtkPrintBackend *print_backend,
ps->dnotify = dnotify;
ps->job = g_object_ref (job);
request->need_auth_info = cups_printer->auth_info_required != NULL;
request->auth_info_required = g_strdupv (cups_printer->auth_info_required);
cups_request_execute (GTK_PRINT_BACKEND_CUPS (print_backend),
request,
(GtkPrintCupsResponseCallbackFunc) cups_print_cb,
@@ -581,6 +587,7 @@ gtk_print_backend_cups_init (GtkPrintBackendCups *backend_cups)
backend_cups->list_printers_poll = FALSE;
backend_cups->got_default_printer = FALSE;
backend_cups->list_printers_pending = FALSE;
backend_cups->list_printers_attempts = 0;
backend_cups->requests = NULL;
backend_cups->auth = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, overwrite_and_free);
@@ -636,6 +643,7 @@ gtk_print_backend_cups_dispose (GObject *object)
if (backend_cups->list_printers_poll > 0)
g_source_remove (backend_cups->list_printers_poll);
backend_cups->list_printers_poll = 0;
backend_cups->list_printers_attempts = 0;
if (backend_cups->default_printer_poll > 0)
g_source_remove (backend_cups->default_printer_poll);
@@ -656,18 +664,38 @@ is_address_local (const gchar *address)
}
static void
gtk_print_backend_cups_set_password (GtkPrintBackend *backend,
const gchar *hostname,
const gchar *username,
const gchar *password)
gtk_print_backend_cups_set_password (GtkPrintBackend *backend,
gchar **auth_info_required,
gchar **auth_info)
{
GtkPrintBackendCups *cups_backend = GTK_PRINT_BACKEND_CUPS (backend);
GList *l;
char dispatch_hostname[HTTP_MAX_URI];
gchar *key;
gchar *username = NULL;
gchar *hostname = NULL;
gchar *password = NULL;
gint length;
gint i;
key = g_strconcat (username, "@", hostname, NULL);
g_hash_table_insert (cups_backend->auth, key, g_strdup (password));
length = g_strv_length (auth_info_required);
if (auth_info != NULL)
for (i = 0; i < length; i++)
{
if (g_strcmp0 (auth_info_required[i], "username") == 0)
username = g_strdup (auth_info[i]);
else if (g_strcmp0 (auth_info_required[i], "hostname") == 0)
hostname = g_strdup (auth_info[i]);
else if (g_strcmp0 (auth_info_required[i], "password") == 0)
password = g_strdup (auth_info[i]);
}
if (hostname != NULL && username != NULL && password != NULL)
{
key = g_strconcat (username, "@", hostname, NULL);
g_hash_table_insert (cups_backend->auth, key, g_strdup (password));
}
g_free (cups_backend->username);
cups_backend->username = g_strdup (username);
@@ -683,7 +711,18 @@ gtk_print_backend_cups_set_password (GtkPrintBackend *backend,
if (is_address_local (dispatch_hostname))
strcpy (dispatch_hostname, "localhost");
if (strcmp (hostname, dispatch_hostname) == 0)
if (dispatch->request->need_auth_info)
{
if (auth_info != NULL)
{
dispatch->request->auth_info = g_new0 (gchar *, length + 1);
for (i = 0; i < length; i++)
dispatch->request->auth_info[i] = g_strdup (auth_info[i]);
}
dispatch->backend->authentication_lock = FALSE;
dispatch->request->need_auth_info = FALSE;
}
else if (dispatch->request->password_state == GTK_CUPS_PASSWORD_REQUESTED || auth_info == NULL)
{
overwrite_and_free (dispatch->request->password);
dispatch->request->password = g_strdup (password);
@@ -704,6 +743,12 @@ request_password (gpointer data)
gchar *prompt = NULL;
gchar *key = NULL;
char hostname[HTTP_MAX_URI];
gchar **auth_info_required;
gchar **auth_info_default;
gchar **auth_info_display;
gboolean *auth_info_visible;
gint length = 3;
gint i;
if (dispatch->backend->authentication_lock)
return FALSE;
@@ -717,6 +762,22 @@ request_password (gpointer data)
else
username = cupsUser ();
auth_info_required = g_new0 (gchar*, length + 1);
auth_info_required[0] = g_strdup ("hostname");
auth_info_required[1] = g_strdup ("username");
auth_info_required[2] = g_strdup ("password");
auth_info_default = g_new0 (gchar*, length + 1);
auth_info_default[0] = g_strdup (hostname);
auth_info_default[1] = g_strdup (username);
auth_info_display = g_new0 (gchar*, length + 1);
auth_info_display[1] = g_strdup (_("Username:"));
auth_info_display[2] = g_strdup (_("Password:"));
auth_info_visible = g_new0 (gboolean, length + 1);
auth_info_visible[1] = TRUE;
key = g_strconcat (username, "@", hostname, NULL);
password = g_hash_table_lookup (dispatch->backend->auth, key);
@@ -784,11 +845,22 @@ request_password (gpointer data)
g_free (printer_name);
g_signal_emit_by_name (dispatch->backend, "request-password",
hostname, username, prompt);
auth_info_required, auth_info_default, auth_info_display, auth_info_visible, prompt);
g_free (prompt);
}
for (i = 0; i < length; i++)
{
g_free (auth_info_required[i]);
g_free (auth_info_default[i]);
g_free (auth_info_display[i]);
}
g_free (auth_info_required);
g_free (auth_info_default);
g_free (auth_info_display);
g_free (auth_info_visible);
g_free (key);
return FALSE;
@@ -827,6 +899,145 @@ cups_dispatch_add_poll (GSource *source)
}
}
static gboolean
check_auth_info (gpointer user_data)
{
GtkPrintCupsDispatchWatch *dispatch;
dispatch = (GtkPrintCupsDispatchWatch *) user_data;
if (!dispatch->request->need_auth_info)
{
if (dispatch->request->auth_info == NULL)
{
dispatch->callback (GTK_PRINT_BACKEND (dispatch->backend),
gtk_cups_request_get_result (dispatch->request),
dispatch->callback_data);
g_source_destroy ((GSource *) dispatch);
}
else
{
gint length;
gint i;
length = g_strv_length (dispatch->request->auth_info_required);
gtk_cups_request_ipp_add_strings (dispatch->request,
IPP_TAG_JOB,
IPP_TAG_TEXT,
"auth-info",
length,
NULL,
dispatch->request->auth_info);
g_source_attach ((GSource *) dispatch, NULL);
g_source_unref ((GSource *) dispatch);
for (i = 0; i < length; i++)
overwrite_and_free (dispatch->request->auth_info[i]);
g_free (dispatch->request->auth_info);
dispatch->request->auth_info = NULL;
}
return FALSE;
}
return TRUE;
}
static gboolean
request_auth_info (gpointer user_data)
{
GtkPrintCupsDispatchWatch *dispatch;
const char *job_title;
const char *printer_uri;
gchar *prompt = NULL;
char *printer_name = NULL;
gint length;
gint i;
gboolean *auth_info_visible = NULL;
gchar **auth_info_default = NULL;
gchar **auth_info_display = NULL;
dispatch = (GtkPrintCupsDispatchWatch *) user_data;
if (dispatch->backend->authentication_lock)
return FALSE;
job_title = gtk_cups_request_ipp_get_string (dispatch->request, IPP_TAG_NAME, "job-name");
printer_uri = gtk_cups_request_ipp_get_string (dispatch->request, IPP_TAG_URI, "printer-uri");
length = g_strv_length (dispatch->request->auth_info_required);
auth_info_visible = g_new0 (gboolean, length);
auth_info_default = g_new0 (gchar *, length + 1);
auth_info_display = g_new0 (gchar *, length + 1);
for (i = 0; i < length; i++)
{
if (g_strcmp0 (dispatch->request->auth_info_required[i], "domain") == 0)
{
auth_info_display[i] = g_strdup (_("Domain:"));
auth_info_default[i] = g_strdup ("WORKGROUP");
auth_info_visible[i] = TRUE;
}
else if (g_strcmp0 (dispatch->request->auth_info_required[i], "username") == 0)
{
auth_info_display[i] = g_strdup (_("Username:"));
if (dispatch->backend->username != NULL)
auth_info_default[i] = g_strdup (dispatch->backend->username);
else
auth_info_default[i] = g_strdup (cupsUser ());
auth_info_visible[i] = TRUE;
}
else if (g_strcmp0 (dispatch->request->auth_info_required[i], "password") == 0)
{
auth_info_display[i] = g_strdup (_("Password:"));
auth_info_visible[i] = FALSE;
}
}
if (printer_uri != NULL && strrchr (printer_uri, '/') != NULL)
printer_name = g_strdup (strrchr (printer_uri, '/') + 1);
dispatch->backend->authentication_lock = TRUE;
if (job_title != NULL)
{
if (printer_name != NULL)
prompt = g_strdup_printf ( _("Authentication is required to print document '%s' on printer %s"), job_title, printer_name);
else
prompt = g_strdup_printf ( _("Authentication is required to print document '%s'"), job_title);
}
else
{
if (printer_name != NULL)
prompt = g_strdup_printf ( _("Authentication is required to print this document on printer %s"), printer_name);
else
prompt = g_strdup ( _("Authentication is required to print this document"));
}
g_signal_emit_by_name (dispatch->backend, "request-password",
dispatch->request->auth_info_required,
auth_info_default,
auth_info_display,
auth_info_visible,
prompt);
for (i = 0; i < length; i++)
{
g_free (auth_info_default[i]);
g_free (auth_info_display[i]);
}
g_free (auth_info_default);
g_free (auth_info_display);
g_free (printer_name);
g_free (prompt);
g_idle_add (check_auth_info, user_data);
return FALSE;
}
static gboolean
cups_dispatch_watch_check (GSource *source)
{
@@ -1008,13 +1219,24 @@ cups_request_execute (GtkPrintBackendCups *print_backend,
dispatch->request = request;
dispatch->backend = g_object_ref (print_backend);
dispatch->data_poll = NULL;
dispatch->callback = NULL;
dispatch->callback_data = NULL;
print_backend->requests = g_list_prepend (print_backend->requests, dispatch);
g_source_set_callback ((GSource *) dispatch, (GSourceFunc) callback, user_data, notify);
g_source_attach ((GSource *) dispatch, NULL);
g_source_unref ((GSource *) dispatch);
if (request->need_auth_info)
{
dispatch->callback = callback;
dispatch->callback_data = user_data;
request_auth_info (dispatch);
}
else
{
g_source_attach ((GSource *) dispatch, NULL);
g_source_unref ((GSource *) dispatch);
}
}
#if 0
@@ -1359,6 +1581,7 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
if (cups_backend->list_printers_poll > 0)
g_source_remove (cups_backend->list_printers_poll);
cups_backend->list_printers_poll = 0;
cups_backend->list_printers_attempts = 0;
}
goto done;
@@ -1435,6 +1658,7 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
gchar *default_cover_before = NULL;
gchar *default_cover_after = NULL;
gboolean remote_printer = FALSE;
gchar **auth_info_required = NULL;
/* Skip leading attributes until we hit a printer...
*/
@@ -1553,6 +1777,15 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
else
remote_printer = FALSE;
}
else if (strcmp (attr->name, "auth-info-required") == 0)
{
if (strcmp (attr->values[0].string.text, "none") != 0)
{
auth_info_required = g_new0 (gchar *, attr->num_values + 1);
for (i = 0; i < attr->num_values; i++)
auth_info_required[i] = g_strdup (attr->values[i].string.text);
}
}
else
{
GTK_NOTE (PRINTING,
@@ -1674,6 +1907,9 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
cups_printer->hostname = g_strdup (hostname);
cups_printer->port = port;
cups_printer->auth_info_required = g_strdupv (auth_info_required);
g_strfreev (auth_info_required);
printer = GTK_PRINTER (cups_printer);
if (cups_backend->default_printer != NULL &&
@@ -1686,6 +1922,8 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
else
g_object_ref (printer);
GTK_PRINTER_CUPS (printer)->remote = remote_printer;
gtk_printer_set_is_paused (printer, is_paused);
gtk_printer_set_is_accepting_jobs (printer, is_accepting_jobs);
@@ -1866,7 +2104,8 @@ cups_request_printer_list (GtkPrintBackendCups *cups_backend)
"printer-is-accepting-jobs",
"job-sheets-supported",
"job-sheets-default",
"printer-type"
"printer-type",
"auth-info-required"
};
if (cups_backend->list_printers_pending)
@@ -1875,8 +2114,23 @@ cups_request_printer_list (GtkPrintBackendCups *cups_backend)
state = gtk_cups_connection_test_get_state (cups_backend->cups_connection_test);
update_backend_status (cups_backend, state);
if (cups_backend->list_printers_attempts == 60)
{
cups_backend->list_printers_attempts = -1;
if (cups_backend->list_printers_poll > 0)
g_source_remove (cups_backend->list_printers_poll);
cups_backend->list_printers_poll = gdk_threads_add_timeout (200,
(GSourceFunc) cups_request_printer_list,
cups_backend);
}
else if (cups_backend->list_printers_attempts != -1)
cups_backend->list_printers_attempts++;
if (state == GTK_CUPS_CONNECTION_IN_PROGRESS || state == GTK_CUPS_CONNECTION_NOT_AVAILABLE)
return TRUE;
else
if (cups_backend->list_printers_attempts > 0)
cups_backend->list_printers_attempts = 60;
cups_backend->list_printers_pending = TRUE;
@@ -1914,9 +2168,9 @@ cups_get_printer_list (GtkPrintBackend *backend)
if (cups_backend->list_printers_poll == 0)
{
if (cups_request_printer_list (cups_backend))
cups_backend->list_printers_poll = gdk_threads_add_timeout_seconds (3,
(GSourceFunc) cups_request_printer_list,
backend);
cups_backend->list_printers_poll = gdk_threads_add_timeout (50,
(GSourceFunc) cups_request_printer_list,
backend);
}
}
@@ -1985,7 +2239,7 @@ done:
GDK_THREADS_LEAVE ();
}
static void
static gboolean
cups_request_ppd (GtkPrinter *printer)
{
GError *error;
@@ -2005,6 +2259,41 @@ cups_request_ppd (GtkPrinter *printer)
GTK_NOTE (PRINTING,
g_print ("CUPS Backend: %s\n", G_STRFUNC));
if (cups_printer->remote)
{
GtkCupsConnectionState state;
state = gtk_cups_connection_test_get_state (cups_printer->remote_cups_connection_test);
if (state == GTK_CUPS_CONNECTION_IN_PROGRESS)
{
if (cups_printer->get_remote_ppd_attempts == 60)
{
cups_printer->get_remote_ppd_attempts = -1;
if (cups_printer->get_remote_ppd_poll > 0)
g_source_remove (cups_printer->get_remote_ppd_poll);
cups_printer->get_remote_ppd_poll = gdk_threads_add_timeout (200,
(GSourceFunc) cups_request_ppd,
printer);
}
else if (cups_printer->get_remote_ppd_attempts != -1)
cups_printer->get_remote_ppd_attempts++;
return TRUE;
}
gtk_cups_connection_test_free (cups_printer->remote_cups_connection_test);
cups_printer->remote_cups_connection_test = NULL;
cups_printer->get_remote_ppd_poll = 0;
cups_printer->get_remote_ppd_attempts = 0;
if (state == GTK_CUPS_CONNECTION_NOT_AVAILABLE)
{
g_signal_emit_by_name (printer, "details-acquired", FALSE);
return FALSE;
}
}
http = httpConnectEncrypt (cups_printer->hostname,
cups_printer->port,
cupsEncryption ());
@@ -2034,7 +2323,7 @@ cups_request_ppd (GtkPrinter *printer)
g_free (data);
g_signal_emit_by_name (printer, "details-acquired", FALSE);
return;
return FALSE;
}
data->http = http;
@@ -2072,6 +2361,8 @@ cups_request_ppd (GtkPrinter *printer)
g_free (resource);
g_free (ppd_filename);
return FALSE;
}
/* Ordering matters for default preference */
@@ -2244,9 +2535,9 @@ cups_get_default_printer (GtkPrintBackendCups *backend)
if (cups_backend->default_printer_poll == 0)
{
if (cups_request_default_printer (cups_backend))
cups_backend->default_printer_poll = gdk_threads_add_timeout (500,
(GSourceFunc) cups_request_default_printer,
backend);
cups_backend->default_printer_poll = gdk_threads_add_timeout (200,
(GSourceFunc) cups_request_default_printer,
backend);
}
}
@@ -2369,7 +2660,22 @@ cups_printer_request_details (GtkPrinter *printer)
cups_printer = GTK_PRINTER_CUPS (printer);
if (!cups_printer->reading_ppd &&
gtk_printer_cups_get_ppd (cups_printer) == NULL)
cups_request_ppd (printer);
{
if (cups_printer->remote)
{
if (cups_printer->get_remote_ppd_poll == 0)
{
cups_printer->remote_cups_connection_test = gtk_cups_connection_test_new (cups_printer->hostname);
if (cups_request_ppd (printer))
cups_printer->get_remote_ppd_poll = gdk_threads_add_timeout (50,
(GSourceFunc) cups_request_ppd,
printer);
}
}
else
cups_request_ppd (printer);
}
}
static char *
@@ -77,6 +77,11 @@ gtk_printer_cups_init (GtkPrinterCups *printer)
printer->ppd_file = NULL;
printer->default_cover_before = NULL;
printer->default_cover_after = NULL;
printer->remote = FALSE;
printer->get_remote_ppd_poll = 0;
printer->get_remote_ppd_attempts = 0;
printer->remote_cups_connection_test = NULL;
printer->auth_info_required = NULL;
}
static void
@@ -94,10 +99,17 @@ gtk_printer_cups_finalize (GObject *object)
g_free (printer->ppd_name);
g_free (printer->default_cover_before);
g_free (printer->default_cover_after);
g_strfreev (printer->auth_info_required);
if (printer->ppd_file)
ppdClose (printer->ppd_file);
if (printer->get_remote_ppd_poll > 0)
g_source_remove (printer->get_remote_ppd_poll);
printer->get_remote_ppd_attempts = 0;
gtk_cups_connection_test_free (printer->remote_cups_connection_test);
G_OBJECT_CLASS (gtk_printer_cups_parent_class)->finalize (object);
}
@@ -23,6 +23,7 @@
#include <glib-object.h>
#include <cups/cups.h>
#include <cups/ppd.h>
#include "gtkcupsutils.h"
#include <gtk/gtkunixprint.h>
@@ -47,6 +48,7 @@ struct _GtkPrinterCups
gchar *printer_uri;
gchar *hostname;
gint port;
gchar **auth_info_required;
ipp_pstate_t state;
gboolean reading_ppd;
@@ -55,6 +57,11 @@ struct _GtkPrinterCups
gchar *default_cover_before;
gchar *default_cover_after;
gboolean remote;
guint get_remote_ppd_poll;
gint get_remote_ppd_attempts;
GtkCupsConnectionTest *remote_cups_connection_test;
};
struct _GtkPrinterCupsClass
@@ -278,8 +278,6 @@ lpr_write (GIOChannel *source,
{
gsize bytes_written;
signal (SIGPIPE, SIG_IGN);
g_io_channel_write_chars (ps->in,
buf,
bytes_read,
+1 -1
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties 2.6-branch\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2004-03-30 17:02+0200\n"
"Last-Translator: Zuza Software Foundation <info@translate.org.za>\n"
"Language-Team: Afrikaans <translate-discuss-af@lists.sourceforge.net>\n"
+1 -1
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+ 2.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2003-01-14 11:02+EDT\n"
"Last-Translator: Ge'ez Frontier Foundation <locales@geez.org>\n"
"Language-Team: Amharic <locales@geez.org>\n"
+1 -1
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties OE\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2004-08-26 16:32-0600\n"
"Last-Translator: James Johnson <modean52@comcast.net>\n"
"Language-Team: Old English <modean52@comcast.net>\n"
+1 -1
View File
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties.HEAD.ar\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2008-09-18 02:19+0300\n"
"Last-Translator: Anas Afif Emad <anas.e87@gmail.com>\n"
"Language-Team: Arabic <doc@arabeyes.org>\n"
+1 -1
View File
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: as\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-09-16 11:40+0530\n"
"Last-Translator: \n"
"Language-Team: American English <>\n"
+1 -1
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ast\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-01-25 13:10+0200\n"
"Last-Translator: Esbardu <esguil@terra.es>\n"
"Language-Team: Asturian <xspuente@gmail.com>\n"
+1 -1
View File
@@ -32,7 +32,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties.HEAD\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2004-03-07 18:05+0200\n"
"Last-Translator: Mətin Əmirov <metin@karegen.com>\n"
"Language-Team: Azerbaijani Turkish <translation-team-az@lists.sourceforge."
+1 -1
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties gtk-2-4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2004-09-27 15:41+0330\n"
"Last-Translator: Amir Hedayaty <amir@bamdad.org>\n"
"Language-Team: Iranian Azerbaijani <az-ir@lists.sharif.edu>\n"
+1 -1
View File
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+ 2.2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2003-03-31 07:40+0300\n"
"Last-Translator: Ales Nyakhaychyk <nab@mail.by>\n"
"Language-Team: Belarusian <i18n@mova.org>\n"
+1 -1
View File
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2007-12-09 14:44+0200\n"
"Last-Translator: Alaksandar Navicki <zolak@lacinka.org>\n"
"Language-Team: i18n@mova.org <i18n@mova.org>\n"
+1 -1
View File
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-08-22 19:04+0300\n"
"Last-Translator: Alexander Shopov <ash@contact.bg>\n"
"Language-Team: Bulgarian <dict@fsa-bg.org>\n"
+1 -1
View File
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties HEAD\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2006-09-03 15:50+0600\n"
"Last-Translator: Khandakar Mujahidul Islam <suzan@bengalinux.org>\n"
"Language-Team: Bangla <gnome-translation@BengaLinux.Org>\n"
+1 -1
View File
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: bn_IN\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-09-16 16:05+0530\n"
"Last-Translator: Runa Bhattacharjee <runab@redhat.com>\n"
"Language-Team: Bengali INDIA <anubad@lists.ankur.org.in>\n"
+1 -1
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 2.3.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-08-01 01:16+0100\n"
"Last-Translator: Denis\n"
"Language-Team: br <LL@li.org>\n"
+1 -1
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties.gtk-2-4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2004-07-19 00:47+0200\n"
"Last-Translator: Kenan Hadžiavdić <kenan@bgnett.no>\n"
"Language-Team: Bosnian <lokal@linux.org.ba>\n"
+1 -1
View File
@@ -26,7 +26,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+ 2.3.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-08-24 20:09+0200\n"
"Last-Translator: David Planella <david.planella@gmail.com>\n"
"Language-Team: Catalan <tradgnome@softcatala.org>\n"
+1 -1
View File
@@ -28,7 +28,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties.gtk-2-16\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-08-10 08:39+0200\n"
"Last-Translator: Carles Ferrando Garcia <carles.ferrando@gmail.com>\n"
"Language-Team: catalan <tradgnome@softcatala.org>\n"
+1 -1
View File
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-04-09 04:32-0500\n"
"Last-Translator: Reşat SABIQ <tilde.birlik@gmail.com>\n"
"Language-Team: Qırımtatarca (Qırım Türkçesi) <tilde-birlik-tercime@lists."
+1 -1
View File
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-08-30 18:26+0200\n"
"Last-Translator: Petr Kovar <pknbe@volny.cz>\n"
"Language-Team: Czech <gnome-cs-list@gnome.org>\n"
+1 -1
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+ 2.2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2007-05-14 22:44-0000\n"
"Last-Translator: Rhys Jones <rhys@sucs.org>\n"
"Language-Team: Cymraeg <gnome-cy@pengwyn.linux.org.uk>\n"
+1 -1
View File
@@ -47,7 +47,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-09-13 02:50+0200\n"
"Last-Translator: Ask Hjorth Larsen <asklarsen@gmail.com>\n"
"Language-Team: Danish <dansk@dansk-gruppen.dk>\n"
+1 -1
View File
@@ -16,7 +16,7 @@ msgid ""
msgstr ""
"Project-Id-Version: GTK+ HEAD\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-09-16 12:11+0200\n"
"Last-Translator: Christian Kirbach <Christian.Kirbach@googlemail.com>\n"
"Language-Team: German <gnome-de@gnome.org>\n"
+1 -1
View File
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties.HEAD.dz\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2006-07-18 17:40+0530\n"
"Last-Translator: Mindu Dorji\n"
"Language-Team: DZONGKHA <pgeyleg@dit.gov.bt>\n"
+1 -1
View File
@@ -26,7 +26,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties.HEAD\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-03-27 09:21+0200\n"
"Last-Translator: Jennie Petoumenou <epetoumenou@gmail.com>\n"
"Language-Team: Greek <team@gnome.gr>\n"
+1 -1
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2005-07-22 22:53-0400\n"
"Last-Translator: Adam Weinberger <adamw@gnome.org>\n"
"Language-Team: Canadian English <adamw@gnome.org>\n"
+9 -9
View File
@@ -7,9 +7,9 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-09-08 20:06+0100\n"
"Last-Translator: Bruce Cowan <bcowan@fastmail.co.uk>\n"
"Last-Translator: Philip Withnall <philip@tecnocode.co.uk>\n"
"Language-Team: British English <en@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -2564,11 +2564,11 @@ msgstr "If TRUE, the popup window will have the same size as the entry"
#: gtk/gtkentrycompletion.c:373
msgid "Popup single match"
msgstr "Pop-up single match"
msgstr "Popup single match"
#: gtk/gtkentrycompletion.c:374
msgid "If TRUE, the popup window will appear for a single match."
msgstr "If TRUE, the pop-up window will appear for a single match."
msgstr "If TRUE, the popup window will appear for a single match."
#: gtk/gtkentrycompletion.c:388
msgid "Inline selection"
@@ -3372,7 +3372,7 @@ msgstr "Whether this link has been visited."
#: gtk/gtkmenu.c:502
msgid "The currently selected menu item"
msgstr "The currently-selected menu item"
msgstr "The currently selected menu item"
#: gtk/gtkmenu.c:517
msgid "The accel group holding accelerators for the menu"
@@ -3393,7 +3393,7 @@ msgstr "Attach Widget"
#: gtk/gtkmenu.c:549
msgid "The widget the menu is attached to"
msgstr "The widget to which the menu is attached"
msgstr "The widget the menu is attached to"
#: gtk/gtkmenu.c:557
msgid ""
@@ -3417,7 +3417,7 @@ msgstr "Monitor"
#: gtk/gtkmenu.c:587
msgid "The monitor the menu will be popped up on"
msgstr "The monitor on which the menu will be popped up"
msgstr "The monitor the menu will be popped up on"
#: gtk/gtkmenu.c:593
msgid "Vertical Padding"
@@ -4054,7 +4054,7 @@ msgstr "Socket Window"
#: gtk/gtkplug.c:166
msgid "The window of the socket the plug is embedded in"
msgstr "The window of the socket in which the plug is embedded"
msgstr "The window of the socket the plug is embedded in"
#: gtk/gtkpreview.c:102
msgid ""
@@ -6416,7 +6416,7 @@ msgstr "Search Column"
#: gtk/gtktreeview.c:634
msgid "Model column to search through during interactive search"
msgstr "Model column through which to search during an interactive search"
msgstr "Model column to search through during interactive search"
#: gtk/gtktreeview.c:654
msgid "Fixed Height Mode"
+1 -1
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties 2.10\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2007-03-11 18:09+0100\n"
"Last-Translator: Guillaume Savaton <llumeao@gmail.com>\n"
"Language-Team: Eo-Tradukado <http://eo-tradukado.tuxfamily.org>\n"
+1 -1
View File
@@ -15,7 +15,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties.HEAD\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-08-22 12:10+0200\n"
"Last-Translator: Jorge González <jorgegonz@svn.gnome.org>\n"
"Language-Team: Español <gnome-es-list@gnome.org>\n"
+1 -1
View File
@@ -15,7 +15,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties HEAD\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-08-22 21:37+0300\n"
"Last-Translator: Ivar Smolin <okul@linux.ee>\n"
"Language-Team: Estonian <gnome-et@linux.ee>\n"
+1 -1
View File
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: eu\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-08-26 10:14+0200\n"
"Last-Translator: Iñaki Larrañaga Murgoitio <dooteo@euskalgnu.org>\n"
"Language-Team: Basque <itzulpena@euskalgnu.org>\n"
+1 -1
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+ 2.3.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2004-01-03 17:49+0330\n"
"Last-Translator: Roozbeh Pournader <roozbeh@sharif.edu>\n"
"Language-Team: Persian <farsi@lists.sharif.edu>\n"
+1 -1
View File
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-08-27 22:12+0300\n"
"Last-Translator: Tommi Vainikainen <thv@iki.fi>\n"
"Language-Team: Finnish <gnome-fi-laatu@lists.sourceforge.net>\n"
+1 -1
View File
@@ -18,7 +18,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+_properties HEAD\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-09-01 09:38+0200\n"
"Last-Translator: Bruno Brouard <annoa.b@gmail.com>\n"
"Language-Team: GNOME French Team <gnomefr@traduc.org>\n"
+1 -1
View File
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+.master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-08-08 02:22-0600\n"
"Last-Translator: Seán de Búrca <leftmostcat@gmail.com>\n"
"Language-Team: Irish <gaeilge-gnulinux@lists.sourceforge.net>\n"
+1 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties.master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-08-19 14:04+0200\n"
"Last-Translator: Antón Méixome <meixome@mancomun.org>\n"
"Language-Team: Galician <gnome@mancomun.org>\n"
+1 -1
View File
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties.master.gu\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-09-16 10:49+0530\n"
"Last-Translator: Sweta Kothari <swkothar@redhat.com>\n"
"Language-Team: Gujarati\n"
+1 -1
View File
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+.HEAD.he\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-09-01 13:48+0200\n"
"Last-Translator: Yaron Shahrabani <sh.yaron@gmail.com>\n"
"Language-Team: Hebrew <he@li.org>\n"
+1 -1
View File
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties.master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-08-26 11:47+0530\n"
"Last-Translator: Rajesh Ranjan <rajesh672@gmail.com>\n"
"Language-Team: Hindi <hindi.sf.net>\n"
+1 -1
View File
@@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties 0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2008-05-08 00:47+0000\n"
"Last-Translator: Robert Sedak <Unknown>\n"
"Language-Team: Croatian <lokalizacija@linux.hr>\n"
+1 -1
View File
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-09-03 02:47+0200\n"
"Last-Translator: Gabor Kelemen <kelemeng at gnome dot hu>\n"
"Language-Team: Hungarian <gnome at fsf dot hu>\n"
+1 -1
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+.HEAD.hy\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2005-07-19 17:50+0500\n"
"Last-Translator: Norayr Chilingaryan\n"
"Language-Team: <norik@freenet.am>\n"
+1 -1
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+ 1.3\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2000-10-27 02:02+0100\n"
"Last-Translator: Robert Brady <rwb197@zepler.org>\n"
"Language-Team: Interlingua\n"
+1 -1
View File
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+ HEAD\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2006-03-24 15:19+0700\n"
"Last-Translator: Mohammad DAMT <mdamt@bisnisweb.com>\n"
"Language-Team: Indonesia <kontak@id.gnome.org>\n"
+1 -1
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+ 2.12.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2007-09-18 19:25-0500\n"
"Last-Translator: Michael Terry <mike@mterry.name>\n"
"Language-Team: Ido <gnome-ido@lists.mterry.name>\n"
+1 -1
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk 2.2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2003-07-22 16:05+0000\n"
"Last-Translator: Richard Allen <ra@ra.is>\n"
"Language-Team: is <is@li.org>\n"
+1 -1
View File
@@ -34,7 +34,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-09-21 22:41+0200\n"
"Last-Translator: Luca Ferretti <elle.uca@libero.it>\n"
"Language-Team: Italian <tp@lists.linux.it>\n"
+1 -1
View File
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-09-06 18:05+0900\n"
"Last-Translator: Takayuki KUSANO <AE5T-KSN@asahi-net.or.jp>\n"
"Language-Team: Japanese <gnome-translation@gnome.gr.jp>\n"
+1 -1
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ka\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2008-03-19 16:31+0100\n"
"Last-Translator: Vladimer Sichinava ვლადიმერ სიჭინავა <vsichi@gnome.org>\n"
"Language-Team: Georgian <http://mail.gnome.org/mailman/listinfo/gnome-ge-"
+1 -1
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties.master.kn\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-08-30 21:46+0530\n"
"Last-Translator: Shankar Prasad <svenkate@redhat.com>\n"
"Language-Team: Kannada <en@li.org>\n"
+1 -1
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties.HEAD\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-08-23 01:32+0900\n"
"Last-Translator: Eunju Kim <eukim@redhat.com>\n"
"Language-Team: GNOME Korea <gnome-kr-hackers@lists.kldp.net>\n"
+1 -1
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ku\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2006-01-16 19:14+0100\n"
"Last-Translator: Erdal Ronahi <erdal.ronahi@gmail.com>\n"
"Language-Team: Kurdish <ku@li.org>\n"
+1 -1
View File
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+ 2.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2003-05-28 17:57+0000\n"
"Last-Translator: Mathieu van Woerkom <mathieu.brabants.org>\n"
"Language-Team: Limburgish <li.org>\n"
+1 -1
View File
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: lt\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-09-10 13:45+0300\n"
"Last-Translator: Gintautas Miliauskas <gintautas@miliauskas.lt>\n"
"Language-Team: Lithuanian <gnome-lt@lists.akl.lt>\n"
+1 -1
View File
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties.HEAD\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-02-19 09:32+0200\n"
"Last-Translator: Raivis Dejus <orvils@gmail.com>\n"
"Language-Team: Latvian <locale@laka.lv>\n"
+1 -1
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties.master.mai\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-22 23:32-0400\n"
"POT-Creation-Date: 2009-09-30 17:31-0400\n"
"PO-Revision-Date: 2009-09-20 12:21+0530\n"
"Last-Translator: Rajesh Ranjan <rajesh672@gmail.com>\n"
"Language-Team: Hindi <hindi.sf.net>\n"

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