Compare commits

..

4 Commits

Author SHA1 Message Date
David Reveman
c23c92b069 Handle scaling with RANDR transformations for Clone mode 2010-01-28 12:30:30 -06:00
David Reveman
acb0b4725f Add an (invisible for now) combo box to select scaling for a display 2010-01-28 12:08:11 -06:00
Federico Mena Quintero
6677c366a8 Set the GConf key for tablet rotation when the user clicks the checkbox
The actual call to xsetwacom(1) will be handled in gnome-settings-daemon.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-12-02 17:01:12 -06:00
Federico Mena Quintero
97b42a7ccf Add a checkbox to rotate a pressure-sensitive tablet as well as the monitor
For tablets, we will call xsetwacom(1) to rotate the stylus when the monitor is
rotated.  This is the corresponding option in the display capplet; it also depends
on a patch to gnome-settings-daemon to actually handle the changes.

For built-in tablets like a Tablet PC, you *want* the tablet to rotate
when you rotate the monitor.  However, this is not the case for external
tablets plugged to a desktop PC.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-12-02 17:00:28 -06:00
1503 changed files with 345263 additions and 1134804 deletions

3
.gitignore vendored
View File

@@ -1,3 +0,0 @@
__pycache__
_build/
**/*~

View File

@@ -1,410 +0,0 @@
image: registry.gitlab.gnome.org/gnome/gnome-control-center:fedora.dev
stages:
- build
- test
- manual
- review
- deploy
.Log files: &log_files [./*.log, _build/meson-logs/]
.Build logs: &save_build_logs
artifacts:
name: log
when: always
paths: *log_files
.Git Untracked files: &save_untracked_files
artifacts:
name: untracked
paths: [$(pwd)]
expire_in: 3h30min
.Show Info: &environment_information
build-aux/ci/ci-helper.sh "INFO" &&
build-aux/ci/ci-helper.sh "GIT_INFO"
.Build procedure: &build_procedure
echo "== Building ==" &&
rm -rf _build/ &&
meson . _build ${BUILD_OPTS} &&
ninja -C _build 2>&1 | tee compilation.log
.Run Tests: &run_tests
echo "== Testing ==" &&
meson test -C _build --verbose --no-stdsplit
##
# Stage: Build
#
# Checks if GNOME Control Center is properly building and installing. This is the
# most important stage of the CI, and no MR should ever be merged if it breaks
# any of them.
##
build:
<<: *save_untracked_files
stage: build
script:
- *environment_information
- *build_procedure
- echo "== Installing =="
- ninja -C _build install
- echo "== Report =="
- build-aux/ci/ci-helper.sh "WARNINGS"
# Save all but git-related files
- rm -rf .git .gitignore .gitmodules
except:
variables:
- $CI_PIPELINE_SOURCE == "schedule"
##
# Stage: Test
#
# Runs the unit tests.
##
test:
<<: *save_build_logs
stage: test
dependencies:
- build
script:
- *environment_information
- *run_tests
- |
if [[ -n "${CI_COMMIT_TAG}" ]]; then
echo "== Distro Test =="
ninja dist -C _build
fi
except:
variables:
- $CI_PIPELINE_SOURCE == "schedule"
- $CI_COMMIT_TITLE =~ /^Update.*translation$/
# Runs the coverage test.
coverage:
<<: *save_build_logs
stage: test
variables:
BUILD_OPTS: "-Db_coverage=true"
coverage: '/^Lines:.\d+.\d+.(\d+\.\d+\%)/'
only:
- master@GNOME/gnome-control-center
script:
- *environment_information
- *build_procedure
- *run_tests
- ninja -C _build coverage-html
# Parse the report to get the coverage result
- |
echo == Coverage ==
sed -e 's/<[^>]*>//g' _build/meson-logs/coveragereport/index.html | tr -d ' \t' | grep -A3 -P '^Lines:$' | tr '\n' ' '; echo
except:
variables:
- $CI_PIPELINE_SOURCE == "schedule"
- $CI_COMMIT_TITLE =~ /^Update.*translation$/
# Runs the address sanitizer.
# - below, at the "sanitizers section"
##
# Stage: Deploy
#
# Publishes the Coverage Report generated above
##
pages:
stage: deploy
dependencies:
- coverage
script:
- mv _build/meson-logs/coveragereport/ public/
artifacts:
paths:
- public
only:
- master@GNOME/gnome-control-center
except:
variables:
- $CRON_TASK == "BUILD_CI_IMAGES"
- $CI_COMMIT_TITLE =~ /^Update.*translation$/
##
# Stage: Manual
#
# Creates a flatpak
##
flatpak:
stage: manual
image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master
artifacts:
name: package
paths:
- $(pwd)/*.flatpak
expire_in: 7 days
variables:
OLD_APPID: "org.gnome.Settings"
APPID: "org.gnome.SettingsDevel"
BUNDLE: "org.gnome.SettingsDevel.flatpak"
MANIFEST_PATH: "org.gnome.Settings.json"
PATCHES: "build-aux/flatpak/*.patch"
PROJECT_FILE: "build-aux/flatpak/org.gnome.Settings.json"
PROJECT_ID: "org.gnome.Settings"
PROJECT_NAME: "gnome-control-center.git"
RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo"
script:
- echo "== Flatpak packaging =="
# Move needed files to the root folder
- cp ${PATCHES} . || true
- cp ${PROJECT_FILE} ${MANIFEST_PATH}
# Make it a develoment manifest
- sed -i -n "p; s/$PROJECT_NAME//p" ${MANIFEST_PATH}
- >
sed -i "s,\"app-id\" : \"$PROJECT_ID\",\"app-id\" : \"<<ID>>\",g" ${MANIFEST_PATH}
- >
sed -i "s,\"url\" : \"https://gitlab.gnome.org/GNOME/$PROJECT_NAME\",\"branch\" : \"<<current>>\"\,,g" ${MANIFEST_PATH}
- >
sed -i "s,\"url\" : \"https://gitlab.gnome.org/GNOME/\",\"path\" : \".\",g" ${MANIFEST_PATH}
# Adjust the manifest to HEAD
- sed -i "s,<<ID>>,$APPID,g" ${MANIFEST_PATH}
- sed -i "s,<<current>>,origin/$CI_COMMIT_REF_NAME,g" ${MANIFEST_PATH}
# Update the icon name
- mv data/icons/hicolor/scalable/apps/$OLD_APPID.svg data/icons/hicolor/scalable/apps/$APPID.svg
- mv data/icons/hicolor/symbolic/apps/$OLD_APPID-symbolic.svg data/icons/hicolor/symbolic/apps/$APPID-symbolic.svg
- flatpak-builder --bundle-sources --repo=devel build ${MANIFEST_PATH}
- flatpak build-bundle devel ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${APPID}
cache:
paths:
- .flatpak-builder/cache
when: manual
except:
- tags
- gnome-3-.*
- master@GNOME/gnome-control-center
##
# Review
#
# Stage: review
#
# Starts the Flatpak review process.
##
review:
stage: review
dependencies:
- flatpak
when: manual
variables:
BUNDLE: "org.gnome.SettingsDevel.flatpak"
script:
- echo "Generating flatpak deployment"
artifacts:
paths:
- ${BUNDLE}
expire_in: 30 days
environment:
name: review/$CI_COMMIT_REF_NAME
url: https://gitlab.gnome.org/$CI_PROJECT_PATH/-/jobs/$CI_JOB_ID/artifacts/raw/${BUNDLE}
on_stop: stop_review
except:
- tags
- gnome-3-.*
- master@GNOME/gnome-control-center
##
# Stop Review
#
# Stage: review
#
# Stops the Flatpak review process.
##
stop_review:
stage: review
script:
- echo "Stopping flatpak deployment"
when: manual
environment:
name: review/$CI_COMMIT_REF_NAME
action: stop
except:
variables:
- $CI_PIPELINE_SOURCE == "schedule"
# Runs the sanitizers [address, thread, undefined, and memory].
.sanitizer: &sanitizer
<<: *save_build_logs
stage: manual
when: manual
script:
- *environment_information
- *build_procedure
- *run_tests
except:
variables:
- $CI_PIPELINE_SOURCE == "schedule"
- $CI_COMMIT_TITLE =~ /^Update.*translation$/
asan:
<<: *sanitizer
stage: test
when: on_success
variables:
BUILD_OPTS: "-Db_sanitize=address"
LSAN_OPTIONS: "suppressions=${CI_PROJECT_DIR}/build-aux/ci/lsan.supp"
tsan:
<<: *sanitizer
variables:
BUILD_OPTS: "-Db_sanitize=thread"
ubsan:
<<: *sanitizer
variables:
BUILD_OPTS: "-Db_sanitize=undefined"
msan:
<<: *sanitizer
variables:
BUILD_OPTS: "-Db_sanitize=memory"
CC: "clang"
# Runs multiarch build test.
.qemu: &multiarch
<<: *save_build_logs
image: docker:latest
services:
- docker:dind
script:
# Register QEMU archs
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
# Run the multiarch test job using QEMU
- 'docker run -v $(pwd):/cwd $IMAGE bash -e -c "cd /cwd &&
echo == Building == &&
rm -rf _build/ &&
meson . _build ${BUILD_OPTS} &&
ninja -C _build 2>&1 | tee compilation.log &&
echo == Testing == &&
ninja -C _build test"
'
except:
variables:
- $CI_PIPELINE_SOURCE == "schedule"
- $CI_COMMIT_TITLE =~ /^Update.*translation$/
armv8:
<<: *multiarch
stage: manual
when: manual
variables:
DOCKER_DRIVER: overlay
IMAGE: "registry.gitlab.gnome.org/gnome/gnome-control-center:fedora.aarch64"
ppc64le:
<<: *multiarch
stage: manual
when: manual
allow_failure: true
variables:
DOCKER_DRIVER: overlay
IMAGE: "registry.gitlab.gnome.org/gnome/gnome-control-center:fedora.ppc64le"
#############################################
# Create CI Docker Images #
#############################################
.Docker image template: &create_docker_image
image: docker:latest
stage: deploy
services:
- docker:dind
only:
variables:
- $CRON_TASK == "BUILD_CI_IMAGES"
changes:
- build-aux/ci/Dockerfile.*
script:
# Skip the build (if requested)
- |
if [[ -z "${CI_COMMIT_MESSAGE##*'[skip images]'*}" ]]; then
echo "== Nothing to do =="
exit 0
fi
- |
if [[ "${CI_COMMIT_REF_NAME}" != "master" ]]; then
echo "== Exiting, will only build CI images when pushing to master. =="
exit 0
fi
# Only when we have somewhere to publish to
- |
if [[ -z "${CI_REGISTRY}${CI_REGISTRY_IMAGE}${CI_REGISTRY_USER}${CI_REGISTRY_PASSWORD}" ]]; then
echo "== Exiting, CI registry not configured. =="
exit 0
fi
# Get multiarch stuff
- |
if [[ -n "${TARGET_ARCH}" ]]; then
docker run --rm --privileged multiarch/qemu-user-static:register --reset
wget https://github.com/multiarch/qemu-user-static/releases/download/v2.12.0/x86_64_qemu-${TARGET_ARCH}-static.tar.gz
fi
# Build using the Dockerfile
- docker build -f "$DOCKERFILE" -t "$CI_REGISTRY_IMAGE:$NAME" .
# Publish
- docker tag "$CI_REGISTRY_IMAGE:$NAME" "$CI_REGISTRY_IMAGE:job-"$CI_JOB_ID"_$NAME"
- docker images
- docker login ${CI_REGISTRY} -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD}
- docker push "$CI_REGISTRY_IMAGE"
fedora.dev:
<<: *create_docker_image
variables:
DOCKER_DRIVER: overlay
DOCKERFILE: "build-aux/ci/Dockerfile.fedora.30"
NAME: "fedora.dev"
fedora.aarch64:
<<: *create_docker_image
variables:
DOCKER_DRIVER: overlay
DOCKERFILE: "build-aux/ci/Dockerfile.arm64v8.fedora.30"
NAME: "fedora.aarch64"
TARGET_ARCH: "aarch64"
fedora.ppc64le:
<<: *create_docker_image
variables:
DOCKER_DRIVER: overlay
DOCKERFILE: "build-aux/ci/Dockerfile.ppc64le.fedora.latest"
NAME: "fedora.ppc64le"
TARGET_ARCH: "ppc64le"

View File

@@ -1,18 +0,0 @@
<!--
Not following the communication guidelines [1] will mean your issue or comment
will be removed. Read it carefully before submitting this issue.
[1] https://gitlab.gnome.org/GNOME/gnome-control-center/blob/master/docs/CONTRIBUTING.md#communication-guideline
-->
Detailed description of the issue. Put as much information as you can, potentially
with images showing the issue.
Steps to reproduce:
1. Open GNOME Settings
2. Change X to something else
3. ...

View File

@@ -1,41 +0,0 @@
# Current problems
<!--
What are the problems that the current project has?
For example:
* User cannot use the keyboard to perform most common actions
or
* User cannot see documents from cloud services
-->
# Goals & use cases
<!--
What are the use cases that this proposal will cover? What are the end goals?
For example:
* User needs to share a file with their friends.
or
* It should be easy to edit a picture within the app.
-->
# Requirements
<!--
What does the solution needs to ensure for being succesful?
For example:
* Work on small form factors and touch
or
* Use the Meson build system and integrate with it
-->
# Relevant art
<!--
Is there any product that has implemented something similar? Put links to other
projects, pictures, links to other code, etc.
-->
# Proposal & plan
<!-- What's the solution and how should be achieved? It can be split in smaller
tasks of minimum change, so they can be delivered across several releases. -->
/label ~"1. Epic"

View File

@@ -1,27 +0,0 @@
<!--
Not following the communication guidelines [1] will mean your issue or comment
will be removed. Read it carefully before submitting this issue.
[1] https://gitlab.gnome.org/GNOME/gnome-control-center/blob/master/docs/CONTRIBUTING.md#communication-guideline
-->
Detailed description of the feature. Put as much information as you can.
Proposed Mockups:
(Add mockups of the proposed feature)
## Design Tasks
* [ ] design tasks
## Development Tasks
* [ ] development tasks
## QA Tasks
* [ ] qa (quality assurance) tasks

6
.gitmodules vendored
View File

@@ -1,6 +0,0 @@
[submodule "subprojects/gvc"]
path = subprojects/gvc
url = https://gitlab.gnome.org/GNOME/libgnome-volume-control.git
[submodule "subprojects/libhandy"]
path = subprojects/libhandy
url = https://source.puri.sm/Librem5/libhandy.git

1
AUTHORS Normal file
View File

@@ -0,0 +1 @@
Jonathan Blandford <jrb@redhat.com>

42
COPYING
View File

@@ -1,12 +1,12 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
@@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@ impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
@@ -255,7 +255,7 @@ 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
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@@ -277,9 +277,9 @@ 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.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
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
@@ -303,16 +303,17 @@ the "copyright" line and a pointer to where the full notice is found.
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.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision version 69, Copyright (C) year name of author
Gnomovision 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.
@@ -335,6 +336,5 @@ necessary. Here is a sample; alter the names:
This 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
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

2
ChangeLog Normal file
View File

@@ -0,0 +1,2 @@
The ChangeLog is auto-generated when releasing. If you are seeing this, use
'git log' for a detailed list of changes.

15
MAINTAINERS Normal file
View File

@@ -0,0 +1,15 @@
Rodrigo Moya
E-mail: rodrigo at gnome-db.org
Userid: rodrigo
Sebastien Bacher
Email: seb128 at debian.org
Userid: sbacher
Thomas Wood
Email: thos at gnome.org
Userid: thos
Jens Granseuer
Email: jensgr at gmx.net
Userid: jensg

80
Makefile.am Normal file
View File

@@ -0,0 +1,80 @@
SUBDIRS = po libwindow-settings capplets font-viewer help
DIST_SUBDIRS = po libwindow-settings capplets font-viewer help libslab shell typing-break
if HAVE_LIBSLAB_DEPS
SUBDIRS += libslab
endif
if HAVE_LIBSLAB
SUBDIRS += shell
endif
if HAVE_TYPING_BREAK
SUBDIRS += typing-break
endif
schemasdir = @GCONF_SCHEMA_FILE_DIR@
schemas_in_files = gnome-control-center.schemas.in
schemas_DATA = $(schemas_in_files:.schemas.in=.schemas)
@INTLTOOL_SCHEMAS_RULE@
ACLOCAL_AMFLAGS = -I m4
CLEANFILES = \
$(schemas_DATA)
DISTCLEANFILES = \
gnome-doc-utils.make
MAINTAINERCLEANFILES = \
$(srcdir)/INSTALL \
$(srcdir)/aclocal.m4 \
$(srcdir)/autoscan.log \
$(srcdir)/compile \
$(srcdir)/config.guess \
$(srcdir)/config.h.in \
$(srcdir)/config.sub \
$(srcdir)/configure.scan \
$(srcdir)/depcomp \
$(srcdir)/install-sh \
$(srcdir)/ltmain.sh \
$(srcdir)/missing \
$(srcdir)/mkinstalldirs \
$(srcdir)/omf.make \
$(srcdir)/xmldocs.make \
$(srcdir)/gtk-doc.make \
`find "$(srcdir)" -type f -name Makefile.in -print`
EXTRA_DIST = \
$(schemas_in_files) \
MAINTAINERS \
gnome-doc-utils.make
DISTCHECK_CONFIGURE_FLAGS = --disable-scrollkeeper --disable-update-mimedb
GITIGNOREFILES=m4
-include $(top_srcdir)/git.mk
install-data-local:
if GCONF_SCHEMAS_INSTALL
if test -z "$(DESTDIR)" ; then \
for p in $(schemas_DATA) ; do \
GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(top_builddir)/$$p >&1 > /dev/null; \
done \
fi
endif
dist-hook:
@if test -d "$(srcdir)/.git"; \
then \
echo Creating ChangeLog && \
( cd "$(top_srcdir)" && \
echo '# Generated by Makefile. Do not edit.'; echo; \
$(top_srcdir)/missing --run git log --stat ) > ChangeLog.tmp \
&& mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \
|| ( rm -f ChangeLog.tmp ; \
echo Failed to generate ChangeLog >&2 ); \
else \
echo A git clone is required to generate a ChangeLog >&2; \
fi

5440
NEWS

File diff suppressed because it is too large Load Diff

53
README Normal file
View File

@@ -0,0 +1,53 @@
GNOME Control Center
====================
About -
The control center is GNOME's main interface for configuration of various
aspects of your desktop.
Installation -
See the file 'INSTALL'
How to report bugs -
Bugs should be reported to the GNOME bug tracking system under the product
control-center. It is available at http://bugzilla.gnome.org.
In the report please include the following information -
Operating system and version
For Linux, version of the C library
How to reproduce the bug if possible
If the bug was a crash, include the exact text that was printed out
A stacktrace where possible [see below]
How to get a stack trace -
If the crash is reproducible, it is possible to get a stack trace and
attach it to the bug report. The following steps are used to obtain a
stack trace -
Run the program in gdb [the GNU debugger] or any other debugger
ie. gdb gnome-keyboard-properties
Start the program
ie. (gdb) run
Reproduce the crash and the program will exit to the gdb prompt
Get the back trace
ie. (gdb) bt full
Once you have the backtrace, copy and paste this either into the
'Comments' field or attach a file with it included.
Patches -
Patches should be submitted to bugzilla.gnome.org or emailed to the
gnomecc-list@gnome.org list. If using bugzilla, attach
the patch to a new bug report [or preferably, check to see if there is
already a bug report that corresponds to your patch]. Bug reports
containing patches should include the 'PATCH' keyword.
Patches should be created using the unified diff form.
ie. svn diff file-to-be-patched.c > patch.diff

View File

@@ -1,63 +0,0 @@
[![Build Status](https://gitlab.gnome.org/GNOME/gnome-control-center/badges/master/build.svg)](https://gitlab.gnome.org/GNOME/gnome-control-center/pipelines)
[![Coverage report](https://gitlab.gnome.org/GNOME/gnome-control-center/badges/master/coverage.svg)](https://gnome.pages.gitlab.gnome.org/gnome-control-center/)
[![License](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://gitlab.gnome.org/GNOME/gnome-control-center/blob/master/COPYING)
GNOME Settings
====================
GNOME Settings is GNOME's main interface for configuration of various aspects of your desktop.
## Contributing
See `docs/CONTRIBUTING.md` for details on the contribution process, and `docs/HACKING.md`
for the coding style guidelines.
## Reporting Bugs
Before reporting any bugs or opening feature requests, [read the communication guidelines][communication-guidelines].
Bugs should be reported to the GNOME bug tracking system under the product
gnome-control-center. It is available at [GitLab Issues](https://gitlab.gnome.org/GNOME/gnome-control-center/issues).
In the report please include the following information:
* Operating system and version
* For Linux, version of the C library
* Exact error message
* Steps to reproduce the bug
* If the bug is a visual defect, attach a screenshot
* If the bug is a crash, attach a backtrace if possible [see below]
### How to get a backtrace
If the crash is reproducible, follow the steps to obtain a
backtrace:
Install debug symbols for gnome-control-center.
Run the program in gdb [the GNU debugger] or any other debugger.
gdb gnome-control-center
Start the program.
(gdb) run
Reproduce the crash and when the program exits to (gdb) prompt, get the backtrace.
(gdb) bt full
Once you have the backtrace, copy and paste it into the 'Comments' field or attach it as
a file to the bug report.
## Testing Unstable Settings
It is quite easy to test and give feedback about the development version of GNOME
Settings. Just access https://gitlab.gnome.org/GNOME/gnome-control-center/environments,
get the latest version, download it, double-click the file, install and run.
Note that GNOME Settings Flatpak will only work if you are running
the latest GNOME version in your host system.
[communication-guidelines]: https://gitlab.gnome.org/GNOME/gnome-control-center/blob/master/docs/CONTRIBUTING.md#communication-guidelines

105
TODO Normal file
View File

@@ -0,0 +1,105 @@
[ Things prefaced with GSD need to be fixed in the gnome-settings daemon
and not the dialog ]
ACCESSIBILITY:
* UI love
* Figure out Keyboard/peripherals integration
BACKGROUND:
* Seth love
* Get actual GNOME backgrounds
DEFAULT APPLICATIONS PROPERTIES:
* Merge in Window Manager selection
FILE TYPES:
* Stability issues
* UI Love
FONT AND THEME:
* merge them
GNOME SETTINGS DAEMON:
* disk monitor
KEYBOARD SHORTCUTS:
* Not sure I like the name.
* Needs icon
* Add a way to add new ones
KEYBOARD PROPERTIES:
* GSD: support keyboard bell
* Remove awful jrb-art and replace with actual blinking cursor
MOUSE PROPERTIES:
* GSD: Add support for devices other than CoreInput.
KEYBINDINGS:
* Metacity keyboard merging. See what hp plans to do
PANEL:
* UI love
* port gconf-peditor functionality
SAWFISH????
SOUND:
* Unknown
* Buggy as heck
SCREENSAVER:
* See what Jacob wants to do
* xscreensaver release
UI-PROPERTIES:
* Seems to be okay
GENERAL:
* Where we have keys, add a restore to defaults context menu button.
* Kill 'advanced'
* Control center itself seems to be fine
* Change buttons to use whatever the UI team comes up with
* Make sure we handle 'locked down' keys
* Make sure we handle all broken keys!
GOING FORWARD:
Hardware Integration
- hwbrowser??? Kde has one; should we?
- peripherals (RH only?)
- gphoto/sane/cd burning?? Userland hw.
Nautilus:
- Move nautilus settings
- Desktop should be a separate dialog
Background:
- Merge nautilus pane and bg capplet;
- possibly even popup a nautilus window of bg's for DnD
- Integrate better w/ nautilus
- per Workspace?
Workspace/Tasks
- Set number and name of workspaces
- Maybe something else?
Identification Capplet
- GDM screen
- Mail capplet
Password Capplet?
- ssh/smb
Themes and Appearance:
- blah
Sound:
- blah
Bugzilla
- Start using it better

27
autogen.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
PKG_NAME="control-center"
(test -f $srcdir/configure.in \
&& test -f $srcdir/autogen.sh \
&& test -d $srcdir/shell) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
echo " top-level $PKG_NAME directory"
exit 1
}
DIE=0
rm -f .using-gnome-libs-package
if ! which gnome-autogen.sh ; then
echo "You need to install the gnome-common module and make"
echo "sure the gnome-autogen.sh script is in your \$PATH."
exit 1
fi
REQUIRED_AUTOMAKE_VERSION=1.9 . gnome-autogen.sh

View File

@@ -1,26 +0,0 @@
FROM arm64v8/fedora:30
MAINTAINER Claudio André (c) 2018 V1.0
LABEL architecture="aarch64"
LABEL version="1.0"
LABEL description="Multiarch Docker image to run CI for GNOME Settings."
ADD x86_64_qemu-aarch64-static.tar.gz /usr/bin
RUN dnf -y --nogpgcheck upgrade && \
dnf -y install \
@c-development @development-tools clang libasan gcovr \
accountsservice-devel cheese-libs-devel chrpath colord-devel \
colord-gtk-devel cups-devel desktop-file-utils docbook-style-xsl flatpak-devel gdk-pixbuf2-devel \
gettext git glib2-devel gnome-bluetooth-libs-devel gnome-desktop3-devel \
gnome-online-accounts-devel gnome-settings-daemon-devel grilo-devel \
gsettings-desktop-schemas-devel gsound-devel gtk3-devel ibus-devel intltool libcanberra-devel \
libgtop2-devel libgudev-devel libnma-devel libpwquality-devel libsmbclient-devel \
libsoup-devel libudisks2-devel libwacom-devel libX11-devel libXi-devel libxml2-devel libxslt \
libXxf86misc-devel meson ModemManager-glib-devel NetworkManager-libnm-devel \
polkit-devel pulseaudio-libs-devel upower-devel \
python3-dbusmock xorg-x11-server-Xvfb mesa-dri-drivers libsecret-devel && \
dnf -y clean all
CMD ["/bin/bash"]

View File

@@ -1,24 +0,0 @@
FROM fedora:30
MAINTAINER Claudio André (c) 2018 V1.0
LABEL architecture="x86_64"
LABEL version="1.0"
LABEL description="Docker image to run CI for GNOME Settings."
RUN dnf -y --nogpgcheck upgrade && \
dnf -y install \
@c-development @development-tools clang libasan gcovr \
accountsservice-devel cheese-libs-devel chrpath colord-devel \
colord-gtk-devel cups-devel desktop-file-utils docbook-style-xsl flatpak-devel gdk-pixbuf2-devel \
gettext git glib2-devel gnome-bluetooth-libs-devel gnome-desktop3-devel \
gnome-online-accounts-devel gnome-settings-daemon-devel grilo-devel \
gsettings-desktop-schemas-devel gsound-devel gtk3-devel ibus-devel intltool libcanberra-devel \
libgtop2-devel libgudev-devel libnma-devel libpwquality-devel libsmbclient-devel \
libsoup-devel libudisks2-devel libwacom-devel libX11-devel libXi-devel libxml2-devel libxslt \
libXxf86misc-devel meson ModemManager-glib-devel NetworkManager-libnm-devel \
polkit-devel pulseaudio-libs-devel upower-devel \
python3-dbusmock xorg-x11-server-Xvfb mesa-dri-drivers libsecret-devel llvm && \
dnf -y clean all
CMD ["/bin/bash"]

View File

@@ -1,26 +0,0 @@
FROM ppc64le/fedora:latest
MAINTAINER Claudio André (c) 2018 V1.0
LABEL architecture="ppc64le"
LABEL version="1.0"
LABEL description="Multiarch Docker image to run CI for GNOME Settings."
ADD x86_64_qemu-ppc64le-static.tar.gz /usr/bin
RUN dnf -y --nogpgcheck upgrade && \
dnf -y install \
@c-development @development-tools clang libasan gcovr \
accountsservice-devel cheese-libs-devel chrpath colord-devel \
colord-gtk-devel cups-devel desktop-file-utils docbook-style-xsl flatpak-devel gdk-pixbuf2-devel \
gettext git glib2-devel gnome-bluetooth-libs-devel gnome-desktop3-devel \
gnome-online-accounts-devel gnome-settings-daemon-devel grilo-devel \
gsettings-desktop-schemas-devel gsound-devel gtk3-devel ibus-devel intltool libcanberra-devel \
libgtop2-devel libgudev-devel libnma-devel libpwquality-devel libsmbclient-devel \
libsoup-devel libudisks2-devel libwacom-devel libX11-devel libXi-devel libxml2-devel libxslt \
libXxf86misc-devel meson ModemManager-glib-devel NetworkManager-libnm-devel \
polkit-devel pulseaudio-libs-devel upower-devel \
python3-dbusmock xorg-x11-server-Xvfb mesa-dri-drivers libsecret-devel && \
dnf -y clean all
CMD ["/bin/bash"]

View File

@@ -1,61 +0,0 @@
#!/bin/bash -e
function do_print_labels(){
if [[ -n "${1}" ]]; then
label_len=${#1}
span=$(((54 - $label_len) / 2))
echo
echo "= ======================================================== ="
printf "%s %${span}s %s %${span}s %s\n" "=" "" "$1" "" "="
echo "= ======================================================== ="
else
echo "= ========================= Done ========================= ="
echo
fi
}
function do_show_info(){
local compiler=gcc
echo -n "Processors: "; grep -c ^processor /proc/cpuinfo
grep ^MemTotal /proc/meminfo
id; uname -a
printenv
echo '-----------------------------------------'
cat /etc/*-release
echo '-----------------------------------------'
if [[ ! -z $CC ]]; then
compiler=$CC
fi
echo 'Compiler version'
$compiler --version
echo '-----------------------------------------'
$compiler -dM -E -x c /dev/null
echo '-----------------------------------------'
}
function do_check_warnings(){
cat compilation.log | grep "warning:" | awk '{total+=1}END{print "Total number of warnings: "total}'
}
# ----------- -----------
if [[ $1 == "INFO" ]]; then
do_print_labels 'Build environment '
do_show_info
do_print_labels
elif [[ $1 == "GIT_INFO" ]]; then
do_print_labels 'Commit'
git log --pretty=format:"%h %cd %s" -1; echo
do_print_labels
elif [[ $1 == "WARNINGS" ]]; then
do_print_labels 'Warning Report '
do_check_warnings
do_print_labels
fi

View File

@@ -1,19 +0,0 @@
# https://bugs.freedesktop.org/show_bug.cgi?id=105466
leak:libfontconfig.so.1
# Unknown and unreported bugs
leak:__GI___vasprintf_chk
leak:__interceptor_malloc
leak:__alloc_dir
leak:libglib-2.0.so.0
# Needing attention
leak:<unknown module>
leak:test_timezone_gfx
########
# __GI___vasprintf_chk /usr/src/debug/glibc-2.27.9000-432-g104502102c/debug/vasprintf_chk.c:80
# __alloc_dir ../sysdeps/posix/opendir.c:118
# g_malloc (/lib64/libglib-2.0.so.0+0x523c5)
# g_realloc (/lib64/libglib-2.0.so.0+0x5247d)
########

View File

@@ -1,22 +0,0 @@
From ba5e0451b51c983e40afd123b6e0d3eddb55e610 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Sat, 24 Mar 2018 17:37:02 +0000
Subject: linux: Include <sys/sysmacros.h> for major() macro.
Since glibc 2.27 this header is required.
---
libparted/arch/linux.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 31b98ab..7e86b51 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -41,6 +41,7 @@
#include <sys/utsname.h> /* for uname() */
#include <scsi/scsi.h>
#include <assert.h>
+#include <sys/sysmacros.h>
#ifdef ENABLE_DEVICE_MAPPER
#include <libdevmapper.h>
#endif

View File

@@ -1,716 +0,0 @@
{
"app-id" : "org.gnome.Settings",
"runtime" : "org.gnome.Sdk",
"runtime-version" : "master",
"sdk" : "org.gnome.Sdk",
"command" : "gnome-control-center",
"rename-desktop-file" : "gnome-control-center.desktop",
"tags" : [
"devel"
],
"desktop-file-name-prefix" : "(Development) ",
"finish-args" : [
"--device=dri",
"--env=DCONF_USER_CONFIG_DIR=.config/dconf",
"--filesystem=host",
"--own-name=org.gnome.ControlCenter",
"--own-name=org.gnome.SessionManager",
"--share=ipc",
"--share=network",
"--socket=x11",
"--socket=pulseaudio",
"--socket=session-bus",
"--socket=system-bus",
"--socket=wayland"
],
"build-options" : {
"cflags" : "-O2 -g",
"cxxflags" : "-O2 -g",
"env" : {
"V" : "1"
}
},
"x-run-args" : [
"--verbose"
],
"cleanup" : [
"/include",
"/share/aclocal",
"/man",
"/share/man",
"/share/gtk-doc",
"/share/vala",
"*.la",
"*.a"
],
"modules" : [
{
"name" : "pwquality",
"buildsystem" : "autotools",
"config-opts" : [
],
"sources" : [
{
"type" : "git",
"url" : "https://github.com/libpwquality/libpwquality.git"
}
]
},
{
"name" : "polkit",
"buildsystem" : "autotools",
"config-opts" : [
"--disable-man-pages",
"--disable-introspection",
"--disable-libelogind",
"--enable-libsystemd-login=no",
"--with-systemdsystemunitdir=no"
],
"sources" : [
{
"type" : "git",
"url" : "git://anongit.freedesktop.org/polkit"
}
]
},
{
"name" : "accountservice",
"buildsystem" : "meson",
"config-opts" : [
"-Ddocbook=false",
"-Delogind=false",
"-Dgtk_doc=false",
"-Dintrospection=false",
"-Dsystemd=false",
"-Dsystemdsystemunitdir=no"
],
"sources" : [
{
"type" : "git",
"url" : "git://anongit.freedesktop.org/accountsservice"
}
]
},
{
"name" : "libusb1",
"buildsystem" : "autotools",
"config-opts" : [
"--disable-udev"
],
"sources" : [
{
"type" : "git",
"url" : "git://github.com/libusb/libusb.git"
}
]
},
{
"name" : "gusb",
"buildsystem" : "meson",
"config-opts" : [
"-Ddocs=false",
"-Dtests=false",
"-Dvapi=false"
],
"sources" : [
{
"type" : "git",
"url" : "git://github.com/hughsie/libgusb.git"
}
]
},
{
"name" : "udev",
"config-opts" : [
"--disable-hwdb",
"--disable-logging",
"--disable-gudev",
"--disable-introspection",
"--disable-keymap",
"--disable-mtd_probe"
],
"cleanup" : [
"/include",
"/etc",
"/libexec",
"/sbin",
"/lib/pkgconfig",
"/man",
"/share/aclocal",
"/share/doc",
"/share/gtk-doc",
"/share/man",
"/share/pkgconfig",
"*.la",
"*.a"
],
"sources" : [
{
"type" : "git",
"url" : "git://github.com/gentoo/eudev.git"
}
]
},
{
"name" : "gudev",
"buildsystem" : "autotools",
"config-opts" : [
"--disable-umockdev"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/libgudev.git"
}
]
},
{
"name" : "colord",
"buildsystem" : "meson",
"config-opts" : [
"-Dargyllcms_sensor=false",
"-Dbash_completion=false",
"-Dman=false",
"-Dudev_rules=false",
"-Dsystemd=false",
"-Dvapi=false",
"-Ddocs=false",
"-Dtests=false",
"-Dinstalled_tests=false"
],
"sources" : [
{
"type" : "git",
"url" : "git://github.com/hughsie/colord.git"
}
]
},
{
"name" : "colord-gtk",
"buildsystem" : "meson",
"config-opts" : [
"-Dman=false"
],
"sources" : [
{
"type" : "git",
"url" : "git://github.com/hughsie/colord-gtk.git"
}
]
},
{
"name" : "rest",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "git",
"branch" : "librest-0-7",
"url" : "https://gitlab.gnome.org/GNOME/librest.git"
}
]
},
{
"name" : "gnome-online-accounts",
"buildsystem" : "meson",
"build-options" : {
"cflags" : "-Wno-error"
},
"config-opts" : [
"-Dgtk_doc=false",
"-Dintrospection=false",
"-Dvapi=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/gnome-online-accounts.git"
}
]
},
{
"name" : "gnome-desktop",
"buildsystem" : "meson",
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/gnome-desktop.git"
}
]
},
{
"name" : "geocode-glib",
"buildsystem" : "meson",
"config-opts" : [
"-Denable-gtk-doc=false",
"-Denable-introspection=false",
"-Denable-installed-tests=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/geocode-glib.git"
}
]
},
{
"name" : "libgweather",
"buildsystem" : "meson",
"config-opts" : [
"-Dglade_catalog=false",
"-Denable_vala=false",
"-Dgtk_doc=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/libgweather.git"
}
]
},
{
"name" : "upower",
"buildsystem" : "autotools",
"config-opts" : [
"--prefix=/app",
"--with-systemdsystemunitdir=/app/lib/systemd/system",
"--disable-gtk-doc",
"--disable-man-pages",
"--disable-tests"
],
"sources" : [
{
"type" : "git",
"url" : "git://anongit.freedesktop.org/upower"
}
]
},
{
"name" : "libwacom",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "git",
"url" : "https://github.com/linuxwacom/libwacom.git"
}
]
},
{
"name" : "libndp",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "archive",
"url" : " http://libndp.org/files/libndp-1.6.tar.gz",
"sha256" : "0c7dfa84e013bd5e569ef2c6292a6f72cfaf14f4ff77a77425e52edc33ffac0e"
}
]
},
{
"name" : "NetworkManager",
"buildsystem" : "meson",
"build-options" : {
"cflags" : "-ltinfo",
"cxxflags" : "-ltinfo"
},
"config-opts" : [
"-Dlibaudit=no",
"-Ddbus_conf_dir=/app/etc/dbus-1/system.d",
"-Ddbus_ifaces_dir=/app/share/dbus-1/interfaces",
"-Ddbus_sys_dir=/app/share/dbus-1/system.d",
"-Ddnsmasq=/usr/bin/true",
"-Ddocs=false",
"-Dintrospection=false",
"-Diptables=/usr/bin/true",
"-Djson_validation=false",
"-Dlibnm_glib=false",
"-Dlibpsl=false",
"-Dmodem_manager=false",
"-Dnmtui=false",
"-Dovs=false",
"-Dppp=false",
"-Dqt=false",
"-Dselinux=false",
"-Dsession_tracking=no",
"-Dsystemdsystemunitdir='no'",
"-Dsystemd_journal=false",
"-Dtests=no",
"-Dvapi=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git"
}
]
},
{
"name" : "network-manager-applet",
"buildsystem" : "meson",
"config-opts" : [
"-Dgtk_doc=false",
"-Dintrospection=false",
"-Dlibnm_gtk=false",
"-Dselinux=false",
"-Dteam=false",
"-Dwwan=false",
"-Dmobile_broadband_provider_info=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/network-manager-applet.git"
}
]
},
{
"name" : "ModemManager",
"buildsystem" : "autotools",
"config-opts" : [
"--disable-introspection",
"--disable-vala",
"--with-udev-base-dir=/app/lib",
"--with-systemdsystemunitdir=/app/lib/systemd/system",
"--without-mbim",
"--without-qmi"
],
"sources" : [
{
"type" : "git",
"url" : "git://anongit.freedesktop.org/ModemManager/ModemManager"
}
]
},
{
"name" : "gnome-settings-daemon",
"buildsystem" : "meson",
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/gnome-settings-daemon.git"
}
]
},
{
"name" : "gnome-bluetooth",
"buildsystem" : "meson",
"config-opts" : [
"-Dintrospection=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/gnome-bluetooth.git"
}
]
},
{
"name" : "grilo",
"buildsystem" : "meson",
"config-opts" : [
"-Denable-grl-pls=false",
"-Denable-gtk-doc=false",
"-Denable-introspection=false",
"-Denable-test-ui=false",
"-Denable-vala=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/grilo.git"
}
]
},
{
"name" : "openldap",
"buildsystem" : "autotools",
"config-opts" : [
"--disable-slapd"
],
"sources" : [
{
"type" : "archive",
"url" : "https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-2.4.46.tgz",
"sha256" : "9a90dcb86b99ae790ccab93b7585a31fbcbeec8c94bf0f7ab0ca0a87ea0c4b2d"
}
]
},
{
"name" : "libtirpc",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "archive",
"url" : "http://downloads.sourceforge.net/sourceforge/libtirpc/libtirpc-1.0.3.tar.bz2",
"sha256" : "86c3a78fc1bddefa96111dd233124c703b22a78884203c55c3e06b3be6a0fd5e"
}
]
},
{
"name" : "rpcsvc-proto",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "archive",
"url" : "https://github.com/thkukuk/rpcsvc-proto/archive/v1.4.tar.gz",
"sha256" : "eaa227686b84e8ae20181d2119c0ccac29d82371441844008019a134dafe3613"
}
]
},
{
"name" : "samba",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "archive",
"url" : "https://download.samba.org/pub/samba/stable/samba-4.8.1.tar.gz",
"sha256" : "8ef7367507f16b7a5e2f6aed5bcdbd1143feca79aa2a07c9b21292b17d7f789d"
}
]
},
{
"name" : "libgtop2",
"buildsystem" : "autotools",
"config-opts" : [
"--disable-introspection"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/libgtop.git"
}
]
},
{
"name" : "cheese",
"buildsystem" : "autotools",
"config-opts" : [
"--disable-introspection"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/cheese.git"
}
]
},
{
"name" : "libhandy",
"buildsystem" : "meson",
"config-opts" : [
"-Dexamples=false",
"-Dglade_catalog=disabled",
"-Dintrospection=disabled",
"-Dtests=false",
"-Dvapi=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://source.puri.sm/Librem5/libhandy.git"
}
]
},
{
"name" : "gsound",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/gsound.git"
}
]
},
{
"name" : "libkmod",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "archive",
"url" : "https://mirrors.edge.kernel.org/pub/linux/utils/kernel/kmod/kmod-25.tar.xz",
"sha256" : "7165e6496656159dcb909a91ed708a0fe273a4b128b4b1dc997ccb5189eef1cd"
}
]
},
{
"name" : "lvm2",
"buildsystem" : "autotools",
"config-opts" : [
"--prefix=/app",
"--enable-cmdlib",
"--enable-dmeventd",
"--enable-pkgconfig",
"--with-usrlibdir=/app/lib",
"--with-usrbindir=/app/bin",
"--with-staticdir=/app/bin"
],
"sources" : [
{
"type" : "archive",
"url" : "https://www.sourceware.org/pub/lvm2/LVM2.2.02.177.tgz",
"sha256" : "4025a23ec9b15c2cb7486d151c29dc953b75efc4d452cfe9dbbc7c0fac8e80f2"
}
],
"post-install" : [
"chmod 755 /app/sbin/dm*",
"chmod 755 /app/sbin/lvm*",
"chmod 755 /app/lib/libdevmapper-event-lvm2.so.2.02",
"chmod 755 /app/lib/libdevmapper-event-lvm2mirror.so",
"chmod 755 /app/lib/libdevmapper-event-lvm2raid.so",
"chmod 755 /app/lib/libdevmapper-event-lvm2snapshot.so",
"chmod 755 /app/lib/libdevmapper-event-lvm2thin.so",
"chmod 755 /app/lib/libdevmapper-event.so.1.02",
"chmod 755 /app/lib/libdevmapper.so.1.02",
"chmod 755 /app/lib/liblvm2cmd.so.2.02"
]
},
{
"name" : "parted",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "archive",
"url" : "http://ftp.gnu.org/gnu/parted/parted-3.2.tar.xz",
"sha256" : "858b589c22297cacdf437f3baff6f04b333087521ab274f7ab677cb8c6bb78e4"
},
{
"type" : "patch",
"path" : "libparted-include.patch"
}
]
},
{
"name" : "mpfr",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "archive",
"url" : "https://www.mpfr.org/mpfr-4.0.2/mpfr-4.0.2.tar.xz",
"sha256" : "1d3be708604eae0e42d578ba93b390c2a145f17743a744d8f3f8c2ad5855a38a"
}
]
},
{
"name" : "bytesize",
"buildsystem" : "autotools",
"config-opts" : [
"--with-gtk-doc=no"
],
"sources" : [
{
"type" : "git",
"url" : "https://github.com/storaged-project/libbytesize.git"
}
]
},
{
"name" : "cryptsetup",
"autotools" : "autotools",
"sources" : [
{
"type" : "archive",
"url" : "https://www.kernel.org/pub/linux/utils/cryptsetup/v1.7/cryptsetup-1.7.5.tar.xz",
"sha256" : "2b30cd1d0dd606a53ac77b406e1d37798d4b0762fa89de6ea546201906a251bd"
}
]
},
{
"name" : "swig",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "git",
"url" : "https://github.com/swig/swig.git"
}
]
},
{
"name" : "volume-key",
"buildsystem" : "simple",
"build-commands" : [
"autoreconf -i",
"./configure --prefix=/app",
"make install"
],
"sources" : [
{
"type" : "archive",
"url" : "https://github.com/felixonmars/volume_key/archive/volume_key-0.3.11.tar.gz",
"sha256" : "92250506756eca19a0b6f50c16d3502eb5566ea4725645d7c5d87eb5cc8f3fd8"
}
]
},
{
"name" : "libblockdev",
"buildsystem" : "autotools",
"config-opts" : [
"--disable-tests",
"--with-btrfs=no",
"--with-dm=no",
"--with-gtk-doc=no",
"--with-kbd=no",
"--with-lvm=no",
"--with-lvm-dbus=no",
"--with-mpath=no",
"--with-nvdimm=no",
"--with-tools=no",
"--with-vdo=no"
],
"sources" : [
{
"type" : "git",
"url" : "https://github.com/storaged-project/libblockdev.git"
}
]
},
{
"name" : "atasmart",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "archive",
"url" : "http://0pointer.de/public/libatasmart-0.19.tar.xz",
"sha256" : "61f0ea345f63d28ab2ff0dc352c22271661b66bf09642db3a4049ac9dbdb0f8d"
}
]
},
{
"name" : "udisks",
"buildsystem" : "autotools",
"config-opts" : [
"--disable-introspection",
"--disable-lvm2",
"--with-systemdsystemunitdir=/app/lib/systemd/system",
"--with-tmpfilesdir=/app/lib/tmpfiles.d"
],
"sources" : [
{
"type" : "git",
"url" : "https://github.com/storaged-project/udisks.git"
}
]
},
{
"name" : "gnome-backgrounds",
"buildsystem" : "meson",
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/gnome-backgrounds.git"
}
]
},
{
"name" : "gnome-control-center",
"buildsystem" : "meson",
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/gnome-control-center.git"
}
],
"config-opts" : [
"-Dtracing=true"
]
}
]
}

