Adding upstream version 48.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
This commit is contained in:
parent
9792e886e4
commit
c99d511d89
535 changed files with 1009287 additions and 0 deletions
29
.editorconfig
Normal file
29
.editorconfig
Normal file
|
@ -0,0 +1,29 @@
|
|||
# SPDX-FileCopyrightText: 2021 The Nautilus Authors
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.[ch]]
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
# For the legacy tabs which still exist in the code:
|
||||
tab_width = 8
|
||||
|
||||
[*.ui]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
|
||||
[*.xml]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
|
||||
[meson.build]
|
||||
indent_size = 2
|
||||
indent_style = space
|
7
.git-blame-ignore-revs
Normal file
7
.git-blame-ignore-revs
Normal file
|
@ -0,0 +1,7 @@
|
|||
# uncrustify runs (reformatting)
|
||||
52d960542b4d5fdf2bd06735d0dbf7934cf2ec12
|
||||
fd2e7dfdead8e9046884ca21dcad034e160dae68
|
||||
24ced54ee43854104a62d81e4ec30480bd0f1f3c
|
||||
995fad689367ff71d1104709d0b9bdee0482324a
|
||||
838691f27a78aa52e5dded5dc13867ebf4746a1c
|
||||
b6ebffd567d870f57db8266d01e25642c4c2862f
|
178
.gitlab-ci.yml
Normal file
178
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,178 @@
|
|||
include:
|
||||
- project: "GNOME/citemplates"
|
||||
file: "flatpak/flatpak_ci_initiative.yml"
|
||||
- project: "Infrastructure/freedesktop-ci-templates"
|
||||
file: "templates/fedora.yml"
|
||||
- component: gitlab.gnome.org/GNOME/citemplates/release-service@master
|
||||
inputs:
|
||||
job-stage: release
|
||||
dist-job-name: "flatpak@x86_64"
|
||||
tarball-artifact-path: "${TARBALL_ARTIFACT_PATH}"
|
||||
|
||||
variables:
|
||||
DEPENDENCIES:
|
||||
git
|
||||
gcc
|
||||
meson
|
||||
libasan
|
||||
uncrustify
|
||||
glibc-devel
|
||||
glib2-devel
|
||||
gtk4-devel
|
||||
libadwaita-devel
|
||||
libselinux-devel
|
||||
gettext
|
||||
libgexiv2-devel
|
||||
localsearch
|
||||
dbus-daemon
|
||||
gnome-desktop4-devel
|
||||
gnome-autoar-devel
|
||||
libportal-devel
|
||||
libportal-gtk4-devel
|
||||
libcloudproviders-devel
|
||||
GIT_SUBMODULE_STRATEGY: normal
|
||||
MESON_BUILD_DIR: _build
|
||||
CI_REGISTRY_IMAGE: registry.gitlab.gnome.org/gnome/nautilus
|
||||
TARBALL_ARTIFACT_PATH: ".flatpak-builder/build/nautilus/_flatpak_build/meson-dist/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.xz"
|
||||
|
||||
stages:
|
||||
- image
|
||||
- review
|
||||
- test
|
||||
- analyze
|
||||
- deploy
|
||||
- release
|
||||
|
||||
.vars-devel:
|
||||
variables:
|
||||
MANIFEST_PATH: "build-aux/flatpak/org.gnome.Nautilus.json"
|
||||
FLATPAK_MODULE: "nautilus"
|
||||
RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo"
|
||||
APP_ID: "org.gnome.NautilusDevel"
|
||||
BUNDLE: "nautilus-dev.flatpak"
|
||||
rules:
|
||||
# Disable tests for protected tags
|
||||
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED
|
||||
variables:
|
||||
CONFIG_OPTS: '--libdir=/app/lib -Dprofile=Devel -Dtests=none'
|
||||
- when: always
|
||||
|
||||
workflow:
|
||||
rules:
|
||||
# Run merge request pipelines, for main or release branches, for manually
|
||||
# triggered pipelines (source "web"), and tags, but not for translation updates
|
||||
- if: ($CI_PIPELINE_SOURCE == "merge_request_event" ||
|
||||
$CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED ||
|
||||
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH ||
|
||||
$CI_COMMIT_BRANCH =~ /^gnome-.*$/ ||
|
||||
$CI_PIPELINE_SOURCE == "web") &&
|
||||
$CI_COMMIT_TITLE !~ /^Update.*translation$/
|
||||
|
||||
.nautilus.fedora:
|
||||
variables:
|
||||
FDO_DISTRIBUTION_VERSION: rawhide
|
||||
FDO_DISTRIBUTION_TAG: '2025-02-28'
|
||||
FDO_DISTRIBUTION_COMPRESSION_FORMAT: zstd:chunked
|
||||
|
||||
|
||||
flatpak@x86_64:
|
||||
extends: ['.flatpak@x86_64', '.vars-devel']
|
||||
|
||||
flatpak@aarch64:
|
||||
when: manual
|
||||
rules:
|
||||
- if: $CI_PROJECT_NAMESPACE == "GNOME" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
when: always
|
||||
- allow_failure: true
|
||||
extends: ['.flatpak@aarch64', '.vars-devel']
|
||||
|
||||
nightly@x86_64:
|
||||
extends: '.publish_nightly'
|
||||
needs: ['flatpak@x86_64']
|
||||
|
||||
nightly@aarch64:
|
||||
extends: '.publish_nightly'
|
||||
needs: ['flatpak@aarch64']
|
||||
|
||||
potfile:
|
||||
extends:
|
||||
- .fdo.distribution-image@fedora
|
||||
- .nautilus.fedora
|
||||
stage: review
|
||||
script:
|
||||
- data/check-potfiles.sh
|
||||
|
||||
style check:
|
||||
extends:
|
||||
- .fdo.distribution-image@fedora
|
||||
- .nautilus.fedora
|
||||
stage: review
|
||||
artifacts:
|
||||
name: 'Style check artifacts'
|
||||
expose_as: 'Get style check diff here'
|
||||
when: on_failure
|
||||
paths:
|
||||
- 'uncrustify.diff'
|
||||
expire_in: 14 days
|
||||
script:
|
||||
- LANG=C.utf8 data/run-uncrustify.sh
|
||||
- git diff --exit-code | tee uncrustify.diff
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH !~ /^gnome-.*$/
|
||||
|
||||
update image:
|
||||
extends:
|
||||
- .fdo.container-build@fedora
|
||||
- .nautilus.fedora
|
||||
stage: image
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
FDO_DISTRIBUTION_PACKAGES: $DEPENDENCIES
|
||||
FDO_DISTRIBUTION_EXEC: ".gitlab/image-script.sh"
|
||||
CFLAGS: "-fno-omit-frame-pointer"
|
||||
when: manual
|
||||
rules:
|
||||
- if: $CI_PROJECT_NAMESPACE != "GNOME"
|
||||
when: never
|
||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
- if: $CI_PIPELINE_SOURCE == "web"
|
||||
|
||||
asan:
|
||||
extends:
|
||||
- .fdo.distribution-image@fedora
|
||||
- .nautilus.fedora
|
||||
variables:
|
||||
CFLAGS: "-fno-omit-frame-pointer"
|
||||
LSAN_OPTIONS: suppressions=$CI_PROJECT_DIR/data/leak-suppress.txt
|
||||
stage: analyze
|
||||
rules:
|
||||
- when: manual
|
||||
allow_failure: true
|
||||
script:
|
||||
- meson setup -Db_sanitize=address -Dextensions=false -Dintrospection=false -Dtests=all $MESON_BUILD_DIR
|
||||
- meson compile -C $MESON_BUILD_DIR
|
||||
- meson test --suite display --suite displayless -C $MESON_BUILD_DIR
|
||||
artifacts:
|
||||
name: 'Address Sanitizer-built test results'
|
||||
when: on_failure
|
||||
paths:
|
||||
- $MESON_BUILD_DIR/meson-logs/testlog.txt
|
||||
reports:
|
||||
junit: $MESON_BUILD_DIR/meson-logs/testlog.junit.xml
|
||||
expire_in: 7 days
|
||||
|
||||
pages:
|
||||
extends:
|
||||
- .fdo.distribution-image@fedora
|
||||
- .nautilus.fedora
|
||||
stage: deploy
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PROJECT_NAMESPACE == "GNOME"
|
||||
script:
|
||||
- meson setup -Ddocs=true -Dextensions=false -Dtests=none $MESON_BUILD_DIR
|
||||
- ninja -C $MESON_BUILD_DIR
|
||||
- mv $MESON_BUILD_DIR/docs/reference/nautilus/ public/
|
||||
artifacts:
|
||||
paths:
|
||||
- public/
|
||||
expire_in: 2 days
|
48
.gitlab/image-script.sh
Executable file
48
.gitlab/image-script.sh
Executable file
|
@ -0,0 +1,48 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
dnf builddep -y glib \
|
||||
&& git clone --depth 1 https://gitlab.gnome.org/GNOME/glib.git \
|
||||
&& cd glib \
|
||||
&& meson setup _build -Dintrospection=disabled -Dtests=false --prefix /usr \
|
||||
&& ninja -C _build \
|
||||
&& ninja install -C _build \
|
||||
&& cd .. \
|
||||
|
||||
dnf builddep -y gobject-introspection \
|
||||
&& git clone --depth 1 --recurse-submodules -j8 https://gitlab.gnome.org/GNOME/gobject-introspection.git \
|
||||
&& cd gobject-introspection \
|
||||
&& meson setup _build --prefix /usr \
|
||||
&& ninja -C _build \
|
||||
&& ninja install -C _build \
|
||||
&& cd .. \
|
||||
&& rm -rf gobject-introspection
|
||||
|
||||
cd glib \
|
||||
&& git clean \
|
||||
&& meson setup _build -Dtests=false --prefix /usr \
|
||||
&& ninja -C _build \
|
||||
&& ninja install -C _build \
|
||||
&& cd .. \
|
||||
&& rm -rf glib
|
||||
|
||||
dnf builddep -y --allowerasing gtk4 \
|
||||
&& dnf install -y glslc \
|
||||
&& git clone --depth 1 https://gitlab.gnome.org/GNOME/gtk.git \
|
||||
&& cd gtk \
|
||||
&& meson setup _build -Dbuild-tests=false -Dbuild-testsuite=false -Dbuild-demos=false -Dbuild-examples=false --prefix /usr \
|
||||
&& ninja -C _build \
|
||||
&& ninja install -C _build \
|
||||
&& cd .. \
|
||||
&& rm -rf gtk
|
||||
|
||||
dnf builddep -y libadwaita \
|
||||
&& dnf install -y appstream-devel \
|
||||
&& git clone --depth 1 https://gitlab.gnome.org/GNOME/libadwaita.git \
|
||||
&& cd libadwaita \
|
||||
&& meson setup _build -Dtests=false -Dexamples=false --prefix /usr \
|
||||
&& ninja -C _build \
|
||||
&& ninja install -C _build \
|
||||
&& cd .. \
|
||||
&& rm -rf libadwaita
|
||||
|
||||
dnf clean all
|
34
.gitlab/issue_templates/Bug.md
Normal file
34
.gitlab/issue_templates/Bug.md
Normal file
|
@ -0,0 +1,34 @@
|
|||
<!--
|
||||
It's very helpful to know if the bug also happens in the latest development version.
|
||||
It can be installed alongside the regular version with these instructions:
|
||||
|
||||
1. Make sure that Flatpak is installed (see https://flatpak.org/setup )
|
||||
|
||||
2. Copy and run the following command in the Terminal or Console app:
|
||||
flatpak install --from https://nightly.gnome.org/repo/appstream/org.gnome.NautilusDevel.flatpakref
|
||||
|
||||
3. Launch the development version (normal Files logo with yellow and black stripes), e.g. with:
|
||||
flatpak run org.gnome.NautilusDevel
|
||||
-->
|
||||
|
||||
# Affected Version
|
||||
- Version: <!-- Note: Versions older than a year are not supported. -->
|
||||
- Distribution: <!-- Example: Ubuntu 23.10 -->
|
||||
- Also happens with development version: Yes / No
|
||||
|
||||
# Steps to reproduce <!-- Explain in detail how the issue can be reproduced. -->
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
# Expected Behavior
|
||||
|
||||
|
||||
# Actual Behavior
|
||||
|
||||
|
||||
# Additional Information
|
||||
<!--
|
||||
If the issue is a crash, please provide a stack trace by following the steps in:
|
||||
https://handbook.gnome.org/issues/stack-traces.html
|
||||
-->
|
9
.gitlab/issue_templates/Default.md
Normal file
9
.gitlab/issue_templates/Default.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
# Welcome to the Files issue tracker!
|
||||
|
||||
To report a bug with Files, please select the 'Bug' template under 'Description' above.
|
||||
|
||||
To request a feature, please start a discussion with your idea over at https://discourse.gnome.org/tag/nautilus.
|
||||
|
||||
To report a shortcoming, something that Files currently does not as good as you wish it would, select the 'Shortcoming' template under 'Description' above.
|
||||
|
||||
If you need help regarding the usage or configuration of Files, or have a concern not covered by anything described here, please feel free to post about it at https://discourse.gnome.org/tag/nautilus.
|
9
.gitlab/issue_templates/Feature.md
Normal file
9
.gitlab/issue_templates/Feature.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
# Ideas for new features are welcome!
|
||||
|
||||
Please share your feature ideas in our Discourse in order to discuss them with our community:
|
||||
|
||||
https://discourse.gnome.org/tag/nautilus
|
||||
|
||||
Quite some evaluation plus refinement has to happen between an idea and creating an actual and detailed plan for a potential implementation. We found that they develop into actionable issues best when they are discussed beforehand.
|
||||
|
||||
However, if you've got this idea because of an existing problem in the application, please don't forget to report the bug or shortcoming using the respective template.
|
31
.gitlab/issue_templates/Shortcoming.md
Normal file
31
.gitlab/issue_templates/Shortcoming.md
Normal file
|
@ -0,0 +1,31 @@
|
|||
<!--
|
||||
It's useful to know if the latest development version has the same shortcoming.
|
||||
It can be installed alongside the regular version with these instructions:
|
||||
|
||||
1. Make sure that Flatpak is installed (see https://flatpak.org/setup )
|
||||
|
||||
2. Copy and run the following command in the Terminal or Console app:
|
||||
flatpak install --from https://nightly.gnome.org/repo/appstream/org.gnome.NautilusDevel.flatpakref
|
||||
|
||||
3. Launch the development version (normal Files logo with yellow and black stripes), e.g. with:
|
||||
flatpak run org.gnome.NautilusDevel
|
||||
-->
|
||||
|
||||
# Affected Version
|
||||
- Version: <!-- Note: Versions older than a year are not supported. -->
|
||||
- Distribution: <!-- Example: Ubuntu 23.10 -->
|
||||
- Also affects development version: Yes / No
|
||||
|
||||
### Use Cases
|
||||
<!--
|
||||
Describe concrete situations, from daily usage, in which this app isn't helpful enough.
|
||||
Focus on what you want to do, not how it should be done, but do mention possible constraints.
|
||||
-->
|
||||
|
||||
### Available Workarounds <!-- Can the goal be achieved with the current app version? -->
|
||||
|
||||
|
||||
### Difficulties <!-- Why is the current experience unsatisfying? -->
|
||||
|
||||
|
||||
### Suggested Enhancements <!-- Optional - the other sections are more important. -->
|
42
CONTRIBUTING.md
Normal file
42
CONTRIBUTING.md
Normal file
|
@ -0,0 +1,42 @@
|
|||
# Contributing to Nautilus
|
||||
|
||||
Thank you for your interest in contributing to our project!
|
||||
|
||||
To build the development version of the Files app and hack on the code
|
||||
see the [welcome guide](https://welcome.gnome.org/en/app/Nautilus/#getting-the-app-to-build).
|
||||
|
||||
Commit messages should follow the expected format [detailed here](https://handbook.gnome.org/development/commit-messages.html).
|
||||
|
||||
Your commit message should look something like this:
|
||||
|
||||
```
|
||||
tag: Short explanation of the commit
|
||||
|
||||
Longer explanation explaining exactly what's changed and why, whether
|
||||
any external or private interfaces changed, what issue were fixed (with
|
||||
issue number if applicable) and so forth. Be concise but not too brief.
|
||||
|
||||
Closes #1234
|
||||
```
|
||||
|
||||
## File Chooser
|
||||
|
||||
Developing for the nautilus file chooser may be complicated because of the
|
||||
portal implementation. In order to call the development version of nautilus
|
||||
(rather than the system installed version) use the below commands, while making
|
||||
sure that you have the development version already running. Note that the
|
||||
below commands are somewhat redundant and include default keys in order to make
|
||||
updating them easier. For example, `OpenFile` defaults to `directory = false`,
|
||||
but you can easily open a directory file chooser by changing `false` to `true`.
|
||||
|
||||
##### Open a file or directory
|
||||
|
||||
`gdbus call --session --dest org.gnome.NautilusDevel --object-path /org/freedesktop/portal/desktop --method org.freedesktop.impl.portal.FileChooser.OpenFile '/org/gnome/NautilusDevel' 'org.gnome.NautilusDevel' '' 'Open a File' "{'filters': <[('All Files', [(uint32 0, '*')]), ('Images', [(uint32 0, '*.ico'), (uint32 1, 'image/png')]), ('Text', [(uint32 0, '*.txt')])]>, 'current_filter': <('All Files', [(uint32 0, '*')])>, 'choices': <[('encoding', 'Encoding', [('utf8', 'Unicode (UTF-8)'), ('latin15', 'Western')], 'latin15'), ('reencode', 'Reencode', [], 'false')]>, 'directory': <false>, 'multiple': <false>, 'modal': <true>, 'accept_label': <'Open'>, 'current_folder': <b'$HOME'>}"`
|
||||
|
||||
##### Save a file
|
||||
|
||||
`gdbus call --session --dest org.gnome.NautilusDevel --object-path /org/freedesktop/portal/desktop --method org.freedesktop.impl.portal.FileChooser.SaveFile '/org/gnome/NautilusDevel' 'org.gnome.NautilusDevel' '' 'Save a File' "{'filters': <[('All Files', [(uint32 0, '*')]),('Images', [(uint32 0, '*.ico'), (uint32 1, 'image/png')]), ('Text', [(uint32 0, '*.txt')])]>, 'current_filter': <('All Files', [(uint32 0, '*')])>, 'choices': <[('encoding', 'Encoding', [('utf8', 'Unicode (UTF-8)'), ('latin15', 'Western')], 'latin15'), ('reencode', 'Reencode', [], 'false')]>, 'modal': <true>, 'accept_label': <'Save'>, 'current_file': <b'$HOME/test_file'>}"`
|
||||
|
||||
##### Save multiple files
|
||||
|
||||
`gdbus call --session --dest org.gnome.NautilusDevel --object-path /org/freedesktop/portal/desktop --method org.freedesktop.impl.portal.FileChooser.SaveFiles '/org/gnome/NautilusDevel' 'org.gnome.NautilusDevel' '' 'Save Files' "{'choices': <[('encoding', 'Encoding', [('utf8', 'Unicode (UTF-8)'), ('latin15', 'Western')], 'latin15'), ('reencode', 'Reencode', [], 'false')]>, 'modal': <true>, 'accept_label': <'Save'>, 'current_folder': <b'$HOME'>}"`
|
674
LICENSE
Normal file
674
LICENSE
Normal file
|
@ -0,0 +1,674 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
38
README.md
Normal file
38
README.md
Normal file
|
@ -0,0 +1,38 @@
|
|||
# nautilus
|
||||
[](https://gitlab.gnome.org/GNOME/nautilus/commits/main)
|
||||
|
||||
This is the project of the [Files](https://apps.gnome.org/Nautilus/) app, a file browser for
|
||||
GNOME, internally known by its historical name `nautilus`.
|
||||
|
||||
## Supported version
|
||||
Only the latest version of Files as provided upstream is supported. Try out the [Flatpak nightly](https://welcome.gnome.org/en/app/Nautilus/#installing-a-nightly-build) installation before filling issues to ensure the installation is reproducible and doesn't have downstream changes on it. In case you cannot reproduce in the nightly installation, don't hesitate to file an issue in your distribution. This is to ensure the issue is well triaged and reaches the proper people.
|
||||
|
||||
### Update default branch
|
||||
|
||||
The default development branch of nautilus has been renamed to `main`. To
|
||||
update your local checkout, use:
|
||||
```sh
|
||||
git checkout master
|
||||
git branch -m master main
|
||||
git fetch
|
||||
git branch --unset-upstream
|
||||
git branch -u origin/main
|
||||
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
|
||||
```
|
||||
|
||||
## Runtime dependencies
|
||||
- [Bubblewrap](https://github.com/projectatomic/bubblewrap) installed. Used for security reasons.
|
||||
- [LocalSearch](https://gitlab.gnome.org/GNOME/localsearch) properly set up and with all features enabled. Used for fast search and metadata extraction, starred files and batch renaming.
|
||||
- [xdg-user-dirs-gtk](https://gitlab.gnome.org/GNOME/xdg-user-dirs-gtk) installed. Used to create the default bookmarks and update localization.
|
||||
|
||||
## Discourse
|
||||
|
||||
For more informal discussion we use [GNOME Discourse](https://discourse.gnome.org/tags/nautilus) in the Applications category with the `nautilus` tag. Feel free to open a topic there.
|
||||
|
||||
## Extensions
|
||||
|
||||
Documentation for the libnautilus-extension API is available [here](https://gnome.pages.gitlab.gnome.org/nautilus/). Also, if you are interested in developing a Nautilus extension in Python you should refer to the [nautilus-python](https://gnome.pages.gitlab.gnome.org/nautilus-python/) documentation.
|
||||
|
||||
## How to report issues
|
||||
|
||||
Report issues to the GNOME [issue tracking system](https://gitlab.gnome.org/GNOME/nautilus/issues).
|
207
build-aux/flatpak/org.gnome.Nautilus.json
Normal file
207
build-aux/flatpak/org.gnome.Nautilus.json
Normal file
|
@ -0,0 +1,207 @@
|
|||
{
|
||||
"app-id": "org.gnome.NautilusDevel",
|
||||
"runtime": "org.gnome.Platform",
|
||||
"runtime-version": "master",
|
||||
"sdk": "org.gnome.Sdk",
|
||||
"command": "nautilus",
|
||||
"tags": [
|
||||
"devel",
|
||||
"development",
|
||||
"nightly"
|
||||
],
|
||||
"finish-args": [
|
||||
"--device=dri",
|
||||
"--share=ipc",
|
||||
"--socket=x11",
|
||||
"--socket=wayland",
|
||||
"--talk-name=org.gnome.OnlineAccounts",
|
||||
"--filesystem=host",
|
||||
"--filesystem=/tmp",
|
||||
"--talk-name=org.gtk.vfs.*",
|
||||
"--talk-name=org.gtk.MountOperationHandler",
|
||||
"--filesystem=xdg-run/gvfsd",
|
||||
"--filesystem=xdg-run/dconf",
|
||||
"--filesystem=~/.config/dconf:ro",
|
||||
"--talk-name=ca.desrt.dconf",
|
||||
"--talk-name=org.gnome.NautilusPreviewer",
|
||||
"--talk-name=org.gnome.NautilusPreviewerDevel",
|
||||
"--talk-name=org.gnome.DiskUtility",
|
||||
"--talk-name=org.gnome.Settings",
|
||||
"--talk-name=org.gnome.Console",
|
||||
"--talk-name=org.gnome.Mutter.ServiceChannel",
|
||||
"--env=DCONF_USER_CONFIG_DIR=.config/dconf",
|
||||
"--add-policy=Tracker3.dbus:org.freedesktop.Tracker3.Miner.Files=tracker:Audio",
|
||||
"--add-policy=Tracker3.dbus:org.freedesktop.Tracker3.Miner.Files=tracker:Documents",
|
||||
"--add-policy=Tracker3.dbus:org.freedesktop.Tracker3.Miner.Files=tracker:FileSystem",
|
||||
"--add-policy=Tracker3.dbus:org.freedesktop.Tracker3.Miner.Files=tracker:Pictures",
|
||||
"--add-policy=Tracker3.dbus:org.freedesktop.Tracker3.Miner.Files=tracker:Music",
|
||||
"--add-policy=Tracker3.dbus:org.freedesktop.Tracker3.Miner.Files=tracker:Video"
|
||||
],
|
||||
"modules": [
|
||||
{
|
||||
"name": "exiv2",
|
||||
"config-opts": [
|
||||
"-DCMAKE_INSTALL_PREFIX=/app",
|
||||
"-DCMAKE_INSTALL_LIBDIR=/app/lib"
|
||||
],
|
||||
"buildsystem": "cmake-ninja",
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://github.com/Exiv2/exiv2.git",
|
||||
"branch": "0.27-maintenance"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "gexiv2",
|
||||
"buildsystem": "meson",
|
||||
"builddir": true,
|
||||
"config-opts": [
|
||||
"--libdir=/app/lib",
|
||||
"-Dintrospection=false",
|
||||
"-Dvapi=false",
|
||||
"-Dtools=false",
|
||||
"-Dpython3=false"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://gitlab.gnome.org/GNOME/gexiv2.git",
|
||||
"tag": "gexiv2-0.14.2"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "localsearch",
|
||||
"buildsystem": "meson",
|
||||
"cleanup": [
|
||||
"/etc",
|
||||
"/libexec/localsearch-3",
|
||||
"/share/dbus-1/services/org.freedesktop.Tracker3.Miner.Files.service",
|
||||
"/share/dbus-1/services/org.freedesktop.Tracker3.Miner.Files.Control.service",
|
||||
"/share/dbus-1/services/org.freedesktop.LocalSearch3.service",
|
||||
"/share/dbus-1/services/org.freedesktop.LocalSearch3.Control.service"
|
||||
],
|
||||
"config-opts": [
|
||||
"-Dfunctional_tests=false",
|
||||
"-Dsandbox_tests=false",
|
||||
"-Ddomain_prefix=org.gnome.NautilusDevel",
|
||||
"-Dextract=true",
|
||||
"-Dlandlock=disabled",
|
||||
"-Dman=false",
|
||||
"-Dminer_fs=true",
|
||||
"-Dminer_fs_cache_location=$XDG_CACHE_HOME/nautilus/miner/files",
|
||||
"-Dsystemd_user_services=false",
|
||||
"-Dwriteback=false",
|
||||
"-Dbattery_detection=none"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://gitlab.gnome.org/GNOME/localsearch.git",
|
||||
"branch": "main"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "gnome-desktop",
|
||||
"buildsystem": "meson",
|
||||
"config-opts": [
|
||||
"-Ddebug_tools=false",
|
||||
"-Ddesktop_docs=false",
|
||||
"-Dlegacy_library=false",
|
||||
"-Dsystemd=disabled",
|
||||
"-Dudev=disabled"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://gitlab.gnome.org/GNOME/gnome-desktop.git"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "gnome-autoar",
|
||||
"buildsystem": "meson",
|
||||
"builddir": true,
|
||||
"config-opts": [
|
||||
"-Dgtk=false",
|
||||
"-Dintrospection=disabled"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://gitlab.gnome.org/GNOME/gnome-autoar.git"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "libportal",
|
||||
"buildsystem": "meson",
|
||||
"builddir": true,
|
||||
"config-opts": [
|
||||
"-Dbackend-gtk4=enabled",
|
||||
"-Dbackend-gtk3=disabled",
|
||||
"-Ddocs=false",
|
||||
"-Dintrospection=false",
|
||||
"-Dtests=false",
|
||||
"-Dvapi=false",
|
||||
"--libdir=/app/lib",
|
||||
"--buildtype=debugoptimized"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://github.com/flatpak/libportal.git",
|
||||
"branch": "main"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "libcloudproviders",
|
||||
"buildsystem": "meson",
|
||||
"builddir": true,
|
||||
"config-opts": [
|
||||
"-Dintrospection=false",
|
||||
"-Dvapigen=false"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://gitlab.gnome.org/GNOME/libcloudproviders.git"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"buildsystem": "meson",
|
||||
"run-tests": true,
|
||||
"builddir": true,
|
||||
"name": "nautilus",
|
||||
"build-options": {
|
||||
"test-args": [
|
||||
"--device=dri",
|
||||
"--share=ipc",
|
||||
"--socket=fallback-x11",
|
||||
"--socket=wayland",
|
||||
"--talk-name=org.gtk.vfs.*",
|
||||
"--talk-name=org.gtk.MountOperationHandler",
|
||||
"--filesystem=xdg-run/gvfsd",
|
||||
"--add-policy=Tracker3.dbus:org.freedesktop.Tracker3.Miner.Files=tracker:FileSystem"
|
||||
]
|
||||
},
|
||||
"config-opts": [
|
||||
"--libdir=/app/lib",
|
||||
"-Dprofile=Devel",
|
||||
"-Dtests=all"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://gitlab.gnome.org/GNOME/nautilus.git",
|
||||
"branch": "main"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
38
data/check-potfiles.sh
Executable file
38
data/check-potfiles.sh
Executable file
|
@ -0,0 +1,38 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
srcdirs="eel extensions src libnautilus-extension"
|
||||
uidirs="src/resources/ui src/gtk"
|
||||
desktopdirs="data"
|
||||
|
||||
# find source files that contain gettext keywords
|
||||
files=$(grep -lR --include='*.c' '\(gettext\|[^I_)]_\)(' $srcdirs)
|
||||
|
||||
# find ui files that contain translatable string
|
||||
files="$files "$(grep -lRi --include='*.ui' 'translatable="[ty1]' $uidirs)
|
||||
|
||||
# find .desktop files
|
||||
files="$files "$(find $desktopdirs -name '*.desktop*')
|
||||
|
||||
# filter out excluded files
|
||||
if [ -f po/POTFILES.skip ]; then
|
||||
files=$(for f in $files; do ! grep -q ^$f po/POTFILES.skip && echo $f; done)
|
||||
fi
|
||||
|
||||
# find those that aren't listed in POTFILES.in
|
||||
missing=$(for f in $files; do ! grep -q ^$f po/POTFILES.in && echo $f; done)
|
||||
|
||||
if [ ${#missing} -eq 0 ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
cat >&2 <<EOT
|
||||
|
||||
The following files are missing from po/POTFILES.po:
|
||||
|
||||
EOT
|
||||
for f in $missing; do
|
||||
echo " $f" >&2
|
||||
done
|
||||
echo >&2
|
||||
|
||||
exit 1
|
59
data/dbus-interfaces.xml
Normal file
59
data/dbus-interfaces.xml
Normal file
|
@ -0,0 +1,59 @@
|
|||
<!DOCTYPE node PUBLIC
|
||||
"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||
|
||||
<!--
|
||||
Copyright (C) 2011 Red Hat, Inc.
|
||||
|
||||
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/>.
|
||||
|
||||
Author: Alexander Larsson <alexl@redhat.com>
|
||||
-->
|
||||
|
||||
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
|
||||
<interface name='org.gnome.Nautilus.FileOperations'>
|
||||
|
||||
<!--
|
||||
This interface has been deprecated. Please switch to
|
||||
org.gnome.Nautilus.FileOperations2 interace.
|
||||
-->
|
||||
<annotation name="org.freedesktop.DBus.Deprecated" value="true"/>
|
||||
|
||||
<method name='CopyURIs'>
|
||||
<arg type='as' name='SourceFilesURIList' direction='in'/>
|
||||
<arg type='s' name='DestinationDirectoryURI' direction='in'/>
|
||||
</method>
|
||||
<method name='MoveURIs'>
|
||||
<arg type='as' name='SourceFilesURIList' direction='in'/>
|
||||
<arg type='s' name='DestinationDirectoryURI' direction='in'/>
|
||||
</method>
|
||||
<method name='EmptyTrash'>
|
||||
</method>
|
||||
<method name='TrashFiles'>
|
||||
<arg type='as' name='URIs' direction='in'/>
|
||||
</method>
|
||||
<method name='CreateFolder'>
|
||||
<arg type='s' name='URI' direction='in'/>
|
||||
</method>
|
||||
<method name='RenameFile'>
|
||||
<arg type='s' name='URI' direction='in'/>
|
||||
<arg type='s' name='NewName' direction='in'/>
|
||||
</method>
|
||||
<method name='Undo'>
|
||||
</method>
|
||||
<method name='Redo'>
|
||||
</method>
|
||||
<property name="UndoStatus" type="i" access="read"/>
|
||||
</interface>
|
||||
</node>
|
84
data/dbus-interfaces2.xml
Normal file
84
data/dbus-interfaces2.xml
Normal file
|
@ -0,0 +1,84 @@
|
|||
<!DOCTYPE node PUBLIC
|
||||
"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||
|
||||
<!--
|
||||
Copyright (C) 2011 Red Hat, Inc.
|
||||
|
||||
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/>.
|
||||
|
||||
Author: Alexander Larsson <alexl@redhat.com>
|
||||
-->
|
||||
|
||||
<!--
|
||||
org.gnome.Nautilus.FileOperations2:
|
||||
@short_description: Nautilus File Operations D-Bus interface
|
||||
|
||||
This API is meant to be consumed by desktop components, and optimized
|
||||
for their needs. This API is considered private and must not be used
|
||||
by applications.
|
||||
|
||||
All methods takes platform_data argument that can be used to pass
|
||||
extra data. Currently supported arguments are:
|
||||
- parent-handle (s): the parent window identifier, used to set parent
|
||||
window for dialogs; must be in x11:XID or
|
||||
wayland:HANDLE form
|
||||
- timestamp (u): the timestamp of the user interaction
|
||||
-->
|
||||
<node xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
|
||||
<interface name='org.gnome.Nautilus.FileOperations2'>
|
||||
|
||||
<method name='CopyURIs'>
|
||||
<arg type='as' name='sources' direction='in'/>
|
||||
<arg type='s' name='destination' direction='in'/>
|
||||
<arg type='a{sv}' name='platform_data' direction='in'/>
|
||||
</method>
|
||||
<method name='MoveURIs'>
|
||||
<arg type='as' name='sources' direction='in'/>
|
||||
<arg type='s' name='destination' direction='in'/>
|
||||
<arg type='a{sv}' name='platform_data' direction='in'/>
|
||||
</method>
|
||||
<method name='EmptyTrash'>
|
||||
<arg type="b" name="ask_confirmation" direction='in'/>
|
||||
<arg type='a{sv}' name='platform_data' direction='in'/>
|
||||
</method>
|
||||
<method name='TrashURIs'>
|
||||
<arg type='as' name='uris' direction='in'/>
|
||||
<arg type='a{sv}' name='platform_data' direction='in'/>
|
||||
</method>
|
||||
<method name='DeleteURIs'>
|
||||
<arg type='as' name='uris' direction='in'/>
|
||||
<arg type='a{sv}' name='platform_data' direction='in'/>
|
||||
</method>
|
||||
<method name='CreateFolder'>
|
||||
<arg type='s' name='parent_uri' direction='in'/>
|
||||
<arg type='s' name='new_folder_name' direction='in'/>
|
||||
<arg type='a{sv}' name='platform_data' direction='in'/>
|
||||
</method>
|
||||
<method name='RenameURI'>
|
||||
<arg type='s' name='uri' direction='in'/>
|
||||
<arg type='s' name='new_name' direction='in'/>
|
||||
<arg type='a{sv}' name='platform_data' direction='in'/>
|
||||
</method>
|
||||
<method name='Undo'>
|
||||
<arg type='a{sv}' name='platform_data' direction='in'/>
|
||||
</method>
|
||||
<method name='Redo'>
|
||||
<arg type='a{sv}' name='platform_data' direction='in'/>
|
||||
</method>
|
||||
|
||||
<property name="UndoStatus" type="i" access="read"/>
|
||||
|
||||
</interface>
|
||||
</node>
|
43
data/freedesktop-dbus-interfaces.xml
Normal file
43
data/freedesktop-dbus-interfaces.xml
Normal file
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE node PUBLIC
|
||||
"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||
|
||||
<!--
|
||||
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/>.
|
||||
-->
|
||||
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
|
||||
<interface name='org.freedesktop.FileManager1'>
|
||||
<method name='ShowFolders'>
|
||||
<arg type='as' name='URIs' direction='in'/>
|
||||
<arg type='s' name='StartupId' direction='in'/>
|
||||
</method>
|
||||
<method name='ShowItems'>
|
||||
<arg type='as' name='URIs' direction='in'/>
|
||||
<arg type='s' name='StartupId' direction='in'/>
|
||||
</method>
|
||||
<method name='ShowItemProperties'>
|
||||
<arg type='as' name='URIs' direction='in'/>
|
||||
<arg type='s' name='StartupId' direction='in'/>
|
||||
</method>
|
||||
<property name="OpenLocations" type="as" access="read"/>
|
||||
<!--
|
||||
An extension to the official FileManager1 interface that allows Nautilus
|
||||
to publish a mapping of windows to the locations in each window.
|
||||
This can be used by shell extensions like dash-to-dock/ubuntu-dock to
|
||||
associate special dock icons with windows where the icon's location is
|
||||
open.
|
||||
-->
|
||||
<property name="OpenWindowsWithLocations" type="a{sas}" access="read"/>
|
||||
</interface>
|
||||
</node>
|
253
data/icons/hicolor/scalable/apps/org.gnome.Nautilus.svg
Normal file
253
data/icons/hicolor/scalable/apps/org.gnome.Nautilus.svg
Normal file
|
@ -0,0 +1,253 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 128 128"
|
||||
style="display:inline;enable-background:new"
|
||||
version="1.0"
|
||||
id="svg11300"
|
||||
height="128"
|
||||
width="128">
|
||||
<title
|
||||
id="title4162">Adwaita Icon Template</title>
|
||||
<defs
|
||||
id="defs3">
|
||||
<linearGradient
|
||||
id="linearGradient1245">
|
||||
<stop
|
||||
id="stop1241"
|
||||
offset="0"
|
||||
style="stop-color:#9a9996;stop-opacity:1" />
|
||||
<stop
|
||||
id="stop1243"
|
||||
offset="1"
|
||||
style="stop-color:#c0bfbc;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient1697">
|
||||
<stop
|
||||
style="stop-color:#deddda;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop1685" />
|
||||
<stop
|
||||
id="stop1687"
|
||||
offset="0.04545455"
|
||||
style="stop-color:#eeeeec;stop-opacity:1" />
|
||||
<stop
|
||||
style="stop-color:#deddda;stop-opacity:1"
|
||||
offset="0.09090909"
|
||||
id="stop1689" />
|
||||
<stop
|
||||
id="stop1691"
|
||||
offset="0.90909094"
|
||||
style="stop-color:#deddda;stop-opacity:1" />
|
||||
<stop
|
||||
style="stop-color:#eeeeec;stop-opacity:1"
|
||||
offset="0.95454544"
|
||||
id="stop1693" />
|
||||
<stop
|
||||
style="stop-color:#c0bfbc;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop1695" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
gradientUnits="userSpaceOnUse"
|
||||
y2="238"
|
||||
x2="108"
|
||||
y1="238"
|
||||
x1="20"
|
||||
id="linearGradient1049"
|
||||
xlink:href="#linearGradient1697" />
|
||||
<linearGradient
|
||||
y2="238"
|
||||
x2="74"
|
||||
y1="238"
|
||||
x1="50"
|
||||
gradientTransform="translate(2,-22)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient1185"
|
||||
xlink:href="#linearGradient1697" />
|
||||
<linearGradient
|
||||
y2="200"
|
||||
x2="65"
|
||||
y1="204"
|
||||
x1="65"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient1348"
|
||||
xlink:href="#linearGradient1245" />
|
||||
</defs>
|
||||
<metadata
|
||||
id="metadata4">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>GNOME Design Team</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<dc:source />
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
|
||||
<dc:title>Adwaita Icon Template</dc:title>
|
||||
<dc:subject>
|
||||
<rdf:Bag />
|
||||
</dc:subject>
|
||||
<dc:date />
|
||||
<dc:rights>
|
||||
<cc:Agent>
|
||||
<dc:title />
|
||||
</cc:Agent>
|
||||
</dc:rights>
|
||||
<dc:publisher>
|
||||
<cc:Agent>
|
||||
<dc:title />
|
||||
</cc:Agent>
|
||||
</dc:publisher>
|
||||
<dc:identifier />
|
||||
<dc:relation />
|
||||
<dc:language />
|
||||
<dc:coverage />
|
||||
<dc:description />
|
||||
<dc:contributor>
|
||||
<cc:Agent>
|
||||
<dc:title />
|
||||
</cc:Agent>
|
||||
</dc:contributor>
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
transform="translate(0,-172)"
|
||||
style="display:inline"
|
||||
id="layer1">
|
||||
<g
|
||||
style="display:inline"
|
||||
id="layer9">
|
||||
<g
|
||||
transform="matrix(0.25,0,0,-0.25,-6,217)"
|
||||
id="g15447-1" />
|
||||
<g
|
||||
id="g1207">
|
||||
<rect
|
||||
ry="8.017911"
|
||||
rx="8.7725897"
|
||||
y="234"
|
||||
x="20"
|
||||
height="58"
|
||||
width="88"
|
||||
id="rect1041"
|
||||
style="opacity:1;vector-effect:none;fill:url(#linearGradient1049);fill-opacity:1;stroke:none;stroke-width:0.01184966px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal" />
|
||||
<rect
|
||||
style="opacity:1;vector-effect:none;fill:#f6f5f4;fill-opacity:1;stroke:none;stroke-width:0.01184966px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
|
||||
id="rect15435-6"
|
||||
width="88"
|
||||
height="108"
|
||||
x="20"
|
||||
y="180"
|
||||
rx="8.7725897"
|
||||
ry="8.017911" />
|
||||
<rect
|
||||
ry="4.0021734"
|
||||
rx="4"
|
||||
y="186"
|
||||
x="24"
|
||||
height="98"
|
||||
width="80"
|
||||
id="rect1167"
|
||||
style="display:inline;opacity:1;vector-effect:none;fill:#1a5fb4;fill-opacity:1;stroke:none;stroke-width:0.0119126px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal;enable-background:new" />
|
||||
<rect
|
||||
style="display:inline;opacity:1;vector-effect:none;fill:#3584e4;fill-opacity:1;stroke:none;stroke-width:0.0119126px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal;enable-background:new"
|
||||
id="rect15441-8"
|
||||
width="80"
|
||||
height="98"
|
||||
x="24"
|
||||
y="184"
|
||||
rx="4"
|
||||
ry="4.0021734" />
|
||||
<rect
|
||||
style="display:inline;opacity:1;vector-effect:none;fill:#1c71d8;fill-opacity:1;stroke:none;stroke-width:0.01190936px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal;enable-background:new"
|
||||
id="rect15443-6"
|
||||
width="80"
|
||||
height="2"
|
||||
x="24"
|
||||
y="216"
|
||||
rx="0"
|
||||
ry="0" />
|
||||
<rect
|
||||
style="display:inline;opacity:1;vector-effect:none;fill:#1c71d8;fill-opacity:1;stroke:none;stroke-width:0.01190936px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal;enable-background:new"
|
||||
id="rect15461-2"
|
||||
width="80"
|
||||
height="2"
|
||||
x="24"
|
||||
y="248"
|
||||
rx="0"
|
||||
ry="0" />
|
||||
<g
|
||||
id="g1088">
|
||||
<path
|
||||
id="path26035"
|
||||
d="m 55,196 h 18 c 1.662,0 3,1 3,3 v 5 H 72.03125 L 72,200 H 56 l 0.03125,4 H 52 v -5 c 0,-1.662 1.338,-3 3,-3 z"
|
||||
style="opacity:1;vector-effect:none;fill:url(#linearGradient1185);fill-opacity:1;stroke:none;stroke-width:0.01184966px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal" />
|
||||
<rect
|
||||
style="opacity:0.1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="rect1059"
|
||||
width="24"
|
||||
height="4"
|
||||
x="52"
|
||||
y="202"
|
||||
ry="1.5" />
|
||||
<path
|
||||
style="opacity:1;fill:url(#linearGradient1348);fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
d="m 55,200 c -1.662,0 -3,1.338 -3,3 v 1 h 4 v -2 h 16 v 2 h 4 v -1 c 0,-1.662 -1.338,-3 -3,-3 z"
|
||||
id="rect1061" />
|
||||
<rect
|
||||
y="202"
|
||||
x="56"
|
||||
height="2"
|
||||
width="16"
|
||||
id="rect1189"
|
||||
style="opacity:0.1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||
</g>
|
||||
<use
|
||||
x="0"
|
||||
y="0"
|
||||
xlink:href="#g1088"
|
||||
id="use1090"
|
||||
transform="translate(0,32)"
|
||||
width="100%"
|
||||
height="100%" />
|
||||
<use
|
||||
height="100%"
|
||||
width="100%"
|
||||
transform="translate(0,64)"
|
||||
id="use1092"
|
||||
xlink:href="#g1088"
|
||||
y="0"
|
||||
x="0" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 9.2 KiB |
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 11 KiB |
|
@ -0,0 +1,30 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:svg='http://www.w3.org/2000/svg' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' version='1.1' inkscape:version='0.47 r22583' height='16' sodipodi:docname='system-file-manager-symbolic.svg' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'>
|
||||
<metadata id='metadata90'>
|
||||
<rdf:RDF>
|
||||
<cc:Work rdf:about=''>
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/>
|
||||
<dc:title>Gnome Symbolic Icon Theme</dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<sodipodi:namedview inkscape:object-paths='true' inkscape:cy='-218.16054' inkscape:current-layer='layer11' inkscape:window-width='1920' pagecolor='#555753' showborder='false' showguides='true' inkscape:snap-nodes='false' objecttolerance='10' showgrid='true' inkscape:object-nodes='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:window-x='0' inkscape:snap-bbox='true' bordercolor='#666666' id='namedview88' inkscape:window-maximized='1' inkscape:snap-global='true' inkscape:window-y='26' gridtolerance='10' inkscape:zoom='1' inkscape:window-height='1021' borderopacity='1' guidetolerance='10' inkscape:snap-bbox-midpoints='false' inkscape:cx='-144.56708' inkscape:bbox-paths='false' inkscape:snap-grids='true' inkscape:pageopacity='1' inkscape:snap-to-guides='true'>
|
||||
<inkscape:grid visible='true' spacingx='1px' type='xygrid' spacingy='1px' id='grid4866' empspacing='2' enabled='true' snapvisiblegridlinesonly='true'/>
|
||||
</sodipodi:namedview>
|
||||
<title id='title9167'>Gnome Symbolic Icon Theme</title>
|
||||
<defs id='defs7386'/>
|
||||
<g transform='translate(-202.0002,-490)' inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline'/>
|
||||
<g transform='translate(-202.0002,-490)' inkscape:groupmode='layer' id='layer10' inkscape:label='devices'/>
|
||||
<g transform='translate(-202.0002,-490)' inkscape:groupmode='layer' id='layer11' inkscape:label='apps'>
|
||||
|
||||
<path inkscape:connector-curvature='0' d='M 205.1875,490 C 203.98238,490 203,491.01795 203,492.21875 l 0,11.5625 c 0,1.2008 0.98238,2.21875 2.1875,2.21875 l 9.625,0 c 1.20512,0 2.1875,-1.01795 2.1875,-2.21875 l 0,-11.5625 C 217,491.01795 216.01762,490 214.8125,490 l -9.625,0 z m -0.1875,3 10,0 0,11 -10,0 0,-11 z m 1,1 0,4 8.03125,0 0,-4 L 206,494 z m 2.34375,1.4375 a 0.50004997,0.50004997 0 0 1 0.0625,0 0.50004997,0.50004997 0 0 1 0.59375,0.5 l 0,0.0625 2,0 0,-0.0625 a 0.50004997,0.50004997 0 1 1 1,0 L 212,496 c 0,0.54535 -0.45465,1 -1,1 l -2,0 c -0.54535,0 -1,-0.45465 -1,-1 l 0,-0.0625 a 0.50004997,0.50004997 0 0 1 0.34375,-0.5 z m -2.3125,3.5625 0,4 8.03125,0 0,-4 -8.03125,0 z m 2.3125,1.4375 a 0.50004997,0.50004997 0 0 1 0.0625,0 0.50004997,0.50004997 0 0 1 0.59375,0.5 l 0,0.0625 2,0 0,-0.0625 a 0.50004997,0.50004997 0 1 1 1,0 L 212,501 c 0,0.54535 -0.45465,1 -1,1 l -2,0 c -0.54535,0 -1,-0.45465 -1,-1 l 0,-0.0625 a 0.50004997,0.50004997 0 0 1 0.34375,-0.5 z' id='rect11668-7' style='color:#000000;fill:#bebebe;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate'/>
|
||||
</g>
|
||||
<g transform='translate(-202.0002,-490)' inkscape:groupmode='layer' id='layer12' inkscape:label='actions'/>
|
||||
<g transform='translate(-202.0002,-490)' inkscape:groupmode='layer' id='layer13' inkscape:label='places'/>
|
||||
<g transform='translate(-202.0002,-490)' inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes'/>
|
||||
<g transform='translate(-202.0002,-490)' inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline'/>
|
||||
<g transform='translate(-202.0002,-490)' inkscape:groupmode='layer' id='g4953' inkscape:label='categories' style='display:inline'/>
|
||||
</svg>
|
After Width: | Height: | Size: 4 KiB |
11
data/leak-suppress.txt
Normal file
11
data/leak-suppress.txt
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Use via environment variable LSAN_OPTIONS=suppressions=data/leak-suppress.txt
|
||||
# Ignore fontconfig reported leaks, its caches cause false positives.
|
||||
leak:libfontconfig.so.1
|
||||
leak:libEGL_mesa.so.0
|
||||
leak:libtracker-sparql-3.0.so.0
|
||||
leak:gtk_init
|
||||
leak:adw_init
|
||||
leak:xdg_mime_init
|
||||
leak:gtk_at_context_create
|
||||
leak:libim-ibus.so
|
||||
leak:gtk_label_set_mnemonic_widget
|
210
data/lineup-parameters
Executable file
210
data/lineup-parameters
Executable file
|
@ -0,0 +1,210 @@
|
|||
#!/usr/bin/env python3
|
||||
#
|
||||
# Copyright © 2019 Michael Catanzaro <mcatanzaro@gnome.org>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Based on original C lineup-parameters by Sébastien Wilmet <swilmet@gnome.org>
|
||||
# Rewritten in Python to allow simple execution from source directory.
|
||||
#
|
||||
# Usage: lineup-parameters [file]
|
||||
# If the file is not given, stdin is read.
|
||||
# The result is printed to stdout.
|
||||
#
|
||||
# The restrictions:
|
||||
# - The function name must be at column 0, followed by a space and an opening
|
||||
# parenthesis;
|
||||
# - One parameter per line;
|
||||
# - A parameter must follow certain rules (see the regex in the code), but it
|
||||
# doesn't accept all possibilities of the C language.
|
||||
# - The opening curly brace ("{") of the function must also be at column 0.
|
||||
#
|
||||
# If one restriction is missing, the function declaration is not modified.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# gboolean
|
||||
# frobnitz (Frobnitz *frobnitz,
|
||||
# gint magic_number,
|
||||
# GError **error)
|
||||
# {
|
||||
# ...
|
||||
# }
|
||||
#
|
||||
# Becomes:
|
||||
#
|
||||
# gboolean
|
||||
# frobnitz (Frobnitz *frobnitz,
|
||||
# gint magic_number,
|
||||
# GError **error)
|
||||
# {
|
||||
# ...
|
||||
# }
|
||||
#
|
||||
# TODO: support "..." vararg parameter
|
||||
|
||||
import argparse
|
||||
import re
|
||||
import sys
|
||||
|
||||
from typing import NamedTuple
|
||||
|
||||
# https://regexr.com/ is your friend.
|
||||
functionNameRegex = re.compile(r'^(\w+) ?\(')
|
||||
parameterRegex = re.compile(
|
||||
r'^\s*(?P<type>(const\s+)?\w+)'
|
||||
r'\s+(?P<stars>\**)'
|
||||
r'\s*(?P<name>\w+)'
|
||||
r'\s*(?P<end>,|\))'
|
||||
r'\s*$')
|
||||
openingCurlyBraceRegex = re.compile(r'^{\s*$')
|
||||
|
||||
|
||||
def matchFunctionName(line):
|
||||
match = functionNameRegex.match(line)
|
||||
if match:
|
||||
functionName = match.group(1)
|
||||
firstParamPosition = match.end(0)
|
||||
return (functionName, firstParamPosition)
|
||||
return (None, 0)
|
||||
|
||||
|
||||
class ParameterInfo(NamedTuple):
|
||||
paramType: str
|
||||
name: str
|
||||
numStars: int
|
||||
isLastParameter: bool
|
||||
|
||||
|
||||
def matchParameter(line):
|
||||
_, firstParamPosition = matchFunctionName(line)
|
||||
match = parameterRegex.match(line[firstParamPosition:])
|
||||
if match is None:
|
||||
return None
|
||||
paramType = match.group('type')
|
||||
assert(paramType is not None)
|
||||
name = match.group('name')
|
||||
assert(name is not None)
|
||||
stars = match.group('stars')
|
||||
numStars = len(stars) if stars is not None else 0
|
||||
end = match.group('end')
|
||||
isLastParameter = True if end is not None and end == ')' else False
|
||||
return ParameterInfo(paramType, name, numStars, isLastParameter)
|
||||
|
||||
|
||||
def matchOpeningCurlyBrace(line):
|
||||
return True if openingCurlyBraceRegex.match(line) is not None else False
|
||||
|
||||
|
||||
# Length returned is number of lines the declaration takes up
|
||||
def getFunctionDeclarationLength(remainingLines):
|
||||
for i in range(len(remainingLines)):
|
||||
currentLine = remainingLines[i]
|
||||
parameterInfo = matchParameter(currentLine)
|
||||
if parameterInfo is None:
|
||||
return 0
|
||||
if parameterInfo.isLastParameter:
|
||||
if i + 1 == len(remainingLines):
|
||||
return 0
|
||||
nextLine = remainingLines[i + 1]
|
||||
if not matchOpeningCurlyBrace(nextLine):
|
||||
return 0
|
||||
return i + 1
|
||||
return 0
|
||||
|
||||
|
||||
def getParameterInfos(remainingLines, length):
|
||||
parameterInfos = []
|
||||
for i in range(length):
|
||||
parameterInfos.append(matchParameter(remainingLines[i]))
|
||||
return parameterInfos
|
||||
|
||||
|
||||
def computeSpacing(parameterInfos):
|
||||
maxTypeLength = 0
|
||||
maxStarsLength = 0
|
||||
for parameterInfo in parameterInfos:
|
||||
maxTypeLength = max(maxTypeLength, len(parameterInfo.paramType))
|
||||
maxStarsLength = max(maxStarsLength, parameterInfo.numStars)
|
||||
return (maxTypeLength, maxStarsLength)
|
||||
|
||||
|
||||
def printParameter(parameterInfo, maxTypeLength, maxStarsLength, outfile):
|
||||
outfile.write(f'{parameterInfo.paramType:<{maxTypeLength + 1}}')
|
||||
paramNamePaddedWithStars = f'{parameterInfo.name:*>{parameterInfo.numStars + len(parameterInfo.name)}}'
|
||||
outfile.write(f'{paramNamePaddedWithStars:>{maxStarsLength + len(parameterInfo.name)}}')
|
||||
|
||||
|
||||
def printFunctionDeclaration(remainingLines, length, useTabs, outfile):
|
||||
functionName, _ = matchFunctionName(remainingLines[0])
|
||||
assert(functionName is not None)
|
||||
outfile.write(f'{functionName} (')
|
||||
numSpacesToParenthesis = len(functionName) + 2
|
||||
whitespace = ''
|
||||
if useTabs:
|
||||
tabs = ''.ljust(numSpacesToParenthesis // 8, '\t')
|
||||
spaces = ''.ljust(numSpacesToParenthesis % 8)
|
||||
whitespace = tabs + spaces
|
||||
else:
|
||||
whitespace = ''.ljust(numSpacesToParenthesis)
|
||||
parameterInfos = getParameterInfos(remainingLines, length)
|
||||
maxTypeLength, maxStarsLength = computeSpacing(parameterInfos)
|
||||
numParameters = len(parameterInfos)
|
||||
for i in range(numParameters):
|
||||
parameterInfo = parameterInfos[i]
|
||||
if i != 0:
|
||||
outfile.write(whitespace)
|
||||
printParameter(parameterInfo, maxTypeLength, maxStarsLength, outfile)
|
||||
if i + 1 != numParameters:
|
||||
outfile.write(',\n')
|
||||
outfile.write(')\n')
|
||||
|
||||
|
||||
def parseContents(infile, useTabs, outfile):
|
||||
lines = infile.readlines()
|
||||
i = 0
|
||||
while i < len(lines):
|
||||
line = lines[i]
|
||||
functionName, _ = matchFunctionName(line)
|
||||
if functionName is None:
|
||||
outfile.write(line)
|
||||
i += 1
|
||||
continue
|
||||
remainingLines = lines[i:]
|
||||
length = getFunctionDeclarationLength(remainingLines)
|
||||
if length == 0:
|
||||
outfile.write(line)
|
||||
i += 1
|
||||
continue
|
||||
printFunctionDeclaration(remainingLines, length, useTabs, outfile)
|
||||
i += length
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Line up parameters of C functions')
|
||||
parser.add_argument('infile', nargs='?',
|
||||
type=argparse.FileType('r'),
|
||||
default=sys.stdin,
|
||||
help='input C source file')
|
||||
parser.add_argument('-o', metavar='outfile', nargs='?',
|
||||
type=argparse.FileType('w'),
|
||||
default=sys.stdout,
|
||||
help='where to output modified file')
|
||||
parser.add_argument('--tabs', action='store_true',
|
||||
help='whether use tab characters in the output')
|
||||
args = parser.parse_args()
|
||||
parseContents(args.infile, args.tabs, args.o)
|
||||
args.infile.close()
|
||||
args.o.close()
|
156
data/meson.build
Normal file
156
data/meson.build
Normal file
|
@ -0,0 +1,156 @@
|
|||
icondir = join_paths('icons', 'hicolor', 'scalable', 'apps')
|
||||
install_data(
|
||||
join_paths(icondir, 'org.gnome.Nautilus' + profile + '.svg'),
|
||||
install_dir: join_paths(datadir, icondir),
|
||||
rename: '@0@.svg'.format(application_id)
|
||||
)
|
||||
|
||||
icondir = join_paths('icons', 'hicolor', 'symbolic', 'apps')
|
||||
|
||||
install_data(
|
||||
join_paths(icondir, 'org.gnome.Nautilus-symbolic.svg'),
|
||||
install_dir: join_paths(datadir, icondir),
|
||||
rename: '@0@-symbolic.svg'.format(application_id)
|
||||
)
|
||||
|
||||
po_dir = join_paths(meson.project_source_root(), 'po')
|
||||
|
||||
desktop_conf = configuration_data()
|
||||
|
||||
desktop_conf.set('icon', application_id)
|
||||
|
||||
desktop = i18n.merge_file(
|
||||
input: configure_file(
|
||||
input: files('org.gnome.Nautilus.desktop.in.in'),
|
||||
output: 'org.gnome.Nautilus.desktop.in',
|
||||
configuration: desktop_conf
|
||||
),
|
||||
output: '@0@.desktop'.format(application_id),
|
||||
install: true,
|
||||
install_dir: desktopdir,
|
||||
po_dir: po_dir,
|
||||
type: 'desktop'
|
||||
)
|
||||
|
||||
desktop_autorun_software = i18n.merge_file(
|
||||
input: 'nautilus-autorun-software.desktop.in',
|
||||
output: 'nautilus-autorun-software.desktop',
|
||||
install: true,
|
||||
install_dir: desktopdir,
|
||||
po_dir: po_dir,
|
||||
type: 'desktop'
|
||||
)
|
||||
|
||||
# get current date, used as build date for snapshots between releases
|
||||
today = 'unknown'
|
||||
date = find_program('date', required: false)
|
||||
# Only set dates for nightly builds to make release builds reproducible
|
||||
if date.found() and profile == 'Devel'
|
||||
r = run_command(date, '-I', check: true)
|
||||
today = r.stdout().strip()
|
||||
endif
|
||||
|
||||
appdata_conf = configuration_data()
|
||||
|
||||
appdata_conf.set('appid', application_id)
|
||||
appdata_conf.set('build-date', today)
|
||||
|
||||
release_version = meson.project_version()
|
||||
python = find_program('python3', required: false)
|
||||
if python.found()
|
||||
args = '''exec("import re\nprint(re.sub(r'^(.+)(\\.)([a-z]+.*)$', r'\\1~\\3', '@0@'))")'''
|
||||
args = args.format(meson.project_version())
|
||||
release_version = run_command(python, '-c', args).stdout().strip()
|
||||
endif
|
||||
appdata_conf.set('release-version', release_version)
|
||||
|
||||
appdata = i18n.merge_file(
|
||||
input: configure_file(
|
||||
input: files('org.gnome.Nautilus.metainfo.xml.in.in'),
|
||||
output: 'org.gnome.Nautilus.metainfo.xml.in',
|
||||
configuration: appdata_conf
|
||||
),
|
||||
output: '@0@.metainfo.xml'.format(application_id),
|
||||
install: true,
|
||||
install_dir: join_paths(datadir, 'metainfo'),
|
||||
po_dir: po_dir
|
||||
)
|
||||
|
||||
service_conf = configuration_data()
|
||||
service_conf.set('appid', application_id)
|
||||
service_conf.set('bindir', join_paths(prefix, bindir))
|
||||
|
||||
configure_file(
|
||||
input: 'org.gnome.Nautilus.service.in',
|
||||
output: '@0@.service'.format(application_id),
|
||||
configuration: service_conf,
|
||||
install_dir: servicedir
|
||||
)
|
||||
|
||||
configure_file(
|
||||
input: 'org.freedesktop.FileManager1.service.in',
|
||||
output: 'org.freedesktop.FileManager1.service',
|
||||
configuration: service_conf,
|
||||
install_dir: servicedir
|
||||
)
|
||||
|
||||
search_provider_conf = configuration_data()
|
||||
|
||||
search_provider_conf.set('appid', application_id)
|
||||
search_provider_conf.set('profile', profile)
|
||||
|
||||
configure_file(
|
||||
configuration: search_provider_conf,
|
||||
input: files('org.gnome.Nautilus.search-provider.ini.in'),
|
||||
install_dir: join_paths(datadir, 'gnome-shell', 'search-providers'),
|
||||
output: '@0@.search-provider.ini'.format(application_id)
|
||||
)
|
||||
|
||||
gnome.compile_schemas(
|
||||
build_by_default: true,
|
||||
depend_files: 'org.gnome.nautilus.gschema.xml'
|
||||
)
|
||||
|
||||
install_data(
|
||||
'org.gnome.nautilus.gschema.xml',
|
||||
install_dir: join_paths(datadir, 'glib-2.0', 'schemas')
|
||||
)
|
||||
|
||||
desktop_file_validate = find_program('desktop-file-validate', required: false)
|
||||
if desktop_file_validate.found()
|
||||
test(
|
||||
'validate-desktop',
|
||||
desktop_file_validate,
|
||||
args: [
|
||||
desktop.full_path()
|
||||
],
|
||||
depends: [
|
||||
desktop,
|
||||
]
|
||||
)
|
||||
test(
|
||||
'validate-desktop-autorun-software',
|
||||
desktop_file_validate,
|
||||
args: [
|
||||
desktop_autorun_software.full_path()
|
||||
],
|
||||
depends: [
|
||||
desktop_autorun_software,
|
||||
]
|
||||
)
|
||||
endif
|
||||
|
||||
appstreamcli = find_program('appstreamcli', required: false)
|
||||
if appstreamcli.found()
|
||||
test(
|
||||
'validate-appdata', appstreamcli,
|
||||
args: [
|
||||
'validate', '--no-net', appdata.full_path()
|
||||
],
|
||||
depends: [
|
||||
appdata,
|
||||
]
|
||||
)
|
||||
endif
|
||||
|
||||
subdir('ontology')
|
11
data/nautilus-autorun-software.desktop.in
Normal file
11
data/nautilus-autorun-software.desktop.in
Normal file
|
@ -0,0 +1,11 @@
|
|||
[Desktop Entry]
|
||||
Name=Run Software
|
||||
TryExec=nautilus-autorun-software
|
||||
Exec=nautilus-autorun-software %u
|
||||
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
|
||||
Icon=application-x-executable
|
||||
NoDisplay=true
|
||||
Terminal=false
|
||||
StartupNotify=true
|
||||
Type=Application
|
||||
MimeType=x-content/unix-software;
|
8
data/ontology/meson.build
Normal file
8
data/ontology/meson.build
Normal file
|
@ -0,0 +1,8 @@
|
|||
ontology_data = files(
|
||||
'nautilus.description',
|
||||
'nautilus.ontology',
|
||||
)
|
||||
|
||||
install_data(ontology_data,
|
||||
install_dir: join_paths(datadir, 'nautilus', 'ontology')
|
||||
)
|
9
data/ontology/nautilus.description
Normal file
9
data/ontology/nautilus.description
Normal file
|
@ -0,0 +1,9 @@
|
|||
@prefix dsc: <http://tracker.api.gnome.org/ontology/v3/dsc#> .
|
||||
|
||||
<virtual-ontology-uri:nautilus.ontology> a dsc:Ontology ;
|
||||
dsc:title "Nautilus ontology" ;
|
||||
dsc:description "Tracker database schema for Nautilus private data." ;
|
||||
|
||||
dsc:localPrefix "nautilus" ;
|
||||
dsc:baseUrl "https://gitlab.gnome.org/GNOME/nautilus#" ;
|
||||
dsc:relativePath "./nautilus.ontology" ;
|
20
data/ontology/nautilus.ontology
Normal file
20
data/ontology/nautilus.ontology
Normal file
|
@ -0,0 +1,20 @@
|
|||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
||||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
||||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
||||
@prefix nrl: <http://tracker.api.gnome.org/ontology/v3/nrl#> .
|
||||
@prefix nautilus: <https://gitlab.gnome.org/GNOME/nautilus#> .
|
||||
|
||||
nautilus: a nrl:Namespace, nrl:Ontology ;
|
||||
nrl:prefix "nautilus" ;
|
||||
nrl:lastModified "2020-05-01T10:00:00Z" .
|
||||
|
||||
nautilus:File a rdfs:Class ;
|
||||
rdfs:comment "Represents a file on disk by its URL. Equivalent to http://tracker.api.gnome.org/ontology/v3/nfo#FileDataObject" ;
|
||||
rdfs:subClassOf rdfs:Resource ;
|
||||
nrl:notify true .
|
||||
|
||||
nautilus:starred a rdf:Property ;
|
||||
rdfs:comment "Marks files that are starred in Nautilus." ;
|
||||
rdfs:domain nautilus:File ;
|
||||
rdfs:range xsd:boolean ;
|
||||
nrl:maxCardinality 1 .
|
3
data/org.freedesktop.FileManager1.service.in
Normal file
3
data/org.freedesktop.FileManager1.service.in
Normal file
|
@ -0,0 +1,3 @@
|
|||
[D-BUS Service]
|
||||
Name=org.freedesktop.FileManager1
|
||||
Exec=@bindir@/nautilus --gapplication-service
|
1595
data/org.gnome.Nautilus.Source.svg
Normal file
1595
data/org.gnome.Nautilus.Source.svg
Normal file
File diff suppressed because it is too large
Load diff
After Width: | Height: | Size: 70 KiB |
21
data/org.gnome.Nautilus.desktop.in.in
Normal file
21
data/org.gnome.Nautilus.desktop.in.in
Normal file
|
@ -0,0 +1,21 @@
|
|||
[Desktop Entry]
|
||||
Name=Files
|
||||
Comment=Access and organize files
|
||||
# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
|
||||
Keywords=folder;manager;explore;disk;filesystem;nautilus;
|
||||
Exec=nautilus --new-window %U
|
||||
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
|
||||
Icon=@icon@
|
||||
Terminal=false
|
||||
Type=Application
|
||||
DBusActivatable=true
|
||||
StartupNotify=true
|
||||
Categories=GNOME;GTK;Utility;Core;FileManager;
|
||||
MimeType=inode/directory;application/x-7z-compressed;application/x-7z-compressed-tar;application/x-bzip;application/x-bzip-compressed-tar;application/x-compress;application/x-compressed-tar;application/x-cpio;application/x-gzip;application/x-lha;application/x-lzip;application/x-lzip-compressed-tar;application/x-lzma;application/x-lzma-compressed-tar;application/x-tar;application/x-tarz;application/x-xar;application/x-xz;application/x-xz-compressed-tar;application/zip;application/gzip;application/bzip2;application/x-bzip2-compressed-tar;application/vnd.rar;application/zstd;application/x-zstd-compressed-tar
|
||||
X-GNOME-UsesNotifications=true
|
||||
Actions=new-window;
|
||||
X-Purism-FormFactor=Workstation;Mobile;
|
||||
|
||||
[Desktop Action new-window]
|
||||
Name=New Window
|
||||
Exec=nautilus --new-window
|
90
data/org.gnome.Nautilus.metainfo.xml.in.in
Normal file
90
data/org.gnome.Nautilus.metainfo.xml.in.in
Normal file
|
@ -0,0 +1,90 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop-application">
|
||||
<id>@appid@</id>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<name>Files</name>
|
||||
<summary>Access and organize files</summary>
|
||||
<description>
|
||||
<p>
|
||||
Files, also known as Nautilus, is the default file manager of the GNOME desktop.
|
||||
It provides a simple and integrated way of managing your files and browsing your file system.
|
||||
</p>
|
||||
<p>
|
||||
Nautilus supports all the basic functions of a file manager and more.
|
||||
It can search and manage your files and folders, both locally and on a network,
|
||||
read and write data to and from removable media, run scripts, and launch apps.
|
||||
It has three views: Icon Grid, Icon List, and Tree List.
|
||||
Its functions can be extended with plugins and scripts.
|
||||
</p>
|
||||
</description>
|
||||
<categories>
|
||||
<category>System</category>
|
||||
</categories>
|
||||
<url type="bugtracker">https://gitlab.gnome.org/GNOME/nautilus/issues</url>
|
||||
<url type="contact">https://discourse.gnome.org/tag/nautilus</url>
|
||||
<url type="contribute">https://welcome.gnome.org/app/Nautilus/</url>
|
||||
<url type="donation">https://www.gnome.org/donate/</url>
|
||||
<url type="help">https://help.gnome.org/users/gnome-help/stable/files.html</url>
|
||||
<url type="homepage">https://apps.gnome.org/Nautilus/</url>
|
||||
<url type="translate">https://l10n.gnome.org/module/nautilus/</url>
|
||||
<url type="vcs-browser">https://gitlab.gnome.org/GNOME/nautilus</url>
|
||||
<launchable type="desktop-id">@appid@.desktop</launchable>
|
||||
<!-- Copy-pastable release tag templates.
|
||||
# For stable releases:
|
||||
<release version="@release-version@" type="stable" date="YYYY-MM-DD"/>
|
||||
|
||||
# For Unstable (alpha, beta, rc) releases:
|
||||
<release version="@release-version@" type="development" date="YYYY-MM-DD"/>
|
||||
|
||||
# Between releases (at post-release version bump):
|
||||
<release version="@release-version@" date="@build-date@"/>
|
||||
-->
|
||||
<releases>
|
||||
<release version="@release-version@" type="stable" date="2025-05-24"/>
|
||||
</releases>
|
||||
<project_group>GNOME</project_group>
|
||||
<project_license>GPL-3.0-or-later</project_license>
|
||||
<developer id="org.gnome">
|
||||
<name>The GNOME Project</name>
|
||||
</developer>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>https://static.gnome.org/appdata/gnome-48/files/grid.png</image>
|
||||
<caption>Grid View</caption>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image>https://static.gnome.org/appdata/gnome-48/files/list.png</image>
|
||||
<caption>List View</caption>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image>https://static.gnome.org/appdata/gnome-48/files/search.png</image>
|
||||
<caption>Search</caption>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image>https://static.gnome.org/appdata/gnome-48/files/thumbnails.png</image>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<branding>
|
||||
<color type="primary" scheme_preference="light">#99c1f1</color>
|
||||
<color type="primary" scheme_preference="dark">#1a5fb4</color>
|
||||
</branding>
|
||||
<translation type="gettext">nautilus</translation>
|
||||
<kudos>
|
||||
<kudo>HiDpiIcon</kudo>
|
||||
<kudo>ModernToolkit</kudo>
|
||||
<kudo>Notifications</kudo>
|
||||
<kudo>SearchProvider</kudo>
|
||||
</kudos>
|
||||
<recommends>
|
||||
<control>keyboard</control>
|
||||
<control>pointing</control>
|
||||
</recommends>
|
||||
<supports>
|
||||
<control>touch</control>
|
||||
<control>tablet</control>
|
||||
</supports>
|
||||
<requires>
|
||||
<display_length>360</display_length>
|
||||
</requires>
|
||||
<content_rating type="oars-1.1" />
|
||||
</component>
|
5
data/org.gnome.Nautilus.search-provider.ini.in
Normal file
5
data/org.gnome.Nautilus.search-provider.ini.in
Normal file
|
@ -0,0 +1,5 @@
|
|||
[Shell Search Provider]
|
||||
DesktopId=@appid@.desktop
|
||||
BusName=@appid@
|
||||
ObjectPath=/org/gnome/Nautilus@profile@/SearchProvider
|
||||
Version=2
|
3
data/org.gnome.Nautilus.service.in
Normal file
3
data/org.gnome.Nautilus.service.in
Normal file
|
@ -0,0 +1,3 @@
|
|||
[D-BUS Service]
|
||||
Name=@appid@
|
||||
Exec=@bindir@/nautilus --gapplication-service
|
264
data/org.gnome.nautilus.gschema.xml
Normal file
264
data/org.gnome.nautilus.gschema.xml
Normal file
|
@ -0,0 +1,264 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<schemalist>
|
||||
<enum id="org.gnome.nautilus.SpeedTradeoff">
|
||||
<value value="0" nick="always"/>
|
||||
<value value="1" nick="local-only"/>
|
||||
<value value="2" nick="never"/>
|
||||
</enum>
|
||||
|
||||
<enum id="org.gnome.nautilus.ClickPolicy">
|
||||
<value value="0" nick="single"/>
|
||||
<value value="1" nick="double"/>
|
||||
</enum>
|
||||
|
||||
<enum id="org.gnome.nautilus.DateTimeFormat">
|
||||
<value value="0" nick="simple"/>
|
||||
<value value="1" nick="detailed"/>
|
||||
</enum>
|
||||
|
||||
<enum id="org.gnome.nautilus.ActivationChoice">
|
||||
<value value="0" nick="launch"/>
|
||||
<value value="1" nick="display"/>
|
||||
<value value="2" nick="ask"/>
|
||||
</enum>
|
||||
|
||||
<enum id="org.gnome.nautilus.FolderView">
|
||||
<value value="1" nick="list-view"/>
|
||||
<value value="2" nick="icon-view"/>
|
||||
</enum>
|
||||
|
||||
<enum id="org.gnome.nautilus.SortOrder">
|
||||
<!--
|
||||
When touching this, make sure to keep the values in sync with the
|
||||
#NautilusFileSortType enum in the `src/nautilus-file.h` code header file.
|
||||
-->
|
||||
<value value="0" nick="name"/>
|
||||
<value value="1" nick="size"/>
|
||||
<value value="2" nick="type"/>
|
||||
<value value="3" nick="mtime"/>
|
||||
<value value="4" nick="atime"/>
|
||||
<value value="5" nick="btime"/>
|
||||
<value value="6" nick="starred"/>
|
||||
</enum>
|
||||
|
||||
<enum id="org.gnome.nautilus.GridZoomLevel">
|
||||
<value value="0" nick="small"/>
|
||||
<value value="1" nick="small-plus"/>
|
||||
<value value="2" nick="medium"/>
|
||||
<value value="3" nick="large"/>
|
||||
<value value="4" nick="extra-large"/>
|
||||
</enum>
|
||||
|
||||
<enum id="org.gnome.nautilus.ListZoomLevel">
|
||||
<value value="0" nick="small"/>
|
||||
<value value="1" nick="medium"/>
|
||||
<value value="2" nick="large"/>
|
||||
</enum>
|
||||
|
||||
<enum id="org.gnome.nautilus.SearchFilterTimeType">
|
||||
<value value="0" nick="last_modified"/>
|
||||
<value value="1" nick="last_used"/>
|
||||
<value value="2" nick="created"/>
|
||||
</enum>
|
||||
|
||||
<enum id="org.gnome.nautilus.CompressionFormat">
|
||||
<value value="0" nick="zip"/>
|
||||
<value value="1" nick="tar.xz"/>
|
||||
<value value="2" nick="7z"/>
|
||||
<value value="3" nick="encrypted_zip"/>
|
||||
</enum>
|
||||
|
||||
<schema path="/org/gnome/nautilus/" id="org.gnome.nautilus" gettext-domain="nautilus">
|
||||
<child schema="org.gnome.nautilus.preferences" name="preferences"/>
|
||||
<child schema="org.gnome.nautilus.compression" name="compression"/>
|
||||
<child schema="org.gnome.nautilus.icon-view" name="icon-view"/>
|
||||
<child schema="org.gnome.nautilus.list-view" name="list-view"/>
|
||||
<child schema="org.gnome.nautilus.window-state" name="window-state"/>
|
||||
</schema>
|
||||
|
||||
<schema path="/org/gnome/nautilus/preferences/" id="org.gnome.nautilus.preferences" gettext-domain="nautilus">
|
||||
<key type="b" name="always-use-location-entry">
|
||||
<default>false</default>
|
||||
<summary>Always use the location entry, instead of the pathbar</summary>
|
||||
<description>If set to true, Files will always use a textual input entry for the location toolbar, instead of the pathbar.</description>
|
||||
</key>
|
||||
<key name="recursive-search" enum="org.gnome.nautilus.SpeedTradeoff">
|
||||
<default>'local-only'</default>
|
||||
<summary>Where to perform recursive search</summary>
|
||||
<description>Locations in which Files should search subfolders. Available values are “local-only”, “always”, “never”.</description>
|
||||
</key>
|
||||
<key name="search-filter-time-type" enum="org.gnome.nautilus.SearchFilterTimeType">
|
||||
<default>'last_modified'</default>
|
||||
<summary>Filter the search dates using either last used or last modified</summary>
|
||||
<description>Filter the search dates using either last used or last modified.</description>
|
||||
</key>
|
||||
<key type="b" name="show-delete-permanently">
|
||||
<default>false</default>
|
||||
<summary>Whether to show a context menu item to delete permanently</summary>
|
||||
<description>If set to true, Files will show a delete permanently context menu item to bypass the Trash.</description>
|
||||
</key>
|
||||
<key type="b" name="show-create-link">
|
||||
<default>false</default>
|
||||
<summary>Whether to show context menu items to create links from copied or selected files</summary>
|
||||
<description>If set to true, Files will show context menu items to create links from the copied or selected files.</description>
|
||||
</key>
|
||||
<key name="show-directory-item-counts" enum="org.gnome.nautilus.SpeedTradeoff">
|
||||
<aliases><alias value='local_only' target='local-only'/></aliases>
|
||||
<default>'local-only'</default>
|
||||
<summary>When to show number of items in a folder</summary>
|
||||
<description>Speed tradeoff for when to show the number of items in a folder. If set to “always” then always show item counts, even if the folder is on a remote server. If set to “local-only” then only show counts for local file systems. If set to “never” then never bother to compute item counts.</description>
|
||||
</key>
|
||||
<key name="click-policy" enum="org.gnome.nautilus.ClickPolicy">
|
||||
<default>'double'</default>
|
||||
<summary>Type of click used to launch/open files</summary>
|
||||
<description>Possible values are “single” to launch files on a single click, or “double” to launch them on a double click.</description>
|
||||
</key>
|
||||
<key type="b" name="install-mime-activation">
|
||||
<default>true</default>
|
||||
<summary>Show the package installer for unknown MIME types</summary>
|
||||
<description>Whether to show the user a package installer dialog in case an unknown MIME type is opened, in order to search for an app to handle it.</description>
|
||||
</key>
|
||||
<key type="b" name="mouse-use-extra-buttons">
|
||||
<default>true</default>
|
||||
<summary>Use extra mouse button events in Files</summary>
|
||||
<description>For users with mice that have “Forward” and “Back” buttons, this key will determine if any action is taken inside of Files when either is pressed.</description>
|
||||
</key>
|
||||
<key type="u" name="mouse-forward-button">
|
||||
<default>9</default>
|
||||
<summary>Mouse button to activate the “Forward” command in browser window</summary>
|
||||
<description>For users with mice that have buttons for “Forward” and “Back”, this key will set which button activates the “Forward” command in a browser window. Possible values range between 6 and 14.</description>
|
||||
</key>
|
||||
<key type="u" name="mouse-back-button">
|
||||
<default>8</default>
|
||||
<summary>Mouse button to activate the “Back” command in browser window</summary>
|
||||
<description>For users with mice that have buttons for “Forward” and “Back”, this key will set which button activates the “Back” command in a browser window. Possible values range between 6 and 14.</description>
|
||||
</key>
|
||||
<key name="show-image-thumbnails" enum="org.gnome.nautilus.SpeedTradeoff">
|
||||
<aliases><alias value='local_only' target='local-only'/></aliases>
|
||||
<default>'local-only'</default>
|
||||
<summary>When to show thumbnails of files</summary>
|
||||
<description>Speed trade-off for when to show a file as a thumbnail. If set to “always” then always thumbnail, even if the folder is on a remote server. If set to “local-only” then only show thumbnails for local file systems. If set to “never” then never bother to thumbnail files, just use a generic icon. Despite what the name may suggest, this applies to any previewable file type.</description>
|
||||
</key>
|
||||
<key type="t" name="thumbnail-limit">
|
||||
<default>50</default>
|
||||
<summary>Maximum image size for thumbnailing</summary>
|
||||
<description>Images over this size (in megabytes) won’t be thumbnailed. The purpose of this setting is to avoid thumbnailing large images that may take a long time to load or use lots of memory.</description>
|
||||
</key>
|
||||
<key name="default-sort-order" enum="org.gnome.nautilus.SortOrder">
|
||||
<aliases>
|
||||
<alias value='modification_date' target='mtime'/>
|
||||
</aliases>
|
||||
<default>'name'</default>
|
||||
<summary>Default sort order</summary>
|
||||
<description>The default sort-order for items in the icon view. Possible values are “name”, “size”, “type”, “mtime”, “atime” and “starred”.</description>
|
||||
</key>
|
||||
<key type="b" name="default-sort-in-reverse-order">
|
||||
<default>false</default>
|
||||
<summary>Reverse sort order in new windows</summary>
|
||||
<description>If true, files in new windows will be sorted in reverse order. I.e., if sorted by name, then instead of sorting the files from “a” to “z”, they will be sorted from “z” to “a”; if sorted by size, instead of being incrementally they will be sorted decrementally.</description>
|
||||
</key>
|
||||
<key name="default-folder-viewer" enum="org.gnome.nautilus.FolderView">
|
||||
<aliases>
|
||||
<alias value='icon_view' target='icon-view'/>
|
||||
<alias value='compact_view' target='icon-view'/>
|
||||
<alias value='compact-view' target='icon-view'/>
|
||||
<alias value='list_view' target='list-view'/>
|
||||
</aliases>
|
||||
<default>'icon-view'</default>
|
||||
<summary>Default folder viewer</summary>
|
||||
<description>When a folder is visited this viewer is used. Possible values are “list-view”, and “icon-view”.</description>
|
||||
</key>
|
||||
<key type="b" name="show-hidden-files">
|
||||
<default>false</default>
|
||||
<summary>Whether to show hidden files</summary>
|
||||
<description>This key is deprecated and ignored. The “show-hidden” key from “org.gtk.Settings.FileChooser” is now used instead.</description>
|
||||
</key>
|
||||
<key type="b" name="migrated-gtk-settings">
|
||||
<default>false</default>
|
||||
<summary>Whether GTK 4 settings migration happened</summary>
|
||||
<description>Whether settings shared with GtkFileChooser have been migrated from their GTK 3 keys to the GTK 4 ones.</description>
|
||||
</key>
|
||||
<key type="b" name="open-folder-on-dnd-hover">
|
||||
<default>true</default>
|
||||
<summary>Whether to open the hovered folder after a timeout when drag and drop operation</summary>
|
||||
<description>If this is set to true, when performing a drag and drop operation the hovered folder will open automatically after a timeout.</description>
|
||||
</key>
|
||||
<key type="b" name="fts-enabled">
|
||||
<default>true</default>
|
||||
<summary>Whether to have full text search enabled by default when opening a new window/tab</summary>
|
||||
<description>If set to true, Files will also match the file contents besides the name. This toggles the default active state, which can still be overridden in the search popover</description>
|
||||
</key>
|
||||
<key name="date-time-format" enum="org.gnome.nautilus.DateTimeFormat">
|
||||
<default>'simple'</default>
|
||||
<summary>How to display file timestamps in the views</summary>
|
||||
<description>If set to 'simple', Files will show Today and Yesterday with time, otherwise the exact date without time. If set to 'detailed', it will always show the exact date and time.</description>
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema path="/org/gnome/nautilus/compression/" id="org.gnome.nautilus.compression" gettext-domain="nautilus">
|
||||
<key name="default-compression-format" enum="org.gnome.nautilus.CompressionFormat">
|
||||
<default>'zip'</default>
|
||||
<summary>Default format for compressing files</summary>
|
||||
<description>The format that will be selected when compressing files.</description>
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema path="/org/gnome/nautilus/icon-view/" id="org.gnome.nautilus.icon-view" gettext-domain="nautilus">
|
||||
<key type="as" name="captions">
|
||||
<default>[ 'none', 'none', 'none' ]</default>
|
||||
<summary>List of possible captions on icons</summary>
|
||||
<description>A list of captions below an icon in the icon view. The actual number of captions shown depends on the zoom level. Some possible values are: “size”, “type”, “date_modified”, “owner”, “group”, “permissions”, and “mime_type”.</description>
|
||||
</key>
|
||||
<key name="default-zoom-level" enum="org.gnome.nautilus.GridZoomLevel">
|
||||
<aliases>
|
||||
<alias value='standard' target='small-plus'/>
|
||||
<alias value='larger' target='extra-large'/>
|
||||
<alias value='largest' target='extra-large'/>
|
||||
</aliases>
|
||||
<default>'medium'</default>
|
||||
<summary>Default icon view zoom level</summary>
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema path="/org/gnome/nautilus/list-view/" id="org.gnome.nautilus.list-view" gettext-domain="nautilus">
|
||||
<key name="default-zoom-level" enum="org.gnome.nautilus.ListZoomLevel">
|
||||
<aliases>
|
||||
<alias value='standard' target='medium'/>
|
||||
<alias value='larger' target='large'/>
|
||||
</aliases>
|
||||
<default>'medium'</default>
|
||||
<summary>Default list view zoom level</summary>
|
||||
</key>
|
||||
<key type="as" name="default-visible-columns">
|
||||
<default>[ 'name', 'size', 'date_modified' ]</default>
|
||||
<summary>Columns visible in list view</summary>
|
||||
</key>
|
||||
<key type="as" name="default-column-order">
|
||||
<default>[ 'name', 'size', 'type', 'owner', 'group', 'permissions', 'mime_type', 'where', 'date_modified', 'date_modified_with_time', 'date_accessed', 'date_created', 'recency', 'starred' ]</default>
|
||||
<summary>Column order in list view</summary>
|
||||
</key>
|
||||
<key type="b" name="use-tree-view">
|
||||
<default>false</default>
|
||||
<summary>Use tree view</summary>
|
||||
<description>Whether a tree should be used for list view navigation instead of a flat list.</description>
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema path="/org/gnome/nautilus/window-state/" id="org.gnome.nautilus.window-state" gettext-domain="nautilus">
|
||||
<key type="(ii)" name="initial-size">
|
||||
<default>(890, 550)</default>
|
||||
<summary>Initial size of the window</summary>
|
||||
<description>A tuple containing the initial width and height of the app window.</description>
|
||||
</key>
|
||||
<key type="b" name="maximized">
|
||||
<default>false</default>
|
||||
<summary>Whether the navigation window should be maximized</summary>
|
||||
<description>Whether the navigation window should be maximized by default.</description>
|
||||
</key>
|
||||
<key type="(ii)" name="initial-size-file-chooser">
|
||||
<default>(890,550)</default>
|
||||
<summary>Initial size of the window</summary>
|
||||
<description>A tuple containing the initial width and height of the app window.</description>
|
||||
</key>
|
||||
</schema>
|
||||
</schemalist>
|
44
data/shell-search-provider-dbus-interfaces.xml
Normal file
44
data/shell-search-provider-dbus-interfaces.xml
Normal file
|
@ -0,0 +1,44 @@
|
|||
<!DOCTYPE node PUBLIC
|
||||
"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||
|
||||
<!--
|
||||
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/>.
|
||||
-->
|
||||
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
|
||||
<interface name='org.gnome.Shell.SearchProvider2'>
|
||||
<method name='GetInitialResultSet'>
|
||||
<arg type='as' name='Terms' direction='in' />
|
||||
<arg type='as' name='Results' direction='out' />
|
||||
</method>
|
||||
<method name = 'GetSubsearchResultSet'>
|
||||
<arg type='as' name='PreviousResults' direction='in' />
|
||||
<arg type='as' name='Terms' direction='in' />
|
||||
<arg type='as' name='Results' direction='out' />
|
||||
</method>
|
||||
<method name = 'GetResultMetas'>
|
||||
<arg type='as' name='Results' direction='in' />
|
||||
<arg type='aa{sv}' name='Metas' direction='out' />
|
||||
</method>
|
||||
<method name = 'ActivateResult'>
|
||||
<arg type='s' name='Result' direction='in' />
|
||||
<arg type='as' name='Terms' direction='in' />
|
||||
<arg type='u' name='Timestamp' direction='in' />
|
||||
</method>
|
||||
<method name = 'LaunchSearch'>
|
||||
<arg type='as' name='Terms' direction='in' />
|
||||
<arg type='u' name='Timestamp' direction='in' />
|
||||
</method>
|
||||
</interface>
|
||||
</node>
|
4
docs/meson.build
Normal file
4
docs/meson.build
Normal file
|
@ -0,0 +1,4 @@
|
|||
install_man('nautilus.1')
|
||||
install_man('nautilus-autorun-software.1')
|
||||
|
||||
subdir('reference')
|
26
docs/nautilus-autorun-software.1
Normal file
26
docs/nautilus-autorun-software.1
Normal file
|
@ -0,0 +1,26 @@
|
|||
.TH nautilus-autorun-software 1 "3 July 2019"
|
||||
|
||||
.SH NAME
|
||||
Run Software \- helper tool
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B nautilus-autorun-software
|
||||
.RI "" "mount-uri"
|
||||
.br
|
||||
|
||||
.SH DESCRIPTION
|
||||
.B nautilus-autorun-software
|
||||
is a helper tool for the GNOME desktop to start software from media with
|
||||
Autostart files.
|
||||
.br
|
||||
|
||||
It is the default "x-content/unix-software" handler for the GNOME desktop.
|
||||
.br
|
||||
|
||||
.SH SEE ALSO
|
||||
Autostart files are described at
|
||||
https://specifications.freedesktop.org/autostart-spec/autostart-spec-latest.html
|
||||
|
||||
.SH BUGS
|
||||
Bug reports can be found and filed at
|
||||
https://gitlab.gnome.org/GNOME/nautilus/issues
|
67
docs/nautilus.1
Normal file
67
docs/nautilus.1
Normal file
|
@ -0,0 +1,67 @@
|
|||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" First parameter, NAME, should be all caps
|
||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||
.\" other parameters are allowed: see man(7), man(1)
|
||||
.TH Nautilus 1 "16 January 2024"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.\" Some roff macros, for reference:
|
||||
.\" .nh disable hyphenation
|
||||
.\" .hy enable hyphenation
|
||||
.\" .ad l left justify
|
||||
.\" .ad b justify to both left and right margins
|
||||
.\" .nf disable filling
|
||||
.\" .fi enable filling
|
||||
.\" .br insert line break
|
||||
.\" .sp <n> insert n+1 empty lines
|
||||
.\" for manpage-specific macros, see man(7)
|
||||
.SH NAME
|
||||
nautilus \- a file manager for GNOME
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B nautilus
|
||||
.RI [ options ] " URIs" ...
|
||||
.br
|
||||
|
||||
.SH DESCRIPTION
|
||||
.B nautilus
|
||||
is a file manager, designed for the GNOME desktop.
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-\-version
|
||||
Show the version of the program.
|
||||
|
||||
.TP
|
||||
.BR \-w ", " \-\-new-window
|
||||
Always open a new window for browsing specified URIs.
|
||||
|
||||
.TP
|
||||
.BR \-q ", " \-\-quit
|
||||
Quit Nautilus.
|
||||
|
||||
.TP
|
||||
.BR \-s ", " \-\-select
|
||||
Select specified URI in parent folder.
|
||||
|
||||
.TP
|
||||
.BR \-h ", " \-\-help
|
||||
Show a summary of options.
|
||||
|
||||
.TP
|
||||
Other standard GNOME options not listed here are also supported.
|
||||
|
||||
.SH SEE ALSO
|
||||
The documentation may be accessed by pressing \fIF1\fR in the application or
|
||||
via the application menu.
|
||||
|
||||
For further information, visit the website
|
||||
https://apps.gnome.org/Nautilus
|
||||
|
||||
.SH BUGS
|
||||
Bug reports can be found and filed at
|
||||
https://gitlab.gnome.org/GNOME/nautilus/issues
|
||||
|
||||
.\"This manual page was written by Takuo KITAME <kitame@debian.org> and Dafydd
|
||||
.\"Harries <daf@muse.19inch.net> for the Debian GNU/Linux system (but may be used
|
||||
.\"by others).
|
253
docs/reference/logo.svg
Normal file
253
docs/reference/logo.svg
Normal file
|
@ -0,0 +1,253 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 128 128"
|
||||
style="display:inline;enable-background:new"
|
||||
version="1.0"
|
||||
id="svg11300"
|
||||
height="128"
|
||||
width="128">
|
||||
<title
|
||||
id="title4162">Adwaita Icon Template</title>
|
||||
<defs
|
||||
id="defs3">
|
||||
<linearGradient
|
||||
id="linearGradient1245">
|
||||
<stop
|
||||
id="stop1241"
|
||||
offset="0"
|
||||
style="stop-color:#9a9996;stop-opacity:1" />
|
||||
<stop
|
||||
id="stop1243"
|
||||
offset="1"
|
||||
style="stop-color:#c0bfbc;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient1697">
|
||||
<stop
|
||||
style="stop-color:#deddda;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop1685" />
|
||||
<stop
|
||||
id="stop1687"
|
||||
offset="0.04545455"
|
||||
style="stop-color:#eeeeec;stop-opacity:1" />
|
||||
<stop
|
||||
style="stop-color:#deddda;stop-opacity:1"
|
||||
offset="0.09090909"
|
||||
id="stop1689" />
|
||||
<stop
|
||||
id="stop1691"
|
||||
offset="0.90909094"
|
||||
style="stop-color:#deddda;stop-opacity:1" />
|
||||
<stop
|
||||
style="stop-color:#eeeeec;stop-opacity:1"
|
||||
offset="0.95454544"
|
||||
id="stop1693" />
|
||||
<stop
|
||||
style="stop-color:#c0bfbc;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop1695" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
gradientUnits="userSpaceOnUse"
|
||||
y2="238"
|
||||
x2="108"
|
||||
y1="238"
|
||||
x1="20"
|
||||
id="linearGradient1049"
|
||||
xlink:href="#linearGradient1697" />
|
||||
<linearGradient
|
||||
y2="238"
|
||||
x2="74"
|
||||
y1="238"
|
||||
x1="50"
|
||||
gradientTransform="translate(2,-22)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient1185"
|
||||
xlink:href="#linearGradient1697" />
|
||||
<linearGradient
|
||||
y2="200"
|
||||
x2="65"
|
||||
y1="204"
|
||||
x1="65"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient1348"
|
||||
xlink:href="#linearGradient1245" />
|
||||
</defs>
|
||||
<metadata
|
||||
id="metadata4">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>GNOME Design Team</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<dc:source />
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
|
||||
<dc:title>Adwaita Icon Template</dc:title>
|
||||
<dc:subject>
|
||||
<rdf:Bag />
|
||||
</dc:subject>
|
||||
<dc:date />
|
||||
<dc:rights>
|
||||
<cc:Agent>
|
||||
<dc:title />
|
||||
</cc:Agent>
|
||||
</dc:rights>
|
||||
<dc:publisher>
|
||||
<cc:Agent>
|
||||
<dc:title />
|
||||
</cc:Agent>
|
||||
</dc:publisher>
|
||||
<dc:identifier />
|
||||
<dc:relation />
|
||||
<dc:language />
|
||||
<dc:coverage />
|
||||
<dc:description />
|
||||
<dc:contributor>
|
||||
<cc:Agent>
|
||||
<dc:title />
|
||||
</cc:Agent>
|
||||
</dc:contributor>
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
transform="translate(0,-172)"
|
||||
style="display:inline"
|
||||
id="layer1">
|
||||
<g
|
||||
style="display:inline"
|
||||
id="layer9">
|
||||
<g
|
||||
transform="matrix(0.25,0,0,-0.25,-6,217)"
|
||||
id="g15447-1" />
|
||||
<g
|
||||
id="g1207">
|
||||
<rect
|
||||
ry="8.017911"
|
||||
rx="8.7725897"
|
||||
y="234"
|
||||
x="20"
|
||||
height="58"
|
||||
width="88"
|
||||
id="rect1041"
|
||||
style="opacity:1;vector-effect:none;fill:url(#linearGradient1049);fill-opacity:1;stroke:none;stroke-width:0.01184966px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal" />
|
||||
<rect
|
||||
style="opacity:1;vector-effect:none;fill:#f6f5f4;fill-opacity:1;stroke:none;stroke-width:0.01184966px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
|
||||
id="rect15435-6"
|
||||
width="88"
|
||||
height="108"
|
||||
x="20"
|
||||
y="180"
|
||||
rx="8.7725897"
|
||||
ry="8.017911" />
|
||||
<rect
|
||||
ry="4.0021734"
|
||||
rx="4"
|
||||
y="186"
|
||||
x="24"
|
||||
height="98"
|
||||
width="80"
|
||||
id="rect1167"
|
||||
style="display:inline;opacity:1;vector-effect:none;fill:#1a5fb4;fill-opacity:1;stroke:none;stroke-width:0.0119126px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal;enable-background:new" />
|
||||
<rect
|
||||
style="display:inline;opacity:1;vector-effect:none;fill:#3584e4;fill-opacity:1;stroke:none;stroke-width:0.0119126px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal;enable-background:new"
|
||||
id="rect15441-8"
|
||||
width="80"
|
||||
height="98"
|
||||
x="24"
|
||||
y="184"
|
||||
rx="4"
|
||||
ry="4.0021734" />
|
||||
<rect
|
||||
style="display:inline;opacity:1;vector-effect:none;fill:#1c71d8;fill-opacity:1;stroke:none;stroke-width:0.01190936px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal;enable-background:new"
|
||||
id="rect15443-6"
|
||||
width="80"
|
||||
height="2"
|
||||
x="24"
|
||||
y="216"
|
||||
rx="0"
|
||||
ry="0" />
|
||||
<rect
|
||||
style="display:inline;opacity:1;vector-effect:none;fill:#1c71d8;fill-opacity:1;stroke:none;stroke-width:0.01190936px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal;enable-background:new"
|
||||
id="rect15461-2"
|
||||
width="80"
|
||||
height="2"
|
||||
x="24"
|
||||
y="248"
|
||||
rx="0"
|
||||
ry="0" />
|
||||
<g
|
||||
id="g1088">
|
||||
<path
|
||||
id="path26035"
|
||||
d="m 55,196 h 18 c 1.662,0 3,1 3,3 v 5 H 72.03125 L 72,200 H 56 l 0.03125,4 H 52 v -5 c 0,-1.662 1.338,-3 3,-3 z"
|
||||
style="opacity:1;vector-effect:none;fill:url(#linearGradient1185);fill-opacity:1;stroke:none;stroke-width:0.01184966px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal" />
|
||||
<rect
|
||||
style="opacity:0.1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="rect1059"
|
||||
width="24"
|
||||
height="4"
|
||||
x="52"
|
||||
y="202"
|
||||
ry="1.5" />
|
||||
<path
|
||||
style="opacity:1;fill:url(#linearGradient1348);fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
d="m 55,200 c -1.662,0 -3,1.338 -3,3 v 1 h 4 v -2 h 16 v 2 h 4 v -1 c 0,-1.662 -1.338,-3 -3,-3 z"
|
||||
id="rect1061" />
|
||||
<rect
|
||||
y="202"
|
||||
x="56"
|
||||
height="2"
|
||||
width="16"
|
||||
id="rect1189"
|
||||
style="opacity:0.1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||
</g>
|
||||
<use
|
||||
x="0"
|
||||
y="0"
|
||||
xlink:href="#g1088"
|
||||
id="use1090"
|
||||
transform="translate(0,32)"
|
||||
width="100%"
|
||||
height="100%" />
|
||||
<use
|
||||
height="100%"
|
||||
width="100%"
|
||||
transform="translate(0,64)"
|
||||
id="use1092"
|
||||
xlink:href="#g1088"
|
||||
y="0"
|
||||
x="0" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 9.2 KiB |
31
docs/reference/meson.build
Normal file
31
docs/reference/meson.build
Normal file
|
@ -0,0 +1,31 @@
|
|||
toml_data = configuration_data()
|
||||
toml_data.set('VERSION', meson.project_version())
|
||||
|
||||
nautilus_toml = configure_file(
|
||||
input: 'nautilus.toml.in',
|
||||
output: 'nautilus.toml',
|
||||
configuration: toml_data,
|
||||
)
|
||||
|
||||
custom_target(
|
||||
'nautilus-doc',
|
||||
input: [
|
||||
nautilus_toml,
|
||||
nautilus_extension_gir[0],
|
||||
],
|
||||
output: 'nautilus',
|
||||
command: [
|
||||
gi_docgen,
|
||||
'generate',
|
||||
'--quiet',
|
||||
'--add-include-path=@0@'.format(meson.project_source_root() / 'libnautilus-extension'),
|
||||
'--config=@INPUT0@',
|
||||
'--output-dir=@OUTPUT@',
|
||||
'--no-namespace-dir',
|
||||
'--content-dir=@0@'.format(meson.current_source_dir()),
|
||||
'@INPUT1@',
|
||||
],
|
||||
build_by_default: true,
|
||||
install: true,
|
||||
install_dir: docdir,
|
||||
)
|
46
docs/reference/nautilus.toml.in
Normal file
46
docs/reference/nautilus.toml.in
Normal file
|
@ -0,0 +1,46 @@
|
|||
[library]
|
||||
version = "@VERSION@"
|
||||
description = "Nautilus Extension API"
|
||||
authors = "The GNOME Project"
|
||||
license = "GPL-3.0-or-later"
|
||||
browse_url = "https://gitlab.gnome.org/GNOME/nautilus/"
|
||||
repository_url = "https://gitlab.gnome.org/GNOME/nautilus.git"
|
||||
website_url = "https://gnome.pages.gitlab.gnome.org/nautilus/"
|
||||
logo_url = "logo.svg"
|
||||
devhelp = true
|
||||
search_index = true
|
||||
|
||||
dependencies = ["GLib – 2.0", "Gio-2.0", "GObject-2.0"]
|
||||
|
||||
[dependencies."GLib-2.0"]
|
||||
name = "GLib"
|
||||
description = "The base type system library"
|
||||
docs_url = "https://docs.gtk.org/gobject/"
|
||||
|
||||
[dependencies."Gio-2.0"]
|
||||
name = "Gio"
|
||||
description = "GObject Interfaces and Objects, Networking, IPC, and I/O"
|
||||
docs_url = "https://docs.gtk.org/gio/"
|
||||
|
||||
[dependencies."GObject-2.0"]
|
||||
name = "GObject"
|
||||
description = "The base type system library"
|
||||
docs_url = "https://docs.gtk.org/gobject/"
|
||||
|
||||
[theme]
|
||||
name = "basic"
|
||||
show_index_summary = true
|
||||
show_class_hierarchy = true
|
||||
|
||||
[source-location]
|
||||
# The base URL for the web UI
|
||||
base_url = "https://gitlab.gnome.org/GNOME/nautilus/-/blob/main/"
|
||||
# The format for links, using "filename" and "line" for the format
|
||||
file_format = "{filename}#L{line}"
|
||||
|
||||
[extra]
|
||||
urlmap_file = "urlmap.js"
|
||||
|
||||
content_images = [
|
||||
"logo.svg",
|
||||
]
|
9
docs/reference/urlmap.js
Normal file
9
docs/reference/urlmap.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
// SPDX-FileCopyrightText: 2021 GNOME Foundation
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
// A map between namespaces and base URLs for their online documentation
|
||||
baseURLs = [
|
||||
["GLib", "https://docs.gtk.org/glib/"],
|
||||
["Gio", "https://docs.gtk.org/gio/"],
|
||||
["GObject", "https://docs.gtk.org/gobject/"],
|
||||
];
|
289
eel/eel-stock-dialogs.c
Normal file
289
eel/eel-stock-dialogs.c
Normal file
|
@ -0,0 +1,289 @@
|
|||
/* eel-stock-dialogs.c: Various standard dialogs for Eel.
|
||||
*
|
||||
* Copyright (C) 2000 Eazel, Inc.
|
||||
*
|
||||
* The Gnome Library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* The Gnome Library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with the Gnome Library; see the file COPYING.LIB. If not,
|
||||
* see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Authors: Darin Adler <darin@eazel.com>
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "eel-stock-dialogs.h"
|
||||
|
||||
#include <adwaita.h>
|
||||
#include <glib/gi18n-lib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#define TIMED_WAIT_STANDARD_DURATION 2000
|
||||
#define TIMED_WAIT_MIN_TIME_UP 3000
|
||||
|
||||
#define TIMED_WAIT_MINIMUM_DIALOG_WIDTH 300
|
||||
|
||||
#define RESPONSE_DETAILS 1000
|
||||
|
||||
typedef struct
|
||||
{
|
||||
EelCancelCallback cancel_callback;
|
||||
gpointer callback_data;
|
||||
|
||||
/* Parameters for creation of the window. */
|
||||
char *wait_message;
|
||||
GtkWindow *parent_window;
|
||||
|
||||
/* Timer to determine when we need to create the window. */
|
||||
guint timeout_handler_id;
|
||||
|
||||
/* Window, once it's created. */
|
||||
AdwAlertDialog *dialog;
|
||||
|
||||
/* system time (microseconds) when dialog was created */
|
||||
gint64 dialog_creation_time;
|
||||
} TimedWait;
|
||||
|
||||
static GHashTable *timed_wait_hash_table;
|
||||
|
||||
static void timed_wait_dialog_destroy_callback (AdwAlertDialog *object,
|
||||
gpointer callback_data);
|
||||
|
||||
static guint
|
||||
timed_wait_hash (gconstpointer value)
|
||||
{
|
||||
const TimedWait *wait;
|
||||
|
||||
wait = value;
|
||||
|
||||
return GPOINTER_TO_UINT (wait->cancel_callback)
|
||||
^ GPOINTER_TO_UINT (wait->callback_data);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
timed_wait_hash_equal (gconstpointer value1,
|
||||
gconstpointer value2)
|
||||
{
|
||||
const TimedWait *wait1, *wait2;
|
||||
|
||||
wait1 = value1;
|
||||
wait2 = value2;
|
||||
|
||||
return wait1->cancel_callback == wait2->cancel_callback
|
||||
&& wait1->callback_data == wait2->callback_data;
|
||||
}
|
||||
|
||||
static void
|
||||
timed_wait_delayed_close_destroy_dialog_callback (AdwAlertDialog *object,
|
||||
gpointer callback_data)
|
||||
{
|
||||
g_source_remove (GPOINTER_TO_UINT (callback_data));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
timed_wait_delayed_close_timeout_callback (gpointer callback_data)
|
||||
{
|
||||
guint handler_id;
|
||||
|
||||
handler_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (callback_data),
|
||||
"eel-stock-dialogs/delayed_close_handler_timeout_id"));
|
||||
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (callback_data),
|
||||
G_CALLBACK (timed_wait_delayed_close_destroy_dialog_callback),
|
||||
GUINT_TO_POINTER (handler_id));
|
||||
|
||||
gtk_window_destroy (GTK_WINDOW (callback_data));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
timed_wait_free (TimedWait *wait)
|
||||
{
|
||||
guint delayed_close_handler_id;
|
||||
guint64 time_up;
|
||||
|
||||
g_assert (g_hash_table_lookup (timed_wait_hash_table, wait) != NULL);
|
||||
|
||||
g_hash_table_remove (timed_wait_hash_table, wait);
|
||||
|
||||
g_free (wait->wait_message);
|
||||
if (wait->parent_window != NULL)
|
||||
{
|
||||
g_object_unref (wait->parent_window);
|
||||
}
|
||||
if (wait->timeout_handler_id != 0)
|
||||
{
|
||||
g_source_remove (wait->timeout_handler_id);
|
||||
}
|
||||
if (wait->dialog != NULL)
|
||||
{
|
||||
/* Make sure to detach from the "destroy" signal, or we'll
|
||||
* double-free.
|
||||
*/
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (wait->dialog),
|
||||
G_CALLBACK (timed_wait_dialog_destroy_callback),
|
||||
wait);
|
||||
|
||||
/* compute time up in milliseconds */
|
||||
time_up = (g_get_monotonic_time () - wait->dialog_creation_time) / 1000;
|
||||
|
||||
if (time_up < TIMED_WAIT_MIN_TIME_UP)
|
||||
{
|
||||
delayed_close_handler_id = g_timeout_add (TIMED_WAIT_MIN_TIME_UP - time_up,
|
||||
timed_wait_delayed_close_timeout_callback,
|
||||
wait->dialog);
|
||||
g_object_set_data (G_OBJECT (wait->dialog),
|
||||
"eel-stock-dialogs/delayed_close_handler_timeout_id",
|
||||
GUINT_TO_POINTER (delayed_close_handler_id));
|
||||
g_signal_connect (wait->dialog, "destroy",
|
||||
G_CALLBACK (timed_wait_delayed_close_destroy_dialog_callback),
|
||||
GUINT_TO_POINTER (delayed_close_handler_id));
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_window_destroy (GTK_WINDOW (wait->dialog));
|
||||
}
|
||||
}
|
||||
|
||||
/* And the wait object itself. */
|
||||
g_free (wait);
|
||||
}
|
||||
|
||||
static void
|
||||
timed_wait_dialog_destroy_callback (AdwAlertDialog *object,
|
||||
gpointer callback_data)
|
||||
{
|
||||
TimedWait *wait;
|
||||
|
||||
wait = callback_data;
|
||||
|
||||
g_assert (object == wait->dialog);
|
||||
|
||||
wait->dialog = NULL;
|
||||
|
||||
/* When there's no cancel_callback, the originator will/must
|
||||
* call eel_timed_wait_stop which will call timed_wait_free.
|
||||
*/
|
||||
|
||||
if (wait->cancel_callback != NULL)
|
||||
{
|
||||
(*wait->cancel_callback)(wait->callback_data);
|
||||
timed_wait_free (wait);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
timed_wait_callback (gpointer callback_data)
|
||||
{
|
||||
TimedWait *wait;
|
||||
AdwAlertDialog *dialog;
|
||||
|
||||
wait = callback_data;
|
||||
|
||||
/* Put up the timed wait window. */
|
||||
dialog = ADW_ALERT_DIALOG (adw_alert_dialog_new (wait->wait_message,
|
||||
_("You can stop this operation by clicking cancel.")));
|
||||
|
||||
adw_alert_dialog_add_response (dialog, "cancel", _("_Cancel"));
|
||||
adw_alert_dialog_set_default_response (dialog, "cancel");
|
||||
|
||||
wait->dialog_creation_time = g_get_monotonic_time ();
|
||||
adw_dialog_present (ADW_DIALOG (dialog), GTK_WIDGET (wait->parent_window));
|
||||
|
||||
/* FIXME bugzilla.eazel.com 2441:
|
||||
* Could parent here, but it's complicated because we
|
||||
* don't want this window to go away just because the parent
|
||||
* would go away first.
|
||||
*/
|
||||
|
||||
/* Make the dialog cancel the timed wait when it goes away.
|
||||
* Connect to "destroy" instead of "response" since we want
|
||||
* to be called no matter how the dialog goes away.
|
||||
*/
|
||||
g_signal_connect (dialog, "destroy",
|
||||
G_CALLBACK (timed_wait_dialog_destroy_callback),
|
||||
wait);
|
||||
|
||||
wait->timeout_handler_id = 0;
|
||||
wait->dialog = dialog;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
eel_timed_wait_start_with_duration (int duration,
|
||||
EelCancelCallback cancel_callback,
|
||||
gpointer callback_data,
|
||||
const char *wait_message,
|
||||
GtkWindow *parent_window)
|
||||
{
|
||||
TimedWait *wait;
|
||||
|
||||
g_return_if_fail (cancel_callback != NULL);
|
||||
g_return_if_fail (callback_data != NULL);
|
||||
g_return_if_fail (wait_message != NULL);
|
||||
g_return_if_fail (parent_window == NULL || GTK_IS_WINDOW (parent_window));
|
||||
|
||||
/* Create the timed wait record. */
|
||||
wait = g_new0 (TimedWait, 1);
|
||||
wait->wait_message = g_strdup (wait_message);
|
||||
wait->cancel_callback = cancel_callback;
|
||||
wait->callback_data = callback_data;
|
||||
wait->parent_window = parent_window;
|
||||
|
||||
if (parent_window != NULL)
|
||||
{
|
||||
g_object_ref (parent_window);
|
||||
}
|
||||
|
||||
/* Start the timer. */
|
||||
wait->timeout_handler_id = g_timeout_add (duration, timed_wait_callback, wait);
|
||||
|
||||
/* Put in the hash table so we can find it later. */
|
||||
if (timed_wait_hash_table == NULL)
|
||||
{
|
||||
timed_wait_hash_table = g_hash_table_new (timed_wait_hash, timed_wait_hash_equal);
|
||||
}
|
||||
g_assert (g_hash_table_lookup (timed_wait_hash_table, wait) == NULL);
|
||||
g_hash_table_insert (timed_wait_hash_table, wait, wait);
|
||||
g_assert (g_hash_table_lookup (timed_wait_hash_table, wait) == wait);
|
||||
}
|
||||
|
||||
void
|
||||
eel_timed_wait_start (EelCancelCallback cancel_callback,
|
||||
gpointer callback_data,
|
||||
const char *wait_message,
|
||||
GtkWindow *parent_window)
|
||||
{
|
||||
eel_timed_wait_start_with_duration
|
||||
(TIMED_WAIT_STANDARD_DURATION,
|
||||
cancel_callback, callback_data,
|
||||
wait_message, parent_window);
|
||||
}
|
||||
|
||||
void
|
||||
eel_timed_wait_stop (EelCancelCallback cancel_callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
TimedWait key;
|
||||
TimedWait *wait;
|
||||
|
||||
g_return_if_fail (callback_data != NULL);
|
||||
|
||||
key.cancel_callback = cancel_callback;
|
||||
key.callback_data = callback_data;
|
||||
wait = g_hash_table_lookup (timed_wait_hash_table, &key);
|
||||
|
||||
g_return_if_fail (wait != NULL);
|
||||
|
||||
timed_wait_free (wait);
|
||||
}
|
40
eel/eel-stock-dialogs.h
Normal file
40
eel/eel-stock-dialogs.h
Normal file
|
@ -0,0 +1,40 @@
|
|||
|
||||
/* eel-stock-dialogs.h: Various standard dialogs for Eel.
|
||||
|
||||
Copyright (C) 2000 Eazel, Inc.
|
||||
|
||||
The Gnome Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The Gnome Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the Gnome Library; see the file COPYING.LIB. If not,
|
||||
see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Authors: Darin Adler <darin@eazel.com>
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
typedef void (* EelCancelCallback) (gpointer callback_data);
|
||||
|
||||
/* Dialog for cancelling something that normally is fast enough not to need a dialog. */
|
||||
void eel_timed_wait_start (EelCancelCallback cancel_callback,
|
||||
gpointer callback_data,
|
||||
const char *wait_message,
|
||||
GtkWindow *parent_window);
|
||||
void eel_timed_wait_start_with_duration (int duration,
|
||||
EelCancelCallback cancel_callback,
|
||||
gpointer callback_data,
|
||||
const char *wait_message,
|
||||
GtkWindow *parent_window);
|
||||
void eel_timed_wait_stop (EelCancelCallback cancel_callback,
|
||||
gpointer callback_data);
|
25
eel/meson.build
Normal file
25
eel/meson.build
Normal file
|
@ -0,0 +1,25 @@
|
|||
libeel_2_sources = [
|
||||
'eel-stock-dialogs.h',
|
||||
'eel-stock-dialogs.c',
|
||||
]
|
||||
|
||||
libeel_2_deps = [
|
||||
config_h,
|
||||
glib,
|
||||
gtk,
|
||||
libadwaita,
|
||||
libm
|
||||
]
|
||||
|
||||
libeel_2 = static_library(
|
||||
'eel-2',
|
||||
libeel_2_sources,
|
||||
dependencies: libeel_2_deps,
|
||||
include_directories: nautilus_include_dirs
|
||||
)
|
||||
|
||||
eel_2 = declare_dependency(
|
||||
link_with: libeel_2,
|
||||
include_directories: nautilus_include_dirs,
|
||||
dependencies: libeel_2_deps
|
||||
)
|
26
extensions/audio-video-properties/meson.build
Normal file
26
extensions/audio-video-properties/meson.build
Normal file
|
@ -0,0 +1,26 @@
|
|||
libm = cc.find_library('m')
|
||||
|
||||
libtotem_properties_page_sources = files(
|
||||
'totem-properties-main.c',
|
||||
'totem-properties-view.c',
|
||||
'totem-gst-helpers.c',
|
||||
)
|
||||
|
||||
libtotem_properties_page_deps = [
|
||||
libm,
|
||||
gst_tag_dep,
|
||||
gst_pbutils_dep,
|
||||
]
|
||||
|
||||
libtotem_properties_page = shared_module(
|
||||
'totem-properties-page',
|
||||
sources: libtotem_properties_page_sources,
|
||||
dependencies: libtotem_properties_page_deps + [
|
||||
nautilus_extension
|
||||
],
|
||||
c_args: [
|
||||
'-DG_LOG_DOMAIN="TotemPropertiesPage"'
|
||||
],
|
||||
install: true,
|
||||
install_dir: extensiondir
|
||||
)
|
62
extensions/audio-video-properties/totem-gst-helpers.c
Normal file
62
extensions/audio-video-properties/totem-gst-helpers.c
Normal file
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* Copyright (C) 2003-2007 the GStreamer project
|
||||
* Julien Moutte <julien@moutte.net>
|
||||
* Ronald Bultje <rbultje@ronald.bitfreak.net>
|
||||
* Copyright (C) 2005-2008 Tim-Philipp Müller <tim centricular net>
|
||||
* Copyright (C) 2009 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
||||
* Copyright © 2009 Christian Persch
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "totem-gst-helpers.h"
|
||||
#include <gst/gstprotection.h>
|
||||
|
||||
/* Disable decoders that require a display environment to work,
|
||||
* and that might cause crashes */
|
||||
void
|
||||
totem_gst_disable_display_decoders (void)
|
||||
{
|
||||
GstRegistry *registry;
|
||||
const char *blacklisted_plugins[] =
|
||||
{
|
||||
"bmcdec",
|
||||
"vaapi",
|
||||
"video4linux2"
|
||||
};
|
||||
guint i;
|
||||
|
||||
/* Disable the vaapi plugin as it will not work with the
|
||||
* fakesink we use:
|
||||
* See: https://bugzilla.gnome.org/show_bug.cgi?id=700186 and
|
||||
* https://bugzilla.gnome.org/show_bug.cgi?id=749605 */
|
||||
registry = gst_registry_get ();
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (blacklisted_plugins); i++)
|
||||
{
|
||||
GstPlugin *plugin =
|
||||
gst_registry_find_plugin (registry,
|
||||
blacklisted_plugins[i]);
|
||||
if (plugin)
|
||||
{
|
||||
gst_registry_remove_plugin (registry, plugin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* vim: sw=2 ts=8 cindent noai bs=2
|
||||
*/
|
25
extensions/audio-video-properties/totem-gst-helpers.h
Normal file
25
extensions/audio-video-properties/totem-gst-helpers.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright (C) 2001,2002,2003,2004,2005 Bastien Nocera <hadess@hadess.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HAVE_TOTEM_GST_HELPERS_H
|
||||
#define HAVE_TOTEM_GST_HELPERS_H
|
||||
|
||||
void totem_gst_disable_display_decoders (void);
|
||||
|
||||
#endif /* HAVE_TOTEM_GST_HELPERS_H */
|
282
extensions/audio-video-properties/totem-mime-types.h
Normal file
282
extensions/audio-video-properties/totem-mime-types.h
Normal file
|
@ -0,0 +1,282 @@
|
|||
/* generated with mime-types-include.sh, don't edit */
|
||||
G_GNUC_UNUSED static const gchar *mime_types[] = {
|
||||
"application/mxf",
|
||||
"application/ogg",
|
||||
"application/ram",
|
||||
"application/sdp",
|
||||
"application/smil",
|
||||
"application/smil+xml",
|
||||
"application/vnd.apple.mpegurl",
|
||||
"application/vnd.ms-asf",
|
||||
"application/vnd.ms-wpl",
|
||||
"application/vnd.rn-realmedia",
|
||||
"application/vnd.rn-realmedia-vbr",
|
||||
"application/x-extension-m4a",
|
||||
"application/x-extension-mp4",
|
||||
"application/x-flac",
|
||||
"application/x-flash-video",
|
||||
"application/x-matroska",
|
||||
"application/x-netshow-channel",
|
||||
"application/x-ogg",
|
||||
"application/x-quicktime-media-link",
|
||||
"application/x-quicktimeplayer",
|
||||
"application/x-shorten",
|
||||
"application/x-smil",
|
||||
"application/xspf+xml",
|
||||
"audio/3gpp",
|
||||
"audio/3gpp2",
|
||||
"audio/aac",
|
||||
"audio/ac3",
|
||||
"audio/AMR",
|
||||
"audio/AMR-WB",
|
||||
"audio/basic",
|
||||
"audio/dv",
|
||||
"audio/eac3",
|
||||
"audio/flac",
|
||||
"audio/m4a",
|
||||
"audio/midi",
|
||||
"audio/mp1",
|
||||
"audio/mp2",
|
||||
"audio/mp3",
|
||||
"audio/mp4",
|
||||
"audio/mpeg",
|
||||
"audio/mpegurl",
|
||||
"audio/mpg",
|
||||
"audio/ogg",
|
||||
"audio/opus",
|
||||
"audio/prs.sid",
|
||||
"audio/scpls",
|
||||
"audio/vnd.rn-realaudio",
|
||||
"audio/wav",
|
||||
"audio/webm",
|
||||
"audio/x-aac",
|
||||
"audio/x-aiff",
|
||||
"audio/x-ape",
|
||||
"audio/x-flac",
|
||||
"audio/x-gsm",
|
||||
"audio/x-it",
|
||||
"audio/x-m4a",
|
||||
"audio/x-m4b",
|
||||
"audio/x-matroska",
|
||||
"audio/x-mod",
|
||||
"audio/x-mp1",
|
||||
"audio/x-mp2",
|
||||
"audio/x-mp3",
|
||||
"audio/x-mpg",
|
||||
"audio/x-mpeg",
|
||||
"audio/x-mpegurl",
|
||||
"audio/x-ms-asf",
|
||||
"audio/x-ms-asx",
|
||||
"audio/x-ms-wax",
|
||||
"audio/x-ms-wma",
|
||||
"audio/x-musepack",
|
||||
"audio/x-opus+ogg",
|
||||
"audio/x-pn-aiff",
|
||||
"audio/x-pn-au",
|
||||
"audio/x-pn-realaudio",
|
||||
"audio/x-pn-realaudio-plugin",
|
||||
"audio/x-pn-wav",
|
||||
"audio/x-pn-windows-acm",
|
||||
"audio/x-realaudio",
|
||||
"audio/x-real-audio",
|
||||
"audio/x-s3m",
|
||||
"audio/x-sbc",
|
||||
"audio/x-scpls",
|
||||
"audio/x-shorten",
|
||||
"audio/x-speex",
|
||||
"audio/x-stm",
|
||||
"audio/x-tta",
|
||||
"audio/x-wav",
|
||||
"audio/x-wavpack",
|
||||
"audio/x-vorbis",
|
||||
"audio/x-vorbis+ogg",
|
||||
"audio/x-xm",
|
||||
"image/vnd.rn-realpix",
|
||||
"image/x-pict",
|
||||
"misc/ultravox",
|
||||
"text/google-video-pointer",
|
||||
"text/x-google-video-pointer",
|
||||
"video/3gp",
|
||||
"video/3gpp",
|
||||
"video/3gpp2",
|
||||
"video/dv",
|
||||
"video/divx",
|
||||
"video/fli",
|
||||
"video/flv",
|
||||
"video/mp2t",
|
||||
"video/mp4",
|
||||
"video/mp4v-es",
|
||||
"video/mpeg",
|
||||
"video/mpeg-system",
|
||||
"video/msvideo",
|
||||
"video/ogg",
|
||||
"video/quicktime",
|
||||
"video/vivo",
|
||||
"video/vnd.divx",
|
||||
"video/vnd.mpegurl",
|
||||
"video/vnd.rn-realvideo",
|
||||
"video/vnd.vivo",
|
||||
"video/webm",
|
||||
"video/x-anim",
|
||||
"video/x-avi",
|
||||
"video/x-flc",
|
||||
"video/x-fli",
|
||||
"video/x-flic",
|
||||
"video/x-flv",
|
||||
"video/x-m4v",
|
||||
"video/x-matroska",
|
||||
"video/x-mjpeg",
|
||||
"video/x-mpeg",
|
||||
"video/x-mpeg2",
|
||||
"video/x-ms-asf",
|
||||
"video/x-ms-asf-plugin",
|
||||
"video/x-ms-asx",
|
||||
"video/x-msvideo",
|
||||
"video/x-ms-wm",
|
||||
"video/x-ms-wmv",
|
||||
"video/x-ms-wmx",
|
||||
"video/x-ms-wvx",
|
||||
"video/x-nsv",
|
||||
"video/x-ogm+ogg",
|
||||
"video/x-theora",
|
||||
"video/x-theora+ogg",
|
||||
"video/x-totem-stream",
|
||||
NULL
|
||||
};
|
||||
G_GNUC_UNUSED static const gchar *audio_mime_types[] = {
|
||||
"audio/3gpp",
|
||||
"audio/3gpp2",
|
||||
"audio/aac",
|
||||
"audio/ac3",
|
||||
"audio/AMR",
|
||||
"audio/AMR-WB",
|
||||
"audio/basic",
|
||||
"audio/dv",
|
||||
"audio/eac3",
|
||||
"audio/flac",
|
||||
"audio/m4a",
|
||||
"audio/midi",
|
||||
"audio/mp1",
|
||||
"audio/mp2",
|
||||
"audio/mp3",
|
||||
"audio/mp4",
|
||||
"audio/mpeg",
|
||||
"audio/mpg",
|
||||
"audio/ogg",
|
||||
"audio/opus",
|
||||
"audio/prs.sid",
|
||||
"audio/scpls",
|
||||
"audio/vnd.rn-realaudio",
|
||||
"audio/wav",
|
||||
"audio/webm",
|
||||
"audio/x-aac",
|
||||
"audio/x-aiff",
|
||||
"audio/x-ape",
|
||||
"audio/x-flac",
|
||||
"audio/x-gsm",
|
||||
"audio/x-it",
|
||||
"audio/x-m4a",
|
||||
"audio/x-m4b",
|
||||
"audio/x-matroska",
|
||||
"audio/x-mod",
|
||||
"audio/x-mp1",
|
||||
"audio/x-mp2",
|
||||
"audio/x-mp3",
|
||||
"audio/x-mpg",
|
||||
"audio/x-mpeg",
|
||||
"audio/x-ms-asf",
|
||||
"audio/x-ms-asx",
|
||||
"audio/x-ms-wax",
|
||||
"audio/x-ms-wma",
|
||||
"audio/x-musepack",
|
||||
"audio/x-opus+ogg",
|
||||
"audio/x-pn-aiff",
|
||||
"audio/x-pn-au",
|
||||
"audio/x-pn-wav",
|
||||
"audio/x-pn-windows-acm",
|
||||
"audio/x-realaudio",
|
||||
"audio/x-real-audio",
|
||||
"audio/x-s3m",
|
||||
"audio/x-sbc",
|
||||
"audio/x-shorten",
|
||||
"audio/x-speex",
|
||||
"audio/x-stm",
|
||||
"audio/x-tta",
|
||||
"audio/x-wav",
|
||||
"audio/x-wavpack",
|
||||
"audio/x-vorbis",
|
||||
"audio/x-vorbis+ogg",
|
||||
"audio/x-xm",
|
||||
"application/x-flac",
|
||||
NULL
|
||||
};
|
||||
G_GNUC_UNUSED static const gchar *video_mime_types[] = {
|
||||
"application/mxf",
|
||||
"application/ogg",
|
||||
"application/ram",
|
||||
"application/sdp",
|
||||
"application/vnd.apple.mpegurl",
|
||||
"application/vnd.ms-asf",
|
||||
"application/vnd.ms-wpl",
|
||||
"application/vnd.rn-realmedia",
|
||||
"application/vnd.rn-realmedia-vbr",
|
||||
"application/x-extension-m4a",
|
||||
"application/x-extension-mp4",
|
||||
"application/x-flash-video",
|
||||
"application/x-matroska",
|
||||
"application/x-netshow-channel",
|
||||
"application/x-ogg",
|
||||
"application/x-quicktimeplayer",
|
||||
"application/x-shorten",
|
||||
"image/vnd.rn-realpix",
|
||||
"image/x-pict",
|
||||
"misc/ultravox",
|
||||
"text/x-google-video-pointer",
|
||||
"video/3gp",
|
||||
"video/3gpp",
|
||||
"video/3gpp2",
|
||||
"video/dv",
|
||||
"video/divx",
|
||||
"video/fli",
|
||||
"video/flv",
|
||||
"video/mp2t",
|
||||
"video/mp4",
|
||||
"video/mp4v-es",
|
||||
"video/mpeg",
|
||||
"video/mpeg-system",
|
||||
"video/msvideo",
|
||||
"video/ogg",
|
||||
"video/quicktime",
|
||||
"video/vivo",
|
||||
"video/vnd.divx",
|
||||
"video/vnd.mpegurl",
|
||||
"video/vnd.rn-realvideo",
|
||||
"video/vnd.vivo",
|
||||
"video/webm",
|
||||
"video/x-anim",
|
||||
"video/x-avi",
|
||||
"video/x-flc",
|
||||
"video/x-fli",
|
||||
"video/x-flic",
|
||||
"video/x-flv",
|
||||
"video/x-m4v",
|
||||
"video/x-matroska",
|
||||
"video/x-mjpeg",
|
||||
"video/x-mpeg",
|
||||
"video/x-mpeg2",
|
||||
"video/x-ms-asf",
|
||||
"video/x-ms-asf-plugin",
|
||||
"video/x-ms-asx",
|
||||
"video/x-msvideo",
|
||||
"video/x-ms-wm",
|
||||
"video/x-ms-wmv",
|
||||
"video/x-ms-wmx",
|
||||
"video/x-ms-wvx",
|
||||
"video/x-nsv",
|
||||
"video/x-ogm+ogg",
|
||||
"video/x-theora",
|
||||
"video/x-theora+ogg",
|
||||
"video/x-totem-stream",
|
||||
"audio/x-pn-realaudio",
|
||||
NULL
|
||||
};
|
155
extensions/audio-video-properties/totem-properties-main.c
Normal file
155
extensions/audio-video-properties/totem-properties-main.c
Normal file
|
@ -0,0 +1,155 @@
|
|||
/*
|
||||
* Copyright (C) 2000, 2001 Eazel Inc.
|
||||
* Copyright (C) 2003 Andrew Sobala <aes@gnome.org>
|
||||
* Copyright (C) 2005 Bastien Nocera <hadess@hadess.net>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU 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
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <string.h>
|
||||
#include <glib/gi18n-lib.h>
|
||||
#define GST_USE_UNSTABLE_API 1
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include "totem-properties-view.h"
|
||||
#include "totem-gst-helpers.h"
|
||||
#include <nautilus-extension.h>
|
||||
|
||||
#define WANT_MIME_TYPES 1
|
||||
#include "totem-mime-types.h"
|
||||
|
||||
static GType tpp_type = 0;
|
||||
static void properties_model_provider_iface_init (NautilusPropertiesModelProviderInterface *iface);
|
||||
static GList *totem_properties_get_models (NautilusPropertiesModelProvider *provider,
|
||||
GList *files);
|
||||
|
||||
static void
|
||||
totem_properties_plugin_register_type (GTypeModule *module)
|
||||
{
|
||||
const GTypeInfo info =
|
||||
{
|
||||
.class_size = sizeof (GObjectClass),
|
||||
.base_init = (GBaseInitFunc) NULL,
|
||||
.base_finalize = (GBaseFinalizeFunc) NULL,
|
||||
.class_init = (GClassInitFunc) NULL,
|
||||
.class_finalize = NULL,
|
||||
.class_data = NULL,
|
||||
.instance_size = sizeof (GObject),
|
||||
.n_preallocs = 0,
|
||||
.instance_init = (GInstanceInitFunc) NULL,
|
||||
.value_table = NULL
|
||||
};
|
||||
const GInterfaceInfo properties_model_provider_iface_info =
|
||||
{
|
||||
(GInterfaceInitFunc) properties_model_provider_iface_init,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
tpp_type = g_type_module_register_type (module, G_TYPE_OBJECT,
|
||||
"TotemPropertiesPlugin",
|
||||
&info, 0);
|
||||
g_type_module_add_interface (module,
|
||||
tpp_type,
|
||||
NAUTILUS_TYPE_PROPERTIES_MODEL_PROVIDER,
|
||||
&properties_model_provider_iface_info);
|
||||
}
|
||||
|
||||
static void
|
||||
properties_model_provider_iface_init (NautilusPropertiesModelProviderInterface *iface)
|
||||
{
|
||||
iface->get_models = totem_properties_get_models;
|
||||
}
|
||||
|
||||
static gpointer
|
||||
init_backend (gpointer data)
|
||||
{
|
||||
gst_init (NULL, NULL);
|
||||
totem_gst_disable_display_decoders ();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static GList *
|
||||
totem_properties_get_models (NautilusPropertiesModelProvider *provider,
|
||||
GList *files)
|
||||
{
|
||||
static GOnce backend_inited = G_ONCE_INIT;
|
||||
NautilusFileInfo *file;
|
||||
char *uri;
|
||||
NautilusPropertiesModel *model;
|
||||
guint i;
|
||||
gboolean found;
|
||||
|
||||
/* only add properties model if a single file is selected */
|
||||
if (files == NULL || files->next != NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
file = files->data;
|
||||
|
||||
/* only add the properties model to these mime types */
|
||||
found = FALSE;
|
||||
for (i = 0; mime_types[i] != NULL; i++)
|
||||
{
|
||||
if (nautilus_file_info_is_mime_type (file, mime_types[i]))
|
||||
{
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found == FALSE)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* okay, make the model, init'ing the backend first if necessary */
|
||||
g_once (&backend_inited, init_backend, NULL);
|
||||
|
||||
uri = nautilus_file_info_get_uri (file);
|
||||
model = totem_properties_view_new (uri);
|
||||
g_free (uri);
|
||||
|
||||
return g_list_prepend (NULL, model);
|
||||
}
|
||||
|
||||
/* --- extension interface --- */
|
||||
void
|
||||
nautilus_module_initialize (GTypeModule *module)
|
||||
{
|
||||
/* set up translation catalog */
|
||||
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
|
||||
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
||||
|
||||
totem_properties_plugin_register_type (module);
|
||||
totem_properties_view_register_type (module);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_module_shutdown (void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_module_list_types (const GType **types,
|
||||
int *num_types)
|
||||
{
|
||||
static GType type_list[1];
|
||||
|
||||
type_list[0] = tpp_type;
|
||||
*types = type_list;
|
||||
*num_types = G_N_ELEMENTS (type_list);
|
||||
}
|
475
extensions/audio-video-properties/totem-properties-view.c
Normal file
475
extensions/audio-video-properties/totem-properties-view.c
Normal file
|
@ -0,0 +1,475 @@
|
|||
/*
|
||||
* Copyright (C) 2003 Andrew Sobala <aes@gnome.org>
|
||||
* Copyright (C) 2004 Bastien Nocera <hadess@hadess.net>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU 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
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <glib/gi18n-lib.h>
|
||||
|
||||
#define GST_USE_UNSTABLE_API 1
|
||||
#include <gst/tag/tag.h>
|
||||
#include <gst/pbutils/pbutils.h>
|
||||
|
||||
#include "totem-properties-view.h"
|
||||
#include <math.h>
|
||||
|
||||
struct TotemPropertiesViewPriv
|
||||
{
|
||||
NautilusPropertiesModel *model;
|
||||
GListStore *store;
|
||||
GstDiscoverer *disco;
|
||||
};
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
static void totem_properties_view_finalize (GObject *object);
|
||||
|
||||
G_DEFINE_TYPE (TotemPropertiesView, totem_properties_view, G_TYPE_OBJECT)
|
||||
|
||||
void
|
||||
totem_properties_view_register_type (GTypeModule *module)
|
||||
{
|
||||
totem_properties_view_get_type ();
|
||||
}
|
||||
|
||||
static void
|
||||
totem_properties_view_class_init (TotemPropertiesViewClass *class)
|
||||
{
|
||||
parent_class = g_type_class_peek_parent (class);
|
||||
G_OBJECT_CLASS (class)->finalize = totem_properties_view_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
append_item (TotemPropertiesView *props,
|
||||
const char *name,
|
||||
const char *value)
|
||||
{
|
||||
g_autoptr (NautilusPropertiesItem) item = NULL;
|
||||
|
||||
item = nautilus_properties_item_new (name, value);
|
||||
|
||||
g_list_store_append (props->priv->store, item);
|
||||
}
|
||||
|
||||
/* Copied from bacon-video-widget-properties.c
|
||||
* Copyright (C) 2002 Bastien Nocera
|
||||
*/
|
||||
static char *
|
||||
time_to_string_text (gint64 msecs)
|
||||
{
|
||||
char *secs, *mins, *hours, *string;
|
||||
int sec, min, hour, _time;
|
||||
|
||||
_time = (int) (msecs / 1000);
|
||||
sec = _time % 60;
|
||||
_time = _time - sec;
|
||||
min = (_time % (60 * 60)) / 60;
|
||||
_time = _time - (min * 60);
|
||||
hour = _time / (60 * 60);
|
||||
|
||||
hours = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE, "%d hour", "%d hours", hour), hour);
|
||||
|
||||
mins = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE, "%d minute",
|
||||
"%d minutes", min), min);
|
||||
|
||||
secs = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE, "%d second",
|
||||
"%d seconds", sec), sec);
|
||||
|
||||
if (hour > 0)
|
||||
{
|
||||
/* 5 hours 2 minutes 12 seconds */
|
||||
string = g_strdup_printf (C_("time", "%s %s %s"), hours, mins, secs);
|
||||
}
|
||||
else if (min > 0)
|
||||
{
|
||||
/* 2 minutes 12 seconds */
|
||||
string = g_strdup_printf (C_("time", "%s %s"), mins, secs);
|
||||
}
|
||||
else if (sec > 0)
|
||||
{
|
||||
/* 10 seconds */
|
||||
string = g_strdup (secs);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 0 seconds */
|
||||
string = g_strdup (_("0 seconds"));
|
||||
}
|
||||
|
||||
g_free (hours);
|
||||
g_free (mins);
|
||||
g_free (secs);
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
static void
|
||||
update_general (TotemPropertiesView *props,
|
||||
const GstTagList *list)
|
||||
{
|
||||
struct
|
||||
{
|
||||
const char *tag_name;
|
||||
const char *title;
|
||||
} items[] =
|
||||
{
|
||||
{ GST_TAG_TITLE, N_("Title") },
|
||||
{ GST_TAG_ARTIST, N_("Artist") },
|
||||
{ GST_TAG_ALBUM, N_("Album") },
|
||||
};
|
||||
guint i;
|
||||
GDate *date;
|
||||
GstDateTime *datetime;
|
||||
gchar *comment;
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (items); i++)
|
||||
{
|
||||
char *string;
|
||||
|
||||
if (gst_tag_list_get_string_index (list, items[i].tag_name, 0, &string) != FALSE)
|
||||
{
|
||||
append_item (props, gettext (items[i].title), string);
|
||||
g_free (string);
|
||||
}
|
||||
}
|
||||
|
||||
/* Comment else use Description defined by:
|
||||
* http://xiph.org/vorbis/doc/v-comment.html */
|
||||
if (gst_tag_list_get_string (list, GST_TAG_COMMENT, &comment) ||
|
||||
gst_tag_list_get_string (list, GST_TAG_DESCRIPTION, &comment))
|
||||
{
|
||||
append_item (props, _("Comment"), comment);
|
||||
g_free (comment);
|
||||
}
|
||||
|
||||
/* Date */
|
||||
if (gst_tag_list_get_date (list, GST_TAG_DATE, &date))
|
||||
{
|
||||
char *string;
|
||||
|
||||
string = g_strdup_printf ("%d", g_date_get_year (date));
|
||||
g_date_free (date);
|
||||
append_item (props, _("Year"), string);
|
||||
g_free (string);
|
||||
}
|
||||
else if (gst_tag_list_get_date_time (list, GST_TAG_DATE_TIME, &datetime))
|
||||
{
|
||||
char *string;
|
||||
|
||||
string = g_strdup_printf ("%d", gst_date_time_get_year (datetime));
|
||||
gst_date_time_unref (datetime);
|
||||
append_item (props, _("Year"), string);
|
||||
g_free (string);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
set_codec (TotemPropertiesView *props,
|
||||
GstDiscovererStreamInfo *info,
|
||||
const char *title)
|
||||
{
|
||||
GstCaps *caps;
|
||||
const char *nick;
|
||||
|
||||
nick = gst_discoverer_stream_info_get_stream_type_nick (info);
|
||||
if (g_str_equal (nick, "audio") == FALSE &&
|
||||
g_str_equal (nick, "video") == FALSE &&
|
||||
g_str_equal (nick, "container") == FALSE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
caps = gst_discoverer_stream_info_get_caps (info);
|
||||
if (caps)
|
||||
{
|
||||
if (gst_caps_is_fixed (caps))
|
||||
{
|
||||
char *string;
|
||||
|
||||
string = gst_pb_utils_get_codec_description (caps);
|
||||
append_item (props, title, string);
|
||||
g_free (string);
|
||||
}
|
||||
gst_caps_unref (caps);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
set_bitrate (TotemPropertiesView *props,
|
||||
guint bitrate,
|
||||
const char *title)
|
||||
{
|
||||
char *string;
|
||||
|
||||
if (!bitrate)
|
||||
{
|
||||
return;
|
||||
}
|
||||
string = g_strdup_printf (_("%d kbps"), bitrate / 1000);
|
||||
append_item (props, title, string);
|
||||
g_free (string);
|
||||
}
|
||||
|
||||
static void
|
||||
update_video (TotemPropertiesView *props,
|
||||
GstDiscovererVideoInfo *info)
|
||||
{
|
||||
guint width, height;
|
||||
guint fps_n, fps_d;
|
||||
float framerate = 0.0;
|
||||
char *string;
|
||||
|
||||
width = gst_discoverer_video_info_get_width (info);
|
||||
height = gst_discoverer_video_info_get_height (info);
|
||||
string = g_strdup_printf (N_("%d × %d"), width, height);
|
||||
append_item (props, _("Dimensions"), string);
|
||||
g_free (string);
|
||||
|
||||
set_codec (props, (GstDiscovererStreamInfo *) info, _("Video Codec"));
|
||||
set_bitrate (props, gst_discoverer_video_info_get_bitrate (info), _("Video Bit Rate"));
|
||||
|
||||
/* Round up/down to the nearest integer framerate */
|
||||
fps_n = gst_discoverer_video_info_get_framerate_num (info);
|
||||
fps_d = gst_discoverer_video_info_get_framerate_denom (info);
|
||||
if (fps_d > 0.0)
|
||||
{
|
||||
framerate = (float) fps_n / (float) fps_d;
|
||||
}
|
||||
|
||||
if (framerate > 1.0)
|
||||
{
|
||||
string = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE,
|
||||
"%0.2f frame per second",
|
||||
"%0.2f frames per second",
|
||||
(int) (ceilf (framerate))),
|
||||
framerate);
|
||||
append_item (props, _("Frame Rate"), string);
|
||||
g_free (string);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
update_audio (TotemPropertiesView *props,
|
||||
GstDiscovererAudioInfo *info)
|
||||
{
|
||||
guint samplerate, channels;
|
||||
|
||||
set_codec (props, (GstDiscovererStreamInfo *) info, _("Audio Codec"));
|
||||
|
||||
set_bitrate (props, gst_discoverer_audio_info_get_bitrate (info), _("Audio Bit Rate"));
|
||||
|
||||
samplerate = gst_discoverer_audio_info_get_sample_rate (info);
|
||||
if (samplerate)
|
||||
{
|
||||
char *string;
|
||||
if (samplerate > 999)
|
||||
{
|
||||
double samplerate_khz = (double) samplerate / 1000.0;
|
||||
string = g_strdup_printf ("%'.2f kHz", samplerate_khz);
|
||||
}
|
||||
else
|
||||
{
|
||||
string = g_strdup_printf ("%d Hz", samplerate);
|
||||
}
|
||||
append_item (props, _("Sample Rate"), string);
|
||||
g_free (string);
|
||||
}
|
||||
|
||||
channels = gst_discoverer_audio_info_get_channels (info);
|
||||
if (channels)
|
||||
{
|
||||
char *string;
|
||||
|
||||
if (channels > 2)
|
||||
{
|
||||
string = g_strdup_printf ("%s %d.1", _("Surround"), channels - 1);
|
||||
}
|
||||
else if (channels == 1)
|
||||
{
|
||||
string = g_strdup (_("Mono"));
|
||||
}
|
||||
else if (channels == 2)
|
||||
{
|
||||
string = g_strdup (_("Stereo"));
|
||||
}
|
||||
else
|
||||
{
|
||||
string = g_strdup (""); /*Should not happen */
|
||||
}
|
||||
append_item (props, _("Channels"), string);
|
||||
g_free (string);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
discovered_cb (GstDiscoverer *discoverer,
|
||||
GstDiscovererInfo *info,
|
||||
GError *error,
|
||||
TotemPropertiesView *props)
|
||||
{
|
||||
GList *video_streams, *audio_streams;
|
||||
const GstTagList *taglist;
|
||||
gboolean has_audio, has_video;
|
||||
const char *label;
|
||||
GstClockTime duration;
|
||||
g_autofree char *duration_string = NULL;
|
||||
g_autoptr (GstDiscovererStreamInfo) sinfo = NULL;
|
||||
|
||||
if (error)
|
||||
{
|
||||
g_warning ("Couldn't get information about '%s': %s",
|
||||
gst_discoverer_info_get_uri (info),
|
||||
error->message);
|
||||
append_item (props, _("Oops! Something went wrong."), error->message);
|
||||
return;
|
||||
}
|
||||
|
||||
video_streams = gst_discoverer_info_get_video_streams (info);
|
||||
has_video = (video_streams != NULL);
|
||||
audio_streams = gst_discoverer_info_get_audio_streams (info);
|
||||
has_audio = (audio_streams != NULL);
|
||||
|
||||
if (has_audio == has_video)
|
||||
{
|
||||
label = _("Audio and Video Properties");
|
||||
}
|
||||
else if (has_audio)
|
||||
{
|
||||
label = _("Audio Properties");
|
||||
}
|
||||
else
|
||||
{
|
||||
label = _("Video Properties");
|
||||
}
|
||||
|
||||
nautilus_properties_model_set_title (props->priv->model, label);
|
||||
|
||||
/* General */
|
||||
duration = gst_discoverer_info_get_duration (info);
|
||||
duration_string = time_to_string_text (duration / GST_SECOND * 1000);
|
||||
append_item (props, _("Duration"), duration_string);
|
||||
|
||||
sinfo = gst_discoverer_info_get_stream_info (info);
|
||||
if (sinfo != NULL &&
|
||||
g_str_equal (gst_discoverer_stream_info_get_stream_type_nick (sinfo), "container"))
|
||||
{
|
||||
set_codec (props, sinfo, _("Container"));
|
||||
}
|
||||
|
||||
taglist = gst_discoverer_info_get_tags (info);
|
||||
update_general (props, taglist);
|
||||
|
||||
/* Video and Audio */
|
||||
if (video_streams)
|
||||
{
|
||||
update_video (props, video_streams->data);
|
||||
}
|
||||
if (audio_streams)
|
||||
{
|
||||
update_audio (props, audio_streams->data);
|
||||
}
|
||||
|
||||
gst_discoverer_stream_info_list_free (video_streams);
|
||||
gst_discoverer_stream_info_list_free (audio_streams);
|
||||
}
|
||||
|
||||
static void
|
||||
totem_properties_view_init (TotemPropertiesView *props)
|
||||
{
|
||||
GError *err = NULL;
|
||||
|
||||
props->priv = g_new0 (TotemPropertiesViewPriv, 1);
|
||||
|
||||
props->priv->store = g_list_store_new (NAUTILUS_TYPE_PROPERTIES_ITEM);
|
||||
|
||||
props->priv->model = nautilus_properties_model_new (_("Audio/Video Properties"),
|
||||
G_LIST_MODEL (props->priv->store));
|
||||
|
||||
props->priv->disco = gst_discoverer_new (GST_SECOND * 60, &err);
|
||||
if (props->priv->disco == NULL)
|
||||
{
|
||||
g_warning ("Could not create discoverer object: %s", err->message);
|
||||
g_error_free (err);
|
||||
return;
|
||||
}
|
||||
g_signal_connect (props->priv->disco, "discovered",
|
||||
G_CALLBACK (discovered_cb), props);
|
||||
}
|
||||
|
||||
static void
|
||||
totem_properties_view_finalize (GObject *object)
|
||||
{
|
||||
TotemPropertiesView *props;
|
||||
|
||||
props = TOTEM_PROPERTIES_VIEW (object);
|
||||
|
||||
if (props->priv != NULL)
|
||||
{
|
||||
if (props->priv->disco)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (props->priv->disco,
|
||||
discovered_cb,
|
||||
props);
|
||||
gst_discoverer_stop (props->priv->disco);
|
||||
g_clear_object (&props->priv->disco);
|
||||
}
|
||||
g_free (props->priv);
|
||||
}
|
||||
props->priv = NULL;
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
totem_properties_view_set_location (TotemPropertiesView *props,
|
||||
const char *location)
|
||||
{
|
||||
g_assert (TOTEM_IS_PROPERTIES_VIEW (props));
|
||||
|
||||
if (props->priv->disco == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
gst_discoverer_stop (props->priv->disco);
|
||||
|
||||
if (location != NULL)
|
||||
{
|
||||
gst_discoverer_start (props->priv->disco);
|
||||
|
||||
if (gst_discoverer_discover_uri_async (props->priv->disco, location) == FALSE)
|
||||
{
|
||||
g_warning ("Couldn't add %s to list", location);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NautilusPropertiesModel *
|
||||
totem_properties_view_new (const char *location)
|
||||
{
|
||||
TotemPropertiesView *props;
|
||||
|
||||
props = g_object_new (TOTEM_TYPE_PROPERTIES_VIEW, NULL);
|
||||
|
||||
totem_properties_view_set_location (props, location);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (props->priv->model), (GWeakNotify) g_object_unref, props);
|
||||
|
||||
return props->priv->model;
|
||||
}
|
48
extensions/audio-video-properties/totem-properties-view.h
Normal file
48
extensions/audio-video-properties/totem-properties-view.h
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (C) 2003 Andrew Sobala <aes@gnome.org>
|
||||
* Copyright (C) 2005 Bastien Nocera <hadess@hadess.net>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU 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
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TOTEM_PROPERTIES_VIEW_H
|
||||
#define TOTEM_PROPERTIES_VIEW_H
|
||||
|
||||
#include <nautilus-extension.h>
|
||||
|
||||
#define TOTEM_TYPE_PROPERTIES_VIEW (totem_properties_view_get_type ())
|
||||
#define TOTEM_PROPERTIES_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOTEM_TYPE_PROPERTIES_VIEW, TotemPropertiesView))
|
||||
#define TOTEM_PROPERTIES_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOTEM_TYPE_PROPERTIES_VIEW, TotemPropertiesViewClass))
|
||||
#define TOTEM_IS_PROPERTIES_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOTEM_TYPE_PROPERTIES_VIEW))
|
||||
#define TOTEM_IS_PROPERTIES_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOTEM_TYPE_PROPERTIES_VIEW))
|
||||
|
||||
typedef struct TotemPropertiesViewPriv TotemPropertiesViewPriv;
|
||||
|
||||
typedef struct {
|
||||
GObject parent;
|
||||
TotemPropertiesViewPriv *priv;
|
||||
} TotemPropertiesView;
|
||||
|
||||
typedef struct {
|
||||
GObjectClass parent;
|
||||
} TotemPropertiesViewClass;
|
||||
|
||||
GType totem_properties_view_get_type (void);
|
||||
void totem_properties_view_register_type (GTypeModule *module);
|
||||
|
||||
NautilusPropertiesModel *totem_properties_view_new (const char *location);
|
||||
|
||||
#endif /* TOTEM_PROPERTIES_VIEW_H */
|
16
extensions/image-properties/meson.build
Normal file
16
extensions/image-properties/meson.build
Normal file
|
@ -0,0 +1,16 @@
|
|||
shared_module (
|
||||
'nautilus-image-properties', [
|
||||
'nautilus-image-properties-module.c',
|
||||
'nautilus-image-properties-model.c',
|
||||
'nautilus-image-properties-model.h',
|
||||
'nautilus-image-properties-model-provider.c',
|
||||
'nautilus-image-properties-model-provider.h'
|
||||
],
|
||||
dependencies: [
|
||||
gexiv,
|
||||
gdkpixbuf,
|
||||
nautilus_extension
|
||||
],
|
||||
install: true,
|
||||
install_dir: extensiondir
|
||||
)
|
|
@ -0,0 +1,127 @@
|
|||
/* Copyright (C) 2004 Red Hat, Inc
|
||||
* Copyright (c) 2007 Novell, Inc.
|
||||
* Copyright (c) 2017 Thomas Bechtold <thomasbechtold@jpberlin.de>
|
||||
* Copyright (c) 2018 Ernestas Kulik <ernestask@gnome.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Alexander Larsson <alexl@redhat.com>
|
||||
* XMP support by Hubert Figuiere <hfiguiere@novell.com>
|
||||
*/
|
||||
|
||||
#include "nautilus-image-properties-model-provider.h"
|
||||
|
||||
#include "nautilus-image-properties-model.h"
|
||||
|
||||
#include <nautilus-extension.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
|
||||
struct _NautilusImagesPropertiesModelProvider
|
||||
{
|
||||
GObject parent_instance;
|
||||
};
|
||||
|
||||
static void properties_group_provider_iface_init (NautilusPropertiesModelProviderInterface *iface);
|
||||
|
||||
G_DEFINE_DYNAMIC_TYPE_EXTENDED (NautilusImagesPropertiesModelProvider,
|
||||
nautilus_image_properties_model_provider,
|
||||
G_TYPE_OBJECT,
|
||||
0,
|
||||
G_IMPLEMENT_INTERFACE_DYNAMIC (NAUTILUS_TYPE_PROPERTIES_MODEL_PROVIDER,
|
||||
properties_group_provider_iface_init))
|
||||
|
||||
static gboolean
|
||||
is_mime_type_supported (const char *mime_type)
|
||||
{
|
||||
g_autoptr (GSList) formats = NULL;
|
||||
|
||||
if (mime_type == NULL)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
formats = gdk_pixbuf_get_formats ();
|
||||
|
||||
for (GSList *l = formats; l != NULL; l = l->next)
|
||||
{
|
||||
g_auto (GStrv) mime_types = NULL;
|
||||
|
||||
mime_types = gdk_pixbuf_format_get_mime_types (l->data);
|
||||
if (mime_types == NULL)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (g_strv_contains ((const char * const *) mime_types, mime_type))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static GList *
|
||||
get_models (NautilusPropertiesModelProvider *provider,
|
||||
GList *files)
|
||||
{
|
||||
NautilusFileInfo *file_info;
|
||||
g_autofree char *mime_type = NULL;
|
||||
NautilusPropertiesModel *properties_group;
|
||||
|
||||
if (files == NULL || files->next != NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
file_info = NAUTILUS_FILE_INFO (files->data);
|
||||
mime_type = nautilus_file_info_get_mime_type (file_info);
|
||||
if (!is_mime_type_supported (mime_type))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
properties_group = nautilus_image_properties_model_new (file_info);
|
||||
|
||||
return g_list_prepend (NULL, properties_group);
|
||||
}
|
||||
|
||||
static void
|
||||
properties_group_provider_iface_init (NautilusPropertiesModelProviderInterface *iface)
|
||||
{
|
||||
iface->get_models = get_models;
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_image_properties_model_provider_init (NautilusImagesPropertiesModelProvider *self)
|
||||
{
|
||||
(void) self;
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_image_properties_model_provider_class_init (NautilusImagesPropertiesModelProviderClass *klass)
|
||||
{
|
||||
(void) klass;
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_image_properties_model_provider_class_finalize (NautilusImagesPropertiesModelProviderClass *klass)
|
||||
{
|
||||
(void) klass;
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_image_properties_model_provider_load (GTypeModule *module)
|
||||
{
|
||||
nautilus_image_properties_model_provider_register_type (module);
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
/* Copyright (C) 2018 Ernestas Kulik <ernestask@gnome.org>
|
||||
*
|
||||
* This file is part of Nautilus.
|
||||
*
|
||||
* Nautilus is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nautilus 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Nautilus. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
#define NAUTILUS_TYPE_IMAGE_PROPERTIES_MODEL_PROVIDER (nautilus_image_properties_model_provider_get_type ())
|
||||
|
||||
G_DECLARE_FINAL_TYPE (NautilusImagesPropertiesModelProvider,
|
||||
nautilus_image_properties_model_provider,
|
||||
NAUTILUS, IMAGE_PROPERTIES_MODEL_PROVIDER,
|
||||
GObject)
|
||||
|
||||
void nautilus_image_properties_model_provider_load (GTypeModule *module);
|
518
extensions/image-properties/nautilus-image-properties-model.c
Normal file
518
extensions/image-properties/nautilus-image-properties-model.c
Normal file
|
@ -0,0 +1,518 @@
|
|||
/* Copyright (C) 2004 Red Hat, Inc
|
||||
* Copyright (c) 2007 Novell, Inc.
|
||||
* Copyright (c) 2017 Thomas Bechtold <thomasbechtold@jpberlin.de>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Alexander Larsson <alexl@redhat.com>
|
||||
* XMP support by Hubert Figuiere <hfiguiere@novell.com>
|
||||
*/
|
||||
|
||||
#include "nautilus-image-properties-model.h"
|
||||
|
||||
#include <gexiv2/gexiv2.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#define LOAD_BUFFER_SIZE 8192
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GListStore *group_model;
|
||||
|
||||
GCancellable *cancellable;
|
||||
GdkPixbufLoader *loader;
|
||||
gboolean got_size;
|
||||
gboolean pixbuf_still_loading;
|
||||
unsigned char buffer[LOAD_BUFFER_SIZE];
|
||||
int width;
|
||||
int height;
|
||||
|
||||
GExiv2Metadata *md;
|
||||
gboolean md_ready;
|
||||
} NautilusImagesPropertiesModel;
|
||||
|
||||
/* tags and their alternatives */
|
||||
const char *title[] = { "Xmp.dc.title", NULL };
|
||||
const char *camera_brand[] = { "Exif.Image.Make", NULL };
|
||||
const char *camera_model[] = { "Exif.Image.Model", "Exif.Image.UniqueCameraModel", NULL };
|
||||
const char *created_on[] = { "Exif.Photo.DateTimeOriginal", "Xmp.xmp.CreateDate", "Exif.Image.DateTime", NULL };
|
||||
const char *exposure_time[] = { "Exif.Photo.ExposureTime", NULL };
|
||||
const char *aperture_value[] = { "Exif.Photo.ApertureValue", NULL };
|
||||
const char *iso_speed_ratings[] = { "Exif.Photo.ISOSpeedRatings", "Xmp.exifEX.ISOSpeed", NULL };
|
||||
const char *flash[] = { "Exif.Photo.Flash", NULL };
|
||||
const char *metering_mode[] = { "Exif.Photo.MeteringMode", NULL };
|
||||
const char *exposure_mode[] = { "Exif.Photo.ExposureMode", NULL };
|
||||
const char *focal_length[] = { "Exif.Photo.FocalLength", NULL };
|
||||
const char *software[] = { "Exif.Image.Software", NULL };
|
||||
const char *description[] = { "Xmp.dc.description", "Exif.Photo.UserComment", NULL };
|
||||
const char *subject[] = { "Xmp.dc.subject", NULL };
|
||||
const char *creator[] = { "Xmp.dc.creator", "Exif.Image.Artist", NULL };
|
||||
const char *rights[] = { "Xmp.dc.rights", NULL };
|
||||
const char *rating[] = { "Xmp.xmp.Rating", NULL };
|
||||
|
||||
static void
|
||||
nautilus_images_properties_model_free (NautilusImagesPropertiesModel *self)
|
||||
{
|
||||
if (self->cancellable != NULL)
|
||||
{
|
||||
g_cancellable_cancel (self->cancellable);
|
||||
g_clear_object (&self->cancellable);
|
||||
}
|
||||
|
||||
if (self->loader != NULL)
|
||||
{
|
||||
gdk_pixbuf_loader_close (self->loader, NULL);
|
||||
g_clear_object (&self->loader);
|
||||
}
|
||||
|
||||
g_clear_object (&self->md);
|
||||
g_clear_object (&self->group_model);
|
||||
|
||||
g_free (self);
|
||||
}
|
||||
|
||||
static void
|
||||
append_item (NautilusImagesPropertiesModel *self,
|
||||
const char *name,
|
||||
const char *value)
|
||||
{
|
||||
g_autoptr (NautilusPropertiesItem) item = NULL;
|
||||
|
||||
item = nautilus_properties_item_new (name, value);
|
||||
g_list_store_append (self->group_model, item);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_image_properties_model_init (NautilusImagesPropertiesModel *self)
|
||||
{
|
||||
self->group_model = g_list_store_new (NAUTILUS_TYPE_PROPERTIES_ITEM);
|
||||
}
|
||||
|
||||
static void
|
||||
append_basic_info (NautilusImagesPropertiesModel *self)
|
||||
{
|
||||
GdkPixbufFormat *format;
|
||||
GExiv2Orientation orientation = GEXIV2_ORIENTATION_UNSPECIFIED;
|
||||
int width;
|
||||
int height;
|
||||
g_autofree char *name = NULL;
|
||||
g_autofree char *desc = NULL;
|
||||
g_autofree char *value = NULL;
|
||||
|
||||
format = gdk_pixbuf_loader_get_format (self->loader);
|
||||
name = gdk_pixbuf_format_get_name (format);
|
||||
desc = gdk_pixbuf_format_get_description (format);
|
||||
value = g_strdup_printf ("%s (%s)", name, desc);
|
||||
|
||||
append_item (self, _("Image Type"), value);
|
||||
|
||||
if (self->md_ready)
|
||||
{
|
||||
orientation = gexiv2_metadata_try_get_orientation (self->md, NULL);
|
||||
}
|
||||
|
||||
if (orientation == GEXIV2_ORIENTATION_ROT_90
|
||||
|| orientation == GEXIV2_ORIENTATION_ROT_270
|
||||
|| orientation == GEXIV2_ORIENTATION_ROT_90_HFLIP
|
||||
|| orientation == GEXIV2_ORIENTATION_ROT_90_VFLIP)
|
||||
{
|
||||
width = self->height;
|
||||
height = self->width;
|
||||
}
|
||||
else
|
||||
{
|
||||
width = self->width;
|
||||
height = self->height;
|
||||
}
|
||||
|
||||
g_free (value);
|
||||
value = g_strdup_printf (ngettext ("%d pixel",
|
||||
"%d pixels",
|
||||
width),
|
||||
width);
|
||||
|
||||
append_item (self, _("Width"), value);
|
||||
|
||||
g_free (value);
|
||||
value = g_strdup_printf (ngettext ("%d pixel",
|
||||
"%d pixels",
|
||||
height),
|
||||
height);
|
||||
|
||||
append_item (self, _("Height"), value);
|
||||
}
|
||||
|
||||
static void
|
||||
format_exif_datetime (gchar **tag_value)
|
||||
{
|
||||
gint year, month, day, hour, minute, seconds, count;
|
||||
|
||||
count = sscanf (*tag_value, "%d:%d:%d %d:%d:%d",
|
||||
&year, &month, &day, &hour, &minute, &seconds);
|
||||
|
||||
if (count == 6)
|
||||
{
|
||||
g_autoptr (GDateTime) datetime = g_date_time_new_utc (year, month, day,
|
||||
hour, minute, seconds);
|
||||
|
||||
if (datetime != NULL)
|
||||
{
|
||||
g_free (*tag_value);
|
||||
/* TODO: Use the date format from Nautilus */
|
||||
*tag_value = g_date_time_format (datetime, "%F %T");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
append_gexiv2_tag (NautilusImagesPropertiesModel *self,
|
||||
const char **tag_names,
|
||||
const char *tag_description)
|
||||
{
|
||||
g_assert (tag_names != NULL);
|
||||
|
||||
for (const char **i = tag_names; *i != NULL; i++)
|
||||
{
|
||||
if (gexiv2_metadata_try_has_tag (self->md, *i, NULL))
|
||||
{
|
||||
g_autofree char *tag_value = NULL;
|
||||
|
||||
tag_value = gexiv2_metadata_try_get_tag_interpreted_string (self->md, *i, NULL);
|
||||
|
||||
if (tag_description == NULL)
|
||||
{
|
||||
tag_description = gexiv2_metadata_try_get_tag_description (*i, NULL);
|
||||
}
|
||||
|
||||
/* don't add empty tags - try next one */
|
||||
if (tag_value != NULL && strlen (tag_value) > 0)
|
||||
{
|
||||
if (tag_names == created_on)
|
||||
{
|
||||
format_exif_datetime (&tag_value);
|
||||
}
|
||||
|
||||
append_item (self, tag_description, tag_value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
append_gexiv2_info (NautilusImagesPropertiesModel *self)
|
||||
{
|
||||
double longitude;
|
||||
double latitude;
|
||||
double altitude;
|
||||
|
||||
if (!self->md_ready)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
append_gexiv2_tag (self, camera_brand, _("Camera Brand"));
|
||||
append_gexiv2_tag (self, camera_model, _("Camera Model"));
|
||||
append_gexiv2_tag (self, exposure_time, _("Exposure Time"));
|
||||
append_gexiv2_tag (self, exposure_mode, _("Exposure Program"));
|
||||
append_gexiv2_tag (self, aperture_value, _("Aperture Value"));
|
||||
append_gexiv2_tag (self, iso_speed_ratings, _("ISO Speed Rating"));
|
||||
append_gexiv2_tag (self, flash, _("Flash Fired"));
|
||||
append_gexiv2_tag (self, metering_mode, _("Metering Mode"));
|
||||
append_gexiv2_tag (self, focal_length, _("Focal Length"));
|
||||
append_gexiv2_tag (self, software, _("Software"));
|
||||
append_gexiv2_tag (self, title, _("Title"));
|
||||
append_gexiv2_tag (self, description, _("Description"));
|
||||
append_gexiv2_tag (self, subject, _("Keywords"));
|
||||
append_gexiv2_tag (self, creator, _("Creator"));
|
||||
append_gexiv2_tag (self, created_on, _("Created On"));
|
||||
append_gexiv2_tag (self, rights, _("Copyright"));
|
||||
append_gexiv2_tag (self, rating, _("Rating"));
|
||||
|
||||
if (gexiv2_metadata_try_get_gps_info (self->md, &longitude, &latitude, &altitude, NULL))
|
||||
{
|
||||
g_autofree char *gps_coords = NULL;
|
||||
|
||||
gps_coords = g_strdup_printf ("%f° %s %f° %s (%.0f m)",
|
||||
fabs (latitude),
|
||||
/* Translators: "N" and "S" stand for
|
||||
* north and south in GPS coordinates. */
|
||||
latitude >= 0 ? _("N") : _("S"),
|
||||
fabs (longitude),
|
||||
/* Translators: "E" and "W" stand for
|
||||
* east and west in GPS coordinates. */
|
||||
longitude >= 0 ? _("E") : _("W"),
|
||||
altitude);
|
||||
|
||||
append_item (self, _("Coordinates"), gps_coords);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
load_finished (NautilusImagesPropertiesModel *self)
|
||||
{
|
||||
if (self->loader != NULL)
|
||||
{
|
||||
gdk_pixbuf_loader_close (self->loader, NULL);
|
||||
}
|
||||
|
||||
if (self->got_size)
|
||||
{
|
||||
append_basic_info (self);
|
||||
append_gexiv2_info (self);
|
||||
}
|
||||
else
|
||||
{
|
||||
append_item (self, _("Oops! Something went wrong."), _("Failed to load image information"));
|
||||
}
|
||||
|
||||
if (self->loader != NULL)
|
||||
{
|
||||
g_object_unref (self->loader);
|
||||
self->loader = NULL;
|
||||
}
|
||||
self->md_ready = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
file_read_callback (GObject *object,
|
||||
GAsyncResult *res,
|
||||
gpointer data)
|
||||
{
|
||||
NautilusImagesPropertiesModel *self;
|
||||
GInputStream *stream;
|
||||
g_autoptr (GError) error = NULL;
|
||||
gssize count_read;
|
||||
gboolean done_reading;
|
||||
|
||||
self = data;
|
||||
stream = G_INPUT_STREAM (object);
|
||||
count_read = g_input_stream_read_finish (stream, res, &error);
|
||||
done_reading = FALSE;
|
||||
|
||||
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
{
|
||||
/* The operation was cancelled and the model was already freed, bailout. */
|
||||
return;
|
||||
}
|
||||
|
||||
if (count_read > 0)
|
||||
{
|
||||
g_assert ((gsize) count_read <= sizeof (self->buffer));
|
||||
|
||||
if (self->pixbuf_still_loading)
|
||||
{
|
||||
if (!gdk_pixbuf_loader_write (self->loader,
|
||||
self->buffer,
|
||||
count_read,
|
||||
NULL))
|
||||
{
|
||||
self->pixbuf_still_loading = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (self->pixbuf_still_loading)
|
||||
{
|
||||
g_input_stream_read_async (G_INPUT_STREAM (stream),
|
||||
self->buffer,
|
||||
sizeof (self->buffer),
|
||||
G_PRIORITY_DEFAULT,
|
||||
self->cancellable,
|
||||
file_read_callback,
|
||||
self);
|
||||
}
|
||||
else
|
||||
{
|
||||
done_reading = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* either EOF, cancelled or an error occurred */
|
||||
done_reading = TRUE;
|
||||
}
|
||||
|
||||
if (error != NULL)
|
||||
{
|
||||
g_autofree char *uri = NULL;
|
||||
|
||||
uri = g_file_get_uri (G_FILE (object));
|
||||
|
||||
g_warning ("Error reading %s: %s", uri, error->message);
|
||||
}
|
||||
|
||||
if (done_reading)
|
||||
{
|
||||
load_finished (self);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
size_prepared_callback (GdkPixbufLoader *loader,
|
||||
int width,
|
||||
int height,
|
||||
gpointer callback_data)
|
||||
{
|
||||
NautilusImagesPropertiesModel *self;
|
||||
|
||||
self = callback_data;
|
||||
|
||||
self->height = height;
|
||||
self->width = width;
|
||||
self->got_size = TRUE;
|
||||
self->pixbuf_still_loading = FALSE;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
NautilusImagesPropertiesModel *self;
|
||||
NautilusFileInfo *file_info;
|
||||
} FileOpenData;
|
||||
|
||||
static void
|
||||
file_open_callback (GObject *object,
|
||||
GAsyncResult *res,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_autofree FileOpenData *data = NULL;
|
||||
NautilusImagesPropertiesModel *self;
|
||||
GFile *file;
|
||||
g_autofree char *uri = NULL;
|
||||
g_autoptr (GError) error = NULL;
|
||||
g_autoptr (GFileInputStream) stream = NULL;
|
||||
|
||||
data = user_data;
|
||||
self = data->self;
|
||||
file = G_FILE (object);
|
||||
uri = g_file_get_uri (file);
|
||||
stream = g_file_read_finish (file, res, &error);
|
||||
|
||||
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
{
|
||||
/* The operation was cancelled and the model was already freed, bailout. */
|
||||
return;
|
||||
}
|
||||
|
||||
if (stream != NULL)
|
||||
{
|
||||
g_autofree char *mime_type = NULL;
|
||||
|
||||
mime_type = nautilus_file_info_get_mime_type (data->file_info);
|
||||
|
||||
self->loader = gdk_pixbuf_loader_new_with_mime_type (mime_type, &error);
|
||||
if (error != NULL)
|
||||
{
|
||||
g_warning ("Error creating loader for %s: %s", uri, error->message);
|
||||
}
|
||||
self->pixbuf_still_loading = TRUE;
|
||||
self->width = 0;
|
||||
self->height = 0;
|
||||
|
||||
g_signal_connect (self->loader,
|
||||
"size-prepared",
|
||||
G_CALLBACK (size_prepared_callback),
|
||||
self);
|
||||
|
||||
g_input_stream_read_async (G_INPUT_STREAM (stream),
|
||||
self->buffer,
|
||||
sizeof (self->buffer),
|
||||
G_PRIORITY_DEFAULT,
|
||||
self->cancellable,
|
||||
file_read_callback,
|
||||
self);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning ("Error reading %s: %s", uri, error->message);
|
||||
load_finished (self);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_image_properties_model_load_from_file_info (NautilusImagesPropertiesModel *self,
|
||||
NautilusFileInfo *file_info)
|
||||
{
|
||||
g_autofree char *uri = NULL;
|
||||
g_autoptr (GFile) file = NULL;
|
||||
g_autofree char *path = NULL;
|
||||
FileOpenData *data;
|
||||
|
||||
g_return_if_fail (file_info != NULL);
|
||||
|
||||
self->cancellable = g_cancellable_new ();
|
||||
|
||||
uri = nautilus_file_info_get_uri (file_info);
|
||||
file = g_file_new_for_uri (uri);
|
||||
path = g_file_get_path (file);
|
||||
|
||||
/* gexiv2 metadata init */
|
||||
self->md_ready = gexiv2_initialize ();
|
||||
if (!self->md_ready)
|
||||
{
|
||||
g_warning ("Unable to initialize gexiv2");
|
||||
}
|
||||
else
|
||||
{
|
||||
self->md = gexiv2_metadata_new ();
|
||||
if (path != NULL)
|
||||
{
|
||||
g_autoptr (GError) error = NULL;
|
||||
|
||||
if (!gexiv2_metadata_open_path (self->md, path, &error))
|
||||
{
|
||||
g_warning ("gexiv2 metadata not supported for '%s': %s", path, error->message);
|
||||
self->md_ready = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
self->md_ready = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
data = g_new0 (FileOpenData, 1);
|
||||
|
||||
data->self = self;
|
||||
data->file_info = file_info;
|
||||
|
||||
g_file_read_async (file,
|
||||
G_PRIORITY_DEFAULT,
|
||||
self->cancellable,
|
||||
file_open_callback,
|
||||
data);
|
||||
}
|
||||
|
||||
NautilusPropertiesModel *
|
||||
nautilus_image_properties_model_new (NautilusFileInfo *file_info)
|
||||
{
|
||||
NautilusImagesPropertiesModel *self;
|
||||
NautilusPropertiesModel *model;
|
||||
|
||||
self = g_new0 (NautilusImagesPropertiesModel, 1);
|
||||
|
||||
nautilus_image_properties_model_init (self);
|
||||
nautilus_image_properties_model_load_from_file_info (self, file_info);
|
||||
|
||||
model = nautilus_properties_model_new (_("Image Properties"),
|
||||
G_LIST_MODEL (self->group_model));
|
||||
|
||||
g_object_weak_ref (G_OBJECT (model),
|
||||
(GWeakNotify) nautilus_images_properties_model_free,
|
||||
self);
|
||||
|
||||
return model;
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
/* Copyright (C) 2004 Red Hat, Inc
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Alexander Larsson <alexl@redhat.com>
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <nautilus-extension.h>
|
||||
|
||||
NautilusPropertiesModel * nautilus_image_properties_model_new (NautilusFileInfo *file_info);
|
|
@ -0,0 +1,54 @@
|
|||
/* Copyright (C) 2018 Ernestas Kulik <ernestask@gnome.org>
|
||||
*
|
||||
* This file is part of Nautilus.
|
||||
*
|
||||
* Nautilus is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nautilus 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Nautilus. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "nautilus-image-properties-model-provider.h"
|
||||
|
||||
#include <glib/gi18n-lib.h>
|
||||
|
||||
#include <nautilus-extension.h>
|
||||
|
||||
void
|
||||
nautilus_module_initialize (GTypeModule *module)
|
||||
{
|
||||
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
|
||||
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
||||
|
||||
nautilus_image_properties_model_provider_load (module);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_module_shutdown (void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_module_list_types (const GType **types,
|
||||
int *num_types)
|
||||
{
|
||||
static GType type_list[1] = { 0 };
|
||||
|
||||
g_assert (types != NULL);
|
||||
g_assert (num_types != NULL);
|
||||
|
||||
type_list[0] = NAUTILUS_TYPE_IMAGE_PROPERTIES_MODEL_PROVIDER;
|
||||
|
||||
*types = type_list;
|
||||
*num_types = G_N_ELEMENTS (type_list);
|
||||
}
|
2
extensions/meson.build
Normal file
2
extensions/meson.build
Normal file
|
@ -0,0 +1,2 @@
|
|||
subdir('image-properties')
|
||||
subdir('audio-video-properties')
|
BIN
icons/filmholes.png
Normal file
BIN
icons/filmholes.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 173 B |
458
libnautilus-extension/LICENSE
Normal file
458
libnautilus-extension/LICENSE
Normal file
|
@ -0,0 +1,458 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
115
libnautilus-extension/meson.build
Normal file
115
libnautilus-extension/meson.build
Normal file
|
@ -0,0 +1,115 @@
|
|||
libnautilus_extension_headers = [
|
||||
'nautilus-column-provider.h',
|
||||
'nautilus-column.h',
|
||||
'nautilus-file-info.h',
|
||||
'nautilus-info-provider.h',
|
||||
'nautilus-menu-provider.h',
|
||||
'nautilus-properties-model-provider.h',
|
||||
'nautilus-properties-model.h',
|
||||
'nautilus-properties-item.h',
|
||||
'nautilus-menu.h'
|
||||
]
|
||||
|
||||
install_headers(
|
||||
'nautilus-extension.h',
|
||||
subdir: 'nautilus'
|
||||
)
|
||||
install_headers(
|
||||
libnautilus_extension_headers,
|
||||
subdir: join_paths('nautilus', 'libnautilus-extension')
|
||||
)
|
||||
|
||||
libnautilus_extension_enums = gnome.mkenums_simple(
|
||||
'nautilus-extension-enum-types',
|
||||
install_header: true,
|
||||
install_dir: join_paths(includedir, 'nautilus', 'libnautilus-extension'),
|
||||
sources: [
|
||||
'nautilus-info-provider.h'
|
||||
]
|
||||
)
|
||||
|
||||
libnautilus_extension_sources = [
|
||||
libnautilus_extension_enums,
|
||||
libnautilus_extension_headers,
|
||||
'nautilus-column-provider.c',
|
||||
'nautilus-column.c',
|
||||
'nautilus-extension.h',
|
||||
'nautilus-extension-private.h',
|
||||
'nautilus-file-info.c',
|
||||
'nautilus-info-provider.c',
|
||||
'nautilus-menu-item.c',
|
||||
'nautilus-menu-provider.c',
|
||||
'nautilus-properties-model-provider.c',
|
||||
'nautilus-properties-model.c',
|
||||
'nautilus-properties-item.c',
|
||||
'nautilus-menu.c'
|
||||
]
|
||||
|
||||
libnautilus_extension_deps = [
|
||||
config_h,
|
||||
glib,
|
||||
gio
|
||||
]
|
||||
|
||||
libnautilus_extension = shared_library(
|
||||
'nautilus-extension', [
|
||||
libnautilus_extension_sources,
|
||||
],
|
||||
c_args: [
|
||||
'-DNAUTILUS_COMPILATION'
|
||||
],
|
||||
dependencies: libnautilus_extension_deps,
|
||||
include_directories: nautilus_include_dirs,
|
||||
soversion: nautilus_extension_version,
|
||||
install: true
|
||||
)
|
||||
|
||||
if get_option('introspection')
|
||||
nautilus_extension_gir = gnome.generate_gir(
|
||||
libnautilus_extension,
|
||||
export_packages: [
|
||||
'libnautilus-extension'
|
||||
],
|
||||
extra_args: [
|
||||
'-DNAUTILUS_COMPILATION'
|
||||
],
|
||||
sources: libnautilus_extension_sources,
|
||||
nsversion: nautilus_extension_version + '.0',
|
||||
namespace: 'Nautilus',
|
||||
includes: [
|
||||
'Gio-2.0',
|
||||
'GLib-2.0'
|
||||
],
|
||||
header: 'nautilus-extension.h',
|
||||
install: true
|
||||
)
|
||||
endif
|
||||
|
||||
nautilus_extension = declare_dependency(
|
||||
sources: libnautilus_extension_enums[1],
|
||||
link_with: libnautilus_extension,
|
||||
dependencies: libnautilus_extension_deps,
|
||||
include_directories: nautilus_include_dirs
|
||||
)
|
||||
|
||||
pkgconfig.generate(
|
||||
description: 'A library to create Nautilus view extensions',
|
||||
filebase: 'libnautilus-extension-' + nautilus_extension_version,
|
||||
libraries: [
|
||||
libnautilus_extension
|
||||
],
|
||||
name: 'libnautilus-extension',
|
||||
subdirs: [
|
||||
'nautilus'
|
||||
],
|
||||
requires: [
|
||||
'gio-2.0',
|
||||
'glib-2.0',
|
||||
],
|
||||
variables: [
|
||||
'exec_prefix=${prefix}',
|
||||
'extensiondir=${libdir}/nautilus/extensions-' + nautilus_extension_version,
|
||||
'extensions_api_version=' + nautilus_extension_version
|
||||
],
|
||||
version: meson.project_version()
|
||||
)
|
45
libnautilus-extension/nautilus-column-provider.c
Normal file
45
libnautilus-extension/nautilus-column-provider.c
Normal file
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* nautilus-column-provider.c - Interface for Nautilus extensions
|
||||
* that provide column specifications.
|
||||
*
|
||||
* Copyright (C) 2003 Novell, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Dave Camp <dave@ximian.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#include "nautilus-column-provider.h"
|
||||
|
||||
G_DEFINE_INTERFACE (NautilusColumnProvider, nautilus_column_provider, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
nautilus_column_provider_default_init (NautilusColumnProviderInterface *klass)
|
||||
{
|
||||
}
|
||||
|
||||
GList *
|
||||
nautilus_column_provider_get_columns (NautilusColumnProvider *self)
|
||||
{
|
||||
NautilusColumnProviderInterface *iface;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_COLUMN_PROVIDER (self), NULL);
|
||||
|
||||
iface = NAUTILUS_COLUMN_PROVIDER_GET_IFACE (self);
|
||||
|
||||
g_return_val_if_fail (iface->get_columns != NULL, NULL);
|
||||
|
||||
return iface->get_columns (self);
|
||||
}
|
78
libnautilus-extension/nautilus-column-provider.h
Normal file
78
libnautilus-extension/nautilus-column-provider.h
Normal file
|
@ -0,0 +1,78 @@
|
|||
/*
|
||||
* nautilus-column-provider.h - Interface for Nautilus extensions that
|
||||
* provide column descriptions.
|
||||
*
|
||||
* Copyright (C) 2003 Novell, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Dave Camp <dave@ximian.com>
|
||||
*
|
||||
*/
|
||||
|
||||
/* This interface is implemented by Nautilus extensions that want to
|
||||
* add columns to the list view and details to the icon view.
|
||||
* Extensions are asked for a list of columns to display. Each
|
||||
* returned column refers to a string attribute which can be filled in
|
||||
* by NautilusInfoProvider */
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined (NAUTILUS_EXTENSION_H) && !defined (NAUTILUS_COMPILATION)
|
||||
#warning "Only <nautilus-extension.h> should be included directly."
|
||||
#endif
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NAUTILUS_TYPE_COLUMN_PROVIDER (nautilus_column_provider_get_type ())
|
||||
|
||||
G_DECLARE_INTERFACE (NautilusColumnProvider, nautilus_column_provider,
|
||||
NAUTILUS, COLUMN_PROVIDER,
|
||||
GObject)
|
||||
|
||||
/**
|
||||
* SECTION:nautilus-column-provider
|
||||
* @title: NautilusColumnProvider
|
||||
* @short_description: Interface to provide additional list view columns
|
||||
*
|
||||
* #NautilusColumnProvider allows extension to provide additional columns
|
||||
* in the file manager list view.
|
||||
*/
|
||||
|
||||
/**
|
||||
* NautilusColumnProviderInterface:
|
||||
* @g_iface: The parent interface.
|
||||
* @get_columns: Returns a #GList of #NautilusColumn.
|
||||
* See nautilus_column_provider_get_columns() for details.
|
||||
*
|
||||
* Interface for extensions to provide additional list view columns.
|
||||
*/
|
||||
struct _NautilusColumnProviderInterface
|
||||
{
|
||||
GTypeInterface g_iface;
|
||||
|
||||
GList *(*get_columns) (NautilusColumnProvider *provider);
|
||||
};
|
||||
|
||||
/**
|
||||
* nautilus_column_provider_get_columns:
|
||||
* @provider: a #NautilusColumnProvider
|
||||
*
|
||||
* Returns: (nullable) (element-type NautilusColumn) (transfer full): the provided #NautilusColumn objects
|
||||
*/
|
||||
GList *nautilus_column_provider_get_columns (NautilusColumnProvider *provider);
|
||||
|
||||
G_END_DECLS
|
355
libnautilus-extension/nautilus-column.c
Normal file
355
libnautilus-extension/nautilus-column.c
Normal file
|
@ -0,0 +1,355 @@
|
|||
/*
|
||||
* nautilus-column.c - Info columns exported by NautilusColumnProvider
|
||||
* objects.
|
||||
*
|
||||
* Copyright (C) 2003 Novell, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Dave Camp <dave@ximian.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#include "nautilus-column.h"
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_NAME,
|
||||
PROP_ATTRIBUTE,
|
||||
PROP_ATTRIBUTE_Q,
|
||||
PROP_LABEL,
|
||||
PROP_DESCRIPTION,
|
||||
PROP_XALIGN,
|
||||
PROP_DEFAULT_SORT_ORDER,
|
||||
PROP_VISIBLE,
|
||||
LAST_PROP
|
||||
};
|
||||
|
||||
struct _NautilusColumn
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
char *name;
|
||||
GQuark attribute;
|
||||
char *label;
|
||||
char *description;
|
||||
float xalign;
|
||||
int default_sort_order; /* Actually, meant to store GtkSortType */
|
||||
gboolean visible;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (NautilusColumn, nautilus_column, G_TYPE_OBJECT);
|
||||
|
||||
NautilusColumn *
|
||||
nautilus_column_new (const char *name,
|
||||
const char *attribute,
|
||||
const char *label,
|
||||
const char *description)
|
||||
{
|
||||
NautilusColumn *column;
|
||||
|
||||
g_return_val_if_fail (name != NULL, NULL);
|
||||
g_return_val_if_fail (attribute != NULL, NULL);
|
||||
g_return_val_if_fail (label != NULL, NULL);
|
||||
g_return_val_if_fail (description != NULL, NULL);
|
||||
|
||||
column = g_object_new (NAUTILUS_TYPE_COLUMN,
|
||||
"name", name,
|
||||
"attribute", attribute,
|
||||
"label", label,
|
||||
"description", description,
|
||||
NULL);
|
||||
|
||||
return column;
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_column_get_property (GObject *object,
|
||||
guint param_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
NautilusColumn *column;
|
||||
|
||||
column = NAUTILUS_COLUMN (object);
|
||||
|
||||
switch (param_id)
|
||||
{
|
||||
case PROP_NAME:
|
||||
{
|
||||
g_value_set_string (value, column->name);
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_ATTRIBUTE:
|
||||
{
|
||||
g_value_set_string (value, g_quark_to_string (column->attribute));
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_ATTRIBUTE_Q:
|
||||
{
|
||||
g_value_set_uint (value, column->attribute);
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_LABEL:
|
||||
{
|
||||
g_value_set_string (value, column->label);
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_DESCRIPTION:
|
||||
{
|
||||
g_value_set_string (value, column->description);
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_XALIGN:
|
||||
{
|
||||
g_value_set_float (value, column->xalign);
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_DEFAULT_SORT_ORDER:
|
||||
{
|
||||
g_value_set_int (value, column->default_sort_order);
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_VISIBLE:
|
||||
{
|
||||
g_value_set_boolean (value, column->visible);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_column_set_property (GObject *object,
|
||||
guint param_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
NautilusColumn *column;
|
||||
|
||||
column = NAUTILUS_COLUMN (object);
|
||||
|
||||
switch (param_id)
|
||||
{
|
||||
case PROP_NAME:
|
||||
{
|
||||
g_free (column->name);
|
||||
column->name = g_strdup (g_value_get_string (value));
|
||||
g_object_notify (object, "name");
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_ATTRIBUTE:
|
||||
{
|
||||
column->attribute = g_quark_from_string (g_value_get_string (value));
|
||||
g_object_notify (object, "attribute");
|
||||
g_object_notify (object, "attribute_q");
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_LABEL:
|
||||
{
|
||||
g_free (column->label);
|
||||
column->label = g_strdup (g_value_get_string (value));
|
||||
g_object_notify (object, "label");
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_DESCRIPTION:
|
||||
{
|
||||
g_free (column->description);
|
||||
column->description = g_strdup (g_value_get_string (value));
|
||||
g_object_notify (object, "description");
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_XALIGN:
|
||||
{
|
||||
column->xalign = g_value_get_float (value);
|
||||
g_object_notify (object, "xalign");
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_DEFAULT_SORT_ORDER:
|
||||
{
|
||||
column->default_sort_order = g_value_get_int (value);
|
||||
g_object_notify (object, "default-sort-order");
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_VISIBLE:
|
||||
{
|
||||
column->visible = g_value_get_boolean (value);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_column_finalize (GObject *object)
|
||||
{
|
||||
NautilusColumn *column;
|
||||
|
||||
column = NAUTILUS_COLUMN (object);
|
||||
|
||||
g_free (column->name);
|
||||
g_free (column->label);
|
||||
g_free (column->description);
|
||||
|
||||
G_OBJECT_CLASS (nautilus_column_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_column_init (NautilusColumn *column)
|
||||
{
|
||||
column->xalign = 0.0;
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_column_class_init (NautilusColumnClass *class)
|
||||
{
|
||||
G_OBJECT_CLASS (class)->finalize = nautilus_column_finalize;
|
||||
G_OBJECT_CLASS (class)->get_property = nautilus_column_get_property;
|
||||
G_OBJECT_CLASS (class)->set_property = nautilus_column_set_property;
|
||||
|
||||
/**
|
||||
* NautilusColumn:name:
|
||||
*
|
||||
* The identifier for the column.
|
||||
*/
|
||||
g_object_class_install_property (G_OBJECT_CLASS (class),
|
||||
PROP_NAME,
|
||||
g_param_spec_string ("name",
|
||||
"Name",
|
||||
"Name of the column",
|
||||
NULL,
|
||||
G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE | G_PARAM_READABLE));
|
||||
|
||||
/**
|
||||
* NautilusColumn:attribute:
|
||||
*
|
||||
* The file attribute to be displayed in the column.
|
||||
*/
|
||||
g_object_class_install_property (G_OBJECT_CLASS (class),
|
||||
PROP_ATTRIBUTE,
|
||||
g_param_spec_string ("attribute",
|
||||
"Attribute",
|
||||
"The attribute name to display",
|
||||
NULL,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
/**
|
||||
* NautilusColumn:attribute_q:
|
||||
*
|
||||
* The name of the attribute to display, in quark form.
|
||||
*/
|
||||
g_object_class_install_property (G_OBJECT_CLASS (class),
|
||||
PROP_ATTRIBUTE_Q,
|
||||
g_param_spec_uint ("attribute_q",
|
||||
"Attribute quark",
|
||||
"The attribute name to display, in quark form",
|
||||
0, G_MAXUINT, 0,
|
||||
G_PARAM_READABLE));
|
||||
|
||||
/**
|
||||
* NautilusColumn:label:
|
||||
*
|
||||
* The label to display in the column.
|
||||
*/
|
||||
g_object_class_install_property (G_OBJECT_CLASS (class),
|
||||
PROP_LABEL,
|
||||
g_param_spec_string ("label",
|
||||
"Label",
|
||||
"Label to display in the column",
|
||||
NULL,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
/**
|
||||
* NautilusColumn:description:
|
||||
*
|
||||
* The user-visible description of the column.
|
||||
*/
|
||||
g_object_class_install_property (G_OBJECT_CLASS (class),
|
||||
PROP_DESCRIPTION,
|
||||
g_param_spec_string ("description",
|
||||
"Description",
|
||||
"A user-visible description of the column",
|
||||
NULL,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
/**
|
||||
* NautilusColumn:xalign:
|
||||
*
|
||||
* The x-alignment of the column.
|
||||
*/
|
||||
g_object_class_install_property (G_OBJECT_CLASS (class),
|
||||
PROP_XALIGN,
|
||||
g_param_spec_float ("xalign",
|
||||
"xalign",
|
||||
"The x-alignment of the column",
|
||||
0.0,
|
||||
1.0,
|
||||
0.0,
|
||||
G_PARAM_READWRITE));
|
||||
/**
|
||||
* NautilusColumn:default-sort-order: (type gboolean)
|
||||
*
|
||||
* Actually meant to store the enum values of GtkSortType, but we don't want
|
||||
* extensions to depend on GTK. Also, this is for internal consumption only.
|
||||
*
|
||||
* Stability: Private: Internal to the application.
|
||||
*/
|
||||
g_object_class_install_property (G_OBJECT_CLASS (class),
|
||||
PROP_DEFAULT_SORT_ORDER,
|
||||
g_param_spec_int ("default-sort-order",
|
||||
"Default sort order",
|
||||
"Default sort order",
|
||||
G_MININT, G_MAXINT, 0,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
/**
|
||||
* NautilusColumn:visible: (type gboolean)
|
||||
*
|
||||
* Whether to show the NautilusColumn in a ColumnChooser.
|
||||
* This is not meant to be used by extensions. The value may be changed
|
||||
* over the life of the NautilusColumn.
|
||||
*
|
||||
* Stability: Private: Internal to the application.
|
||||
*/
|
||||
g_object_class_install_property (G_OBJECT_CLASS (class),
|
||||
PROP_VISIBLE,
|
||||
g_param_spec_boolean ("visible",
|
||||
NULL, NULL,
|
||||
FALSE,
|
||||
G_PARAM_READWRITE));
|
||||
}
|
66
libnautilus-extension/nautilus-column.h
Normal file
66
libnautilus-extension/nautilus-column.h
Normal file
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
* nautilus-column.h - Info columns exported by
|
||||
* NautilusColumnProvider objects.
|
||||
*
|
||||
* Copyright (C) 2003 Novell, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Dave Camp <dave@ximian.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined (NAUTILUS_EXTENSION_H) && !defined (NAUTILUS_COMPILATION)
|
||||
#warning "Only <nautilus-extension.h> should be included directly."
|
||||
#endif
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NAUTILUS_TYPE_COLUMN (nautilus_column_get_type())
|
||||
|
||||
G_DECLARE_FINAL_TYPE (NautilusColumn, nautilus_column, NAUTILUS, COLUMN, GObject)
|
||||
|
||||
/**
|
||||
* NautilusColumn:
|
||||
*
|
||||
* List view column descriptor object.
|
||||
*
|
||||
* `NautilusColumn` is an object that describes a column in the file manager
|
||||
* list view. Extensions can provide `NautilusColumn` by registering a
|
||||
* [iface@ColumnProvider] and returning them from
|
||||
* [method@ColumnProvider.get_columns], which will be called by the main
|
||||
* application when creating a view.
|
||||
*/
|
||||
|
||||
/**
|
||||
* nautilus_column_new:
|
||||
* @name: (not nullable): identifier of the column
|
||||
* @attribute: (not nullable): the file attribute to be displayed in the column
|
||||
* @label: (not nullable): the user-visible label for the column
|
||||
* @description: (not nullable): a user-visible description of the column
|
||||
*
|
||||
* Creates a new [class@Column] object.
|
||||
*
|
||||
* Returns: (transfer full): a new #NautilusColumn
|
||||
*/
|
||||
NautilusColumn *nautilus_column_new (const char *name,
|
||||
const char *attribute,
|
||||
const char *label,
|
||||
const char *description);
|
||||
|
||||
G_END_DECLS
|
31
libnautilus-extension/nautilus-extension-private.h
Normal file
31
libnautilus-extension/nautilus-extension-private.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* nautilus-extension-private.h - Type definitions for Nautilus extensions
|
||||
*
|
||||
* Copyright (C) 2009 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Alexander Larsson <alexl@redhat.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <libnautilus-extension/nautilus-file-info.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
extern NautilusFileInfo *(*nautilus_file_info_getter) (GFile *location, gboolean create);
|
||||
|
||||
G_END_DECLS
|
66
libnautilus-extension/nautilus-extension.h
Normal file
66
libnautilus-extension/nautilus-extension.h
Normal file
|
@ -0,0 +1,66 @@
|
|||
/* Copyright (C) 2018 Ernestas Kulik <ernestask@gnome.org>
|
||||
*
|
||||
* This file is part of libnautilus-extension.
|
||||
*
|
||||
* libnautilus-extension 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.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* libnautilus-extension 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 libnautilus-extension. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define NAUTILUS_EXTENSION_H
|
||||
|
||||
#include <libnautilus-extension/nautilus-column-provider.h>
|
||||
#include <libnautilus-extension/nautilus-column.h>
|
||||
#include <libnautilus-extension/nautilus-extension-enum-types.h>
|
||||
#include <libnautilus-extension/nautilus-file-info.h>
|
||||
#include <libnautilus-extension/nautilus-info-provider.h>
|
||||
#include <libnautilus-extension/nautilus-menu.h>
|
||||
#include <libnautilus-extension/nautilus-menu-provider.h>
|
||||
#include <libnautilus-extension/nautilus-properties-model.h>
|
||||
#include <libnautilus-extension/nautilus-properties-model-provider.h>
|
||||
#include <libnautilus-extension/nautilus-properties-item.h>
|
||||
|
||||
/**
|
||||
* SECTION:nautilus-extension
|
||||
* @title: Extension entry points
|
||||
*/
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* nautilus_module_initialize: (skip)
|
||||
* @module: a #GTypeModule used in type registration
|
||||
*
|
||||
* Called when the extension is begin loaded to register the types it exports
|
||||
* and to perform other initializations.
|
||||
*/
|
||||
void nautilus_module_initialize (GTypeModule *module);
|
||||
/**
|
||||
* nautilus_module_shutdown: (skip)
|
||||
*
|
||||
* Called when the extension is being unloaded.
|
||||
*/
|
||||
void nautilus_module_shutdown (void);
|
||||
/**
|
||||
* nautilus_module_list_types: (skip)
|
||||
* @types: (out) (transfer none) (array length=num_types): array of GType *
|
||||
* @num_types: the number of types in the array
|
||||
*
|
||||
* Called after the extension has been initialized and has registered all the
|
||||
* types it exports, to load them into Nautilus.
|
||||
*/
|
||||
void nautilus_module_list_types (const GType **types,
|
||||
int *num_types);
|
||||
|
||||
G_END_DECLS
|
376
libnautilus-extension/nautilus-file-info.c
Normal file
376
libnautilus-extension/nautilus-file-info.c
Normal file
|
@ -0,0 +1,376 @@
|
|||
/*
|
||||
* nautilus-file-info.c - Information about a file
|
||||
*
|
||||
* Copyright (C) 2003 Novell, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "nautilus-file-info.h"
|
||||
|
||||
#include "nautilus-extension-private.h"
|
||||
|
||||
G_DEFINE_INTERFACE (NautilusFileInfo, nautilus_file_info, G_TYPE_OBJECT)
|
||||
|
||||
NautilusFileInfo * (*nautilus_file_info_getter)(GFile *location,
|
||||
gboolean create);
|
||||
|
||||
GList *
|
||||
nautilus_file_info_list_copy (GList *files)
|
||||
{
|
||||
GList *ret;
|
||||
GList *l;
|
||||
|
||||
ret = g_list_copy (files);
|
||||
for (l = ret; l != NULL; l = l->next)
|
||||
{
|
||||
g_object_ref (G_OBJECT (l->data));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_file_info_list_free (GList *files)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
for (l = files; l != NULL; l = l->next)
|
||||
{
|
||||
g_object_unref (G_OBJECT (l->data));
|
||||
}
|
||||
|
||||
g_list_free (files);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_file_info_default_init (NautilusFileInfoInterface *klass)
|
||||
{
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_file_info_is_gone (NautilusFileInfo *self)
|
||||
{
|
||||
NautilusFileInfoInterface *iface;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (self), FALSE);
|
||||
|
||||
iface = NAUTILUS_FILE_INFO_GET_IFACE (self);
|
||||
|
||||
g_return_val_if_fail (iface->is_gone != NULL, FALSE);
|
||||
|
||||
return iface->is_gone (self);
|
||||
}
|
||||
|
||||
GFileType
|
||||
nautilus_file_info_get_file_type (NautilusFileInfo *self)
|
||||
{
|
||||
NautilusFileInfoInterface *iface;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (self), G_FILE_TYPE_UNKNOWN);
|
||||
|
||||
iface = NAUTILUS_FILE_INFO_GET_IFACE (self);
|
||||
|
||||
g_return_val_if_fail (iface->get_file_type != NULL, G_FILE_TYPE_UNKNOWN);
|
||||
|
||||
return iface->get_file_type (self);
|
||||
}
|
||||
|
||||
char *
|
||||
nautilus_file_info_get_name (NautilusFileInfo *self)
|
||||
{
|
||||
NautilusFileInfoInterface *iface;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (self), NULL);
|
||||
|
||||
iface = NAUTILUS_FILE_INFO_GET_IFACE (self);
|
||||
|
||||
g_return_val_if_fail (iface->get_name != NULL, NULL);
|
||||
|
||||
return iface->get_name (self);
|
||||
}
|
||||
|
||||
GFile *
|
||||
nautilus_file_info_get_location (NautilusFileInfo *self)
|
||||
{
|
||||
NautilusFileInfoInterface *iface;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (self), NULL);
|
||||
|
||||
iface = NAUTILUS_FILE_INFO_GET_IFACE (self);
|
||||
|
||||
g_return_val_if_fail (iface->get_location != NULL, NULL);
|
||||
|
||||
return iface->get_location (self);
|
||||
}
|
||||
char *
|
||||
nautilus_file_info_get_uri (NautilusFileInfo *self)
|
||||
{
|
||||
NautilusFileInfoInterface *iface;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (self), NULL);
|
||||
|
||||
iface = NAUTILUS_FILE_INFO_GET_IFACE (self);
|
||||
|
||||
g_return_val_if_fail (iface->get_uri != NULL, NULL);
|
||||
|
||||
return iface->get_uri (self);
|
||||
}
|
||||
|
||||
char *
|
||||
nautilus_file_info_get_activation_uri (NautilusFileInfo *self)
|
||||
{
|
||||
NautilusFileInfoInterface *iface;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (self), NULL);
|
||||
|
||||
iface = NAUTILUS_FILE_INFO_GET_IFACE (self);
|
||||
|
||||
g_return_val_if_fail (iface->get_activation_uri != NULL, NULL);
|
||||
|
||||
return iface->get_activation_uri (self);
|
||||
}
|
||||
|
||||
GFile *
|
||||
nautilus_file_info_get_parent_location (NautilusFileInfo *self)
|
||||
{
|
||||
NautilusFileInfoInterface *iface;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (self), NULL);
|
||||
|
||||
iface = NAUTILUS_FILE_INFO_GET_IFACE (self);
|
||||
|
||||
g_return_val_if_fail (iface->get_parent_location != NULL, NULL);
|
||||
|
||||
return iface->get_parent_location (self);
|
||||
}
|
||||
|
||||
char *
|
||||
nautilus_file_info_get_parent_uri (NautilusFileInfo *self)
|
||||
{
|
||||
NautilusFileInfoInterface *iface;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (self), NULL);
|
||||
|
||||
iface = NAUTILUS_FILE_INFO_GET_IFACE (self);
|
||||
|
||||
g_return_val_if_fail (iface->get_parent_uri != NULL, NULL);
|
||||
|
||||
return iface->get_parent_uri (self);
|
||||
}
|
||||
|
||||
NautilusFileInfo *
|
||||
nautilus_file_info_get_parent_info (NautilusFileInfo *self)
|
||||
{
|
||||
NautilusFileInfoInterface *iface;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (self), NULL);
|
||||
|
||||
iface = NAUTILUS_FILE_INFO_GET_IFACE (self);
|
||||
|
||||
g_return_val_if_fail (iface->get_parent_info != NULL, NULL);
|
||||
|
||||
return iface->get_parent_info (self);
|
||||
}
|
||||
|
||||
GMount *
|
||||
nautilus_file_info_get_mount (NautilusFileInfo *self)
|
||||
{
|
||||
NautilusFileInfoInterface *iface;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (self), NULL);
|
||||
|
||||
iface = NAUTILUS_FILE_INFO_GET_IFACE (self);
|
||||
|
||||
g_return_val_if_fail (iface->get_mount != NULL, NULL);
|
||||
|
||||
return iface->get_mount (self);
|
||||
}
|
||||
|
||||
char *
|
||||
nautilus_file_info_get_uri_scheme (NautilusFileInfo *self)
|
||||
{
|
||||
NautilusFileInfoInterface *iface;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (self), NULL);
|
||||
|
||||
iface = NAUTILUS_FILE_INFO_GET_IFACE (self);
|
||||
|
||||
g_return_val_if_fail (iface->get_uri_scheme != NULL, NULL);
|
||||
|
||||
return iface->get_uri_scheme (self);
|
||||
}
|
||||
|
||||
char *
|
||||
nautilus_file_info_get_mime_type (NautilusFileInfo *self)
|
||||
{
|
||||
NautilusFileInfoInterface *iface;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (self), NULL);
|
||||
|
||||
iface = NAUTILUS_FILE_INFO_GET_IFACE (self);
|
||||
|
||||
g_return_val_if_fail (iface->get_mime_type != NULL, NULL);
|
||||
|
||||
return iface->get_mime_type (self);
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_file_info_is_mime_type (NautilusFileInfo *self,
|
||||
const char *mime_type)
|
||||
{
|
||||
NautilusFileInfoInterface *iface;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (self), FALSE);
|
||||
g_return_val_if_fail (mime_type != NULL, FALSE);
|
||||
|
||||
iface = NAUTILUS_FILE_INFO_GET_IFACE (self);
|
||||
|
||||
g_return_val_if_fail (iface->is_mime_type != NULL, FALSE);
|
||||
|
||||
return iface->is_mime_type (self, mime_type);
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_file_info_is_directory (NautilusFileInfo *self)
|
||||
{
|
||||
NautilusFileInfoInterface *iface;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (self), FALSE);
|
||||
|
||||
iface = NAUTILUS_FILE_INFO_GET_IFACE (self);
|
||||
|
||||
g_return_val_if_fail (iface->is_directory != NULL, FALSE);
|
||||
|
||||
return iface->is_directory (self);
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_file_info_can_write (NautilusFileInfo *self)
|
||||
{
|
||||
NautilusFileInfoInterface *iface;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (self), FALSE);
|
||||
|
||||
iface = NAUTILUS_FILE_INFO_GET_IFACE (self);
|
||||
|
||||
g_return_val_if_fail (iface->can_write != NULL, FALSE);
|
||||
|
||||
return iface->can_write (self);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_file_info_add_emblem (NautilusFileInfo *self,
|
||||
const char *emblem_name)
|
||||
{
|
||||
NautilusFileInfoInterface *iface;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_FILE_INFO (self));
|
||||
g_return_if_fail (emblem_name != NULL && emblem_name[0] != '\0');
|
||||
|
||||
iface = NAUTILUS_FILE_INFO_GET_IFACE (self);
|
||||
|
||||
g_return_if_fail (iface->add_emblem != NULL);
|
||||
|
||||
iface->add_emblem (self, emblem_name);
|
||||
}
|
||||
|
||||
char *
|
||||
nautilus_file_info_get_string_attribute (NautilusFileInfo *self,
|
||||
const char *attribute_name)
|
||||
{
|
||||
NautilusFileInfoInterface *iface;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (self), NULL);
|
||||
g_return_val_if_fail (attribute_name != NULL, NULL);
|
||||
|
||||
iface = NAUTILUS_FILE_INFO_GET_IFACE (self);
|
||||
|
||||
g_return_val_if_fail (iface->get_string_attribute != NULL, NULL);
|
||||
|
||||
return iface->get_string_attribute (self, attribute_name);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_file_info_add_string_attribute (NautilusFileInfo *self,
|
||||
const char *attribute_name,
|
||||
const char *value)
|
||||
{
|
||||
NautilusFileInfoInterface *iface;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_FILE_INFO (self));
|
||||
g_return_if_fail (attribute_name != NULL);
|
||||
g_return_if_fail (value != NULL);
|
||||
|
||||
iface = NAUTILUS_FILE_INFO_GET_IFACE (self);
|
||||
|
||||
g_return_if_fail (iface->add_string_attribute != NULL);
|
||||
|
||||
iface->add_string_attribute (self, attribute_name, value);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_file_info_invalidate_extension_info (NautilusFileInfo *self)
|
||||
{
|
||||
NautilusFileInfoInterface *iface;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_FILE_INFO (self));
|
||||
|
||||
iface = NAUTILUS_FILE_INFO_GET_IFACE (self);
|
||||
|
||||
g_return_if_fail (iface->invalidate_extension_info != NULL);
|
||||
|
||||
iface->invalidate_extension_info (self);
|
||||
}
|
||||
|
||||
NautilusFileInfo *
|
||||
nautilus_file_info_lookup (GFile *location)
|
||||
{
|
||||
g_return_val_if_fail (G_IS_FILE (location), NULL);
|
||||
|
||||
return nautilus_file_info_getter (location, FALSE);
|
||||
}
|
||||
|
||||
NautilusFileInfo *
|
||||
nautilus_file_info_create (GFile *location)
|
||||
{
|
||||
g_return_val_if_fail (G_IS_FILE (location), NULL);
|
||||
|
||||
return nautilus_file_info_getter (location, TRUE);
|
||||
}
|
||||
|
||||
NautilusFileInfo *
|
||||
nautilus_file_info_lookup_for_uri (const char *uri)
|
||||
{
|
||||
g_autoptr (GFile) location = NULL;
|
||||
|
||||
g_return_val_if_fail (uri != NULL, NULL);
|
||||
|
||||
location = g_file_new_for_uri (uri);
|
||||
|
||||
return nautilus_file_info_lookup (location);
|
||||
}
|
||||
|
||||
NautilusFileInfo *
|
||||
nautilus_file_info_create_for_uri (const char *uri)
|
||||
{
|
||||
g_autoptr (GFile) location = NULL;
|
||||
|
||||
g_return_val_if_fail (uri != NULL, NULL);
|
||||
|
||||
location = g_file_new_for_uri (uri);
|
||||
|
||||
return nautilus_file_info_create (location);
|
||||
}
|
328
libnautilus-extension/nautilus-file-info.h
Normal file
328
libnautilus-extension/nautilus-file-info.h
Normal file
|
@ -0,0 +1,328 @@
|
|||
/*
|
||||
* nautilus-file-info.h - Information about a file
|
||||
*
|
||||
* Copyright (C) 2003 Novell, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/* NautilusFileInfo is an interface to the NautilusFile object. It
|
||||
* provides access to the asynchronous data in the NautilusFile.
|
||||
* Extensions are passed objects of this type for operations. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined (NAUTILUS_EXTENSION_H) && !defined (NAUTILUS_COMPILATION)
|
||||
#warning "Only <nautilus-extension.h> should be included directly."
|
||||
#endif
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gio/gio.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NAUTILUS_TYPE_FILE_INFO (nautilus_file_info_get_type ())
|
||||
|
||||
G_DECLARE_INTERFACE (NautilusFileInfo, nautilus_file_info, NAUTILUS, FILE_INFO, GObject)
|
||||
|
||||
/**
|
||||
* SECTION:nautilus-file-info
|
||||
* @title: NautilusFileInfo
|
||||
* @short_description: File interface for nautilus extensions
|
||||
*
|
||||
* #NautilusFileInfo provides methods to get and modify information
|
||||
* about file objects in the file manager.
|
||||
*/
|
||||
|
||||
/**
|
||||
* NautilusFileInfoInterface:
|
||||
* @g_iface: The parent interface.
|
||||
* @is_gone: Returns whether the file info is gone.
|
||||
* See nautilus_file_info_is_gone() for details.
|
||||
* @get_name: Returns the file name as a string.
|
||||
* See nautilus_file_info_get_name() for details.
|
||||
* @get_uri: Returns the file URI as a string.
|
||||
* See nautilus_file_info_get_uri() for details.
|
||||
* @get_parent_uri: Returns the file parent URI as a string.
|
||||
* See nautilus_file_info_get_parent_uri() for details.
|
||||
* @get_uri_scheme: Returns the file URI scheme as a string.
|
||||
* See nautilus_file_info_get_uri_scheme() for details.
|
||||
* @get_mime_type: Returns the file mime type as a string.
|
||||
* See nautilus_file_info_get_mime_type() for details.
|
||||
* @is_mime_type: Returns whether the file is the given mime type.
|
||||
* See nautilus_file_info_is_mime_type() for details.
|
||||
* @is_directory: Returns whether the file is a directory.
|
||||
* See nautilus_file_info_is_directory() for details.
|
||||
* @add_emblem: Adds an emblem to this file.
|
||||
* See nautilus_file_info_add_emblem() for details.
|
||||
* @get_string_attribute: Returns the specified file attribute as a string.
|
||||
* See nautilus_file_info_get_string_attribute() for details.
|
||||
* @add_string_attribute: Sets the specified string file attribute value.
|
||||
* See nautilus_file_info_add_string_attribute() for details.
|
||||
* @invalidate_extension_info: Invalidates information of the file provided by extensions.
|
||||
* See nautilus_file_info_invalidate_extension_info() for details.
|
||||
* @get_activation_uri: Returns the file activation URI as a string.
|
||||
* See nautilus_file_info_get_activation_uri() for details.
|
||||
* @get_file_type: Returns the file type.
|
||||
* See nautilus_file_info_get_file_type() for details.
|
||||
* @get_location: Returns the file location as a #GFile.
|
||||
* See nautilus_file_info_get_location() for details.
|
||||
* @get_parent_location: Returns the file parent location as a #GFile.
|
||||
* See nautilus_file_info_get_parent_location() for details.
|
||||
* @get_parent_info: Returns the file parent #NautilusFileInfo.
|
||||
* See nautilus_file_info_get_parent_info() for details.
|
||||
* @get_mount: Returns the file mount as a #GMount.
|
||||
* See nautilus_file_info_get_mount() for details.
|
||||
* @can_write: Returns whether the file is writable.
|
||||
* See nautilus_file_info_can_write() for details.
|
||||
*
|
||||
* Interface for extensions to provide additional menu items.
|
||||
*/
|
||||
struct _NautilusFileInfoInterface
|
||||
{
|
||||
GTypeInterface g_iface;
|
||||
|
||||
gboolean (*is_gone) (NautilusFileInfo *file_info);
|
||||
|
||||
char *(*get_name) (NautilusFileInfo *file_info);
|
||||
char *(*get_uri) (NautilusFileInfo *file_info);
|
||||
char *(*get_parent_uri) (NautilusFileInfo *file_info);
|
||||
char *(*get_uri_scheme) (NautilusFileInfo *file_info);
|
||||
|
||||
char *(*get_mime_type) (NautilusFileInfo *file_info);
|
||||
gboolean (*is_mime_type) (NautilusFileInfo *file_info,
|
||||
const char *mime_type);
|
||||
gboolean (*is_directory) (NautilusFileInfo *file_info);
|
||||
|
||||
void (*add_emblem) (NautilusFileInfo *file_info,
|
||||
const char *emblem_name);
|
||||
char *(*get_string_attribute) (NautilusFileInfo *file_info,
|
||||
const char *attribute_name);
|
||||
void (*add_string_attribute) (NautilusFileInfo *file_info,
|
||||
const char *attribute_name,
|
||||
const char *value);
|
||||
void (*invalidate_extension_info) (NautilusFileInfo *file_info);
|
||||
|
||||
char *(*get_activation_uri) (NautilusFileInfo *file_info);
|
||||
|
||||
GFileType (*get_file_type) (NautilusFileInfo *file_info);
|
||||
GFile *(*get_location) (NautilusFileInfo *file_info);
|
||||
GFile *(*get_parent_location) (NautilusFileInfo *file_info);
|
||||
NautilusFileInfo *(*get_parent_info) (NautilusFileInfo *file_info);
|
||||
GMount *(*get_mount) (NautilusFileInfo *file_info);
|
||||
gboolean (*can_write) (NautilusFileInfo *file_info);
|
||||
};
|
||||
|
||||
/**
|
||||
* nautilus_file_info_list_copy:
|
||||
* @files: (element-type NautilusFileInfo): the files to copy
|
||||
*
|
||||
* Returns: (element-type NautilusFileInfo) (transfer full): a copy of @files.
|
||||
* Use #nautilus_file_info_list_free to free the list and unref its contents.
|
||||
*/
|
||||
GList *nautilus_file_info_list_copy (GList *files);
|
||||
/**
|
||||
* nautilus_file_info_list_free:
|
||||
* @files: (element-type NautilusFileInfo): a list created with #nautilus_file_info_list_copy
|
||||
*
|
||||
*/
|
||||
void nautilus_file_info_list_free (GList *files);
|
||||
|
||||
/**
|
||||
* nautilus_file_info_is_gone:
|
||||
* @file_info: a #NautilusFileInfo
|
||||
*
|
||||
* Returns: whether the file has been deleted
|
||||
*/
|
||||
gboolean nautilus_file_info_is_gone (NautilusFileInfo *file_info);
|
||||
|
||||
/* Name and Location */
|
||||
/**
|
||||
* nautilus_file_info_get_file_type:
|
||||
* @file_info: a #NautilusFileInfo
|
||||
*
|
||||
* Returns: a #GFileType for the location of @file_info
|
||||
*/
|
||||
GFileType nautilus_file_info_get_file_type (NautilusFileInfo *file_info);
|
||||
/**
|
||||
* nautilus_file_info_get_location:
|
||||
* @file_info: a #NautilusFileInfo
|
||||
*
|
||||
* Returns: (transfer full): a #GFile for the location of @file_info
|
||||
*/
|
||||
GFile *nautilus_file_info_get_location (NautilusFileInfo *file_info);
|
||||
/**
|
||||
* nautilus_file_info_get_name:
|
||||
* @file_info: a #NautilusFileInfo
|
||||
*
|
||||
* Returns: the file name of @file_info
|
||||
*/
|
||||
char *nautilus_file_info_get_name (NautilusFileInfo *file_info);
|
||||
/**
|
||||
* nautilus_file_info_get_uri:
|
||||
* @file_info: a #NautilusFileInfo
|
||||
*
|
||||
* Returns: the file URI of @file_info
|
||||
*/
|
||||
char *nautilus_file_info_get_uri (NautilusFileInfo *file_info);
|
||||
/**
|
||||
* nautilus_file_info_get_activation_uri:
|
||||
* @file_info: a #NautilusFileInfo
|
||||
*
|
||||
* Returns: the activation URI of @file_info, which may differ from the actual
|
||||
* URI if e.g. the file is a .desktop file or a Nautilus XML link file
|
||||
*/
|
||||
char *nautilus_file_info_get_activation_uri (NautilusFileInfo *file_info);
|
||||
/**
|
||||
* nautilus_file_info_get_parent_location:
|
||||
* @file_info: a #NautilusFileInfo
|
||||
*
|
||||
* Returns: (allow-none) (transfer full): a #GFile for the parent location of @file_info,
|
||||
* or %NULL if @file_info has no parent
|
||||
*/
|
||||
GFile *nautilus_file_info_get_parent_location (NautilusFileInfo *file_info);
|
||||
/**
|
||||
* nautilus_file_info_get_parent_uri:
|
||||
* @file_info: a #NautilusFileInfo
|
||||
*
|
||||
* Returns: the URI for the parent location of @file_info, or the empty string
|
||||
* if it has none
|
||||
*/
|
||||
char *nautilus_file_info_get_parent_uri (NautilusFileInfo *file_info);
|
||||
/**
|
||||
* nautilus_file_info_get_mount:
|
||||
* @file_info: a #NautilusFileInfo
|
||||
*
|
||||
* Returns: (nullable) (transfer full): a #GMount for the mount of @file_info,
|
||||
* or %NULL if @file_info has no mount
|
||||
*/
|
||||
GMount *nautilus_file_info_get_mount (NautilusFileInfo *file_info);
|
||||
/**
|
||||
* nautilus_file_info_get_uri_scheme:
|
||||
* @file_info: a #NautilusFileInfo
|
||||
*
|
||||
* Returns: the URI scheme of @file_info
|
||||
*/
|
||||
char *nautilus_file_info_get_uri_scheme (NautilusFileInfo *file_info);
|
||||
/**
|
||||
* nautilus_file_info_get_parent_info:
|
||||
* @file_info: a #NautilusFileInfo
|
||||
*
|
||||
* It's not safe to call this recursively multiple times, as it works
|
||||
* only for files already cached by Nautilus.
|
||||
*
|
||||
* Returns: (nullable) (transfer full): a #NautilusFileInfo for the parent of @file_info,
|
||||
* or %NULL if @file_info has no parent.
|
||||
*/
|
||||
NautilusFileInfo *nautilus_file_info_get_parent_info (NautilusFileInfo *file_info);
|
||||
|
||||
/**
|
||||
* nautilus_file_info_get_mime_type:
|
||||
* @file_info: a #NautilusFileInfo
|
||||
*
|
||||
* Returns: (transfer full): the MIME type of @file_info
|
||||
*/
|
||||
char * nautilus_file_info_get_mime_type (NautilusFileInfo *file_info);
|
||||
/**
|
||||
* nautilus_file_info_is_mime_type:
|
||||
* @file_info: a #NautilusFileInfo
|
||||
* @mime_type: a MIME type
|
||||
*
|
||||
* Returns: %TRUE when the MIME type of @file_info matches @mime_type, and
|
||||
* %FALSE otherwise
|
||||
*/
|
||||
gboolean nautilus_file_info_is_mime_type (NautilusFileInfo *file_info,
|
||||
const char *mime_type);
|
||||
/**
|
||||
* nautilus_file_info_is_directory:
|
||||
* @file_info: a #NautilusFileInfo
|
||||
*
|
||||
* Returns: %TRUE when @file_info is a directory, and %FALSE otherwise
|
||||
*/
|
||||
gboolean nautilus_file_info_is_directory (NautilusFileInfo *file_info);
|
||||
/**
|
||||
* nautilus_file_info_can_write:
|
||||
* @file_info: a #NautilusFileInfo
|
||||
*
|
||||
* Returns: %TRUE when @file_info is writeable, and %FALSE otherwise
|
||||
*/
|
||||
gboolean nautilus_file_info_can_write (NautilusFileInfo *file_info);
|
||||
|
||||
|
||||
/* Modifying the NautilusFileInfo */
|
||||
/**
|
||||
* nautilus_file_info_add_emblem:
|
||||
* @file_info: a #NautilusFileInfo
|
||||
* @emblem_name: the name of an emblem
|
||||
*/
|
||||
void nautilus_file_info_add_emblem (NautilusFileInfo *file_info,
|
||||
const char *emblem_name);
|
||||
/**
|
||||
* nautilus_file_info_get_string_attribute:
|
||||
* @file_info: a #NautilusFileInfo
|
||||
* @attribute_name: the name of an attribute
|
||||
*
|
||||
* Returns: (nullable): the value for the given @attribute_name, or %NULL if
|
||||
* there is none
|
||||
*/
|
||||
char *nautilus_file_info_get_string_attribute (NautilusFileInfo *file_info,
|
||||
const char *attribute_name);
|
||||
/**
|
||||
* nautilus_file_info_add_string_attribute:
|
||||
* @file_info: a #NautilusFileInfo
|
||||
* @attribute_name: the name of an attribute
|
||||
* @value: the name of an attribute
|
||||
*/
|
||||
void nautilus_file_info_add_string_attribute (NautilusFileInfo *file_info,
|
||||
const char *attribute_name,
|
||||
const char *value);
|
||||
|
||||
/* Invalidating file info */
|
||||
/**
|
||||
* nautilus_file_info_invalidate_extension_info:
|
||||
* @file_info: a #NautilusFileInfo
|
||||
*/
|
||||
void nautilus_file_info_invalidate_extension_info (NautilusFileInfo *file_info);
|
||||
|
||||
/**
|
||||
* nautilus_file_info_lookup:
|
||||
* @location: the location for which to look up a corresponding #NautilusFileInfo object
|
||||
*
|
||||
* Returns: (nullable) (transfer full): a #NautilusFileInfo
|
||||
*/
|
||||
NautilusFileInfo *nautilus_file_info_lookup (GFile *location);
|
||||
/**
|
||||
* nautilus_file_info_create:
|
||||
* @location: the location to create the file info for
|
||||
*
|
||||
* Returns: (transfer full): a #NautilusFileInfo
|
||||
*/
|
||||
NautilusFileInfo *nautilus_file_info_create (GFile *location);
|
||||
/**
|
||||
* nautilus_file_info_lookup_for_uri:
|
||||
* @uri: the URI to lookup the file info for
|
||||
*
|
||||
* Returns: (nullable) (transfer full): a #NautilusFileInfo
|
||||
*/
|
||||
NautilusFileInfo *nautilus_file_info_lookup_for_uri (const char *uri);
|
||||
/**
|
||||
* nautilus_file_info_create_for_uri:
|
||||
* @uri: the URI to lookup the file info for
|
||||
*
|
||||
* Returns: (transfer full): a #NautilusFileInfo
|
||||
*/
|
||||
NautilusFileInfo *nautilus_file_info_create_for_uri (const char *uri);
|
||||
|
||||
G_END_DECLS
|
98
libnautilus-extension/nautilus-info-provider.c
Normal file
98
libnautilus-extension/nautilus-info-provider.c
Normal file
|
@ -0,0 +1,98 @@
|
|||
/*
|
||||
* nautilus-info-provider.c - Interface for Nautilus extensions that
|
||||
* provide info about files.
|
||||
*
|
||||
* Copyright (C) 2003 Novell, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Dave Camp <dave@ximian.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#include "nautilus-info-provider.h"
|
||||
|
||||
#include "nautilus-extension-enum-types.h"
|
||||
|
||||
G_DEFINE_INTERFACE (NautilusInfoProvider, nautilus_info_provider, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
nautilus_info_provider_default_init (NautilusInfoProviderInterface *klass)
|
||||
{
|
||||
}
|
||||
|
||||
NautilusOperationResult
|
||||
nautilus_info_provider_update_file_info (NautilusInfoProvider *self,
|
||||
NautilusFileInfo *file,
|
||||
GClosure *update_complete,
|
||||
NautilusOperationHandle **handle)
|
||||
{
|
||||
NautilusInfoProviderInterface *iface;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_INFO_PROVIDER (self),
|
||||
NAUTILUS_OPERATION_FAILED);
|
||||
g_return_val_if_fail (update_complete != NULL,
|
||||
NAUTILUS_OPERATION_FAILED);
|
||||
g_return_val_if_fail (handle != NULL, NAUTILUS_OPERATION_FAILED);
|
||||
|
||||
iface = NAUTILUS_INFO_PROVIDER_GET_IFACE (self);
|
||||
|
||||
g_return_val_if_fail (iface->update_file_info != NULL,
|
||||
NAUTILUS_OPERATION_FAILED);
|
||||
|
||||
return iface->update_file_info (self, file, update_complete, handle);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_info_provider_cancel_update (NautilusInfoProvider *self,
|
||||
NautilusOperationHandle *handle)
|
||||
{
|
||||
NautilusInfoProviderInterface *iface;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_INFO_PROVIDER (self));
|
||||
g_return_if_fail (handle != NULL);
|
||||
|
||||
iface = NAUTILUS_INFO_PROVIDER_GET_IFACE (self);
|
||||
|
||||
g_return_if_fail (iface->cancel_update != NULL);
|
||||
|
||||
iface->cancel_update (self, handle);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_info_provider_update_complete_invoke (GClosure *update_complete,
|
||||
NautilusInfoProvider *provider,
|
||||
NautilusOperationHandle *handle,
|
||||
NautilusOperationResult result)
|
||||
{
|
||||
GValue args[3] = { { 0, } };
|
||||
GValue return_val = { 0, };
|
||||
|
||||
g_return_if_fail (update_complete != NULL);
|
||||
g_return_if_fail (NAUTILUS_IS_INFO_PROVIDER (provider));
|
||||
|
||||
g_value_init (&args[0], NAUTILUS_TYPE_INFO_PROVIDER);
|
||||
g_value_init (&args[1], G_TYPE_POINTER);
|
||||
g_value_init (&args[2], NAUTILUS_TYPE_OPERATION_RESULT);
|
||||
|
||||
g_value_set_object (&args[0], provider);
|
||||
g_value_set_pointer (&args[1], handle);
|
||||
g_value_set_enum (&args[2], result);
|
||||
|
||||
g_closure_invoke (update_complete, &return_val, 3, args, NULL);
|
||||
|
||||
g_value_unset (&args[0]);
|
||||
g_value_unset (&args[1]);
|
||||
g_value_unset (&args[2]);
|
||||
}
|
156
libnautilus-extension/nautilus-info-provider.h
Normal file
156
libnautilus-extension/nautilus-info-provider.h
Normal file
|
@ -0,0 +1,156 @@
|
|||
/*
|
||||
* nautilus-info-provider.h - Interface for Nautilus extensions that
|
||||
* provide info about files.
|
||||
*
|
||||
* Copyright (C) 2003 Novell, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Dave Camp <dave@ximian.com>
|
||||
*
|
||||
*/
|
||||
|
||||
/* This interface is implemented by Nautilus extensions that want to
|
||||
* provide information about files. Extensions are called when Nautilus
|
||||
* needs information about a file. They are passed a NautilusFileInfo
|
||||
* object which should be filled with relevant information */
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined (NAUTILUS_EXTENSION_H) && !defined (NAUTILUS_COMPILATION)
|
||||
#warning "Only <nautilus-extension.h> should be included directly."
|
||||
#endif
|
||||
|
||||
#include <glib-object.h>
|
||||
#include "nautilus-file-info.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NAUTILUS_TYPE_INFO_PROVIDER (nautilus_info_provider_get_type ())
|
||||
|
||||
G_DECLARE_INTERFACE (NautilusInfoProvider, nautilus_info_provider,
|
||||
NAUTILUS, INFO_PROVIDER,
|
||||
GObject)
|
||||
|
||||
/**
|
||||
* SECTION:nautilus-info-provider
|
||||
* @title: NautilusInfoProvider
|
||||
* @short_description: Interface to provide additional information about files
|
||||
*
|
||||
* #NautilusInfoProvider allows extension to provide additional information about
|
||||
* files. When nautilus_info_provider_update_file_info() is called by the application,
|
||||
* extensions will know that it's time to add extra information to the provided
|
||||
* #NautilusFileInfo.
|
||||
*/
|
||||
|
||||
/**
|
||||
* NautilusOperationHandle:
|
||||
*
|
||||
* Handle for asynchronous interfaces. These are opaque handles that must
|
||||
* be unique within an extension object. These are returned by operations
|
||||
* that return #NAUTILUS_OPERATION_IN_PROGRESS.
|
||||
*/
|
||||
typedef struct _NautilusOperationHandle NautilusOperationHandle;
|
||||
|
||||
/**
|
||||
* NautilusOperationResult:
|
||||
* @NAUTILUS_OPERATION_COMPLETE: the operation succeeded, and the extension
|
||||
* is done with the request.
|
||||
* @NAUTILUS_OPERATION_FAILED: the operation failed.
|
||||
* @NAUTILUS_OPERATION_IN_PROGRESS: the extension has begin an async operation.
|
||||
* When this value is returned, the extension must set the handle parameter
|
||||
* and call the callback closure when the operation is complete.
|
||||
*
|
||||
* Return values for asynchronous operations performed by the extension.
|
||||
* See nautilus_info_provider_update_file_info().
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
/* Returned if the call succeeded, and the extension is done
|
||||
* with the request */
|
||||
NAUTILUS_OPERATION_COMPLETE,
|
||||
|
||||
/* Returned if the call failed */
|
||||
NAUTILUS_OPERATION_FAILED,
|
||||
|
||||
/* Returned if the extension has begun an async operation.
|
||||
* If this is returned, the extension must set the handle
|
||||
* parameter and call the callback closure when the
|
||||
* operation is complete. */
|
||||
NAUTILUS_OPERATION_IN_PROGRESS
|
||||
} NautilusOperationResult;
|
||||
|
||||
/**
|
||||
* NautilusInfoProviderInterface:
|
||||
* @g_iface: The parent interface.
|
||||
* @update_file_info: Returns a #NautilusOperationResult.
|
||||
* See nautilus_info_provider_update_file_info() for details.
|
||||
* @cancel_update: Cancels a previous call to nautilus_info_provider_update_file_info().
|
||||
* See nautilus_info_provider_cancel_update() for details.
|
||||
*
|
||||
* Interface for extensions to provide additional information about files.
|
||||
*/
|
||||
struct _NautilusInfoProviderInterface
|
||||
{
|
||||
GTypeInterface g_iface;
|
||||
|
||||
NautilusOperationResult (*update_file_info) (NautilusInfoProvider *provider,
|
||||
NautilusFileInfo *file,
|
||||
GClosure *update_complete,
|
||||
NautilusOperationHandle **handle);
|
||||
void (*cancel_update) (NautilusInfoProvider *provider,
|
||||
NautilusOperationHandle *handle);
|
||||
};
|
||||
|
||||
/* Interface Functions */
|
||||
/**
|
||||
* nautilus_info_provider_update_file_info:
|
||||
* @provider: a #NautilusInfoProvider
|
||||
* @file: a #NautilusFileInfo
|
||||
* @update_complete: the closure to invoke at some later time when returning
|
||||
* @NAUTILUS_OPERATION_IN_PROGRESS.
|
||||
* @handle: (transfer none) (nullable) (out): an opaque #NautilusOperationHandle
|
||||
* that must be set when returning @NAUTILUS_OPERATION_IN_PROGRESS.
|
||||
*
|
||||
* Returns: A #NautilusOperationResult.
|
||||
*/
|
||||
NautilusOperationResult nautilus_info_provider_update_file_info (NautilusInfoProvider *provider,
|
||||
NautilusFileInfo *file,
|
||||
GClosure *update_complete,
|
||||
NautilusOperationHandle **handle);
|
||||
/**
|
||||
* nautilus_info_provider_cancel_update:
|
||||
* @provider: a #NautilusInfoProvider
|
||||
* @handle: the opaque #NautilusOperationHandle returned from a previous call to
|
||||
* nautilus_info_provider_update_file_info().
|
||||
*/
|
||||
void nautilus_info_provider_cancel_update (NautilusInfoProvider *provider,
|
||||
NautilusOperationHandle *handle);
|
||||
|
||||
|
||||
|
||||
/* Helper functions for implementations */
|
||||
/**
|
||||
* nautilus_info_provider_update_complete_invoke:
|
||||
* @update_complete: a #GClosure
|
||||
* @provider: a #NautilusInfoProvider
|
||||
* @handle: an opaque #NautilusOperationHandle
|
||||
* @result: a #NautilusOperationResult
|
||||
*/
|
||||
void nautilus_info_provider_update_complete_invoke (GClosure *update_complete,
|
||||
NautilusInfoProvider *provider,
|
||||
NautilusOperationHandle *handle,
|
||||
NautilusOperationResult result);
|
||||
|
||||
G_END_DECLS
|
348
libnautilus-extension/nautilus-menu-item.c
Normal file
348
libnautilus-extension/nautilus-menu-item.c
Normal file
|
@ -0,0 +1,348 @@
|
|||
/*
|
||||
* nautilus-menu-item.c - Menu items exported by NautilusMenuProvider
|
||||
* objects.
|
||||
*
|
||||
* Copyright (C) 2003 Novell, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Dave Camp <dave@ximian.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <glib/gi18n-lib.h>
|
||||
#include "nautilus-menu.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *name;
|
||||
char *label;
|
||||
char *tip;
|
||||
char *icon;
|
||||
NautilusMenu *menu;
|
||||
gboolean sensitive;
|
||||
gboolean priority;
|
||||
} NautilusMenuItemPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (NautilusMenuItem, nautilus_menu_item, G_TYPE_OBJECT)
|
||||
|
||||
enum
|
||||
{
|
||||
ACTIVATE,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_NAME,
|
||||
PROP_LABEL,
|
||||
PROP_TIP,
|
||||
PROP_ICON,
|
||||
PROP_SENSITIVE,
|
||||
PROP_PRIORITY,
|
||||
PROP_MENU,
|
||||
LAST_PROP
|
||||
};
|
||||
|
||||
static guint signals[LAST_SIGNAL];
|
||||
|
||||
NautilusMenuItem *
|
||||
nautilus_menu_item_new (const char *name,
|
||||
const char *label,
|
||||
const char *tip,
|
||||
const char *icon)
|
||||
{
|
||||
NautilusMenuItem *item;
|
||||
|
||||
g_return_val_if_fail (name != NULL, NULL);
|
||||
g_return_val_if_fail (label != NULL, NULL);
|
||||
|
||||
item = g_object_new (NAUTILUS_TYPE_MENU_ITEM,
|
||||
"name", name,
|
||||
"label", label,
|
||||
"tip", tip,
|
||||
"icon", icon,
|
||||
NULL);
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_menu_item_activate (NautilusMenuItem *self)
|
||||
{
|
||||
g_return_if_fail (NAUTILUS_IS_MENU_ITEM (self));
|
||||
|
||||
g_signal_emit (self, signals[ACTIVATE], 0);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_menu_item_set_submenu (NautilusMenuItem *self,
|
||||
NautilusMenu *menu)
|
||||
{
|
||||
g_return_if_fail (NAUTILUS_IS_MENU_ITEM (self));
|
||||
|
||||
g_object_set (self, "menu", menu, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_menu_item_get_property (GObject *object,
|
||||
guint param_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
NautilusMenuItem *item;
|
||||
NautilusMenuItemPrivate *priv;
|
||||
|
||||
item = NAUTILUS_MENU_ITEM (object);
|
||||
priv = nautilus_menu_item_get_instance_private (item);
|
||||
|
||||
switch (param_id)
|
||||
{
|
||||
case PROP_NAME:
|
||||
{
|
||||
g_value_set_string (value, priv->name);
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_LABEL:
|
||||
{
|
||||
g_value_set_string (value, priv->label);
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_TIP:
|
||||
{
|
||||
g_value_set_string (value, priv->tip);
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_ICON:
|
||||
{
|
||||
g_value_set_string (value, priv->icon);
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_SENSITIVE:
|
||||
{
|
||||
g_value_set_boolean (value, priv->sensitive);
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_PRIORITY:
|
||||
{
|
||||
g_value_set_boolean (value, priv->priority);
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_MENU:
|
||||
{
|
||||
g_value_set_object (value, priv->menu);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_menu_item_set_property (GObject *object,
|
||||
guint param_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
NautilusMenuItem *item;
|
||||
NautilusMenuItemPrivate *priv;
|
||||
|
||||
item = NAUTILUS_MENU_ITEM (object);
|
||||
priv = nautilus_menu_item_get_instance_private (item);
|
||||
|
||||
switch (param_id)
|
||||
{
|
||||
case PROP_NAME:
|
||||
{
|
||||
g_free (priv->name);
|
||||
priv->name = g_strdup (g_value_get_string (value));
|
||||
g_object_notify (object, "name");
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_LABEL:
|
||||
{
|
||||
g_free (priv->label);
|
||||
priv->label = g_strdup (g_value_get_string (value));
|
||||
g_object_notify (object, "label");
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_TIP:
|
||||
{
|
||||
g_free (priv->tip);
|
||||
priv->tip = g_strdup (g_value_get_string (value));
|
||||
g_object_notify (object, "tip");
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_ICON:
|
||||
{
|
||||
g_free (priv->icon);
|
||||
priv->icon = g_strdup (g_value_get_string (value));
|
||||
g_object_notify (object, "icon");
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_SENSITIVE:
|
||||
{
|
||||
priv->sensitive = g_value_get_boolean (value);
|
||||
g_object_notify (object, "sensitive");
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_PRIORITY:
|
||||
{
|
||||
priv->priority = g_value_get_boolean (value);
|
||||
g_object_notify (object, "priority");
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_MENU:
|
||||
{
|
||||
if (priv->menu)
|
||||
{
|
||||
g_object_unref (priv->menu);
|
||||
}
|
||||
priv->menu = g_object_ref (g_value_get_object (value));
|
||||
g_object_notify (object, "menu");
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_menu_item_finalize (GObject *object)
|
||||
{
|
||||
NautilusMenuItem *item;
|
||||
NautilusMenuItemPrivate *priv;
|
||||
|
||||
item = NAUTILUS_MENU_ITEM (object);
|
||||
priv = nautilus_menu_item_get_instance_private (item);
|
||||
|
||||
g_free (priv->name);
|
||||
g_free (priv->label);
|
||||
g_free (priv->tip);
|
||||
g_free (priv->icon);
|
||||
if (priv->menu)
|
||||
{
|
||||
g_object_unref (priv->menu);
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (nautilus_menu_item_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_menu_item_init (NautilusMenuItem *self)
|
||||
{
|
||||
NautilusMenuItemPrivate *priv;
|
||||
|
||||
priv = nautilus_menu_item_get_instance_private (self);
|
||||
|
||||
priv->sensitive = TRUE;
|
||||
priv->menu = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_menu_item_class_init (NautilusMenuItemClass *class)
|
||||
{
|
||||
G_OBJECT_CLASS (class)->finalize = nautilus_menu_item_finalize;
|
||||
G_OBJECT_CLASS (class)->get_property = nautilus_menu_item_get_property;
|
||||
G_OBJECT_CLASS (class)->set_property = nautilus_menu_item_set_property;
|
||||
|
||||
/**
|
||||
* NautilusMenuItem::activate:
|
||||
* @item: the object which received the signal
|
||||
*
|
||||
* Signals that the user has activated this menu item.
|
||||
*/
|
||||
signals[ACTIVATE] =
|
||||
g_signal_new ("activate",
|
||||
G_TYPE_FROM_CLASS (class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (NautilusMenuItemClass,
|
||||
activate),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
g_object_class_install_property (G_OBJECT_CLASS (class),
|
||||
PROP_NAME,
|
||||
g_param_spec_string ("name",
|
||||
"Name",
|
||||
"Name of the item",
|
||||
NULL,
|
||||
G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE | G_PARAM_READABLE));
|
||||
g_object_class_install_property (G_OBJECT_CLASS (class),
|
||||
PROP_LABEL,
|
||||
g_param_spec_string ("label",
|
||||
"Label",
|
||||
"Label to display to the user",
|
||||
NULL,
|
||||
G_PARAM_READWRITE));
|
||||
g_object_class_install_property (G_OBJECT_CLASS (class),
|
||||
PROP_TIP,
|
||||
g_param_spec_string ("tip",
|
||||
"Tip",
|
||||
"Tooltip for the menu item",
|
||||
NULL,
|
||||
G_PARAM_READWRITE));
|
||||
g_object_class_install_property (G_OBJECT_CLASS (class),
|
||||
PROP_ICON,
|
||||
g_param_spec_string ("icon",
|
||||
"Icon",
|
||||
"Name of the icon to display in the menu item",
|
||||
NULL,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_object_class_install_property (G_OBJECT_CLASS (class),
|
||||
PROP_SENSITIVE,
|
||||
g_param_spec_boolean ("sensitive",
|
||||
"Sensitive",
|
||||
"Whether the menu item is sensitive",
|
||||
TRUE,
|
||||
G_PARAM_READWRITE));
|
||||
g_object_class_install_property (G_OBJECT_CLASS (class),
|
||||
PROP_PRIORITY,
|
||||
g_param_spec_boolean ("priority",
|
||||
"Priority",
|
||||
"Show priority text in toolbars",
|
||||
TRUE,
|
||||
G_PARAM_READWRITE));
|
||||
g_object_class_install_property (G_OBJECT_CLASS (class),
|
||||
PROP_MENU,
|
||||
g_param_spec_object ("menu",
|
||||
"Menu",
|
||||
"The menu belonging to this item. May be null.",
|
||||
NAUTILUS_TYPE_MENU,
|
||||
G_PARAM_READWRITE));
|
||||
}
|
94
libnautilus-extension/nautilus-menu-provider.c
Normal file
94
libnautilus-extension/nautilus-menu-provider.c
Normal file
|
@ -0,0 +1,94 @@
|
|||
/*
|
||||
* nautilus-property-page-provider.c - Interface for Nautilus extensions
|
||||
* that provide context menu items
|
||||
* for files.
|
||||
*
|
||||
* Copyright (C) 2003 Novell, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Dave Camp <dave@ximian.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "nautilus-menu-provider.h"
|
||||
|
||||
G_DEFINE_INTERFACE (NautilusMenuProvider, nautilus_menu_provider, G_TYPE_OBJECT)
|
||||
|
||||
enum
|
||||
{
|
||||
ITEMS_UPDATED,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
static guint signals[LAST_SIGNAL];
|
||||
|
||||
static void
|
||||
nautilus_menu_provider_default_init (NautilusMenuProviderInterface *klass)
|
||||
{
|
||||
/* This signal should be emited each time the extension modify the list of menu items */
|
||||
signals[ITEMS_UPDATED] = g_signal_new ("items-updated",
|
||||
NAUTILUS_TYPE_MENU_PROVIDER,
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
}
|
||||
|
||||
GList *
|
||||
nautilus_menu_provider_get_file_items (NautilusMenuProvider *provider,
|
||||
GList *files)
|
||||
{
|
||||
NautilusMenuProviderInterface *iface;
|
||||
|
||||
iface = NAUTILUS_MENU_PROVIDER_GET_IFACE (provider);
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_MENU_PROVIDER (provider), NULL);
|
||||
|
||||
if (iface->get_file_items != NULL)
|
||||
{
|
||||
return iface->get_file_items (provider, files);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GList *
|
||||
nautilus_menu_provider_get_background_items (NautilusMenuProvider *provider,
|
||||
NautilusFileInfo *current_folder)
|
||||
{
|
||||
NautilusMenuProviderInterface *iface;
|
||||
|
||||
iface = NAUTILUS_MENU_PROVIDER_GET_IFACE (provider);
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_MENU_PROVIDER (provider), NULL);
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (current_folder), NULL);
|
||||
|
||||
if (iface->get_background_items != NULL)
|
||||
{
|
||||
return iface->get_background_items (provider, current_folder);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_menu_provider_emit_items_updated_signal (NautilusMenuProvider *provider)
|
||||
{
|
||||
g_return_if_fail (NAUTILUS_IS_MENU_PROVIDER (provider));
|
||||
|
||||
g_signal_emit (provider, signals[ITEMS_UPDATED], 0);
|
||||
}
|
102
libnautilus-extension/nautilus-menu-provider.h
Normal file
102
libnautilus-extension/nautilus-menu-provider.h
Normal file
|
@ -0,0 +1,102 @@
|
|||
/*
|
||||
* nautilus-menu-provider.h - Interface for Nautilus extensions that
|
||||
* provide context menu items.
|
||||
*
|
||||
* Copyright (C) 2003 Novell, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Dave Camp <dave@ximian.com>
|
||||
*
|
||||
*/
|
||||
|
||||
/* This interface is implemented by Nautilus extensions that want to
|
||||
* add context menu entries to files. Extensions are called when
|
||||
* Nautilus constructs the context menu for a file. They are passed a
|
||||
* list of NautilusFileInfo objects which holds the current selection */
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined (NAUTILUS_EXTENSION_H) && !defined (NAUTILUS_COMPILATION)
|
||||
#warning "Only <nautilus-extension.h> should be included directly."
|
||||
#endif
|
||||
|
||||
#include <glib-object.h>
|
||||
#include "nautilus-file-info.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NAUTILUS_TYPE_MENU_PROVIDER (nautilus_menu_provider_get_type ())
|
||||
|
||||
G_DECLARE_INTERFACE (NautilusMenuProvider, nautilus_menu_provider,
|
||||
NAUTILUS, MENU_PROVIDER,
|
||||
GObject)
|
||||
|
||||
/**
|
||||
* SECTION:nautilus-menu-provider
|
||||
* @title: NautilusMenuProvider
|
||||
* @short_description: Interface to provide additional menu items
|
||||
*
|
||||
* #NautilusMenuProvider allows extension to provide additional menu items
|
||||
* in the file manager menus.
|
||||
*/
|
||||
|
||||
/**
|
||||
* NautilusMenuProviderInterface:
|
||||
* @g_iface: The parent interface.
|
||||
* @get_file_items: Returns a #GList of #NautilusMenuItem.
|
||||
* See nautilus_menu_provider_get_file_items() for details.
|
||||
* @get_background_items: Returns a #GList of #NautilusMenuItem.
|
||||
* See nautilus_menu_provider_get_background_items() for details.
|
||||
*
|
||||
* Interface for extensions to provide additional menu items.
|
||||
*/
|
||||
struct _NautilusMenuProviderInterface
|
||||
{
|
||||
GTypeInterface g_iface;
|
||||
|
||||
GList *(*get_file_items) (NautilusMenuProvider *provider,
|
||||
GList *files);
|
||||
GList *(*get_background_items) (NautilusMenuProvider *provider,
|
||||
NautilusFileInfo *current_folder);
|
||||
};
|
||||
|
||||
/**
|
||||
* nautilus_menu_provider_get_file_items:
|
||||
* @provider: a #NautilusMenuProvider
|
||||
* @files: (element-type NautilusFileInfo): a list of #NautilusFileInfo
|
||||
*
|
||||
* Returns: (nullable) (element-type NautilusMenuItem) (transfer full): the provided list of #NautilusMenuItem.
|
||||
*/
|
||||
GList *nautilus_menu_provider_get_file_items (NautilusMenuProvider *provider,
|
||||
GList *files);
|
||||
/**
|
||||
* nautilus_menu_provider_get_background_items:
|
||||
* @provider: a #NautilusMenuProvider
|
||||
* @current_folder: the folder for which background items are requested
|
||||
*
|
||||
* Returns: (nullable) (element-type NautilusMenuItem) (transfer full): the provided list of #NautilusMenuItem.
|
||||
*/
|
||||
GList *nautilus_menu_provider_get_background_items (NautilusMenuProvider *provider,
|
||||
NautilusFileInfo *current_folder);
|
||||
|
||||
/**
|
||||
* nautilus_menu_provider_emit_items_updated_signal:
|
||||
* @provider: a #NautilusMenuProvider
|
||||
*
|
||||
* Emits #NautilusMenuProvider::items-updated.
|
||||
*/
|
||||
void nautilus_menu_provider_emit_items_updated_signal (NautilusMenuProvider *provider);
|
||||
|
||||
G_END_DECLS
|
98
libnautilus-extension/nautilus-menu.c
Normal file
98
libnautilus-extension/nautilus-menu.c
Normal file
|
@ -0,0 +1,98 @@
|
|||
/*
|
||||
* nautilus-menu.h - Menus exported by NautilusMenuProvider objects.
|
||||
*
|
||||
* Copyright (C) 2005 Raffaele Sandrini
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Raffaele Sandrini <rasa@gmx.ch>
|
||||
*
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "nautilus-menu.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib/gi18n-lib.h>
|
||||
|
||||
struct _NautilusMenu
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
GList *item_list;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (NautilusMenu, nautilus_menu, G_TYPE_OBJECT);
|
||||
|
||||
void
|
||||
nautilus_menu_append_item (NautilusMenu *self,
|
||||
NautilusMenuItem *menu_item)
|
||||
{
|
||||
g_return_if_fail (NAUTILUS_IS_MENU (self));
|
||||
g_return_if_fail (NAUTILUS_IS_MENU_ITEM (menu_item));
|
||||
|
||||
self->item_list = g_list_append (self->item_list, g_object_ref (menu_item));
|
||||
}
|
||||
|
||||
GList *
|
||||
nautilus_menu_get_items (NautilusMenu *self)
|
||||
{
|
||||
GList *item_list;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_MENU (self), NULL);
|
||||
|
||||
item_list = g_list_copy (self->item_list);
|
||||
g_list_foreach (item_list, (GFunc) g_object_ref, NULL);
|
||||
|
||||
return item_list;
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_menu_item_list_free (GList *item_list)
|
||||
{
|
||||
g_return_if_fail (item_list != NULL);
|
||||
|
||||
g_list_foreach (item_list, (GFunc) g_object_unref, NULL);
|
||||
g_list_free (item_list);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_menu_finalize (GObject *object)
|
||||
{
|
||||
NautilusMenu *menu = NAUTILUS_MENU (object);
|
||||
|
||||
g_clear_pointer (&menu->item_list, g_list_free);
|
||||
|
||||
G_OBJECT_CLASS (nautilus_menu_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_menu_init (NautilusMenu *self)
|
||||
{
|
||||
self->item_list = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_menu_class_init (NautilusMenuClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = nautilus_menu_finalize;
|
||||
}
|
||||
|
||||
NautilusMenu *
|
||||
nautilus_menu_new (void)
|
||||
{
|
||||
return g_object_new (NAUTILUS_TYPE_MENU, NULL);
|
||||
}
|
143
libnautilus-extension/nautilus-menu.h
Normal file
143
libnautilus-extension/nautilus-menu.h
Normal file
|
@ -0,0 +1,143 @@
|
|||
/*
|
||||
* nautilus-menu.h - Menus exported by NautilusMenuProvider objects.
|
||||
*
|
||||
* Copyright (C) 2005 Raffaele Sandrini
|
||||
* Copyright (C) 2003 Novell, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Dave Camp <dave@ximian.com>
|
||||
* Raffaele Sandrini <rasa@gmx.ch>
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined (NAUTILUS_EXTENSION_H) && !defined (NAUTILUS_COMPILATION)
|
||||
#warning "Only <nautilus-extension.h> should be included directly."
|
||||
#endif
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NAUTILUS_TYPE_MENU (nautilus_menu_get_type ())
|
||||
#define NAUTILUS_TYPE_MENU_ITEM (nautilus_menu_item_get_type ())
|
||||
|
||||
G_DECLARE_FINAL_TYPE (NautilusMenu, nautilus_menu,
|
||||
NAUTILUS, MENU,
|
||||
GObject)
|
||||
G_DECLARE_DERIVABLE_TYPE (NautilusMenuItem, nautilus_menu_item,
|
||||
NAUTILUS, MENU_ITEM,
|
||||
GObject)
|
||||
|
||||
/**
|
||||
* SECTION:nautilus-menu
|
||||
* @title: NautilusMenu
|
||||
* @short_description: Menu descriptor object
|
||||
*
|
||||
* #NautilusMenu is an object that describes a submenu in a file manager
|
||||
* menu. Extensions can provide #NautilusMenu objects by attaching them to
|
||||
* #NautilusMenuItem objects, using nautilus_menu_item_set_submenu().
|
||||
*
|
||||
* ## Menu Items
|
||||
*
|
||||
* #NautilusMenuItem is an object that describes an item in a file manager
|
||||
* menu. Extensions can provide #NautilusMenuItem objects by registering a
|
||||
* #NautilusMenuProvider and returning them from
|
||||
* nautilus_menu_provider_get_file_items(), or
|
||||
* nautilus_menu_provider_get_background_items(), which will be called by the
|
||||
* main application when creating menus.
|
||||
*/
|
||||
|
||||
struct _NautilusMenuItemClass
|
||||
{
|
||||
GObjectClass parent;
|
||||
|
||||
void (*activate) (NautilusMenuItem *item);
|
||||
};
|
||||
|
||||
/**
|
||||
* nautilus_menu_new:
|
||||
*
|
||||
* Returns: a new #NautilusMenu.
|
||||
*/
|
||||
NautilusMenu *nautilus_menu_new (void);
|
||||
|
||||
/**
|
||||
* nautilus_menu_append_item:
|
||||
* @menu: a #NautilusMenu
|
||||
* @item: (transfer full): a #NautilusMenuItem to append
|
||||
*/
|
||||
void nautilus_menu_append_item (NautilusMenu *menu,
|
||||
NautilusMenuItem *item);
|
||||
/**
|
||||
* nautilus_menu_get_items:
|
||||
* @menu: a #NautilusMenu
|
||||
*
|
||||
* Returns: (nullable) (element-type NautilusMenuItem) (transfer full): the provided #NautilusMenuItem list
|
||||
*/
|
||||
GList *nautilus_menu_get_items (NautilusMenu *menu);
|
||||
/**
|
||||
* nautilus_menu_item_list_free:
|
||||
* @item_list: (element-type NautilusMenuItem): a list of #NautilusMenuItem
|
||||
*
|
||||
*/
|
||||
void nautilus_menu_item_list_free (GList *item_list);
|
||||
|
||||
/**
|
||||
* nautilus_menu_item_new:
|
||||
* @name: the identifier for the menu item
|
||||
* @label: the user-visible label of the menu item
|
||||
* @tip: (nullable): the tooltip of the menu item
|
||||
* @icon: (nullable): the name of the icon to display in the menu item
|
||||
*
|
||||
* Creates a new menu item that can be added to the toolbar or to a contextual menu.
|
||||
*
|
||||
* Returns: (transfer full): a new #NautilusMenuItem
|
||||
*/
|
||||
NautilusMenuItem *nautilus_menu_item_new (const char *name,
|
||||
const char *label,
|
||||
const char *tip,
|
||||
const char *icon);
|
||||
|
||||
/**
|
||||
* nautilus_menu_item_activate:
|
||||
* @item: pointer to a #NautilusMenuItem
|
||||
*
|
||||
* Emits #NautilusMenuItem::activate.
|
||||
*/
|
||||
void nautilus_menu_item_activate (NautilusMenuItem *item);
|
||||
/**
|
||||
* nautilus_menu_item_set_submenu:
|
||||
* @item: pointer to a #NautilusMenuItem
|
||||
* @menu: (transfer full): pointer to a #NautilusMenu to attach to the button
|
||||
*
|
||||
* Attaches a menu to the given #NautilusMenuItem.
|
||||
*/
|
||||
void nautilus_menu_item_set_submenu (NautilusMenuItem *item,
|
||||
NautilusMenu *menu);
|
||||
|
||||
/* NautilusMenuItem has the following properties:
|
||||
* name (string) - the identifier for the menu item
|
||||
* label (string) - the user-visible label of the menu item
|
||||
* tip (string) - the tooltip of the menu item
|
||||
* icon (string) - the name of the icon to display in the menu item
|
||||
* sensitive (boolean) - whether the menu item is sensitive or not
|
||||
* priority (boolean) - used for toolbar items, whether to show priority
|
||||
* text.
|
||||
* menu (NautilusMenu) - The menu belonging to this item. May be null.
|
||||
*/
|
||||
|
||||
G_END_DECLS
|
149
libnautilus-extension/nautilus-properties-item.c
Normal file
149
libnautilus-extension/nautilus-properties-item.c
Normal file
|
@ -0,0 +1,149 @@
|
|||
/*
|
||||
* Copyright (C) 2022 António Fernandes <antoniof@gnome.org>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "nautilus-properties-item.h"
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_NAME,
|
||||
PROP_VALUE,
|
||||
LAST_PROP
|
||||
};
|
||||
|
||||
struct _NautilusPropertiesItem
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
char *name;
|
||||
char *value;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (NautilusPropertiesItem, nautilus_properties_item, G_TYPE_OBJECT)
|
||||
|
||||
NautilusPropertiesItem *
|
||||
nautilus_properties_item_new (const char *name,
|
||||
const char *value)
|
||||
{
|
||||
g_return_val_if_fail (name != NULL, NULL);
|
||||
g_return_val_if_fail (name != NULL, NULL);
|
||||
|
||||
return g_object_new (NAUTILUS_TYPE_PROPERTIES_ITEM,
|
||||
"name", name,
|
||||
"value", value,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_properties_item_get_property (GObject *object,
|
||||
guint param_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
NautilusPropertiesItem *self = NAUTILUS_PROPERTIES_ITEM (object);
|
||||
|
||||
switch (param_id)
|
||||
{
|
||||
case PROP_NAME:
|
||||
{
|
||||
g_value_set_string (value, self->name);
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_VALUE:
|
||||
{
|
||||
g_value_set_string (value, self->value);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_properties_item_set_property (GObject *object,
|
||||
guint param_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
NautilusPropertiesItem *self = NAUTILUS_PROPERTIES_ITEM (object);
|
||||
|
||||
switch (param_id)
|
||||
{
|
||||
case PROP_NAME:
|
||||
{
|
||||
g_free (self->name);
|
||||
self->name = g_value_dup_string (value);
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_VALUE:
|
||||
{
|
||||
g_free (self->value);
|
||||
self->value = g_value_dup_string (value);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_properties_item_finalize (GObject *object)
|
||||
{
|
||||
NautilusPropertiesItem *self = NAUTILUS_PROPERTIES_ITEM (object);
|
||||
|
||||
g_free (self->name);
|
||||
g_free (self->value);
|
||||
|
||||
G_OBJECT_CLASS (nautilus_properties_item_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_properties_item_init (NautilusPropertiesItem *self)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_properties_item_class_init (NautilusPropertiesItemClass *class)
|
||||
{
|
||||
GParamSpec *pspec;
|
||||
|
||||
G_OBJECT_CLASS (class)->finalize = nautilus_properties_item_finalize;
|
||||
G_OBJECT_CLASS (class)->get_property = nautilus_properties_item_get_property;
|
||||
G_OBJECT_CLASS (class)->set_property = nautilus_properties_item_set_property;
|
||||
|
||||
pspec = g_param_spec_string ("name", "", "",
|
||||
NULL,
|
||||
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
g_object_class_install_property (G_OBJECT_CLASS (class), PROP_NAME, pspec);
|
||||
|
||||
pspec = g_param_spec_string ("value", "", "",
|
||||
NULL,
|
||||
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
g_object_class_install_property (G_OBJECT_CLASS (class), PROP_VALUE, pspec);
|
||||
}
|
||||
|
||||
const char *
|
||||
nautilus_properties_item_get_name (NautilusPropertiesItem *self)
|
||||
{
|
||||
return self->name;
|
||||
}
|
||||
|
||||
const char *
|
||||
nautilus_properties_item_get_value (NautilusPropertiesItem *self)
|
||||
{
|
||||
return self->value;
|
||||
}
|
61
libnautilus-extension/nautilus-properties-item.h
Normal file
61
libnautilus-extension/nautilus-properties-item.h
Normal file
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* Copyright (C) 2022 António Fernandes <antoniof@gnome.org>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined (NAUTILUS_EXTENSION_H) && !defined (NAUTILUS_COMPILATION)
|
||||
#warning "Only <nautilus-extension.h> should be included directly."
|
||||
#endif
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NAUTILUS_TYPE_PROPERTIES_ITEM (nautilus_properties_item_get_type ())
|
||||
|
||||
G_DECLARE_FINAL_TYPE (NautilusPropertiesItem,
|
||||
nautilus_properties_item,
|
||||
NAUTILUS, PROPERTIES_ITEM,
|
||||
GObject)
|
||||
|
||||
/**
|
||||
* SECTION:nautilus-properties-item
|
||||
* @name: NautilusPropertiesItem
|
||||
* @value: Properties item descriptor object
|
||||
*
|
||||
* #NautilusPropertiesItem is an object that describes a name & value pair in
|
||||
* file properties. Extensions can provide #NautilusPropertiesItem objects in
|
||||
* models provided by #NautilusPropertiesModel.
|
||||
*/
|
||||
|
||||
/**
|
||||
* nautilus_properties_item_new:
|
||||
* @name: the user-visible name for the properties item.
|
||||
* @value: the user-visible value for the properties item.
|
||||
*
|
||||
* Returns: (transfer full): a new #NautilusPropertiesItem
|
||||
*/
|
||||
NautilusPropertiesItem *nautilus_properties_item_new (const char *name,
|
||||
const char *value);
|
||||
|
||||
/**
|
||||
* nautilus_properties_item_get_name:
|
||||
* @self: the properties item
|
||||
*
|
||||
* Returns: (transfer none): the name of this #NautilusPropertiesItem
|
||||
*/
|
||||
const char *nautilus_properties_item_get_name (NautilusPropertiesItem *self);
|
||||
|
||||
/**
|
||||
* nautilus_properties_item_get_value:
|
||||
* @self: the properties item
|
||||
*
|
||||
* Returns: (transfer none): the value of this #NautilusPropertiesItem
|
||||
*/
|
||||
const char * nautilus_properties_item_get_value (NautilusPropertiesItem *self);
|
||||
|
||||
|
||||
G_END_DECLS
|
29
libnautilus-extension/nautilus-properties-model-provider.c
Normal file
29
libnautilus-extension/nautilus-properties-model-provider.c
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright (C) 2022 The GNOME project contributors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "nautilus-properties-model-provider.h"
|
||||
|
||||
G_DEFINE_INTERFACE (NautilusPropertiesModelProvider, nautilus_properties_model_provider, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
nautilus_properties_model_provider_default_init (NautilusPropertiesModelProviderInterface *klass)
|
||||
{
|
||||
}
|
||||
|
||||
GList *
|
||||
nautilus_properties_model_provider_get_models (NautilusPropertiesModelProvider *self,
|
||||
GList *files)
|
||||
{
|
||||
NautilusPropertiesModelProviderInterface *iface;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_PROPERTIES_MODEL_PROVIDER (self), NULL);
|
||||
|
||||
iface = NAUTILUS_PROPERTIES_MODEL_PROVIDER_GET_IFACE (self);
|
||||
|
||||
g_return_val_if_fail (iface->get_models != NULL, NULL);
|
||||
|
||||
return iface->get_models (self, files);
|
||||
}
|
66
libnautilus-extension/nautilus-properties-model-provider.h
Normal file
66
libnautilus-extension/nautilus-properties-model-provider.h
Normal file
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
* Copyright (C) 2022 The GNOME project contributors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined (NAUTILUS_EXTENSION_H) && !defined (NAUTILUS_COMPILATION)
|
||||
#warning "Only <nautilus-extension.h> should be included directly."
|
||||
#endif
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NAUTILUS_TYPE_PROPERTIES_MODEL_PROVIDER (nautilus_properties_model_provider_get_type ())
|
||||
|
||||
G_DECLARE_INTERFACE (NautilusPropertiesModelProvider,
|
||||
nautilus_properties_model_provider,
|
||||
NAUTILUS, PROPERTIES_MODEL_PROVIDER,
|
||||
GObject)
|
||||
|
||||
/**
|
||||
* SECTION:nautilus-properties-model-provider
|
||||
* @title: NautilusPropertiesModelProvider
|
||||
* @short_description: Interface to provide additional properties
|
||||
*
|
||||
* #NautilusPropertiesModelProvider allows extension to provide additional
|
||||
* information for the file properties.
|
||||
*/
|
||||
|
||||
/**
|
||||
* NautilusPropertiesModelProviderInterface:
|
||||
* @g_iface: The parent interface.
|
||||
* @get_models: Returns a #GList of #NautilusPropertiesModel.
|
||||
* See nautilus_properties_model_provider_get_models() for details.
|
||||
*
|
||||
* Interface for extensions to provide additional properties.
|
||||
*/
|
||||
struct _NautilusPropertiesModelProviderInterface
|
||||
{
|
||||
GTypeInterface g_iface;
|
||||
|
||||
GList *(*get_models) (NautilusPropertiesModelProvider *provider,
|
||||
GList *files);
|
||||
};
|
||||
|
||||
/**
|
||||
* nautilus_properties_model_provider_get_models:
|
||||
* @provider: a #NautilusPropertiesModelProvider
|
||||
* @files: (element-type NautilusFileInfo): a #GList of #NautilusFileInfo
|
||||
*
|
||||
* This function is called by the application when it wants properties models
|
||||
* from the extension.
|
||||
*
|
||||
* This function is called in the main thread before the Properties are shown,
|
||||
* so it should return quickly. The models can be populated and updated
|
||||
* asynchronously.
|
||||
*
|
||||
* Returns: (nullable) (element-type NautilusPropertiesModel) (transfer full): A #GList of allocated #NautilusPropertiesModel models.
|
||||
*/
|
||||
GList *nautilus_properties_model_provider_get_models (NautilusPropertiesModelProvider *provider,
|
||||
GList *files);
|
||||
|
||||
G_END_DECLS
|
167
libnautilus-extension/nautilus-properties-model.c
Normal file
167
libnautilus-extension/nautilus-properties-model.c
Normal file
|
@ -0,0 +1,167 @@
|
|||
/*
|
||||
* Copyright (C) 2022 The GNOME project contributors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "nautilus-properties-model.h"
|
||||
#include "nautilus-properties-item.h"
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_TITLE,
|
||||
PROP_MODEL,
|
||||
LAST_PROP
|
||||
};
|
||||
|
||||
struct _NautilusPropertiesModel
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
char *title;
|
||||
GListModel *model;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (NautilusPropertiesModel, nautilus_properties_model, G_TYPE_OBJECT)
|
||||
|
||||
NautilusPropertiesModel *
|
||||
nautilus_properties_model_new (const char *title,
|
||||
GListModel *model)
|
||||
{
|
||||
g_return_val_if_fail (title != NULL, NULL);
|
||||
g_return_val_if_fail (G_IS_LIST_MODEL (model), NULL);
|
||||
g_return_val_if_fail (g_list_model_get_item_type (model) == NAUTILUS_TYPE_PROPERTIES_ITEM, NULL);
|
||||
|
||||
return g_object_new (NAUTILUS_TYPE_PROPERTIES_MODEL,
|
||||
"title", title,
|
||||
"model", model,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_properties_model_get_property (GObject *object,
|
||||
guint param_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
NautilusPropertiesModel *self = NAUTILUS_PROPERTIES_MODEL (object);
|
||||
|
||||
switch (param_id)
|
||||
{
|
||||
case PROP_TITLE:
|
||||
{
|
||||
g_value_set_string (value, self->title);
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_MODEL:
|
||||
{
|
||||
g_value_set_object (value, self->model);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_properties_model_set_property (GObject *object,
|
||||
guint param_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
NautilusPropertiesModel *self = NAUTILUS_PROPERTIES_MODEL (object);
|
||||
|
||||
switch (param_id)
|
||||
{
|
||||
case PROP_TITLE:
|
||||
{
|
||||
g_free (self->title);
|
||||
self->title = g_value_dup_string (value);
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_MODEL:
|
||||
{
|
||||
g_set_object (&self->model, g_value_get_object (value));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_properties_model_dispose (GObject *object)
|
||||
{
|
||||
NautilusPropertiesModel *self = NAUTILUS_PROPERTIES_MODEL (object);
|
||||
|
||||
g_clear_object (&self->model);
|
||||
|
||||
G_OBJECT_CLASS (nautilus_properties_model_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_properties_model_finalize (GObject *object)
|
||||
{
|
||||
NautilusPropertiesModel *self = NAUTILUS_PROPERTIES_MODEL (object);
|
||||
|
||||
g_free (self->title);
|
||||
|
||||
G_OBJECT_CLASS (nautilus_properties_model_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_properties_model_init (NautilusPropertiesModel *self)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_properties_model_class_init (NautilusPropertiesModelClass *class)
|
||||
{
|
||||
GParamSpec *pspec;
|
||||
|
||||
G_OBJECT_CLASS (class)->finalize = nautilus_properties_model_finalize;
|
||||
G_OBJECT_CLASS (class)->dispose = nautilus_properties_model_dispose;
|
||||
G_OBJECT_CLASS (class)->get_property = nautilus_properties_model_get_property;
|
||||
G_OBJECT_CLASS (class)->set_property = nautilus_properties_model_set_property;
|
||||
|
||||
pspec = g_param_spec_string ("title", "", "",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
g_object_class_install_property (G_OBJECT_CLASS (class), PROP_TITLE, pspec);
|
||||
|
||||
pspec = g_param_spec_object ("model", "", "",
|
||||
G_TYPE_LIST_MODEL,
|
||||
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
g_object_class_install_property (G_OBJECT_CLASS (class), PROP_MODEL, pspec);
|
||||
}
|
||||
|
||||
const char *
|
||||
nautilus_properties_model_get_title (NautilusPropertiesModel *self)
|
||||
{
|
||||
return self->title;
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_properties_model_set_title (NautilusPropertiesModel *self,
|
||||
const char *title)
|
||||
{
|
||||
g_object_set (self, "title", title, NULL);
|
||||
}
|
||||
|
||||
GListModel *
|
||||
nautilus_properties_model_get_model (NautilusPropertiesModel *self)
|
||||
{
|
||||
return self->model;
|
||||
}
|
71
libnautilus-extension/nautilus-properties-model.h
Normal file
71
libnautilus-extension/nautilus-properties-model.h
Normal file
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
* Copyright (C) 2022 The GNOME project contributors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined (NAUTILUS_EXTENSION_H) && !defined (NAUTILUS_COMPILATION)
|
||||
#warning "Only <nautilus-extension.h> should be included directly."
|
||||
#endif
|
||||
|
||||
#include <gio/gio.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NAUTILUS_TYPE_PROPERTIES_MODEL (nautilus_properties_model_get_type ())
|
||||
|
||||
G_DECLARE_FINAL_TYPE (NautilusPropertiesModel,
|
||||
nautilus_properties_model,
|
||||
NAUTILUS, PROPERTIES_MODEL,
|
||||
GObject)
|
||||
|
||||
/**
|
||||
* SECTION:nautilus-properties-model
|
||||
* @title: NautilusPropertiesModel
|
||||
* @short_description: Properties set descriptor model
|
||||
*
|
||||
* #NautilusPropertiesModel is an model that describes a set of file properties.
|
||||
* Extensions can provide #NautilusPropertiesModel objects by registering a
|
||||
* #NautilusPropertiesModelProvider and returning them from
|
||||
* nautilus_properties_model_provider_get_models(), which will be called by
|
||||
* the main application when creating file properties.
|
||||
*/
|
||||
|
||||
/**
|
||||
* nautilus_properties_model_new:
|
||||
* @title: the user-visible name for the set of properties in this model
|
||||
* @model: a #GListModel containing #NautilusPropertyItem objects.
|
||||
*
|
||||
* Returns: (transfer full): a new #NautilusPropertiesModel
|
||||
*/
|
||||
NautilusPropertiesModel *nautilus_properties_model_new (const char *title,
|
||||
GListModel *model);
|
||||
|
||||
/**
|
||||
* nautilus_properties_model_get_title:
|
||||
* @self: the properties model
|
||||
*
|
||||
* Returns: (transfer none): the title of this #NautilusPropertiesModel
|
||||
*/
|
||||
const char *nautilus_properties_model_get_title (NautilusPropertiesModel *self);
|
||||
|
||||
/**
|
||||
* nautilus_properties_model_set_title:
|
||||
* @self: the properties model
|
||||
* @title: the new title of this #NautilusPropertiesModel
|
||||
*/
|
||||
void nautilus_properties_model_set_title (NautilusPropertiesModel *self,
|
||||
const char *title);
|
||||
|
||||
/**
|
||||
* nautilus_properties_model_get_model:
|
||||
* @self: the properties model
|
||||
*
|
||||
* Returns: (transfer none): a #GListModel containing #NautilusPropertiesItem.
|
||||
*/
|
||||
GListModel * nautilus_properties_model_get_model (NautilusPropertiesModel *self);
|
||||
|
||||
|
||||
G_END_DECLS
|
266
meson.build
Normal file
266
meson.build
Normal file
|
@ -0,0 +1,266 @@
|
|||
project('nautilus', 'c',
|
||||
default_options: ['c_std=c11'],
|
||||
|
||||
# Do not forget when releasing:
|
||||
# * Set release date in data/org.gnome.Nautilus.metainfo.xml.in.in
|
||||
version: '48.2',
|
||||
|
||||
meson_version: '>= 0.59.0',
|
||||
license: 'GPL-3.0-or-later'
|
||||
)
|
||||
|
||||
nautilus_extension_version = '4'
|
||||
|
||||
###############
|
||||
# Directories #
|
||||
###############
|
||||
|
||||
prefix = get_option('prefix')
|
||||
|
||||
bindir = get_option('bindir')
|
||||
datadir = get_option('datadir')
|
||||
desktopdir = join_paths(datadir, 'applications')
|
||||
includedir = get_option('includedir')
|
||||
libdir = get_option('libdir')
|
||||
localedir = get_option('localedir')
|
||||
docdir = datadir / 'doc'
|
||||
extensiondir = join_paths(libdir, 'nautilus', 'extensions-' + nautilus_extension_version)
|
||||
servicedir = join_paths(datadir, 'dbus-1', 'services')
|
||||
|
||||
###################
|
||||
# End directories #
|
||||
###################
|
||||
|
||||
#############
|
||||
# Compilers #
|
||||
#############
|
||||
|
||||
cc = meson.get_compiler('c')
|
||||
|
||||
#################
|
||||
# End compilers #
|
||||
#################
|
||||
|
||||
add_project_arguments(
|
||||
cc.get_supported_arguments([
|
||||
'-Wall',
|
||||
'-Wduplicated-branches',
|
||||
'-Wduplicated-cond',
|
||||
'-Wlogical-op',
|
||||
'-Werror=empty-body',
|
||||
'-Werror=format=2',
|
||||
'-Werror=implicit-function-declaration',
|
||||
'-Werror=incompatible-pointer-types',
|
||||
'-Werror=init-self',
|
||||
'-Werror=missing-include-dirs',
|
||||
'-Werror=missing-prototypes',
|
||||
'-Werror=pointer-arith',
|
||||
'-Werror=sequence-point',
|
||||
'-Werror=shadow',
|
||||
'-Werror=strict-prototypes',
|
||||
'-Werror=undef',
|
||||
'-Werror=uninitialized',
|
||||
# There are currently too many warnings caused by deprecations, hindering the usefulness
|
||||
# of any other warnings. Disable them until
|
||||
# https://gitlab.gnome.org/GNOME/nautilus/-/issues/2722 is resolved.
|
||||
'-Wno-deprecated-declarations',
|
||||
# We want the general warnings in Wextra, but as GLib functions commonly accept additional
|
||||
# user data, warnings for function casts are not feasible. Neither are warnings for unused
|
||||
# parameters, as parameters in callbacks commonly aren't used.
|
||||
'-Wextra',
|
||||
'-Wno-cast-function-type',
|
||||
'-Wno-unused-parameter',
|
||||
# Context: https://gitlab.com/freedesktop-sdk/freedesktop-sdk/commit/ce54a2527555e51e4ebf4cce9cbb6259cafa89a4
|
||||
# -O2 and -fexceptions unmask some cases of -Wmaybe-uninitialized, which
|
||||
# become errors for some reason (I’m guessing because of the
|
||||
# -Werror=uninitialized above, but no idea why that implies this).
|
||||
# This being an error is nice and all, but not when its appearance is
|
||||
# dependent on optimization level and other flags.
|
||||
'-Wno-error=maybe-uninitialized',
|
||||
]),
|
||||
'-D_GNU_SOURCE',
|
||||
language: 'c'
|
||||
)
|
||||
|
||||
##################
|
||||
# Module imports #
|
||||
##################
|
||||
|
||||
gnome = import('gnome')
|
||||
i18n = import('i18n')
|
||||
pkgconfig = import('pkgconfig')
|
||||
|
||||
######################
|
||||
# End module imports #
|
||||
######################
|
||||
|
||||
################
|
||||
# Dependencies #
|
||||
################
|
||||
glib_ver = '>= 2.79.0'
|
||||
|
||||
libm = cc.find_library('m')
|
||||
|
||||
if get_option('extensions')
|
||||
gexiv = dependency('gexiv2', version: '>= 0.14.2')
|
||||
gdkpixbuf = dependency('gdk-pixbuf-2.0', version: '>= 2.30.0')
|
||||
gst_tag_dep = dependency('gstreamer-tag-1.0')
|
||||
gst_pbutils_dep = dependency('gstreamer-pbutils-1.0')
|
||||
endif
|
||||
gio = dependency('gio-2.0', version: glib_ver)
|
||||
gio_unix = dependency('gio-unix-2.0', version: glib_ver)
|
||||
glib = dependency('glib-2.0', version: glib_ver)
|
||||
gmodule = dependency('gmodule-no-export-2.0', version: glib_ver)
|
||||
gnome_autoar = dependency('gnome-autoar-0', version: '>= 0.4.4')
|
||||
gnome_desktop = dependency('gnome-desktop-4', version: '>= 43')
|
||||
gtk = dependency('gtk4', version: '>= 4.17.5')
|
||||
gtk_x11 = dependency('gtk4-x11', required: false)
|
||||
gtk_wayland = dependency('gtk4-wayland', required: false)
|
||||
if gtk_wayland.found()
|
||||
dependency('wayland-client')
|
||||
endif
|
||||
libadwaita = dependency('libadwaita-1', version: '>= 1.6.beta')
|
||||
libportal = dependency('libportal', version: '>= 0.7')
|
||||
libportal_gtk4 = dependency('libportal-gtk4', version: '>= 0.5')
|
||||
selinux = []
|
||||
if get_option('selinux')
|
||||
selinux = dependency('libselinux', version: '>= 2.0')
|
||||
endif
|
||||
tracker_sparql = dependency('tracker-sparql-3.0')
|
||||
cloudproviders = []
|
||||
if get_option('cloudproviders')
|
||||
cloudproviders = dependency('cloudproviders', version: '>= 0.3.1')
|
||||
endif
|
||||
gi_docgen = find_program('gi-docgen', required: get_option('docs'))
|
||||
|
||||
####################
|
||||
# End dependencies #
|
||||
####################
|
||||
|
||||
#################
|
||||
# Configuration #
|
||||
#################
|
||||
conf = configuration_data()
|
||||
|
||||
profile = get_option('profile')
|
||||
name_suffix = ''
|
||||
|
||||
if get_option('profile') == 'Devel'
|
||||
name_suffix = ' (Development Snapshot)'
|
||||
endif
|
||||
|
||||
application_id = 'org.gnome.Nautilus' + profile
|
||||
|
||||
if profile == ''
|
||||
# Example: 40.0
|
||||
version_string = meson.project_version()
|
||||
else
|
||||
# Examples: 40.alpha-787a835f
|
||||
version_string = '@0@-@VCS_TAG@'.format(meson.project_version())
|
||||
endif
|
||||
|
||||
conf.set_quoted('APPLICATION_ID', application_id)
|
||||
conf.set_quoted('GETTEXT_PACKAGE', 'nautilus')
|
||||
conf.set_quoted('LOCALEDIR', join_paths(prefix, localedir))
|
||||
conf.set_quoted('NAME_SUFFIX', name_suffix)
|
||||
conf.set_quoted('NAUTILUS_DATADIR', join_paths(prefix, datadir, 'nautilus'))
|
||||
conf.set_quoted('NAUTILUS_EXTENSIONDIR', join_paths(prefix, extensiondir))
|
||||
conf.set_quoted('PACKAGE_VERSION', meson.project_version())
|
||||
conf.set_quoted('PROFILE', profile)
|
||||
conf.set_quoted('VERSION', version_string)
|
||||
|
||||
conf.set('ENABLE_PACKAGEKIT', get_option('packagekit'))
|
||||
conf.set('HAVE_SELINUX', get_option('selinux'))
|
||||
conf.set('HAVE_CLOUDPROVIDERS', get_option('cloudproviders'))
|
||||
|
||||
if gtk_x11.found()
|
||||
conf.set('HAVE_GTK_X11', 1)
|
||||
endif
|
||||
if gtk_wayland.found()
|
||||
conf.set('HAVE_GTK_WAYLAND', 1)
|
||||
endif
|
||||
|
||||
######################################
|
||||
# File Configuration (for xml files) #
|
||||
######################################
|
||||
file_conf = configuration_data()
|
||||
file_conf.set('appid', application_id)
|
||||
|
||||
#############################################################
|
||||
# config.h dependency, add to target dependencies if needed #
|
||||
#############################################################
|
||||
|
||||
config_h = declare_dependency(
|
||||
sources: vcs_tag(
|
||||
command: ['git', 'rev-parse', '--short', 'HEAD'],
|
||||
fallback: profile != '' ? 'devel' : '',
|
||||
input: configure_file(
|
||||
output: 'config.h.in',
|
||||
configuration: conf
|
||||
),
|
||||
output: 'config.h'
|
||||
)
|
||||
)
|
||||
|
||||
#####################
|
||||
# End configuration #
|
||||
#####################
|
||||
|
||||
nautilus_include_dirs = include_directories(
|
||||
'.',
|
||||
'libnautilus-extension'
|
||||
)
|
||||
|
||||
#########
|
||||
# Build #
|
||||
#########
|
||||
|
||||
subdirs = [
|
||||
'data',
|
||||
'eel',
|
||||
'xdp-gnome',
|
||||
'libnautilus-extension',
|
||||
'po',
|
||||
'src',
|
||||
]
|
||||
|
||||
########################
|
||||
# Conditional building #
|
||||
########################
|
||||
|
||||
if get_option('docs')
|
||||
subdirs += 'docs'
|
||||
endif
|
||||
if get_option('tests') != 'none'
|
||||
subdirs += 'test'
|
||||
endif
|
||||
if get_option('extensions')
|
||||
subdirs += 'extensions'
|
||||
endif
|
||||
|
||||
foreach dir : subdirs
|
||||
subdir(dir)
|
||||
endforeach
|
||||
|
||||
#############
|
||||
# End build #
|
||||
#############
|
||||
|
||||
gnome.post_install(
|
||||
gtk_update_icon_cache: true,
|
||||
glib_compile_schemas: true,
|
||||
update_desktop_database: true,
|
||||
)
|
||||
|
||||
#### Summary ####
|
||||
|
||||
summary('Extensions', get_option('extensions').to_string(), section: 'Features')
|
||||
summary('Cloud providers support', get_option('cloudproviders'), section: 'Features')
|
||||
summary('SELinux support', get_option('selinux'), section: 'Features')
|
||||
|
||||
summary('Profile', get_option('profile'), section: 'Build')
|
||||
summary('Debugging', get_option('debug'), section: 'Build')
|
||||
summary('Optimization', get_option('optimization'), section: 'Build')
|
||||
summary('Documentation', get_option('docs'), section: 'Build')
|
||||
summary('Introspection', get_option('introspection'), section: 'Build')
|
||||
summary('Tests', get_option('tests'), section: 'Build')
|
74
meson_options.txt
Normal file
74
meson_options.txt
Normal file
|
@ -0,0 +1,74 @@
|
|||
##############
|
||||
# Extensions #
|
||||
##############
|
||||
option(
|
||||
'docs',
|
||||
type: 'boolean',
|
||||
value: false,
|
||||
description: 'Build documentation for extension library',
|
||||
)
|
||||
option(
|
||||
'extensions',
|
||||
type: 'boolean',
|
||||
value: true,
|
||||
description: 'Build stock extensions',
|
||||
)
|
||||
option(
|
||||
'introspection',
|
||||
type: 'boolean',
|
||||
value: true,
|
||||
description: 'Build GObject introspection data for extension library',
|
||||
)
|
||||
##################
|
||||
# End extensions #
|
||||
##################
|
||||
|
||||
############
|
||||
# Features #
|
||||
############
|
||||
option(
|
||||
'packagekit',
|
||||
type: 'boolean',
|
||||
value: true,
|
||||
description: 'Enable finding file type handlers using PackageKit',
|
||||
)
|
||||
option(
|
||||
'selinux',
|
||||
type: 'boolean',
|
||||
value: false,
|
||||
description: 'Enable SELinux context support in file properties dialog',
|
||||
)
|
||||
option(
|
||||
'cloudproviders',
|
||||
type: 'boolean',
|
||||
value: true,
|
||||
description: 'Enable the cloudproviders support',
|
||||
)
|
||||
################
|
||||
# End features #
|
||||
################
|
||||
|
||||
###########
|
||||
# Testing #
|
||||
###########
|
||||
option(
|
||||
'tests',
|
||||
type: 'combo',
|
||||
choices: [
|
||||
'none',
|
||||
'headless',
|
||||
'all'
|
||||
],
|
||||
value: 'headless',
|
||||
description: 'Build selected tests',
|
||||
)
|
||||
###############
|
||||
# End testing #
|
||||
###############
|
||||
|
||||
option(
|
||||
'profile',
|
||||
type: 'string',
|
||||
value: '',
|
||||
description: 'Build with specified application ID',
|
||||
)
|
124
po/LINGUAS
Normal file
124
po/LINGUAS
Normal file
|
@ -0,0 +1,124 @@
|
|||
# please keep this list sorted alphabetically
|
||||
#
|
||||
ab
|
||||
af
|
||||
am
|
||||
an
|
||||
ar
|
||||
as
|
||||
ast
|
||||
az
|
||||
be
|
||||
be@latin
|
||||
bg
|
||||
bn
|
||||
bn_IN
|
||||
bo
|
||||
br
|
||||
bs
|
||||
ca
|
||||
ca@valencia
|
||||
ckb
|
||||
crh
|
||||
cs
|
||||
cy
|
||||
da
|
||||
de
|
||||
dz
|
||||
el
|
||||
en_CA
|
||||
en_GB
|
||||
en@shaw
|
||||
eo
|
||||
es
|
||||
et
|
||||
eu
|
||||
fa
|
||||
fi
|
||||
fo
|
||||
fr
|
||||
fur
|
||||
fy
|
||||
ga
|
||||
gd
|
||||
gl
|
||||
gu
|
||||
gv
|
||||
ha
|
||||
he
|
||||
hi
|
||||
hr
|
||||
hu
|
||||
hy
|
||||
id
|
||||
ie
|
||||
ig
|
||||
io
|
||||
is
|
||||
it
|
||||
ja
|
||||
ka
|
||||
kab
|
||||
kk
|
||||
km
|
||||
kn
|
||||
ko
|
||||
ku
|
||||
ky
|
||||
li
|
||||
ln
|
||||
lt
|
||||
lv
|
||||
mai
|
||||
mg
|
||||
mi
|
||||
mjw
|
||||
mk
|
||||
ml
|
||||
mn
|
||||
mr
|
||||
ms
|
||||
my
|
||||
nb
|
||||
nds
|
||||
ne
|
||||
nl
|
||||
nn
|
||||
nso
|
||||
oc
|
||||
or
|
||||
pa
|
||||
pl
|
||||
ps
|
||||
pt
|
||||
pt_BR
|
||||
ro
|
||||
ru
|
||||
rw
|
||||
si
|
||||
sk
|
||||
sl
|
||||
sq
|
||||
sr
|
||||
sr@ije
|
||||
sr@latin
|
||||
sv
|
||||
ta
|
||||
te
|
||||
tg
|
||||
th
|
||||
tk
|
||||
tr
|
||||
ug
|
||||
uk
|
||||
uz
|
||||
uz@cyrillic
|
||||
vi
|
||||
wa
|
||||
xh
|
||||
yi
|
||||
yo
|
||||
zh_CN
|
||||
zh_HK
|
||||
zh_TW
|
||||
zu
|
106
po/POTFILES.in
Normal file
106
po/POTFILES.in
Normal file
|
@ -0,0 +1,106 @@
|
|||
# List of source files containing translatable strings.
|
||||
# Please keep this file sorted alphabetically.
|
||||
data/nautilus-autorun-software.desktop.in
|
||||
data/org.gnome.Nautilus.metainfo.xml.in.in
|
||||
data/org.gnome.Nautilus.desktop.in.in
|
||||
data/org.gnome.nautilus.gschema.xml
|
||||
eel/eel-stock-dialogs.c
|
||||
extensions/audio-video-properties/totem-properties-main.c
|
||||
extensions/audio-video-properties/totem-properties-view.c
|
||||
extensions/image-properties/nautilus-image-properties-model.c
|
||||
extensions/image-properties/nautilus-image-properties-model-provider.c
|
||||
libnautilus-extension/nautilus-column.c
|
||||
libnautilus-extension/nautilus-menu-item.c
|
||||
src/nautilus-application.c
|
||||
src/nautilus-app-chooser.c
|
||||
src/nautilus-autorun-software.c
|
||||
src/nautilus-batch-rename-dialog.c
|
||||
src/nautilus-batch-rename-dialog.h
|
||||
src/nautilus-bookmark.c
|
||||
src/nautilus-clipboard.c
|
||||
src/nautilus-column-chooser.c
|
||||
src/nautilus-column-utilities.c
|
||||
src/nautilus-compress-dialog.c
|
||||
src/nautilus-date-utilities.c
|
||||
src/nautilus-dbus-launcher.c
|
||||
src/nautilus-directory.c
|
||||
src/nautilus-dnd.c
|
||||
src/nautilus-error-reporting.c
|
||||
src/nautilus-file.c
|
||||
src/nautilus-file-chooser.c
|
||||
src/nautilus-file-conflict-dialog.c
|
||||
src/nautilus-filename-validator.c
|
||||
src/nautilus-file-operations.c
|
||||
src/nautilus-files-view.c
|
||||
src/nautilus-files-view-dnd.c
|
||||
src/nautilus-file-undo-operations.c
|
||||
src/nautilus-file-utilities.c
|
||||
src/nautilus-filename-utilities.c
|
||||
src/nautilus-global-preferences.c
|
||||
src/nautilus-grid-view.c
|
||||
src/nautilus-internal-place-file.c
|
||||
src/nautilus-list-view.c
|
||||
src/nautilus-location-banner.c
|
||||
src/nautilus-location-entry.c
|
||||
src/nautilus-main.c
|
||||
src/nautilus-mime-actions.c
|
||||
src/nautilus-network-address-bar.c
|
||||
src/nautilus-network-cell.c
|
||||
src/nautilus-network-view.c
|
||||
src/nautilus-new-folder-dialog.c
|
||||
src/nautilus-operations-ui-manager.c
|
||||
src/nautilus-pathbar.c
|
||||
src/nautilus-portal.c
|
||||
src/nautilus-preferences-dialog.c
|
||||
src/nautilus-program-choosing.c
|
||||
src/nautilus-progress-info.c
|
||||
src/nautilus-progress-info-widget.c
|
||||
src/nautilus-progress-persistence-handler.c
|
||||
src/nautilus-properties-window.c
|
||||
src/nautilus-query.c
|
||||
src/nautilus-query-editor.c
|
||||
src/nautilus-rename-file-popover.c
|
||||
src/nautilus-search-directory-file.c
|
||||
src/nautilus-search-engine.c
|
||||
src/nautilus-search-popover.c
|
||||
src/nautilus-shell-search-provider.c
|
||||
src/nautilus-star-cell.c
|
||||
src/nautilus-toolbar.c
|
||||
src/nautilus-ui-utilities.c
|
||||
src/nautilus-vfs-file.c
|
||||
src/nautilus-view.c
|
||||
src/nautilus-window.c
|
||||
src/nautilus-window-slot.c
|
||||
src/nautilus-x-content-bar.c
|
||||
src/resources/gtk/help-overlay.ui
|
||||
src/resources/ui/nautilus-app-chooser.ui
|
||||
src/resources/ui/nautilus-batch-rename-dialog.ui
|
||||
src/resources/ui/nautilus-column-chooser.ui
|
||||
src/resources/ui/nautilus-compress-dialog.ui
|
||||
src/resources/ui/nautilus-new-folder-dialog.ui
|
||||
src/resources/ui/nautilus-file-chooser.ui
|
||||
src/resources/ui/nautilus-file-conflict-dialog.ui
|
||||
src/resources/ui/nautilus-file-properties-change-permissions.ui
|
||||
src/resources/ui/nautilus-files-view-context-menus.ui
|
||||
src/resources/ui/nautilus-files-view-select-items.ui
|
||||
src/resources/ui/nautilus-files-view.ui
|
||||
src/resources/ui/nautilus-grid-cell.ui
|
||||
src/resources/ui/nautilus-history-controls.ui
|
||||
src/resources/ui/nautilus-name-cell.ui
|
||||
src/resources/ui/nautilus-network-address-bar.ui
|
||||
src/resources/ui/nautilus-network-cell.ui
|
||||
src/resources/ui/nautilus-operations-ui-manager-request-passphrase.ui
|
||||
src/resources/ui/nautilus-pathbar-context-menu.ui
|
||||
src/resources/ui/nautilus-preferences-dialog.ui
|
||||
src/resources/ui/nautilus-progress-indicator.ui
|
||||
src/resources/ui/nautilus-progress-info-widget.ui
|
||||
src/resources/ui/nautilus-properties-window.ui
|
||||
src/resources/ui/nautilus-rename-file-popover.ui
|
||||
src/resources/ui/nautilus-search-popover.ui
|
||||
src/resources/ui/nautilus-search-types-dialog.ui
|
||||
src/resources/ui/nautilus-toolbar.ui
|
||||
src/resources/ui/nautilus-toolbar-view-menu.ui
|
||||
src/resources/ui/nautilus-view-controls.ui
|
||||
src/resources/ui/nautilus-window.ui
|
||||
src/gtk/nautilusgtkplacessidebar.c
|
||||
src/gtk/nautilusgtksidebarrow.ui
|
3
po/POTFILES.skip
Normal file
3
po/POTFILES.skip
Normal file
|
@ -0,0 +1,3 @@
|
|||
# List of source files that should *not* be translated.
|
||||
# Please keep this file sorted alphabetically.
|
||||
src/animation/egg-animation.c
|
6876
po/be@latin.po
Normal file
6876
po/be@latin.po
Normal file
File diff suppressed because it is too large
Load diff
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue