Compare commits

..
Author SHA1 Message Date
608c99d92d gtktreeview: reduce validation stalls for fixed-height file lists
Use a shorter validation idle budget on general targets while retaining a longer ARMv6 budget for weak single-core hardware.

Add an internal fixed-height-mode helper for FileChooser rows whose height is width-independent, and avoid unnecessary scrolling work when the first root row is already visible.
2026-09-01 11:56:04 +02:00
7af69af9c8 gtkiconview: slice layout work across main loop iterations
Make GtkIconView layout resumable and time-slice row processing so large models do not monopolize the main loop.

Preserve layout state across idle iterations, avoid redundant relayout from size allocation, and keep hit testing and visible-range queries safe while layout is still in progress.
2026-09-01 11:52:17 +02:00
6501755d7b filechooser: avoid repeated icon view visible-range scans
Cache the GtkIconView viewport and refresh it cooperatively on layout, allocation and adjustment changes instead of repeatedly scanning visible ranges for individual cells.

Reuse the cached range for nearby thumbnail prioritization and icon cache invalidation, while preserving the existing list-view path and thumbnail scheduling semantics.
2026-09-01 11:38:46 +02:00
d0c833a8a7 gtkfilesystemmodel: make directory loading cooperative and race-safe
Rework GtkFileSystemModel around stable node IDs, sparse value caching and cooperative directory integration.

Time-slice initial sorting, visibility publication and monitor replay so large directories do not block the main loop. Queue monitor changes during loading and prevent stale asynchronous monitor queries from resurrecting deleted or superseded files.

Delay FileChooser model publication until loading and replay complete, and apply the initial sort directly to the browse model.
2026-09-01 11:28:00 +02:00
437b7949dd filechooser: clarify nearby thumbnail priority 2026-05-29 13:28:47 +02:00
781d8c974a filechooser: prioritize nearby thumbnail jobs 2026-05-29 13:12:33 +02:00
79f3ac57e5 filechooser: prioritize visible thumbnail jobs 2026-05-29 13:05:22 +02:00
0d8a8a1183 filechooser: cache thumbnail placeholder icons 2026-05-29 11:52:39 +02:00
f9c1469267 filechooser: render cached thumbnails asynchronously 2026-05-29 11:41:25 +02:00
1d4ea5dac3 filechooser: skip stale thumbnail queue entries 2026-05-29 11:15:07 +02:00
d83e126644 filechooser: validate cached thumbnail dimensions 2026-05-29 11:01:30 +02:00
95a727c219 gtkfilechooser: improve preview and thumbnail responsiveness 2026-05-28 12:03:22 +02:00
2ccdfc445d gtkfilechooser: preserve location entry selection after typed folder changes 2026-05-28 11:00:41 +02:00
d4f2313aee gtkfilechooser: improve location edit button 2026-05-27 15:14:49 +02:00
d24ca42b24 gtkfilechooser: keep location entry path current 2026-05-26 20:45:56 +02:00
e6f3ed4f69 gtkfilechooser: support dropping files onto folders 2026-05-26 14:20:47 +02:00
b98239c5a4 gtkfilechooser: dim hidden file icons 2026-05-26 11:53:13 +02:00
7a557c5540 po: add German file chooser translations 2026-05-22 12:04:35 +02:00
6c9ebd69ca gtkfilechooser: copy dropped files into current folder 2026-05-22 11:00:49 +02:00
d416fe6936 gtkfilechooser: provide URI data when dragging files 2026-05-22 10:54:35 +02:00
badfe1295a gtkfilechooser: dim cut file icons 2026-05-22 10:06:24 +02:00
073b38a0f5 gtkfilechooser: clear cut feedback when clipboard changes 2026-05-22 09:55:28 +02:00
9436bc7ce0 gtkfilechooser: track cut files for visual feedback 2026-05-22 09:51:44 +02:00
3961ed8f46 gtkfilechooser: paste files from file list shortcut 2026-05-22 09:30:26 +02:00
325da813f3 gtkfilechooser: add file list keyboard shortcuts 2026-05-22 09:20:17 +02:00
d0f1c474de gtkfilechooser: avoid refresh after cancelled paste conflict 2026-05-22 09:05:01 +02:00
27e4b3901a gtkfilechooser: let users rename pasted files on conflict 2026-05-21 23:28:02 +02:00
da0dd44412 gtkfilechooser: avoid repeated selection counts in popup menu 2026-05-21 22:22:27 +02:00
54e988a8ad gtkfilechooser: open containing folders from popup menus 2026-05-21 21:58:31 +02:00
bbea4b5e33 gtkfilechooser: move files to trash from popup menu 2026-05-21 21:23:36 +02:00
3f6d93db49 gtkfilechooser: paste files from clipboard 2026-05-21 20:48:19 +02:00
359911d11a gtkfilechooser: add paste menu item 2026-05-21 20:13:53 +02:00
6594e77f7a gtkfilechooser: add file copy and cut menu items 2026-05-21 19:55:16 +02:00
bdad1edd93 gtkfilechooser: refresh thumbnails after folder load 2026-05-21 19:52:59 +02:00
01d7b18802 gtkfilechooser: keep thumbnail queue across view changes 2026-05-21 10:21:30 +02:00
8571f59136 gtkfilechooser: queue thumbnails from cached icon path 2026-05-21 10:13:23 +02:00
e79b989e7a gtkfilechooser: tidy thumbnail cache prototype 2026-05-21 09:20:46 +02:00
ed029de53d gtkfilechooser: choose thumbnail cache size 2026-05-20 18:04:25 +02:00
793d059d38 gtkfilechooser: document thumbnail loader requirements 2026-05-20 16:35:56 +02:00
1ad3bfdd64 gtkfilechooser: persist generated thumbnails 2026-05-20 16:26:34 +02:00
59679d00f1 gtkfilechooser: prepare thumbnail worker scheduling 2026-05-20 14:46:45 +02:00
ac2c4e808d gtkfilechooser: drain thumbnail queue asynchronously 2026-05-20 14:37:34 +02:00
fd799a203b gtkfilechooser: queue visible image files for thumbnails 2026-05-20 13:28:45 +02:00
67820cc624 gtkfilechooser: add thumbnail toggle setting 2026-05-20 13:24:50 +02:00
0bd9ec1e5e gtkfilechooser: add thumbnail queue state 2026-05-20 12:35:50 +02:00
bd62ff6717 gtkfilechooser: query metadata for thumbnail generation 2026-05-20 12:27:57 +02:00
7974c98490 gtkfilechooser: query metadata for thumbnail generation 2026-05-20 12:09:01 +02:00
aa46d1cd22 gtkfilechooser: tune compact view spacing 2026-05-20 10:54:16 +02:00
fb60703d21 gtkfilechooser: improve preview panel details 2026-05-20 10:41:05 +02:00
a87dbdb9a9 gtkfilechooser: improve file chooser tooltips 2026-05-20 10:28:23 +02:00
7b0f4f4b8a gtkfilechooser: improve file tooltips 2026-05-19 14:17:20 +02:00
dc0b67f1e2 gtkfilechooser: add cached icon view tooltips 2026-05-19 13:11:13 +02:00
281f231d73 gtkfilechooser: improve preview panel 2026-05-19 12:13:14 +02:00
2a67316003 gtkfilechooser: add preview panel toggle 2026-05-19 09:53:59 +02:00
1706e775d6 gtkfilechooser: add rename menu item 2026-05-19 08:33:53 +02:00
cf8531cd0d gtkfilechooser: add compact view mode 2026-05-18 20:15:48 +02:00
ff8d4f899d gtkfilechooser: add copy location menu item 2026-05-18 19:32:36 +02:00
8786714cc9 gtkfilechooser: select clicked file before popup menu 2026-05-18 18:42:03 +02:00
cbfe8477fb gtkfilesystemmodel: avoid sorting twice for newly queried files
_gtk_file_system_model_update_file() adds unknown files through add_file(), which already sorts the model. gtk_file_system_model_query_done() then sorted again unconditionally after the update.

Remember whether the file was already present before updating it, and only request the extra sort for existing files. This avoids redundant sorting for newly discovered files while keeping the existing update behaviour for known files.
2026-05-18 17:54:21 +02:00
06167dfa59 configure: include pango packages in GTK cflags 2026-05-16 09:24:49 +02:00
685dbf9bbc fontsel: remove unused selection timeout helpers 2026-05-15 22:47:24 +02:00
b74c87f355 gtk: cache font face descriptions while sorting 2026-05-15 22:36:52 +02:00
4c60091657 gtk: cache font family sort keys 2026-05-15 18:04:40 +02:00
f10e451bad gtk: update selected font style and size immediately 2026-05-15 17:38:55 +02:00
5806b7f34d gtk: update selected font family immediately 2026-05-15 17:35:59 +02:00
2e454a61ba cups: release secrets task resources 2026-05-15 16:35:47 +02:00
01df2249df gtk: avoid overallocating module paths 2026-05-15 16:19:36 +02:00
7c9df99170 gtk: reuse cached module path 2026-05-15 16:11:57 +02:00
d0628c6856 gtk: avoid unused immodule query symbols 2026-05-15 15:55:10 +02:00
095225e496 gtk: preserve strftime calendar names 2026-05-15 15:48:44 +02:00
e6873c2cd5 gail: avoid formatting string attribute values 2026-05-15 15:46:15 +02:00
55d5543eed gtk: limit direct module paths to GTK_PATH 2026-05-15 15:34:32 +02:00
76a7700091 gtk: check win32 stdio lock fallbacks 2026-05-15 15:21:02 +02:00
f5bafd1b8e gtk: reject unquoted strings in immodule parser 2026-05-15 15:09:45 +02:00
fedfe60e0e treewide: fix whitespace in changed files 2026-05-15 13:11:07 +02:00
83405a2c8b gail: clarify paned value conversion 2026-05-15 13:01:13 +02:00
a0b2f2491f gail: unset temporary values in paned test 2026-05-15 12:04:10 +02:00
94f030875f gail: use modern value API in paned test 2026-05-15 11:17:48 +02:00
3591e29913 gail: implement modern paned value interface 2026-05-15 11:07:09 +02:00
10e7514987 gail: use component extents in tests 2026-05-15 10:41:08 +02:00
839ed23770 gtk: use component extents for accessible positions 2026-05-15 10:33:12 +02:00
9eb83c3501 gail: use component extents for image positions 2026-05-15 10:15:55 +02:00
dbe993a4dd gtk: use returned text btree string buffer 2026-05-15 10:08:06 +02:00
d7a517a0b0 Merge branch 'vendor-patch-imports-2026-05' into warning-cleanups 2026-05-15 09:42:12 +02:00
f6142b10c9 Merge remote-tracking branch 'origin/master' into warning-cleanups 2026-05-15 09:40:48 +02:00
9423346201 gtk: include local module path fallback 2026-05-15 09:39:48 +02:00
de9f5196fa configure: add rpath-link flags for custom library prefixes
When building with a custom library prefix, GNU ld may find a directly
linked shared library through -L but fail to locate that library's indirect
DT_NEEDED dependencies from the same prefix.

Derive -Wl,-rpath-link entries from existing LDFLAGS -L paths on Linux.
This improves configure tests for musl, cross-toolchain and custom-prefix
builds without changing the pkg-config dependency set.
2026-05-15 08:56:41 +02:00
c062dcb54d updateiconcache: sort directory entries before scanning
Based on the openSUSE gtk2-updateiconcache_sort.patch.

Sort directory entries while building the icon cache so cache output is deterministic, but keep the implementation portable by using GLib arrays instead of scandir()/alphasort(). Also free the scanned directory path before returning.
2026-05-14 15:00:25 +02:00
dda8c3764a fontsel: use insert_with_values when populating lists
Use gtk_list_store_insert_with_values() for font family, style and size list population to avoid separate append/set updates while preserving the same inserted values and row selection behavior.
2026-05-14 14:37:46 +02:00
3501d8c4f5 fontsel: defer expensive selection updates
Based on the openSUSE gtk2-bnc130159-bgo319483-async-selection-in-gtk-font-selection.diff.

Coalesce font family, style and size selection updates with short timeouts to keep GtkFontSelection responsive while preserving immediate updates for internal programmatic selection changes.
2026-05-13 13:20:06 +02:00
0c87680876 cups: wire Secret Service storage into authentication flow
Use the imported Secret Service helper to optionally store CUPS authentication data when a secrets service is available and the user enables password remembering.

Keep the GtkPrintBackend request-password signal and gtk_print_backend_set_password() ABI unchanged by passing the transient UI state through private object data.
2026-05-13 12:56:13 +02:00
dab59b874b print: add optional remember-password UI state
Prepare the print authentication dialog for backends that can store credentials without changing the request-password signal or gtk_print_backend_set_password() ABI.

This keeps the openSUSE CUPS Secret Service feature ABI-conservative for gtk2-ng.
2026-05-13 12:36:45 +02:00
0d089cd6de cups: build Secret Service authentication helper
Wire the imported CUPS Secret Service helper into the CUPS print backend build.
2026-05-13 12:31:14 +02:00
2901f63d0d cups: add Secret Service helper for print authentication
Based on the openSUSE gtk2-bgo743166-remember-printing-authentication.patch.

Add the CUPS Secret Service helper source files separately before wiring them into the print backend.
2026-05-13 12:23:35 +02:00
438c13366a fontsel: localize common font style names
Based on the openSUSE bugzilla-129753-gtk+-2.8.9-localize-font-style-name.diff.

Mark common font style names for translation and use translated names in the font selection UI when Pango returns standard style names.
2026-05-13 12:12:49 +02:00
02a2c61f2d gdk: handle 30-bit RGB drawables in GdkRGB
Based on the openSUSE gtk2-bgo625202-30-bit-drawables-remain-black.patch.

Add a dedicated conversion path for 32bpp 30-bit truecolor visuals so 8-bit RGB source data is expanded to 10-bit channels instead of producing black or overly dark output.
2026-05-13 11:54:31 +02:00
525150055d print: preserve default-printer wait during status updates
Based on the openSUSE gtk2-default-printer.patch.

Avoid treating printer status updates as user-driven printer selection changes, so the print dialog can continue waiting for a default printer that may appear later.
2026-05-13 11:46:52 +02:00
7cc56a9965 gtktrayicon: use explicit void prototypes for reserved slots
Based on the Mageia gtk+-2.24.32-warnings.patch.

Declare the reserved GtkTrayIconClass function pointers with explicit void parameter lists to avoid strict-prototype warnings without changing the class layout.
2026-05-13 11:25:19 +02:00
1ae5c7beec docs: use top_srcdir for GDK X11 header reference
Based on the MSYS2 0005-Fix-header-ref.all.patch.

Use an explicit top_srcdir-relative path for gdkx.h in the GDK reference documentation instead of a fragile relative path.
2026-05-13 10:55:56 +02:00
06974f39fc introspection: include Win32 keymap declarations
Add gdkwin32keys.h to the Win32 introspection source list so exported Win32 keymap APIs are visible in GdkWin32-2.0.gir.

The corresponding gdk_win32_keymap_get_type() and gdk_win32_keymap_check_compose() symbols are already exported, so this keeps the GIR closer to the installed Win32 API surface.
2026-05-13 10:48:39 +02:00
4cde9b16fd introspection: add GdkWin32 GIR generation
Based on the MSYS2 0011-gir-for-gdkwin32.mingw.patch.

Add Win32 backend sources to introspection when building the Win32 target and generate GdkWin32-2.0.gir alongside the common Gdk-2.0 GIR.
2026-05-13 10:48:27 +02:00
cc3ccba88d introspection: pass compiler and GTK DLL path to scanner
Based on the MSYS2 0009-give-cc-to-gir-scanner.mingw.patch and 0010-put-gtk-dll-into-path.mingw.patch.

Pass CC to g-ir-scanner and add the GTK build directory to PATH while scanning GTK, so MinGW builds can run the scanner with the just-built DLLs.
2026-05-13 10:19:49 +02:00
442630afe5 win32: quote icon cache manifest in resource file
Based on the MSYS2 0024-gtk-update-icon-cache-rc-quote.patch.

Quote the manifest path when generating the gtk-update-icon-cache resource file so windres parses it correctly.
2026-05-13 10:09:36 +02:00
45fc03183e win32: initialize key state before updating keymap
Based on the MSYS2 0023-gdkkeys-win32.c-fix-initialisation-of-key_state-in-u.patch.

Clear the key_state array before using it during keymap updates so stale state cannot affect layout handling, including Japanese IME input.
2026-05-13 10:08:01 +02:00
e42049b412 icontheme: detect SVG icons by extension on Win32
Based on the MSYS2 0022-icontheme-win32-detect-SVG-files-by-extension.patch.

Some Windows systems report .svg files with a generic or incorrect content type. On Win32, fall back to the .svg extension so SVG icons can still be detected.
2026-05-13 10:07:25 +02:00
cd4145185c win32: improve mouse window lookup through transparent children
Based on the MSYS2 0013_fix_mouse_events.patch.

Use CWP_SKIPTRANSPARENT while walking from the desktop window, but stop skipping transparent windows after the first level so transparent child windows are still considered correctly.
2026-05-13 10:06:34 +02:00
b305265dea quartz: avoid extra resize-idle updates on Big Sur and newer
Based on part of the MacPorts Big Sur performance patch for GIMP issue 5989.

Keep the existing gdk_window_process_all_updates() call for non-Quartz targets and for older macOS releases, but avoid this extra resize-idle update path on Big Sur and newer where it can contribute to expensive full-window redraw behaviour.
2026-05-13 09:59:26 +02:00
243fcad89f quartz: avoid extra content invalidation on Big Sur and newer
Based on part of the MacPorts Big Sur performance patch for GIMP issue 5989.

Keep the existing Mojave-era setNeedsDisplay workaround for macOS 10.14 and 10.15, but avoid the extra full-window invalidation on Big Sur and newer where it can cause expensive redraw behaviour.
2026-05-13 09:54:51 +02:00
3b177953c1 quartz: request 8-bit layer contents on Big Sur and newer
Based on part of the MacPorts Big Sur performance patch for GIMP issue 5989.

Use a dynamic Objective-C call to request 8-bit layer contents on macOS 11 and newer, avoiding a hard QuartzCore/CALayer compile-time dependency and preserving old behaviour on older macOS releases.
2026-05-13 09:49:48 +02:00
032c5f1efd quartz: avoid screen update suppression on Mojave and newer
Based on part of the MacPorts Big Sur performance patch for GIMP issue 5989.

NSDisableScreenUpdates and NSEnableScreenUpdates are deprecated on newer macOS releases. Keep using them for older macOS versions, but avoid them on Mojave and newer.
2026-05-13 09:41:36 +02:00
ceb158a3e1 quartz: use CGContext accessor on Yosemite and newer
Based on part of the MacPorts Big Sur performance patch for GIMP issue 5989.

Use the modern NSGraphicsContext CGContext accessor on Yosemite and newer, matching the existing Quartz window code, while preserving graphicsPort for older macOS versions.
2026-05-13 09:38:00 +02:00
35e2e048fc quartz: map macOS 11 and newer to internal OS versions
Based on part of the MacPorts Big Sur performance patch for GIMP issue 5989.

GTK2 represents macOS 10.x releases by their minor version. Read the major version as well and map macOS 11 and newer into the same sequence so Big Sur and later releases can be detected correctly.
2026-05-13 09:36:56 +02:00
eebe1148c1 quartz: avoid focus locking on Mojave and newer
Based on part of the MacPorts Big Sur performance patch for GIMP issue 5989.

The NSView focus-locking API is deprecated on newer macOS releases and can cause expensive redraw behaviour. Keep the old path for older macOS versions, but avoid lockFocusIfCanDraw/unlockFocus on Mojave and newer.
2026-05-13 09:36:56 +02:00
8347521bfd quartz: add newer macOS version constants
Based on the MacPorts patch-gdkquartz-osx-versions.diff.

Extend the Quartz OS version enum so later macOS-specific code can
distinguish Catalina, Big Sur, Monterey, Ventura, Sonoma, and Sequoia
while preserving the existing older constants.
2026-05-13 09:36:55 +02:00
2d1ba49ab4 build: disable GNU visibility aliases on Apple platforms
Based on the MacPorts patch-aliases.diff.

Keep the existing GNU visibility alias generation on other platforms, but avoid it on Apple targets where this alias mechanism is not suitable.
2026-05-13 09:15:53 +02:00
385df5517b gtkrc: search XDG data dirs for themes
Based on the Guix gtk2-theme-paths.patch by Jookia.

Keep the existing ~/.themes and gtk_rc_get_theme_dir() lookup paths, but check g_get_system_data_dirs() in between so profile- and prefix-based theme installations can be found.
2026-05-13 08:38:30 +02:00
a221e0da4c tests: fix GtkBuilder signal callback prototypes
Based on the Guix gtk2-fix-builder-test.patch.

The callbacks are connected to notify-style signals and must take a
GParamSpec pointer, not a GParamSpec by value. This avoids stack/register
ABI problems on platforms such as ppc64el.
2026-05-13 08:38:20 +02:00
d4729ecf19 gail: read spin button adjustment values directly 2026-05-11 21:15:37 +02:00
bec4c7bdb4 gail: read range adjustment values directly 2026-05-11 21:12:25 +02:00
0c99e43e4c gail: use modern AtkValue API for progress bars 2026-05-11 20:23:05 +02:00
0451e0ad1d cups: use modern backend HTTP connect helper when available 2026-05-11 18:46:01 +02:00
48e183353b cups: use modern HTTP connect helpers when available 2026-05-11 18:36:05 +02:00
c3412528e8 gtk: replace deprecated im module parser helpers 2026-05-11 17:24:23 +02:00
35e6148400 gtk: replace deprecated tooltip timestamp ABI field 2026-05-11 08:28:20 +02:00
82 changed files with 12447 additions and 3767 deletions

1133
ABOUT-NLS

File diff suppressed because it is too large Load diff

89
HACKING
View file

@ -1,45 +1,64 @@
**Hacking gtk2-ng**
If you want to hack on the GTK+ project, you'll need to have
the following packages installed:
Note:
When this document was first created back in the day, "hacking" meant to
modify code to do new and interesting things, not quite the same as the
more sinister meaning it has taken on today. It is in the spirit of the
original meaning that this newly revised document has been updated.
- GNU autoconf 2.54
- GNU automake 1.7
- GNU libtool 1.4
- indent (GNU indent 1.9.1 is known good)
- GNU gettext 10.40
Full list of Daemonratte's projects:
https://git.devuan.org/Daemonratte
These should be available by ftp from ftp.gnu.org or any of the
fine GNU mirrors. Beta software can be found at alpha.gnu.org.
We welcome all contributions to the project! And the best way to make that
happen is to first clone the main gtk2-ng repo at :
https://git.devuan.org/Daemonratte/gtk2-ng
Up-to-date instructions about developing GNOME applications and libraries
can be found here:
To make a pull request or report a bug, you'll need to register an account
at: https://git.devuan.org
http://developer.gnome.org
Got some ideas or a feature request? You can also make an account at:
https://devuanusers.com and join in the discussions here:
https://devuanusers.com/forum-gtk2-revival-project--12
Information about using git with GNOME can be found here:
Cloning the git repo to your local computer is a great way to experiment
and test results, you'll need to be familiar with git commands and first
need to install the build dependencies:
http://live.gnome.org/Git
# yad build-essential git libcups2-dev gettext autopoint
# autoconf automake libtool pkg-config gtk-doc-tools gobject-introspection
# libglib2.0-dev libpango1.0-dev libatk1.0-dev libcairo2-dev libgdk-pixbuf-2.0-dev
# libfontconfig1-dev libfreetype-dev libharfbuzz-dev libfribidi-dev libpng-dev
# libx11-dev libxext-dev libxrender-dev libxrandr-dev libxcursor-dev
# libxinerama-dev libxi-dev libxfixes-dev libxcomposite-dev libxdamage-dev
In order to get GIT gtk+ installed on your system, you need to have
the most recent GIT versions of glib, pango, and atk installed as well.
The installation process of these libraries is similar to that of gtk+, but
needs to be fulfilled prior to installation of gtk+.
There are build scripts (Linux) to help automate the process and do local testing
side-by-side against current versions of gtk2, you can find them here:
https://git.devuan.org/greenjeans/gtk2-ng-test-scripts
If at all possible, please use GIT to get the latest development version of
gtk+ and glib. You can do the following to get glib and gtk+ from GIT:
And if you just want to do some simple testing there's an easy way to do
that without having to do a lot of building/installing, a special test-iso
with the above scripts already installed to automate everything, that you
can run in a live-session or a VM, or also install if you have a partition
to spare:
https://sourceforge.net/projects/vuu-do/files/Vuu-do-5.03/5.03-gtk2ng-testing/
$ git clone git://git.gnome.org/glib
$ git clone git://git.gnome.org/pango
$ git clone git://git.gnome.org/atk
$ git clone git://git.gnome.org/gtk+
~greenjeans June 2026
Note: if you plan to push changes to back to the master repository and
have a gnome account, you want to use the following instead:
$ git clone ssh://<username>@git.gnome.org/git/gtk+
To compile the GIT version of gtk+ on your system, you will need to take
several steps to setup the tree for compilation. You can do all these
steps at once by running:
gtk+$ ./autogen.sh
Basically this does the following for you:
gtk+$ aclocal; automake; autoconf
The above commands create the `configure' script. Now you
run the `configure' script in `gtk+/' to create all Makefiles.
More information about that in `INSTALL'.
Before running `autogen.sh' or `configure', make sure you have libtool
in your path.
Note that autogen.sh runs configure for you. If you wish to pass
options like `--prefix=/usr' to `configure' you can give those options
to `autogen.sh' and they will be passed on to `configure'.
For information about submitting patches and pushing changes
to GIT, see the `README' and `README.commits' files. In particular,
don't, under any circumstances, push anything to GIT before
reading and understanding `README.commmits'.

View file

@ -1,13 +1,12 @@
Daemonratte - lead developer
https://git.devuan.org/Daemonratte
Matthias Clasen
E-mail: mclasen@redhat.com
Userid: matthiasc
greenjeans - collaborator
https://git.devuan.org/greenjeans
Tim Janik
E-mail: timj@gtk.org
Userid: timj
Note that a LOT of people are contributing to gtk2-ng, and some parts of it
like the .deb packages are being maintained by other people. The people listed
above are meant as contacts for administrative questions. The best way to get
involved is by registering an account at : https://git.devuan.org/ for any
feature requests or issues. You can also register an account on the Devuan
users forum : https://devuanusers.com/index.php and post or message/email
any one of us.
Note that a lot of people are contributing to GTK+, and some parts of it
are technically maintained by other people. The people listed above are
meant as contacts for administrative questions such as cvs accounts. Other
questions are best directed to the mailing list gtk-devel-list@gnome.org.

View file

@ -1,35 +1,72 @@
The gtk2-ng project is part of Daemonratte's git repository. At the current
time, only the project owner and collaborators are allowed to make commits,
gtk2-ng is a fairly large and complicated package that many other things
depend on, so to avoid unnecessary breakage, but to take advantage of the
knowledge about GTK that has been built up over the years, we'd like to ask
people to feel free to submit pull requests after modding and testing. It
will all get reviewed though sometimes that may take some time!
GTK+ is part of the GNOME git repository. At the current time, any
person with write access to the GNOME repository, can make changes to
GTK+. This is a good thing, in that it encourages many people to work
on GTK+, and progress can be made quickly. However, GTK+ is a fairly
large and complicated package that many other things depend on, so to
avoid unnecessary breakage, and to take advantage of the knowledge
about GTK+ that has been built up over the years, we'd like to ask
people committing to GTK+ to follow a few rules:
If you would like to submit pull requests, you will need to have an account
at: https://git.devuan.org
It's also a good idea to sign up at the devuanusers.com forum and join the
discussion here: https://devuanusers.com/forum-gtk2-revival-project--12
0) Ask first. If your changes are major, or could possibly break existing
code, you should always ask. If your change is minor and you've
been working on GTK+ for a while it probably isn't necessary
to ask. But when in doubt, ask. Even if your change is correct,
somebody may know a better way to do things.
If you are making changes to GTK+, you should be subscribed
to gtk-devel-list@gnome.org. (Subscription address:
gtk-devel-list-request@gnome.org.) This is a good place to ask
about intended changes.
#gtk+ on GIMPNet (irc.gimp.org, irc.us.gimp.org, irc.eu.gimp.org, ...)
is also a good place to find GTK+ developers to discuss changes with,
however, email to gtk-devel-list is the most certain and preferred
method.
1) Ask _first_.
2) With git, we no longer maintain a ChangeLog file, but you are expected
to produce a meaningful commit message. Changes without a sufficient
commit message will be reverted. See below for the expected format
of commit messages.
Notes:
* When developing larger features or complicated bug fixes, it is
advisable to work in a branch in your own cloned gtk2-ng repository.
advisable to work in a branch in your own cloned GTK+ repository.
You may even consider making your repository publically available
so that others can easily test and review your changes.
* The expected format for git commit messages is as follows:
Title: Short explanation of the commit, i.e "Update foo.c"
Optional extended description: Longer explanation about what's changed,
whether any external or private interfaces changed, what bugs were fixed
(with bug tracker reference if applicable) and so on. Be concise but complete,
i.e. "Added new spin-buttons, deleted some trailing whitespace, fixed bug #8"
~greenjeans June 2026
=== begin example commit ===
Short explanation of the commit
Longer explanation explaining exactly what's changed, whether any
external or private interfaces changed, what bugs were fixed (with bug
tracker reference if applicable) and so forth. Be concise but not too brief.
=== end example commit ===
- Always add a brief description of the commit to the _first_ line of
the commit and terminate by two newlines (it will work without the
second newline, but that is not nice for the interfaces).
- First line (the brief description) must only be one sentence and
should start with a capital letter unless it starts with a lowercase
symbol or identifier. Don't use a trailing period either. Don't exceed
72 characters.
- The main description (the body) is normal prose and should use normal
punctuation and capital letters where appropriate. Normally, for patches
sent to a mailing list it's copied from there.
- When committing code on behalf of others use the --author option, e.g.
git commit -a --author "Joe Coder <joe@coder.org>" and --signoff.
Owen Taylor
13 Aug 1998
17 Apr 2001
Matthias Clasen
31 Mar 2009

View file

@ -1,20 +1,25 @@
General Information
===================
This is gtk2-ng, a multi-platform toolkit for creating graphical user interfaces.
Offering a complete set of widgets, gtk2-ng is suitable for projects ranging from
small one-off projects to complete application suites.
This is GTK+ version @GTK_VERSION@. GTK+ is a multi-platform toolkit for
creating graphical user interfaces. Offering a complete set of widgets,
GTK+ is suitable for projects ranging from small one-off projects to
complete application suites.
This is free software and part of the gtk2 revival project. However, the
licensing terms for gtk2-ng, the GNU LGPL, allow it to be used by all
GTK+ is free software and part of the GNU Project. However, the
licensing terms for GTK+, the GNU LGPL, allow it to be used by all
developers, including those developing proprietary software, without any
license fees or royalties.
The official source code site is:
https://git.devuan.org/Daemonratte/gtk2-ng
The official ftp site is:
ftp://ftp.gtk.org/pub/gtk
The official web site is:
https://devuanusers.com/index.php
http://www.gtk.org/
Information about mailing lists can be found at
http://www.gtk.org/mailinglists.html
Installation
============
@ -415,9 +420,9 @@ Release notes for 2.6
How to report bugs
==================
Bugs should be reported to the gtk2-ng bug tracking system.
(https://git.devuan.org/Daemonratte/gtk2-ng)
You will need to create an account for yourself.
Bugs should be reported to the GNOME bug tracking system.
(http://bugzilla.gnome.org, product gtk+.) You will need to create an
account for yourself.
In the bug report please include:
@ -449,8 +454,8 @@ In the bug report please include:
Patches
=======
Patches should also be submitted to https://git.devuan.org/Daemonratte/gtk2-ng.
If the patch fixes an existing bug, add the patch as an attachment to that bug
Patches should also be submitted to bugzilla.gnome.org. If the patch
fixes an existing bug, add the patch as an attachment to that bug
report.
Otherwise, enter a new bug report that describes the patch, and attach

View file

@ -4,18 +4,13 @@
This fork focuses on modern compatibility while preserving stability, performance, ABI compatibility, and original behavior as much as possible. X11-first, no forced Wayland migration.
Backed by the **devuanusers.com** community and **The Lateral Tech Foundation**.
Backed by the **devuanusers.com** community.
## Recent Development News
- Build scripts to automate local testing - https://git.devuan.org/greenjeans/gtk2-ng-test-scripts
- Testing iso (Daedalus) - https://sourceforge.net/projects/vuu-do/files/Vuu-do-5.03/5.03-gtk2ng-testing/
- Deb packages (Daedalus, Excalibur) - https://git.devuan.org/SteveM/gtk2-ng_debs
- Win32 build scripts - https://git.devuan.org/lmemsm/bldgtk
- Successfully built for EasyOS and KLV-Airedale - https://forum.puppylinux.com/viewtopic.php?p=171842#p171842
- EasyOS 7.4 released featuring gtk2-ng - https://distrowatch.com/?newsid=12874
- Available in the AUR for Archlinux - https://aur.archlinux.org/packages/gtk2-ng-git
- The Lateral Tech Foundation formed - https://lateraltechfoundation.com/
- Deb packages (Excalibur) - https://git.devuan.org/SteveM/DTK_debs
## Highlights
@ -34,7 +29,7 @@ Backed by the **devuanusers.com** community and **The Lateral Tech Foundation**.
- Preserved GTK2 theming, theme engines, input modules and print backends
- Preserved legacy configuration and module lookup behaviour
- Continued focus on performance, low overhead and responsiveness
- Community-driven maintenance backed by devuanusers.com and lateraltechfoundation.com
- Community-driven maintenance backed by devuanusers.com
## Roadmap
@ -136,7 +131,7 @@ emerge --ask --oneshot media-libs/freetype x11-libs/pango
```
## How to Contribute
Join the main discussion here:
Join the main discussion here:
https://devuanusers.com/thread-gtk2-revival-thread--80
Test apps, report issues, submit patches!

View file

@ -469,7 +469,7 @@ if test "x$enable_rebuilds" = "xyes" && \
fi
AC_SUBST(REBUILD)
AC_CHECK_FUNCS(lstat mkstemp flockfile getc_unlocked)
AC_CHECK_FUNCS(lstat mkstemp flockfile getc_unlocked _lock_file _unlock_file _getc_nolock)
AC_CHECK_FUNCS(localtime_r)
# _NL_TIME_FIRST_WEEKDAY is an enum and not a define
@ -718,6 +718,48 @@ fi
saved_cflags="$CFLAGS"
saved_ldflags="$LDFLAGS"
# Help GNU ld find indirect shared-library dependencies from custom
# library prefixes. This is useful for musl/cross/custom-prefix builds
# where a directly linked .so is found through -L, but its DT_NEEDED
# libraries from the same prefix are not in the default linker search path.
case "$host_os" in
linux*)
GTK_RPATH_LINK_FLAGS=
gtk_next_is_libdir=no
for gtk_ldflag in $LDFLAGS; do
if test "x$gtk_next_is_libdir" = xyes; then
gtk_libdir="$gtk_ldflag"
gtk_next_is_libdir=no
else
case $gtk_ldflag in
-L)
gtk_next_is_libdir=yes
continue
;;
-L*)
gtk_libdir=`echo "$gtk_ldflag" | sed 's/^-L//'`
;;
*)
continue
;;
esac
fi
case " $GTK_RPATH_LINK_FLAGS " in
*" -Wl,-rpath-link,$gtk_libdir "*)
;;
*)
GTK_RPATH_LINK_FLAGS="$GTK_RPATH_LINK_FLAGS -Wl,-rpath-link,$gtk_libdir"
;;
esac
done
LDFLAGS="$LDFLAGS $GTK_RPATH_LINK_FLAGS"
;;
esac
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
@ -1392,7 +1434,7 @@ CFLAGS="$CFLAGS $PANGO_CFLAGS"
if $PKG_CONFIG --uninstalled $PANGO_PACKAGES; then
:
else
gtk_save_LIBS="$LIBS"
gtk_save_LIBS="$LIBS"
LIBS="$PANGO_LIBS $LIBS"
AC_LINK_IFELSE(
[AC_LANG_CALL([], [pango_context_new])],
@ -1470,7 +1512,7 @@ fi
GTK_EXTRA_LIBS=
GTK_EXTRA_CFLAGS=
GTK_DEP_LIBS="$GDK_EXTRA_LIBS $GTK_DEP_LIBS_FOR_X `$PKG_CONFIG --libs $PANGO_PACKAGES $GTK_PACKAGES_FOR_X $GTK_PACKAGES` $GTK_EXTRA_LIBS $MATH_LIB"
GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PACKAGES $GTK_PACKAGES` $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $PANGO_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
if test x"$os_win32" = xyes; then
GTK_EXTRA_CFLAGS="$msnative_struct"
@ -1594,6 +1636,7 @@ else
gtk_save_libs="$LIBS"
LIBS="$CUPS_LIBS"
AC_CHECK_FUNCS(httpGetAuthString)
AC_CHECK_FUNCS(httpConnect2 httpReconnect2)
LIBS="$gtk_save_libs"
fi
fi

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

View file

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="260" height="270" version="1.1">
<defs>
<linearGradient id="L0">
<stop style="stop-color:#fe798e"/>
<stop style="stop-color:#9c2219" offset="1"/>
</linearGradient>
<linearGradient id="L1">
<stop style="stop-color:#bff872"/>
<stop style="stop-color:#7de567" offset="1"/>
</linearGradient>
<linearGradient id="L2">
<stop style="stop-color:#92cbe2"/>
<stop style="stop-color:#7f95fe" offset="1"/>
</linearGradient>
<linearGradient xlink:href="#L2" id="L3" gradientUnits="userSpaceOnUse" gradientTransform="translate(92.2254,-.313709)" x1="-143" y1="207.36218" x2="-129.5" y2="108.86218"/>
<linearGradient xlink:href="#L1" id="L4" gradientUnits="userSpaceOnUse" gradientTransform="translate(92.2254,-.313709)" x1="-133.5" y1="221.86218" x2="-50" y2="279.36218"/>
<linearGradient xlink:href="#L0" id="L5" gradientUnits="userSpaceOnUse" gradientTransform="translate(92.2254,-.313709)" x1="-157.5" y1="222.86218" x2="-247.5" y2="276.86218"/>
</defs>
<g transform="translate(178.992551,-88.576718)">
<path style="fill:url(#L3)" d="M-58.11348,213.41831L -162.26826,151.37974L -37.01785,100.04846L 68.1307,158.15264L -58.11348,213.41831z "/>
<path style="fill:url(#L4)" d="M-51.56037,213.5916L 72.03976,159.30293L 54.30386,283.51375L -62.14067,350.24024L -51.56037,213.5916z "/>
<path style="fill:url(#L5)" d="M-59.56037,347.18826L -164.06037,282.96566L -163.61166,159.3255L -55.18554,215.49255L -59.56037,347.18826z "/>
<path style="fill:#000" d="M-66.27108,352.00632C -69.30467,350.22909 -85.32501,339.74485 -101.87184,328.708C -141.06516,302.56578 -152.91684,294.99749 -161.22644,290.80508C -172.47362,285.13057 -171.42166,291.71277 -171.76785,224.84661C -172.09132,162.36876 -172.8819,151.51349 -166.98072,153.09872C -171.59657,148.70486 -149.89048,141.93362 -115.91158,126.8062C -82.71848,112.02862 -46.04303,97.12968 -37.99045,95.151731C -35.80415,94.614711 -30.58575,96.813551 -10.91381,106.56083C 32.31874,127.98218 67.99593,147.7319 72.54924,152.76325C 73.58759,153.91062 75.03553,154.84937 75.76688,154.84937C 77.84679,154.84937 78.37332,158.95768 77.25844,166.48751C 76.69538,170.29042 72.64193,195.0632 68.25078,221.53813C 63.85962,248.01307 59.96508,272.38204 59.59625,275.69141C 58.29011,287.41076 58.65986,286.97385 40.74281,297.9691C 31.80145,303.4562 9.14236,316.66419 -9.61071,327.3202C -28.36378,337.97622 -47.03613,348.65729 -51.10479,351.05592C -55.17346,353.45455 -59.00931,355.3767 -59.62892,355.32736C -60.24852,355.27802 -63.23749,353.78356 -66.27108,352.00632z M-61.87106,326.08404C -61.53987,317.12117 -60.90739,291.51119 -60.46556,269.17296C -59.4846,219.57813 -59.22374,221.12454 -69.76193,214.06246C -82.68227,205.404 -96.65592,197.35576 -120.42436,184.88302C -133.38604,178.08124 -147.58846,170.35597 -151.98528,167.71576C -157.4594,164.42865 -160.30462,163.24026 -161.01083,163.94598C -162.29568,165.22992 -162.39159,217.12625 -161.17615,253.40053L -160.31016,279.24588L -153.15345,283.38712C -146.97571,286.96188 -111.07469,311.08894 -76.29946,335.03636C -70.50807,339.02452 -65.02796,342.30839 -64.12144,342.33386C -62.68203,342.3743 -62.39695,340.31581 -61.87106,326.08404z M-123.45447,281.63953L -121.92862,231.56652L -140.98255,221.52843L -138.49408,200.85313L -78.16426,229.52961L -79.29283,248.93423L -101.23414,239.89866C -104.02169,251.08704 -104.55187,273.56224 -106.14867,290.70437L -123.45447,281.63953z M-9.61071,316.77116C 34.17351,291.73098 48.95974,282.50651 49.5137,279.88608C 49.76822,278.68213 50.70639,272.73304 51.59851,266.66586C 52.49065,260.59869 56.34489,236.69937 60.1635,213.55627C 66.55191,174.8386 67.87919,164.87776 66.64985,164.87776C 65.35309,164.87776 41.87183,175.43096 11.95031,189.46143C -6.52698,198.1256 -27.06009,207.7061 -33.67883,210.75142C -40.29756,213.79674 -46.27431,216.80609 -46.96048,217.43886C -49.01471,219.33318 -53.67591,334.1607 -51.88774,338.82058C -51.3077,340.33214 -50.58188,340.15475 -45.46483,337.25078C -42.2919,335.45011 -26.15754,326.23429 -9.61071,316.77116z M-31.52427,299.57413C -31.87775,272.99487 -33.95338,246.76003 -28.00983,218.92136L -15.53109,218.69485L -14.46997,256.84948L 28.82336,204.1205L 49.21858,198.81459L 11.17117,250.94644L 46.4177,267.81063L 31.8401,277.19567L -4.08659,261.22054L -17.12774,267.67154L -17.55651,293.33323L -31.52427,299.57413z M-44.98935,205.62376C -42.07793,204.31693 -20.74221,194.22819 2.42335,183.20435C 25.58892,172.18051 47.47586,161.89162 51.06101,160.34015C 60.54302,156.23684 60.93348,155.67356 56.37503,152.674C 49.35425,148.05414 13.69688,129.08139 -11.32169,116.65357L -36.09795,104.34612L -44.41536,107.15536C -56.14763,111.11798 -89.54973,125.04344 -118.35237,137.97996C -148.44864,151.49752 -152.51519,153.54112 -152.51519,155.14816C -152.51519,155.84547 -145.85885,160.0994 -137.72332,164.60135C -111.60287,179.05557 -54.81147,207.96913 -52.51064,207.98472C -51.28536,207.99302 -47.90078,206.93059 -44.98935,205.62376z M-60.75547,189.54567C -75.28072,185.96717 -91.81229,177.57594 -96.0911,171.6097C -99.47879,166.88602 -102.37326,159.22994 -102.37326,154.99297C -102.37326,149.88393 -99.16092,142.63741 -94.96571,138.28271C -89.64934,132.76424 -82.2461,130.42562 -63.03287,128.19542C -43.93665,125.97879 -27.42575,126.6637 -17.57474,130.08117C -8.29082,133.30188 -4.52834,135.30727 -2.61559,138.05436C 2.38083,145.2301 5.93328,151.2196 5.93328,152.46787C 5.93328,154.32106 1.29355,156.06801 -2.01293,155.45979C -3.4339,155.1984 -6.26937,154.71168 -8.31397,154.3782C -11.32445,153.88717 -12.45855,153.01191 -14.27723,149.776C -16.85292,145.19318 -23.60657,140.51818 -30.15247,138.78687C -40.15132,136.14228 -67.5992,138.35316 -76.05306,142.48406C -80.82949,144.81802 -83.39709,149.93235 -84.08312,158.47883C -84.55072,164.304 -84.36299,165.20843 -82.20604,167.52215C -79.28527,170.65521 -71.09215,174.87312 -62.00697,177.92089C -56.94497,179.61901 -54.0594,180.03115 -50.5755,179.55363C -42.46315,178.44171 -41.49161,176.3237 -46.32188,170.28055C -50.48755,165.06888 -51.4992,162.24318 -50.12122,159.66839C -49.15472,157.86249 -48.34815,157.66756 -43.78911,158.13809C -37.32875,158.80486 -23.72903,163.98325 -20.5194,166.99854C -17.69425,169.65263 -17.2471,175.88082 -19.70523,178.33895C -22.5073,181.14102 -34.94771,188.0685 -39.80016,189.52887C -45.45811,191.23166 -53.88454,191.23841 -60.75547,189.54567z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 6.5 KiB

View file

@ -1,20 +0,0 @@
gtk2-ng.svg is based on File:GTK.svg from Wikimedia Commons.
Source:
https://commons.wikimedia.org/wiki/File:GTK.svg
Original source:
Conversion of Image:GTK.png to SVG using Inkscape.
Author:
Jose Hevia, vectorised by DTR at English Wikipedia.
Commons cleanup by Tene~commonswiki.
License:
Creative Commons Attribution-ShareAlike 3.0 Unported or
GNU Free Documentation License 1.2 or later.
This copy is included under the Creative Commons Attribution-ShareAlike
3.0 Unported license.
No endorsement by the original authors or Wikimedia Commons is implied.

View file

@ -992,11 +992,11 @@ main (int argc, char **argv)
NULL);
gtk_text_buffer_create_tag (source_buffer, "preprocessor",
"style", PANGO_STYLE_OBLIQUE,
"foreground", "burlywood4",
"foreground", "burlywood4",
NULL);
gtk_text_buffer_create_tag (source_buffer, "function",
"weight", PANGO_WEIGHT_BOLD,
"foreground", "DarkGoldenrod4",
"foreground", "DarkGoldenrod4",
NULL);
g_object_unref (source_buffer);

View file

@ -37,7 +37,7 @@ IGNORE_HFILES= \
# Extra files to add when scanning (relative to $srcdir)
EXTRA_HFILES= \
../../../gdk/x11/gdkx.h
$(top_srcdir)/gdk/x11/gdkx.h
# CFLAGS and LDFLAGS for compiling scan program. Only needed
# if $(DOC_MODULE).types is non-empty.
@ -159,4 +159,3 @@ EXTRA_DIST += version.xml.in
# working when the top-level test target descends into the documentation
# reference directories.
test:

View file

@ -391,4 +391,3 @@ dist-hook-local: $(BUILT_EXTRA_DIST)
# working when the top-level test target descends into the documentation
# reference directories.
test:

View file

@ -39,4 +39,3 @@ include $(top_srcdir)/gtk-doc.make
# working when the top-level test target descends into the documentation
# reference directories.
test:

View file

@ -2,6 +2,8 @@
include $(top_srcdir)/Makefile.decl
-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ENV = \
CC="$(CC)"
INTROSPECTION_SCANNER_ARGS = \
--warn-all \
--add-include-path=../gdk
@ -213,6 +215,11 @@ Gdk_2_0_gir_CFLAGS = \
-I$(top_builddir) \
-I$(top_builddir)/gdk \
$(INCLUDES)
if OS_WIN32
Gdk_2_0_gir_CFLAGS += -I$(srcdir)/win32 -I$(srcdir)
endif
INTROSPECTION_GIRS += Gdk-2.0.gir
if USE_X11
@ -268,6 +275,63 @@ introspection_files += $(filter-out x11/gdkx.h, $(x11_introspection_files))
endif # USE_X11
if OS_WIN32
win32_introspection_files = \
win32/gdkapplaunchcontext-win32.c \
win32/gdkcolor-win32.c \
win32/gdkcursor-win32.c \
win32/gdkdisplay-win32.c \
win32/gdkdnd-win32.c \
win32/gdkdrawable-win32.c \
win32/gdkdrawable-win32.h \
win32/gdkevents-win32.c \
win32/gdkfont-win32.c \
win32/gdkgc-win32.c \
win32/gdkgeometry-win32.c \
win32/gdkglobals-win32.c \
win32/gdkimage-win32.c \
win32/gdkim-win32.c \
win32/gdkinput.c \
win32/gdkinput-win32.c \
win32/gdkinput-win32.h \
win32/gdkkeys-win32.c \
win32/gdkmain-win32.c \
win32/gdkpixmap-win32.c \
win32/gdkpixmap-win32.h \
win32/gdkprivate-win32.h \
win32/gdkproperty-win32.c \
win32/gdkscreen-win32.c \
win32/gdkselection-win32.c \
win32/gdkspawn-win32.c \
win32/gdktestutils-win32.c \
win32/gdkvisual-win32.c \
win32/gdkwin32.h \
win32/gdkwin32id.c \
win32/gdkwin32keys.h \
win32/gdkwindow-win32.c \
win32/gdkwindow-win32.h
GdkWin32-2.0.gir: $(gdktargetlib) Gdk-2.0.gir Makefile
GdkWin32_2_0_gir_SCANNERFLAGS = --warn-all --identifier-prefix=Gdk --symbol-prefix=gdk --include-uninstalled=Gdk-2.0.gir
GdkWin32_2_0_gir_INCLUDES = Gio-2.0 Gdk-2.0 GdkPixbuf-2.0 Pango-1.0
GdkWin32_2_0_gir_LIBS = $(gdktargetlib)
GdkWin32_2_0_gir_FILES = $(win32_introspection_files)
GdkWin32_2_0_gir_EXPORT_PACKAGES = gdk-win32-2.0
GdkWin32_2_0_gir_CFLAGS = \
-DGDK_COMPILATION \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_builddir)/gdk \
-I$(srcdir)/win32 \
-I$(srcdir) \
$(INCLUDES) \
-L$(top_builddir)/gdk
INTROSPECTION_GIRS += GdkWin32-2.0.gir
introspection_files += $(filter-out win32/gdkwin32.h, $(win32_introspection_files))
endif # OS_WIN32
girdir = $(datadir)/gir-1.0
gir_DATA = $(INTROSPECTION_GIRS)

View file

@ -817,31 +817,6 @@ gdk_threads_add_timeout_seconds (guint interval,
}
static gpointer
gdk_atom_copy (gpointer atom)
{
return atom;
}
static void
gdk_atom_free (gpointer atom)
{
/* GdkAtom values are interned and must not be freed. */
}
GType
gdk_atom_get_type (void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static (g_intern_static_string ("GdkAtom"),
(GBoxedCopyFunc) gdk_atom_copy,
(GBoxedFreeFunc) gdk_atom_free);
return our_type;
}
const char *
gdk_get_program_class (void)
{

View file

@ -184,14 +184,9 @@ gdk_utf8_to_compound_text
#endif
#endif
#if IN_HEADER(__GDK_PROPERTY_H__)
#if IN_FILE(__GDK_C__)
gdk_atom_get_type G_GNUC_CONST
#endif
#endif
#if IN_HEADER(__GDK_PROPERTY_H__)
#if IN_FILE(__GDK_PROPERTY_X11_C__)
gdk_atom_get_type G_GNUC_CONST
gdk_atom_intern
gdk_atom_intern_static_string
gdk_atom_name

View file

@ -2242,6 +2242,51 @@ gdk_rgb_convert_8880_br (GdkRgbInfo *image_info, GdkImage *image,
}
}
static void
gdk_rgb_convert_0AAA_br (GdkRgbInfo *image_info, GdkImage *image,
gint x0, gint y0, gint width, gint height,
const guchar *buf, int rowstride,
gint x_align, gint y_align, GdkRgbCmap *cmap)
{
int y, w;
guchar *obuf, *p;
gint bpl;
const guchar *bptr, *bp2;
guchar r, g, b;
bptr = buf;
bpl = image->bpl;
obuf = ((guchar *) image->mem) + y0 * bpl + x0 * 4;
for (y = 0; y < height; y++)
{
bp2 = bptr;
p = obuf;
w = width;
while (w--)
{
r = *bp2++;
g = *bp2++;
b = *bp2++;
/* Since the R, G and B channels are coded in a char, we
* replicate the two most significant bits to the two least
* significant ones.
*/
*((guint32 *) p) = 0x3 << 30 |
b << 22 | (b >> 6) << 20 |
g << 12 | (g >> 6) << 10 |
r << 2 | (r >> 6);
p += 4;
}
bptr += rowstride;
obuf += bpl;
}
}
/* Generic truecolor/directcolor conversion function. Slow, but these
are oddball modes. */
static void
@ -3195,6 +3240,11 @@ gdk_rgb_select_conv (GdkRgbInfo *image_info)
#endif
}
#endif
else if (bpp == 32 && (depth == 30 || depth == 32) &&
vtype == GDK_VISUAL_TRUE_COLOR &&
(red_mask == 0x3ff && green_mask == 0xffc00 &&
blue_mask == 0x3ff00000 && byte_order == GDK_LSB_FIRST))
conv = gdk_rgb_convert_0AAA_br;
else if (vtype == GDK_VISUAL_TRUE_COLOR && byte_order == GDK_LSB_FIRST)
{
conv = gdk_rgb_convert_truecolor_lsb;

View file

@ -14,7 +14,7 @@ print <<EOF;
#include <glib.h>
#ifdef G_HAVE_GNUC_VISIBILITY
#if defined(G_HAVE_GNUC_VISIBILITY) && !defined(__APPLE__)
EOF

View file

@ -599,6 +599,25 @@
gdk_screen_get_rgba_colormap (_gdk_screen);
}
-(void)viewWillDraw
{
/* macOS 11 (Big Sur) and newer may use a higher precision backing
* format for layer contents. For GTK2's 8-bit drawing this can add
* avoidable conversion overhead. Use a dynamic Objective-C call here
* instead of a hard QuartzCore/CALayer dependency, so old SDKs and old
* macOS targets keep building and keep their old behaviour.
*/
if (gdk_quartz_osx_version () >= GDK_OSX_BIG_SUR)
{
id layer = [self layer];
if (layer && [layer respondsToSelector: @selector(setContentsFormat:)])
[layer setValue: @"RGBA8Uint" forKey: @"contentsFormat"];
}
[super viewWillDraw];
}
-(void)drawRect: (NSRect)rect
{
GdkRectangle gdk_rect;

View file

@ -893,7 +893,8 @@ gdk_quartz_drawable_release_context (GdkDrawable *drawable,
if (window_impl->in_paint_rect_count == 0)
{
_gdk_quartz_drawable_flush (drawable);
[window_impl->view unlockFocus];
if (gdk_quartz_osx_version () < GDK_OSX_MOJAVE)
[window_impl->view unlockFocus];
}
}
else if (GDK_IS_PIXMAP_IMPL_QUARTZ (drawable))

View file

@ -34,9 +34,20 @@ gdk_quartz_osx_version (void)
if (minor == GDK_OSX_UNSUPPORTED)
{
OSErr err = Gestalt (gestaltSystemVersionMinor, (SInt32*)&minor);
gint32 major = GDK_OSX_UNSUPPORTED;
OSErr err = Gestalt (gestaltSystemVersionMajor, (SInt32*)&major);
g_return_val_if_fail (err == noErr, GDK_OSX_UNSUPPORTED);
err = Gestalt (gestaltSystemVersionMinor, (SInt32*)&minor);
g_return_val_if_fail (err == noErr, GDK_OSX_UNSUPPORTED);
/* GTK2 encodes macOS 10.x releases by their minor version.
* Map macOS 11+ into the same sequence:
* 11 -> 16, 12 -> 17, 13 -> 18, ...
*/
if (major > 10)
minor = major + 5;
}
if (minor < GDK_OSX_MIN)

View file

@ -54,7 +54,13 @@ typedef enum
GDK_OSX_SIERRA = 12,
GDK_OSX_HIGH_SIERRA = 13,
GDK_OSX_MOJAVE = 14,
GDK_OSX_CURRENT = 14,
GDK_OSX_CATALINA = 15,
GDK_OSX_BIG_SUR = 16,
GDK_OSX_MONTEREY = 17,
GDK_OSX_VENTURA = 18,
GDK_OSX_SONOMA = 19,
GDK_OSX_SEQUOIA = 20,
GDK_OSX_CURRENT = 20,
GDK_OSX_NEW = 99
} GdkOSXVersion;

View file

@ -104,7 +104,8 @@ gdk_window_impl_quartz_get_context (GdkDrawable *drawable,
* and for widgets that send fake expose events like the arrow
* buttons in spinbuttons or the position marker in rulers.
*/
if (window_impl->in_paint_rect_count == 0)
if (window_impl->in_paint_rect_count == 0 &&
gdk_quartz_osx_version () < GDK_OSX_MOJAVE)
{
if (![window_impl->view lockFocusIfCanDraw])
return NULL;
@ -468,7 +469,8 @@ _gdk_windowing_before_process_all_updates (void)
{
in_process_all_updates = TRUE;
NSDisableScreenUpdates ();
if (gdk_quartz_osx_version () < GDK_OSX_MOJAVE)
NSDisableScreenUpdates ();
}
void
@ -489,8 +491,9 @@ _gdk_windowing_after_process_all_updates (void)
/* 10.14 needs to be told that the view needs to be redrawn, see
* https://gitlab.gnome.org/GNOME/gtk/issues/1479 */
if (gdk_quartz_osx_version() >= GDK_OSX_MOJAVE)
[[nswindow contentView] setNeedsDisplay:YES];
if (gdk_quartz_osx_version () >= GDK_OSX_MOJAVE &&
gdk_quartz_osx_version () < GDK_OSX_BIG_SUR)
[[nswindow contentView] setNeedsDisplay:YES];
[nswindow enableFlushWindow];
[nswindow flushWindow];
[nswindow release];
@ -502,7 +505,8 @@ _gdk_windowing_after_process_all_updates (void)
in_process_all_updates = FALSE;
NSEnableScreenUpdates ();
if (gdk_quartz_osx_version () < GDK_OSX_MOJAVE)
NSEnableScreenUpdates ();
}
static void

View file

@ -692,6 +692,7 @@ update_keymap (GdkKeymap *gdk_keymap)
if (hkls_len != keymap->layout_handles->len)
keymap->keysym_tab = g_renew (guint, keymap->keysym_tab, keysym_tab_size);
memset (key_state, 0, sizeof(key_state));
memset (keymap->keysym_tab, 0, keysym_tab_size);
g_array_set_size (keymap->layout_handles, hkls_len);
g_array_set_size (keymap->options, hkls_len);

View file

@ -2767,6 +2767,10 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display,
* WindowFromPoint() can find our windows, we follow similar logic
* here, and ignore invisible and disabled windows.
*/
UINT cwp_flags = CWP_SKIPDISABLED |
CWP_SKIPINVISIBLE |
CWP_SKIPTRANSPARENT;
hwnd = GetDesktopWindow ();
do {
window = gdk_win32_handle_table_lookup ((GdkNativeWindow) hwnd);
@ -2777,8 +2781,7 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display,
break;
screen_to_client (hwnd, screen_pt, &client_pt);
hwndc = ChildWindowFromPointEx (hwnd, client_pt, CWP_SKIPDISABLED |
CWP_SKIPINVISIBLE);
hwndc = ChildWindowFromPointEx (hwnd, client_pt, cwp_flags);
/* Verify that we're really inside the client area of the window */
if (hwndc != hwnd)
@ -2789,6 +2792,8 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display,
hwndc = hwnd;
}
/* Only ignore top-level transparent windows */
cwp_flags &= ~CWP_SKIPTRANSPARENT;
} while (hwndc != hwnd && (hwnd = hwndc, 1));
}

View file

@ -393,6 +393,31 @@ intern_atom (const gchar *atom_name,
return result;
}
static gpointer
gdk_atom_copy (gpointer atom)
{
return atom;
}
static void
gdk_atom_free (gpointer atom)
{
/* GdkAtom values are interned and must not be freed. */
}
GType
gdk_atom_get_type (void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static (g_intern_static_string ("GdkAtom"),
(GBoxedCopyFunc) gdk_atom_copy,
(GBoxedFreeFunc) gdk_atom_free);
return our_type;
}
GdkAtom
gdk_atom_intern (const gchar *atom_name,
gboolean only_if_exists)

2
git.mk
View file

@ -8,6 +8,8 @@
# is permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
#
# The canonical source for this file is https://github.com/behdad/git.mk.
#
# To use in your project, import this file in your git repo's toplevel,
# then do "make -f git.mk". This modifies all Makefile.am files in
# your project to -include git.mk. Remember to add that line to new

View file

@ -2,6 +2,9 @@
include $(top_srcdir)/Makefile.decl
-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ENV = \
CC="$(CC)" \
PATH="$(builddir):$(builddir)/.libs:$${PATH}:"
INTROSPECTION_SCANNER_ARGS = \
--warn-all \
--add-include-path=../gdk
@ -1081,7 +1084,7 @@ Gtk_2_0_gir_CFLAGS = \
$(INCLUDES) \
-DGTK_DISABLE_DEPRECATED \
-DGTK_TEXT_USE_INTERNAL_UNSUPPORTED_API
Gtk_2_0_gir_LIBS = $(gtktargetlib) $(top_builddir)/gdk/$(gdktargetlib)
Gtk_2_0_gir_LIBS = $(gtktargetlib)
Gtk_2_0_gir_FILES = \
$(filter-out gtkprivate.h gtkpixdatautils.h gtktextlayout.h gtkmarshal.h, \
$(introspection_files))
@ -1139,7 +1142,7 @@ $(GTK_UPDATE_ICON_CACHE_MANIFEST):
echo '</assembly>' ) >$@
$(GTK_UPDATE_ICON_CACHE_RC):
(echo -e '#include <winbase.h>\nCREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST '$(GTK_UPDATE_ICON_CACHE_MANIFEST)) >$@
(echo -e '#include <winbase.h>\nCREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "'$(GTK_UPDATE_ICON_CACHE_MANIFEST)'"') >$@
$(GTK_UPDATE_ICON_CACHE_MANIFEST_OBJECT): $(GTK_UPDATE_ICON_CACHE_RC) $(GTK_UPDATE_ICON_CACHE_MANIFEST)
$(WINDRES) --input $< --output $@ --output-format=coff

View file

@ -5,14 +5,7 @@ if test "x$gtk_all_c_sources" = x; then
exit 1
fi
srcdir=${srcdir-.}
grep 'IN_FILE' "$srcdir/gtk.symbols" | sed 's/^[^(]*(//;s/).*//;s/__GTK_MARSHAL_MARSHAL_C__/__gtk_marshal_MARSHAL_C__/' | grep __ | sort -u > expected-files
{
for file in $gtk_all_c_sources; do
test -f "$file" || file="$srcdir/$file"
grep '^ *# *define __' "$file"
done
} | sed 's/.*define //;s/ *$//;s/__GTK_MARSHAL_MARSHAL_C__/__gtk_marshal_MARSHAL_C__/' | sort > actual-files
grep 'IN_FILE' ${srcdir-.}/gtk.symbols | sed 's/.*(//;s/).*//' | grep __ | sort -u > expected-files
{ cd ${srcdir-.}; grep '^ *# *define __' $gtk_all_c_sources; } | sed 's/.*define //;s/ *$//' | sort > actual-files
diff expected-files actual-files && rm -f expected-files actual-files

View file

@ -688,8 +688,7 @@ gtk_calendar_init (GtkCalendar *calendar)
#else
static const char *month_format = NULL;
char buffer[255];
GDateTime *tmp_dt;
gchar *tmp_str;
time_t tmp_time;
#endif
GtkCalendarPrivate *priv;
gchar *year_before;
@ -710,15 +709,9 @@ gtk_calendar_init (GtkCalendar *calendar)
for (i=0; i<7; i++)
{
#ifndef G_OS_WIN32
tmp_dt = g_date_time_new_utc (2001, 1, i + 7, 12, 0, 0.0);
if (tmp_dt)
{
tmp_str = g_date_time_format (tmp_dt, "%a");
default_abbreviated_dayname[i] = tmp_str ? tmp_str : g_strdup ("");
g_date_time_unref (tmp_dt);
}
else
default_abbreviated_dayname[i] = g_strdup ("");
tmp_time = (i + 3) * 86400;
strftime (buffer, sizeof (buffer), "%a", gmtime (&tmp_time));
default_abbreviated_dayname[i] = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
#else
if (!GetLocaleInfoW (GetThreadLocale (), LOCALE_SABBREVDAYNAME1 + (i+6)%7,
wbuffer, G_N_ELEMENTS (wbuffer)))
@ -732,30 +725,21 @@ gtk_calendar_init (GtkCalendar *calendar)
for (i=0; i<12; i++)
{
#ifndef G_OS_WIN32
tmp_dt = g_date_time_new_utc (2001, i + 1, 1, 12, 0, 0.0);
tmp_time = i * 2764800;
if (G_UNLIKELY (month_format == NULL))
{
buffer[0] = '\0';
month_format = "%OB";
tmp_str = tmp_dt ? g_date_time_format (tmp_dt, month_format) : NULL;
if (tmp_str)
{
g_strlcpy (buffer, tmp_str, sizeof (buffer));
g_free (tmp_str);
}
strftime (buffer, sizeof (buffer), month_format, gmtime (&tmp_time));
/* "%OB" is not supported in Linux with glibc < 2.27 */
if (!strcmp (buffer, "%OB") || !strcmp (buffer, "OB") || !strcmp (buffer, ""))
month_format = "%B";
}
if (tmp_dt)
{
tmp_str = g_date_time_format (tmp_dt, month_format);
default_monthname[i] = tmp_str ? tmp_str : g_strdup ("");
g_date_time_unref (tmp_dt);
}
else
default_monthname[i] = g_strdup ("");
strftime (buffer, sizeof (buffer), month_format, gmtime (&tmp_time));
default_monthname[i] = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
#else
if (!GetLocaleInfoW (GetThreadLocale (), LOCALE_SMONTHNAME1 + i,
wbuffer, G_N_ELEMENTS (wbuffer)))

View file

@ -884,11 +884,11 @@ gtk_clipboard_wait_for_targets (GtkClipboard *clipboard,
clipboard->n_cached_targets != -1)
{
if (n_targets)
*n_targets = clipboard->n_cached_targets;
*n_targets = clipboard->n_cached_targets;
if (targets)
*targets = _gtk_memdup2 (clipboard->cached_targets,
clipboard->n_cached_targets * sizeof (GdkAtom));
*targets = _gtk_memdup2 (clipboard->cached_targets,
clipboard->n_cached_targets * sizeof (GdkAtom));
return TRUE;
}
@ -909,11 +909,11 @@ gtk_clipboard_wait_for_targets (GtkClipboard *clipboard,
result = gtk_selection_data_get_targets (data, &tmp_targets, &tmp_n_targets);
if (gdk_display_supports_selection_notification (gtk_clipboard_get_display (clipboard)))
{
clipboard->n_cached_targets = tmp_n_targets;
clipboard->cached_targets = _gtk_memdup2 (tmp_targets,
tmp_n_targets * sizeof (GdkAtom));
}
{
clipboard->n_cached_targets = tmp_n_targets;
clipboard->cached_targets = _gtk_memdup2 (tmp_targets,
tmp_n_targets * sizeof (GdkAtom));
}
if (n_targets)
*n_targets = tmp_n_targets;

View file

@ -548,7 +548,7 @@ gtk_clipboard_set_contents (GtkClipboard *clipboard,
clipboard_add_owner_notify (clipboard);
}
}
}
clipboard->get_func = get_func;
clipboard->clear_func = clear_func;
@ -1758,11 +1758,11 @@ gtk_clipboard_wait_for_targets (GtkClipboard *clipboard,
clipboard->n_cached_targets != -1)
{
if (n_targets)
*n_targets = clipboard->n_cached_targets;
*n_targets = clipboard->n_cached_targets;
if (targets)
*targets = _gtk_memdup2 (clipboard->cached_targets,
clipboard->n_cached_targets * sizeof (GdkAtom));
*targets = _gtk_memdup2 (clipboard->cached_targets,
clipboard->n_cached_targets * sizeof (GdkAtom));
return TRUE;
}
@ -1783,11 +1783,11 @@ gtk_clipboard_wait_for_targets (GtkClipboard *clipboard,
result = gtk_selection_data_get_targets (data, &tmp_targets, &tmp_n_targets);
if (gdk_display_supports_selection_notification (gtk_clipboard_get_display (clipboard)))
{
clipboard->n_cached_targets = tmp_n_targets;
clipboard->cached_targets = _gtk_memdup2 (tmp_targets,
tmp_n_targets * sizeof (GdkAtom));
}
{
clipboard->n_cached_targets = tmp_n_targets;
clipboard->cached_targets = _gtk_memdup2 (tmp_targets,
tmp_n_targets * sizeof (GdkAtom));
}
if (n_targets)
*n_targets = tmp_n_targets;

View file

@ -40,6 +40,9 @@
#include "gtktoolbar.h"
#include <gobject/gobjectnotifyqueue.c>
#include <gobject/gvaluecollector.h>
#ifdef GDK_WINDOWING_QUARTZ
#include "gdk/quartz/gdkquartz.h"
#endif
#include "gtkalias.h"
@ -1357,7 +1360,16 @@ gtk_container_idle_sizer (gpointer data)
gtk_container_check_resize (GTK_CONTAINER (widget));
}
#ifdef GDK_WINDOWING_QUARTZ
/* macOS 11 and newer can trigger expensive full-window redraws here.
* Keep the traditional update processing path for older Quartz targets,
* but let the normal GDK update idle handle updates on Big Sur and newer.
*/
if (gdk_quartz_osx_version () < GDK_OSX_BIG_SUR)
gdk_window_process_all_updates ();
#else
gdk_window_process_all_updates ();
#endif
return FALSE;
}

File diff suppressed because it is too large Load diff

View file

@ -122,8 +122,7 @@ struct _GtkFileChooserWidgetPrivate
typedef enum {
LOAD_EMPTY, /* There is no model */
LOAD_PRELOAD, /* Model is loading and a timer is running; model isn't inserted into the tree yet */
LOAD_LOADING, /* Timeout expired, model is inserted into the tree, but not fully loaded yet */
LOAD_LOADING, /* Model is loading; inserted into the view when loading finishes */
LOAD_FINISHED /* Model is fully loaded and inserted into the tree */
} LoadState;
@ -139,7 +138,8 @@ typedef enum {
typedef enum {
VIEW_MODE_LIST,
VIEW_MODE_ICON
VIEW_MODE_ICON,
VIEW_MODE_COMPACT
} ViewMode;
typedef enum {
@ -176,13 +176,35 @@ struct _GtkFileChooserDefault
GtkWidget *browse_shortcuts_popup_menu;
GtkWidget *browse_shortcuts_popup_menu_remove_item;
GtkWidget *browse_shortcuts_popup_menu_rename_item;
GtkWidget *browse_shortcuts_popup_menu_open_containing_folder_item;
GtkWidget *browse_files_tree_view;
GtkWidget *browse_files_scrolled_window;
GtkWidget *browse_files_current_view;
GtkWidget *browse_files_icon_view;
GtkTreePath *icon_tooltip_path;
gchar *icon_tooltip_text;
gint icon_tooltip_width;
ViewMode icon_tooltip_view_mode;
OperationMode icon_tooltip_operation_mode;
guint icon_tooltip_visible : 1;
GtkTreePath *list_tooltip_path;
GtkTreeModel *list_tooltip_model;
gchar *list_tooltip_text;
gint list_tooltip_width;
OperationMode list_tooltip_operation_mode;
guint list_tooltip_visible : 1;
GtkWidget *browse_files_popup_menu;
GtkWidget *browse_files_popup_menu_add_shortcut_item;
GtkWidget *browse_files_popup_menu_copy_item;
GtkWidget *browse_files_popup_menu_cut_item;
GtkWidget *browse_files_popup_menu_paste_item;
GtkWidget *browse_files_popup_menu_copy_location_item;
GtkWidget *browse_files_popup_menu_open_containing_folder_item;
GtkWidget *browse_files_popup_menu_rename_item;
GtkWidget *browse_files_popup_menu_trash_item;
GtkWidget *browse_files_popup_menu_hidden_files_item;
GtkWidget *browse_files_popup_menu_preview_panel_item;
GtkWidget *browse_files_popup_menu_thumbnails_item;
GtkWidget *browse_files_popup_menu_size_column_item;
GtkWidget *browse_files_popup_menu_sort_by_name_item;
GtkWidget *browse_files_popup_menu_sort_by_size_item;
@ -224,10 +246,18 @@ struct _GtkFileChooserDefault
GtkWidget *preview_box;
GtkWidget *preview_label;
GtkWidget *preview_widget;
GtkWidget *preview_panel;
GtkWidget *preview_panel_image;
GtkWidget *preview_panel_title_label;
GtkWidget *preview_panel_info_label;
guint preview_panel_resize_timeout_id;
guint preview_panel_update_timeout_id;
gint preview_panel_last_image_size;
GtkWidget *extra_align;
GtkWidget *extra_widget;
GtkWidget *view_mode_combo_box;
GtkWidget *preview_panel_toggle_button;
GtkWidget *icon_view_scale_hbox;
GtkWidget *icon_view_scale;
GtkWidget *icon_view_scale_zoom_in_icon;
@ -237,8 +267,29 @@ struct _GtkFileChooserDefault
guint icon_view_scale_after_layout_id;
gint pending_icon_view_icon_size;
gint icon_view_scale_visible_overscan;
/* Cached viewport avoids an O(n) visible-range scan per icon cell. */
guint icon_view_visible_range_idle_id;
gint icon_view_visible_first, icon_view_visible_last;
guint icon_view_visible_range_valid : 1;
ViewMode view_mode;
/* Visible-only thumbnail generation state. Thumbnail workers are
* cancellable so changing folders or views never leaves stale decode work
* running for files that are no longer useful to the user.
*/
GSList *thumbnail_queue;
GSList *thumbnail_queue_tail;
GHashTable *thumbnail_queued_files;
GHashTable *file_clipboard_cut_files;
GCancellable *thumbnail_cancellable;
guint thumbnail_queue_idle_id;
guint thumbnail_generation_serial;
guint thumbnail_worker_running : 1;
GdkPixbuf *thumbnail_standard_icon_pixbuf;
gint thumbnail_standard_icon_size;
GtkWidget *location_button;
GtkWidget *location_entry_box;
GtkWidget *location_label;
@ -264,7 +315,6 @@ struct _GtkFileChooserDefault
LoadState load_state;
ReloadState reload_state;
guint load_timeout_id;
OperationMode operation_mode;
@ -294,6 +344,11 @@ struct _GtkFileChooserDefault
GSource *edited_idle;
char *edited_new_text;
GSource *rename_idle;
char *rename_new_text;
char *rename_old_text;
GFile *rename_file;
gulong settings_signal_id;
int list_view_icon_size;
int icon_view_icon_size;
@ -318,9 +373,11 @@ struct _GtkFileChooserDefault
guint local_only : 1;
guint preview_widget_active : 1;
guint preview_panel_active : 1;
guint use_preview_label : 1;
guint select_multiple : 1;
guint show_hidden : 1;
guint show_thumbnails : 1;
guint do_overwrite_confirmation : 1;
guint list_sort_ascending : 1;
guint changing_folder : 1;

View file

@ -42,6 +42,8 @@
#define VIEW_MODE_KEY "ViewMode"
#define ICON_VIEW_SCALE_KEY "IconViewScale"
#define SHOW_HIDDEN_KEY "ShowHidden"
#define SHOW_PREVIEW_PANEL_KEY "ShowPreviewPanel"
#define SHOW_THUMBNAILS_KEY "ShowThumbnails"
#define SHOW_SIZE_COLUMN_KEY "ShowSizeColumn"
#define GEOMETRY_X_KEY "GeometryX"
#define GEOMETRY_Y_KEY "GeometryY"
@ -65,6 +67,7 @@
#define MODE_LIST_VIEW "list-view"
#define MODE_ICON_VIEW "icon-view"
#define MODE_COMPACT_VIEW "compact-view"
#define EQ(a, b) (g_ascii_strcasecmp ((a), (b)) == 0)
@ -174,6 +177,8 @@ ensure_settings_read (GtkFileChooserSettings *settings)
settings->view_mode = VIEW_MODE_LIST;
else if (EQ (view_mode_str, MODE_ICON_VIEW))
settings->view_mode = VIEW_MODE_ICON;
else if (EQ (view_mode_str, MODE_COMPACT_VIEW))
settings->view_mode = VIEW_MODE_COMPACT;
else
g_warning ("Unknown view mode '%s' encountered in filechooser settings",
view_mode_str);
@ -194,6 +199,24 @@ ensure_settings_read (GtkFileChooserSettings *settings)
else
settings->show_hidden = value != FALSE;
/* Show preview panel */
value = g_key_file_get_boolean (key_file, SETTINGS_GROUP,
SHOW_PREVIEW_PANEL_KEY, &error);
if (error)
warn_if_invalid_key_and_clear_error (SHOW_PREVIEW_PANEL_KEY, &error);
else
settings->show_preview_panel = value != FALSE;
/* Show thumbnails */
value = g_key_file_get_boolean (key_file, SETTINGS_GROUP,
SHOW_THUMBNAILS_KEY, &error);
if (error)
warn_if_invalid_key_and_clear_error (SHOW_THUMBNAILS_KEY, &error);
else
settings->show_thumbnails = value != FALSE;
/* Show size column */
value = g_key_file_get_boolean (key_file, SETTINGS_GROUP,
@ -287,6 +310,8 @@ _gtk_file_chooser_settings_init (GtkFileChooserSettings *settings)
settings->sort_order = GTK_SORT_ASCENDING;
settings->sort_column = FILE_LIST_COL_NAME;
settings->show_hidden = FALSE;
settings->show_preview_panel = FALSE;
settings->show_thumbnails = TRUE;
settings->show_size_column = TRUE;
settings->geometry_x = -1;
settings->geometry_y = -1;
@ -357,6 +382,34 @@ _gtk_file_chooser_settings_set_show_hidden (GtkFileChooserSettings *settings,
settings->show_hidden = show_hidden != FALSE;
}
gboolean
_gtk_file_chooser_settings_get_show_preview_panel (GtkFileChooserSettings *settings)
{
ensure_settings_read (settings);
return settings->show_preview_panel;
}
void
_gtk_file_chooser_settings_set_show_preview_panel (GtkFileChooserSettings *settings,
gboolean show_preview_panel)
{
settings->show_preview_panel = show_preview_panel != FALSE;
}
gboolean
_gtk_file_chooser_settings_get_show_thumbnails (GtkFileChooserSettings *settings)
{
ensure_settings_read (settings);
return settings->show_thumbnails;
}
void
_gtk_file_chooser_settings_set_show_thumbnails (GtkFileChooserSettings *settings,
gboolean show_thumbnails)
{
settings->show_thumbnails = show_thumbnails != FALSE;
}
void
_gtk_file_chooser_settings_set_show_size_column (GtkFileChooserSettings *settings,
gboolean show_column)
@ -477,6 +530,8 @@ _gtk_file_chooser_settings_save (GtkFileChooserSettings *settings,
view_mode_str = MODE_LIST_VIEW;
else if (settings->view_mode == VIEW_MODE_ICON)
view_mode_str = MODE_ICON_VIEW;
else if (settings->view_mode == VIEW_MODE_COMPACT)
view_mode_str = MODE_COMPACT_VIEW;
else
{
g_assert_not_reached ();
@ -545,6 +600,10 @@ _gtk_file_chooser_settings_save (GtkFileChooserSettings *settings,
ICON_VIEW_SCALE_KEY, settings->icon_view_scale);
g_key_file_set_boolean (key_file, SETTINGS_GROUP,
SHOW_HIDDEN_KEY, settings->show_hidden);
g_key_file_set_boolean (key_file, SETTINGS_GROUP,
SHOW_PREVIEW_PANEL_KEY, settings->show_preview_panel);
g_key_file_set_boolean (key_file, SETTINGS_GROUP,
SHOW_THUMBNAILS_KEY, settings->show_thumbnails);
g_key_file_set_boolean (key_file, SETTINGS_GROUP,
SHOW_SIZE_COLUMN_KEY, settings->show_size_column);
g_key_file_set_integer (key_file, SETTINGS_GROUP,

View file

@ -56,9 +56,11 @@ struct _GtkFileChooserSettings
int geometry_width;
int geometry_height;
guint settings_read : 1;
guint show_hidden : 1;
guint show_size_column : 1;
guint settings_read : 1;
guint show_hidden : 1;
guint show_preview_panel : 1;
guint show_thumbnails : 1;
guint show_size_column : 1;
};
struct _GtkFileChooserSettingsClass
@ -86,6 +88,14 @@ gboolean _gtk_file_chooser_settings_get_show_hidden (GtkFileChooserSettings *set
void _gtk_file_chooser_settings_set_show_hidden (GtkFileChooserSettings *settings,
gboolean show_hidden);
gboolean _gtk_file_chooser_settings_get_show_preview_panel (GtkFileChooserSettings *settings);
void _gtk_file_chooser_settings_set_show_preview_panel (GtkFileChooserSettings *settings,
gboolean show_preview_panel);
gboolean _gtk_file_chooser_settings_get_show_thumbnails (GtkFileChooserSettings *settings);
void _gtk_file_chooser_settings_set_show_thumbnails (GtkFileChooserSettings *settings,
gboolean show_thumbnails);
gboolean _gtk_file_chooser_settings_get_show_size_column (GtkFileChooserSettings *settings);
void _gtk_file_chooser_settings_set_show_size_column (GtkFileChooserSettings *settings,
gboolean show_column);

File diff suppressed because it is too large Load diff

View file

@ -92,7 +92,7 @@ void _gtk_file_system_model_set_filter (GtkFileSystemModel
GtkFileFilter *filter);
void _gtk_file_system_model_add_editable (GtkFileSystemModel *model,
GtkTreeIter *iter);
GtkTreeIter *iter);
void _gtk_file_system_model_remove_editable (GtkFileSystemModel *model);
G_END_DECLS

View file

@ -889,7 +889,7 @@ gtk_font_button_update_font_info (GtkFontButton *font_button)
if (style == NULL || !g_ascii_strcasecmp (style, "Regular"))
family_style = g_strdup (family);
else
family_style = g_strdup_printf ("%s %s", family, style);
family_style = g_strdup_printf ("%s %s", family, _(style));
gtk_label_set_text (GTK_LABEL (font_button->priv->font_label), family_style);

View file

@ -76,6 +76,22 @@
#define DEFAULT_FONT_NAME "Sans 10"
/* Common font style names, listed here so they can be translated when
* Pango returns the standard English names.
*/
#define FONT_STYLE_ULTRA_LIGHT N_("Ultra-Light")
#define FONT_STYLE_LIGHT N_("Light")
#define FONT_STYLE_MEDIUM N_("Medium")
#define FONT_STYLE_NORMAL N_("Normal")
#define FONT_STYLE_REGULAR N_("Regular")
#define FONT_STYLE_ITALIC N_("Italic")
#define FONT_STYLE_OBLIQUE N_("Oblique")
#define FONT_STYLE_SEMI_BOLD N_("Semi-Bold")
#define FONT_STYLE_BOLD N_("Bold")
#define FONT_STYLE_ULTRA_BOLD N_("Ultra-Bold")
#define FONT_STYLE_HEAVY N_("Heavy")
#define FONT_STYLE_BOLD_ITALIC N_("Bold Italic")
/* This is the initial and maximum height of the preview entry (it expands
when large font sizes are selected). Initial height is also the minimum. */
#define INITIAL_PREVIEW_HEIGHT 44
@ -699,11 +715,11 @@ gtk_font_selection_scroll_on_map (GtkWidget *widget,
}
/* This is called when a family is selected in the list. */
static void
gtk_font_selection_select_font (GtkTreeSelection *selection,
gpointer data)
static gboolean
gtk_font_selection_real_select_font (gpointer data)
{
GtkFontSelection *fontsel;
GtkTreeSelection *selection;
GtkTreeModel *model;
GtkTreeIter iter;
#ifdef INCLUDE_FONT_ENTRIES
@ -711,6 +727,7 @@ gtk_font_selection_select_font (GtkTreeSelection *selection,
#endif
fontsel = GTK_FONT_SELECTION (data);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (fontsel->family_list));
if (gtk_tree_selection_get_selected (selection, &model, &iter))
{
@ -718,29 +735,53 @@ gtk_font_selection_select_font (GtkTreeSelection *selection,
gtk_tree_model_get (model, &iter, FAMILY_COLUMN, &family, -1);
if (fontsel->family != family)
{
gtk_font_selection_ref_family (fontsel, family);
{
gtk_font_selection_ref_family (fontsel, family);
#ifdef INCLUDE_FONT_ENTRIES
family_name = pango_font_family_get_name (fontsel->family);
gtk_entry_set_text (GTK_ENTRY (fontsel->font_entry), family_name);
family_name = pango_font_family_get_name (fontsel->family);
gtk_entry_set_text (GTK_ENTRY (fontsel->font_entry), family_name);
#endif
gtk_font_selection_show_available_styles (fontsel);
gtk_font_selection_select_best_style (fontsel, TRUE);
}
gtk_font_selection_show_available_styles (fontsel);
gtk_font_selection_select_best_style (fontsel, TRUE);
}
g_object_unref (family);
}
return FALSE;
}
static int
cmp_families (const void *a, const void *b)
static void
gtk_font_selection_select_font (GtkTreeSelection *selection,
gpointer data)
{
const char *a_name = pango_font_family_get_name (*(PangoFontFamily **)a);
const char *b_name = pango_font_family_get_name (*(PangoFontFamily **)b);
GtkFontSelection *fontsel = GTK_FONT_SELECTION (data);
return g_utf8_collate (a_name, b_name);
gtk_font_selection_real_select_font (fontsel);
}
typedef struct
{
PangoFontFamily *family;
const gchar *name;
gchar *collate_key;
} FontFamilySortInfo;
static int
cmp_families (const void *a,
const void *b)
{
const FontFamilySortInfo *family_a = a;
const FontFamilySortInfo *family_b = b;
gint result;
result = strcmp (family_a->collate_key, family_b->collate_key);
if (result != 0)
return result;
return g_strcmp0 (family_a->name, family_b->name);
}
static void
@ -748,6 +789,7 @@ gtk_font_selection_show_available_fonts (GtkFontSelection *fontsel)
{
GtkListStore *model;
PangoFontFamily **families;
FontFamilySortInfo *sorted_families;
PangoFontFamily *match_family = NULL;
gint n_families, i;
GtkTreeIter match_row;
@ -755,27 +797,37 @@ gtk_font_selection_show_available_fonts (GtkFontSelection *fontsel)
model = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (fontsel->family_list)));
pango_context_list_families (gtk_widget_get_pango_context (GTK_WIDGET (fontsel)),
&families, &n_families);
qsort (families, n_families, sizeof (PangoFontFamily *), cmp_families);
&families, &n_families);
sorted_families = g_new (FontFamilySortInfo, n_families);
for (i = 0; i < n_families; i++)
{
const gchar *name = pango_font_family_get_name (families[i]);
sorted_families[i].family = families[i];
sorted_families[i].name = name;
sorted_families[i].collate_key = g_utf8_collate_key (name ? name : "", -1);
}
qsort (sorted_families, n_families, sizeof (FontFamilySortInfo), cmp_families);
gtk_list_store_clear (model);
for (i=0; i<n_families; i++)
for (i = 0; i < n_families; i++)
{
const gchar *name = pango_font_family_get_name (families[i]);
const gchar *name = sorted_families[i].name;
GtkTreeIter iter;
gtk_list_store_append (model, &iter);
gtk_list_store_set (model, &iter,
FAMILY_COLUMN, families[i],
FAMILY_NAME_COLUMN, name,
-1);
gtk_list_store_insert_with_values (model, &iter, -1,
FAMILY_COLUMN, sorted_families[i].family,
FAMILY_NAME_COLUMN, name,
-1);
if (i == 0 || !g_ascii_strcasecmp (name, "sans"))
{
match_family = families[i];
match_row = iter;
}
{
match_family = sorted_families[i].family;
match_row = iter;
}
}
gtk_font_selection_ref_family (fontsel, match_family);
@ -784,10 +836,14 @@ gtk_font_selection_show_available_fonts (GtkFontSelection *fontsel)
set_cursor_to_iter (GTK_TREE_VIEW (fontsel->family_list), &match_row);
#ifdef INCLUDE_FONT_ENTRIES
gtk_entry_set_text (GTK_ENTRY (fontsel->font_entry),
pango_font_family_get_name (match_family));
pango_font_family_get_name (match_family));
#endif /* INCLUDE_FONT_ENTRIES */
}
for (i = 0; i < n_families; i++)
g_free (sorted_families[i].collate_key);
g_free (sorted_families);
g_free (families);
}
@ -813,18 +869,26 @@ compare_font_descriptions (const PangoFontDescription *a, const PangoFontDescrip
return 0;
}
static int
faces_sort_func (const void *a, const void *b)
typedef struct
{
PangoFontDescription *desc_a = pango_font_face_describe (*(PangoFontFace **)a);
PangoFontDescription *desc_b = pango_font_face_describe (*(PangoFontFace **)b);
PangoFontFace *face;
PangoFontDescription *desc;
const gchar *name;
} FontFaceSortInfo;
int ord = compare_font_descriptions (desc_a, desc_b);
static int
faces_sort_func (const void *a,
const void *b)
{
const FontFaceSortInfo *face_a = a;
const FontFaceSortInfo *face_b = b;
gint result;
pango_font_description_free (desc_a);
pango_font_description_free (desc_b);
result = compare_font_descriptions (face_a->desc, face_b->desc);
if (result != 0)
return result;
return ord;
return g_strcmp0 (face_a->name, face_b->name);
}
static gboolean
@ -844,6 +908,7 @@ gtk_font_selection_show_available_styles (GtkFontSelection *fontsel)
{
gint n_faces, i;
PangoFontFace **faces;
FontFaceSortInfo *sorted_faces;
PangoFontDescription *old_desc;
GtkListStore *model;
GtkTreeIter match_row;
@ -857,38 +922,40 @@ gtk_font_selection_show_available_styles (GtkFontSelection *fontsel)
old_desc= NULL;
pango_font_family_list_faces (fontsel->family, &faces, &n_faces);
qsort (faces, n_faces, sizeof (PangoFontFace *), faces_sort_func);
sorted_faces = g_new (FontFaceSortInfo, n_faces);
for (i = 0; i < n_faces; i++)
{
sorted_faces[i].face = faces[i];
sorted_faces[i].desc = pango_font_face_describe (faces[i]);
sorted_faces[i].name = pango_font_face_get_face_name (faces[i]);
}
qsort (sorted_faces, n_faces, sizeof (FontFaceSortInfo), faces_sort_func);
gtk_list_store_clear (model);
for (i=0; i < n_faces; i++)
for (i = 0; i < n_faces; i++)
{
GtkTreeIter iter;
const gchar *str = pango_font_face_get_face_name (faces[i]);
const gchar *str = sorted_faces[i].name;
gtk_list_store_append (model, &iter);
gtk_list_store_set (model, &iter,
FACE_COLUMN, faces[i],
FACE_NAME_COLUMN, str,
-1);
gtk_list_store_insert_with_values (model, &iter, -1,
FACE_COLUMN, sorted_faces[i].face,
FACE_NAME_COLUMN, _(str),
-1);
if (i == 0)
{
match_row = iter;
match_face = faces[i];
}
else if (old_desc)
{
PangoFontDescription *tmp_desc = pango_font_face_describe (faces[i]);
if (font_description_style_equal (tmp_desc, old_desc))
{
match_row = iter;
match_face = faces[i];
}
pango_font_description_free (tmp_desc);
}
{
match_row = iter;
match_face = sorted_faces[i].face;
}
else if (old_desc &&
font_description_style_equal (sorted_faces[i].desc, old_desc))
{
match_row = iter;
match_face = sorted_faces[i].face;
}
}
if (old_desc)
@ -905,6 +972,10 @@ gtk_font_selection_show_available_styles (GtkFontSelection *fontsel)
set_cursor_to_iter (GTK_TREE_VIEW (fontsel->face_list), &match_row);
}
for (i = 0; i < n_faces; i++)
pango_font_description_free (sorted_faces[i].desc);
g_free (sorted_faces);
g_free (faces);
}
@ -934,14 +1005,16 @@ gtk_font_selection_select_best_style (GtkFontSelection *fontsel,
/* This is called when a style is selected in the list. */
static void
gtk_font_selection_select_style (GtkTreeSelection *selection,
gpointer data)
static gboolean
gtk_font_selection_real_select_style (gpointer data)
{
GtkFontSelection *fontsel = GTK_FONT_SELECTION (data);
GtkTreeSelection *selection;
GtkTreeModel *model;
GtkTreeIter iter;
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (fontsel->face_list));
if (gtk_tree_selection_get_selected (selection, &model, &iter))
{
PangoFontFace *face;
@ -953,6 +1026,17 @@ gtk_font_selection_select_style (GtkTreeSelection *selection,
gtk_font_selection_show_available_sizes (fontsel, FALSE);
gtk_font_selection_select_best_size (fontsel);
return FALSE;
}
static void
gtk_font_selection_select_style (GtkTreeSelection *selection,
gpointer data)
{
GtkFontSelection *fontsel = GTK_FONT_SELECTION (data);
gtk_font_selection_real_select_style (fontsel);
}
static void
@ -975,8 +1059,9 @@ gtk_font_selection_show_available_sizes (GtkFontSelection *fontsel,
{
GtkTreeIter iter;
gtk_list_store_append (model, &iter);
gtk_list_store_set (model, &iter, SIZE_COLUMN, font_sizes[i], -1);
gtk_list_store_insert_with_values (model, &iter, -1,
SIZE_COLUMN, font_sizes[i],
-1);
if (font_sizes[i] * PANGO_SCALE == fontsel->size)
set_cursor_to_iter (GTK_TREE_VIEW (fontsel->size_list), &iter);
@ -1085,22 +1170,34 @@ gtk_font_selection_size_focus_out (GtkWidget *w,
}
/* This is called when a size is selected in the list. */
static void
gtk_font_selection_select_size (GtkTreeSelection *selection,
gpointer data)
static gboolean
gtk_font_selection_real_select_size (gpointer data)
{
GtkFontSelection *fontsel;
GtkTreeSelection *selection;
GtkTreeModel *model;
GtkTreeIter iter;
gint new_size;
fontsel = GTK_FONT_SELECTION (data);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (fontsel->size_list));
if (gtk_tree_selection_get_selected (selection, &model, &iter))
{
gtk_tree_model_get (model, &iter, SIZE_COLUMN, &new_size, -1);
gtk_font_selection_set_size (fontsel, new_size * PANGO_SCALE);
}
return FALSE;
}
static void
gtk_font_selection_select_size (GtkTreeSelection *selection,
gpointer data)
{
GtkFontSelection *fontsel = GTK_FONT_SELECTION (data);
gtk_font_selection_real_select_size (fontsel);
}
static void

View file

@ -2945,6 +2945,10 @@ icon_info_ensure_scale_and_pixbuf (GtkIconInfo *icon_info,
if (mime_type && strcmp (mime_type, "image/svg+xml") == 0)
is_svg = TRUE;
#ifdef G_OS_WIN32
else if (content_type && strcmp (content_type, ".svg") == 0)
is_svg = TRUE;
#endif
}
g_object_unref (file_info);

View file

@ -120,6 +120,12 @@ struct _GtkIconViewPrivate
GtkAdjustment *vadjustment;
guint layout_idle_id;
GList *layout_items;
gint layout_y, layout_maximum_width;
gint layout_row, layout_item_width, layout_next_index;
guint layout_in_progress : 1;
guint layout_scanning_width : 1;
guint layout_restart : 1;
gboolean doing_rubberband;
gint rubberband_x1, rubberband_y1;
@ -304,6 +310,7 @@ static void gtk_icon_view_queue_draw_path (GtkIco
GtkTreePath *path);
static void gtk_icon_view_queue_draw_item (GtkIconView *icon_view,
GtkIconViewItem *item);
static gboolean layout_callback (gpointer user_data);
static void gtk_icon_view_queue_layout (GtkIconView *icon_view);
static void gtk_icon_view_set_cursor_item (GtkIconView *icon_view,
GtkIconViewItem *item,
@ -1491,6 +1498,8 @@ gtk_icon_view_size_allocate (GtkWidget *widget,
GtkIconView *icon_view = GTK_ICON_VIEW (widget);
GtkAdjustment *hadjustment, *vadjustment;
gboolean relayout = (icon_view->priv->layout_idle_id != 0 ||
widget->allocation.width != allocation->width);
widget->allocation = *allocation;
@ -1504,7 +1513,8 @@ gtk_icon_view_size_allocate (GtkWidget *widget,
MAX (icon_view->priv->height, allocation->height));
}
gtk_icon_view_layout (icon_view);
if (relayout)
gtk_icon_view_layout (icon_view);
gtk_icon_view_allocate_children (icon_view);
@ -1588,6 +1598,10 @@ gtk_icon_view_expose (GtkWidget *widget,
for (icons = icon_view->priv->items; icons; icons = icons->next)
{
GtkIconViewItem *item = icons->data;
if (icon_view->priv->layout_in_progress &&
item->index >= icon_view->priv->layout_next_index)
break;
GdkRectangle area;
area.x = item->x;
@ -2810,11 +2824,8 @@ gtk_icon_view_set_adjustment_upper (GtkAdjustment *adj,
static void
gtk_icon_view_layout (GtkIconView *icon_view)
{
gint y = 0, maximum_width = 0;
GList *icons;
GtkWidget *widget;
gint row;
gint item_width;
gint64 deadline;
if (icon_view->priv->layout_idle_id != 0)
{
@ -2823,54 +2834,100 @@ gtk_icon_view_layout (GtkIconView *icon_view)
}
if (icon_view->priv->model == NULL)
return;
{
icon_view->priv->layout_in_progress = FALSE;
icon_view->priv->layout_items = NULL;
return;
}
widget = GTK_WIDGET (icon_view);
deadline = g_get_monotonic_time () + 2000;
item_width = icon_view->priv->item_width;
if (item_width < 0)
if (!icon_view->priv->layout_in_progress ||
icon_view->priv->layout_restart)
{
for (icons = icon_view->priv->items; icons; icons = icons->next)
{
GtkIconViewItem *item = icons->data;
gtk_icon_view_calculate_item_size (icon_view, item);
item_width = MAX (item_width, item->width);
}
icon_view->priv->layout_in_progress = TRUE;
icon_view->priv->layout_restart = FALSE;
icon_view->priv->layout_items = icon_view->priv->items;
icon_view->priv->layout_y = icon_view->priv->margin;
icon_view->priv->layout_maximum_width = 0;
icon_view->priv->layout_row = 0;
icon_view->priv->layout_item_width = icon_view->priv->item_width;
icon_view->priv->layout_next_index = 0;
icon_view->priv->layout_scanning_width =
icon_view->priv->layout_item_width < 0;
if (!icon_view->priv->layout_scanning_width &&
icon_view->priv->layout_items)
{
gtk_icon_view_set_cell_data (icon_view,
icon_view->priv->layout_items->data);
adjust_wrap_width (icon_view, icon_view->priv->layout_items->data);
}
}
icons = icon_view->priv->items;
y += icon_view->priv->margin;
row = 0;
if (icons)
while (icon_view->priv->layout_scanning_width &&
icon_view->priv->layout_items)
{
gtk_icon_view_set_cell_data (icon_view, icons->data);
adjust_wrap_width (icon_view, icons->data);
GtkIconViewItem *item = icon_view->priv->layout_items->data;
gtk_icon_view_calculate_item_size (icon_view, item);
icon_view->priv->layout_item_width =
MAX (icon_view->priv->layout_item_width, item->width);
icon_view->priv->layout_items = icon_view->priv->layout_items->next;
if (g_get_monotonic_time () >= deadline)
goto yield;
}
do
if (icon_view->priv->layout_scanning_width)
{
icons = gtk_icon_view_layout_single_row (icon_view, icons,
item_width, row,
&y, &maximum_width);
row++;
icon_view->priv->layout_scanning_width = FALSE;
icon_view->priv->layout_items = icon_view->priv->items;
if (icon_view->priv->layout_items)
{
gtk_icon_view_set_cell_data (icon_view,
icon_view->priv->layout_items->data);
adjust_wrap_width (icon_view, icon_view->priv->layout_items->data);
}
}
while (icons != NULL);
if (maximum_width != icon_view->priv->width)
icon_view->priv->width = maximum_width;
while (icon_view->priv->layout_items)
{
icon_view->priv->layout_items =
gtk_icon_view_layout_single_row (icon_view,
icon_view->priv->layout_items,
icon_view->priv->layout_item_width,
icon_view->priv->layout_row++,
&icon_view->priv->layout_y,
&icon_view->priv->layout_maximum_width);
y += icon_view->priv->margin;
icon_view->priv->layout_next_index =
icon_view->priv->layout_items
? ((GtkIconViewItem *) icon_view->priv->layout_items->data)->index
: G_MAXINT;
if (y != icon_view->priv->height)
icon_view->priv->height = y;
if (icon_view->priv->layout_restart ||
(icon_view->priv->layout_items &&
g_get_monotonic_time () >= deadline))
goto yield;
}
icon_view->priv->layout_in_progress = FALSE;
if (icon_view->priv->layout_maximum_width != icon_view->priv->width)
icon_view->priv->width = icon_view->priv->layout_maximum_width;
icon_view->priv->layout_y += icon_view->priv->margin;
if (icon_view->priv->layout_y != icon_view->priv->height)
icon_view->priv->height = icon_view->priv->layout_y;
gtk_icon_view_set_adjustment_upper (icon_view->priv->hadjustment,
icon_view->priv->width);
icon_view->priv->width);
gtk_icon_view_set_adjustment_upper (icon_view->priv->vadjustment,
icon_view->priv->height);
icon_view->priv->height);
if (icon_view->priv->width != widget->requisition.width ||
icon_view->priv->height != widget->requisition.height)
@ -2878,8 +2935,8 @@ gtk_icon_view_layout (GtkIconView *icon_view)
if (gtk_widget_get_realized (GTK_WIDGET (icon_view)))
gdk_window_resize (icon_view->priv->bin_window,
MAX (icon_view->priv->width, widget->allocation.width),
MAX (icon_view->priv->height, widget->allocation.height));
MAX (icon_view->priv->width, widget->allocation.width),
MAX (icon_view->priv->height, widget->allocation.height));
if (icon_view->priv->scroll_to_path)
{
@ -2890,13 +2947,21 @@ gtk_icon_view_layout (GtkIconView *icon_view)
icon_view->priv->scroll_to_path = NULL;
gtk_icon_view_scroll_to_path (icon_view, path,
icon_view->priv->scroll_to_use_align,
icon_view->priv->scroll_to_row_align,
icon_view->priv->scroll_to_col_align);
icon_view->priv->scroll_to_use_align,
icon_view->priv->scroll_to_row_align,
icon_view->priv->scroll_to_col_align);
gtk_tree_path_free (path);
}
gtk_widget_queue_draw (widget);
return;
yield:
if (icon_view->priv->layout_idle_id == 0)
icon_view->priv->layout_idle_id =
gdk_threads_add_idle (layout_callback, icon_view);
gtk_widget_queue_draw (widget);
}
static void
@ -3409,6 +3474,9 @@ layout_callback (gpointer user_data)
static void
gtk_icon_view_queue_layout (GtkIconView *icon_view)
{
if (icon_view->priv->layout_in_progress)
icon_view->priv->layout_restart = TRUE;
if (icon_view->priv->layout_idle_id != 0)
return;
@ -3500,6 +3568,10 @@ gtk_icon_view_get_item_at_coords (GtkIconView *icon_view,
{
GtkIconViewItem *item = items->data;
if (icon_view->priv->layout_in_progress &&
item->index >= icon_view->priv->layout_next_index)
break;
if (x >= item->x - icon_view->priv->column_spacing/2 && x <= item->x + item->width + icon_view->priv->column_spacing/2 &&
y >= item->y - icon_view->priv->row_spacing/2 && y <= item->y + item->height + icon_view->priv->row_spacing/2)
{
@ -5207,6 +5279,10 @@ gtk_icon_view_get_visible_range (GtkIconView *icon_view,
{
GtkIconViewItem *item = icons->data;
if (icon_view->priv->layout_in_progress &&
item->index >= icon_view->priv->layout_next_index)
break;
if ((item->x + item->width >= (int)icon_view->priv->hadjustment->value) &&
(item->y + item->height >= (int)icon_view->priv->vadjustment->value) &&
(item->x <= (int) (icon_view->priv->hadjustment->value + icon_view->priv->hadjustment->page_size)) &&
@ -7917,7 +7993,7 @@ gtk_icon_view_item_accessible_image_get_image_position (AtkImage *image,
if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
return;
atk_component_get_position (ATK_COMPONENT (image), x, y, coord_type);
atk_component_get_extents (ATK_COMPONENT (image), x, y, NULL, NULL, coord_type);
if (get_pixbuf_box (GTK_ICON_VIEW (item->widget), item->item, &box))
{
@ -8601,7 +8677,7 @@ gtk_icon_view_item_accessible_get_extents (AtkComponent *component,
if (gtk_icon_view_item_accessible_is_showing (item))
{
parent_obj = gtk_widget_get_accessible (item->widget);
atk_component_get_position (ATK_COMPONENT (parent_obj), &l_x, &l_y, coord_type);
atk_component_get_extents (ATK_COMPONENT (parent_obj), &l_x, &l_y, NULL, NULL, coord_type);
*x = l_x + item->item->x;
*y = l_y + item->item->y;
}

View file

@ -79,7 +79,7 @@ struct _GtkIMModule
GModule *library;
void (*list) (const GtkIMContextInfo ***contexts,
guint *n_contexts);
guint *n_contexts);
void (*init) (GTypeModule *module);
void (*exit) (void);
GtkIMContext *(*create) (const gchar *context_id);
@ -309,6 +309,176 @@ add_builtin_module (const gchar *module_name,
return module;
}
/* Parser helpers adapted from GTK 3.24 gtkutils.c
* (gtk_read_line(), gtk_skip_space(), gtk_scan_string()).
* GTK 3 notes that these helpers were copied from pango-utils.c.
*
* Keep these helpers local to avoid depending on deprecated Pango parser
* utilities while preserving the old gtk.immodules parser semantics.
*/
#if !defined(HAVE_FLOCKFILE) && \
defined(HAVE__LOCK_FILE) && \
defined(HAVE__UNLOCK_FILE) && \
defined(HAVE__GETC_NOLOCK)
#define flockfile(f) _lock_file(f)
#define funlockfile(f) _unlock_file(f)
#define getc_unlocked(f) _getc_nolock(f)
#elif !defined(HAVE_FLOCKFILE)
#define flockfile(f) (void)1
#define funlockfile(f) (void)1
#define getc_unlocked(f) getc(f)
#endif
static gboolean
gtk_im_module_scan_string (const char **pos,
GString *out)
{
const char *p = *pos, *q = *pos;
char *tmp, *tmp2;
gboolean quoted;
while (g_ascii_isspace (*p))
p++;
if (!*p)
return FALSE;
else if (*p == '"')
{
p++;
quoted = FALSE;
for (q = p; (*q != '"') || quoted; q++)
{
if (!*q)
return FALSE;
quoted = (*q == '\\') && !quoted;
}
tmp = g_strndup (p, q - p);
tmp2 = g_strcompress (tmp);
g_string_truncate (out, 0);
g_string_append (out, tmp2);
g_free (tmp);
g_free (tmp2);
}
else
return FALSE;
q++;
*pos = q;
return TRUE;
}
static gboolean
gtk_im_module_skip_space (const char **pos)
{
const char *p = *pos;
while (g_ascii_isspace (*p))
p++;
*pos = p;
return !(*p == '\0');
}
static gint
gtk_im_module_read_line (FILE *stream,
GString *str)
{
gboolean quoted = FALSE;
gboolean comment = FALSE;
int n_read = 0;
int lines = 1;
flockfile (stream);
g_string_truncate (str, 0);
while (1)
{
int c;
c = getc_unlocked (stream);
if (c == EOF)
{
if (quoted)
g_string_append_c (str, '\\');
goto done;
}
else
n_read++;
if (quoted)
{
quoted = FALSE;
switch (c)
{
case '#':
g_string_append_c (str, '#');
break;
case '\r':
case '\n':
{
int next_c = getc_unlocked (stream);
if (!(next_c == EOF ||
(c == '\r' && next_c == '\n') ||
(c == '\n' && next_c == '\r')))
ungetc (next_c, stream);
lines++;
break;
}
default:
g_string_append_c (str, '\\');
g_string_append_c (str, c);
}
}
else
{
switch (c)
{
case '#':
comment = TRUE;
break;
case '\\':
if (!comment)
quoted = TRUE;
break;
case '\n':
{
int next_c = getc_unlocked (stream);
if (!(next_c == EOF ||
(c == '\r' && next_c == '\n') ||
(c == '\n' && next_c == '\r')))
ungetc (next_c, stream);
goto done;
}
default:
if (!comment)
g_string_append_c (str, c);
}
}
}
done:
funlockfile (stream);
return (n_read > 0) ? lines : 0;
}
static void
gtk_im_module_initialize (void)
{
@ -392,13 +562,13 @@ gtk_im_module_initialize (void)
return;
}
while (!have_error && pango_read_line (file, line_buf))
while (!have_error && gtk_im_module_read_line (file, line_buf))
{
const char *p;
p = line_buf->str;
if (!pango_skip_space (&p))
if (!gtk_im_module_skip_space (&p))
{
/* Blank line marking the end of a module
*/
@ -418,8 +588,8 @@ gtk_im_module_initialize (void)
*/
module = g_object_new (GTK_TYPE_IM_MODULE, NULL);
if (!pango_scan_string (&p, tmp_buf) ||
pango_skip_space (&p))
if (!gtk_im_module_scan_string (&p, tmp_buf) ||
gtk_im_module_skip_space (&p))
{
g_warning ("Error parsing context info in '%s'\n %s",
filename, line_buf->str);
@ -438,30 +608,30 @@ gtk_im_module_initialize (void)
/* Read information about a context type
*/
if (!pango_scan_string (&p, tmp_buf))
if (!gtk_im_module_scan_string (&p, tmp_buf))
goto context_error;
info->context_id = g_strdup (tmp_buf->str);
if (!pango_scan_string (&p, tmp_buf))
if (!gtk_im_module_scan_string (&p, tmp_buf))
goto context_error;
info->context_name = g_strdup (tmp_buf->str);
if (!pango_scan_string (&p, tmp_buf))
if (!gtk_im_module_scan_string (&p, tmp_buf))
goto context_error;
info->domain = g_strdup (tmp_buf->str);
if (!pango_scan_string (&p, tmp_buf))
if (!gtk_im_module_scan_string (&p, tmp_buf))
goto context_error;
info->domain_dirname = g_strdup (tmp_buf->str);
#ifdef G_OS_WIN32
correct_localedir_prefix ((char **) &info->domain_dirname);
#endif
if (!pango_scan_string (&p, tmp_buf))
if (!gtk_im_module_scan_string (&p, tmp_buf))
goto context_error;
info->default_locales = g_strdup (tmp_buf->str);
if (pango_skip_space (&p))
if (gtk_im_module_skip_space (&p))
goto context_error;
infos = g_slist_prepend (infos, info);
@ -662,7 +832,7 @@ lookup_immodule (gchar **immodules_list)
gboolean found;
gchar *context_id;
found = g_hash_table_lookup_extended (contexts_hash, *immodules_list,
(gpointer *) &context_id, NULL);
(gpointer *) &context_id, NULL);
if (found)
return context_id;
}
@ -721,7 +891,7 @@ _gtk_im_module_get_default_context_id (GdkWindow *client_window)
g_strfreev(immodules);
g_free (tmp);
if (context_id)
if (context_id)
return context_id;
}
}

View file

@ -51,6 +51,8 @@ static gboolean default_display_opened = FALSE;
static gint gtk_argc = 0;
static gchar **gtk_argv = NULL;
static gint module_path_env_dirs = 0;
static gchar **
split_file_list (const gchar *str)
{
@ -131,6 +133,7 @@ get_module_path (void)
gchar *home_gtk_dir = NULL;
gchar *module_path;
gchar *default_dir;
gchar *local_dir = NULL;
static gchar **result = NULL;
if (result)
@ -146,25 +149,67 @@ get_module_path (void)
if (exe_prefix)
default_dir = g_build_filename (exe_prefix, "lib", "gtk-2.0", NULL);
else
default_dir = g_build_filename (GTK_LIBDIR, "gtk-2.0", NULL);
{
default_dir = g_build_filename (GTK_LIBDIR, "gtk-2.0", NULL);
if (module_path_env && home_gtk_dir)
#ifndef G_OS_WIN32
if (g_str_has_prefix (GTK_LIBDIR, "/usr/lib"))
{
const gchar *lib_subdir = GTK_LIBDIR + strlen ("/usr/");
if (lib_subdir[0] != '\0')
local_dir = g_build_filename ("/usr/local", lib_subdir, "gtk-2.0", NULL);
}
#endif
}
if (module_path_env && home_gtk_dir && local_dir)
module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
module_path_env, home_gtk_dir, default_dir, NULL);
module_path_env, home_gtk_dir, local_dir, default_dir, NULL);
else if (module_path_env && home_gtk_dir)
module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
module_path_env, home_gtk_dir, default_dir, NULL);
else if (module_path_env && local_dir)
module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
module_path_env, local_dir, default_dir, NULL);
else if (module_path_env)
module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
module_path_env, default_dir, NULL);
module_path_env, default_dir, NULL);
else if (home_gtk_dir && local_dir)
module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
home_gtk_dir, local_dir, default_dir, NULL);
else if (home_gtk_dir)
module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
home_gtk_dir, default_dir, NULL);
home_gtk_dir, default_dir, NULL);
else if (local_dir)
module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
local_dir, default_dir, NULL);
else
module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
default_dir, NULL);
default_dir, NULL);
g_free (home_gtk_dir);
g_free (local_dir);
g_free (default_dir);
result = split_file_list (module_path);
if (module_path_env)
{
gchar **env_paths;
gchar **path;
env_paths = split_file_list (module_path_env);
module_path_env_dirs = 0;
for (path = env_paths; *path; path++)
module_path_env_dirs++;
g_strfreev (env_paths);
}
else
module_path_env_dirs = 0;
g_free (module_path);
return result;
@ -189,12 +234,15 @@ _gtk_get_module_path (const gchar *type)
for (path = paths; *path; path++)
count++;
result = g_new (gchar *, count * 5 + 1);
result = g_new (gchar *, count * 4 + module_path_env_dirs + 1);
count = 0;
for (path = get_module_path (); *path; path++)
for (path = paths; *path; path++)
{
gint use_version, use_host;
gboolean path_from_env;
path_from_env = (path - paths) < module_path_env_dirs;
for (use_version = TRUE; use_version >= FALSE; use_version--)
for (use_host = TRUE; use_host >= FALSE; use_host--)
@ -219,10 +267,11 @@ _gtk_get_module_path (const gchar *type)
* live directly in .../.libs directories, for example print backends,
* theme engines or input modules.
*
* Keep this limited to absolute paths so the removed fallback that could
* load modules from the current working directory is not reintroduced.
* Keep this limited to absolute GTK_PATH entries so the removed fallback
* that could load modules from the current working directory is not
* reintroduced for built-in default paths.
*/
if (g_path_is_absolute (*path))
if (path_from_env && g_path_is_absolute (*path))
result[count++] = g_strdup (*path);
}

View file

@ -454,8 +454,7 @@ gtk_paper_size_get_paper_sizes (gboolean include_custom)
{
GList *list = NULL;
guint i;
#ifdef G_OS_UNIX
/* _gtk_load_custom_papers() only on Unix so far */
#ifdef G_OS_UNIX /* _gtk_load_custom_papers() only on Unix so far */
if (include_custom)
{
GList *page_setups, *l;

View file

@ -349,6 +349,9 @@ gtk_print_backend_load_modules (void)
G_DEFINE_TYPE_WITH_PRIVATE (GtkPrintBackend, gtk_print_backend, G_TYPE_OBJECT)
#define GTK_PRINT_BACKEND_CAN_STORE_AUTH_INFO_KEY "gtk-print-backend-can-store-auth-info"
#define GTK_PRINT_BACKEND_STORE_AUTH_INFO_KEY "gtk-print-backend-store-auth-info"
static void fallback_printer_request_details (GtkPrinter *printer);
static gboolean fallback_printer_mark_conflicts (GtkPrinter *printer,
GtkPrinterOptionSet *options);
@ -690,6 +693,17 @@ store_entry (GtkEntry *entry,
*data = g_strdup (gtk_entry_get_text (entry));
}
static void
store_auth_info_toggled (GtkToggleButton *button,
gpointer user_data)
{
GtkPrintBackend *backend = GTK_PRINT_BACKEND (user_data);
g_object_set_data (G_OBJECT (backend),
GTK_PRINT_BACKEND_STORE_AUTH_INFO_KEY,
GINT_TO_POINTER (gtk_toggle_button_get_active (button)));
}
static void
password_dialog_response (GtkWidget *dialog,
gint response_id,
@ -729,7 +743,7 @@ request_password (GtkPrintBackend *backend,
const gchar *prompt)
{
GtkPrintBackendPrivate *priv = backend->priv;
GtkWidget *dialog, *box, *main_box, *label, *icon, *vbox, *entry;
GtkWidget *dialog, *box, *main_box, *label, *icon, *vbox, *entry, *chkbtn;
GtkWidget *focus = NULL;
gchar *markup;
gint length;
@ -743,6 +757,10 @@ request_password (GtkPrintBackend *backend,
length = g_strv_length (ai_required);
priv->auth_info = g_new0 (gchar *, length + 1);
g_object_set_data (G_OBJECT (backend),
GTK_PRINT_BACKEND_STORE_AUTH_INFO_KEY,
GINT_TO_POINTER (FALSE));
dialog = gtk_dialog_new_with_buttons ( _("Authentication"), NULL, GTK_DIALOG_MODAL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -810,6 +828,17 @@ request_password (GtkPrintBackend *backend,
}
}
if (g_object_get_data (G_OBJECT (backend),
GTK_PRINT_BACKEND_CAN_STORE_AUTH_INFO_KEY))
{
chkbtn = gtk_check_button_new_with_mnemonic (_("_Remember password"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (chkbtn), FALSE);
gtk_box_pack_start (GTK_BOX (vbox), chkbtn, FALSE, FALSE, 6);
g_signal_connect (chkbtn, "toggled",
G_CALLBACK (store_auth_info_toggled),
backend);
}
if (focus != NULL)
{
gtk_widget_grab_focus (focus);

View file

@ -796,7 +796,9 @@ printer_status_cb (GtkPrintBackend *backend,
/* When the pause state change then we need to update sensitive property
* of GTK_RESPONSE_OK button inside of selected_printer_changed function. */
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->printer_treeview));
priv->internal_printer_change = TRUE;
selected_printer_changed (selection, dialog);
priv->internal_printer_change = FALSE;
if (gtk_print_backend_printer_list_is_done (backend) &&
gtk_printer_is_default (printer) &&

View file

@ -67,7 +67,10 @@ _gtk_quartz_create_image_from_pixbuf (GdkPixbuf *pixbuf)
}
[nsimage lockFocus];
context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
if (gdk_quartz_osx_version () < GDK_OSX_YOSEMITE)
context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
else
context = [[NSGraphicsContext currentContext] CGContext];
CGContextDrawImage (context, CGRectMake (0, 0, pixbuf_width, pixbuf_height), image);
[nsimage unlockFocus];

View file

@ -808,6 +808,8 @@ gtk_rc_parse_named (GtkRcContext *context,
gchar *path = NULL;
const gchar *home_dir;
gchar *subpath;
const gchar * const *xdg_data_dirs;
gint i;
if (type)
subpath = g_strconcat ("gtk-2.0-", type,
@ -829,6 +831,22 @@ gtk_rc_parse_named (GtkRcContext *context,
}
}
if (!path)
{
xdg_data_dirs = g_get_system_data_dirs ();
for (i = 0; xdg_data_dirs[i]; i++)
{
path = g_build_filename (xdg_data_dirs[i], "themes", name, subpath, NULL);
if (g_file_test (path, G_FILE_TEST_EXISTS))
break;
else
{
g_free (path);
path = NULL;
}
}
}
if (!path)
{
gchar *theme_dir = gtk_rc_get_theme_dir ();

View file

@ -86,12 +86,12 @@ struct _GtkRecentChooserIface
* Methods
*/
gboolean (* set_current_uri) (GtkRecentChooser *chooser,
const gchar *uri,
GError **error);
const gchar *uri,
GError **error);
gchar * (* get_current_uri) (GtkRecentChooser *chooser);
gboolean (* select_uri) (GtkRecentChooser *chooser,
const gchar *uri,
GError **error);
const gchar *uri,
GError **error);
void (* unselect_uri) (GtkRecentChooser *chooser,
const gchar *uri);
void (* select_all) (GtkRecentChooser *chooser);
@ -99,14 +99,14 @@ struct _GtkRecentChooserIface
GList * (* get_items) (GtkRecentChooser *chooser);
GtkRecentManager *(* get_recent_manager) (GtkRecentChooser *chooser);
void (* add_filter) (GtkRecentChooser *chooser,
GtkRecentFilter *filter);
GtkRecentFilter *filter);
void (* remove_filter) (GtkRecentChooser *chooser,
GtkRecentFilter *filter);
GtkRecentFilter *filter);
GSList * (* list_filters) (GtkRecentChooser *chooser);
void (* set_sort_func) (GtkRecentChooser *chooser,
GtkRecentSortFunc sort_func,
gpointer sort_data,
GDestroyNotify data_destroy);
GtkRecentSortFunc sort_func,
gpointer sort_data,
GDestroyNotify data_destroy);
/*
* Signals
@ -176,8 +176,8 @@ gchar ** gtk_recent_chooser_get_uris (GtkRecentChooser *chooser,
/*
* Filters
*/
void gtk_recent_chooser_add_filter (GtkRecentChooser *chooser,
GtkRecentFilter *filter);
void gtk_recent_chooser_add_filter (GtkRecentChooser *chooser,
GtkRecentFilter *filter);
void gtk_recent_chooser_remove_filter (GtkRecentChooser *chooser,
GtkRecentFilter *filter);
GSList * gtk_recent_chooser_list_filters (GtkRecentChooser *chooser);

View file

@ -2439,8 +2439,7 @@ _gtk_text_btree_get_text (const GtkTextIter *start_orig,
copy_segment (retval, include_hidden, include_nonchars, &iter, &end);
str = retval->str;
g_string_free (retval, FALSE);
str = g_string_free (retval, FALSE);
return str;
}

View file

@ -74,7 +74,10 @@ struct _GtkTooltips
guint have_grab : 1;
guint use_sticky_delay : 1;
gint timer_tag;
GTimeVal last_popdown;
struct {
glong tv_sec;
glong tv_usec;
} last_popdown;
};
struct _GtkTooltipsClass

View file

@ -46,12 +46,12 @@ struct _GtkTrayIconClass
{
GtkPlugClass parent_class;
void (*__gtk_reserved1);
void (*__gtk_reserved2);
void (*__gtk_reserved3);
void (*__gtk_reserved4);
void (*__gtk_reserved5);
void (*__gtk_reserved6);
void (*__gtk_reserved1) (void);
void (*__gtk_reserved2) (void);
void (*__gtk_reserved3) (void);
void (*__gtk_reserved4) (void);
void (*__gtk_reserved5) (void);
void (*__gtk_reserved6) (void);
};
GType gtk_tray_icon_get_type (void) G_GNUC_CONST;

View file

@ -465,6 +465,10 @@ void _gtk_tree_view_column_get_neighbor_sizes (GtkTreeViewColumn *c
gint *right);
G_GNUC_INTERNAL
void _gtk_tree_view_set_fixed_height_mode_unchecked
(GtkTreeView *tree_view);
G_END_DECLS

View file

@ -48,7 +48,11 @@
#define GTK_TREE_VIEW_PRIORITY_VALIDATE (GDK_PRIORITY_REDRAW + 5)
#define GTK_TREE_VIEW_PRIORITY_SCROLL_SYNC (GTK_TREE_VIEW_PRIORITY_VALIDATE + 2)
#define GTK_TREE_VIEW_TIME_MS_PER_IDLE 30
#if defined(__arm__) && defined(__ARM_ARCH) && (__ARM_ARCH == 6)
#define GTK_TREE_VIEW_TIME_MS_PER_IDLE 10
#else
#define GTK_TREE_VIEW_TIME_MS_PER_IDLE 2
#endif
#define SCROLL_EDGE_SIZE 15
#define EXPANDER_EXTRA_PADDING 4
#define GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT 5000
@ -7732,6 +7736,25 @@ column_sizing_notify (GObject *object,
g_object_set (data, "fixed-height-mode", FALSE, NULL);
}
/* Internal fixed-height mode for width-independent rows. */
G_GNUC_INTERNAL
void
_gtk_tree_view_set_fixed_height_mode_unchecked (GtkTreeView *tree_view)
{
g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
if (tree_view->priv->fixed_height_mode)
return;
tree_view->priv->fixed_height_mode = TRUE;
tree_view->priv->fixed_height = -1;
if (tree_view->priv->tree)
initialize_fixed_height_mode (tree_view);
g_object_notify (G_OBJECT (tree_view), "fixed-height-mode");
}
/**
* gtk_tree_view_set_fixed_height_mode:
* @tree_view: a #GtkTreeView
@ -8927,6 +8950,16 @@ gtk_tree_view_clamp_node_visible (GtkTreeView *tree_view,
path = _gtk_tree_view_find_path (tree_view, tree, node);
if (path)
{
/* The first root row at the top cannot require scrolling. */
if (tree_view->priv->vadjustment->value <=
tree_view->priv->vadjustment->lower &&
gtk_tree_path_get_depth (path) == 1 &&
gtk_tree_path_get_indices (path)[0] == 0)
{
gtk_tree_path_free (path);
return;
}
/* We process updates because we want to clear old selected items when we scroll.
* if this is removed, we get a "selection streak" at the bottom. */
gdk_window_process_updates (tree_view->priv->bin_window, TRUE);

View file

@ -652,8 +652,8 @@ gtk-win32-$(GTK_VER)s.lib : $(gtk_OBJECTS)
gtk-query-immodules-$(GTK_VER).exe : queryimmodules.obj
$(CC) $(CFLAGS) -Fe$@ queryimmodules.obj $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(LDFLAGS)
gtk-update-icon-cache.exe : updateiconcache.obj gtkpixdatautils.obj
$(CC) $(CFLAGS) -Fe$@ updateiconcache.obj gtkpixdatautils.obj $(GDK_PIXBUF_LIBS) $(GLIB_LIBS) $(INTL_LIBS) $(PANGO_LIBS) $(LDFLAGS)
gtk-update-icon-cache.exe : updateiconcache.obj
$(CC) $(CFLAGS) -Fe$@ updateiconcache.obj $(GDK_PIXBUF_LIBS) $(GLIB_LIBS) $(INTL_LIBS) $(PANGO_LIBS) $(LDFLAGS)
gtk-x11-$(GTK_VER).dll : $(gtk_OBJECTS) gtk.def
$(CC) $(CFLAGS) -LD -Fm -Fegtk-x11-$(GTK_VER).dll $(gtk_OBJECTS) ../gdk/gdk-x11-$(GTK_VER).lib $(GDK_PIXBUF_LIBS) $(PANGO_LIBS) $(INTL_LIBS) $(GLIB_LIBS) gdi32.lib user32.lib advapi32.lib $(LDFLAGS) /def:gtk.def

View file

@ -14,7 +14,7 @@ print <<EOF;
#include <glib.h>
#ifdef G_HAVE_GNUC_VISIBILITY
#if defined(G_HAVE_GNUC_VISIBILITY) && !defined(__APPLE__)
EOF

View file

@ -159,9 +159,6 @@ query_module (const char *dir, const char *name, GString *contents)
{
void (*list) (const GtkIMContextInfo ***contexts,
guint *n_contexts);
G_GNUC_UNUSED void (*init) (GTypeModule *type_module);
G_GNUC_UNUSED void (*exit) (void);
G_GNUC_UNUSED GtkIMContext *(*create) (const gchar *context_id);
gpointer list_ptr;
gpointer init_ptr;
@ -196,9 +193,6 @@ query_module (const char *dir, const char *name, GString *contents)
int i;
list = list_ptr;
init = init_ptr;
exit = exit_ptr;
create = create_ptr;
print_escaped (contents, path);
g_string_append_c (contents, '\n');

View file

@ -132,7 +132,7 @@ static int object = 0;
static int object_after = 0;
void /* exported for GtkBuilder */
signal_normal (GtkWindow *window, GParamSpec spec)
signal_normal (GtkWindow *window, GParamSpec *spec)
{
g_assert (GTK_IS_WINDOW (window));
g_assert (normal == 0);
@ -142,7 +142,7 @@ signal_normal (GtkWindow *window, GParamSpec spec)
}
void /* exported for GtkBuilder */
signal_after (GtkWindow *window, GParamSpec spec)
signal_after (GtkWindow *window, GParamSpec *spec)
{
g_assert (GTK_IS_WINDOW (window));
g_assert (normal == 1);
@ -152,7 +152,7 @@ signal_after (GtkWindow *window, GParamSpec spec)
}
void /* exported for GtkBuilder */
signal_object (GtkButton *button, GParamSpec spec)
signal_object (GtkButton *button, GParamSpec *spec)
{
g_assert (GTK_IS_BUTTON (button));
g_assert (object == 0);
@ -162,7 +162,7 @@ signal_object (GtkButton *button, GParamSpec spec)
}
void /* exported for GtkBuilder */
signal_object_after (GtkButton *button, GParamSpec spec)
signal_object_after (GtkButton *button, GParamSpec *spec)
{
g_assert (GTK_IS_BUTTON (button));
g_assert (object == 1);
@ -172,28 +172,28 @@ signal_object_after (GtkButton *button, GParamSpec spec)
}
void /* exported for GtkBuilder */
signal_first (GtkButton *button, GParamSpec spec)
signal_first (GtkButton *button, GParamSpec *spec)
{
g_assert (normal == 0);
normal = 10;
}
void /* exported for GtkBuilder */
signal_second (GtkButton *button, GParamSpec spec)
signal_second (GtkButton *button, GParamSpec *spec)
{
g_assert (normal == 10);
normal = 20;
}
void /* exported for GtkBuilder */
signal_extra (GtkButton *button, GParamSpec spec)
signal_extra (GtkButton *button, GParamSpec *spec)
{
g_assert (normal == 20);
normal = 30;
}
void /* exported for GtkBuilder */
signal_extra2 (GtkButton *button, GParamSpec spec)
signal_extra2 (GtkButton *button, GParamSpec *spec)
{
g_assert (normal == 30);
normal = 40;

View file

@ -608,6 +608,16 @@ replace_backslashes_with_slashes (gchar *path)
path[i] = '/';
}
static gint
compare_string_pointers (gconstpointer a,
gconstpointer b)
{
const gchar * const *str_a = a;
const gchar * const *str_b = b;
return strcmp (*str_a, *str_b);
}
static GList *
scan_directory (const gchar *base_path,
const gchar *subdir,
@ -617,10 +627,12 @@ scan_directory (const gchar *base_path,
{
GHashTable *dir_hash;
GDir *dir;
GPtrArray *names;
const gchar *name;
gchar *dir_path;
gboolean dir_added = FALSE;
guint dir_index = 0xffff;
guint i;
dir_path = g_build_path ("/", base_path, subdir, NULL);
@ -628,12 +640,25 @@ scan_directory (const gchar *base_path,
dir = g_dir_open (dir_path, 0, NULL);
if (!dir)
return directories;
{
g_free (dir_path);
return directories;
}
names = g_ptr_array_new_with_free_func (g_free);
while ((name = g_dir_read_name (dir)))
g_ptr_array_add (names, g_strdup (name));
g_dir_close (dir);
g_ptr_array_sort (names, compare_string_pointers);
dir_hash = g_hash_table_new (g_str_hash, g_str_equal);
while ((name = g_dir_read_name (dir)))
for (i = 0; i < names->len; i++)
{
name = g_ptr_array_index (names, i);
gchar *path;
gboolean retval;
int flags = 0;
@ -712,7 +737,8 @@ scan_directory (const gchar *base_path,
g_free (path);
}
g_dir_close (dir);
g_ptr_array_free (names, TRUE);
g_free (dir_path);
/* Move dir into the big file hash */
g_hash_table_foreach_remove (dir_hash, foreach_remove_func, files);

View file

@ -1021,7 +1021,7 @@ gail_button_get_image_position (AtkImage *image,
if (button_image != NULL)
{
obj = gtk_widget_get_accessible (GTK_WIDGET (button_image));
atk_component_get_position (ATK_COMPONENT (obj), x, y, coord_type);
atk_component_get_extents (ATK_COMPONENT (obj), x, y, NULL, NULL, coord_type);
}
else
{

View file

@ -179,7 +179,7 @@ gail_image_get_image_position (AtkImage *image,
gint *y,
AtkCoordType coord_type)
{
atk_component_get_position (ATK_COMPONENT (image), x, y, coord_type);
atk_component_get_extents (ATK_COMPONENT (image), x, y, NULL, NULL, coord_type);
}
static void

View file

@ -150,7 +150,7 @@ gail_image_cell_get_image_position (AtkImage *image,
gint *y,
AtkCoordType coord_type)
{
atk_component_get_position (ATK_COMPONENT (image), x, y, coord_type);
atk_component_get_extents (ATK_COMPONENT (image), x, y, NULL, NULL, coord_type);
}
static void

View file

@ -467,7 +467,7 @@ gail_notebook_page_get_extents (AtkComponent *component,
child = atk_object_ref_accessible_child (ATK_OBJECT (component), 0);
gail_return_if_fail (child);
atk_component_get_position (ATK_COMPONENT (child), x, y, coord_type);
atk_component_get_extents (ATK_COMPONENT (child), x, y, NULL, NULL, coord_type);
g_object_unref (child);
}
else

View file

@ -43,6 +43,14 @@ static void gail_paned_get_minimum_value (AtkValue *obj,
GValue *value);
static gboolean gail_paned_set_current_value (AtkValue *obj,
const GValue *value);
#if ATK_CHECK_VERSION (2, 12, 0)
static void gail_paned_get_value_and_text (AtkValue *obj,
gdouble *value,
gchar **text);
static AtkRange *gail_paned_get_range (AtkValue *obj);
static void gail_paned_set_value (AtkValue *obj,
gdouble new_value);
#endif
G_DEFINE_TYPE_WITH_CODE (GailPaned, gail_paned, GAIL_TYPE_CONTAINER,
G_IMPLEMENT_INTERFACE (ATK_TYPE_VALUE, atk_value_interface_init))
@ -112,6 +120,11 @@ atk_value_interface_init (AtkValueIface *iface)
iface->get_maximum_value = gail_paned_get_maximum_value;
iface->get_minimum_value = gail_paned_get_minimum_value;
iface->set_current_value = gail_paned_set_current_value;
#if ATK_CHECK_VERSION (2, 12, 0)
iface->get_value_and_text = gail_paned_get_value_and_text;
iface->get_range = gail_paned_get_range;
iface->set_value = gail_paned_set_value;
#endif
}
static void
@ -197,3 +210,58 @@ gail_paned_set_current_value (AtkValue *obj,
else
return FALSE;
}
#if ATK_CHECK_VERSION (2, 12, 0)
static void
gail_paned_get_value_and_text (AtkValue *obj,
gdouble *value,
gchar **text)
{
GtkWidget *widget;
if (text)
*text = NULL;
if (!value)
return;
widget = GTK_ACCESSIBLE (obj)->widget;
if (widget == NULL)
{
*value = 0.0;
return;
}
*value = gtk_paned_get_position (GTK_PANED (widget));
}
static AtkRange *
gail_paned_get_range (AtkValue *obj)
{
GtkWidget *widget;
GtkPaned *paned;
widget = GTK_ACCESSIBLE (obj)->widget;
if (widget == NULL)
return NULL;
paned = GTK_PANED (widget);
return atk_range_new (paned->min_position, paned->max_position, NULL);
}
static void
gail_paned_set_value (AtkValue *obj,
gdouble value)
{
GtkWidget *widget;
gint new_value;
widget = GTK_ACCESSIBLE (obj)->widget;
if (widget == NULL)
return;
new_value = (gint) value;
gtk_paned_set_position (GTK_PANED (widget), new_value);
}
#endif

View file

@ -103,7 +103,7 @@ gail_pixmap_get_image_position (AtkImage *obj,
gint *y,
AtkCoordType coord_type)
{
atk_component_get_position (ATK_COMPONENT (obj), x, y, coord_type);
atk_component_get_extents (ATK_COMPONENT (obj), x, y, NULL, NULL, coord_type);
}
static void

View file

@ -125,7 +125,17 @@ gail_progress_bar_get_current_value (AtkValue *obj,
*/
return;
atk_value_get_current_value (ATK_VALUE (progress_bar->adjustment), value);
{
GtkAdjustment *adjustment;
adjustment = GAIL_ADJUSTMENT (progress_bar->adjustment)->adjustment;
if (adjustment == NULL)
return;
memset (value, 0, sizeof (GValue));
g_value_init (value, G_TYPE_DOUBLE);
g_value_set_double (value, adjustment->value);
}
}
static void
@ -143,7 +153,17 @@ gail_progress_bar_get_maximum_value (AtkValue *obj,
*/
return;
atk_value_get_maximum_value (ATK_VALUE (progress_bar->adjustment), value);
{
GtkAdjustment *adjustment;
adjustment = GAIL_ADJUSTMENT (progress_bar->adjustment)->adjustment;
if (adjustment == NULL)
return;
memset (value, 0, sizeof (GValue));
g_value_init (value, G_TYPE_DOUBLE);
g_value_set_double (value, adjustment->upper);
}
}
static void
@ -161,7 +181,17 @@ gail_progress_bar_get_minimum_value (AtkValue *obj,
*/
return;
atk_value_get_minimum_value (ATK_VALUE (progress_bar->adjustment), value);
{
GtkAdjustment *adjustment;
adjustment = GAIL_ADJUSTMENT (progress_bar->adjustment)->adjustment;
if (adjustment == NULL)
return;
memset (value, 0, sizeof (GValue));
g_value_init (value, G_TYPE_DOUBLE);
g_value_set_double (value, adjustment->lower);
}
}
static void

View file

@ -180,7 +180,17 @@ gail_range_get_current_value (AtkValue *obj,
*/
return;
atk_value_get_current_value (ATK_VALUE (range->adjustment), value);
{
GtkAdjustment *adjustment;
adjustment = GAIL_ADJUSTMENT (range->adjustment)->adjustment;
if (adjustment == NULL)
return;
memset (value, 0, sizeof (GValue));
g_value_init (value, G_TYPE_DOUBLE);
g_value_set_double (value, adjustment->value);
}
}
static void
@ -201,7 +211,17 @@ gail_range_get_maximum_value (AtkValue *obj,
*/
return;
atk_value_get_maximum_value (ATK_VALUE (range->adjustment), value);
{
GtkAdjustment *adjustment;
adjustment = GAIL_ADJUSTMENT (range->adjustment)->adjustment;
if (adjustment == NULL)
return;
memset (value, 0, sizeof (GValue));
g_value_init (value, G_TYPE_DOUBLE);
g_value_set_double (value, adjustment->upper);
}
gtk_range = GTK_RANGE (gtk_accessible_get_widget (GTK_ACCESSIBLE (range)));
g_return_if_fail (gtk_range);
@ -231,7 +251,17 @@ gail_range_get_minimum_value (AtkValue *obj,
*/
return;
atk_value_get_minimum_value (ATK_VALUE (range->adjustment), value);
{
GtkAdjustment *adjustment;
adjustment = GAIL_ADJUSTMENT (range->adjustment)->adjustment;
if (adjustment == NULL)
return;
memset (value, 0, sizeof (GValue));
g_value_init (value, G_TYPE_DOUBLE);
g_value_set_double (value, adjustment->lower);
}
}
static void
@ -248,7 +278,31 @@ gail_range_get_minimum_increment (AtkValue *obj, GValue *value)
*/
return;
atk_value_get_minimum_increment (ATK_VALUE (range->adjustment), value);
{
GtkAdjustment *adjustment;
gdouble minimum_increment;
adjustment = GAIL_ADJUSTMENT (range->adjustment)->adjustment;
if (adjustment == NULL)
return;
if (adjustment->step_increment != 0 &&
adjustment->page_increment != 0)
{
if (ABS (adjustment->step_increment) < ABS (adjustment->page_increment))
minimum_increment = adjustment->step_increment;
else
minimum_increment = adjustment->page_increment;
}
else if (adjustment->step_increment != 0)
minimum_increment = adjustment->step_increment;
else
minimum_increment = adjustment->page_increment;
memset (value, 0, sizeof (GValue));
g_value_init (value, G_TYPE_DOUBLE);
g_value_set_double (value, minimum_increment);
}
}
static gboolean gail_range_set_current_value (AtkValue *obj,

View file

@ -127,7 +127,17 @@ gail_spin_button_get_current_value (AtkValue *obj,
*/
return;
atk_value_get_current_value (ATK_VALUE (spin_button->adjustment), value);
{
GtkAdjustment *adjustment;
adjustment = GAIL_ADJUSTMENT (spin_button->adjustment)->adjustment;
if (adjustment == NULL)
return;
memset (value, 0, sizeof (GValue));
g_value_init (value, G_TYPE_DOUBLE);
g_value_set_double (value, adjustment->value);
}
}
static void
@ -145,7 +155,17 @@ gail_spin_button_get_maximum_value (AtkValue *obj,
*/
return;
atk_value_get_maximum_value (ATK_VALUE (spin_button->adjustment), value);
{
GtkAdjustment *adjustment;
adjustment = GAIL_ADJUSTMENT (spin_button->adjustment)->adjustment;
if (adjustment == NULL)
return;
memset (value, 0, sizeof (GValue));
g_value_init (value, G_TYPE_DOUBLE);
g_value_set_double (value, adjustment->upper);
}
}
static void
@ -163,7 +183,17 @@ gail_spin_button_get_minimum_value (AtkValue *obj,
*/
return;
atk_value_get_minimum_value (ATK_VALUE (spin_button->adjustment), value);
{
GtkAdjustment *adjustment;
adjustment = GAIL_ADJUSTMENT (spin_button->adjustment)->adjustment;
if (adjustment == NULL)
return;
memset (value, 0, sizeof (GValue));
g_value_init (value, G_TYPE_DOUBLE);
g_value_set_double (value, adjustment->lower);
}
}
static void
@ -180,7 +210,31 @@ gail_spin_button_get_minimum_increment (AtkValue *obj, GValue *value)
*/
return;
atk_value_get_minimum_increment (ATK_VALUE (spin_button->adjustment), value);
{
GtkAdjustment *adjustment;
gdouble minimum_increment;
adjustment = GAIL_ADJUSTMENT (spin_button->adjustment)->adjustment;
if (adjustment == NULL)
return;
if (adjustment->step_increment != 0 &&
adjustment->page_increment != 0)
{
if (ABS (adjustment->step_increment) < ABS (adjustment->page_increment))
minimum_increment = adjustment->step_increment;
else
minimum_increment = adjustment->page_increment;
}
else if (adjustment->step_increment != 0)
minimum_increment = adjustment->step_increment;
else
minimum_increment = adjustment->page_increment;
memset (value, 0, sizeof (GValue));
g_value_init (value, G_TYPE_DOUBLE);
g_value_set_double (value, minimum_increment);
}
}
static gboolean
@ -198,7 +252,19 @@ gail_spin_button_set_current_value (AtkValue *obj,
*/
return FALSE;
return atk_value_set_current_value (ATK_VALUE (spin_button->adjustment), value);
if (G_VALUE_HOLDS_DOUBLE (value))
{
GtkAdjustment *adjustment;
adjustment = GAIL_ADJUSTMENT (spin_button->adjustment)->adjustment;
if (adjustment == NULL)
return FALSE;
gtk_adjustment_set_value (adjustment, g_value_get_double (value));
return TRUE;
}
return FALSE;
}
static void

View file

@ -251,7 +251,7 @@ gail_misc_layout_get_run_attributes (AtkAttributeSet *attrib_set,
if ((pango_string = (PangoAttrString*) pango_attr_iterator_get (iter,
PANGO_ATTR_FAMILY)) != NULL)
{
value = g_strdup_printf("%s", pango_string->value);
value = g_strdup (pango_string->value);
attrib_set = gail_misc_add_attribute (attrib_set,
ATK_TEXT_ATTR_FAMILY_NAME,
value);

View file

@ -1512,9 +1512,10 @@ _button_watcher (GSignalInvocationHint *ihint,
event = (GdkEventButton *) gp;
aobject = gtk_widget_get_accessible (widget);
aobject_x = aobject_y = 0;
atk_component_get_position (ATK_COMPONENT (aobject),
&aobject_x, &aobject_y,
ATK_XY_WINDOW);
atk_component_get_extents (ATK_COMPONENT (aobject),
&aobject_x, &aobject_y,
NULL, NULL,
ATK_XY_WINDOW);
x = aobject_x + (gint) event->x;
y = aobject_y + (gint) event->y;
child = atk_component_ref_accessible_at_point (ATK_COMPONENT (aobject),

View file

@ -16,11 +16,11 @@ static void _check_position (AtkObject *obj)
return;
atk_component_get_extents (ATK_COMPONENT(obj), &x, &y, &width, &height, ATK_XY_SCREEN);
atk_component_get_position (ATK_COMPONENT(obj), &x1, &y1, ATK_XY_SCREEN );
atk_component_get_extents (ATK_COMPONENT(obj), &x1, &y1, NULL, NULL, ATK_XY_SCREEN);
atk_component_get_size (ATK_COMPONENT(obj), &width1, &height1);
if ((x1 != x) || (y1 != y))
{
g_print ("atk_component_get_extents and atk_get_position give different"
g_print ("Repeated atk_component_get_extents calls give different"
" values: %d,%d %d,%d\n", x, y, x1, y1);
}
if ((width1 != width) || (height1 != height))
@ -29,7 +29,7 @@ static void _check_position (AtkObject *obj)
" values: %d,%d %d,%d\n", width, height, width1, height1);
}
atk_component_get_position (ATK_COMPONENT(obj), &x1, &y1, ATK_XY_SCREEN);
atk_component_get_extents (ATK_COMPONENT(obj), &x1, &y1, NULL, NULL, ATK_XY_SCREEN);
g_print ("Object Type: %s\n", g_type_name (G_OBJECT_TYPE (obj)));
g_print ("Object at %d, %d on screen\n", x1, y1);
g_print ("Object at %d, %d, size: %d, %d\n", x, y, width, height);

View file

@ -12,6 +12,103 @@ static void _property_change_handler (AtkObject *obj,
#define NUM_VALID_ROLES 1
static gint last_position;
static gint
test_value_get_current_int (AtkValue *obj)
{
#if ATK_CHECK_VERSION (2, 12, 0)
gdouble value = 0.0;
atk_value_get_value_and_text (obj, &value, NULL);
return (gint) value;
#else
GValue value = G_VALUE_INIT;
gint result;
atk_value_get_current_value (obj, &value);
g_return_val_if_fail (G_VALUE_HOLDS_INT (&value), 0);
result = g_value_get_int (&value);
g_value_unset (&value);
return result;
#endif
}
static gint
test_value_get_minimum_int (AtkValue *obj)
{
#if ATK_CHECK_VERSION (2, 12, 0)
AtkRange *range;
gint value = 0;
range = atk_value_get_range (obj);
if (range)
{
value = (gint) atk_range_get_lower_limit (range);
atk_range_free (range);
}
return value;
#else
GValue value = G_VALUE_INIT;
gint result;
atk_value_get_minimum_value (obj, &value);
g_return_val_if_fail (G_VALUE_HOLDS_INT (&value), 0);
result = g_value_get_int (&value);
g_value_unset (&value);
return result;
#endif
}
static gint
test_value_get_maximum_int (AtkValue *obj)
{
#if ATK_CHECK_VERSION (2, 12, 0)
AtkRange *range;
gint value = 0;
range = atk_value_get_range (obj);
if (range)
{
value = (gint) atk_range_get_upper_limit (range);
atk_range_free (range);
}
return value;
#else
GValue value = G_VALUE_INIT;
gint result;
atk_value_get_maximum_value (obj, &value);
g_return_val_if_fail (G_VALUE_HOLDS_INT (&value), 0);
result = g_value_get_int (&value);
g_value_unset (&value);
return result;
#endif
}
static void
test_value_set_current_int (AtkValue *obj,
gint value)
{
#if ATK_CHECK_VERSION (2, 12, 0)
atk_value_set_value (obj, value);
#else
GValue gvalue = G_VALUE_INIT;
g_value_init (&gvalue, G_TYPE_INT);
g_value_set_int (&gvalue, value);
atk_value_set_current_value (obj, &gvalue);
g_value_unset (&gvalue);
#endif
}
static void _property_change_handler (AtkObject *obj,
AtkPropertyValues *values)
{
@ -26,24 +123,17 @@ static void _property_change_handler (AtkObject *obj,
values->property_name ? values->property_name: "NULL");
if (strcmp (values->property_name, "accessible-value") == 0)
{
GValue *value, val;
int position;
value = &val;
memset (value, 0, sizeof (GValue));
atk_value_get_current_value (ATK_VALUE (obj), value);
g_return_if_fail (G_VALUE_HOLDS_INT (value));
position = g_value_get_int (value);
position = test_value_get_current_int (ATK_VALUE (obj));
g_print ("Position is %d previous position was %d\n",
position, last_position);
last_position = position;
atk_value_get_minimum_value (ATK_VALUE (obj), value);
g_return_if_fail (G_VALUE_HOLDS_INT (value));
position = g_value_get_int (value);
position = test_value_get_minimum_int (ATK_VALUE (obj));
g_print ("Minimum Value is %d\n", position);
atk_value_get_maximum_value (ATK_VALUE (obj), value);
g_return_if_fail (G_VALUE_HOLDS_INT (value));
position = g_value_get_int (value);
position = test_value_get_maximum_int (ATK_VALUE (obj));
g_print ("Maximum Value is %d\n", position);
}
}
@ -56,19 +146,13 @@ static gint _test_paned (gpointer data)
if (role == ATK_ROLE_SPLIT_PANE)
{
GValue *value, val;
int position;
value = &val;
memset (value, 0, sizeof (GValue));
atk_value_get_current_value (ATK_VALUE (obj), value);
g_return_val_if_fail (G_VALUE_HOLDS_INT (value), FALSE);
position = g_value_get_int (value);
position = test_value_get_current_int (ATK_VALUE (obj));
g_print ("Position is : %d\n", position);
last_position = position;
position *= 2;
g_value_set_int (value, position);
atk_value_set_current_value (ATK_VALUE (obj), value);
test_value_set_current_int (ATK_VALUE (obj), position);
times++;
}
if (times < 4)

View file

@ -27,12 +27,14 @@ backend_LTLIBRARIES = libprintbackend-cups.la
libprintbackend_cups_la_SOURCES = \
gtkprintbackendcups.c \
gtkprintercups.c \
gtkcupsutils.c
gtkcupsutils.c \
gtkcupssecretsutils.c
noinst_HEADERS = \
gtkprintbackendcups.h \
gtkprintercups.h \
gtkcupsutils.h
gtkcupsutils.h \
gtkcupssecretsutils.h
libprintbackend_cups_la_LDFLAGS = -avoid-version -module $(no_undefined)
libprintbackend_cups_la_LIBADD = $(LDADDS) $(CUPS_LIBS)

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,41 @@
/* gtkcupssecretsutils.h: Helper to use a secrets service for printer passwords
* Copyright (C) 2014 Intevation GmbH
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GTK_SECRETS_UTILS_H__
#define __GTK_SECRETS_UTILS_H__
#include <glib.h>
#include "gtkcupsutils.h"
G_BEGIN_DECLS
void gtk_cups_secrets_service_query_task (gpointer source_object,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data,
const gchar *printer_uri,
gchar **auth_info_required);
guint gtk_cups_secrets_service_watch (GBusNameAppearedCallback appeared,
GBusNameVanishedCallback vanished,
gpointer user_data);
void gtk_cups_secrets_service_store (gchar **auth_info,
gchar **auth_info_labels,
const gchar *printer_uri);
G_END_DECLS
#endif /* __GTK_SECRETS_UTILS_H__ */

View file

@ -34,6 +34,11 @@
typedef void (*GtkCupsRequestStateFunc) (GtkCupsRequest *request);
static http_t *gtk_cups_http_connect (const char *host,
int port,
http_encryption_t encryption);
static int gtk_cups_http_reconnect (http_t *http);
static void _connect (GtkCupsRequest *request);
static void _post_send (GtkCupsRequest *request);
static void _post_write_request (GtkCupsRequest *request);
@ -171,7 +176,7 @@ gtk_cups_request_new_with_username (http_t *connection,
else
{
request->http = NULL;
request->http = httpConnectEncrypt (request->server,
request->http = gtk_cups_http_connect (request->server,
ippPort (),
cupsEncryption ());
@ -681,6 +686,29 @@ gtk_cups_request_set_ipp_version (GtkCupsRequest *request,
ippSetVersion (request->ipp_request, major, minor);
}
static http_t *
gtk_cups_http_connect (const char *host,
int port,
http_encryption_t encryption)
{
#ifdef HAVE_HTTPCONNECT2
return httpConnect2 (host, port, NULL, AF_UNSPEC, encryption, 0, 30000, NULL);
#else
return httpConnectEncrypt (host, port, encryption);
#endif
}
static int
gtk_cups_http_reconnect (http_t *http)
{
#ifdef HAVE_HTTPRECONNECT2
return httpReconnect2 (http, 30000, NULL);
#else
return httpReconnect (http);
#endif
}
static void
_connect (GtkCupsRequest *request)
{
@ -689,7 +717,7 @@ _connect (GtkCupsRequest *request)
if (request->http == NULL)
{
request->http = httpConnectEncrypt (request->server,
request->http = gtk_cups_http_connect (request->server,
ippPort (),
cupsEncryption ());
@ -744,7 +772,7 @@ _post_send (GtkCupsRequest *request)
if (httpPost (request->http, request->resource))
{
if (httpReconnect (request->http))
if (gtk_cups_http_reconnect (request->http))
{
request->state = GTK_CUPS_POST_DONE;
request->poll_state = GTK_CUPS_HTTP_IDLE;
@ -1046,7 +1074,7 @@ _post_check (GtkCupsRequest *request)
}
if (auth_result ||
httpReconnect (request->http))
gtk_cups_http_reconnect (request->http))
{
/* if the password has been used, reset password_state
* so that we ask for a new one next time around
@ -1105,7 +1133,7 @@ _post_check (GtkCupsRequest *request)
request->state = GTK_CUPS_POST_CONNECT;
/* Reconnect... */
httpReconnect (request->http);
gtk_cups_http_reconnect (request->http);
/* Upgrade with encryption... */
httpEncryption (request->http, HTTP_ENCRYPT_REQUIRED);
@ -1232,7 +1260,7 @@ _get_send (GtkCupsRequest *request)
if (httpGet (request->http, request->resource))
{
if (httpReconnect (request->http))
if (gtk_cups_http_reconnect (request->http))
{
request->state = GTK_CUPS_GET_DONE;
request->poll_state = GTK_CUPS_HTTP_IDLE;
@ -1341,7 +1369,7 @@ _get_check (GtkCupsRequest *request)
}
if (auth_result ||
httpReconnect (request->http))
gtk_cups_http_reconnect (request->http))
{
/* if the password has been used, reset password_state
* so that we ask for a new one next time around
@ -1373,7 +1401,7 @@ _get_check (GtkCupsRequest *request)
request->state = GTK_CUPS_GET_CONNECT;
/* Reconnect... */
httpReconnect (request->http);
gtk_cups_http_reconnect (request->http);
/* Upgrade with encryption... */
httpEncryption (request->http, HTTP_ENCRYPT_REQUIRED);

View file

@ -60,6 +60,11 @@
#include "gtkprintercups.h"
#include "gtkcupsutils.h"
#include "gtkcupssecretsutils.h"
#define GTK_PRINT_BACKEND_CAN_STORE_AUTH_INFO_KEY "gtk-print-backend-can-store-auth-info"
#define GTK_PRINT_BACKEND_STORE_AUTH_INFO_KEY "gtk-print-backend-store-auth-info"
#define GTK_PRINT_BACKEND_AUTH_PRINTER_URI_KEY "gtk-print-backend-auth-printer-uri"
typedef struct _GtkPrintBackendCupsClass GtkPrintBackendCupsClass;
@ -144,6 +149,9 @@ struct _GtkPrintBackendCups
GHashTable *auth;
gchar *username;
gboolean authentication_lock;
gboolean secrets_service_available;
guint secrets_service_watch_id;
#ifdef HAVE_CUPS_API_1_6
GDBusConnection *dbus_connection;
gchar *avahi_default_printer;
@ -213,6 +221,14 @@ static cairo_surface_t * cups_printer_create_cairo_surface (GtkPrinter
static void gtk_print_backend_cups_set_password (GtkPrintBackend *backend,
gchar **auth_info_required,
gchar **auth_info);
static void secrets_service_appeared (GDBusConnection *connection,
const gchar *name,
const gchar *name_owner,
gpointer user_data);
static void secrets_service_vanished (GDBusConnection *connection,
const gchar *name,
gpointer user_data);
void overwrite_and_free (gpointer data);
static gboolean is_address_local (const gchar *address);
@ -489,6 +505,22 @@ cups_free_print_stream_data (CupsPrintStreamData *data)
g_free (data);
}
static http_t *
gtk_cups_backend_http_connect (const char *host,
int port,
http_encryption_t encryption)
{
#ifdef HAVE_HTTPCONNECT2
return httpConnect2 (host, port, NULL, AF_UNSPEC, encryption, 1, 30000, NULL);
#else
if (encryption == HTTP_ENCRYPT_NEVER)
return httpConnect (host, port);
return httpConnectEncrypt (host, port, encryption);
#endif
}
static void
cups_print_cb (GtkPrintBackendCups *print_backend,
GtkCupsResult *result,
@ -636,7 +668,7 @@ gtk_print_backend_cups_print_stream (GtkPrintBackend *print_backend,
{
http_t *http;
http = httpConnect (cups_printer->hostname, cups_printer->port);
http = gtk_cups_backend_http_connect (cups_printer->hostname, cups_printer->port, HTTP_ENCRYPT_NEVER);
if (http)
{
request = gtk_cups_request_new_with_username (http,
@ -751,6 +783,27 @@ void overwrite_and_free (gpointer data)
}
}
static void
secrets_service_appeared (GDBusConnection *connection,
const gchar *name,
const gchar *name_owner,
gpointer user_data)
{
GtkPrintBackendCups *cups_backend = GTK_PRINT_BACKEND_CUPS (user_data);
cups_backend->secrets_service_available = TRUE;
}
static void
secrets_service_vanished (GDBusConnection *connection,
const gchar *name,
gpointer user_data)
{
GtkPrintBackendCups *cups_backend = GTK_PRINT_BACKEND_CUPS (user_data);
cups_backend->secrets_service_available = FALSE;
}
static void
gtk_print_backend_cups_init (GtkPrintBackendCups *backend_cups)
{
@ -767,6 +820,11 @@ gtk_print_backend_cups_init (GtkPrintBackendCups *backend_cups)
backend_cups->requests = NULL;
backend_cups->auth = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, overwrite_and_free);
backend_cups->authentication_lock = FALSE;
backend_cups->secrets_service_available = FALSE;
backend_cups->secrets_service_watch_id =
gtk_cups_secrets_service_watch (secrets_service_appeared,
secrets_service_vanished,
backend_cups);
backend_cups->covers = NULL;
backend_cups->number_of_covers = 0;
@ -836,6 +894,12 @@ gtk_print_backend_cups_dispose (GObject *object)
backend_cups = GTK_PRINT_BACKEND_CUPS (object);
if (backend_cups->secrets_service_watch_id != 0)
{
g_bus_unwatch_name (backend_cups->secrets_service_watch_id);
backend_cups->secrets_service_watch_id = 0;
}
if (backend_cups->list_printers_poll > 0)
g_source_remove (backend_cups->list_printers_poll);
backend_cups->list_printers_poll = 0;
@ -940,7 +1004,7 @@ gtk_print_backend_cups_set_password (GtkPrintBackend *backend,
GtkPrintBackendCups *cups_backend = GTK_PRINT_BACKEND_CUPS (backend);
GList *l;
char dispatch_hostname[HTTP_MAX_URI];
gchar *key;
gchar *key = NULL;
gchar *username = NULL;
gchar *hostname = NULL;
gchar *password = NULL;
@ -962,15 +1026,27 @@ gtk_print_backend_cups_set_password (GtkPrintBackend *backend,
if (hostname != NULL && username != NULL && password != NULL)
{
const gchar *printer_uri;
gboolean store_auth_info;
key = g_strconcat (username, "@", hostname, NULL);
g_hash_table_insert (cups_backend->auth, key, g_strdup (password));
printer_uri = g_object_get_data (G_OBJECT (backend),
GTK_PRINT_BACKEND_AUTH_PRINTER_URI_KEY);
store_auth_info = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (backend),
GTK_PRINT_BACKEND_STORE_AUTH_INFO_KEY));
if (store_auth_info && cups_backend->secrets_service_available && printer_uri != NULL)
gtk_cups_secrets_service_store (auth_info, auth_info_required, printer_uri);
}
g_free (cups_backend->username);
cups_backend->username = g_strdup (username);
GTK_NOTE (PRINTING,
g_print ("CUPS backend: storing password for %s\n", key));
if (key != NULL)
GTK_NOTE (PRINTING,
g_print ("CUPS backend: storing password for %s\n", key));
for (l = cups_backend->requests; l; l = l->next)
{
@ -1114,6 +1190,14 @@ request_password (gpointer data)
g_free (printer_name);
g_object_set_data (G_OBJECT (dispatch->backend),
GTK_PRINT_BACKEND_CAN_STORE_AUTH_INFO_KEY,
GINT_TO_POINTER (dispatch->backend->secrets_service_available));
g_object_set_data_full (G_OBJECT (dispatch->backend),
GTK_PRINT_BACKEND_AUTH_PRINTER_URI_KEY,
g_strdup (printer_uri),
g_free);
g_signal_emit_by_name (dispatch->backend, "request-password",
auth_info_required, auth_info_default, auth_info_display, auth_info_visible, prompt);
@ -2555,7 +2639,7 @@ cups_request_avahi_printer_info (const gchar *printer_uri,
AvahiService *service;
http_t *http;
http = httpConnect (host, port);
http = gtk_cups_backend_http_connect (host, port, HTTP_ENCRYPT_NEVER);
if (http)
{
service = (AvahiService *) g_new0 (AvahiService, 1);
@ -3438,7 +3522,7 @@ cups_request_ppd (GtkPrinter *printer)
}
}
http = httpConnectEncrypt (cups_printer->hostname,
http = gtk_cups_backend_http_connect (cups_printer->hostname,
cups_printer->port,
cupsEncryption ());

View file

@ -2743,7 +2743,7 @@ msgstr "_Aufsteigend"
#: ../gtk/gtkstock.c:427
msgctxt "Stock label"
msgid "_Descending"
msgstr "_Absteigend"
msgstr "A_bsteigend"
#: ../gtk/gtkstock.c:428
msgctxt "Stock label"
@ -6086,3 +6086,95 @@ msgstr ""
#~ msgid "X"
#~ msgstr "X"
#: gtk/gtkfilechooserdefault.c
msgid "A file named \"%s\" already exists."
msgstr "Eine Datei namens „%s“ existiert bereits."
#: gtk/gtkfilechooserdefault.c
msgid "Choose a new name for the pasted file."
msgstr "Neuen Namen für die eingefügte Datei wählen."
#: gtk/gtkfilechooserdefault.c
msgid "New name:"
msgstr "Neuer Name:"
#: gtk/gtkfilechooserdefault.c
msgid "Open _Containing Folder"
msgstr "_Dateipfad öffnen"
#: gtk/gtkfilechooserdefault.c
msgid "Could not paste files"
msgstr "Dateien konnten nicht eingefügt werden"
#: gtk/gtkfilechooserdefault.c
msgid "Could not move %s"
msgstr "%s konnte nicht verschoben werden"
#: gtk/gtkfilechooserdefault.c
msgid "Could not copy %s"
msgstr "%s konnte nicht kopiert werden"
#: gtk/gtkfilechooserdefault.c
msgid "Could not move %s to the trash"
msgstr "%s konnte nicht in den Papierkorb verschoben werden"
#: gtk/gtkfilechooserdefault.c
msgid "Could not move files to the trash"
msgstr "Dateien konnten nicht in den Papierkorb verschoben werden"
#: gtk/gtkfilechooserdefault.c
msgid "_Copy Location"
msgstr "_Pfad kopieren"
#: gtk/gtkfilechooserdefault.c
msgid "_Rename..."
msgstr "_Umbenennen …"
#: gtk/gtkfilechooserdefault.c
msgid "Move to _Trash"
msgstr "In den _Papierkorb verschieben"
#: gtk/gtkfilechooserdefault.c
msgid "Show _Preview Panel"
msgstr "_Vorschauleiste anzeigen"
#: gtk/gtkfilechooserdefault.c
msgid "Show _Thumbnails"
msgstr "_Vorschaubilder anzeigen"
#: gtk/gtkfilechooserdefault.c
msgid "List View"
msgstr "Listenansicht"
#: gtk/gtkfilechooserdefault.c
msgid "Icon View"
msgstr "Symbolansicht"
#: gtk/gtkfilechooserdefault.c
msgid "Compact View"
msgstr "Kompaktansicht"
#: gtk/gtkfilechooserdefault.c
msgid "Show Preview Panel"
msgstr "Vorschauleiste anzeigen"
#: gtk/gtkfilechooserdefault.c
msgid "Arrange Items"
msgstr "Objekte anordnen"
#: gtk/gtkfilechooserdefault.c
msgid "Arrange _Items"
msgstr "_Objekte anordnen"
#: gtk/gtkfilechooserdefault.c
msgid "By _Name"
msgstr "Nach _Name"
#: gtk/gtkfilechooserdefault.c
msgid "By _Size"
msgstr "Nach _Größe"
#: gtk/gtkfilechooserdefault.c
msgid "By _Modification Date"
msgstr "Nach _Änderungsdatum"

View file

@ -628,9 +628,9 @@ create_tree_model (void)
gint i;
GType *t;
volatile GType dummy G_GNUC_UNUSED; /* G_GNUC_CONST makes the optimizer remove
* get_type calls if you don't do something
* like this
*/
* get_type calls if you don't do something
* like this
*/
/* Make the tree more interesting */
dummy = gtk_scrolled_window_get_type ();