View File

@@ -1,5 +0,0 @@
update_from_gsd = find_program('meson/update-from-gsd.sh')
update_from_gsd_in = files('meson/update-from-gsd.in')
update_from_nma_in = files('meson/update-from-nma.in')
meson.add_install_script('meson/meson_post_install.py', control_center_datadir)

View File

@@ -1,15 +0,0 @@
#!/usr/bin/env python3
import os
import subprocess
import sys
gsettingsschemadir = os.path.join(sys.argv[1], 'glib-2.0', 'schemas')
icondir = os.path.join(sys.argv[1], 'icons', 'hicolor')
if not os.environ.get('DESTDIR'):
print('Compiling gsettings schemas...')
subprocess.call(['glib-compile-schemas', gsettingsschemadir])
print('Update icon cache...')
subprocess.call(['gtk-update-icon-cache', '-f', '-t', icondir])

View File

@@ -1,10 +0,0 @@
#!/bin/sh
cd @working_dir@
export FILES="@source_files@"
export DIR="@input_dir@"
@program@ &&
git add @source_files@ &&
git commit -m "@source_message@"

View File

@@ -1,26 +0,0 @@
#!/bin/bash
function die() {
echo $*
exit 1
}
if test -z "$DIR"; then
echo "Must set DIR"
exit 1
fi
if test -z "$FILES"; then
echo "Must set FILES"
exit 1
fi
for FILE in $FILES; do
if cmp -s $DIR/$FILE $FILE; then
echo "File $FILE is unchanged"
else
cp $DIR/$FILE $FILE || die "Could not move $DIR/$FILE to $FILE"
echo "Updated $FILE"
git add $FILE
fi
done

View File

@@ -1,19 +0,0 @@
#!/bin/sh
cd @working_dir@
export FILES="@source_files@"
export DIR="@input_dir@"
@program@ &&
patch -p4 < @source_patch@ &&
git add @source_files@ &&
git commit -m "@source_message@"
export FILES="@resource_data@"
export DIR="@input_dir@"
@program@ &&
patch -p4 < @resource_patch@ &&
git add @resource_data@ &&
git commit -m "@resource_message@"

34
capplets/Makefile.am Normal file
View File

@@ -0,0 +1,34 @@
SUBDIRS = \
common \
accessibility \
appearance \
default-applications \
keybindings \
keyboard \
mouse \
network \
windows
DIST_SUBDIRS = \
common \
accessibility \
appearance \
default-applications \
keybindings \
keyboard \
mouse \
network \
windows \
display \
about-me
if HAVE_RANDR
SUBDIRS += display
endif
if BUILD_ABOUTME
SUBDIRS += about-me
endif
-include $(top_srcdir)/git.mk

View File

@@ -0,0 +1,2 @@
Diego Gonzalez Gonzalez <diego@pemas.net>
Chris Toshok <toshok@ximian.com>

View File

@@ -0,0 +1,59 @@
SUBDIRS = icons
# This is used in GNOMECC_CAPPLETS_CFLAGS
cappletname = about-me
ui_files = gnome-about-me-dialog.ui gnome-about-me-password.ui gnome-about-me-fingerprint.ui
Desktop_in_files = gnome-about-me.desktop.in
gnome_about_me_SOURCES = \
eel-alert-dialog.c \
eel-alert-dialog.h \
eel-gtk-macros.h \
gnome-about-me-password.c \
gnome-about-me-password.h \
e-image-chooser.c \
e-image-chooser.h \
gnome-about-me-fingerprint.c \
gnome-about-me-fingerprint.h \
$(MARSHALFILES) \
fingerprint-strings.h \
gnome-about-me.c
MARSHALFILES = marshal.c marshal.h
BUILT_SOURCES = $(MARSHALFILES)
marshal.h: fprintd-marshal.list
@GLIB_GENMARSHAL@ --prefix=fprintd_marshal $< --header > $@
marshal.c: fprintd-marshal.list
@GLIB_GENMARSHAL@ --prefix=fprintd_marshal $< --body --header > $@
if BUILD_ABOUTME
bin_PROGRAMS = gnome-about-me
gnome_about_me_LDADD = $(GNOMECC_CAPPLETS_LIBS) $(LIBEBOOK_LIBS)
gnome_about_me_LDFLAGS = -export-dynamic
@INTLTOOL_DESKTOP_RULE@
desktopdir = $(datadir)/applications
desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop)
uidir = $(pkgdatadir)/ui
ui_DATA = $(ui_files)
INCLUDES = \
$(GNOMECC_CAPPLETS_CFLAGS) \
$(LIBEBOOK_CFLAGS) \
-DDATADIR="\"$(datadir)\"" \
-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \
-DGNOMECC_UI_DIR="\"$(uidir)\"" \
-DGNOMECC_PIXMAP_DIR="\"$(pkgdatadir)/pixmaps\"" \
-DGNOMELOCALEDIR="\"$(datadir)/locale\""
endif # BUILD_ABOUTME
CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) $(desktop_DATA) $(MARSHALFILES)
EXTRA_DIST = $(ui_files) fprintd-marshal.list
-include $(top_srcdir)/git.mk

View File

@@ -0,0 +1,455 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* e-image-chooser.c
* Copyright (C) 2004 Novell, Inc.
* Author: Chris Toshok <toshok@ximian.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
*
* 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 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-object.h>
#include <glib/gi18n.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
#include "e-image-chooser.h"
struct _EImageChooserPrivate {
GtkWidget *image;
GtkWidget *browse_button;
char *image_buf;
int image_buf_size;
int image_width;
int image_height;
gboolean editable;
};
enum {
CHANGED,
LAST_SIGNAL
};
static gint image_chooser_signals [LAST_SIGNAL] = { 0 };
static void e_image_chooser_init (EImageChooser *chooser);
static void e_image_chooser_class_init (EImageChooserClass *klass);
static void e_image_chooser_dispose (GObject *object);
static gboolean image_drag_motion_cb (GtkWidget *widget,
GdkDragContext *context,
gint x, gint y, guint time, EImageChooser *chooser);
static gboolean image_drag_drop_cb (GtkWidget *widget,
GdkDragContext *context,
gint x, gint y, guint time, EImageChooser *chooser);
static void image_drag_data_received_cb (GtkWidget *widget,
GdkDragContext *context,
gint x, gint y,
GtkSelectionData *selection_data,
guint info, guint time, EImageChooser *chooser);
static GtkObjectClass *parent_class = NULL;
#define PARENT_TYPE GTK_TYPE_VBOX
enum DndTargetType {
DND_TARGET_TYPE_URI_LIST
};
#define URI_LIST_TYPE "text/uri-list"
static GtkTargetEntry image_drag_types[] = {
{ URI_LIST_TYPE, 0, DND_TARGET_TYPE_URI_LIST },
};
static const int num_image_drag_types = sizeof (image_drag_types) / sizeof (image_drag_types[0]);
GtkWidget *
e_image_chooser_new (void)
{
return g_object_new (E_TYPE_IMAGE_CHOOSER, NULL);
}
GType
e_image_chooser_get_type (void)
{
static GType eic_type = 0;
if (!eic_type) {
static const GTypeInfo eic_info = {
sizeof (EImageChooserClass),
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) e_image_chooser_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (EImageChooser),
0, /* n_preallocs */
(GInstanceInitFunc) e_image_chooser_init,
};
eic_type = g_type_register_static (PARENT_TYPE, "EImageChooser", &eic_info, 0);
}
return eic_type;
}
static void
e_image_chooser_class_init (EImageChooserClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_ref (PARENT_TYPE);
image_chooser_signals [CHANGED] =
g_signal_new ("changed",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (EImageChooserClass, changed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
GTK_TYPE_NONE, 0);
object_class->dispose = e_image_chooser_dispose;
}
static void
e_image_chooser_init (EImageChooser *chooser)
{
EImageChooserPrivate *priv;
priv = chooser->priv = g_new0 (EImageChooserPrivate, 1);
priv->image = gtk_image_new ();
gtk_box_set_homogeneous (GTK_BOX (chooser), FALSE);
gtk_box_pack_start (GTK_BOX (chooser), priv->image, TRUE, TRUE, 0);
gtk_drag_dest_set (priv->image, 0, image_drag_types, num_image_drag_types, GDK_ACTION_COPY);
g_signal_connect (priv->image,
"drag_motion", G_CALLBACK (image_drag_motion_cb), chooser);
g_signal_connect (priv->image,
"drag_drop", G_CALLBACK (image_drag_drop_cb), chooser);
g_signal_connect (priv->image,
"drag_data_received", G_CALLBACK (image_drag_data_received_cb), chooser);
gtk_widget_show_all (priv->image);
/* we default to being editable */
priv->editable = TRUE;
}
static void
e_image_chooser_dispose (GObject *object)
{
EImageChooser *eic = E_IMAGE_CHOOSER (object);
if (eic->priv) {
EImageChooserPrivate *priv = eic->priv;
if (priv->image_buf) {
g_free (priv->image_buf);
priv->image_buf = NULL;
}
g_free (eic->priv);
eic->priv = NULL;
}
if (G_OBJECT_CLASS (parent_class)->dispose)
(* G_OBJECT_CLASS (parent_class)->dispose) (object);
}
static gboolean
set_image_from_data (EImageChooser *chooser,
char *data, int length)
{
gboolean rv = FALSE;
GdkPixbufLoader *loader = gdk_pixbuf_loader_new ();
GdkPixbuf *pixbuf;
gdk_pixbuf_loader_write (loader, data, length, NULL);
gdk_pixbuf_loader_close (loader, NULL);
pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
if (pixbuf)
g_object_ref (pixbuf);
g_object_unref (loader);
if (pixbuf) {
GdkPixbuf *scaled;
GtkRequisition chooser_size;
float scale;
int new_height, new_width;
gtk_widget_size_request (gtk_widget_get_parent (GTK_WIDGET (chooser)),
&chooser_size);
chooser_size.width -= 5;
chooser_size.height -= 5;
new_height = gdk_pixbuf_get_height (pixbuf);
new_width = gdk_pixbuf_get_width (pixbuf);
if (chooser->priv->image_height == 0
&& chooser->priv->image_width == 0) {
scale = 1.0;
}
else if (chooser->priv->image_height < new_height
|| chooser->priv->image_width < new_width) {
/* we need to scale down */
if (new_height > new_width)
scale = (float)chooser_size.height / new_height;
else
scale = (float)chooser_size.width / new_width;
}
else {
/* we need to scale up */
if (new_height > new_width)
scale = (float)new_height / chooser_size.height;
else
scale = (float)new_width / chooser_size.width;
}
if (scale == 1.0) {
gtk_image_set_from_pixbuf (GTK_IMAGE (chooser->priv->image), pixbuf);
chooser->priv->image_width = new_width;
chooser->priv->image_height = new_height;
}
else {
new_width *= scale;
new_height *= scale;
new_width = MIN (new_width, chooser_size.width);
new_height = MIN (new_height, chooser_size.height);
scaled = gdk_pixbuf_scale_simple (pixbuf,
new_width, new_height,
GDK_INTERP_BILINEAR);
gtk_image_set_from_pixbuf (GTK_IMAGE (chooser->priv->image), scaled);
g_object_unref (scaled);
}
g_object_unref (pixbuf);
g_free (chooser->priv->image_buf);
chooser->priv->image_buf = data;
chooser->priv->image_buf_size = length;
g_signal_emit (chooser,
image_chooser_signals [CHANGED], 0);
rv = TRUE;
}
return rv;
}
static gboolean
image_drag_motion_cb (GtkWidget *widget,
GdkDragContext *context,
gint x, gint y, guint time, EImageChooser *chooser)
{
GList *p;
if (!chooser->priv->editable)
return FALSE;
for (p = context->targets; p != NULL; p = p->next) {
char *possible_type;
possible_type = gdk_atom_name (GDK_POINTER_TO_ATOM (p->data));
if (!strcmp (possible_type, URI_LIST_TYPE)) {
g_free (possible_type);
gdk_drag_status (context, GDK_ACTION_COPY, time);
return TRUE;
}
g_free (possible_type);
}
return FALSE;
}
static gboolean
image_drag_drop_cb (GtkWidget *widget,
GdkDragContext *context,
gint x, gint y, guint time, EImageChooser *chooser)
{
GList *p;
if (!chooser->priv->editable)
return FALSE;
if (context->targets == NULL) {
return FALSE;
}
for (p = context->targets; p != NULL; p = p->next) {
char *possible_type;
possible_type = gdk_atom_name (GDK_POINTER_TO_ATOM (p->data));
if (!strcmp (possible_type, URI_LIST_TYPE)) {
g_free (possible_type);
gtk_drag_get_data (widget, context,
GDK_POINTER_TO_ATOM (p->data),
time);
return TRUE;
}
g_free (possible_type);
}
return FALSE;
}
static void
image_drag_data_received_cb (GtkWidget *widget,
GdkDragContext *context,
gint x, gint y,
GtkSelectionData *selection_data,
guint info, guint time, EImageChooser *chooser)
{
char *target_type;
gboolean handled = FALSE;
target_type = gdk_atom_name (selection_data->target);
if (!strcmp (target_type, URI_LIST_TYPE)) {
char *uri;
GFile *file;
GInputStream *istream;
char *nl = strstr (selection_data->data, "\r\n");
if (nl)
uri = g_strndup (selection_data->data, nl - (char *) selection_data->data);
else
uri = g_strdup (selection_data->data);
file = g_file_new_for_uri (uri);
istream = G_INPUT_STREAM (g_file_read (file, NULL, NULL));
if (istream != NULL) {
GFileInfo *info;
info = g_file_query_info (file,
G_FILE_ATTRIBUTE_STANDARD_SIZE,
G_FILE_QUERY_INFO_NONE,
NULL, NULL);
if (info != NULL) {
gsize size;
gboolean success;
gchar *buf;
size = g_file_info_get_size (info);
g_object_unref (info);
buf = g_malloc (size);
success = g_input_stream_read_all (istream,
buf,
size,
&size,
NULL,
NULL);
g_input_stream_close (istream, NULL, NULL);
if (success &&
set_image_from_data (chooser, buf, size))
handled = TRUE;
else
g_free (buf);
}
g_object_unref (istream);
}
g_object_unref (file);
g_free (uri);
}
gtk_drag_finish (context, handled, FALSE, time);
}
gboolean
e_image_chooser_set_from_file (EImageChooser *chooser, const char *filename)
{
gchar *data;
gsize data_length;
g_return_val_if_fail (E_IS_IMAGE_CHOOSER (chooser), FALSE);
g_return_val_if_fail (filename, FALSE);
if (!g_file_get_contents (filename, &data, &data_length, NULL)) {
return FALSE;
}
if (!set_image_from_data (chooser, data, data_length))
g_free (data);
return TRUE;
}
void
e_image_chooser_set_editable (EImageChooser *chooser, gboolean editable)
{
g_return_if_fail (E_IS_IMAGE_CHOOSER (chooser));
chooser->priv->editable = editable;
gtk_widget_set_sensitive (chooser->priv->browse_button, editable);
}
gboolean
e_image_chooser_get_image_data (EImageChooser *chooser, char **data, gsize *data_length)
{
g_return_val_if_fail (E_IS_IMAGE_CHOOSER (chooser), FALSE);
g_return_val_if_fail (data != NULL, FALSE);
g_return_val_if_fail (data_length != NULL, FALSE);
*data_length = chooser->priv->image_buf_size;
*data = g_malloc (*data_length);
memcpy (*data, chooser->priv->image_buf, *data_length);
return TRUE;
}
gboolean
e_image_chooser_set_image_data (EImageChooser *chooser, char *data, gsize data_length)
{
char *buf;
g_return_val_if_fail (E_IS_IMAGE_CHOOSER (chooser), FALSE);
g_return_val_if_fail (data != NULL, FALSE);
/* yuck, a copy... */
buf = g_malloc (data_length);
memcpy (buf, data, data_length);
if (!set_image_from_data (chooser, buf, data_length)) {
g_free (buf);
return FALSE;
}
return TRUE;
}

View File

@@ -0,0 +1,64 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* e-image-chooser.c
* Copyright (C) 2004 Novell, Inc.
* Author: Chris Toshok <toshok@ximian.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
*
* 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 library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef _E_IMAGE_CHOOSER_H_
#define _E_IMAGE_CHOOSER_H_
#include <gtk/gtkvbox.h>
G_BEGIN_DECLS
#define E_TYPE_IMAGE_CHOOSER (e_image_chooser_get_type ())
#define E_IMAGE_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_IMAGE_CHOOSER, EImageChooser))
#define E_IMAGE_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_IMAGE_CHOOSER, EImageChooserClass))
#define E_IS_IMAGE_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_IMAGE_CHOOSER))
#define E_IS_IMAGE_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_IMAGE_CHOOSER))
typedef struct _EImageChooser EImageChooser;
typedef struct _EImageChooserClass EImageChooserClass;
typedef struct _EImageChooserPrivate EImageChooserPrivate;
struct _EImageChooser
{
GtkVBox parent;
EImageChooserPrivate *priv;
};
struct _EImageChooserClass
{
GtkVBoxClass parent_class;
/* signals */
void (*changed) (EImageChooser *chooser);
};
GtkWidget *e_image_chooser_new (void);
GType e_image_chooser_get_type (void);
gboolean e_image_chooser_set_from_file (EImageChooser *chooser, const char *filename);
gboolean e_image_chooser_set_image_data (EImageChooser *chooser, char *data, gsize data_length);
void e_image_chooser_set_editable (EImageChooser *chooser, gboolean editable);
gboolean e_image_chooser_get_image_data (EImageChooser *chooser, char **data, gsize *data_length);
#endif /* _E_IMAGE_CHOOSER_H_ */

View File

@@ -0,0 +1,3 @@
NONE:NONE
NONE:INT
NONE:POINTER

View File

@@ -0,0 +1,470 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* eel-alert-dialog.c: An HIG compliant alert dialog.
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,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "eel-alert-dialog.h"
#include "eel-gtk-macros.h"
#include <glib/gi18n.h>
#include <gtk/gtklabel.h>
#include <gtk/gtkhbox.h>
#include <gtk/gtkvbox.h>
#include <gtk/gtkimage.h>
#include <gtk/gtkstock.h>
#include <gtk/gtkiconfactory.h>
#include <gtk/gtkexpander.h>
#include <string.h>
enum {
PROP_0,
PROP_ALERT_TYPE,
PROP_BUTTONS
};
struct _EelAlertDialogDetails {
GtkWidget *image;
GtkWidget *primary_label;
GtkWidget *secondary_label;
GtkWidget *details_expander;
GtkWidget *details_label;
GtkMessageType type;
};
static gpointer parent_class;
static void eel_alert_dialog_finalize (GObject *object);
static void eel_alert_dialog_class_init (EelAlertDialogClass *klass);
static void eel_alert_dialog_init (EelAlertDialog *dialog);
static void eel_alert_dialog_style_set (GtkWidget *widget,
GtkStyle *prev_style);
static void eel_alert_dialog_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
static void eel_alert_dialog_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
static void eel_alert_dialog_add_buttons (EelAlertDialog *alert_dialog,
GtkButtonsType buttons);
GType
eel_alert_dialog_get_type (void)
{
static GType dialog_type = 0;
if (!dialog_type) {
static const GTypeInfo dialog_info =
{
sizeof (EelAlertDialogClass),
NULL,
NULL,
(GClassInitFunc) eel_alert_dialog_class_init,
NULL,
NULL,
sizeof (EelAlertDialog),
0,
(GInstanceInitFunc) eel_alert_dialog_init,
};
dialog_type = g_type_register_static (GTK_TYPE_DIALOG, "EelAlertDialog",
&dialog_info, 0);
}
return dialog_type;
}
static void
eel_alert_dialog_class_init (EelAlertDialogClass *class)
{
GtkWidgetClass *widget_class;
GObjectClass *gobject_class;
widget_class = GTK_WIDGET_CLASS (class);
gobject_class = G_OBJECT_CLASS (class);
parent_class = g_type_class_peek_parent (class);
G_OBJECT_CLASS (class)->finalize = eel_alert_dialog_finalize;
widget_class->style_set = eel_alert_dialog_style_set;
gobject_class->set_property = eel_alert_dialog_set_property;
gobject_class->get_property = eel_alert_dialog_get_property;
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("alert_border",
_("Image/label border"),
_("Width of border around the label and image in the alert dialog"),
0,
G_MAXINT,
5,
G_PARAM_READABLE));
g_object_class_install_property (gobject_class,
PROP_ALERT_TYPE,
g_param_spec_enum ("alert_type",
_("Alert Type"),
_("The type of alert"),
GTK_TYPE_MESSAGE_TYPE,
GTK_MESSAGE_INFO,
G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
g_object_class_install_property (gobject_class,
PROP_BUTTONS,
g_param_spec_enum ("buttons",
_("Alert Buttons"),
_("The buttons shown in the alert dialog"),
GTK_TYPE_BUTTONS_TYPE,
GTK_BUTTONS_NONE,
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}
static void
eel_alert_dialog_finalize (GObject *object)
{
EelAlertDialog *dialog;
dialog = EEL_ALERT_DIALOG (object);
g_free (dialog->details);
EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
}
static void
eel_alert_dialog_init (EelAlertDialog *dialog)
{
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *expander;
dialog->details = g_new0 (EelAlertDialogDetails, 1);
dialog->details->primary_label = gtk_label_new (NULL);
dialog->details->secondary_label = gtk_label_new (NULL);
dialog->details->details_label = gtk_label_new (NULL);
dialog->details->image = gtk_image_new_from_stock (NULL, GTK_ICON_SIZE_DIALOG);
gtk_misc_set_alignment (GTK_MISC (dialog->details->image), 0.5, 0.0);
gtk_label_set_line_wrap (GTK_LABEL (dialog->details->primary_label), TRUE);
gtk_label_set_selectable (GTK_LABEL (dialog->details->primary_label), TRUE);
gtk_label_set_use_markup (GTK_LABEL (dialog->details->primary_label), TRUE);
gtk_misc_set_alignment (GTK_MISC (dialog->details->primary_label), 0.0, 0.5);
gtk_label_set_line_wrap (GTK_LABEL (dialog->details->secondary_label), TRUE);
gtk_label_set_selectable (GTK_LABEL (dialog->details->secondary_label), TRUE);
gtk_misc_set_alignment (GTK_MISC (dialog->details->secondary_label), 0.0, 0.5);
gtk_label_set_line_wrap (GTK_LABEL (dialog->details->details_label), TRUE);
gtk_label_set_selectable (GTK_LABEL (dialog->details->details_label), TRUE);
gtk_misc_set_alignment (GTK_MISC (dialog->details->details_label), 0.0, 0.5);
hbox = gtk_hbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
gtk_box_pack_start (GTK_BOX (hbox), dialog->details->image,
FALSE, FALSE, 0);
vbox = gtk_vbox_new (FALSE, 12);
gtk_box_pack_start (GTK_BOX (hbox), vbox,
FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), dialog->details->primary_label,
FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), dialog->details->secondary_label,
FALSE, FALSE, 0);
expander = gtk_expander_new_with_mnemonic (_("Show more _details"));
dialog->details->details_expander = expander;
gtk_expander_set_spacing (GTK_EXPANDER (expander), 6);
gtk_container_add (GTK_CONTAINER (expander), dialog->details->details_label);
gtk_box_pack_start (GTK_BOX (vbox), expander,
FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox,
FALSE, FALSE, 0);
gtk_widget_show_all (hbox);
gtk_widget_hide (expander);
}
static void
setup_type (EelAlertDialog *dialog,
GtkMessageType type)
{
const gchar *stock_id = NULL;
GtkStockItem item;
switch (type) {
case GTK_MESSAGE_INFO:
stock_id = GTK_STOCK_DIALOG_INFO;
break;
case GTK_MESSAGE_QUESTION:
stock_id = GTK_STOCK_DIALOG_QUESTION;
break;
case GTK_MESSAGE_WARNING:
stock_id = GTK_STOCK_DIALOG_WARNING;
break;
case GTK_MESSAGE_ERROR:
stock_id = GTK_STOCK_DIALOG_ERROR;
break;
default:
g_warning ("Unknown GtkMessageType %d", type);
break;
}
if (stock_id == NULL) {
stock_id = GTK_STOCK_DIALOG_INFO;
}
if (gtk_stock_lookup (stock_id, &item)) {
gtk_image_set_from_stock (GTK_IMAGE (dialog->details->image), stock_id,
GTK_ICON_SIZE_DIALOG);
} else {
g_warning ("Stock dialog ID doesn't exist?");
}
}
static void
eel_alert_dialog_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
EelAlertDialog *dialog;
dialog = EEL_ALERT_DIALOG (object);
switch (prop_id) {
case PROP_ALERT_TYPE:
dialog->details->type = g_value_get_enum (value);
setup_type (dialog, dialog->details->type);
break;
case PROP_BUTTONS:
eel_alert_dialog_add_buttons (dialog, g_value_get_enum (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
eel_alert_dialog_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
EelAlertDialog *dialog;
dialog = EEL_ALERT_DIALOG (object);
switch (prop_id) {
case PROP_ALERT_TYPE:
g_value_set_enum (value, dialog->details->type);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
void
eel_alert_dialog_set_primary_label (EelAlertDialog *dialog,
const gchar *message)
{
gchar *markup_str;
char *escaped_message;
if (message != NULL) {
escaped_message = g_markup_escape_text (message, -1);
markup_str = g_strconcat ("<span weight=\"bold\" size=\"larger\">", escaped_message, "</span>", NULL);
gtk_label_set_markup (GTK_LABEL (EEL_ALERT_DIALOG (dialog)->details->primary_label),
markup_str);
g_free (markup_str);
g_free (escaped_message);
}
}
void
eel_alert_dialog_set_secondary_label (EelAlertDialog *dialog,
const gchar *message)
{
if (message != NULL) {
gtk_label_set_text (GTK_LABEL (EEL_ALERT_DIALOG (dialog)->details->secondary_label),
message);
} else {
gtk_widget_hide (EEL_ALERT_DIALOG (dialog)->details->secondary_label);
}
}
void
eel_alert_dialog_set_details_label (EelAlertDialog *dialog,
const gchar *message)
{
if (message != NULL) {
gtk_widget_show (dialog->details->details_expander);
gtk_label_set_text (GTK_LABEL (dialog->details->details_label), message);
} else {
gtk_widget_hide (dialog->details->details_expander);
}
}
GtkWidget*
eel_alert_dialog_new (GtkWindow *parent,
GtkDialogFlags flags,
GtkMessageType type,
GtkButtonsType buttons,
const gchar *primary_message,
const gchar *secondary_message,
const gchar *title)
{
GtkWidget *widget;
GtkDialog *dialog;
g_return_val_if_fail (parent == NULL || GTK_IS_WINDOW (parent), NULL);
widget = g_object_new (EEL_TYPE_ALERT_DIALOG,
"alert_type", type,
"buttons", buttons,
NULL);
atk_object_set_role (gtk_widget_get_accessible (widget), ATK_ROLE_ALERT);
dialog = GTK_DIALOG (widget);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 14);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_dialog_set_has_separator (dialog, FALSE);
gtk_window_set_title (GTK_WINDOW (dialog),
(title != NULL) ? title : "");
eel_alert_dialog_set_primary_label (EEL_ALERT_DIALOG (dialog),
primary_message);
eel_alert_dialog_set_secondary_label (EEL_ALERT_DIALOG (dialog),
secondary_message);
if (parent != NULL) {
gtk_window_set_transient_for (GTK_WINDOW (widget),
GTK_WINDOW (parent));
}
if (flags & GTK_DIALOG_MODAL) {
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
}
if (flags & GTK_DIALOG_DESTROY_WITH_PARENT) {
gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
}
return widget;
}
static void
eel_alert_dialog_add_buttons (EelAlertDialog* alert_dialog,
GtkButtonsType buttons)
{
GtkDialog* dialog;
dialog = GTK_DIALOG (alert_dialog);
switch (buttons) {
case GTK_BUTTONS_NONE:
break;
case GTK_BUTTONS_OK:
gtk_dialog_add_button (dialog,
GTK_STOCK_OK,
GTK_RESPONSE_OK);
gtk_dialog_set_default_response (dialog,
GTK_RESPONSE_OK);
break;
case GTK_BUTTONS_CLOSE:
gtk_dialog_add_button (dialog,
GTK_STOCK_CLOSE,
GTK_RESPONSE_CLOSE);
gtk_dialog_set_default_response (dialog,
GTK_RESPONSE_CLOSE);
break;
case GTK_BUTTONS_CANCEL:
gtk_dialog_add_button (dialog,
GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL);
gtk_dialog_set_default_response (dialog,
GTK_RESPONSE_CANCEL);
break;
case GTK_BUTTONS_YES_NO:
gtk_dialog_add_button (dialog,
GTK_STOCK_NO,
GTK_RESPONSE_NO);
gtk_dialog_add_button (dialog,
GTK_STOCK_YES,
GTK_RESPONSE_YES);
gtk_dialog_set_default_response (dialog,
GTK_RESPONSE_YES);
break;
case GTK_BUTTONS_OK_CANCEL:
gtk_dialog_add_button (dialog,
GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL);
gtk_dialog_add_button (dialog,
GTK_STOCK_OK,
GTK_RESPONSE_OK);
gtk_dialog_set_default_response (dialog,
GTK_RESPONSE_OK);
break;
default:
g_warning ("Unknown GtkButtonsType");
break;
}
g_object_notify (G_OBJECT (alert_dialog), "buttons");
}
static void
eel_alert_dialog_style_set (GtkWidget *widget,
GtkStyle *prev_style)
{
GtkWidget *parent;
gint border_width;
border_width = 0;
parent = GTK_WIDGET (EEL_ALERT_DIALOG (widget)->details->image->parent);
if (parent != NULL) {
gtk_widget_style_get (widget, "alert_border",
&border_width, NULL);
gtk_container_set_border_width (GTK_CONTAINER (parent),
border_width);
}
if (GTK_WIDGET_CLASS (parent_class)->style_set) {
(GTK_WIDGET_CLASS (parent_class)->style_set) (widget, prev_style);
}
}

View File

@@ -0,0 +1,61 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* eel-alert-dialog.h: An HIG compliant alert dialog.
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,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef EEL_ALERT_DIALOG_H
#define EEL_ALERT_DIALOG_H
#include <gtk/gtkmessagedialog.h>
#define EEL_TYPE_ALERT_DIALOG (eel_alert_dialog_get_type ())
#define EEL_ALERT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EEL_TYPE_ALERT_DIALOG, EelAlertDialog))
typedef struct _EelAlertDialog EelAlertDialog;
typedef struct _EelAlertDialogClass EelAlertDialogClass;
typedef struct _EelAlertDialogDetails EelAlertDialogDetails;
struct _EelAlertDialog
{
GtkDialog parent_instance;
EelAlertDialogDetails *details;
};
struct _EelAlertDialogClass
{
GtkDialogClass parent_class;
};
GType eel_alert_dialog_get_type (void);
GtkWidget* eel_alert_dialog_new (GtkWindow *parent,
GtkDialogFlags flags,
GtkMessageType type,
GtkButtonsType buttons,
const gchar *primary_message,
const gchar *secondary_message,
const gchar *title);
void eel_alert_dialog_set_primary_label (EelAlertDialog *dialog,
const gchar *message);
void eel_alert_dialog_set_secondary_label (EelAlertDialog *dialog,
const gchar *message);
void eel_alert_dialog_set_details_label (EelAlertDialog *dialog,
const gchar *message);
#endif /* EEL_ALERT_DIALOG_H */

View File

@@ -0,0 +1,178 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
eel-gtk-macros.h: Macros to reduce boilerplate when using GTK.
Copyright (C) 1999, 2000, 2001 Eazel, Inc.
This program 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 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Darin Adler <darin@bentspoon.com>
Ramiro Estrugo <ramiro@eazel.com>
*/
#ifndef EEL_GTK_MACROS_H
#define EEL_GTK_MACROS_H
#ifndef EEL_DISABLE_DEPRECATED
/* Define a parent_class global and a get_type function for a GTK class.
Since this is boilerplate, it's better not to repeat it over and over again.
Called like this:
EEL_CLASS_BOILERPLATE (EelBookmark, eel_bookmark, GTK_TYPE_OBJECT)
The parent_class_type parameter is guaranteed to be evaluated only once
so it can be an expression, even an expression that contains a function call.
*/
#define EEL_CLASS_BOILERPLATE(class_name, prefix, parent_class_type) \
EEL_BOILERPLATE (class_name, class_name, prefix, parent_class_type, \
EEL_REGISTER_TYPE)
#define EEL_REGISTER_TYPE(class_name, corba_name) \
g_type_register_static (parent_type, #class_name, &info, 0)
#define EEL_BOILERPLATE(class_name, corba_name, prefix, parent_class_type, \
register_type) \
\
static gpointer parent_class; \
\
GType \
prefix##_get_type (void) \
{ \
GType parent_type; \
static GType type; \
\
if (type == 0) { \
static GTypeInfo info = { \
sizeof (class_name##Class), \
NULL, NULL, \
(GClassInitFunc) prefix##_class_init, \
NULL, NULL, \
sizeof (class_name), 0, \
(GInstanceInitFunc) prefix##_init, \
NULL \
}; \
\
parent_type = (parent_class_type); \
type = register_type (class_name, corba_name); \
parent_class = g_type_class_ref (parent_type); \
} \
\
return type; \
}
/* Call a parent class version of a virtual function (or default
* signal handler since that's the same thing). Nice because it
* documents what it's doing and there is less chance for a
* typo. Depends on the parent class pointer having the conventional
* name "parent_class" as the boilerplate macro above does it.
*/
#define EEL_CALL_PARENT(parent_class_cast_macro, signal, parameters) \
\
G_STMT_START { \
if (parent_class_cast_macro (parent_class)->signal != NULL) { \
(* parent_class_cast_macro (parent_class)->signal) parameters;\
} \
} G_STMT_END
/* Same thing, for functions with a return value. */
#define EEL_CALL_PARENT_WITH_RETURN_VALUE(parent_class_cast_macro, signal, \
parameters) \
\
(parent_class_cast_macro (parent_class)->signal == NULL) \
? 0 \
: ((* parent_class_cast_macro (parent_class)->signal) parameters)
#endif /* EEL_DISABLE_DEPRECATED */
/* Call a virtual function. Useful when the virtual function is not a
* signal, otherwise you want to gtk_signal emit. Nice because it
* documents what it's doing and there is less chance for a typo.
*/
#define EEL_CALL_METHOD(class_cast_macro, object, signal, parameters) \
\
G_STMT_START { \
if (class_cast_macro (G_OBJECT_GET_CLASS (object))->signal != NULL) { \
(* class_cast_macro (G_OBJECT_GET_CLASS (object))->signal) \
parameters; \
} \
} G_STMT_END
/* Same thing, for functions with a return value. */
#define EEL_CALL_METHOD_WITH_RETURN_VALUE(class_cast_macro, object, signal, \
parameters) \
\
(class_cast_macro (G_OBJECT_GET_CLASS (object))->signal == NULL) \
? 0 \
: ((* class_cast_macro (G_OBJECT_GET_CLASS (object))->signal) \
parameters) \
#ifndef G_DISABLE_ASSERT
/* Define a signal that is not implemented by this class but must be
* implemented by subclasses. This macro should be used inside the
* class initialization function. The companion macro EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL
* must be used earlier in the file. Called like this:
*
* EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass,
* fm_directory_view,
* clear);
*/
#define EEL_ASSIGN_MUST_OVERRIDE_SIGNAL(class_pointer, prefix, signal) \
\
* (void (**)(void)) & (class_pointer)->signal = prefix##_unimplemented_##signal
/* Provide a debug-only implementation of a signal that must be implemented
* by subclasses. The debug-only implementation fires a warning if it is called.
* This macro should be placed as if it were a function, earlier in the file
* than the class initialization function. Called like this:
*
* EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, clear);
*/
#define EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL(prefix, signal) \
\
static void \
prefix##_unimplemented_##signal (void) \
{ \
g_warning ("failed to override signal " #prefix "->" #signal); \
}
#else /* G_DISABLE_ASSERT */
#define EEL_DEFINE_MUST_OVERRIDE_SIGNAL(class_cast_macro, class_pointer, prefix, signal)
#define EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL(prefix, signal)
#define EEL_ASSIGN_MUST_OVERRIDE_SIGNAL(class_pointer, prefix, signal)
#endif /* G_DISABLE_ASSERT */
/* Access a method. */
#define EEL_ACCESS_METHOD(class_cast_macro, object, method) \
(class_cast_macro (G_OBJECT_GET_CLASS (object))->method)
/* Invoke a method for a given object. */
#define EEL_INVOKE_METHOD(class_cast_macro, object, method, parameters) \
((* EEL_ACCESS_METHOD (class_cast_macro, object, method)) parameters)
/* Assert the non-nullness of a method for a given object. */
#define EEL_ASSERT_METHOD(class_cast_macro, object, method) \
g_assert (EEL_ACCESS_METHOD (class_cast_macro, object, method) != NULL)
/* Invoke a method if it ain't null. */
#define EEL_INVOKE_METHOD_IF(class_cast_macro, object, method, parameters) \
(EEL_ACCESS_METHOD (class_cast_macro, object, method) ? 0 : \
EEL_INVOKE_METHOD (class_cast_macro, object, method, parameters))
#endif /* EEL_GTK_MACROS_H */

View File

@@ -0,0 +1,111 @@
/*
* Helper functions to translate statuses and actions to strings
* Copyright (C) 2008 Bastien Nocera <hadess@hadess.net>
*
* Experimental code. This will be moved out of fprintd into it's own
* package once the system has matured.
*
* 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.
*/
struct {
const char *dbus_name;
const char *place_str;
const char *swipe_str;
} fingers[11] = {
{ "left-thumb", N_("Place your left thumb on %s"), N_("Swipe your left thumb on %s") },
{ "left-index-finger", N_("Place your left index finger on %s"), N_("Swipe your left index finger on %s") },
{ "left-middle-finger", N_("Place your left middle finger on %s"), N_("Swipe your left middle finger on %s") },
{ "left-ring-finger", N_("Place your left ring finger on %s"), N_("Swipe your left ring finger on %s") },
{ "left-little-finger", N_("Place your left little finger on %s"), N_("Swipe your left little finger on %s") },
{ "right-thumb", N_("Place your right thumb on %s"), N_("Swipe your right thumb on %s") },
{ "right-index-finger", N_("Place your right index finger on %s"), N_("Swipe your right index finger on %s") },
{ "right-middle-finger", N_("Place your right middle finger on %s"), N_("Swipe your right middle finger on %s") },
{ "right-ring-finger", N_("Place your right ring finger on %s"), N_("Swipe your right ring finger on %s") },
{ "right-little-finger", N_("Place your right little finger on %s"), N_("Swipe your right little finger on %s") },
{ NULL, NULL, NULL }
};
static const char *finger_str_to_msg(const char *finger_name, gboolean is_swipe)
{
int i;
if (finger_name == NULL)
return NULL;
for (i = 0; fingers[i].dbus_name != NULL; i++) {
if (g_str_equal (fingers[i].dbus_name, finger_name)) {
if (is_swipe == FALSE)
return fingers[i].place_str;
else
return fingers[i].swipe_str;
}
}
return NULL;
}
/* Cases not handled:
* verify-no-match
* verify-match
* verify-unknown-error
*/
static const char *verify_result_str_to_msg(const char *result, gboolean is_swipe)
{
if (result == NULL)
return NULL;
if (strcmp (result, "verify-retry-scan") == 0) {
if (is_swipe == FALSE)
return N_("Place your finger on the reader again");
else
return N_("Swipe your finger again");
}
if (strcmp (result, "verify-swipe-too-short") == 0)
return N_("Swipe was too short, try again");
if (strcmp (result, "verify-finger-not-centered") == 0)
return N_("Your finger was not centered, try swiping your finger again");
if (strcmp (result, "verify-remove-and-retry") == 0)
return N_("Remove your finger, and try swiping your finger again");
return NULL;
}
/* Cases not handled:
* enroll-completed
* enroll-failed
* enroll-unknown-error
*/
static const char *enroll_result_str_to_msg(const char *result, gboolean is_swipe)
{
if (result == NULL)
return NULL;
if (strcmp (result, "enroll-retry-scan") == 0 || strcmp (result, "enroll-stage-passed") == 0) {
if (is_swipe == FALSE)
return N_("Place your finger on the reader again");
else
return N_("Swipe your finger again");
}
if (strcmp (result, "enroll-swipe-too-short") == 0)
return N_("Swipe was too short, try again");
if (strcmp (result, "enroll-finger-not-centered") == 0)
return N_("Your finger was not centered, try swiping your finger again");
if (strcmp (result, "enroll-remove-and-retry") == 0)
return N_("Remove your finger, and try swiping your finger again");
return NULL;
}

View File

@@ -0,0 +1 @@
VOID:STRING,BOOLEAN

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,604 @@
/* gnome-about-me-fingerprint.h
* Copyright (C) 2008 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, 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., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <dbus/dbus-glib-bindings.h>
#include "fingerprint-strings.h"
#include "capplet-util.h"
/* This must match the number of images on the 2nd page in the UI file */
#define MAX_ENROLL_STAGES 3
static DBusGProxy *manager = NULL;
static DBusGConnection *connection = NULL;
static gboolean is_disable = FALSE;
enum {
STATE_NONE,
STATE_CLAIMED,
STATE_ENROLLING
};
typedef struct {
GtkWidget *enable;
GtkWidget *disable;
GtkWidget *ass;
GtkBuilder *dialog;
DBusGProxy *device;
gboolean is_swipe;
int num_enroll_stages;
int num_stages_done;
char *name;
const char *finger;
gint state;
} EnrollData;
static void create_manager (void)
{
GError *error = NULL;
connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
if (connection == NULL) {
g_warning ("Failed to connect to session bus: %s", error->message);
return;
}
manager = dbus_g_proxy_new_for_name (connection,
"net.reactivated.Fprint",
"/net/reactivated/Fprint/Manager",
"net.reactivated.Fprint.Manager");
}
static DBusGProxy *
get_first_device (void)
{
DBusGProxy *device;
char *device_str;
if (!dbus_g_proxy_call (manager, "GetDefaultDevice", NULL, G_TYPE_INVALID,
DBUS_TYPE_G_OBJECT_PATH, &device_str, G_TYPE_INVALID)) {
return NULL;
}
device = dbus_g_proxy_new_for_name(connection,
"net.reactivated.Fprint",
device_str,
"net.reactivated.Fprint.Device");
g_free (device_str);
return device;
}
static const char *
get_reason_for_error (const char *dbus_error)
{
if (g_str_equal (dbus_error, "net.reactivated.Fprint.Error.PermissionDenied"))
return N_("You are not allowed to access the device. Contact your system administrator.");
if (g_str_equal (dbus_error, "net.reactivated.Fprint.Error.AlreadyInUse"))
return N_("The device is already in use.");
if (g_str_equal (dbus_error, "net.reactivated.Fprint.Error.Internal"))
return N_("An internal error occured");
return NULL;
}
static GtkWidget *
get_error_dialog (const char *title,
const char *dbus_error,
GtkWindow *parent)
{
GtkWidget *error_dialog;
const char *reason;
if (dbus_error == NULL)
g_warning ("get_error_dialog called with reason == NULL");
error_dialog =
gtk_message_dialog_new (parent,
GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
"%s", title);
reason = get_reason_for_error (dbus_error);
gtk_message_dialog_format_secondary_text
(GTK_MESSAGE_DIALOG (error_dialog), "%s", reason ? _(reason) : _(dbus_error));
gtk_window_set_title (GTK_WINDOW (error_dialog), ""); /* as per HIG */
gtk_container_set_border_width (GTK_CONTAINER (error_dialog), 5);
gtk_dialog_set_default_response (GTK_DIALOG (error_dialog),
GTK_RESPONSE_OK);
gtk_window_set_modal (GTK_WINDOW (error_dialog), TRUE);
gtk_window_set_position (GTK_WINDOW (error_dialog), GTK_WIN_POS_CENTER_ON_PARENT);
return error_dialog;
}
void
set_fingerprint_label (GtkWidget *enable, GtkWidget *disable)
{
char **fingers;
DBusGProxy *device;
GError *error = NULL;
gtk_widget_set_no_show_all (enable, TRUE);
gtk_widget_set_no_show_all (disable, TRUE);
if (manager == NULL) {
create_manager ();
if (manager == NULL) {
gtk_widget_hide (enable);
gtk_widget_hide (disable);
return;
}
}
device = get_first_device ();
if (device == NULL) {
gtk_widget_hide (enable);
gtk_widget_hide (disable);
return;
}
if (!dbus_g_proxy_call (device, "ListEnrolledFingers", &error, G_TYPE_STRING, "", G_TYPE_INVALID,
G_TYPE_STRV, &fingers, G_TYPE_INVALID)) {
if (dbus_g_error_has_name (error, "net.reactivated.Fprint.Error.NoEnrolledPrints") == FALSE) {
gtk_widget_hide (enable);
gtk_widget_hide (disable);
g_object_unref (device);
return;
}
fingers = NULL;
}
if (fingers == NULL || g_strv_length (fingers) == 0) {
gtk_widget_hide (disable);
gtk_widget_show (enable);
is_disable = FALSE;
} else {
gtk_widget_hide (enable);
gtk_widget_show (disable);
is_disable = TRUE;
}
g_strfreev (fingers);
g_object_unref (device);
}
static void
delete_fingerprints (void)
{
DBusGProxy *device;
if (manager == NULL) {
create_manager ();
if (manager == NULL)
return;
}
device = get_first_device ();
if (device == NULL)
return;
dbus_g_proxy_call (device, "DeleteEnrolledFingers", NULL, G_TYPE_STRING, "", G_TYPE_INVALID, G_TYPE_INVALID);
g_object_unref (device);
}
static void
delete_fingerprints_question (GtkBuilder *dialog, GtkWidget *enable, GtkWidget *disable)
{
GtkWidget *question;
GtkWidget *button;
question = gtk_message_dialog_new (GTK_WINDOW (WID ("about-me-dialog")),
GTK_DIALOG_MODAL,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_NONE,
_("Delete registered fingerprints?"));
gtk_dialog_add_button (GTK_DIALOG (question), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
button = gtk_button_new_with_mnemonic (_("_Delete Fingerprints"));
gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_stock (GTK_STOCK_DELETE, GTK_ICON_SIZE_BUTTON));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_show (button);
gtk_dialog_add_action_widget (GTK_DIALOG (question), button, GTK_RESPONSE_OK);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (question),
_("Do you want to delete your registered fingerprints so fingerprint login is disabled?"));
gtk_container_set_border_width (GTK_CONTAINER (question), 5);
gtk_dialog_set_default_response (GTK_DIALOG (question), GTK_RESPONSE_OK);
gtk_window_set_position (GTK_WINDOW (question), GTK_WIN_POS_CENTER_ON_PARENT);
gtk_window_set_modal (GTK_WINDOW (question), TRUE);
if (gtk_dialog_run (GTK_DIALOG (question)) == GTK_RESPONSE_OK) {
delete_fingerprints ();
set_fingerprint_label (enable, disable);
}
gtk_widget_destroy (question);
}
static void
enroll_data_destroy (EnrollData *data)
{
switch (data->state) {
case STATE_ENROLLING:
dbus_g_proxy_call(data->device, "EnrollStop", NULL, G_TYPE_INVALID, G_TYPE_INVALID);
/* fall-through */
case STATE_CLAIMED:
dbus_g_proxy_call(data->device, "Release", NULL, G_TYPE_INVALID, G_TYPE_INVALID);
/* fall-through */
case STATE_NONE:
g_free (data->name);
g_object_unref (data->device);
g_object_unref (data->dialog);
gtk_widget_destroy (data->ass);
g_free (data);
}
}
static const char *
selected_finger (GtkBuilder *dialog)
{
int index;
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (WID ("radiobutton1")))) {
gtk_widget_set_sensitive (WID ("finger_combobox"), FALSE);
return "right-index-finger";
}
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (WID ("radiobutton2")))) {
gtk_widget_set_sensitive (WID ("finger_combobox"), FALSE);
return "left-index-finger";
}
gtk_widget_set_sensitive (WID ("finger_combobox"), TRUE);
index = gtk_combo_box_get_active (GTK_COMBO_BOX (WID ("finger_combobox")));
switch (index) {
case 0:
return "left-thumb";
case 1:
return "left-middle-finger";
case 2:
return "left-ring-finger";
case 3:
return "left-little-finger";
case 4:
return "right-thumb";
case 5:
return "right-middle-finger";
case 6:
return "right-ring-finger";
case 7:
return "right-little-finger";
default:
g_assert_not_reached ();
}
return NULL;
}
static void
finger_radio_button_toggled (GtkToggleButton *button, EnrollData *data)
{
data->finger = selected_finger (data->dialog);
}
static void
finger_combobox_changed (GtkComboBox *combobox, EnrollData *data)
{
data->finger = selected_finger (data->dialog);
}
static void
assistant_cancelled (GtkAssistant *ass, EnrollData *data)
{
GtkWidget *enable, *disable;
enable = data->enable;
disable = data->disable;
enroll_data_destroy (data);
set_fingerprint_label (enable, disable);
}
static void
enroll_result (GObject *object, const char *result, gboolean done, EnrollData *data)
{
GtkBuilder *dialog = data->dialog;
char *msg;
if (g_str_equal (result, "enroll-completed") || g_str_equal (result, "enroll-stage-passed")) {
char *name, *path;
data->num_stages_done++;
name = g_strdup_printf ("image%d", data->num_stages_done);
path = g_build_filename (GNOMECC_PIXMAP_DIR, "print_ok.png", NULL);
gtk_image_set_from_file (GTK_IMAGE (WID (name)), path);
g_free (name);
g_free (path);
}
if (g_str_equal (result, "enroll-completed")) {
gtk_label_set_text (GTK_LABEL (WID ("status-label")), _("Done!"));
gtk_assistant_set_page_complete (GTK_ASSISTANT (data->ass), WID ("page2"), TRUE);
}
if (done != FALSE) {
dbus_g_proxy_call(data->device, "EnrollStop", NULL, G_TYPE_INVALID, G_TYPE_INVALID);
data->state = STATE_CLAIMED;
if (g_str_equal (result, "enroll-completed") == FALSE) {
/* The enrollment failed, restart it */
dbus_g_proxy_call(data->device, "EnrollStart", NULL, G_TYPE_STRING, data->finger, G_TYPE_INVALID, G_TYPE_INVALID);
data->state = STATE_ENROLLING;
result = "enroll-retry-scan";
} else {
return;
}
}
msg = g_strdup_printf (enroll_result_str_to_msg (result, data->is_swipe), data->name);
gtk_label_set_text (GTK_LABEL (WID ("status-label")), msg);
g_free (msg);
}
static void
assistant_prepare (GtkAssistant *ass, GtkWidget *page, EnrollData *data)
{
const char *name;
name = g_object_get_data (G_OBJECT (page), "name");
if (name == NULL)
return;
if (g_str_equal (name, "enroll")) {
DBusGProxy *p;
GError *error = NULL;
GtkBuilder *dialog = data->dialog;
char *path;
guint i;
GValue value = { 0, };
if (!dbus_g_proxy_call (data->device, "Claim", &error, G_TYPE_STRING, "", G_TYPE_INVALID, G_TYPE_INVALID)) {
GtkWidget *d;
char *msg;
/* translators:
* The variable is the name of the device, for example:
* "Could you not access "Digital Persona U.are.U 4000/4000B" device */
msg = g_strdup_printf (_("Could not access '%s' device"), data->name);
d = get_error_dialog (msg, dbus_g_error_get_name (error), GTK_WINDOW (data->ass));
g_error_free (error);
gtk_dialog_run (GTK_DIALOG (d));
gtk_widget_destroy (d);
g_free (msg);
enroll_data_destroy (data);
return;
}
data->state = STATE_CLAIMED;
p = dbus_g_proxy_new_from_proxy (data->device, "org.freedesktop.DBus.Properties", NULL);
if (!dbus_g_proxy_call (p, "Get", NULL, G_TYPE_STRING, "net.reactivated.Fprint.Device", G_TYPE_STRING, "num-enroll-stages", G_TYPE_INVALID,
G_TYPE_VALUE, &value, G_TYPE_INVALID) || g_value_get_int (&value) < 1) {
GtkWidget *d;
char *msg;
/* translators:
* The variable is the name of the device, for example:
* "Could you not access "Digital Persona U.are.U 4000/4000B" device */
msg = g_strdup_printf (_("Could not access '%s' device"), data->name);
d = get_error_dialog (msg, "net.reactivated.Fprint.Error.Internal", GTK_WINDOW (data->ass));
gtk_dialog_run (GTK_DIALOG (d));
gtk_widget_destroy (d);
g_free (msg);
enroll_data_destroy (data);
g_object_unref (p);
return;
}
g_object_unref (p);
data->num_enroll_stages = g_value_get_int (&value);
/* Hide the extra "bulbs" if not needed */
for (i = MAX_ENROLL_STAGES; i > data->num_enroll_stages; i--) {
char *name;
name = g_strdup_printf ("image%d", i);
gtk_widget_hide (WID (name));
g_free (name);
}
/* And set the right image */
{
char *filename;
filename = g_strdup_printf ("%s.png", data->finger);
path = g_build_filename (GNOMECC_PIXMAP_DIR, filename, NULL);
g_free (filename);
}
for (i = 1; i <= data->num_enroll_stages; i++) {
char *name;
name = g_strdup_printf ("image%d", i);
gtk_image_set_from_file (GTK_IMAGE (WID (name)), path);
g_free (name);
}
g_free (path);
dbus_g_proxy_add_signal(data->device, "EnrollStatus", G_TYPE_STRING, G_TYPE_BOOLEAN, NULL);
dbus_g_proxy_connect_signal(data->device, "EnrollStatus", G_CALLBACK(enroll_result), data, NULL);
if (!dbus_g_proxy_call(data->device, "EnrollStart", &error, G_TYPE_STRING, data->finger, G_TYPE_INVALID, G_TYPE_INVALID)) {
GtkWidget *d;
char *msg;
/* translators:
* The variable is the name of the device, for example:
* "Could you not access "Digital Persona U.are.U 4000/4000B" device */
msg = g_strdup_printf (_("Could not start finger capture on '%s' device"), data->name);
d = get_error_dialog (msg, dbus_g_error_get_name (error), GTK_WINDOW (data->ass));
g_error_free (error);
gtk_dialog_run (GTK_DIALOG (d));
gtk_widget_destroy (d);
g_free (msg);
enroll_data_destroy (data);
return;
}
data->state = STATE_ENROLLING;;
} else {
if (data->state == STATE_ENROLLING) {
dbus_g_proxy_call(data->device, "EnrollStop", NULL, G_TYPE_INVALID, G_TYPE_INVALID);
data->state = STATE_CLAIMED;
}
if (data->state == STATE_CLAIMED) {
dbus_g_proxy_call(data->device, "Release", NULL, G_TYPE_INVALID, G_TYPE_INVALID);
data->state = STATE_NONE;
}
}
}
static void
enroll_fingerprints (GtkWindow *parent, GtkWidget *enable, GtkWidget *disable)
{
DBusGProxy *device, *p;
GHashTable *props;
GtkBuilder *dialog;
EnrollData *data;
GtkWidget *ass;
char *msg;
device = NULL;
if (manager == NULL) {
create_manager ();
if (manager != NULL)
device = get_first_device ();
} else {
device = get_first_device ();
}
if (manager == NULL || device == NULL) {
GtkWidget *d;
d = get_error_dialog (_("Could not access any fingerprint readers"),
_("Please contact your system administrator for help."),
parent);
gtk_dialog_run (GTK_DIALOG (d));
gtk_widget_destroy (d);
return;
}
data = g_new0 (EnrollData, 1);
data->device = device;
data->enable = enable;
data->disable = disable;
/* Get some details about the device */
p = dbus_g_proxy_new_from_proxy (device, "org.freedesktop.DBus.Properties", NULL);
if (dbus_g_proxy_call (p, "GetAll", NULL, G_TYPE_STRING, "net.reactivated.Fprint.Device", G_TYPE_INVALID,
dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), &props, G_TYPE_INVALID)) {
const char *scan_type;
data->name = g_value_dup_string (g_hash_table_lookup (props, "name"));
scan_type = g_value_dup_string (g_hash_table_lookup (props, "scan-type"));
if (g_str_equal (scan_type, "swipe"))
data->is_swipe = TRUE;
g_hash_table_destroy (props);
}
g_object_unref (p);
dialog = gtk_builder_new ();
gtk_builder_add_from_file (dialog, GNOMECC_UI_DIR "/gnome-about-me-fingerprint.ui", NULL);
data->dialog = dialog;
ass = WID ("assistant");
gtk_window_set_title (GTK_WINDOW (ass), _("Enable Fingerprint Login"));
gtk_window_set_transient_for (GTK_WINDOW (ass), parent);
gtk_window_set_position (GTK_WINDOW (ass), GTK_WIN_POS_CENTER_ON_PARENT);
g_signal_connect (G_OBJECT (ass), "cancel",
G_CALLBACK (assistant_cancelled), data);
g_signal_connect (G_OBJECT (ass), "close",
G_CALLBACK (assistant_cancelled), data);
g_signal_connect (G_OBJECT (ass), "prepare",
G_CALLBACK (assistant_prepare), data);
/* Page 1 */
gtk_combo_box_set_active (GTK_COMBO_BOX (WID ("finger_combobox")), 0);
g_signal_connect (G_OBJECT (WID ("radiobutton1")), "toggled",
G_CALLBACK (finger_radio_button_toggled), data);
g_signal_connect (G_OBJECT (WID ("radiobutton2")), "toggled",
G_CALLBACK (finger_radio_button_toggled), data);
g_signal_connect (G_OBJECT (WID ("radiobutton3")), "toggled",
G_CALLBACK (finger_radio_button_toggled), data);
g_signal_connect (G_OBJECT (WID ("finger_combobox")), "changed",
G_CALLBACK (finger_combobox_changed), data);
data->finger = selected_finger (dialog);
g_object_set_data (G_OBJECT (WID("page1")), "name", "intro");
/* translators:
* The variable is the name of the device, for example:
* "To enable fingerprint login, you need to save one of your fingerprints, using the
* 'Digital Persona U.are.U 4000/4000B' device." */
msg = g_strdup_printf (_("To enable fingerprint login, you need to save one of your fingerprints, using the '%s' device."),
data->name);
gtk_label_set_text (GTK_LABEL (WID("intro-label")), msg);
g_free (msg);
gtk_assistant_set_page_complete (GTK_ASSISTANT (ass), WID("page1"), TRUE);
/* Page 2 */
if (data->is_swipe != FALSE)
gtk_assistant_set_page_title (GTK_ASSISTANT (ass), WID("page2"), _("Swipe finger on reader"));
else
gtk_assistant_set_page_title (GTK_ASSISTANT (ass), WID("page2"), _("Place finger on reader"));
g_object_set_data (G_OBJECT (WID("page2")), "name", "enroll");
msg = g_strdup_printf (finger_str_to_msg (data->finger, data->is_swipe), data->name);
gtk_label_set_text (GTK_LABEL (WID("enroll-label")), msg);
g_free (msg);
/* Page 3 */
g_object_set_data (G_OBJECT (WID("page3")), "name", "summary");
data->ass = ass;
gtk_widget_show_all (ass);
}
void
fingerprint_button_clicked (GtkBuilder *dialog,
GtkWidget *enable,
GtkWidget *disable)
{
if (is_disable != FALSE) {
delete_fingerprints_question (dialog, enable, disable);
} else {
enroll_fingerprints (GTK_WINDOW (WID ("about-me-dialog")), enable, disable);
}
}

View File

@@ -12,15 +12,16 @@
* 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/>.
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#pragma once
#include <gtk/gtk.h>
#include <act/act.h>
gboolean set_fingerprint_label (GtkButton *editable_button);
void fingerprint_button_clicked (GtkWindow *parent,
GtkButton *editable_button,
ActUser *user);
void set_fingerprint_label (GtkWidget *enable,
GtkWidget *disable);
void fingerprint_button_clicked (GtkBuilder *dialog,
GtkWidget *enable,
GtkWidget *disable);

View File

@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<interface>
<!-- interface-requires gtk+ 3.8 -->
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkListStore" id="model1">
<columns>
@@ -37,8 +37,6 @@
<object class="GtkAssistant" id="assistant">
<property name="border_width">12</property>
<property name="title" translatable="yes">Enable Fingerprint Login</property>
<property name="icon_name">system-users</property>
<property name="visible">False</property>
<child>
<placeholder/>
</child>
@@ -86,7 +84,7 @@
<property name="orientation">vertical</property>
<child>
<object class="GtkRadioButton" id="radiobutton1">
<property name="label" translatable="yes">_Right index finger</property>
<property name="label" translatable="yes">Right index finger</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -102,7 +100,7 @@
</child>
<child>
<object class="GtkRadioButton" id="radiobutton2">
<property name="label" translatable="yes">_Left index finger</property>
<property name="label" translatable="yes">Left index finger</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -117,13 +115,12 @@
</packing>
</child>
<child>
<object class="GtkHBox" id="radiobutton3-hbox">
<object class="GtkHBox" id="hbox77">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkRadioButton" id="radiobutton3">
<property name="label" translatable="yes">Other finger: </property>
<property name="visible">True</property>
<property name="label" translatable="yes">_Other finger:</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
@@ -133,6 +130,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
@@ -149,7 +147,7 @@
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
@@ -164,6 +162,9 @@
</packing>
</child>
</object>
<packing>
<property name="title" translatable="yes">Select finger</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="page2">
@@ -184,8 +185,9 @@
<child>
<object class="GtkHBox" id="enroll_hbox">
<property name="visible">True</property>
<property name="margin-top">24</property>
<property name="margin-bottom">24</property>
<child>
<placeholder/>
</child>
<child>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
@@ -217,98 +219,16 @@
</packing>
</child>
<child>
<object class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="stock">gtk-no</property>
<property name="icon-size">6</property>
</object>
<packing>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="stock">gtk-no</property>
<property name="icon-size">6</property>
</object>
<packing>
<property name="position">5</property>
</packing>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="enroll2_hbox">
<property name="visible">True</property>
<property name="margin-top">24</property>
<property name="margin-bottom">24</property>
<child>
<object class="GtkImage" id="image6">
<property name="visible">True</property>
<property name="stock">gtk-no</property>
<property name="icon-size">6</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkImage" id="image7">
<property name="visible">True</property>
<property name="stock">gtk-no</property>
<property name="icon-size">6</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkImage" id="image8">
<property name="visible">True</property>
<property name="stock">gtk-no</property>
<property name="icon-size">6</property>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkImage" id="image9">
<property name="visible">True</property>
<property name="stock">gtk-no</property>
<property name="icon-size">6</property>
</object>
<packing>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkImage" id="image10">
<property name="visible">True</property>
<property name="stock">gtk-no</property>
<property name="icon-size">6</property>
</object>
<packing>
<property name="position">5</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="status-label">
<property name="visible">True</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -317,6 +237,9 @@
</packing>
</child>
</object>
<packing>
<property name="title">Swipe finger on reader</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="page3">
@@ -326,15 +249,8 @@
</object>
<packing>
<property name="page_type">summary</property>
<property name="title" translatable="yes">Done!</property>
</packing>
</child>
</object>
<object class="GtkSizeGroup" id="sizegroup">
<property name="mode">both</property>
<widgets>
<widget name="radiobutton1"/>
<widget name="radiobutton2"/>
<widget name="radiobutton3-hbox"/>
</widgets>
</object>
</interface>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,9 @@
#ifndef __GNOME_ABOUT_ME_PASSWORD_H__
#define __GNOME_ABOUT_ME_PASSWORD_H__
#include <gtk/gtkwindow.h>
void
gnome_about_me_password (GtkWindow *parent);
#endif /* __GNOME_ABOUT_ME_PASSWORD_H__ */

View File

@@ -0,0 +1,319 @@
<?xml version="1.0"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkDialog" id="change-password">
<property name="border_width">6</property>
<property name="title" translatable="yes">Change password</property>
<property name="resizable">False</property>
<property name="type_hint">dialog</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkHBox" id="container-hbox">
<property name="visible">True</property>
<property name="border_width">6</property>
<property name="spacing">12</property>
<child>
<object class="GtkImage" id="dialog-image">
<property name="visible">True</property>
<property name="yalign">0</property>
<property name="icon_name">gtk-dialog-authentication</property>
<property name="icon-size">6</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="main-vbox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="header-label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Change your password</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="scale" value="1.2"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="description-label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label" translatable="yes">To change your password, enter your current password in the field below and click &lt;b&gt;Authenticate&lt;/b&gt;.
After you have authenticated, enter your new password, retype it for verification and click &lt;b&gt;Change password&lt;/b&gt;.</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="entry-hbox">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkVBox" id="entry-labels-vbox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="current-password-label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Current _password:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">current-password</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="new-password-label">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_New password:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">new-password</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="retyped-password-label">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Retype new password:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">retyped-password</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="entry-vbox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkHBox" id="auth-hbox">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkEntry" id="current-password">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="visibility">False</property>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="authenticate-button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<child>
<object class="GtkHBox" id="hbox73">
<property name="visible">True</property>
<property name="spacing">2</property>
<child>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="stock">gtk-apply</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label1070">
<property name="visible">True</property>
<property name="label" translatable="yes">_Authenticate</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="new-password">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="visibility">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="retyped-password">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="visibility">False</property>
<property name="activates_default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="status-label">
<property name="visible">True</property>
<property name="label" translatable="yes">Please type your password again in the &lt;b&gt;Retype new password&lt;/b&gt; field.</property>
<property name="use_markup">True</property>
<property name="justify">center</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action-area">
<property name="visible">True</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="cancel-button">
<property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="change-password-button">
<property name="label" translatable="yes">Change pa_ssword</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="-7">cancel-button</action-widget>
<action-widget response="-5">change-password-button</action-widget>
</action-widgets>
</object>
</interface>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,14 @@
[Desktop Entry]
_Name=About Me
_Comment=Set your personal information
Exec=gnome-about-me
Icon=user-info
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Settings;X-GNOME-PersonalSettings;
OnlyShowIn=GNOME;
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gnome-control-center
X-GNOME-Bugzilla-Component=about-me
X-GNOME-Bugzilla-Version=@VERSION@

View File

@@ -0,0 +1,32 @@
pixmapsdir = $(pkgdatadir)/pixmaps
pixmaps_DATA = \
gnome-about-me-lock.png \
gnome-about-me-lock-open.png \
left-index-finger.svg \
left-little-finger.svg \
left-middle-finger.svg \
left-ring-finger.svg \
left-thumb.svg \
print_error.svg \
print_ok.svg \
right-index-finger.svg \
right-little-finger.svg \
right-middle-finger.svg \
right-ring-finger.svg \
right-thumb.svg \
left-index-finger.png \
left-middle-finger.png \
left-little-finger.png \
left-ring-finger.png \
left-thumb.png \
print_error.png \
print_ok.png \
right-index-finger.png \
right-middle-finger.png \
right-little-finger.png \
right-ring-finger.png \
right-thumb.png
EXTRA_DIST = $(pixmaps_DATA)
-include $(top_srcdir)/git.mk

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@@ -0,0 +1,3 @@
SUBDIRS = at-properties
-include $(top_srcdir)/git.mk

View File

@@ -0,0 +1,31 @@
bin_PROGRAMS = gnome-at-properties
gnome_at_properties_LDADD = $(AT_CAPPLET_LIBS) $(GNOMECC_CAPPLETS_LIBS) $(top_builddir)/capplets/common/libcommon.la
gnome_at_properties_SOURCES = \
main.c
gnome_at_properties_LDFLAGS = -export-dynamic
@INTLTOOL_DESKTOP_RULE@
desktopdir = $(datadir)/applications
Desktop_in_files = at-properties.desktop.in
desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop)
pixmapdir = $(pkgdatadir)/pixmaps
pixmap_DATA = \
at-startup.png \
at-support.png
uidir = $(pkgdatadir)/ui
ui_DATA = at-enable-dialog.ui
INCLUDES = $(AT_CAPPLET_CFLAGS) \
$(GNOMECC_CAPPLETS_CFLAGS) \
-DUIDIR=\""$(uidir)"\" \
-DPIXMAPDIR=\""$(pixmapdir)"\" \
-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \
-DGNOMELOCALEDIR="\"$(datadir)/locale\""
CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) $(Desktop_in_files) $(desktop_DATA)
EXTRA_DIST = $(ui_DATA) $(pixmap_DATA)
-include $(top_srcdir)/git.mk

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -0,0 +1,351 @@
<?xml version="1.0"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkDialog" id="at_properties_dialog">
<property name="border_width">5</property>
<property name="title" translatable="yes">Assistive Technologies Preferences</property>
<property name="resizable">False</property>
<property name="type_hint">dialog</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
<property name="spacing">2</property>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="border_width">5</property>
<property name="spacing">18</property>
<child>
<object class="GtkVBox" id="at_support_frame">
<property name="visible">True</property>
<child>
<object class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Assistive Technologies</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox2">
<property name="visible">True</property>
<property name="spacing">12</property>
<child>
<object class="GtkImage" id="at_enable_image">
<property name="visible">True</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox3">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkButton" id="at_pref_button">
<property name="label" translatable="yes">_Preferred Applications</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="image">pref_button_img</property>
<property name="use_underline">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="at_pref_button-atkobject">
<property name="AtkObject::accessible-description" translatable="yes">Jump to Preferred Applications dialog</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="at_enable_toggle">
<property name="label" translatable="yes">_Enable assistive technologies</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="at_enable_toggle-atkobject">
<property name="AtkObject::accessible-description" translatable="yes">Changes to enable assistive technologies will not take effect until your next log in.</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="at_applications_frame">
<property name="visible">True</property>
<child>
<object class="GtkVBox" id="vbox7">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="pref_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Preferences</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox3">
<property name="visible">True</property>
<property name="spacing">12</property>
<child>
<object class="GtkImage" id="at_applications_image">
<property name="visible">True</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox5">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkVBox" id="vbox8">
<property name="visible">True</property>
<child>
<object class="GtkButton" id="keyboard_button">
<property name="label" translatable="yes">_Keyboard Accessibility</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="image">keyboard_button_img</property>
<property name="use_underline">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="keyboard_button-atkobject">
<property name="AtkObject::accessible-description" translatable="yes">Jump to the Keyboard Accessibility dialog</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">5</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="mouse_button">
<property name="label" translatable="yes">_Mouse Accessibility</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="image">mouse_button_img</property>
<property name="use_underline">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="mouse_button-atkobject">
<property name="AtkObject::accessible-description" translatable="yes">Jump to the Mouse Accessibility dialog</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">5</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="login_button">
<property name="label" translatable="yes">Accessible Lo_gin</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="image">login_button_img</property>
<property name="use_underline">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="login_button-atkobject">
<property name="AtkObject::accessible-description" translatable="yes">Jump to the Accessible Login dialog</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">5</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="at_help_button">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="at_close_logout_button">
<property name="label" translatable="yes">Close and _Log Out</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="image">close_logout_button_img</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="at_close_button">
<property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="-11">at_help_button</action-widget>
<action-widget response="0">at_close_logout_button</action-widget>
<action-widget response="-7">at_close_button</action-widget>
</action-widgets>
</object>
<object class="GtkImage" id="close_logout_button_img">
<property name="visible">True</property>
<property name="stock">gtk-quit</property>
</object>
<object class="GtkImage" id="pref_button_img">
<property name="visible">True</property>
<property name="stock">gtk-jump-to</property>
</object>
<object class="GtkImage" id="keyboard_button_img">
<property name="visible">True</property>
<property name="stock">gtk-jump-to</property>
</object>
<object class="GtkImage" id="mouse_button_img">
<property name="visible">True</property>
<property name="stock">gtk-jump-to</property>
</object>
<object class="GtkImage" id="login_button_img">
<property name="visible">True</property>
<property name="stock">gtk-jump-to</property>
</object>
</interface>

View File

@@ -0,0 +1,14 @@
[Desktop Entry]
_Name=Assistive Technologies
_Comment=Choose which accessibility features to enable when you log in
Exec=gnome-at-properties
Icon=preferences-desktop-accessibility
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Settings;X-GNOME-PersonalSettings;
OnlyShowIn=GNOME;
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gnome-control-center
X-GNOME-Bugzilla-Component=Assistive Technology Preferences
X-GNOME-Bugzilla-Version=@VERSION@

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -0,0 +1,293 @@
#include <config.h>
#include <gtk/gtk.h>
#include <gconf/gconf-client.h>
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-lowlevel.h>
#define GSM_SERVICE_DBUS "org.gnome.SessionManager"
#define GSM_PATH_DBUS "/org/gnome/SessionManager"
#define GSM_INTERFACE_DBUS "org.gnome.SessionManager"
enum {
GSM_LOGOUT_MODE_NORMAL = 0,
GSM_LOGOUT_MODE_NO_CONFIRMATION,
GSM_LOGOUT_MODE_FORCE
};
#include "capplet-util.h"
#include "gconf-property-editor.h"
#include "activate-settings-daemon.h"
#define ACCESSIBILITY_KEY "/desktop/gnome/interface/accessibility"
#define ACCESSIBILITY_KEY_DIR "/desktop/gnome/interface"
static gboolean initial_state;
static GtkBuilder *
create_builder (void)
{
GtkBuilder *builder;
GError *error = NULL;
static const gchar *uifile = UIDIR "/at-enable-dialog.ui";
builder = gtk_builder_new ();
if (gtk_builder_add_from_file (builder, uifile, &error)) {
GObject *object;
gchar *prog;
object = gtk_builder_get_object (builder, "at_enable_image");
gtk_image_set_from_file (GTK_IMAGE (object),
PIXMAPDIR "/at-startup.png");
object = gtk_builder_get_object (builder,
"at_applications_image");
gtk_image_set_from_file (GTK_IMAGE (object),
PIXMAPDIR "/at-support.png");
prog = g_find_program_in_path ("gdmsetup");
if (prog == NULL) {
object = gtk_builder_get_object (builder,
"login_button");
gtk_widget_hide (GTK_WIDGET (object));
}
g_free (prog);
} else {
g_warning ("Could not load UI: %s", error->message);
g_error_free (error);
g_object_unref (builder);
builder = NULL;
}
return builder;
}
static void
cb_at_preferences (GtkDialog *dialog, gint response_id)
{
g_spawn_command_line_async ("gnome-default-applications-properties --show-page=a11y", NULL);
}
static void
cb_keyboard_preferences (GtkDialog *dialog, gint response_id)
{
g_spawn_command_line_async ("gnome-keyboard-properties --a11y", NULL);
}
static void
cb_mouse_preferences (GtkDialog *dialog, gint response_id)
{
g_spawn_command_line_async ("gnome-mouse-properties --show-page=accessibility", NULL);
}
static void
cb_login_preferences (GtkDialog *dialog, gint response_id)
{
g_spawn_command_line_async ("gdmsetup", NULL);
}
/* get_session_bus(), get_sm_proxy(), and do_logout() are all
* based on code from gnome-session-save.c from gnome-session.
*/
static DBusGConnection *
get_session_bus (void)
{
DBusGConnection *bus;
GError *error = NULL;
bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
if (bus == NULL) {
g_warning ("Couldn't connect to session bus: %s", error->message);
g_error_free (error);
}
return bus;
}
static DBusGProxy *
get_sm_proxy (void)
{
DBusGConnection *connection;
DBusGProxy *sm_proxy;
if (!(connection = get_session_bus ()))
return NULL;
sm_proxy = dbus_g_proxy_new_for_name (connection,
GSM_SERVICE_DBUS,
GSM_PATH_DBUS,
GSM_INTERFACE_DBUS);
return sm_proxy;
}
static gboolean
do_logout (GError **err)
{
DBusGProxy *sm_proxy;
GError *error;
gboolean res;
sm_proxy = get_sm_proxy ();
if (sm_proxy == NULL)
return FALSE;
res = dbus_g_proxy_call (sm_proxy,
"Logout",
&error,
G_TYPE_UINT, 0, /* '0' means 'log out normally' */
G_TYPE_INVALID,
G_TYPE_INVALID);
if (sm_proxy)
g_object_unref (sm_proxy);
return res;
}
static void
cb_dialog_response (GtkDialog *dialog, gint response_id)
{
if (response_id == GTK_RESPONSE_HELP)
capplet_help (GTK_WINDOW (dialog),
"goscustaccess-11");
else if (response_id == GTK_RESPONSE_CLOSE || response_id == GTK_RESPONSE_DELETE_EVENT)
gtk_main_quit ();
else {
g_message ("CLOSE AND LOGOUT!");
if (!do_logout (NULL))
gtk_main_quit ();
}
}
static void
close_logout_update (GtkBuilder *builder)
{
GConfClient *client = gconf_client_get_default ();
gboolean curr_state = gconf_client_get_bool (client, ACCESSIBILITY_KEY, NULL);
GObject *btn = gtk_builder_get_object (builder,
"at_close_logout_button");
gtk_widget_set_sensitive (GTK_WIDGET (btn), initial_state != curr_state);
g_object_unref (client);
}
static void
at_enable_toggled (GtkToggleButton *toggle_button,
GtkBuilder *builder)
{
GConfClient *client = gconf_client_get_default ();
gboolean is_enabled = gtk_toggle_button_get_active (toggle_button);
gconf_client_set_bool (client, ACCESSIBILITY_KEY,
is_enabled,
NULL);
g_object_unref (client);
}
static void
at_enable_update (GConfClient *client,
GtkBuilder *builder)
{
gboolean is_enabled = gconf_client_get_bool (client, ACCESSIBILITY_KEY, NULL);
GObject *btn = gtk_builder_get_object (builder, "at_enable_toggle");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (btn),
is_enabled);
}
static void
at_enable_changed (GConfClient *client,
guint cnxn_id,
GConfEntry *entry,
gpointer user_data)
{
at_enable_update (client, user_data);
close_logout_update (user_data);
}
static void
setup_dialog (GtkBuilder *builder)
{
GConfClient *client;
GtkWidget *widget;
GObject *object;
GObject *peditor;
client = gconf_client_get_default ();
gconf_client_add_dir (client, ACCESSIBILITY_KEY_DIR,
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
object = gtk_builder_get_object (builder, "at_enable_toggle");
g_signal_connect (object, "toggled",
G_CALLBACK (at_enable_toggled),
builder);
peditor = gconf_peditor_new_boolean (NULL, ACCESSIBILITY_KEY,
GTK_WIDGET (object),
NULL);
initial_state = gconf_client_get_bool (client, ACCESSIBILITY_KEY, NULL);
at_enable_update (client, builder);
gconf_client_notify_add (client, ACCESSIBILITY_KEY_DIR,
at_enable_changed,
builder, NULL, NULL);
object = gtk_builder_get_object (builder, "at_pref_button");
g_signal_connect (object, "clicked",
G_CALLBACK (cb_at_preferences), NULL);
object = gtk_builder_get_object (builder, "keyboard_button");
g_signal_connect (object, "clicked",
G_CALLBACK (cb_keyboard_preferences), NULL);
object = gtk_builder_get_object (builder, "mouse_button");
g_signal_connect (object, "clicked",
G_CALLBACK (cb_mouse_preferences), NULL);
object = gtk_builder_get_object (builder, "login_button");
g_signal_connect (object, "clicked",
G_CALLBACK (cb_login_preferences), NULL);
widget = GTK_WIDGET (gtk_builder_get_object (builder,
"at_properties_dialog"));
capplet_set_icon (widget, "preferences-desktop-accessibility");
g_signal_connect (G_OBJECT (widget),
"response",
G_CALLBACK (cb_dialog_response), NULL);
gtk_widget_show (widget);
g_object_unref (client);
}
int
main (int argc, char *argv[])
{
GtkBuilder *builder;
capplet_init (NULL, &argc, &argv);
activate_settings_daemon ();
builder = create_builder ();
if (builder) {
setup_dialog (builder);
gtk_main ();
g_object_unref (builder);
}
return 0;
}

View File

@@ -0,0 +1,60 @@
SUBDIRS = data
# This is used in GNOMECC_CAPPLETS_CFLAGS
cappletname = appearance
bin_PROGRAMS = gnome-appearance-properties
gnome_appearance_properties_SOURCES = \
appearance.h \
appearance-desktop.c \
appearance-desktop.h \
appearance-font.c \
appearance-font.h \
appearance-main.c \
appearance-themes.c \
appearance-themes.h \
appearance-style.c \
appearance-style.h \
gedit-message-area.c \
gedit-message-area.h \
gnome-wp-info.c \
gnome-wp-info.h \
gnome-wp-item.c \
gnome-wp-item.h \
gnome-wp-xml.c \
gnome-wp-xml.h \
theme-installer.c \
theme-installer.h \
theme-save.c \
theme-save.h \
theme-util.c \
theme-util.h
AM_CFLAGS = -DGNOME_DESKTOP_USE_UNSTABLE_API
gnome_appearance_properties_LDADD = \
$(top_builddir)/libwindow-settings/libgnome-window-settings.la \
$(top_builddir)/capplets/common/libcommon.la \
$(GNOMECC_CAPPLETS_LIBS) \
$(FONT_CAPPLET_LIBS) \
$(METACITY_LIBS)
gnome_appearance_properties_LDFLAGS = -export-dynamic
gtkbuilderdir = $(pkgdatadir)/ui
pixmapdir = $(pkgdatadir)/pixmaps
wallpaperdir = $(datadir)/gnome-background-properties
INCLUDES = \
$(METACITY_CFLAGS) \
$(GNOMECC_CAPPLETS_CFLAGS) \
$(FONT_CAPPLET_CFLAGS) \
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \
-DGNOMECC_GTKBUILDER_DIR="\"$(gtkbuilderdir)\"" \
-DGNOMECC_PIXMAP_DIR="\"$(pixmapdir)\"" \
-DWALLPAPER_DATADIR="\"$(wallpaperdir)\""
CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES)
-include $(top_srcdir)/git.mk

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,8 @@
/*
* Copyright (C) 2007 The GNOME Foundation
* Written by Denis Washington <denisw@svn.gnome.org>
* All Rights Reserved
*
* 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
@@ -12,21 +16,7 @@
* 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.
*
* (C) Copyright 2015 Red Hat, Inc.
*/
#pragma once
#include <gtk/gtk.h>
#include <act/act.h>
G_BEGIN_DECLS
#define CC_TYPE_USER_IMAGE (cc_user_image_get_type ())
G_DECLARE_FINAL_TYPE (CcUserImage, cc_user_image, CC, USER_IMAGE, GtkImage)
GtkWidget *cc_user_image_new (void);
void cc_user_image_set_user (CcUserImage *image, ActUser *user);
G_END_DECLS
void desktop_init (AppearanceData *data, const gchar **uris);
void desktop_shutdown (AppearanceData *data);

View File

@@ -0,0 +1,984 @@
/*
* Copyright (C) 2007 The GNOME Foundation
* Written by Jonathan Blandford <jrb@gnome.org>
* Jens Granseuer <jensgr@gmx.net>
* All Rights Reserved
*
* 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 "appearance.h"
#include <string.h>
#include <stdarg.h>
#include <math.h>
#ifdef HAVE_XFT2
#include <gdk/gdkx.h>
#include <X11/Xft/Xft.h>
#endif /* HAVE_XFT2 */
#include <glib/gi18n.h>
#include "capplet-util.h"
#include "gconf-property-editor.h"
#define GTK_FONT_KEY "/desktop/gnome/interface/font_name"
#define DESKTOP_FONT_KEY "/apps/nautilus/preferences/desktop_font"
#define METACITY_DIR "/apps/metacity/general"
#define WINDOW_TITLE_FONT_KEY METACITY_DIR "/titlebar_font"
#define WINDOW_TITLE_USES_SYSTEM_KEY METACITY_DIR "/titlebar_uses_system_font"
#define MONOSPACE_FONT_KEY "/desktop/gnome/interface/monospace_font_name"
#define DOCUMENT_FONT_KEY "/desktop/gnome/interface/document_font_name"
#ifdef HAVE_XFT2
#define FONT_RENDER_DIR "/desktop/gnome/font_rendering"
#define FONT_ANTIALIASING_KEY FONT_RENDER_DIR "/antialiasing"
#define FONT_HINTING_KEY FONT_RENDER_DIR "/hinting"
#define FONT_RGBA_ORDER_KEY FONT_RENDER_DIR "/rgba_order"
#define FONT_DPI_KEY FONT_RENDER_DIR "/dpi"
/* X servers sometimes lie about the screen's physical dimensions, so we cannot
* compute an accurate DPI value. When this happens, the user gets fonts that
* are too huge or too tiny. So, we see what the server returns: if it reports
* something outside of the range [DPI_LOW_REASONABLE_VALUE,
* DPI_HIGH_REASONABLE_VALUE], then we assume that it is lying and we use
* DPI_FALLBACK instead.
*
* See get_dpi_from_gconf_or_server() below, and also
* https://bugzilla.novell.com/show_bug.cgi?id=217790
*/
#define DPI_FALLBACK 96
#define DPI_LOW_REASONABLE_VALUE 50
#define DPI_HIGH_REASONABLE_VALUE 500
#endif /* HAVE_XFT2 */
static gboolean in_change = FALSE;
static gchar *old_font = NULL;
#define MAX_FONT_POINT_WITHOUT_WARNING 32
#define MAX_FONT_SIZE_WITHOUT_WARNING MAX_FONT_POINT_WITHOUT_WARNING*1024
#ifdef HAVE_XFT2
/*
* Code for displaying previews of font rendering with various Xft options
*/
static void
sample_size_request (GtkWidget *darea,
GtkRequisition *requisition)
{
GdkPixbuf *pixbuf = g_object_get_data (G_OBJECT (darea), "sample-pixbuf");
requisition->width = gdk_pixbuf_get_width (pixbuf) + 2;
requisition->height = gdk_pixbuf_get_height (pixbuf) + 2;
}
static void
sample_expose (GtkWidget *darea,
GdkEventExpose *expose)
{
GdkPixbuf *pixbuf = g_object_get_data (G_OBJECT (darea), "sample-pixbuf");
int width = gdk_pixbuf_get_width (pixbuf);
int height = gdk_pixbuf_get_height (pixbuf);
int x = (darea->allocation.width - width) / 2;
int y = (darea->allocation.height - height) / 2;
gdk_draw_rectangle (darea->window, darea->style->white_gc, TRUE,
0, 0,
darea->allocation.width, darea->allocation.height);
gdk_draw_rectangle (darea->window, darea->style->black_gc, FALSE,
0, 0,
darea->allocation.width - 1, darea->allocation.height - 1);
gdk_draw_pixbuf (darea->window, NULL, pixbuf, 0, 0, x, y, width, height,
GDK_RGB_DITHER_NORMAL, 0, 0);
}
typedef enum {
ANTIALIAS_NONE,
ANTIALIAS_GRAYSCALE,
ANTIALIAS_RGBA
} Antialiasing;
static GConfEnumStringPair antialias_enums[] = {
{ ANTIALIAS_NONE, "none" },
{ ANTIALIAS_GRAYSCALE, "grayscale" },
{ ANTIALIAS_RGBA, "rgba" },
{ -1, NULL }
};
typedef enum {
HINT_NONE,
HINT_SLIGHT,
HINT_MEDIUM,
HINT_FULL
} Hinting;
static GConfEnumStringPair hint_enums[] = {
{ HINT_NONE, "none" },
{ HINT_SLIGHT, "slight" },
{ HINT_MEDIUM, "medium" },
{ HINT_FULL, "full" },
{ -1, NULL }
};
typedef enum {
RGBA_RGB,
RGBA_BGR,
RGBA_VRGB,
RGBA_VBGR
} RgbaOrder;
static GConfEnumStringPair rgba_order_enums[] = {
{ RGBA_RGB, "rgb" },
{ RGBA_BGR, "bgr" },
{ RGBA_VRGB, "vrgb" },
{ RGBA_VBGR, "vbgr" },
{ -1, NULL }
};
static XftFont *
open_pattern (FcPattern *pattern,
Antialiasing antialiasing,
Hinting hinting)
{
#ifdef FC_HINT_STYLE
static const int hintstyles[] = {
FC_HINT_NONE, FC_HINT_SLIGHT, FC_HINT_MEDIUM, FC_HINT_FULL
};
#endif /* FC_HINT_STYLE */
FcPattern *res_pattern;
FcResult result;
XftFont *font;
Display *xdisplay = gdk_x11_get_default_xdisplay ();
int screen = gdk_x11_get_default_screen ();
res_pattern = XftFontMatch (xdisplay, screen, pattern, &result);
if (res_pattern == NULL)
return NULL;
FcPatternDel (res_pattern, FC_HINTING);
FcPatternAddBool (res_pattern, FC_HINTING, hinting != HINT_NONE);
#ifdef FC_HINT_STYLE
FcPatternDel (res_pattern, FC_HINT_STYLE);
FcPatternAddInteger (res_pattern, FC_HINT_STYLE, hintstyles[hinting]);
#endif /* FC_HINT_STYLE */
FcPatternDel (res_pattern, FC_ANTIALIAS);
FcPatternAddBool (res_pattern, FC_ANTIALIAS, antialiasing != ANTIALIAS_NONE);
FcPatternDel (res_pattern, FC_RGBA);
FcPatternAddInteger (res_pattern, FC_RGBA,
antialiasing == ANTIALIAS_RGBA ? FC_RGBA_RGB : FC_RGBA_NONE);
FcPatternDel (res_pattern, FC_DPI);
FcPatternAddInteger (res_pattern, FC_DPI, 96);
font = XftFontOpenPattern (xdisplay, res_pattern);
if (!font)
FcPatternDestroy (res_pattern);
return font;
}
static void
setup_font_sample (GtkWidget *darea,
Antialiasing antialiasing,
Hinting hinting)
{
const char *string1 = "abcfgop AO ";
const char *string2 = "abcfgop";
XftColor black, white;
XRenderColor rendcolor;
Display *xdisplay = gdk_x11_get_default_xdisplay ();
GdkColormap *colormap = gdk_rgb_get_colormap ();
Colormap xcolormap = GDK_COLORMAP_XCOLORMAP (colormap);
GdkVisual *visual = gdk_colormap_get_visual (colormap);
Visual *xvisual = GDK_VISUAL_XVISUAL (visual);
FcPattern *pattern;
XftFont *font1, *font2;
XGlyphInfo extents1 = { 0 };
XGlyphInfo extents2 = { 0 };
GdkPixmap *pixmap;
XftDraw *draw;
GdkPixbuf *tmp_pixbuf, *pixbuf;
int width, height;
int ascent, descent;
pattern = FcPatternBuild (NULL,
FC_FAMILY, FcTypeString, "Serif",
FC_SLANT, FcTypeInteger, FC_SLANT_ROMAN,
FC_SIZE, FcTypeDouble, 18.,
NULL);
font1 = open_pattern (pattern, antialiasing, hinting);
FcPatternDestroy (pattern);
pattern = FcPatternBuild (NULL,
FC_FAMILY, FcTypeString, "Serif",
FC_SLANT, FcTypeInteger, FC_SLANT_ITALIC,
FC_SIZE, FcTypeDouble, 20.,
NULL);
font2 = open_pattern (pattern, antialiasing, hinting);
FcPatternDestroy (pattern);
ascent = 0;
descent = 0;
if (font1) {
XftTextExtentsUtf8 (xdisplay, font1, (unsigned char *) string1,
strlen (string1), &extents1);
ascent = MAX (ascent, font1->ascent);
descent = MAX (descent, font1->descent);
}
if (font2) {
XftTextExtentsUtf8 (xdisplay, font2, (unsigned char *) string2,
strlen (string2), &extents2);
ascent = MAX (ascent, font2->ascent);
descent = MAX (descent, font2->descent);
}
width = extents1.xOff + extents2.xOff + 4;
height = ascent + descent + 2;
pixmap = gdk_pixmap_new (NULL, width, height, visual->depth);
draw = XftDrawCreate (xdisplay, GDK_DRAWABLE_XID (pixmap), xvisual, xcolormap);
rendcolor.red = 0;
rendcolor.green = 0;
rendcolor.blue = 0;
rendcolor.alpha = 0xffff;
XftColorAllocValue (xdisplay, xvisual, xcolormap, &rendcolor, &black);
rendcolor.red = 0xffff;
rendcolor.green = 0xffff;
rendcolor.blue = 0xffff;
rendcolor.alpha = 0xffff;
XftColorAllocValue (xdisplay, xvisual, xcolormap, &rendcolor, &white);
XftDrawRect (draw, &white, 0, 0, width, height);
if (font1)
XftDrawStringUtf8 (draw, &black, font1,
2, 2 + ascent,
(unsigned char *) string1, strlen (string1));
if (font2)
XftDrawStringUtf8 (draw, &black, font2,
2 + extents1.xOff, 2 + ascent,
(unsigned char *) string2, strlen (string2));
XftDrawDestroy (draw);
if (font1)
XftFontClose (xdisplay, font1);
if (font2)
XftFontClose (xdisplay, font2);
tmp_pixbuf = gdk_pixbuf_get_from_drawable (NULL, pixmap, colormap, 0, 0, 0, 0, width, height);
pixbuf = gdk_pixbuf_scale_simple (tmp_pixbuf, 1 * width, 1 * height, GDK_INTERP_TILES);
g_object_unref (pixmap);
g_object_unref (tmp_pixbuf);
g_object_set_data_full (G_OBJECT (darea), "sample-pixbuf",
pixbuf, (GDestroyNotify) g_object_unref);
g_signal_connect (darea, "size_request", G_CALLBACK (sample_size_request), NULL);
g_signal_connect (darea, "expose_event", G_CALLBACK (sample_expose), NULL);
}
/*
* Code implementing a group of radio buttons with different Xft option combinations.
* If one of the buttons is matched by the GConf key, we pick it. Otherwise we
* show the group as inconsistent.
*/
static void
font_render_get_gconf (GConfClient *client,
Antialiasing *antialiasing,
Hinting *hinting)
{
gchar *antialias_str = gconf_client_get_string (client, FONT_ANTIALIASING_KEY, NULL);
gchar *hint_str = gconf_client_get_string (client, FONT_HINTING_KEY, NULL);
gint val;
val = ANTIALIAS_GRAYSCALE;
if (antialias_str) {
gconf_string_to_enum (antialias_enums, antialias_str, &val);
g_free (antialias_str);
}
*antialiasing = val;
val = HINT_FULL;
if (hint_str) {
gconf_string_to_enum (hint_enums, hint_str, &val);
g_free (hint_str);
}
*hinting = val;
}
typedef struct {
Antialiasing antialiasing;
Hinting hinting;
GtkToggleButton *radio;
} FontPair;
static GSList *font_pairs = NULL;
static void
font_render_load (GConfClient *client)
{
Antialiasing antialiasing;
Hinting hinting;
gboolean inconsistent = TRUE;
GSList *tmp_list;
font_render_get_gconf (client, &antialiasing, &hinting);
in_change = TRUE;
for (tmp_list = font_pairs; tmp_list; tmp_list = tmp_list->next) {
FontPair *pair = tmp_list->data;
if (antialiasing == pair->antialiasing && hinting == pair->hinting) {
gtk_toggle_button_set_active (pair->radio, TRUE);
inconsistent = FALSE;
break;
}
}
for (tmp_list = font_pairs; tmp_list; tmp_list = tmp_list->next) {
FontPair *pair = tmp_list->data;
gtk_toggle_button_set_inconsistent (pair->radio, inconsistent);
}
in_change = FALSE;
}
static void
font_render_changed (GConfClient *client,
guint cnxn_id,
GConfEntry *entry,
gpointer user_data)
{
font_render_load (client);
}
static void
font_radio_toggled (GtkToggleButton *toggle_button,
FontPair *pair)
{
if (!in_change) {
GConfClient *client = gconf_client_get_default ();
gconf_client_set_string (client, FONT_ANTIALIASING_KEY,
gconf_enum_to_string (antialias_enums, pair->antialiasing),
NULL);
gconf_client_set_string (client, FONT_HINTING_KEY,
gconf_enum_to_string (hint_enums, pair->hinting),
NULL);
/* Restore back to the previous state until we get notification */
font_render_load (client);
g_object_unref (client);
}
}
static void
setup_font_pair (GtkWidget *radio,
GtkWidget *darea,
Antialiasing antialiasing,
Hinting hinting)
{
FontPair *pair = g_new (FontPair, 1);
pair->antialiasing = antialiasing;
pair->hinting = hinting;
pair->radio = GTK_TOGGLE_BUTTON (radio);
setup_font_sample (darea, antialiasing, hinting);
font_pairs = g_slist_prepend (font_pairs, pair);
g_signal_connect (radio, "toggled",
G_CALLBACK (font_radio_toggled), pair);
}
#endif /* HAVE_XFT2 */
static void
metacity_titlebar_load_sensitivity (AppearanceData *data)
{
gtk_widget_set_sensitive (appearance_capplet_get_widget (data, "window_title_font"),
!gconf_client_get_bool (data->client,
WINDOW_TITLE_USES_SYSTEM_KEY,
NULL));
}
static void
metacity_changed (GConfClient *client,
guint cnxn_id,
GConfEntry *entry,
gpointer user_data)
{
metacity_titlebar_load_sensitivity (user_data);
}
/* returns 0 if the font is safe, otherwise returns the size in points. */
static gint
font_dangerous (const char *font)
{
PangoFontDescription *pfd;
gboolean retval = 0;
pfd = pango_font_description_from_string (font);
if (pfd == NULL)
/* an invalid font was passed in. This isn't our problem. */
return 0;
if ((pango_font_description_get_set_fields (pfd) & PANGO_FONT_MASK_SIZE) &&
(pango_font_description_get_size (pfd) >= MAX_FONT_SIZE_WITHOUT_WARNING)) {
retval = pango_font_description_get_size (pfd)/1024;
}
pango_font_description_free (pfd);
return retval;
}
static GConfValue *
application_font_to_gconf (GConfPropertyEditor *peditor,
GConfValue *value)
{
GConfValue *new_value;
const char *new_font;
GtkWidget *font_button;
gint danger_level;
font_button = GTK_WIDGET (gconf_property_editor_get_ui_control (peditor));
g_return_val_if_fail (font_button != NULL, NULL);
new_value = gconf_value_new (GCONF_VALUE_STRING);
new_font = gconf_value_get_string (value);
if (font_dangerous (old_font)) {
/* If we're already too large, we don't warn again. */
gconf_value_set_string (new_value, new_font);
return new_value;
}
danger_level = font_dangerous (new_font);
if (danger_level) {
GtkWidget *warning_dialog, *apply_button;
const gchar *warning_label;
gchar *warning_label2;
warning_label = _("Font may be too large");
if (danger_level > MAX_FONT_POINT_WITHOUT_WARNING) {
warning_label2 = g_strdup_printf (ngettext (
"The font selected is %d point large, "
"and may make it difficult to effectively "
"use the computer. It is recommended that "
"you select a size smaller than %d.",
"The font selected is %d points large, "
"and may make it difficult to effectively "
"use the computer. It is recommended that "
"you select a size smaller than %d.",
danger_level),
danger_level,
MAX_FONT_POINT_WITHOUT_WARNING);
} else {
warning_label2 = g_strdup_printf (ngettext (
"The font selected is %d point large, "
"and may make it difficult to effectively "
"use the computer. It is recommended that "
"you select a smaller sized font.",
"The font selected is %d points large, "
"and may make it difficult to effectively "
"use the computer. It is recommended that "
"you select a smaller sized font.",
danger_level),
danger_level);
}
warning_dialog = gtk_message_dialog_new (NULL,
GTK_DIALOG_MODAL,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_NONE,
"%s",
warning_label);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (warning_dialog),
"%s", warning_label2);
gtk_dialog_add_button (GTK_DIALOG (warning_dialog),
_("Use previous font"), GTK_RESPONSE_CLOSE);
apply_button = gtk_button_new_with_label (_("Use selected font"));
gtk_button_set_image (GTK_BUTTON (apply_button), gtk_image_new_from_stock (GTK_STOCK_APPLY, GTK_ICON_SIZE_BUTTON));
gtk_dialog_add_action_widget (GTK_DIALOG (warning_dialog), apply_button, GTK_RESPONSE_APPLY);
GTK_WIDGET_SET_FLAGS (apply_button, GTK_CAN_DEFAULT);
gtk_widget_show (apply_button);
gtk_dialog_set_default_response (GTK_DIALOG (warning_dialog), GTK_RESPONSE_CLOSE);
g_free (warning_label2);
if (gtk_dialog_run (GTK_DIALOG (warning_dialog)) == GTK_RESPONSE_APPLY) {
gconf_value_set_string (new_value, new_font);
} else {
gconf_value_set_string (new_value, old_font);
gtk_font_button_set_font_name (GTK_FONT_BUTTON (font_button), old_font);
}
gtk_widget_destroy (warning_dialog);
} else {
gconf_value_set_string (new_value, new_font);
}
return new_value;
}
static void
application_font_changed (GtkWidget *font_button)
{
const gchar *font;
font = gtk_font_button_get_font_name (GTK_FONT_BUTTON (font_button));
g_free (old_font);
old_font = g_strdup (font);
}
#ifdef HAVE_XFT2
/*
* EnumGroup - a group of radio buttons tied to a string enumeration
* value. We add this here because the gconf peditor
* equivalent of this is both painful to use (you have
* to supply functions to convert from enums to indices)
* and conceptually broken (the order of radio buttons
* in a group when using Glade is not predictable.
*/
typedef struct
{
GConfClient *client;
GSList *items;
gchar *gconf_key;
GConfEnumStringPair *enums;
int default_value;
} EnumGroup;
typedef struct
{
EnumGroup *group;
GtkToggleButton *widget;
int value;
} EnumItem;
static void
enum_group_load (EnumGroup *group)
{
gchar *str = gconf_client_get_string (group->client, group->gconf_key, NULL);
gint val = group->default_value;
GSList *tmp_list;
if (str)
gconf_string_to_enum (group->enums, str, &val);
g_free (str);
in_change = TRUE;
for (tmp_list = group->items; tmp_list; tmp_list = tmp_list->next) {
EnumItem *item = tmp_list->data;
if (val == item->value)
gtk_toggle_button_set_active (item->widget, TRUE);
}
in_change = FALSE;
}
static void
enum_group_changed (GConfClient *client,
guint cnxn_id,
GConfEntry *entry,
gpointer user_data)
{
enum_group_load (user_data);
}
static void
enum_item_toggled (GtkToggleButton *toggle_button,
EnumItem *item)
{
EnumGroup *group = item->group;
if (!in_change) {
gconf_client_set_string (group->client, group->gconf_key,
gconf_enum_to_string (group->enums, item->value),
NULL);
}
/* Restore back to the previous state until we get notification */
enum_group_load (group);
}
static EnumGroup *
enum_group_create (const gchar *gconf_key,
GConfEnumStringPair *enums,
int default_value,
GtkWidget *first_widget,
...)
{
EnumGroup *group;
GtkWidget *widget;
va_list args;
group = g_new (EnumGroup, 1);
group->client = gconf_client_get_default ();
group->gconf_key = g_strdup (gconf_key);
group->enums = enums;
group->default_value = default_value;
group->items = NULL;
va_start (args, first_widget);
widget = first_widget;
while (widget) {
EnumItem *item;
item = g_new (EnumItem, 1);
item->group = group;
item->widget = GTK_TOGGLE_BUTTON (widget);
item->value = va_arg (args, int);
g_signal_connect (item->widget, "toggled",
G_CALLBACK (enum_item_toggled), item);
group->items = g_slist_prepend (group->items, item);
widget = va_arg (args, GtkWidget *);
}
va_end (args);
enum_group_load (group);
gconf_client_notify_add (group->client, gconf_key,
enum_group_changed,
group, NULL, NULL);
return group;
}
static void
enum_group_destroy (EnumGroup *group)
{
g_object_unref (group->client);
g_free (group->gconf_key);
g_slist_foreach (group->items, (GFunc) g_free, NULL);
g_slist_free (group->items);
g_free (group);
}
static double
dpi_from_pixels_and_mm (int pixels, int mm)
{
double dpi;
if (mm >= 1)
dpi = pixels / (mm / 25.4);
else
dpi = 0;
return dpi;
}
static double
get_dpi_from_x_server (void)
{
GdkScreen *screen;
double dpi;
screen = gdk_screen_get_default ();
if (screen) {
double width_dpi, height_dpi;
width_dpi = dpi_from_pixels_and_mm (gdk_screen_get_width (screen),
gdk_screen_get_width_mm (screen));
height_dpi = dpi_from_pixels_and_mm (gdk_screen_get_height (screen),
gdk_screen_get_height_mm (screen));
if (width_dpi < DPI_LOW_REASONABLE_VALUE || width_dpi > DPI_HIGH_REASONABLE_VALUE ||
height_dpi < DPI_LOW_REASONABLE_VALUE || height_dpi > DPI_HIGH_REASONABLE_VALUE)
dpi = DPI_FALLBACK;
else
dpi = (width_dpi + height_dpi) / 2.0;
} else {
/* Huh!? No screen? */
dpi = DPI_FALLBACK;
}
return dpi;
}
/*
* The font rendering details dialog
*/
static void
dpi_load (GConfClient *client,
GtkSpinButton *spinner)
{
GConfValue *value;
gdouble dpi;
value = gconf_client_get_without_default (client, FONT_DPI_KEY, NULL);
if (value) {
dpi = gconf_value_get_float (value);
gconf_value_free (value);
} else
dpi = get_dpi_from_x_server ();
if (dpi < DPI_LOW_REASONABLE_VALUE)
dpi = DPI_LOW_REASONABLE_VALUE;
in_change = TRUE;
gtk_spin_button_set_value (spinner, dpi);
in_change = FALSE;
}
static void
dpi_changed (GConfClient *client,
guint cnxn_id,
GConfEntry *entry,
gpointer user_data)
{
dpi_load (client, user_data);
}
static void
dpi_value_changed (GtkSpinButton *spinner,
GConfClient *client)
{
/* Like any time when using a spin button with GConf, there is
* a race condition here. When we change, we send the new
* value to GConf, then restore to the old value until
* we get a response to emulate the proper model/view behavior.
*
* If the user changes the value faster than responses are
* received from GConf, this may cause mildly strange effects.
*/
if (!in_change) {
gdouble new_dpi = gtk_spin_button_get_value (spinner);
gconf_client_set_float (client, FONT_DPI_KEY, new_dpi, NULL);
dpi_load (client, spinner);
}
}
static void
cb_details_response (GtkDialog *dialog, gint response_id)
{
if (response_id == GTK_RESPONSE_HELP) {
capplet_help (GTK_WINDOW (dialog),
"goscustdesk-38");
} else
gtk_widget_hide (GTK_WIDGET (dialog));
}
static void
cb_show_details (GtkWidget *button,
AppearanceData *data)
{
if (!data->font_details) {
GtkAdjustment *adjustment;
GtkWidget *widget;
EnumGroup *group;
data->font_details = appearance_capplet_get_widget (data, "render_details");
gtk_window_set_transient_for (GTK_WINDOW (data->font_details),
GTK_WINDOW (appearance_capplet_get_widget (data, "appearance_window")));
widget = appearance_capplet_get_widget (data, "dpi_spinner");
/* pick a sensible maximum dpi */
adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget));
adjustment->upper = DPI_HIGH_REASONABLE_VALUE;
adjustment->lower = DPI_LOW_REASONABLE_VALUE;
adjustment->step_increment = 1;
dpi_load (data->client, GTK_SPIN_BUTTON (widget));
g_signal_connect (widget, "value_changed",
G_CALLBACK (dpi_value_changed), data->client);
gconf_client_notify_add (data->client, FONT_DPI_KEY,
dpi_changed, widget, NULL, NULL);
setup_font_sample (appearance_capplet_get_widget (data, "antialias_none_sample"), ANTIALIAS_NONE, HINT_FULL);
setup_font_sample (appearance_capplet_get_widget (data, "antialias_grayscale_sample"), ANTIALIAS_GRAYSCALE, HINT_FULL);
setup_font_sample (appearance_capplet_get_widget (data, "antialias_subpixel_sample"), ANTIALIAS_RGBA, HINT_FULL);
group = enum_group_create (
FONT_ANTIALIASING_KEY, antialias_enums, ANTIALIAS_GRAYSCALE,
appearance_capplet_get_widget (data, "antialias_none_radio"), ANTIALIAS_NONE,
appearance_capplet_get_widget (data, "antialias_grayscale_radio"), ANTIALIAS_GRAYSCALE,
appearance_capplet_get_widget (data, "antialias_subpixel_radio"), ANTIALIAS_RGBA,
NULL);
data->font_groups = g_slist_prepend (data->font_groups, group);
setup_font_sample (appearance_capplet_get_widget (data, "hint_none_sample"), ANTIALIAS_GRAYSCALE, HINT_NONE);
setup_font_sample (appearance_capplet_get_widget (data, "hint_slight_sample"), ANTIALIAS_GRAYSCALE, HINT_SLIGHT);
setup_font_sample (appearance_capplet_get_widget (data, "hint_medium_sample"), ANTIALIAS_GRAYSCALE, HINT_MEDIUM);
setup_font_sample (appearance_capplet_get_widget (data, "hint_full_sample"), ANTIALIAS_GRAYSCALE, HINT_FULL);
group = enum_group_create (FONT_HINTING_KEY, hint_enums, HINT_FULL,
appearance_capplet_get_widget (data, "hint_none_radio"), HINT_NONE,
appearance_capplet_get_widget (data, "hint_slight_radio"), HINT_SLIGHT,
appearance_capplet_get_widget (data, "hint_medium_radio"), HINT_MEDIUM,
appearance_capplet_get_widget (data, "hint_full_radio"), HINT_FULL,
NULL);
data->font_groups = g_slist_prepend (data->font_groups, group);
gtk_image_set_from_file (GTK_IMAGE (appearance_capplet_get_widget (data, "subpixel_rgb_image")),
GNOMECC_PIXMAP_DIR "/subpixel-rgb.png");
gtk_image_set_from_file (GTK_IMAGE (appearance_capplet_get_widget (data, "subpixel_bgr_image")),
GNOMECC_PIXMAP_DIR "/subpixel-bgr.png");
gtk_image_set_from_file (GTK_IMAGE (appearance_capplet_get_widget (data, "subpixel_vrgb_image")),
GNOMECC_PIXMAP_DIR "/subpixel-vrgb.png");
gtk_image_set_from_file (GTK_IMAGE (appearance_capplet_get_widget (data, "subpixel_vbgr_image")),
GNOMECC_PIXMAP_DIR "/subpixel-vbgr.png");
group = enum_group_create (FONT_RGBA_ORDER_KEY, rgba_order_enums, RGBA_RGB,
appearance_capplet_get_widget (data, "subpixel_rgb_radio"), RGBA_RGB,
appearance_capplet_get_widget (data, "subpixel_bgr_radio"), RGBA_BGR,
appearance_capplet_get_widget (data, "subpixel_vrgb_radio"), RGBA_VRGB,
appearance_capplet_get_widget (data, "subpixel_vbgr_radio"), RGBA_VBGR,
NULL);
data->font_groups = g_slist_prepend (data->font_groups, group);
g_signal_connect (G_OBJECT (data->font_details),
"response",
G_CALLBACK (cb_details_response), NULL);
g_signal_connect (G_OBJECT (data->font_details),
"delete_event",
G_CALLBACK (gtk_true), NULL);
}
gtk_window_present (GTK_WINDOW (data->font_details));
}
#endif /* HAVE_XFT2 */
void
font_init (AppearanceData *data)
{
GObject *peditor;
GtkWidget *widget;
data->font_details = NULL;
data->font_groups = NULL;
gconf_client_add_dir (data->client, "/desktop/gnome/interface",
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
gconf_client_add_dir (data->client, "/apps/nautilus/preferences",
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
gconf_client_add_dir (data->client, METACITY_DIR,
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
#ifdef HAVE_XFT2
gconf_client_add_dir (data->client, FONT_RENDER_DIR,
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
#endif /* HAVE_XFT2 */
widget = appearance_capplet_get_widget (data, "application_font");
peditor = gconf_peditor_new_font (NULL, GTK_FONT_KEY,
widget,
"conv-from-widget-cb", application_font_to_gconf,
NULL);
g_signal_connect_swapped (peditor, "value-changed",
G_CALLBACK (application_font_changed),
widget);
application_font_changed (widget);
peditor = gconf_peditor_new_font (NULL, DOCUMENT_FONT_KEY,
appearance_capplet_get_widget (data, "document_font"),
NULL);
peditor = gconf_peditor_new_font (NULL, DESKTOP_FONT_KEY,
appearance_capplet_get_widget (data, "desktop_font"),
NULL);
peditor = gconf_peditor_new_font (NULL, WINDOW_TITLE_FONT_KEY,
appearance_capplet_get_widget (data, "window_title_font"),
NULL);
peditor = gconf_peditor_new_font (NULL, MONOSPACE_FONT_KEY,
appearance_capplet_get_widget (data, "monospace_font"),
NULL);
gconf_client_notify_add (data->client, WINDOW_TITLE_USES_SYSTEM_KEY,
metacity_changed,
data, NULL, NULL);
metacity_titlebar_load_sensitivity (data);
#ifdef HAVE_XFT2
setup_font_pair (appearance_capplet_get_widget (data, "monochrome_radio"),
appearance_capplet_get_widget (data, "monochrome_sample"),
ANTIALIAS_NONE, HINT_FULL);
setup_font_pair (appearance_capplet_get_widget (data, "best_shapes_radio"),
appearance_capplet_get_widget (data, "best_shapes_sample"),
ANTIALIAS_GRAYSCALE, HINT_MEDIUM);
setup_font_pair (appearance_capplet_get_widget (data, "best_contrast_radio"),
appearance_capplet_get_widget (data, "best_contrast_sample"),
ANTIALIAS_GRAYSCALE, HINT_FULL);
setup_font_pair (appearance_capplet_get_widget (data, "subpixel_radio"),
appearance_capplet_get_widget (data, "subpixel_sample"),
ANTIALIAS_RGBA, HINT_FULL);
font_render_load (data->client);
gconf_client_notify_add (data->client, FONT_RENDER_DIR,
font_render_changed,
data->client, NULL, NULL);
g_signal_connect (appearance_capplet_get_widget (data, "details_button"),
"clicked", G_CALLBACK (cb_show_details), data);
#else /* !HAVE_XFT2 */
gtk_widget_hide (appearance_capplet_get_widget (data, "font_render_frame"));
#endif /* HAVE_XFT2 */
}
void
font_shutdown (AppearanceData *data)
{
g_slist_foreach (data->font_groups, (GFunc) enum_group_destroy, NULL);
g_slist_free (data->font_groups);
g_slist_foreach (font_pairs, (GFunc) g_free, NULL);
g_slist_free (font_pairs);
g_free (old_font);
}

View File

@@ -1,4 +1,8 @@
/*
* Copyright (C) 2007 The GNOME Foundation
* Written by Jens Granseuer <jensgr@gmx.net>
* All Rights Reserved
*
* 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
@@ -12,16 +16,7 @@
* 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.
*
* (C) Copyright 2014 Red Hat, Inc.
*/
#ifndef _UI_HELPERS_H_
#define _UI_HELPERS_H_
#include <gtk/gtk.h>
void widget_set_error (GtkWidget *widget);
void widget_unset_error (GtkWidget *widget);
#endif /* _UI_HELPERS_H_ */
void font_init (AppearanceData *data);
void font_shutdown (AppearanceData *data);

View File

@@ -0,0 +1,215 @@
/*
* Copyright (C) 2007 The GNOME Foundation
* Written by Thomas Wood <thos@gnome.org>
* All Rights Reserved
*
* 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 <glib/gi18n.h>
#include "appearance.h"
#include "appearance-desktop.h"
#include "appearance-font.h"
#include "appearance-themes.h"
#include "appearance-style.h"
#include "theme-installer.h"
#include "theme-thumbnail.h"
#include "activate-settings-daemon.h"
#include "capplet-util.h"
static AppearanceData *
init_appearance_data (int *argc, char ***argv, GOptionContext *context)
{
AppearanceData *data = NULL;
gchar *uifile;
GtkBuilder *ui;
GError *err = NULL;
g_thread_init (NULL);
theme_thumbnail_factory_init (*argc, *argv);
capplet_init (context, argc, argv);
activate_settings_daemon ();
/* set up the data */
uifile = g_build_filename (GNOMECC_GTKBUILDER_DIR, "appearance.ui",
NULL);
ui = gtk_builder_new ();
gtk_builder_add_from_file (ui, uifile, &err);
g_free (uifile);
if (err)
{
g_warning (_("Could not load user interface file: %s"), err->message);
g_error_free (err);
g_object_unref (ui);
}
else
{
data = g_new (AppearanceData, 1);
data->client = gconf_client_get_default ();
data->ui = ui;
data->thumb_factory = gnome_desktop_thumbnail_factory_new (GNOME_DESKTOP_THUMBNAIL_SIZE_NORMAL);
}
return data;
}
static void
main_window_response (GtkWidget *widget,
gint response_id,
AppearanceData *data)
{
if (response_id == GTK_RESPONSE_CLOSE ||
response_id == GTK_RESPONSE_DELETE_EVENT)
{
gtk_main_quit ();
themes_shutdown (data);
style_shutdown (data);
desktop_shutdown (data);
font_shutdown (data);
g_object_unref (data->thumb_factory);
g_object_unref (data->client);
g_object_unref (data->ui);
}
else if (response_id == GTK_RESPONSE_HELP)
{
GtkNotebook *nb;
gint pindex;
nb = GTK_NOTEBOOK (appearance_capplet_get_widget (data, "main_notebook"));
pindex = gtk_notebook_get_current_page (nb);
switch (pindex)
{
case 0: /* theme */
capplet_help (GTK_WINDOW (widget), "goscustdesk-12");
break;
case 1: /* background */
capplet_help (GTK_WINDOW (widget), "goscustdesk-7");
break;
case 2: /* fonts */
capplet_help (GTK_WINDOW (widget), "goscustdesk-38");
break;
case 3: /* interface */
capplet_help (GTK_WINDOW (widget), "goscustuserinter-2");
break;
default:
capplet_help (GTK_WINDOW (widget), "prefs-look-and-feel");
break;
}
}
}
int
main (int argc, char **argv)
{
AppearanceData *data;
GtkWidget *w;
gchar *install_filename = NULL;
gchar *start_page = NULL;
gchar **wallpaper_files = NULL;
GOptionContext *option_context;
GOptionEntry option_entries[] = {
{ "install-theme",
'i',
G_OPTION_FLAG_IN_MAIN,
G_OPTION_ARG_FILENAME,
&install_filename,
N_("Specify the filename of a theme to install"),
N_("filename") },
{ "show-page",
'p',
G_OPTION_FLAG_IN_MAIN,
G_OPTION_ARG_STRING,
&start_page,
/* TRANSLATORS: don't translate the terms in brackets */
N_("Specify the name of the page to show (theme|background|fonts|interface)"),
N_("page") },
{ G_OPTION_REMAINING,
0,
G_OPTION_FLAG_IN_MAIN,
G_OPTION_ARG_FILENAME_ARRAY,
&wallpaper_files,
NULL,
N_("[WALLPAPER...]") },
{ NULL }
};
option_context = g_option_context_new (NULL);
g_option_context_add_main_entries (option_context, option_entries, GETTEXT_PACKAGE);
/* init */
data = init_appearance_data (&argc, &argv, option_context);
if (!data)
return 1;
/* init tabs */
themes_init (data);
style_init (data);
desktop_init (data, (const gchar **) wallpaper_files);
g_strfreev (wallpaper_files);
font_init (data);
/* prepare the main window */
w = appearance_capplet_get_widget (data, "appearance_window");
capplet_set_icon (w, "preferences-desktop-theme");
gtk_widget_show_all (w);
g_signal_connect_after (w, "response",
(GCallback) main_window_response, data);
/* default to background page if files were given on the command line */
if (wallpaper_files && !install_filename && !start_page)
start_page = g_strdup ("background");
if (start_page != NULL) {
gchar *page_name;
page_name = g_strconcat (start_page, "_vbox", NULL);
g_free (start_page);
w = appearance_capplet_get_widget (data, page_name);
if (w != NULL) {
GtkNotebook *nb;
gint pindex;
nb = GTK_NOTEBOOK (appearance_capplet_get_widget (data, "main_notebook"));
pindex = gtk_notebook_page_num (nb, w);
if (pindex != -1)
gtk_notebook_set_current_page (nb, pindex);
}
g_free (page_name);
}
if (install_filename != NULL) {
GFile *inst = g_file_new_for_commandline_arg (install_filename);
g_free (install_filename);
gnome_theme_install (inst, GTK_WINDOW (w));
g_object_unref (inst);
}
g_option_context_free (option_context);
/* start the mainloop */
gtk_main ();
/* free stuff */
g_free (data);
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,7 @@
/*
* Copyright (C) 2011 Red Hat, Inc
* Copyright (C) 2007 The GNOME Foundation
* Written by Thomas Wood <thos@gnome.org>
* All Rights Reserved
*
* 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
@@ -11,13 +13,10 @@
* 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/>.
*
* 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.
*/
#pragma once
char *pretty_hostname_to_static (const char *pretty,
gboolean for_display);
char *pretty_hostname_to_ssid (const char *pretty);
void style_init (AppearanceData *data);
void style_shutdown (AppearanceData *data);

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,22 @@
/*
* Copyright (C) 2007 The GNOME Foundation
* Written by Thomas Wood <thos@gnome.org>
* All Rights Reserved
*
* 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.
*/
void themes_init (AppearanceData *data);
void themes_shutdown (AppearanceData *data);

View File

@@ -0,0 +1,87 @@
/*
* Copyright (C) 2007 The GNOME Foundation
* Written by Thomas Wood <thos@gnome.org>
* All Rights Reserved
*
* 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 "config.h"
#include <glib.h>
#include <gtk/gtk.h>
#include <gconf/gconf-client.h>
#include <libgnomeui/gnome-desktop-thumbnail.h>
#include "gnome-theme-info.h"
#define APPEARANCE_KEY_DIR "/apps/control-center/appearance"
#define MORE_THEMES_URL_KEY APPEARANCE_KEY_DIR "/more_themes_url"
#define MORE_BACKGROUNDS_URL_KEY APPEARANCE_KEY_DIR "/more_backgrounds_url"
typedef struct
{
GConfClient *client;
GtkBuilder *ui;
GnomeDesktopThumbnailFactory *thumb_factory;
/* desktop */
GHashTable *wp_hash;
gboolean wp_update_gconf;
GtkIconView *wp_view;
GtkTreeModel *wp_model;
GtkWidget *wp_scpicker;
GtkWidget *wp_pcpicker;
GtkWidget *wp_style_menu;
GtkWidget *wp_color_menu;
GtkWidget *wp_rem_button;
GtkFileChooser *wp_filesel;
GtkWidget *wp_image;
GSList *wp_uris;
gint frame;
/* font */
GtkWidget *font_details;
GSList *font_groups;
/* themes */
GtkListStore *theme_store;
GnomeThemeMetaInfo *theme_custom;
GdkPixbuf *theme_icon;
GtkWidget *theme_save_dialog;
GtkWidget *theme_message_area;
GtkWidget *theme_message_label;
GtkWidget *apply_background_button;
GtkWidget *revert_font_button;
GtkWidget *apply_font_button;
GtkWidget *install_button;
GtkWidget *theme_info_icon;
GtkWidget *theme_error_icon;
gchar *revert_application_font;
gchar *revert_documents_font;
gchar *revert_desktop_font;
gchar *revert_windowtitle_font;
gchar *revert_monospace_font;
/* style */
GdkPixbuf *gtk_theme_icon;
GdkPixbuf *window_theme_icon;
GdkPixbuf *icon_theme_icon;
GtkWidget *style_message_area;
GtkWidget *style_message_label;
GtkWidget *style_install_button;
} AppearanceData;
#define appearance_capplet_get_widget(x, y) (GtkWidget *) gtk_builder_get_object (x->ui, y)

View File

@@ -0,0 +1,62 @@
gtkbuilderdir = $(pkgdatadir)/ui
dist_gtkbuilder_DATA = appearance.ui
pixmapdir = $(pkgdatadir)/pixmaps
dist_pixmap_DATA = \
subpixel-bgr.png \
subpixel-rgb.png \
subpixel-vbgr.png \
subpixel-vrgb.png \
theme-thumbnailing.png \
gtk-theme-thumbnailing.png \
window-theme-thumbnailing.png \
icon-theme-thumbnailing.png \
mouse-cursor-normal.png \
mouse-cursor-normal-large.png \
mouse-cursor-white.png \
mouse-cursor-white-large.png
cursorfontdir = $(datadir)/gnome/cursor-fonts
dist_cursorfont_DATA = \
cursor-large.pcf \
cursor-white.pcf \
cursor-large-white.pcf
@INTLTOOL_DESKTOP_RULE@
desktopdir = $(datadir)/applications
desktop_in_files = \
gnome-appearance-properties.desktop.in \
gnome-theme-installer.desktop.in
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
@INTLTOOL_XML_RULE@
xml_in_files = \
gnome-theme-package.xml.in
mimedir = $(datadir)/mime/packages
mime_DATA = $(xml_in_files:.xml.in=.xml)
install-data-hook:
if ENABLE_UPDATE_MIMEDB
$(UPDATE_MIME_DATABASE) "$(DESTDIR)$(datadir)/mime"
endif
uninstall-hook:
if ENABLE_UPDATE_MIMEDB
$(UPDATE_MIME_DATABASE) "$(DESTDIR)$(datadir)/mime"
endif
EXTRA_DIST = $(xml_in_files)
CLEANFILES = $(desktop_in_files) $(desktop_DATA) $(mime_DATA)
-include $(top_srcdir)/git.mk

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,14 @@
[Desktop Entry]
_Name=Appearance
_Comment=Customize the look of the desktop
Exec=gnome-appearance-properties %F
Icon=preferences-desktop-theme
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Settings;DesktopSettings;
OnlyShowIn=GNOME;
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gnome-control-center
X-GNOME-Bugzilla-Component=Appearance
X-GNOME-Bugzilla-Version=@VERSION@

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