├── .gitignore ├── .gitlab-ci.yml ├── .gitlab-ci └── install-meson-project.sh ├── .gitmodules ├── AUTHORS ├── COPYING ├── COPYING.LIB ├── ChangeLog ├── MAINTAINERS ├── NEWS ├── README ├── build-aux └── ci │ └── ci-helper.sh ├── data ├── gnome-settings-daemon.convert ├── gnome-settings-daemon │ └── gsd-enums.h ├── meson.build ├── org.gnome.settings-daemon.global-shortcuts.gschema.xml.in ├── org.gnome.settings-daemon.peripherals.gschema.xml.in ├── org.gnome.settings-daemon.peripherals.wacom.gschema.xml.in ├── org.gnome.settings-daemon.plugins.color.gschema.xml.in ├── org.gnome.settings-daemon.plugins.gschema.xml.in ├── org.gnome.settings-daemon.plugins.housekeeping.gschema.xml.in ├── org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in ├── org.gnome.settings-daemon.plugins.power.gschema.xml.in ├── org.gnome.settings-daemon.plugins.sharing.gschema.xml.in ├── org.gnome.settings-daemon.plugins.wwan.gschema.xml.in └── org.gnome.settings-daemon.plugins.xsettings.gschema.xml.in ├── gnome-settings-daemon.doap ├── gnome-settings-daemon ├── gnome-settings-bus.c ├── gnome-settings-bus.h ├── gnome-settings-module.c ├── gnome-settings-module.h ├── gnome-settings-plugin-info.c ├── gnome-settings-plugin-info.h ├── gnome-settings-profile.c ├── gnome-settings-profile.h ├── meson.build ├── org.gnome.Mutter.DisplayConfig.xml ├── org.gnome.ScreenSaver.xml ├── org.gnome.SessionManager.xml └── org.gnome.Shell.xml ├── meson.build ├── meson_options.txt ├── plugins ├── a11y-settings │ ├── gsd-a11y-settings-manager.c │ ├── gsd-a11y-settings-manager.h │ ├── main.c │ └── meson.build ├── color │ ├── gcm-self-test.c │ ├── gnome-datetime-source.c │ ├── gnome-datetime-source.h │ ├── gsd-color-calibrate.c │ ├── gsd-color-calibrate.h │ ├── gsd-color-manager.c │ ├── gsd-color-manager.h │ ├── gsd-color-state.c │ ├── gsd-color-state.h │ ├── gsd-night-light-common.c │ ├── gsd-night-light-common.h │ ├── gsd-night-light.c │ ├── gsd-night-light.h │ ├── main.c │ ├── meson.build │ └── test-data │ │ ├── LG-L225W-External.bin │ │ └── Lenovo-T61-Internal.bin ├── common │ ├── gsd-application.c │ ├── gsd-application.h │ ├── gsd-input-helper.c │ ├── gsd-input-helper.h │ ├── gsd-main-helper.c │ ├── gsd-main-helper.h │ ├── gsd-settings-migrate.c │ ├── gsd-settings-migrate.h │ ├── gsd-shell-helper.c │ ├── gsd-shell-helper.h │ ├── gsd.gresources.xml │ ├── gtk.css │ └── meson.build ├── datetime │ ├── backward │ ├── gsd-datetime-manager.c │ ├── gsd-datetime-manager.h │ ├── gsd-timezone-monitor.c │ ├── gsd-timezone-monitor.h │ ├── main.c │ ├── meson.build │ ├── timedated1-interface.xml │ ├── tz.c │ ├── tz.h │ ├── weather-tz.c │ └── weather-tz.h ├── gsd.service.in ├── gsd.target.in ├── housekeeping │ ├── gsd-disk-space-helper.c │ ├── gsd-disk-space-helper.h │ ├── gsd-disk-space-test.c │ ├── gsd-disk-space.c │ ├── gsd-disk-space.h │ ├── gsd-empty-trash-test.c │ ├── gsd-housekeeping-manager.c │ ├── gsd-housekeeping-manager.h │ ├── gsd-purge-temp-test.c │ ├── gsd-systemd-notify.c │ ├── gsd-systemd-notify.h │ ├── main.c │ └── meson.build ├── keyboard │ ├── .indent.pro │ ├── gsd-keyboard-manager.c │ ├── gsd-keyboard-manager.h │ ├── main.c │ └── meson.build ├── media-keys │ ├── audio-selection-test.c │ ├── bus-watch-namespace.c │ ├── bus-watch-namespace.h │ ├── gsd-marshal.list │ ├── gsd-media-keys-manager.c │ ├── gsd-media-keys-manager.h │ ├── main.c │ ├── media-keys.h │ ├── meson.build │ ├── mpris-controller.c │ ├── mpris-controller.h │ ├── org.gnome.ShellKeyGrabber.xml │ ├── shell-action-modes.h │ └── shortcuts-list.h ├── meson-add-wants.sh ├── meson.build ├── org.gnome.SettingsDaemon.Dummy.desktop.in ├── org.gnome.SettingsDaemon.Real.desktop.in ├── power │ ├── dbusmock-templates │ │ └── mutter.py │ ├── gpm-common.c │ ├── gpm-common.h │ ├── gsd-backlight.c │ ├── gsd-backlight.h │ ├── gsd-power-constants-update.pl │ ├── gsd-power-constants.h │ ├── gsd-power-enums-update.c │ ├── gsd-power-enums.c.in │ ├── gsd-power-enums.h.in │ ├── gsd-power-manager.c │ ├── gsd-power-manager.h │ ├── gsdpowerconstants.py │ ├── gsm-inhibitor-flag.h │ ├── gsm-manager-logout-mode.h │ ├── gsm-presence-flag.h │ ├── main.c │ ├── meson.build │ └── test.py ├── print-notifications │ ├── gsd-print-notifications-manager.c │ ├── gsd-print-notifications-manager.h │ ├── gsd-printer.c │ ├── main.c │ └── meson.build ├── rfkill │ ├── 61-gnome-settings-daemon-rfkill.rules │ ├── gsd-rfkill-manager.c │ ├── gsd-rfkill-manager.h │ ├── main.c │ ├── meson.build │ ├── rfkill-glib.c │ ├── rfkill-glib.h │ └── rfkill.h ├── screensaver-proxy │ ├── gsd-screensaver-proxy-manager.c │ ├── gsd-screensaver-proxy-manager.h │ ├── main.c │ └── meson.build ├── sharing │ ├── gsd-sharing-enums.h │ ├── gsd-sharing-manager.c │ ├── gsd-sharing-manager.h │ ├── main.c │ └── meson.build ├── smartcard │ ├── gsd-smartcard-enum-types.c.in │ ├── gsd-smartcard-enum-types.h.in │ ├── gsd-smartcard-manager.c │ ├── gsd-smartcard-manager.h │ ├── gsd-smartcard-service.c │ ├── gsd-smartcard-service.h │ ├── gsd-smartcard-utils.c │ ├── gsd-smartcard-utils.h │ ├── main.c │ ├── meson.build │ └── org.gnome.SettingsDaemon.Smartcard.xml ├── sound │ ├── gsd-sound-manager.c │ ├── gsd-sound-manager.h │ ├── main.c │ └── meson.build ├── usb-protection │ ├── gsd-usb-protection-manager.c │ ├── gsd-usb-protection-manager.h │ ├── main.c │ └── meson.build ├── wacom │ ├── gsd-wacom-manager.c │ ├── gsd-wacom-manager.h │ ├── gsd-wacom-oled-constants.h │ ├── gsd-wacom-oled-helper.c │ ├── gsd-wacom-oled.c │ ├── gsd-wacom-oled.h │ ├── main.c │ ├── meson.build │ └── org.gnome.settings-daemon.plugins.wacom.policy.in.in ├── wwan │ ├── cc-wwan-device.c │ ├── cc-wwan-device.h │ ├── cc-wwan-errors-private.h │ ├── gsd-wwan-manager.c │ ├── gsd-wwan-manager.h │ ├── main.c │ └── meson.build └── xsettings │ ├── 00-xrdb │ ├── README.xsettings │ ├── fc-monitor.c │ ├── fc-monitor.h │ ├── fontconfig-test │ └── fonts.conf │ ├── gsd-remote-display-manager.h │ ├── gsd-xsettings-gtk.c │ ├── gsd-xsettings-gtk.h │ ├── gsd-xsettings-manager.c │ ├── gsd-xsettings-manager.h │ ├── gtk-modules-test │ ├── canberra-gtk-module.desktop │ └── pk-gtk-module.desktop │ ├── main.c │ ├── meson.build │ ├── test-gtk-modules.c │ ├── test-wm-button-layout-translations.c │ ├── test.py │ ├── wm-button-layout-translation.c │ ├── wm-button-layout-translation.h │ ├── xsettings-common.c │ ├── xsettings-common.h │ ├── xsettings-manager.c │ └── xsettings-manager.h ├── po ├── ChangeLog ├── LINGUAS ├── POTFILES.in ├── POTFILES.skip ├── ab.po ├── af.po ├── am.po ├── ar.po ├── as.po ├── ast.po ├── az.po ├── be.po ├── be@latin.po ├── bg.po ├── bn.po ├── bn_IN.po ├── br.po ├── bs.po ├── ca.po ├── ca@valencia.po ├── ckb.po ├── crh.po ├── cs.po ├── cy.po ├── da.po ├── de.po ├── dz.po ├── el.po ├── en@shaw.po ├── en_CA.po ├── en_GB.po ├── eo.po ├── es.po ├── et.po ├── eu.po ├── fa.po ├── fi.po ├── fr.po ├── fur.po ├── ga.po ├── gd.po ├── gl.po ├── gu.po ├── he.po ├── hi.po ├── hr.po ├── hu.po ├── id.po ├── is.po ├── it.po ├── ja.po ├── ka.po ├── kab.po ├── kk.po ├── km.po ├── kn.po ├── ko.po ├── ku.po ├── lt.po ├── lv.po ├── mai.po ├── meson.build ├── mg.po ├── mk.po ├── ml.po ├── mn.po ├── mr.po ├── ms.po ├── nb.po ├── nds.po ├── ne.po ├── nl.po ├── nn.po ├── nso.po ├── oc.po ├── or.po ├── pa.po ├── pl.po ├── pt.po ├── pt_BR.po ├── ro.po ├── ru.po ├── rw.po ├── si.po ├── sk.po ├── sl.po ├── sq.po ├── sr.po ├── sr@latin.po ├── sv.po ├── ta.po ├── te.po ├── tg.po ├── th.po ├── tr.po ├── ug.po ├── uk.po ├── uz.po ├── vi.po ├── wa.po ├── xh.po ├── zh_CN.po ├── zh_HK.po ├── zh_TW.po └── zu.po └── tests ├── dummy.session ├── dummyapp.desktop ├── get-display-name.sh ├── gsdtestcase.py └── output_checker.py /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | -------------------------------------------------------------------------------- /.gitlab-ci/install-meson-project.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | usage() { 6 | cat <<-EOF 7 | Usage: $(basename $0) [OPTION…] REPO_URL COMMIT 8 | 9 | Check out and install a meson project 10 | 11 | Options: 12 | -Dkey=val Option to pass on to meson 13 | --subdir Build subdirectory instead of whole project 14 | --prepare Script to run before build 15 | --libdir Setup the project with a different libdir 16 | --destdir Install the project to an additional destdir 17 | 18 | -h, --help Display this help 19 | 20 | EOF 21 | } 22 | 23 | TEMP=$(getopt \ 24 | --name=$(basename $0) \ 25 | --options='D:h' \ 26 | --longoptions='subdir:' \ 27 | --longoptions='prepare:' \ 28 | --longoptions='libdir:' \ 29 | --longoptions='destdir:' \ 30 | --longoptions='help' \ 31 | -- "$@") 32 | 33 | eval set -- "$TEMP" 34 | unset TEMP 35 | 36 | MESON_OPTIONS=() 37 | SUBDIR=. 38 | PREPARE=: 39 | DESTDIR="" 40 | 41 | while true; do 42 | case "$1" in 43 | -D) 44 | MESON_OPTIONS+=( -D$2 ) 45 | shift 2 46 | ;; 47 | 48 | --subdir) 49 | SUBDIR=$2 50 | shift 2 51 | ;; 52 | 53 | --prepare) 54 | PREPARE=$2 55 | shift 2 56 | ;; 57 | 58 | --libdir) 59 | MESON_OPTIONS+=( --libdir=$2 ) 60 | shift 2 61 | ;; 62 | 63 | --destdir) 64 | DESTDIR=$2 65 | shift 2 66 | ;; 67 | 68 | -h|--help) 69 | usage 70 | exit 0 71 | ;; 72 | 73 | --) 74 | shift 75 | break 76 | ;; 77 | esac 78 | done 79 | 80 | if [[ $# -lt 2 ]]; then 81 | usage 82 | exit 1 83 | fi 84 | 85 | REPO_URL="$1" 86 | COMMIT="$2" 87 | 88 | CHECKOUT_DIR=$(mktemp --directory) 89 | trap "rm -rf $CHECKOUT_DIR" EXIT 90 | 91 | git clone --depth 1 "$REPO_URL" -b "$COMMIT" "$CHECKOUT_DIR" 92 | 93 | pushd "$CHECKOUT_DIR/$SUBDIR" 94 | sh -c "$PREPARE" 95 | meson setup --prefix=/usr _build "${MESON_OPTIONS[@]}" 96 | 97 | # Install it to an additional directory e.g., system extension directory 98 | if [ -n "${DESTDIR}" ]; then 99 | sudo meson install -C _build --destdir=$DESTDIR 100 | fi 101 | 102 | sudo meson install -C _build 103 | popd 104 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "subprojects/gvc"] 2 | path = subprojects/gvc 3 | url = https://gitlab.gnome.org/GNOME/libgnome-volume-control.git 4 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Jonathan Blandford 2 | William Jon McCann 3 | -------------------------------------------------------------------------------- /MAINTAINERS: -------------------------------------------------------------------------------- 1 | See gnome-settings-daemon.doap 2 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Introduction to GNOME Settings Daemon 2 | =============================================================================== 3 | 4 | The GNOME Settings Daemon is responsible for setting various parameters of a 5 | GNOME Session and the applications that run under it. 6 | 7 | This package is known to build and work properly using an LFS-9.0 platform. 8 | 9 | 10 | Dependencies 11 | ------------------------------------------------------------------------------- 12 | 13 | Required: 14 | 15 | * colord-1.4.4 (http://www.linuxfromscratch.org/blfs/view/systemd/general/colord.html) 16 | * Fontconfig-2.13.1 (http://www.linuxfromscratch.org/blfs/view/systemd/general/fontconfig.html) 17 | * GeoClue-2.5.3 (http://www.linuxfromscratch.org/blfs/view/systemd/basicnet/geoclue2.html) 18 | * geocode-glib-3.26.1 (http://www.linuxfromscratch.org/blfs/view/systemd/gnome/geocode-glib.html) 19 | * gnome-desktop-3.32.2 (http://www.linuxfromscratch.org/blfs/view/systemd/gnome/gnome-desktop.html) 20 | * Little CMS-2.9 (http://www.linuxfromscratch.org/blfs/view/systemd/general/lcms2.html) 21 | * libcanberra-0.30 (http://www.linuxfromscratch.org/blfs/view/systemd/multimedia/libcanberra.html) 22 | * libgweather-3.32.2 (http://www.linuxfromscratch.org/blfs/view/systemd/gnome/libgweather.html) 23 | * libnotify-0.7.8 (http://www.linuxfromscratch.org/blfs/view/systemd/x/libnotify.html) 24 | * librsvg-2.44.14 (http://www.linuxfromscratch.org/blfs/view/systemd/general/librsvg.html) 25 | * libwacom-0.29 (http://www.linuxfromscratch.org/blfs/view/systemd/general/libwacom.html) 26 | * PulseAudio-12.2 (http://www.linuxfromscratch.org/blfs/view/systemd/multimedia/pulseaudio.html) 27 | * Systemd-241 (http://www.linuxfromscratch.org/blfs/view/systemd/general/systemd.html) 28 | * UPower-0.99.10 (http://www.linuxfromscratch.org/blfs/view/systemd/general/upower.html) 29 | * Xorg Wacom Driver-0.37.0 (http://www.linuxfromscratch.org/blfs/view/systemd/x/x7driver.html#xorg-wacom-driver) 30 | 31 | Recommended: 32 | 33 | * ALSA-1.1.9 (http://www.linuxfromscratch.org/blfs/view/systemd/multimedia/alsa.html) 34 | * Cups-2.2.12 (http://www.linuxfromscratch.org/blfs/view/systemd/pst/cups.html) 35 | * NetworkManager-1.20.0 (http://www.linuxfromscratch.org/blfs/view/systemd/basicnet/networkmanager.html) 36 | * NSS-3.45 (http://www.linuxfromscratch.org/blfs/view/systemd/postlfs/nss.html) 37 | * Wayland-1.17.0 (http://www.linuxfromscratch.org/blfs/view/systemd/general/wayland.html) 38 | 39 | Optional 40 | 41 | * python-dbusmock (https://github.com/martinpitt/python-dbusmock) 42 | * umockdev (https://github.com/martinpitt/umockdev) 43 | 44 | 45 | Build 46 | ------------------------------------------------------------------------------- 47 | 48 | Install GNOME Settings Daemon by running the following commands: 49 | 50 | ```bash 51 | mkdir build && 52 | cd build && 53 | 54 | meson --prefix=/usr --sysconfdir=/etc .. && 55 | ninja 56 | ``` 57 | 58 | To check the results, execute: `ninja test`. Note that you must have 59 | python-dbusmock installed in order for the tests to complete successfully. Some 60 | tests in the "power" testsuite may fail depending on the init system in use. 61 | 62 | Now, as the root user: 63 | ```bash 64 | ninja install 65 | ``` 66 | -------------------------------------------------------------------------------- /build-aux/ci/ci-helper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | function do_print_labels(){ 4 | 5 | if [[ -n "${1}" ]]; then 6 | label_len=${#1} 7 | span=$(((54 - $label_len) / 2)) 8 | 9 | echo 10 | echo "= ======================================================== =" 11 | printf "%s %${span}s %s %${span}s %s\n" "=" "" "$1" "" "=" 12 | echo "= ======================================================== =" 13 | else 14 | echo "= ========================= Done ========================= =" 15 | echo 16 | fi 17 | } 18 | 19 | function do_show_info(){ 20 | 21 | local compiler=gcc 22 | 23 | echo -n "Processors: "; grep -c ^processor /proc/cpuinfo 24 | grep ^MemTotal /proc/meminfo 25 | id; uname -a 26 | printenv 27 | echo '-----------------------------------------' 28 | cat /etc/*-release 29 | echo '-----------------------------------------' 30 | 31 | if [[ ! -z $CC ]]; then 32 | compiler=$CC 33 | fi 34 | echo 'Compiler version' 35 | $compiler --version 36 | echo '-----------------------------------------' 37 | $compiler -dM -E -x c /dev/null 38 | echo '-----------------------------------------' 39 | } 40 | 41 | function do_check_warnings(){ 42 | 43 | cat compilation.log | grep "warning:" | awk '{total+=1}END{print "Total number of warnings: "total}' 44 | } 45 | 46 | # ----------- ----------- 47 | if [[ $1 == "INFO" ]]; then 48 | do_print_labels 'Build environment ' 49 | do_show_info 50 | do_print_labels 51 | 52 | elif [[ $1 == "GIT_INFO" ]]; then 53 | do_print_labels 'Commit' 54 | git log --pretty=format:"%h %cd %s" -1; echo 55 | do_print_labels 56 | 57 | elif [[ $1 == "WARNINGS" ]]; then 58 | do_print_labels 'Warning Report ' 59 | do_check_warnings 60 | do_print_labels 61 | fi -------------------------------------------------------------------------------- /data/gnome-settings-daemon.convert: -------------------------------------------------------------------------------- 1 | [org.gnome.settings-daemon.peripherals.smartcard] 2 | removal-action = /desktop/gnome/peripherals/smartcard/removal_action 3 | 4 | [org.gnome.settings-daemon.plugins.housekeeping] 5 | free-percent-notify = /apps/gnome_settings_daemon/plugins/housekeeping/free_percent_notify 6 | free-percent-notify-again = /apps/gnome_settings_daemon/plugins/housekeeping/free_percent_notify_again 7 | free-size-gb-no-notify = /apps/gnome_settings_daemon/plugins/housekeeping/free_size_gb_no_notify 8 | ignore-paths = /apps/gnome_settings_daemon/plugins/housekeeping/ignore_paths 9 | min-notify-period = /apps/gnome_settings_daemon/plugins/housekeeping/min_notify_period 10 | 11 | [org.gnome.settings-daemon.plugins.media-keys] 12 | calculator = /apps/gnome_settings_daemon/keybindings/calculator 13 | email = /apps/gnome_settings_daemon/keybindings/email 14 | eject = /apps/gnome_settings_daemon/keybindings/eject 15 | help = /apps/gnome_settings_daemon/keybindings/help 16 | home = /apps/gnome_settings_daemon/keybindings/home 17 | logout = /apps/gnome_settings_daemon/keybindings/power 18 | media = /apps/gnome_settings_daemon/keybindings/media 19 | next = /apps/gnome_settings_daemon/keybindings/next 20 | pause = /apps/gnome_settings_daemon/keybindings/pause 21 | play = /apps/gnome_settings_daemon/keybindings/play 22 | previous = /apps/gnome_settings_daemon/keybindings/previous 23 | screensaver = /apps/gnome_settings_daemon/keybindings/screensaver 24 | search = /apps/gnome_settings_daemon/keybindings/search 25 | stop = /apps/gnome_settings_daemon/keybindings/stop 26 | touchpad = /apps/gnome_settings_daemon/keybindings/touchpad 27 | volume-down = /apps/gnome_settings_daemon/keybindings/volume_down 28 | volume-mute = /apps/gnome_settings_daemon/keybindings/volume_mute 29 | volume-up = /apps/gnome_settings_daemon/keybindings/volume_up 30 | www = /apps/gnome_settings_daemon/keybindings/www 31 | 32 | [org.gnome.settings-daemon.peripherals.mouse] 33 | double-click = /desktop/gnome/peripherals/mouse/double_click 34 | drag-threshold = /desktop/gnome/peripherals/mouse/drag_threshold 35 | 36 | [org.gnome.settings-daemon.plugins.xsettings] 37 | antialiasing = /desktop/gnome/font_rendering/antialiasing 38 | hinting = /desktop/gnome/font_rendering/hinting 39 | rgba-order = /desktop/gnome/font_rendering/rgba_order 40 | -------------------------------------------------------------------------------- /data/gnome-settings-daemon/gsd-enums.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010 Bastien Nocera 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | * 19 | * Authors: 20 | * Bastien Nocera 21 | */ 22 | 23 | #ifndef __gsd_enums_h__ 24 | #define __gsd_enums_h__ 25 | 26 | typedef enum 27 | { 28 | GSD_FONT_ANTIALIASING_MODE_NONE, 29 | GSD_FONT_ANTIALIASING_MODE_GRAYSCALE, 30 | GSD_FONT_ANTIALIASING_MODE_RGBA 31 | } GsdFontAntialiasingMode; 32 | 33 | typedef enum 34 | { 35 | GSD_FONT_HINTING_NONE, 36 | GSD_FONT_HINTING_SLIGHT, 37 | GSD_FONT_HINTING_MEDIUM, 38 | GSD_FONT_HINTING_FULL 39 | } GsdFontHinting; 40 | 41 | typedef enum 42 | { 43 | GSD_FONT_RGBA_ORDER_RGBA, 44 | GSD_FONT_RGBA_ORDER_RGB, 45 | GSD_FONT_RGBA_ORDER_BGR, 46 | GSD_FONT_RGBA_ORDER_VRGB, 47 | GSD_FONT_RGBA_ORDER_VBGR 48 | } GsdFontRgbaOrder; 49 | 50 | typedef enum 51 | { 52 | GSD_SMARTCARD_REMOVAL_ACTION_NONE, 53 | GSD_SMARTCARD_REMOVAL_ACTION_LOCK_SCREEN, 54 | GSD_SMARTCARD_REMOVAL_ACTION_FORCE_LOGOUT 55 | } GsdSmartcardRemovalAction; 56 | 57 | typedef enum 58 | { 59 | GSD_TOUCHPAD_SCROLL_METHOD_DISABLED, 60 | GSD_TOUCHPAD_SCROLL_METHOD_EDGE_SCROLLING, 61 | GSD_TOUCHPAD_SCROLL_METHOD_TWO_FINGER_SCROLLING 62 | } GsdTouchpadScrollMethod; 63 | 64 | typedef enum 65 | { 66 | GSD_BELL_MODE_ON, 67 | GSD_BELL_MODE_OFF, 68 | GSD_BELL_MODE_CUSTOM 69 | } GsdBellMode; 70 | 71 | typedef enum 72 | { 73 | GSD_TOUCHPAD_HANDEDNESS_RIGHT, 74 | GSD_TOUCHPAD_HANDEDNESS_LEFT, 75 | GSD_TOUCHPAD_HANDEDNESS_MOUSE 76 | } GsdTouchpadHandedness; 77 | 78 | typedef enum 79 | { 80 | GSD_WACOM_ROTATION_NONE, 81 | GSD_WACOM_ROTATION_CW, 82 | GSD_WACOM_ROTATION_CCW, 83 | GSD_WACOM_ROTATION_HALF 84 | } GsdWacomRotation; 85 | 86 | typedef enum 87 | { 88 | GSD_WACOM_ACTION_TYPE_NONE, 89 | GSD_WACOM_ACTION_TYPE_CUSTOM, 90 | GSD_WACOM_ACTION_TYPE_SWITCH_MONITOR, 91 | GSD_WACOM_ACTION_TYPE_HELP 92 | } GsdWacomActionType; 93 | 94 | typedef enum 95 | { 96 | GSD_POWER_ACTION_BLANK, 97 | GSD_POWER_ACTION_SUSPEND, 98 | GSD_POWER_ACTION_SHUTDOWN, 99 | GSD_POWER_ACTION_HIBERNATE, 100 | GSD_POWER_ACTION_INTERACTIVE, 101 | GSD_POWER_ACTION_NOTHING, 102 | GSD_POWER_ACTION_LOGOUT 103 | } GsdPowerActionType; 104 | 105 | typedef enum 106 | { 107 | GSD_POWER_BUTTON_ACTION_NOTHING, 108 | GSD_POWER_BUTTON_ACTION_SUSPEND, 109 | GSD_POWER_BUTTON_ACTION_HIBERNATE, 110 | GSD_POWER_BUTTON_ACTION_INTERACTIVE 111 | } GsdPowerButtonActionType; 112 | 113 | typedef enum 114 | { 115 | GSD_UPDATE_TYPE_ALL, 116 | GSD_UPDATE_TYPE_SECURITY, 117 | GSD_UPDATE_TYPE_NONE 118 | } GsdUpdateType; 119 | 120 | typedef enum 121 | { 122 | GSD_NUM_LOCK_STATE_UNKNOWN, 123 | GSD_NUM_LOCK_STATE_ON, 124 | GSD_NUM_LOCK_STATE_OFF 125 | } GsdNumLockState; 126 | 127 | #endif /* __gsd_enums_h__ */ 128 | -------------------------------------------------------------------------------- /data/meson.build: -------------------------------------------------------------------------------- 1 | schemas = [ 2 | 'org.gnome.settings-daemon.global-shortcuts.gschema.xml', 3 | 'org.gnome.settings-daemon.peripherals.gschema.xml', 4 | 'org.gnome.settings-daemon.peripherals.wacom.gschema.xml', 5 | 'org.gnome.settings-daemon.plugins.gschema.xml', 6 | 'org.gnome.settings-daemon.plugins.color.gschema.xml', 7 | 'org.gnome.settings-daemon.plugins.housekeeping.gschema.xml', 8 | 'org.gnome.settings-daemon.plugins.media-keys.gschema.xml', 9 | 'org.gnome.settings-daemon.plugins.power.gschema.xml', 10 | 'org.gnome.settings-daemon.plugins.sharing.gschema.xml', 11 | 'org.gnome.settings-daemon.plugins.xsettings.gschema.xml' 12 | ] 13 | 14 | if enable_wwan 15 | schemas += 'org.gnome.settings-daemon.plugins.wwan.gschema.xml' 16 | endif 17 | 18 | schema_conf = configuration_data() 19 | schema_conf.set('GETTEXT_PACKAGE', meson.project_name()) 20 | 21 | schemas_xml = [] 22 | foreach schema: schemas 23 | schemas_xml += [configure_file( 24 | input: schema + '.in', 25 | output: schema, 26 | configuration: schema_conf, 27 | install_dir: gsd_schemadir 28 | )] 29 | endforeach 30 | 31 | enums_header = files('gnome-settings-daemon' / 'gsd-enums.h') 32 | 33 | mkenums = gnome.mkenums( 34 | 'org.gnome.settings-daemon.enums.xml', 35 | sources: enums_header, 36 | comments: '', 37 | fhead: '', 38 | vhead: ' <@type@ id="org.gnome.settings-daemon.@EnumName@">', 39 | vprod: ' ', 40 | vtail: ' ', 41 | ftail: '', 42 | install_header: true, 43 | install_dir: gsd_schemadir 44 | ) 45 | 46 | install_data( 47 | enums_header, 48 | install_dir: join_paths(gsd_pkgincludedir, meson.project_name()) 49 | ) 50 | 51 | install_data( 52 | 'gnome-settings-daemon.convert', 53 | install_dir: join_paths(gsd_datadir, 'GConf', 'gsettings') 54 | ) 55 | 56 | pkg.generate( 57 | version: gsd_version, 58 | name: meson.project_name(), 59 | description: meson.project_name() + ' specific enumerations', 60 | filebase: meson.project_name(), 61 | subdirs: gsd_api_name 62 | ) 63 | 64 | gsd_enums_dep = declare_dependency( 65 | include_directories: include_directories('.') 66 | ) 67 | 68 | meson.override_dependency(meson.project_name(), gsd_enums_dep) 69 | 70 | # for unit tests - gnome.compile_schemas() only looks in srcdir 71 | custom_target('compile-schemas', 72 | input: schemas_xml, 73 | depends: mkenums, 74 | output: 'gschemas.compiled', 75 | command: [find_program('glib-compile-schemas'), meson.current_build_dir()], 76 | build_by_default: true) 77 | -------------------------------------------------------------------------------- /data/org.gnome.settings-daemon.global-shortcuts.gschema.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | [] 6 | Applications 7 | Applications that have defined global shortcuts 8 | 9 | 10 | 11 | 12 | [] 13 | Shortcuts 14 | Keyboard shortcut definitions 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /data/org.gnome.settings-daemon.plugins.color.gschema.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 0 6 | The duration a display profile is valid 7 | This is the number of days after which the display color profile is considered invalid. 8 | 9 | 10 | 0 11 | The duration a printer profile is valid 12 | This is the number of days after which the printer color profile is considered invalid. 13 | 14 | 15 | false 16 | If the night light mode is enabled 17 | Night light mode changes the color temperature of your display when the sun has gone down or at preset times. 18 | 19 | 20 | 2700 21 | Temperature of the display when enabled 22 | This temperature in Kelvin is used to modify the screen tones when night light mode is enabled. Higher values are bluer, lower redder. 23 | 24 | 25 | true 26 | Use the sunrise and sunset 27 | Calculate the sunrise and sunset times automatically, from the current location. 28 | 29 | 30 | 20.00 31 | The start time 32 | When “night-light-schedule-automatic” is disabled, use this start time in hours from midnight. 33 | 34 | 35 | 6.00 36 | The end time 37 | When “night-light-schedule-automatic” is disabled, use this end time in hours from midnight. 38 | 39 | 40 | (91,181) 41 | The last detected position 42 | When location services are available this represents the last detected location. The default value is an invalid value to ensure it is always updated at startup. 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /data/org.gnome.settings-daemon.plugins.gschema.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ['all'] 6 | List of plugins that are allowed to be loaded 7 | 8 | A list of strings representing the plugins that are allowed to be loaded (default: “all”). 9 | This is only evaluated on startup. 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /data/org.gnome.settings-daemon.plugins.housekeeping.gschema.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | [] 6 | Mount paths to ignore 7 | Specify a list of mount paths to ignore when they run low on space. 8 | 9 | 10 | 0.05 11 | 12 | Free percentage notify threshold 13 | Percentage free space threshold for initial warning of low disk space. If the percentage free space drops below this, a warning will be shown. 14 | 15 | 16 | 0.01 17 | 18 | Subsequent free space percentage notify threshold 19 | Specify the percentage that the free disk space should reduce by before issuing a subsequent warning. 20 | 21 | 22 | 1 23 | Free space notify threshold 24 | Specify an amount in GB. If the amount of free space is more than this, no warning will be shown. 25 | 26 | 27 | 10 28 | Minimum notify period for repeated warnings 29 | Specify a time in minutes. Subsequent warnings for a volume will not appear more often than this period. 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /data/org.gnome.settings-daemon.plugins.power.gschema.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 30 6 | The brightness of the screen when idle 7 | This is the laptop panel screen brightness used when the session is idle. 8 | 9 | 10 | true 11 | Dim the screen after a period of inactivity 12 | If the screen should be dimmed to save power when the computer is idle. 13 | 14 | 15 | 900 16 | Sleep timeout computer when on AC 17 | The amount of time in seconds the computer on AC power needs to be inactive before it goes to sleep. A value of 0 means never. 18 | 19 | 20 | 'suspend' 21 | Whether to hibernate, suspend or do nothing when inactive 22 | The type of sleeping that should be performed when the computer is inactive. 23 | 24 | 25 | 900 26 | Sleep timeout computer when on battery 27 | The amount of time in seconds the computer on battery power needs to be inactive before it goes to sleep. A value of 0 means never. 28 | 29 | 30 | 'suspend' 31 | Whether to hibernate, suspend or do nothing when inactive 32 | The type of sleeping that should be performed when the computer is inactive. 33 | 34 | 35 | true 36 | Enable the ALS sensor 37 | If the ambient light sensor functionality is enabled. 38 | 39 | 40 | 'suspend' 41 | Power button action 42 | The action to take when the system power button is pressed. Virtual machines only honor the 'nothing' action, and will shutdown otherwise. Tablets always suspend, ignoring all the other action options. 43 | 44 | 45 | true 46 | Enable power-saver profile when battery is low 47 | Automatically enable the "power-saver" profile using power-profiles-daemon if the battery is low. 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /data/org.gnome.settings-daemon.plugins.sharing.gschema.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | [] 6 | On which connections the service is enabled 7 | The list of NetworkManager connections (each one represented with its UUID) on which this service is enabled and started. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /data/org.gnome.settings-daemon.plugins.wwan.gschema.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | false 6 | Unlock sim cards 7 | Unlock any sim cards right away. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /data/org.gnome.settings-daemon.plugins.xsettings.gschema.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | [] 6 | List of explicitly disabled GTK+ modules 7 | A list of strings representing the GTK+ modules that will not be loaded, even if enabled by default in their configuration. 8 | 9 | 10 | [] 11 | List of explicitly enabled GTK+ modules 12 | A list of strings representing the GTK+ modules that will be loaded, usually in addition to conditional and forcibly disabled ones. 13 | 14 | 15 | {} 16 | A dictionary of XSETTINGS to override 17 | This dictionary maps XSETTINGS names to overrides values. The values must be either strings, signed int32s or (in the case of colors), 4-tuples of uint16 (red, green, blue, alpha; 65535 is fully opaque). 18 | 19 | 20 | 21 | 22 | 'grayscale' 23 | Antialiasing 24 | The type of antialiasing to use when rendering fonts. Possible values are: “none” for no antialiasing, “grayscale” for standard grayscale antialiasing, and “rgba” for subpixel antialiasing (LCD screens only). 25 | 26 | 27 | 'slight' 28 | Hinting 29 | The type of hinting to use when rendering fonts. Possible values are: “none” for no hinting and “slight” for fitting only to the Y-axis like Microsoft’s ClearType, DirectWrite and Adobe’s proprietary font rendering engine. Ignores native hinting within the font, generates hints algorithmically. Used on Ubuntu by default. Recommended. The meaning of “medium” and “full” depends on the font format (.ttf, .otf, .pfa/.pfb) and the installed version of FreeType. They usually try to fit glyphs to both the X and the Y axis (except for .otf: Y-only). This can lead to distortion and/or inconsistent rendering depending on the quality of the font, the font format and the state of FreeType’s font engines. 30 | 31 | 32 | 'rgb' 33 | RGBA order 34 | The order of subpixel elements on an LCD screen; only used when antialiasing is set to “rgba”. Possible values are: “rgb” for red on left (most common), “bgr” for blue on left, “vrgb” for red on top, “vbgr” for red on bottom. 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /gnome-settings-daemon.doap: -------------------------------------------------------------------------------- 1 | 6 | 7 | gnome-settings-daemon 8 | GNOME Settings Daemon 9 | The GNOME Settings Daemon is responsible for setting various parameters of a 10 | GNOME Session and the applications that run under it. 11 | 12 | 13 | 14 | 15 | 16 | 17 | C 18 | 19 | 20 | 21 | Carlos Garnacho 22 | 23 | carlosg 24 | 25 | 26 | 27 | 28 | Benjamin Berg 29 | 30 | bberg 31 | 32 | 33 | 34 | 35 | Bastien Nocera 36 | 37 | hadess 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /gnome-settings-daemon/gnome-settings-bus.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2010-2011 Richard Hughes 4 | * 5 | * Licensed under the GNU General Public License Version 2 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20 | */ 21 | 22 | #ifndef __GNOME_SETTINGS_BUS_H 23 | #define __GNOME_SETTINGS_BUS_H 24 | 25 | #include 26 | #include "gsd-session-manager-glue.h" 27 | #include "gsd-screen-saver-glue.h" 28 | #include "gsd-shell-glue.h" 29 | #include "gsd-display-config-glue.h" 30 | 31 | G_BEGIN_DECLS 32 | 33 | GsdSessionManager *gnome_settings_bus_get_session_proxy (void); 34 | GsdScreenSaver *gnome_settings_bus_get_screen_saver_proxy (void); 35 | GsdShell *gnome_settings_bus_get_shell_proxy (void); 36 | GsdDisplayConfig *gnome_settings_bus_get_display_config_proxy (void); 37 | gboolean gnome_settings_is_wayland (void); 38 | char * gnome_settings_get_chassis_type (void); 39 | 40 | G_END_DECLS 41 | 42 | #endif /* __GNOME_SETTINGS_BUS_H */ 43 | -------------------------------------------------------------------------------- /gnome-settings-daemon/gnome-settings-module.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2005 - Paolo Maggi 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | */ 18 | 19 | #ifndef GNOME_SETTINGS_MODULE_H 20 | #define GNOME_SETTINGS_MODULE_H 21 | 22 | #include 23 | 24 | G_BEGIN_DECLS 25 | 26 | #define GNOME_TYPE_SETTINGS_MODULE (gnome_settings_module_get_type ()) 27 | #define GNOME_SETTINGS_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_SETTINGS_MODULE, GnomeSettingsModule)) 28 | #define GNOME_SETTINGS_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_TYPE_SETTINGS_MODULE, GnomeSettingsModuleClass)) 29 | #define GNOME_IS_SETTINGS_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_TYPE_SETTINGS_MODULE)) 30 | #define GNOME_IS_SETTINGS_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), GNOME_TYPE_SETTINGS_MODULE)) 31 | #define GNOME_SETTINGS_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNOME_TYPE_SETTINGS_MODULE, GnomeSettingsModuleClass)) 32 | 33 | typedef struct _GnomeSettingsModule GnomeSettingsModule; 34 | 35 | GType gnome_settings_module_get_type (void) G_GNUC_CONST; 36 | 37 | GnomeSettingsModule *gnome_settings_module_new (const gchar *path); 38 | 39 | const char *gnome_settings_module_get_path (GnomeSettingsModule *module); 40 | 41 | GObject *gnome_settings_module_new_object (GnomeSettingsModule *module); 42 | 43 | G_END_DECLS 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /gnome-settings-daemon/gnome-settings-profile.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2005 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | * Authors: William Jon McCann 19 | * 20 | */ 21 | 22 | #include "config.h" 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #include 32 | #include 33 | 34 | #include "gnome-settings-profile.h" 35 | 36 | void 37 | _gnome_settings_profile_log (const char *func, 38 | const char *note, 39 | const char *format, 40 | ...) 41 | { 42 | va_list args; 43 | char *str; 44 | char *formatted; 45 | 46 | if (format == NULL) { 47 | formatted = g_strdup (""); 48 | } else { 49 | va_start (args, format); 50 | formatted = g_strdup_vprintf (format, args); 51 | va_end (args); 52 | } 53 | 54 | if (func != NULL) { 55 | str = g_strdup_printf ("MARK: %s %s: %s %s", g_get_prgname(), func, note ? note : "", formatted); 56 | } else { 57 | str = g_strdup_printf ("MARK: %s: %s %s", g_get_prgname(), note ? note : "", formatted); 58 | } 59 | 60 | g_free (formatted); 61 | 62 | g_access (str, F_OK); 63 | g_free (str); 64 | } 65 | -------------------------------------------------------------------------------- /gnome-settings-daemon/gnome-settings-profile.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2005 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | * Authors: William Jon McCann 19 | * 20 | */ 21 | 22 | #ifndef __GNOME_SETTINGS_PROFILE_H 23 | #define __GNOME_SETTINGS_PROFILE_H 24 | 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | #ifdef ENABLE_PROFILING 30 | #ifdef G_HAVE_ISO_VARARGS 31 | #define gnome_settings_profile_start(...) _gnome_settings_profile_log (G_STRFUNC, "start", __VA_ARGS__) 32 | #define gnome_settings_profile_end(...) _gnome_settings_profile_log (G_STRFUNC, "end", __VA_ARGS__) 33 | #define gnome_settings_profile_msg(...) _gnome_settings_profile_log (NULL, NULL, __VA_ARGS__) 34 | #elif defined(G_HAVE_GNUC_VARARGS) 35 | #define gnome_settings_profile_start(format...) _gnome_settings_profile_log (G_STRFUNC, "start", format) 36 | #define gnome_settings_profile_end(format...) _gnome_settings_profile_log (G_STRFUNC, "end", format) 37 | #define gnome_settings_profile_msg(format...) _gnome_settings_profile_log (NULL, NULL, format) 38 | #endif 39 | #else 40 | #define gnome_settings_profile_start(...) 41 | #define gnome_settings_profile_end(...) 42 | #define gnome_settings_profile_msg(...) 43 | #endif 44 | 45 | void _gnome_settings_profile_log (const char *func, 46 | const char *note, 47 | const char *format, 48 | ...) G_GNUC_PRINTF (3, 4); 49 | 50 | G_END_DECLS 51 | 52 | #endif /* __GNOME_SETTINGS_PROFILE_H */ 53 | -------------------------------------------------------------------------------- /gnome-settings-daemon/meson.build: -------------------------------------------------------------------------------- 1 | sources = files( 2 | 'gnome-settings-bus.c', 3 | 'gnome-settings-profile.c' 4 | ) 5 | 6 | dbus_ifaces = [ 7 | ['SessionManager', 'gsd-session-manager-glue', 'SessionManager'], 8 | ['ScreenSaver', 'gsd-screen-saver-glue', 'ScreenSaver'], 9 | ['Shell', 'gsd-shell-glue', 'Shell'], 10 | ['Mutter.DisplayConfig', 'gsd-display-config-glue', 'DisplayConfig'], 11 | ] 12 | 13 | dbus_headers = [] 14 | 15 | foreach iface: dbus_ifaces 16 | name = 'org.gnome.' + iface[0] 17 | c_name = iface[2] 18 | 19 | dbus_sources = gnome.gdbus_codegen( 20 | iface[1], 21 | name + '.xml', 22 | interface_prefix: name + '.', 23 | namespace: 'Gsd', 24 | annotations: [name, 'org.gtk.GDBus.C.Name', iface[2]] 25 | ) 26 | 27 | sources += dbus_sources[0] 28 | dbus_headers += dbus_sources[1] 29 | endforeach 30 | 31 | deps = [gio_unix_dep] 32 | 33 | if enable_wayland 34 | deps += wayland_client_dep 35 | endif 36 | 37 | libgsd = shared_library( 38 | 'gsd', 39 | sources: sources + dbus_headers, 40 | include_directories: top_inc, 41 | dependencies: deps, 42 | install: true, 43 | install_dir: gsd_pkglibdir 44 | ) 45 | 46 | libgsd_dep = declare_dependency( 47 | sources: dbus_headers, 48 | include_directories: include_directories('.'), 49 | link_with: libgsd 50 | ) 51 | -------------------------------------------------------------------------------- /gnome-settings-daemon/org.gnome.ScreenSaver.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 21 | 22 | 23 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /gnome-settings-daemon/org.gnome.Shell.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 21 | 22 | 23 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /meson_options.txt: -------------------------------------------------------------------------------- 1 | option('udev_dir', type: 'string', value: '', description: 'Absolute path of the udev base directory') 2 | option('systemd', type: 'boolean', value: true, description: 'Enable systemd integration') 3 | option('elogind', type: 'boolean', value: false, description: 'Use elogind') 4 | option('alsa', type: 'boolean', value: true, description: 'build with ALSA support (not optional on Linux platforms)') 5 | option('gudev', type: 'boolean', value: true, description: 'build with gudev device support (not optional on Linux platforms)') 6 | option('cups', type: 'boolean', value: true, description: 'build with CUPS support') 7 | option('network_manager', type: 'boolean', value: true, description: 'build with NetworkManager support (not optional on Linux platforms)') 8 | option('rfkill', type: 'boolean', value: true, description: 'build with rfkill support (not optional on Linux platforms)') 9 | option('smartcard', type: 'boolean', value: true, description: 'build with smartcard support') 10 | option('usb-protection', type: 'boolean', value: true, description: 'build with usb-protection support') 11 | option('wayland', type: 'boolean', value: true, description: 'build with Wayland support') 12 | option('wwan', type: 'boolean', value: true, description: 'build with WWAN support') 13 | option('gcr3', type: 'boolean', value: false, description: 'build with gcr3, otherwise gcr4 is used') 14 | option('colord', type: 'boolean', value: true, description: 'build with colord support') 15 | -------------------------------------------------------------------------------- /plugins/a11y-settings/gsd-a11y-settings-manager.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #ifndef __GSD_A11Y_SETTINGS_MANAGER_H 21 | #define __GSD_A11Y_SETTINGS_MANAGER_H 22 | 23 | #include "gsd-application.h" 24 | 25 | G_BEGIN_DECLS 26 | 27 | #define GSD_TYPE_A11Y_SETTINGS_MANAGER gsd_a11y_settings_manager_get_type () 28 | G_DECLARE_FINAL_TYPE (GsdA11ySettingsManager, gsd_a11y_settings_manager, GSD, A11Y_SETTINGS_MANAGER, GsdApplication) 29 | 30 | G_END_DECLS 31 | 32 | #endif /* __GSD_A11Y_SETTINGS_MANAGER_H */ 33 | -------------------------------------------------------------------------------- /plugins/a11y-settings/main.c: -------------------------------------------------------------------------------- 1 | #include "gsd-main-helper.h" 2 | #include "gsd-a11y-settings-manager.h" 3 | 4 | int 5 | main (int argc, char **argv) 6 | { 7 | return gsd_main_helper (GSD_TYPE_A11Y_SETTINGS_MANAGER, argc, argv); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /plugins/a11y-settings/meson.build: -------------------------------------------------------------------------------- 1 | sources = files( 2 | 'gsd-a11y-settings-manager.c', 3 | 'main.c' 4 | ) 5 | sources += main_helper_sources 6 | 7 | deps = plugins_deps + [ 8 | gio_dep, 9 | gsettings_desktop_dep 10 | ] 11 | 12 | executable( 13 | 'gsd-' + plugin_name, 14 | sources, 15 | include_directories: [top_inc, common_inc], 16 | dependencies: deps, 17 | c_args: cflags, 18 | install: true, 19 | install_rpath: gsd_pkglibdir, 20 | install_dir: gsd_libexecdir 21 | ) 22 | -------------------------------------------------------------------------------- /plugins/color/gnome-datetime-source.h: -------------------------------------------------------------------------------- 1 | /* gnome-rr.h 2 | * 3 | * Copyright 2011, Red Hat, Inc. 4 | * 5 | * This file is part of the Gnome Library. 6 | * 7 | * The Gnome Library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Library General Public License as 9 | * published by the Free Software Foundation; either version 2 of the 10 | * License, or (at your option) any later version. 11 | * 12 | * The Gnome Library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Library General Public 18 | * License along with the Gnome Library; see the file COPYING.LIB. If not, 19 | * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301, USA. 21 | * 22 | * Author: Colin Walters 23 | */ 24 | 25 | #ifndef GNOME_DATETIME_SOURCE_H 26 | #define GNOME_DATETIME_SOURCE_H 27 | 28 | #ifndef GNOME_DESKTOP_USE_UNSTABLE_API 29 | #error This is unstable API. You must define GNOME_DESKTOP_USE_UNSTABLE_API 30 | #endif 31 | 32 | #include 33 | 34 | GSource *_gnome_datetime_source_new (GDateTime *now, 35 | GDateTime *expiry, 36 | gboolean cancel_on_set); 37 | 38 | #endif /* GNOME_DATETIME_SOURCE_H */ 39 | -------------------------------------------------------------------------------- /plugins/color/gsd-color-calibrate.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * Copyright (C) 2011-2013 Richard Hughes 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | * 19 | */ 20 | 21 | #ifndef __GSD_COLOR_CALIBRATE_H 22 | #define __GSD_COLOR_CALIBRATE_H 23 | 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define GSD_TYPE_COLOR_CALIBRATE (gsd_color_calibrate_get_type ()) 29 | G_DECLARE_FINAL_TYPE (GsdColorCalibrate, gsd_color_calibrate, GSD, COLOR_CALIBRATE, GObject) 30 | 31 | GType gsd_color_calibrate_get_type (void); 32 | GQuark gsd_color_calibrate_error_quark (void); 33 | 34 | GsdColorCalibrate * gsd_color_calibrate_new (void); 35 | 36 | G_END_DECLS 37 | 38 | #endif /* __GSD_COLOR_CALIBRATE_H */ 39 | -------------------------------------------------------------------------------- /plugins/color/gsd-color-manager.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * Copyright (C) 2011 Richard Hughes 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | * 19 | */ 20 | 21 | #ifndef __GSD_COLOR_MANAGER_H 22 | #define __GSD_COLOR_MANAGER_H 23 | 24 | #include "gsd-application.h" 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define GSD_TYPE_COLOR_MANAGER (gsd_color_manager_get_type ()) 29 | G_DECLARE_FINAL_TYPE (GsdColorManager, gsd_color_manager, GSD, COLOR_MANAGER, GsdApplication) 30 | 31 | G_END_DECLS 32 | 33 | #endif /* __GSD_COLOR_MANAGER_H */ 34 | -------------------------------------------------------------------------------- /plugins/color/gsd-color-state.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * Copyright (C) 2011-2013 Richard Hughes 5 | * Copyright (C) 2020 NVIDIA CORPORATION 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, see . 19 | * 20 | */ 21 | 22 | #include "config.h" 23 | 24 | #include "gsd-color-manager.h" 25 | #include "gsd-color-state.h" 26 | 27 | struct _GsdColorState 28 | { 29 | GObject parent; 30 | 31 | guint color_temperature; 32 | }; 33 | 34 | static void gsd_color_state_class_init (GsdColorStateClass *klass); 35 | static void gsd_color_state_init (GsdColorState *color_state); 36 | 37 | G_DEFINE_TYPE (GsdColorState, gsd_color_state, G_TYPE_OBJECT) 38 | 39 | void 40 | gsd_color_state_set_temperature (GsdColorState *state, guint temperature) 41 | { 42 | g_return_if_fail (GSD_IS_COLOR_STATE (state)); 43 | 44 | state->color_temperature = temperature; 45 | } 46 | 47 | guint 48 | gsd_color_state_get_temperature (GsdColorState *state) 49 | { 50 | g_return_val_if_fail (GSD_IS_COLOR_STATE (state), 0); 51 | return state->color_temperature; 52 | } 53 | 54 | void 55 | gsd_color_state_start (GsdColorState *state) 56 | { 57 | } 58 | 59 | void 60 | gsd_color_state_stop (GsdColorState *state) 61 | { 62 | } 63 | 64 | static void 65 | gsd_color_state_class_init (GsdColorStateClass *klass) 66 | { 67 | } 68 | 69 | static void 70 | gsd_color_state_init (GsdColorState *state) 71 | { 72 | /* default color temperature */ 73 | state->color_temperature = GSD_COLOR_TEMPERATURE_DEFAULT; 74 | } 75 | 76 | GsdColorState * 77 | gsd_color_state_new (void) 78 | { 79 | GsdColorState *state; 80 | state = g_object_new (GSD_TYPE_COLOR_STATE, NULL); 81 | return GSD_COLOR_STATE (state); 82 | } 83 | -------------------------------------------------------------------------------- /plugins/color/gsd-color-state.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * Copyright (C) 2011-2013 Richard Hughes 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | * 19 | */ 20 | 21 | #ifndef __GSD_COLOR_STATE_H 22 | #define __GSD_COLOR_STATE_H 23 | 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define GSD_TYPE_COLOR_STATE (gsd_color_state_get_type ()) 29 | 30 | G_DECLARE_FINAL_TYPE (GsdColorState, gsd_color_state, GSD, COLOR_STATE, GObject) 31 | 32 | #define GSD_COLOR_TEMPERATURE_MIN 1000 /* Kelvin */ 33 | #define GSD_COLOR_TEMPERATURE_DEFAULT 6500 /* Kelvin, is RGB [1.0,1.0,1.0] */ 34 | #define GSD_COLOR_TEMPERATURE_MAX 10000 /* Kelvin */ 35 | 36 | GsdColorState * gsd_color_state_new (void); 37 | void gsd_color_state_start (GsdColorState *state); 38 | void gsd_color_state_stop (GsdColorState *state); 39 | void gsd_color_state_set_temperature (GsdColorState *state, 40 | guint temperature); 41 | guint gsd_color_state_get_temperature (GsdColorState *state); 42 | 43 | G_END_DECLS 44 | 45 | #endif /* __GSD_COLOR_STATE_H */ 46 | -------------------------------------------------------------------------------- /plugins/color/gsd-night-light-common.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2017 Richard Hughes 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #ifndef __GSD_NIGHT_LIGHT_COMMON_H 21 | #define __GSD_NIGHT_LIGHT_COMMON_H 22 | 23 | #include 24 | 25 | G_BEGIN_DECLS 26 | 27 | gboolean gsd_night_light_get_sunrise_sunset (GDateTime *dt, 28 | gdouble pos_lat, 29 | gdouble pos_long, 30 | gdouble *sunrise, 31 | gdouble *sunset); 32 | gdouble gsd_night_light_frac_day_from_dt (GDateTime *dt); 33 | gboolean gsd_night_light_frac_day_is_between (gdouble value, 34 | gdouble start, 35 | gdouble end); 36 | 37 | G_END_DECLS 38 | 39 | #endif /* __GSD_NIGHT_LIGHT_COMMON_H */ 40 | -------------------------------------------------------------------------------- /plugins/color/gsd-night-light.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Richard Hughes 3 | * 4 | * Licensed under the GNU General Public License Version 2 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 | */ 20 | 21 | #ifndef __GSD_NIGHT_LIGHT_H__ 22 | #define __GSD_NIGHT_LIGHT_H__ 23 | 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define GSD_TYPE_NIGHT_LIGHT (gsd_night_light_get_type ()) 29 | G_DECLARE_FINAL_TYPE (GsdNightLight, gsd_night_light, GSD, NIGHT_LIGHT, GObject) 30 | 31 | GsdNightLight *gsd_night_light_new (void); 32 | gboolean gsd_night_light_start (GsdNightLight *self, 33 | GError **error); 34 | 35 | gboolean gsd_night_light_get_active (GsdNightLight *self); 36 | gdouble gsd_night_light_get_sunrise (GsdNightLight *self); 37 | gdouble gsd_night_light_get_sunset (GsdNightLight *self); 38 | gdouble gsd_night_light_get_temperature (GsdNightLight *self); 39 | 40 | gboolean gsd_night_light_get_disabled_until_tmw (GsdNightLight *self); 41 | void gsd_night_light_set_disabled_until_tmw (GsdNightLight *self, 42 | gboolean value); 43 | 44 | gboolean gsd_night_light_get_forced (GsdNightLight *self); 45 | void gsd_night_light_set_forced (GsdNightLight *self, 46 | gboolean value); 47 | 48 | /* only for the self test program */ 49 | void gsd_night_light_set_geoclue_enabled (GsdNightLight *self, 50 | gboolean enabled); 51 | void gsd_night_light_set_date_time_now (GsdNightLight *self, 52 | GDateTime *datetime); 53 | void gsd_night_light_set_smooth_enabled (GsdNightLight *self, 54 | gboolean smooth_enabled); 55 | 56 | G_END_DECLS 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /plugins/color/main.c: -------------------------------------------------------------------------------- 1 | #include "gsd-main-helper.h" 2 | #include "gsd-color-manager.h" 3 | 4 | int 5 | main (int argc, char **argv) 6 | { 7 | return gsd_main_helper (GSD_TYPE_COLOR_MANAGER, argc, argv); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /plugins/color/meson.build: -------------------------------------------------------------------------------- 1 | sources = files( 2 | 'gnome-datetime-source.c', 3 | 'gsd-color-calibrate.c', 4 | 'gsd-color-manager.c', 5 | 'gsd-color-state.c', 6 | 'gsd-night-light.c', 7 | 'gsd-night-light-common.c', 8 | 'main.c' 9 | ) 10 | sources += main_helper_sources 11 | 12 | deps = plugins_deps + [ 13 | colord_dep, 14 | libcanberra_gtk_dep, 15 | libgeoclue_dep, 16 | libnotify_dep, 17 | libcommon_dep, 18 | m_dep, 19 | ] 20 | 21 | cflags += ['-DBINDIR="@0@"'.format(gsd_bindir)] 22 | cflags += ['-DUSE_GTK=1'] 23 | 24 | executable( 25 | 'gsd-' + plugin_name, 26 | sources, 27 | include_directories: [top_inc, common_inc], 28 | dependencies: deps, 29 | c_args: cflags, 30 | install: true, 31 | install_rpath: gsd_pkglibdir, 32 | install_dir: gsd_libexecdir 33 | ) 34 | 35 | sources = files( 36 | 'gcm-self-test.c', 37 | 'gnome-datetime-source.c', 38 | 'gsd-night-light.c', 39 | 'gsd-night-light-common.c' 40 | ) 41 | 42 | test_unit = 'gcm-self-test' 43 | 44 | exe = executable( 45 | test_unit, 46 | sources, 47 | include_directories: top_inc, 48 | dependencies: deps, 49 | c_args: '-DTESTDATADIR="@0@"'.format(join_paths(meson.current_source_dir(), 'test-data')) 50 | ) 51 | 52 | envs = ['GSETTINGS_SCHEMA_DIR=@0@'.format(join_paths(meson.project_build_root(), 'data'))] 53 | test(test_unit, exe, env: envs) 54 | -------------------------------------------------------------------------------- /plugins/color/test-data/LG-L225W-External.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gnome-settings-daemon/8bef304b093dc5c9a79e22a92aab19c7d69ec147/plugins/color/test-data/LG-L225W-External.bin -------------------------------------------------------------------------------- /plugins/color/test-data/Lenovo-T61-Internal.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gnome-settings-daemon/8bef304b093dc5c9a79e22a92aab19c7d69ec147/plugins/color/test-data/Lenovo-T61-Internal.bin -------------------------------------------------------------------------------- /plugins/common/gsd-application.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2025 Red Hat Inc. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | * Author: Carlos Garnacho 19 | */ 20 | 21 | #include "gsd-application.h" 22 | 23 | G_DEFINE_TYPE (GsdApplication, gsd_application, G_TYPE_APPLICATION) 24 | 25 | static void 26 | gsd_application_real_pre_shutdown (GsdApplication *app) 27 | { 28 | g_application_release (G_APPLICATION (app)); 29 | } 30 | 31 | static void 32 | gsd_application_class_init (GsdApplicationClass *klass) 33 | { 34 | klass->pre_shutdown = gsd_application_real_pre_shutdown; 35 | } 36 | 37 | static void 38 | gsd_application_init (GsdApplication *app) 39 | { 40 | } 41 | 42 | void 43 | gsd_application_pre_shutdown (GsdApplication *app) 44 | { 45 | GSD_APPLICATION_GET_CLASS (app)->pre_shutdown (app); 46 | } 47 | -------------------------------------------------------------------------------- /plugins/common/gsd-application.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2025 Red Hat Inc. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | * Author: Carlos Garnacho 19 | */ 20 | 21 | #ifndef __GSD_APPLICATION_H__ 22 | #define __GSD_APPLICATION_H__ 23 | 24 | #include 25 | 26 | #define GSD_TYPE_APPLICATION gsd_application_get_type () 27 | G_DECLARE_DERIVABLE_TYPE (GsdApplication, 28 | gsd_application, 29 | GSD, APPLICATION, 30 | GApplication) 31 | 32 | struct _GsdApplicationClass 33 | { 34 | GApplicationClass parent_class; 35 | 36 | void (* pre_shutdown) (GsdApplication *app); 37 | }; 38 | 39 | void gsd_application_pre_shutdown (GsdApplication *app); 40 | 41 | #endif /* __GSD_APPLICATION_H__ */ 42 | -------------------------------------------------------------------------------- /plugins/common/gsd-input-helper.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2010 Bastien Nocera 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #include "config.h" 21 | 22 | #include 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | #include "gsd-input-helper.h" 32 | 33 | char * 34 | xdevice_get_device_node (int deviceid) 35 | { 36 | Atom prop; 37 | Atom act_type; 38 | int act_format; 39 | unsigned long nitems, bytes_after; 40 | unsigned char *data; 41 | char *ret; 42 | 43 | gdk_display_sync (gdk_display_get_default ()); 44 | 45 | prop = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "Device Node", False); 46 | if (!prop) 47 | return NULL; 48 | 49 | gdk_x11_display_error_trap_push (gdk_display_get_default ()); 50 | 51 | if (!XIGetProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), 52 | deviceid, prop, 0, 1000, False, 53 | AnyPropertyType, &act_type, &act_format, 54 | &nitems, &bytes_after, &data) == Success) { 55 | gdk_x11_display_error_trap_pop_ignored (gdk_display_get_default ()); 56 | return NULL; 57 | } 58 | if (gdk_x11_display_error_trap_pop (gdk_display_get_default ())) 59 | goto out; 60 | 61 | if (nitems == 0) 62 | goto out; 63 | 64 | if (act_type != XA_STRING) 65 | goto out; 66 | 67 | /* Unknown string format */ 68 | if (act_format != 8) 69 | goto out; 70 | 71 | ret = g_strdup ((char *) data); 72 | 73 | XFree (data); 74 | return ret; 75 | 76 | out: 77 | XFree (data); 78 | return NULL; 79 | } 80 | -------------------------------------------------------------------------------- /plugins/common/gsd-input-helper.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2010 Bastien Nocera 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | */ 18 | 19 | #ifndef __GSD_INPUT_HELPER_H 20 | #define __GSD_INPUT_HELPER_H 21 | 22 | G_BEGIN_DECLS 23 | 24 | #include 25 | 26 | #include 27 | #include 28 | 29 | char * xdevice_get_device_node (int deviceid); 30 | 31 | G_END_DECLS 32 | 33 | #endif /* __GSD_INPUT_HELPER_H */ 34 | -------------------------------------------------------------------------------- /plugins/common/gsd-main-helper.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2024 SUSE Software Solutions Germany GmbH 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, but 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | * Author: Joan Torres 19 | * 20 | */ 21 | 22 | #ifndef __GSD_MAIN_HELPER_H 23 | #define __GSD_MAIN_HELPER_H 24 | 25 | #include 26 | 27 | int gsd_main_helper (GType manager_type, 28 | int argc, 29 | char **argv); 30 | 31 | #endif /* __GSD_MAIN_HELPER_H */ 32 | -------------------------------------------------------------------------------- /plugins/common/gsd-settings-migrate.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2015 Red Hat 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | * Author: Carlos Garnacho 20 | */ 21 | 22 | #include "config.h" 23 | 24 | #include 25 | 26 | #include "gsd-settings-migrate.h" 27 | 28 | void 29 | gsd_settings_migrate_check (const gchar *origin_schema, 30 | const gchar *origin_path, 31 | const gchar *dest_schema, 32 | const gchar *dest_path, 33 | GsdSettingsMigrateEntry entries[], 34 | guint n_entries) 35 | { 36 | GSettings *origin_settings, *dest_settings; 37 | guint i; 38 | 39 | origin_settings = g_settings_new_with_path (origin_schema, origin_path); 40 | dest_settings = g_settings_new_with_path (dest_schema, dest_path); 41 | 42 | for (i = 0; i < n_entries; i++) { 43 | g_autoptr(GVariant) variant = NULL; 44 | 45 | variant = g_settings_get_user_value (origin_settings, entries[i].origin_key); 46 | 47 | if (!variant) 48 | continue; 49 | 50 | g_settings_reset (origin_settings, entries[i].origin_key); 51 | 52 | if (entries[i].dest_key) { 53 | if (entries[i].func) { 54 | g_autoptr(GVariant) old_default = NULL; 55 | g_autoptr(GVariant) new_default = NULL; 56 | GVariant *modified; 57 | 58 | old_default = g_settings_get_default_value (origin_settings, entries[i].origin_key); 59 | new_default = g_settings_get_default_value (dest_settings, entries[i].dest_key); 60 | 61 | modified = entries[i].func (variant, old_default, new_default); 62 | g_clear_pointer (&variant, g_variant_unref); 63 | if (modified) 64 | variant = g_variant_ref_sink (modified); 65 | } 66 | 67 | if (variant) 68 | g_settings_set_value (dest_settings, entries[i].dest_key, variant); 69 | } 70 | } 71 | 72 | g_object_unref (origin_settings); 73 | g_object_unref (dest_settings); 74 | } 75 | -------------------------------------------------------------------------------- /plugins/common/gsd-settings-migrate.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2015 Red Hat 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | * Author: Carlos Garnacho 20 | */ 21 | 22 | #ifndef __GSD_SETTINGS_MIGRATE_H__ 23 | #define __GSD_SETTINGS_MIGRATE_H__ 24 | 25 | typedef struct _GsdSettingsMigrateEntry GsdSettingsMigrateEntry; 26 | 27 | typedef GVariant * (* GsdSettingsMigrateFunc) (GVariant *variant, GVariant *old_default, GVariant *new_default); 28 | 29 | struct _GsdSettingsMigrateEntry 30 | { 31 | const gchar *origin_key; 32 | const gchar *dest_key; 33 | GsdSettingsMigrateFunc func; 34 | }; 35 | 36 | void gsd_settings_migrate_check (const gchar *origin_schema, 37 | const gchar *origin_path, 38 | const gchar *dest_schema, 39 | const gchar *dest_path, 40 | GsdSettingsMigrateEntry entries[], 41 | guint n_entries); 42 | 43 | #endif /* __GSD_SETTINGS_MIGRATE_H__ */ 44 | -------------------------------------------------------------------------------- /plugins/common/gsd-shell-helper.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2013 Carlos Garnacho 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #include "config.h" 21 | #include "gsd-shell-helper.h" 22 | 23 | void 24 | shell_show_osd (GsdShell *shell, 25 | const gchar *icon_name, 26 | const gchar *label, 27 | double level, 28 | const gchar *connector) 29 | { 30 | shell_show_osd_with_max_level (shell, icon_name, label, level, -1, connector); 31 | } 32 | 33 | void 34 | shell_show_osd_with_max_level (GsdShell *shell, 35 | const gchar *icon_name, 36 | const gchar *label, 37 | double level, 38 | double max_level, 39 | const gchar *connector) 40 | { 41 | GVariantBuilder builder; 42 | 43 | g_return_if_fail (GSD_IS_SHELL (shell)); 44 | 45 | g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT); 46 | 47 | if (icon_name) 48 | g_variant_builder_add (&builder, "{sv}", 49 | "icon", g_variant_new_string (icon_name)); 50 | if (label) 51 | g_variant_builder_add (&builder, "{sv}", 52 | "label", g_variant_new_string (label)); 53 | if (level >= 0.0) 54 | g_variant_builder_add (&builder, "{sv}", 55 | "level", g_variant_new_double (level)); 56 | if (max_level > 1.0) 57 | g_variant_builder_add (&builder, "{sv}", 58 | "max_level", g_variant_new_double (max_level)); 59 | if (connector) 60 | g_variant_builder_add (&builder, "{sv}", 61 | "connector", g_variant_new_string (connector)); 62 | 63 | gsd_shell_call_show_osd (shell, 64 | g_variant_builder_end (&builder), 65 | NULL, NULL, NULL); 66 | } 67 | -------------------------------------------------------------------------------- /plugins/common/gsd-shell-helper.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2013 Carlos Garnacho 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #ifndef __GSD_SHELL_HELPER_H__ 21 | #define __GSD_SHELL_HELPER_H__ 22 | 23 | #include "gsd-shell-glue.h" 24 | 25 | G_BEGIN_DECLS 26 | 27 | void shell_show_osd (GsdShell *shell, 28 | const gchar *icon_name, 29 | const gchar *label, 30 | double level, 31 | const gchar *connector); 32 | 33 | void shell_show_osd_with_max_level (GsdShell *shell, 34 | const gchar *icon_name, 35 | const gchar *label, 36 | double level, 37 | double max_level, 38 | const gchar *connector); 39 | 40 | G_END_DECLS 41 | 42 | #endif /* __GSD_SHELL_HELPER_H__ */ 43 | -------------------------------------------------------------------------------- /plugins/common/gsd.gresources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | gtk.css 5 | 6 | 7 | -------------------------------------------------------------------------------- /plugins/common/gtk.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gnome-settings-daemon/8bef304b093dc5c9a79e22a92aab19c7d69ec147/plugins/common/gtk.css -------------------------------------------------------------------------------- /plugins/common/meson.build: -------------------------------------------------------------------------------- 1 | common_inc = include_directories('.') 2 | 3 | sources = files( 4 | 'gsd-input-helper.c', 5 | 'gsd-settings-migrate.c', 6 | 'gsd-shell-helper.c' 7 | ) 8 | 9 | main_helper_sources = files( 10 | 'gsd-application.c', 11 | 'gsd-main-helper.c', 12 | ) 13 | 14 | resource_data = files('gtk.css') 15 | 16 | sources += gnome.compile_resources( 17 | 'gsd-resources', 18 | 'gsd.gresources.xml', 19 | c_name: 'gsd', 20 | dependencies: resource_data 21 | ) 22 | 23 | deps = plugins_deps + [ 24 | gnome_desktop_dep, 25 | gtk_x11_dep, 26 | x11_dep, 27 | dependency('kbproto'), 28 | dependency('xi') 29 | ] 30 | 31 | ldflags = [] 32 | if host_is_darwin 33 | ldflags += ['-Wl,-bundle_loader,@0@'.format(join_paths(), meson.project_build_root(), meson.project_name(), meson.project_name())] 34 | endif 35 | 36 | libcommon = static_library( 37 | plugin_name, 38 | sources: sources, 39 | include_directories: top_inc, 40 | dependencies: deps, 41 | c_args: cflags, 42 | link_args: ldflags 43 | ) 44 | 45 | libcommon_dep = declare_dependency( 46 | include_directories: common_inc, 47 | link_with: libcommon 48 | ) 49 | -------------------------------------------------------------------------------- /plugins/datetime/gsd-datetime-manager.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2013 Kalev Lember 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #ifndef __GSD_DATETIME_MANAGER_H 21 | #define __GSD_DATETIME_MANAGER_H 22 | 23 | #include "gsd-application.h" 24 | 25 | G_BEGIN_DECLS 26 | 27 | #define GSD_TYPE_DATETIME_MANAGER (gsd_datetime_manager_get_type ()) 28 | G_DECLARE_FINAL_TYPE (GsdDatetimeManager, gsd_datetime_manager, GSD, DATETIME_MANAGER, GsdApplication) 29 | 30 | G_END_DECLS 31 | 32 | #endif /* __GSD_DATETIME_MANAGER_H */ 33 | -------------------------------------------------------------------------------- /plugins/datetime/gsd-timezone-monitor.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2013 Kalev Lember 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #ifndef __GSD_TIMEZONE_MONITOR_H 21 | #define __GSD_TIMEZONE_MONITOR_H 22 | 23 | #include 24 | 25 | G_BEGIN_DECLS 26 | 27 | #define GSD_TYPE_TIMEZONE_MONITOR (gsd_timezone_monitor_get_type ()) 28 | #define GSD_TIMEZONE_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSD_TYPE_TIMEZONE_MONITOR, GsdTimezoneMonitor)) 29 | #define GSD_IS_TIMEZONE_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSD_TYPE_TIMEZONE_MONITOR)) 30 | #define GSD_TIMEZONE_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GSD_TYPE_TIMEZONE_MONITOR, GsdTimezoneMonitorClass)) 31 | #define GSD_IS_TIMEZONE_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GSD_TYPE_TIMEZONE_MONITOR)) 32 | #define GSD_TIMEZONE_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GSD_TYPE_TIMEZONE_MONITOR, GsdTimezoneMonitorClass)) 33 | 34 | typedef struct _GsdTimezoneMonitor GsdTimezoneMonitor; 35 | typedef struct _GsdTimezoneMonitorClass GsdTimezoneMonitorClass; 36 | 37 | struct _GsdTimezoneMonitor 38 | { 39 | GObject parent_instance; 40 | }; 41 | 42 | struct _GsdTimezoneMonitorClass 43 | { 44 | GObjectClass parent_class; 45 | 46 | void (*timezone_changed) (GsdTimezoneMonitor *monitor, gchar *timezone_id); 47 | }; 48 | 49 | GType gsd_timezone_monitor_get_type (void) G_GNUC_CONST; 50 | 51 | GsdTimezoneMonitor *gsd_timezone_monitor_new (void); 52 | 53 | G_END_DECLS 54 | 55 | #endif /* __GSD_TIMEZONE_MONITOR_H */ 56 | -------------------------------------------------------------------------------- /plugins/datetime/main.c: -------------------------------------------------------------------------------- 1 | #include "gsd-main-helper.h" 2 | #include "gsd-datetime-manager.h" 3 | 4 | int 5 | main (int argc, char **argv) 6 | { 7 | return gsd_main_helper (GSD_TYPE_DATETIME_MANAGER, argc, argv); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /plugins/datetime/meson.build: -------------------------------------------------------------------------------- 1 | install_data( 2 | 'backward', 3 | install_dir: join_paths(gsd_pkgdatadir, 'datetime') 4 | ) 5 | 6 | sources = files( 7 | 'gsd-datetime-manager.c', 8 | 'gsd-timezone-monitor.c', 9 | 'main.c', 10 | 'tz.c', 11 | 'weather-tz.c' 12 | ) 13 | 14 | sources += gnome.gdbus_codegen( 15 | 'timedated', 16 | 'timedated1-interface.xml', 17 | interface_prefix: 'org.freedesktop.' 18 | ) 19 | 20 | sources += main_helper_sources 21 | 22 | deps = plugins_deps + [ 23 | geocode_glib_dep, 24 | gweather_dep, 25 | libgeoclue_dep, 26 | libnotify_dep, 27 | m_dep, 28 | polkit_gobject_dep 29 | ] 30 | 31 | cflags += ['-DGNOMECC_DATA_DIR="@0@"'.format(gsd_pkgdatadir)] 32 | 33 | executable( 34 | 'gsd-' + plugin_name, 35 | sources, 36 | include_directories: [top_inc, common_inc], 37 | dependencies: deps, 38 | c_args: cflags, 39 | install: true, 40 | install_rpath: gsd_pkglibdir, 41 | install_dir: gsd_libexecdir 42 | ) 43 | -------------------------------------------------------------------------------- /plugins/datetime/timedated1-interface.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /plugins/datetime/tz.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ 2 | /* Generic timezone utilities. 3 | * 4 | * Copyright (C) 2000-2001 Ximian, Inc. 5 | * 6 | * Authors: Hans Petter Jansson 7 | * 8 | * Largely based on Michael Fulbright's work on Anaconda. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation; either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, see . 22 | */ 23 | 24 | 25 | #ifndef _E_TZ_H 26 | #define _E_TZ_H 27 | 28 | #include 29 | 30 | #ifndef __sun 31 | # define TZ_DATA_FILE "/usr/share/zoneinfo/zone.tab" 32 | #else 33 | # define TZ_DATA_FILE "/usr/share/lib/zoneinfo/tab/zone_sun.tab" 34 | #endif 35 | 36 | typedef struct _TzDB TzDB; 37 | typedef struct _TzLocation TzLocation; 38 | typedef struct _TzInfo TzInfo; 39 | 40 | 41 | struct _TzDB 42 | { 43 | GPtrArray *locations; 44 | GHashTable *backward; 45 | }; 46 | 47 | struct _TzLocation 48 | { 49 | gchar *country; 50 | gdouble latitude; 51 | gdouble longitude; 52 | gchar *zone; 53 | gchar *comment; 54 | 55 | gdouble dist; /* distance to clicked point for comparison */ 56 | }; 57 | 58 | /* see the glibc info page information on time zone information */ 59 | /* tzname_normal is the default name for the timezone */ 60 | /* tzname_daylight is the name of the zone when in daylight savings */ 61 | /* utc_offset is offset in seconds from utc */ 62 | /* daylight if non-zero then location obeys daylight savings */ 63 | 64 | struct _TzInfo 65 | { 66 | gchar *tzname_normal; 67 | gchar *tzname_daylight; 68 | glong utc_offset; 69 | gint daylight; 70 | }; 71 | 72 | 73 | TzDB *tz_load_db (void); 74 | void tz_db_free (TzDB *db); 75 | char * tz_info_get_clean_name (TzDB *tz_db, 76 | const char *tz); 77 | GPtrArray *tz_get_locations (TzDB *db); 78 | void tz_location_get_position (TzLocation *loc, 79 | double *longitude, double *latitude); 80 | void tz_location_free (TzLocation *loc); 81 | char *tz_location_get_country (TzLocation *loc); 82 | gchar *tz_location_get_zone (TzLocation *loc); 83 | gchar *tz_location_get_comment (TzLocation *loc); 84 | glong tz_location_get_utc_offset (TzLocation *loc); 85 | gint tz_location_set_locally (TzLocation *loc); 86 | TzInfo *tz_info_from_location (TzLocation *loc); 87 | void tz_info_free (TzInfo *tz_info); 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /plugins/datetime/weather-tz.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2013 Kalev Lember 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #ifndef __WEATHER_TZ_H 21 | #define __WEATHER_TZ_H 22 | 23 | #include 24 | 25 | GList *weather_tz_db_get_locations (const char *country); 26 | 27 | #endif /* __WEATHER_TZ_H */ 28 | -------------------------------------------------------------------------------- /plugins/gsd.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=@description@ service 3 | CollectMode=inactive-or-failed 4 | RefuseManualStart=true 5 | RefuseManualStop=true 6 | 7 | After=gnome-session-initialized.target 8 | 9 | # Requisite/PartOf means the dependency is not loaded automatically. 10 | # The ordering here also implies Before=gnome-session.target 11 | Requisite=@plugin_dbus_name@.target 12 | PartOf=@plugin_dbus_name@.target 13 | Before=@plugin_dbus_name@.target 14 | 15 | @plugin_gate_units_section@ 16 | 17 | [Service] 18 | Slice=session.slice 19 | Type=dbus 20 | ExecStart=@libexecdir@/gsd-@plugin_name@ 21 | Restart=on-failure 22 | BusName=@plugin_dbus_name@ 23 | TimeoutStopSec=5 24 | # We cannot use OnFailure as e.g. dependency failures are normal 25 | # https://github.com/systemd/systemd/issues/12352 26 | ExecStopPost=@libexecdir@/gnome-session-ctl --exec-stop-check 27 | -------------------------------------------------------------------------------- /plugins/gsd.target.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=@description@ target 3 | CollectMode=inactive-or-failed 4 | 5 | # Pull in the service 6 | Wants=@plugin_dbus_name@.service 7 | 8 | # Require GNOME session and specify startup ordering 9 | Requisite=gnome-session-initialized.target 10 | After=gnome-session-initialized.target 11 | PartOf=gnome-session-initialized.target 12 | Before=gnome-session.target 13 | -------------------------------------------------------------------------------- /plugins/housekeeping/gsd-disk-space-helper.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * vim: set et sw=8 ts=8: 3 | * 4 | * Copyright (c) 2008, Novell, Inc. 5 | * Copyright (c) 2012, Red Hat, Inc. 6 | * 7 | * Authors: Vincent Untz 8 | * Bastien Nocera 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation; either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, see . 22 | * 23 | */ 24 | 25 | #ifndef __GSD_DISK_SPACE_HELPER_H 26 | #define __GSD_DISK_SPACE_HELPER_H 27 | 28 | #include 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | gboolean gsd_should_ignore_unix_mount (GUnixMountEntry *mount); 34 | gboolean gsd_is_removable_mount (GUnixMountEntry *mount); 35 | 36 | G_END_DECLS 37 | 38 | #endif /* __GSD_DISK_SPACE_HELPER_H */ 39 | -------------------------------------------------------------------------------- /plugins/housekeeping/gsd-disk-space-test.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * vim: set et sw=8 ts=8: 3 | * 4 | * Copyright (c) 2008, Novell, Inc. 5 | * 6 | * Authors: Vincent Untz 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, see . 20 | * 21 | */ 22 | 23 | #include "config.h" 24 | #include 25 | #include 26 | #include "gsd-disk-space.h" 27 | 28 | int 29 | main (int argc, 30 | char **argv) 31 | { 32 | GMainLoop *loop; 33 | 34 | gtk_init (&argc, &argv); 35 | notify_init ("gsd-disk-space-test"); 36 | 37 | loop = g_main_loop_new (NULL, FALSE); 38 | 39 | gsd_ldsm_setup (TRUE); 40 | 41 | g_main_loop_run (loop); 42 | 43 | gsd_ldsm_clean (); 44 | g_main_loop_unref (loop); 45 | 46 | return 0; 47 | } 48 | 49 | -------------------------------------------------------------------------------- /plugins/housekeeping/gsd-disk-space.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * vim: set et sw=8 ts=8: 3 | * 4 | * Copyright (c) 2008, Novell, Inc. 5 | * 6 | * Authors: Vincent Untz 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, see . 20 | * 21 | */ 22 | 23 | #ifndef __GSD_DISK_SPACE_H 24 | #define __GSD_DISK_SPACE_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | typedef struct { 31 | grefcount ref_count; 32 | GFile *file; 33 | GCancellable *cancellable; 34 | GDateTime *old; 35 | gboolean dry_run; 36 | gboolean trash; 37 | gchar *name; 38 | gchar *filesystem; 39 | gint depth; 40 | } DeleteData; 41 | 42 | void delete_data_unref (DeleteData *data); 43 | DeleteData *delete_data_new (GFile *file, 44 | GCancellable *cancellable, 45 | GDateTime *old, 46 | gboolean dry_run, 47 | gboolean trash, 48 | gint depth, 49 | const char *filesystem); 50 | char* get_filesystem (GFile *file); 51 | 52 | void delete_recursively_by_age (DeleteData *data); 53 | 54 | void gsd_ldsm_setup (gboolean check_now); 55 | void gsd_ldsm_clean (void); 56 | 57 | /* for the test */ 58 | void gsd_ldsm_show_empty_trash (void); 59 | void gsd_ldsm_purge_trash (GDateTime *old); 60 | void gsd_ldsm_purge_temp_files (GDateTime *old); 61 | 62 | G_END_DECLS 63 | 64 | #endif /* __GSD_DISK_SPACE_H */ 65 | -------------------------------------------------------------------------------- /plugins/housekeeping/gsd-empty-trash-test.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * vim: set et sw=8 ts=8: 3 | * 4 | * Copyright (c) 2011, Red Hat, Inc. 5 | * 6 | * Authors: Cosimo Cecchi 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, see . 20 | * 21 | */ 22 | 23 | #include "config.h" 24 | #include 25 | #include "gsd-disk-space.h" 26 | 27 | int 28 | main (int argc, 29 | char **argv) 30 | { 31 | GMainLoop *loop; 32 | 33 | gtk_init (&argc, &argv); 34 | 35 | loop = g_main_loop_new (NULL, FALSE); 36 | 37 | gsd_ldsm_show_empty_trash (); 38 | g_main_loop_run (loop); 39 | 40 | g_main_loop_unref (loop); 41 | 42 | return 0; 43 | } 44 | 45 | -------------------------------------------------------------------------------- /plugins/housekeeping/gsd-housekeeping-manager.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2008 Michael J. Chudobiak 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #ifndef __GSD_HOUSEKEEPING_MANAGER_H 21 | #define __GSD_HOUSEKEEPING_MANAGER_H 22 | 23 | #include "gsd-application.h" 24 | 25 | G_BEGIN_DECLS 26 | 27 | #define GSD_TYPE_HOUSEKEEPING_MANAGER (gsd_housekeeping_manager_get_type ()) 28 | 29 | G_DECLARE_FINAL_TYPE (GsdHousekeepingManager, gsd_housekeeping_manager, GSD, HOUSEKEEPING_MANAGER, GsdApplication) 30 | 31 | G_END_DECLS 32 | 33 | #endif /* __GSD_HOUSEKEEPING_MANAGER_H */ 34 | -------------------------------------------------------------------------------- /plugins/housekeeping/gsd-purge-temp-test.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * vim: set et sw=8 ts=8: 3 | * 4 | * Copyright (c) 2008, Novell, Inc. 5 | * 6 | * Authors: Vincent Untz 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, see . 20 | * 21 | */ 22 | 23 | #include "config.h" 24 | #include 25 | #include 26 | #include "gsd-disk-space.h" 27 | 28 | int 29 | main (int argc, 30 | char **argv) 31 | { 32 | GFile *file; 33 | DeleteData *data; 34 | GDateTime *old; 35 | GMainLoop *loop; 36 | g_autofree char *filesystem = NULL; 37 | 38 | g_setenv ("G_MESSAGES_DEBUG", "all", TRUE); 39 | 40 | gtk_init (&argc, &argv); 41 | notify_init ("gsd-purge-temp-test"); 42 | loop = g_main_loop_new (NULL, FALSE); 43 | 44 | file = g_file_new_for_path ("/tmp/gsd-purge-temp-test"); 45 | if (!g_file_query_exists (file, NULL)) { 46 | g_warning ("Create /tmp/gsd-purge-temp-test and add some files to it to test deletion by date"); 47 | g_object_unref (file); 48 | return 1; 49 | } 50 | 51 | old = g_date_time_new_now_local (); 52 | filesystem = get_filesystem (file); 53 | data = delete_data_new (file, NULL, old, FALSE, FALSE, 0, filesystem); 54 | delete_recursively_by_age (data); 55 | delete_data_unref (data); 56 | g_object_unref (file); 57 | 58 | g_main_loop_run (loop); 59 | 60 | return 0; 61 | } 62 | 63 | -------------------------------------------------------------------------------- /plugins/housekeeping/gsd-systemd-notify.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 Benjamin Berg 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, see . 16 | * 17 | */ 18 | 19 | #ifndef __GSD_SYSTEMD_NOTIFY_H 20 | #define __GSD_SYSTEMD_NOTIFY_H 21 | 22 | #include 23 | 24 | G_BEGIN_DECLS 25 | 26 | #define GSD_TYPE_SYSTEMD_NOTIFY (gsd_systemd_notify_get_type ()) 27 | 28 | G_DECLARE_FINAL_TYPE (GsdSystemdNotify, gsd_systemd_notify, GSD, SYSTEMD_NOTIFY, GObject) 29 | 30 | G_END_DECLS 31 | 32 | #endif /* __GSD_SYSTEMD_NOTIFY_H */ 33 | -------------------------------------------------------------------------------- /plugins/housekeeping/main.c: -------------------------------------------------------------------------------- 1 | #include "gsd-main-helper.h" 2 | #include "gsd-housekeeping-manager.h" 3 | 4 | int 5 | main (int argc, char **argv) 6 | { 7 | return gsd_main_helper (GSD_TYPE_HOUSEKEEPING_MANAGER, argc, argv); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /plugins/housekeeping/meson.build: -------------------------------------------------------------------------------- 1 | common_files = files( 2 | 'gsd-disk-space.c', 3 | 'gsd-disk-space-helper.c' 4 | ) 5 | 6 | sources = common_files + files( 7 | 'gsd-housekeeping-manager.c', 8 | 'gsd-systemd-notify.c', 9 | 'main.c' 10 | ) 11 | sources += main_helper_sources 12 | 13 | deps = plugins_deps + [ 14 | gio_unix_dep, 15 | gtk_dep, 16 | libnotify_dep 17 | ] 18 | 19 | executable( 20 | 'gsd-' + plugin_name, 21 | sources, 22 | include_directories: [top_inc, common_inc], 23 | dependencies: deps, 24 | c_args: cflags, 25 | install: true, 26 | install_rpath: gsd_pkglibdir, 27 | install_dir: gsd_libexecdir 28 | ) 29 | 30 | programs = [ 31 | 'gsd-disk-space-test', 32 | 'gsd-empty-trash-test', 33 | 'gsd-purge-temp-test' 34 | ] 35 | 36 | foreach program: programs 37 | executable( 38 | program, 39 | common_files + [program + '.c'], 40 | include_directories: top_inc, 41 | dependencies: deps 42 | ) 43 | endforeach 44 | -------------------------------------------------------------------------------- /plugins/keyboard/.indent.pro: -------------------------------------------------------------------------------- 1 | -kr -i8 -pcs -lps -psl 2 | 3 | -------------------------------------------------------------------------------- /plugins/keyboard/gsd-keyboard-manager.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #ifndef __GSD_KEYBOARD_MANAGER_H 21 | #define __GSD_KEYBOARD_MANAGER_H 22 | 23 | #include "gsd-application.h" 24 | 25 | G_BEGIN_DECLS 26 | 27 | #define GSD_TYPE_KEYBOARD_MANAGER (gsd_keyboard_manager_get_type ()) 28 | 29 | G_DECLARE_FINAL_TYPE (GsdKeyboardManager, gsd_keyboard_manager, GSD, KEYBOARD_MANAGER, GsdApplication) 30 | 31 | G_END_DECLS 32 | 33 | #endif /* __GSD_KEYBOARD_MANAGER_H */ 34 | -------------------------------------------------------------------------------- /plugins/keyboard/main.c: -------------------------------------------------------------------------------- 1 | #include "gsd-main-helper.h" 2 | #include "gsd-keyboard-manager.h" 3 | 4 | int 5 | main (int argc, char **argv) 6 | { 7 | return gsd_main_helper (GSD_TYPE_KEYBOARD_MANAGER, argc, argv); 8 | } 9 | -------------------------------------------------------------------------------- /plugins/keyboard/meson.build: -------------------------------------------------------------------------------- 1 | sources = files( 2 | 'gsd-keyboard-manager.c', 3 | 'main.c' 4 | ) 5 | sources += main_helper_sources 6 | 7 | deps = plugins_deps + [ 8 | gsd_enums_dep, 9 | gtk_dep, 10 | libcommon_dep, 11 | x11_dep 12 | ] 13 | 14 | cflags += ['-DUSE_GTK=1'] 15 | 16 | executable( 17 | 'gsd-' + plugin_name, 18 | sources, 19 | include_directories: top_inc, 20 | dependencies: deps, 21 | c_args: cflags, 22 | install: true, 23 | install_rpath: gsd_pkglibdir, 24 | install_dir: gsd_libexecdir 25 | ) 26 | -------------------------------------------------------------------------------- /plugins/media-keys/bus-watch-namespace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Canonical Ltd. 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as 6 | * published by the Free Software Foundation; either version 2 of the 7 | * License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, but 10 | * WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with this program. If not, see . 16 | * 17 | * Author: Lars Uebernickel 18 | */ 19 | 20 | #ifndef __BUS_WATCH_NAMESPACE_H__ 21 | #define __BUS_WATCH_NAMESPACE_H__ 22 | 23 | #include 24 | 25 | guint bus_watch_namespace (GBusType bus_type, 26 | const gchar *name_space, 27 | GBusNameAppearedCallback appeared_handler, 28 | GBusNameVanishedCallback vanished_handler, 29 | gpointer user_data, 30 | GDestroyNotify user_data_destroy); 31 | 32 | void bus_unwatch_namespace (guint id); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /plugins/media-keys/gsd-marshal.list: -------------------------------------------------------------------------------- 1 | VOID:STRING,STRING 2 | -------------------------------------------------------------------------------- /plugins/media-keys/gsd-media-keys-manager.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #ifndef __GSD_MEDIA_KEYS_MANAGER_H 21 | #define __GSD_MEDIA_KEYS_MANAGER_H 22 | 23 | #include "gsd-application.h" 24 | 25 | G_BEGIN_DECLS 26 | 27 | #define GSD_TYPE_MEDIA_KEYS_MANAGER (gsd_media_keys_manager_get_type ()) 28 | 29 | G_DECLARE_DERIVABLE_TYPE (GsdMediaKeysManager, gsd_media_keys_manager, GSD, MEDIA_KEYS_MANAGER, GsdApplication) 30 | 31 | struct _GsdMediaKeysManagerClass 32 | { 33 | GsdApplicationClass parent_class; 34 | 35 | void (* media_player_key_pressed) (GsdMediaKeysManager *manager, 36 | const char *application, 37 | const char *key); 38 | }; 39 | 40 | G_END_DECLS 41 | 42 | #endif /* __GSD_MEDIA_KEYS_MANAGER_H */ 43 | -------------------------------------------------------------------------------- /plugins/media-keys/main.c: -------------------------------------------------------------------------------- 1 | #include "gsd-main-helper.h" 2 | #include "gsd-media-keys-manager.h" 3 | 4 | int 5 | main (int argc, char **argv) 6 | { 7 | return gsd_main_helper (GSD_TYPE_MEDIA_KEYS_MANAGER, argc, argv); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /plugins/media-keys/media-keys.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2001 Bastien Nocera 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | */ 18 | 19 | #ifndef __MEDIA_KEYS_H__ 20 | #define __MEDIA_KEYS_H__ 21 | 22 | typedef enum { 23 | TOUCHPAD_KEY, 24 | TOUCHPAD_ON_KEY, 25 | TOUCHPAD_OFF_KEY, 26 | MUTE_KEY, 27 | VOLUME_DOWN_KEY, 28 | VOLUME_UP_KEY, 29 | MIC_MUTE_KEY, 30 | MUTE_QUIET_KEY, 31 | VOLUME_DOWN_QUIET_KEY, 32 | VOLUME_UP_QUIET_KEY, 33 | VOLUME_DOWN_PRECISE_KEY, 34 | VOLUME_UP_PRECISE_KEY, 35 | LOGOUT_KEY, 36 | REBOOT_KEY, 37 | SHUTDOWN_KEY, 38 | EJECT_KEY, 39 | HOME_KEY, 40 | MEDIA_KEY, 41 | CALCULATOR_KEY, 42 | SEARCH_KEY, 43 | EMAIL_KEY, 44 | CONTROL_CENTER_KEY, 45 | SCREENSAVER_KEY, 46 | HELP_KEY, 47 | WWW_KEY, 48 | PLAY_KEY, 49 | PAUSE_KEY, 50 | STOP_KEY, 51 | PREVIOUS_KEY, 52 | NEXT_KEY, 53 | REWIND_KEY, 54 | FORWARD_KEY, 55 | REPEAT_KEY, 56 | RANDOM_KEY, 57 | ROTATE_VIDEO_LOCK_KEY, 58 | MAGNIFIER_KEY, 59 | SCREENREADER_KEY, 60 | ON_SCREEN_KEYBOARD_KEY, 61 | INCREASE_TEXT_KEY, 62 | DECREASE_TEXT_KEY, 63 | TOGGLE_CONTRAST_KEY, 64 | MAGNIFIER_ZOOM_IN_KEY, 65 | MAGNIFIER_ZOOM_OUT_KEY, 66 | POWER_KEY, 67 | SUSPEND_KEY, 68 | HIBERNATE_KEY, 69 | SCREEN_BRIGHTNESS_UP_KEY, 70 | SCREEN_BRIGHTNESS_DOWN_KEY, 71 | SCREEN_BRIGHTNESS_CYCLE_KEY, 72 | KEYBOARD_BRIGHTNESS_UP_KEY, 73 | KEYBOARD_BRIGHTNESS_DOWN_KEY, 74 | KEYBOARD_BRIGHTNESS_TOGGLE_KEY, 75 | BATTERY_KEY, 76 | RFKILL_KEY, 77 | BLUETOOTH_RFKILL_KEY, 78 | CUSTOM_KEY 79 | } MediaKeyType; 80 | 81 | #endif /* __MEDIA_KEYS_H__ */ 82 | -------------------------------------------------------------------------------- /plugins/media-keys/meson.build: -------------------------------------------------------------------------------- 1 | sources = files( 2 | 'bus-watch-namespace.c', 3 | 'gsd-media-keys-manager.c', 4 | 'main.c', 5 | 'mpris-controller.c' 6 | ) 7 | 8 | sources += main_helper_sources 9 | 10 | marshal = 'gsd-marshal' 11 | 12 | sources += gnome.genmarshal( 13 | marshal, 14 | sources: marshal + '.list', 15 | prefix: marshal.underscorify(), 16 | internal: true 17 | ) 18 | 19 | sources += gnome.gdbus_codegen( 20 | 'shell-key-grabber', 21 | 'org.gnome.ShellKeyGrabber.xml', 22 | interface_prefix: 'org.gnome.', 23 | namespace: 'Shell' 24 | ) 25 | 26 | deps = plugins_deps + [ 27 | gio_unix_dep, 28 | gsd_enums_dep, 29 | gsettings_desktop_dep, 30 | libcanberra_gtk_dep, 31 | libcommon_dep, 32 | gnome_desktop_dep, 33 | libgvc_dep, 34 | libpulse_mainloop_glib_dep, 35 | m_dep, 36 | upower_glib_dep 37 | ] 38 | 39 | if enable_gudev 40 | deps += gudev_dep 41 | endif 42 | 43 | cflags += ['-DUSE_GTK=1'] 44 | 45 | executable( 46 | 'gsd-' + plugin_name, 47 | sources, 48 | include_directories: top_inc, 49 | dependencies: deps, 50 | c_args: cflags, 51 | install: true, 52 | install_rpath: gsd_pkglibdir, 53 | install_dir: gsd_libexecdir 54 | ) 55 | 56 | program = 'audio-selection-test' 57 | 58 | executable( 59 | program, 60 | program + '.c', 61 | include_directories: top_inc, 62 | dependencies: deps 63 | ) 64 | -------------------------------------------------------------------------------- /plugins/media-keys/mpris-controller.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2013 Intel Corporation. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it 5 | * under the terms and conditions of the GNU Lesser General Public License, 6 | * version 2.1, as published by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope it will be useful, but WITHOUT ANY 9 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 10 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 11 | * details. 12 | * 13 | * You should have received a copy of the GNU Lesser General Public License 14 | * along with this program; if not, see 15 | * 16 | * Author: Michael Wood 17 | */ 18 | 19 | #ifndef __MPRIS_CONTROLLER_H__ 20 | #define __MPRIS_CONTROLLER_H__ 21 | 22 | #include 23 | 24 | G_BEGIN_DECLS 25 | 26 | #define MPRIS_TYPE_CONTROLLER mpris_controller_get_type() 27 | 28 | G_DECLARE_FINAL_TYPE (MprisController, mpris_controller, MPRIS, CONTROLLER, GObject) 29 | 30 | MprisController *mpris_controller_new (void); 31 | gboolean mpris_controller_key (MprisController *self, const gchar *key); 32 | gboolean mpris_controller_seek (MprisController *self, gint64 offset); 33 | gboolean mpris_controller_toggle (MprisController *self, const gchar *property); 34 | gboolean mpris_controller_get_has_active_player (MprisController *controller); 35 | 36 | G_END_DECLS 37 | 38 | #endif /* __MPRIS_CONTROLLER_H__ */ 39 | -------------------------------------------------------------------------------- /plugins/media-keys/org.gnome.ShellKeyGrabber.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /plugins/media-keys/shell-action-modes.h: -------------------------------------------------------------------------------- 1 | /** 2 | * ShellActionMode: 3 | * @SHELL_ACTION_MODE_NONE: block action 4 | * @SHELL_ACTION_MODE_NORMAL: allow action when in window mode, 5 | * e.g. when the focus is in an application window 6 | * @SHELL_ACTION_MODE_OVERVIEW: allow action while the overview 7 | * is active 8 | * @SHELL_ACTION_MODE_LOCK_SCREEN: allow action when the screen 9 | * is locked, e.g. when the screen shield is shown 10 | * @SHELL_ACTION_MODE_UNLOCK_SCREEN: allow action in the unlock 11 | * dialog 12 | * @SHELL_ACTION_MODE_LOGIN_SCREEN: allow action in the login screen 13 | * @SHELL_ACTION_MODE_SYSTEM_MODAL: allow action when a system modal 14 | * dialog (e.g. authentification or session dialogs) is open 15 | * @SHELL_ACTION_MODE_LOOKING_GLASS: allow action in looking glass 16 | * @SHELL_ACTION_MODE_POPUP: allow action while a shell menu is open 17 | * @SHELL_ACTION_MODE_ALL: always allow action 18 | * 19 | * Controls in which GNOME Shell states an action (like keybindings and gestures) 20 | * should be handled. 21 | */ 22 | typedef enum { 23 | SHELL_ACTION_MODE_NONE = 0, 24 | SHELL_ACTION_MODE_NORMAL = 1 << 0, 25 | SHELL_ACTION_MODE_OVERVIEW = 1 << 1, 26 | SHELL_ACTION_MODE_LOCK_SCREEN = 1 << 2, 27 | SHELL_ACTION_MODE_UNLOCK_SCREEN = 1 << 3, 28 | SHELL_ACTION_MODE_LOGIN_SCREEN = 1 << 4, 29 | SHELL_ACTION_MODE_SYSTEM_MODAL = 1 << 5, 30 | SHELL_ACTION_MODE_LOOKING_GLASS = 1 << 6, 31 | SHELL_ACTION_MODE_POPUP = 1 << 7, 32 | 33 | SHELL_ACTION_MODE_ALL = ~0, 34 | } ShellActionMode; 35 | 36 | /** 37 | * MetaKeyBindingFlags: 38 | * @META_KEY_BINDING_NONE: none 39 | * @META_KEY_BINDING_PER_WINDOW: per-window 40 | * @META_KEY_BINDING_BUILTIN: built-in 41 | * @META_KEY_BINDING_IS_REVERSED: is reversed 42 | * @META_KEY_BINDING_NON_MASKABLE: always active 43 | * @META_KEY_BINDING_IGNORE_AUTOREPEAT: ignore key autorepeat 44 | */ 45 | typedef enum 46 | { 47 | META_KEY_BINDING_NONE, 48 | META_KEY_BINDING_PER_WINDOW = 1 << 0, 49 | META_KEY_BINDING_BUILTIN = 1 << 1, 50 | META_KEY_BINDING_IS_REVERSED = 1 << 2, 51 | META_KEY_BINDING_NON_MASKABLE = 1 << 3, 52 | META_KEY_BINDING_IGNORE_AUTOREPEAT = 1 << 4, 53 | } MetaKeyBindingFlags; -------------------------------------------------------------------------------- /plugins/meson-add-wants.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | # Script copied from systemd 5 | 6 | unitdir="$1" 7 | target="$2" 8 | unit="$3" 9 | 10 | case "$target" in 11 | */?*) # a path, but not just a slash at the end 12 | dir="${DESTDIR:-}${target}" 13 | ;; 14 | *) 15 | dir="${DESTDIR:-}${unitdir}/${target}" 16 | ;; 17 | esac 18 | 19 | unitpath="${DESTDIR:-}${unitdir}/${unit}" 20 | 21 | case "$target" in 22 | */) 23 | mkdir -vp -m 0755 "$dir" 24 | ;; 25 | *) 26 | mkdir -vp -m 0755 "$(dirname "$dir")" 27 | ;; 28 | esac 29 | 30 | ln -vfs --relative "$unitpath" "$dir" 31 | -------------------------------------------------------------------------------- /plugins/org.gnome.SettingsDaemon.Dummy.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Name=GNOME Settings Daemon's @pluginname@ dummy autostart file 4 | Exec=false 5 | OnlyShowIn=GNOME; 6 | NoDisplay=true 7 | Hidden=true 8 | -------------------------------------------------------------------------------- /plugins/org.gnome.SettingsDaemon.Real.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Name=@description@ 4 | Exec=@libexecdir@/gsd-@pluginname@ 5 | OnlyShowIn=GNOME; 6 | NoDisplay=true 7 | X-GNOME-Autostart-Phase=Initialization 8 | X-GNOME-Autostart-Notify=true 9 | X-GNOME-AutoRestart=true 10 | X-GNOME-HiddenUnderSystemd=@systemd_hidden@ 11 | -------------------------------------------------------------------------------- /plugins/power/gpm-common.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2005-2011 Richard Hughes 4 | * 5 | * Licensed under the GNU General Public License Version 2 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20 | */ 21 | 22 | #ifndef __GPMCOMMON_H 23 | #define __GPMCOMMON_H 24 | 25 | #include 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | /* UPower helpers */ 31 | gchar *gpm_get_timestring (guint time); 32 | 33 | /* Power helpers */ 34 | gboolean gsd_power_is_hardware_a_vm (void); 35 | guint gsd_power_enable_screensaver_watchdog (void); 36 | void reset_idletime (void); 37 | 38 | /* Backlight helpers */ 39 | 40 | /* on ACPI machines we have 4-16 levels, on others it's ~150 */ 41 | #define BRIGHTNESS_STEP_AMOUNT(max) ((max) < 20 ? 1 : (max) / 20) 42 | 43 | #define ABS_TO_PERCENTAGE(min, max, value) gsd_power_backlight_abs_to_percentage(min, max, value) 44 | #define PERCENTAGE_TO_ABS(min, max, value) gsd_power_backlight_percentage_to_abs(min, max, value) 45 | 46 | int gsd_power_backlight_abs_to_percentage (int min, int max, int value); 47 | int gsd_power_backlight_percentage_to_abs (int min, int max, int value); 48 | 49 | /* RandR helpers */ 50 | void watch_external_monitor (void); 51 | gboolean external_monitor_is_connected (void); 52 | 53 | /* Sound helpers */ 54 | void play_loop_start (guint *id); 55 | void play_loop_stop (guint *id); 56 | 57 | G_END_DECLS 58 | 59 | #endif /* __GPMCOMMON_H */ 60 | -------------------------------------------------------------------------------- /plugins/power/gsd-power-constants-update.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | # Author : Simos Xenitellis . 4 | # Author : Bastien Nocera 5 | # Version : 1.2 6 | # 7 | # Input : gsd-power-constants.h 8 | # Output : gsdpowerconstants.py 9 | # 10 | use strict; 11 | 12 | # Used for reading the keysymdef symbols. 13 | my @constantselements; 14 | 15 | (scalar @ARGV >= 2) or die "Usage: $0 \n"; 16 | my ($input, $output) = @ARGV; 17 | 18 | die "Could not open file gsd-power-constants.h: $!\n" unless open(IN_CONSTANTS, "<:utf8", $input); 19 | 20 | # Output: gtk+/gdk/gdkkeysyms.h 21 | die "Could not open file gsdpowerconstants.py: $!\n" unless open(OUT_CONSTANTS, ">:utf8", $output); 22 | 23 | print OUT_CONSTANTS<) 35 | { 36 | next if ( ! /^#define / ); 37 | 38 | @constantselements = split(/\s+/); 39 | die "Internal error, no \@constantselements: $_\n" unless @constantselements; 40 | 41 | my $constant = $constantselements[1]; 42 | my $value = $constantselements[2]; 43 | 44 | printf OUT_CONSTANTS "%s = %s;\n", $constant, $value; 45 | } 46 | 47 | close IN_CONSTANTS; 48 | 49 | printf "We just finished converting $input to $output\nThank you\n"; 50 | -------------------------------------------------------------------------------- /plugins/power/gsd-power-constants.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2013 Red Hat Inc. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | /* The blank delay when the screensaver is active */ 21 | #define SCREENSAVER_TIMEOUT_BLANK 30 /* seconds */ 22 | 23 | /* The dim delay when dimming on idle is requested but idle-delay 24 | * is set to "Never" */ 25 | #define IDLE_DIM_BLANK_DISABLED_MIN 60 /* seconds */ 26 | 27 | /* Which fraction of the idle-delay is the idle-dim delay */ 28 | #define IDLE_DELAY_TO_IDLE_DIM_MULTIPLIER 1.0/2.0 29 | 30 | /* The dim delay under which we do not bother dimming */ 31 | #define MINIMUM_IDLE_DIM_DELAY 10 /* seconds */ 32 | 33 | /* The amount of time we'll undim if the machine is idle when plugged in */ 34 | #define POWER_UP_TIME_ON_AC 15 /* seconds */ 35 | 36 | /* Default brightness values for the mock backlight used in the test suite */ 37 | #define GSD_MOCK_DEFAULT_BRIGHTNESS 50 38 | #define GSD_MOCK_MAX_BRIGHTNESS 100 39 | 40 | /* When unplugging the external monitor, give a certain amount 41 | * of time before suspending the laptop */ 42 | #define LID_CLOSE_SAFETY_TIMEOUT 8 /* seconds */ 43 | -------------------------------------------------------------------------------- /plugins/power/gsd-power-enums-update.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | /* XXX: The following functions use printf, because otherwise there were 6 | * build failures when the building with the memory sanitizer enabled. 7 | * These may be false positives though. 8 | */ 9 | 10 | static void 11 | output_enum_values (GType class_type) 12 | { 13 | GEnumClass *eclass; 14 | guint i; 15 | 16 | eclass = G_ENUM_CLASS (g_type_class_peek (class_type)); 17 | for (i = 0; i < eclass->n_values; i++) { 18 | GEnumValue *value = &(eclass->values[i]); 19 | printf ("%s = %d;\n", value->value_name, value->value); 20 | } 21 | } 22 | 23 | static void 24 | output_flags_values (GType class_type) 25 | { 26 | GFlagsClass *fclass; 27 | guint i; 28 | 29 | fclass = G_FLAGS_CLASS (g_type_class_peek (class_type)); 30 | for (i = 0; i < fclass->n_values; i++) { 31 | GFlagsValue *value = &(fclass->values[i]); 32 | printf ("%s = %d;\n", value->value_name, value->value); 33 | } 34 | } 35 | 36 | int 37 | main (int argc, char **argv) 38 | { 39 | g_type_class_ref (GSD_POWER_TYPE_INHIBITOR_FLAG); 40 | g_type_class_ref (GSD_POWER_TYPE_PRESENCE_STATUS); 41 | output_flags_values (GSD_POWER_TYPE_INHIBITOR_FLAG); 42 | output_enum_values (GSD_POWER_TYPE_PRESENCE_STATUS); 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /plugins/power/gsd-power-enums.c.in: -------------------------------------------------------------------------------- 1 | /*** BEGIN file-header ***/ 2 | #include "gsd-power-enums.h" 3 | #include 4 | 5 | /*** END file-header ***/ 6 | 7 | /*** BEGIN file-production ***/ 8 | /* enumerations from "@basename@" */ 9 | #include "@basename@" 10 | 11 | /*** END file-production ***/ 12 | 13 | /*** BEGIN value-header ***/ 14 | GType 15 | @enum_name@_get_type (void) 16 | { 17 | static GType the_type = 0; 18 | 19 | if (the_type == 0) 20 | { 21 | static const G@Type@Value values[] = { 22 | /*** END value-header ***/ 23 | 24 | /*** BEGIN value-production ***/ 25 | { @VALUENAME@, 26 | "@VALUENAME@", 27 | "@valuenick@" }, 28 | /*** END value-production ***/ 29 | 30 | /*** BEGIN value-tail ***/ 31 | { 0, NULL, NULL } 32 | }; 33 | the_type = g_@type@_register_static ( 34 | g_intern_static_string ("@EnumName@"), 35 | values); 36 | } 37 | return the_type; 38 | } 39 | 40 | /*** END value-tail ***/ 41 | -------------------------------------------------------------------------------- /plugins/power/gsd-power-enums.h.in: -------------------------------------------------------------------------------- 1 | /*** BEGIN file-header ***/ 2 | #ifndef GSD_POWER_ENUMS_H 3 | #define GSD_POWER_ENUMS_H 4 | 5 | #include 6 | 7 | G_BEGIN_DECLS 8 | 9 | /*** END file-header ***/ 10 | 11 | /*** BEGIN file-production ***/ 12 | /* Enumerations from "@basename@" */ 13 | 14 | /*** END file-production ***/ 15 | 16 | /*** BEGIN enumeration-production ***/ 17 | #define GSD_POWER_TYPE_@ENUMSHORT@ (@enum_name@_get_type()) 18 | GType @enum_name@_get_type (void) G_GNUC_CONST; 19 | 20 | /*** END enumeration-production ***/ 21 | 22 | /*** BEGIN file-tail ***/ 23 | G_END_DECLS 24 | 25 | #endif /* !GSD_POWER_ENUMS_H */ 26 | /*** END file-tail ***/ 27 | 28 | -------------------------------------------------------------------------------- /plugins/power/gsd-power-manager.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #ifndef __GSD_POWER_MANAGER_H 21 | #define __GSD_POWER_MANAGER_H 22 | 23 | #include "gsd-application.h" 24 | 25 | G_BEGIN_DECLS 26 | 27 | #define GSD_TYPE_POWER_MANAGER (gsd_power_manager_get_type ()) 28 | #define GSD_POWER_MANAGER_ERROR (gsd_power_manager_error_quark ()) 29 | 30 | G_DECLARE_FINAL_TYPE (GsdPowerManager, gsd_power_manager, GSD, POWER_MANAGER, GsdApplication) 31 | 32 | enum 33 | { 34 | GSD_POWER_MANAGER_ERROR_FAILED, 35 | GSD_POWER_MANAGER_ERROR_NO_BACKLIGHT, 36 | }; 37 | 38 | GQuark gsd_power_manager_error_quark (void); 39 | 40 | G_END_DECLS 41 | 42 | #endif /* __GSD_POWER_MANAGER_H */ 43 | -------------------------------------------------------------------------------- /plugins/power/gsdpowerconstants.py: -------------------------------------------------------------------------------- 1 | 2 | # File auto-generated from script http://git.gnome.org/browse/gnome-settings-daemon/tree/plugins/power/gsd-power-constants-update.pl 3 | 4 | # Modified by the GTK+ Team and others 1997-2012. See the AUTHORS 5 | # file for a list of people on the GTK+ Team. See the ChangeLog 6 | # files for a list of changes. These files are distributed with 7 | # GTK+ at ftp://ftp.gtk.org/pub/gtk/. 8 | 9 | SCREENSAVER_TIMEOUT_BLANK = 15; 10 | IDLE_DIM_BLANK_DISABLED_MIN = 60; 11 | IDLE_DELAY_TO_IDLE_DIM_MULTIPLIER = 1.0/2.0; 12 | MINIMUM_IDLE_DIM_DELAY = 10; 13 | POWER_UP_TIME_ON_AC = 15; 14 | GSD_MOCK_DEFAULT_BRIGHTNESS = 50; 15 | GSD_MOCK_MAX_BRIGHTNESS = 100; 16 | LID_CLOSE_SAFETY_TIMEOUT = 8; 17 | -------------------------------------------------------------------------------- /plugins/power/gsm-inhibitor-flag.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2008 Red Hat, Inc. 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, but 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | */ 18 | 19 | #ifndef __GSM_INHIBITOR_FLAG_H__ 20 | #define __GSM_INHIBITOR_FLAG_H__ 21 | 22 | #include 23 | 24 | G_BEGIN_DECLS 25 | 26 | typedef enum { 27 | GSM_INHIBITOR_FLAG_LOGOUT = 1 << 0, 28 | GSM_INHIBITOR_FLAG_SWITCH_USER = 1 << 1, 29 | GSM_INHIBITOR_FLAG_SUSPEND = 1 << 2, 30 | GSM_INHIBITOR_FLAG_IDLE = 1 << 3, 31 | GSM_INHIBITOR_FLAG_AUTOMOUNT = 1 << 4 32 | } GsmInhibitorFlag; 33 | 34 | G_END_DECLS 35 | 36 | #endif /* __GSM_INHIBITOR_FLAG_H__ */ 37 | -------------------------------------------------------------------------------- /plugins/power/gsm-manager-logout-mode.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2008 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | 21 | #ifndef __GSM_MANAGER_LOGOUT_MODE_H 22 | #define __GSM_MANAGER_LOGOUT_MODE_H 23 | 24 | G_BEGIN_DECLS 25 | 26 | typedef enum { 27 | GSM_MANAGER_LOGOUT_MODE_NORMAL = 0, 28 | GSM_MANAGER_LOGOUT_MODE_NO_CONFIRMATION, 29 | GSM_MANAGER_LOGOUT_MODE_FORCE 30 | } GsmManagerLogoutMode; 31 | 32 | G_END_DECLS 33 | 34 | #endif /* __GSM_MANAGER_LOGOUT_MODE_H */ 35 | -------------------------------------------------------------------------------- /plugins/power/gsm-presence-flag.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2009 Red Hat, Inc. 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, but 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | */ 18 | 19 | #ifndef __GSM_PRESENCE_FLAG_H__ 20 | #define __GSM_PRESENCE_FLAG_H__ 21 | 22 | G_BEGIN_DECLS 23 | 24 | typedef enum { 25 | GSM_PRESENCE_STATUS_AVAILABLE = 0, 26 | GSM_PRESENCE_STATUS_INVISIBLE, 27 | GSM_PRESENCE_STATUS_BUSY, 28 | GSM_PRESENCE_STATUS_IDLE, 29 | } GsmPresenceStatus; 30 | 31 | G_END_DECLS 32 | 33 | #endif /* __GSM_PRESENCE_FLAG_H__ */ 34 | -------------------------------------------------------------------------------- /plugins/power/main.c: -------------------------------------------------------------------------------- 1 | #include "gsd-main-helper.h" 2 | #include "gsd-power-manager.h" 3 | 4 | int 5 | main (int argc, char **argv) 6 | { 7 | return gsd_main_helper (GSD_TYPE_POWER_MANAGER, argc, argv); 8 | } 9 | -------------------------------------------------------------------------------- /plugins/power/meson.build: -------------------------------------------------------------------------------- 1 | sources = files( 2 | 'gpm-common.c', 3 | 'gsd-backlight.c', 4 | 'gsd-power-manager.c', 5 | 'main.c' 6 | ) 7 | sources += main_helper_sources 8 | 9 | deps = plugins_deps + [ 10 | libcanberra_gtk_dep, 11 | libcommon_dep, 12 | libnotify_dep, 13 | gio_unix_dep, 14 | gnome_desktop_dep, 15 | gsd_enums_dep, 16 | m_dep, 17 | upower_glib_dep, 18 | x11_dep, 19 | dependency('xext') 20 | ] 21 | 22 | # required for gsd-power-enums-update, which we have 23 | # to compile natively 24 | native_deps = [ 25 | dependency('glib-2.0', native: true), 26 | dependency('gio-2.0', native:true) 27 | ] 28 | 29 | if host_is_linux 30 | deps += gudev_dep 31 | endif 32 | 33 | cflags += ['-DLIBEXECDIR="@0@"'.format(gsd_libexecdir)] 34 | cflags += ['-DUSE_GTK=1'] 35 | 36 | gsd_power = executable( 37 | 'gsd-' + plugin_name, 38 | sources, 39 | include_directories: top_inc, 40 | dependencies: deps, 41 | c_args: cflags, 42 | install: true, 43 | install_rpath: gsd_pkglibdir, 44 | install_dir: gsd_libexecdir 45 | ) 46 | 47 | sources = files('gsd-power-enums-update.c') 48 | 49 | enums_headers = files( 50 | 'gsm-inhibitor-flag.h', 51 | 'gsm-presence-flag.h' 52 | ) 53 | 54 | enums = 'gsd-power-enums' 55 | 56 | sources += gnome.mkenums( 57 | enums, 58 | sources: enums_headers, 59 | c_template: enums + '.c.in', 60 | h_template: enums + '.h.in' 61 | ) 62 | 63 | gsd_power_enums_update = executable( 64 | 'gsd-power-enums-update', 65 | sources, 66 | include_directories: top_inc, 67 | dependencies: native_deps, 68 | c_args: cflags, 69 | native: true 70 | ) 71 | 72 | output = 'gsdpowerconstants.py' 73 | 74 | gsdpowerconstants_py = custom_target( 75 | output, 76 | input: 'gsd-power-constants.h', 77 | output: output, 78 | build_by_default: true, 79 | command: [join_paths(meson.current_source_dir(), 'gsd-power-constants-update.pl'), '@INPUT@', '@OUTPUT@'] 80 | ) 81 | 82 | output = 'gsdpowerenums.py' 83 | 84 | gsdpowerenums_py = custom_target( 85 | output, 86 | output: output, 87 | capture: true, 88 | build_by_default: true, 89 | command: [gsd_power_enums_update] 90 | ) 91 | 92 | test_py = find_program('test.py') 93 | fs.copyfile('dbusmock-templates/mutter.py') 94 | 95 | envs = environment() 96 | #envs.prepend('G_DEBUG', 'fatal-warnings') 97 | envs.set('BUILDDIR', meson.current_build_dir()) 98 | envs.set('TOP_BUILDDIR', meson.project_build_root()) 99 | envs.set('NO_AT_BRIDGE', '1') 100 | 101 | tests = [ 102 | 'Screensaver', 103 | 'ScreensaverNoblank', 104 | 'Battery', 105 | 'Lid', 106 | 'Dim', 107 | 'BatteryLevels', 108 | 'Brightness', 109 | 'BrightnessStep', 110 | ] 111 | 112 | foreach test : tests 113 | test( 114 | 'test-power @0@'.format(test), 115 | test_py, 116 | args: [ 'PowerPluginTest@0@'.format(test) ], 117 | env: envs, 118 | # The first set of tests takes very long because of SCREENSAVER_TIMEOUT_BLANK 119 | timeout: test == 'Screensaver' ? 180 : 120 120 | ) 121 | endforeach 122 | 123 | -------------------------------------------------------------------------------- /plugins/print-notifications/gsd-print-notifications-manager.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #ifndef __GSD_PRINT_NOTIFICATIONS_MANAGER_H 21 | #define __GSD_PRINT_NOTIFICATIONS_MANAGER_H 22 | 23 | #include "gsd-application.h" 24 | 25 | G_BEGIN_DECLS 26 | 27 | #define GSD_TYPE_PRINT_NOTIFICATIONS_MANAGER (gsd_print_notifications_manager_get_type ()) 28 | 29 | G_DECLARE_FINAL_TYPE (GsdPrintNotificationsManager, gsd_print_notifications_manager, GSD, PRINT_NOTIFICATIONS_MANAGER, GsdApplication) 30 | 31 | G_END_DECLS 32 | 33 | #endif /* __GSD_PRINT_NOTIFICATIONS_MANAGER_H */ 34 | -------------------------------------------------------------------------------- /plugins/print-notifications/main.c: -------------------------------------------------------------------------------- 1 | #include "gsd-main-helper.h" 2 | #include "gsd-print-notifications-manager.h" 3 | 4 | int 5 | main (int argc, char **argv) 6 | { 7 | return gsd_main_helper (GSD_TYPE_PRINT_NOTIFICATIONS_MANAGER, argc, argv); 8 | } 9 | -------------------------------------------------------------------------------- /plugins/print-notifications/meson.build: -------------------------------------------------------------------------------- 1 | sources = files( 2 | 'gsd-print-notifications-manager.c', 3 | 'main.c' 4 | ) 5 | sources += main_helper_sources 6 | 7 | deps = plugins_deps + [ 8 | cups_dep, 9 | gtk_dep, 10 | libnotify_dep 11 | ] 12 | 13 | cflags += ['-DLIBEXECDIR="@0@"'.format(gsd_libexecdir)] 14 | cflags += ['-DBINDIR="@0@"'.format(gsd_bindir)] 15 | 16 | executable( 17 | 'gsd-' + plugin_name, 18 | sources, 19 | include_directories: [top_inc, common_inc], 20 | dependencies: deps, 21 | c_args: cflags, 22 | install: true, 23 | install_rpath: gsd_pkglibdir, 24 | install_dir: gsd_libexecdir 25 | ) 26 | 27 | program = 'gsd-printer' 28 | 29 | executable( 30 | program, 31 | program + '.c', 32 | include_directories: top_inc, 33 | dependencies: deps, 34 | c_args: '-DGNOME_SETTINGS_LOCALEDIR="@0@"'.format(gsd_localedir), 35 | install: true, 36 | install_rpath: gsd_pkglibdir, 37 | install_dir: gsd_libexecdir 38 | ) 39 | -------------------------------------------------------------------------------- /plugins/rfkill/61-gnome-settings-daemon-rfkill.rules: -------------------------------------------------------------------------------- 1 | # Get access to /dev/rfkill for users 2 | # See https://bugzilla.redhat.com/show_bug.cgi?id=514798 3 | # 4 | # Simplified by Kay Sievers 5 | # https://bugzilla.redhat.com/show_bug.cgi?id=733326 6 | # See also https://bugzilla.gnome.org/show_bug.cgi?id=711373 7 | 8 | KERNEL=="rfkill", SUBSYSTEM=="misc", TAG+="uaccess" 9 | -------------------------------------------------------------------------------- /plugins/rfkill/gsd-rfkill-manager.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * Copyright (C) 2010 Red Hat, Inc. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | * 19 | */ 20 | 21 | #ifndef __GSD_RFKILL_MANAGER_H 22 | #define __GSD_RFKILL_MANAGER_H 23 | 24 | #include "gsd-application.h" 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define GSD_TYPE_RFKILL_MANAGER (gsd_rfkill_manager_get_type ()) 29 | 30 | G_DECLARE_FINAL_TYPE (GsdRfkillManager, gsd_rfkill_manager, GSD, RFKILL_MANAGER, GsdApplication) 31 | 32 | G_END_DECLS 33 | 34 | #endif /* __GSD_RFKILL_MANAGER_H */ 35 | -------------------------------------------------------------------------------- /plugins/rfkill/main.c: -------------------------------------------------------------------------------- 1 | #include "gsd-main-helper.h" 2 | #include "gsd-rfkill-manager.h" 3 | 4 | int 5 | main (int argc, char **argv) 6 | { 7 | return gsd_main_helper (GSD_TYPE_RFKILL_MANAGER, argc, argv); 8 | } 9 | -------------------------------------------------------------------------------- /plugins/rfkill/meson.build: -------------------------------------------------------------------------------- 1 | install_data( 2 | '61-gnome-settings-daemon-rfkill.rules', 3 | install_dir: join_paths(udev_dir, 'rules.d') 4 | ) 5 | 6 | sources = files( 7 | 'gsd-rfkill-manager.c', 8 | 'rfkill-glib.c', 9 | 'main.c' 10 | ) 11 | sources += main_helper_sources 12 | 13 | deps = plugins_deps 14 | deps += [ 15 | gio_unix_dep, 16 | gudev_dep, 17 | m_dep 18 | ] 19 | 20 | executable( 21 | 'gsd-' + plugin_name, 22 | sources, 23 | include_directories: [top_inc, common_inc], 24 | dependencies: deps, 25 | c_args: cflags, 26 | install: true, 27 | install_rpath: gsd_pkglibdir, 28 | install_dir: gsd_libexecdir 29 | ) 30 | -------------------------------------------------------------------------------- /plugins/rfkill/rfkill-glib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * gnome-bluetooth - Bluetooth integration for GNOME 4 | * 5 | * Copyright (C) 2012 Bastien Nocera 6 | * Copyright © 2017 Endless Mobile, Inc. 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | 24 | #ifndef __CC_RFKILL_GLIB_H 25 | #define __CC_RFKILL_GLIB_H 26 | 27 | #include 28 | #include 29 | #include "rfkill.h" 30 | 31 | G_BEGIN_DECLS 32 | 33 | #define CC_RFKILL_TYPE_GLIB cc_rfkill_glib_get_type () 34 | G_DECLARE_FINAL_TYPE (CcRfkillGlib, cc_rfkill_glib, CC_RFKILL, GLIB, GObject) 35 | 36 | CcRfkillGlib *cc_rfkill_glib_new (void); 37 | gboolean cc_rfkill_glib_open (CcRfkillGlib *rfkill, 38 | GError **error); 39 | 40 | gboolean cc_rfkill_glib_get_rfkill_input_inhibited (CcRfkillGlib *rfkill); 41 | void cc_rfkill_glib_set_rfkill_input_inhibited (CcRfkillGlib *rfkill, 42 | gboolean noinput); 43 | 44 | void cc_rfkill_glib_send_change_all_event (CcRfkillGlib *rfkill, 45 | guint rfkill_type, 46 | gboolean enable, 47 | GCancellable *cancellable, 48 | GAsyncReadyCallback callback, 49 | gpointer user_data); 50 | 51 | gboolean cc_rfkill_glib_send_change_all_event_finish (CcRfkillGlib *rfkill, 52 | GAsyncResult *res, 53 | GError **error); 54 | 55 | G_END_DECLS 56 | 57 | #endif /* __CC_RFKILL_GLIB_H */ 58 | -------------------------------------------------------------------------------- /plugins/screensaver-proxy/gsd-screensaver-proxy-manager.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2012 Bastien Nocera 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #ifndef __GSD_SCREENSAVER_PROXY_MANAGER_H 21 | #define __GSD_SCREENSAVER_PROXY_MANAGER_H 22 | 23 | #include "gsd-application.h" 24 | 25 | G_BEGIN_DECLS 26 | 27 | #define GSD_TYPE_SCREENSAVER_PROXY_MANAGER (gsd_screensaver_proxy_manager_get_type ()) 28 | 29 | G_DECLARE_FINAL_TYPE (GsdScreensaverProxyManager, gsd_screensaver_proxy_manager, GSD, SCREENSAVER_PROXY_MANAGER, GsdApplication) 30 | 31 | G_END_DECLS 32 | 33 | #endif /* __GSD_SCREENSAVER_PROXY_MANAGER_H */ 34 | -------------------------------------------------------------------------------- /plugins/screensaver-proxy/main.c: -------------------------------------------------------------------------------- 1 | #include "gsd-main-helper.h" 2 | #include "gsd-screensaver-proxy-manager.h" 3 | 4 | int 5 | main (int argc, char **argv) 6 | { 7 | return gsd_main_helper (GSD_TYPE_SCREENSAVER_PROXY_MANAGER, argc, argv); 8 | } 9 | -------------------------------------------------------------------------------- /plugins/screensaver-proxy/meson.build: -------------------------------------------------------------------------------- 1 | sources = files( 2 | 'gsd-screensaver-proxy-manager.c', 3 | 'main.c' 4 | ) 5 | sources += main_helper_sources 6 | 7 | deps = plugins_deps + [gio_dep] 8 | 9 | executable( 10 | 'gsd-' + plugin_name, 11 | sources, 12 | include_directories: [top_inc, common_inc], 13 | dependencies: deps, 14 | c_args: cflags, 15 | install: true, 16 | install_rpath: gsd_pkglibdir, 17 | install_dir: gsd_libexecdir 18 | ) 19 | -------------------------------------------------------------------------------- /plugins/sharing/gsd-sharing-enums.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2014 Bastien Nocera 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #ifndef __GSD_SHARING_ENUMS_H 21 | #define __GSD_SHARING_ENUMS_H 22 | 23 | G_BEGIN_DECLS 24 | 25 | typedef enum { 26 | GSD_SHARING_STATUS_OFFLINE, 27 | GSD_SHARING_STATUS_DISABLED_MOBILE_BROADBAND, 28 | GSD_SHARING_STATUS_DISABLED_LOW_SECURITY, 29 | GSD_SHARING_STATUS_AVAILABLE 30 | } GsdSharingStatus; 31 | 32 | G_END_DECLS 33 | 34 | #endif /* __GSD_SHARING_ENUMS_H */ 35 | -------------------------------------------------------------------------------- /plugins/sharing/gsd-sharing-manager.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #ifndef __GSD_SHARING_MANAGER_H 21 | #define __GSD_SHARING_MANAGER_H 22 | 23 | #include "gsd-application.h" 24 | 25 | G_BEGIN_DECLS 26 | 27 | #define GSD_TYPE_SHARING_MANAGER (gsd_sharing_manager_get_type ()) 28 | 29 | G_DECLARE_FINAL_TYPE (GsdSharingManager, gsd_sharing_manager, GSD, SHARING_MANAGER, GsdApplication) 30 | 31 | G_END_DECLS 32 | 33 | #endif /* __GSD_SHARING_MANAGER_H */ 34 | -------------------------------------------------------------------------------- /plugins/sharing/main.c: -------------------------------------------------------------------------------- 1 | #include "gsd-main-helper.h" 2 | #include "gsd-sharing-manager.h" 3 | 4 | int 5 | main (int argc, char **argv) 6 | { 7 | return gsd_main_helper (GSD_TYPE_SHARING_MANAGER, argc, argv); 8 | } 9 | -------------------------------------------------------------------------------- /plugins/sharing/meson.build: -------------------------------------------------------------------------------- 1 | sources = files( 2 | 'gsd-sharing-manager.c', 3 | 'main.c' 4 | ) 5 | sources += main_helper_sources 6 | 7 | deps = plugins_deps + [ 8 | gio_unix_dep, 9 | libnotify_dep, 10 | ] 11 | 12 | if enable_systemd 13 | deps += libsystemd_dep 14 | elif enable_elogind 15 | deps += elogind_dep 16 | endif 17 | 18 | if enable_network_manager 19 | deps += libnm_dep 20 | endif 21 | 22 | executable( 23 | 'gsd-' + plugin_name, 24 | sources, 25 | include_directories: [top_inc, common_inc], 26 | dependencies: deps, 27 | c_args: cflags, 28 | install: true, 29 | install_rpath: gsd_pkglibdir, 30 | install_dir: gsd_libexecdir 31 | ) 32 | -------------------------------------------------------------------------------- /plugins/smartcard/gsd-smartcard-enum-types.c.in: -------------------------------------------------------------------------------- 1 | /*** BEGIN file-header ***/ 2 | 3 | #include 4 | 5 | /*** END file-header ***/ 6 | 7 | /*** BEGIN file-production ***/ 8 | #include "@filename@" 9 | /* enumerations from "@filename@" */ 10 | /*** END file-production ***/ 11 | 12 | /*** BEGIN value-header ***/ 13 | GType @enum_name@_get_type (void) G_GNUC_CONST; 14 | 15 | GType 16 | @enum_name@_get_type (void) 17 | { 18 | static GType etype = 0; 19 | 20 | if (G_UNLIKELY(etype == 0)) { 21 | static const G@Type@Value values[] = { 22 | /*** END value-header ***/ 23 | 24 | /*** BEGIN value-production ***/ 25 | { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, 26 | /*** END value-production ***/ 27 | 28 | /*** BEGIN value-tail ***/ 29 | { 0, NULL, NULL } 30 | }; 31 | 32 | etype = g_@type@_register_static (g_intern_static_string ("@EnumName@"), values); 33 | } 34 | 35 | return etype; 36 | } 37 | 38 | /*** END value-tail ***/ 39 | 40 | /*** BEGIN file-tail ***/ 41 | /**/ 42 | /*** END file-tail ***/ 43 | -------------------------------------------------------------------------------- /plugins/smartcard/gsd-smartcard-enum-types.h.in: -------------------------------------------------------------------------------- 1 | /*** BEGIN file-header ***/ 2 | #ifndef GSD_IDENTITY_ENUM_TYPES_H 3 | #define GSD_IDENTITY_ENUM_TYPES_H 4 | 5 | #include 6 | 7 | G_BEGIN_DECLS 8 | /*** END file-header ***/ 9 | 10 | /*** BEGIN file-production ***/ 11 | 12 | /* enumerations from "@filename@" */ 13 | /*** END file-production ***/ 14 | 15 | /*** BEGIN value-header ***/ 16 | GType @enum_name@_get_type (void) G_GNUC_CONST; 17 | #define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ()) 18 | /*** END value-header ***/ 19 | 20 | /*** BEGIN file-tail ***/ 21 | G_END_DECLS 22 | 23 | #endif /* GSD_IDENTITY_ENUM_TYPES_H */ 24 | /*** END file-tail ***/ 25 | -------------------------------------------------------------------------------- /plugins/smartcard/gsd-smartcard-manager.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * Copyright (C) 2010 Red Hat, Inc. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | * 19 | */ 20 | 21 | #ifndef __GSD_SMARTCARD_MANAGER_H 22 | #define __GSD_SMARTCARD_MANAGER_H 23 | 24 | #include 25 | 26 | #include "gsd-application.h" 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GSD_TYPE_SMARTCARD_MANAGER (gsd_smartcard_manager_get_type ()) 31 | #define GSD_SMARTCARD_MANAGER_ERROR (gsd_smartcard_manager_error_quark ()) 32 | 33 | G_DECLARE_FINAL_TYPE (GsdSmartcardManager, gsd_smartcard_manager, GSD, SMARTCARD_MANAGER, GsdApplication) 34 | 35 | typedef enum 36 | { 37 | GSD_SMARTCARD_MANAGER_ERROR_GENERIC = 0, 38 | GSD_SMARTCARD_MANAGER_ERROR_WITH_P11KIT, 39 | GSD_SMARTCARD_MANAGER_ERROR_LOADING_DRIVER, 40 | GSD_SMARTCARD_MANAGER_ERROR_WATCHING_FOR_EVENTS, 41 | GSD_SMARTCARD_MANAGER_ERROR_REPORTING_EVENTS, 42 | GSD_SMARTCARD_MANAGER_ERROR_FINDING_SMARTCARD, 43 | GSD_SMARTCARD_MANAGER_ERROR_NO_DRIVERS, 44 | } GsdSmartcardManagerError; 45 | 46 | GQuark gsd_smartcard_manager_error_quark (void); 47 | 48 | 49 | GckSlot * gsd_smartcard_manager_get_login_token (GsdSmartcardManager *manager); 50 | GList * gsd_smartcard_manager_get_inserted_tokens (GsdSmartcardManager *manager, 51 | gsize *num_tokens); 52 | void gsd_smartcard_manager_do_remove_action (GsdSmartcardManager *manager); 53 | 54 | G_END_DECLS 55 | 56 | #endif /* __GSD_SMARTCARD_MANAGER_H */ 57 | -------------------------------------------------------------------------------- /plugins/smartcard/gsd-smartcard-service.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2012 Red Hat, Inc. 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, but 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | * Authors: Ray Strode 19 | */ 20 | 21 | #ifndef __GSD_SMARTCARD_SERVICE_H__ 22 | #define __GSD_SMARTCARD_SERVICE_H__ 23 | 24 | #include 25 | #include 26 | #include 27 | #include "gsd-smartcard-manager.h" 28 | 29 | #include "org.gnome.SettingsDaemon.Smartcard.h" 30 | 31 | G_BEGIN_DECLS 32 | 33 | #define GSD_TYPE_SMARTCARD_SERVICE (gsd_smartcard_service_get_type ()) 34 | 35 | G_DECLARE_FINAL_TYPE (GsdSmartcardService, gsd_smartcard_service, GSD, SMARTCARD_SERVICE, GsdSmartcardServiceManagerSkeleton) 36 | 37 | void gsd_smartcard_service_new_async (GsdSmartcardManager *manager, 38 | GCancellable *cancellable, 39 | GAsyncReadyCallback callback, 40 | gpointer user_data); 41 | GsdSmartcardService *gsd_smartcard_service_new_finish (GAsyncResult *result, 42 | GError **error); 43 | 44 | void gsd_smartcard_service_register_driver (GsdSmartcardService *service, 45 | GckModule *module); 46 | void gsd_smartcard_service_sync_token (GsdSmartcardService *service, 47 | GckSlot *card_slot, 48 | GCancellable *cancellable); 49 | 50 | 51 | G_END_DECLS 52 | 53 | #endif /* __GSD_SMARTCARD_SERVICE_H__ */ 54 | -------------------------------------------------------------------------------- /plugins/smartcard/gsd-smartcard-utils.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2013 Red Hat, Inc. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #ifndef __GSD_SMARTCARD_UTILS_H 21 | #define __GSD_SMARTCARD_UTILS_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | void gsd_smartcard_utils_register_error_domain (GQuark error_domain, 29 | GType error_enum); 30 | char * gsd_smartcard_utils_escape_object_path (const char *unescaped_string); 31 | 32 | const char * gsd_smartcard_utils_get_login_token_name (void); 33 | 34 | G_END_DECLS 35 | 36 | #endif /* __GSD_SMARTCARD_MANAGER_H */ 37 | -------------------------------------------------------------------------------- /plugins/smartcard/main.c: -------------------------------------------------------------------------------- 1 | #include "gsd-main-helper.h" 2 | #include "gsd-smartcard-manager.h" 3 | 4 | int 5 | main (int argc, char **argv) 6 | { 7 | return gsd_main_helper (GSD_TYPE_SMARTCARD_MANAGER, argc, argv); 8 | } 9 | -------------------------------------------------------------------------------- /plugins/smartcard/meson.build: -------------------------------------------------------------------------------- 1 | sources = files( 2 | 'gsd-smartcard-manager.c', 3 | 'gsd-smartcard-service.c', 4 | 'gsd-smartcard-utils.c', 5 | 'main.c' 6 | ) 7 | 8 | sources += main_helper_sources 9 | 10 | enum_headers = files( 11 | 'gsd-smartcard-manager.h', 12 | 'gsd-smartcard-utils.h' 13 | ) 14 | 15 | enum_types = 'gsd-smartcard-enum-types' 16 | 17 | sources += gnome.mkenums( 18 | enum_types, 19 | sources: enum_headers, 20 | c_template: enum_types + '.c.in', 21 | h_template: enum_types + '.h.in' 22 | ) 23 | 24 | gdbus = 'org.gnome.SettingsDaemon.Smartcard' 25 | 26 | sources += gnome.gdbus_codegen( 27 | gdbus, 28 | gdbus + '.xml', 29 | interface_prefix: gdbus + '.', 30 | namespace: 'GsdSmartcardService', 31 | object_manager: true 32 | ) 33 | 34 | deps = plugins_deps + [ 35 | gio_unix_dep, 36 | libnotify_dep, 37 | smartcard_deps 38 | ] 39 | 40 | cflags += ['-DGCK_API_SUBJECT_TO_CHANGE=1'] 41 | 42 | executable( 43 | 'gsd-' + plugin_name, 44 | sources, 45 | include_directories: [top_inc, common_inc], 46 | dependencies: deps, 47 | c_args: cflags, 48 | install: true, 49 | install_rpath: gsd_pkglibdir, 50 | install_dir: gsd_libexecdir 51 | ) 52 | -------------------------------------------------------------------------------- /plugins/smartcard/org.gnome.SettingsDaemon.Smartcard.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 45 | 46 | 50 | 51 | 52 | 56 | 57 | 58 | 59 | 64 | 65 | 69 | 70 | 71 | 75 | 76 | 77 | 81 | 82 | 83 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /plugins/sound/gsd-sound-manager.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2008 Lennart Poettering 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #ifndef __GSD_SOUND_MANAGER_H 21 | #define __GSD_SOUND_MANAGER_H 22 | 23 | #include "gsd-application.h" 24 | 25 | G_BEGIN_DECLS 26 | 27 | #define GSD_TYPE_SOUND_MANAGER (gsd_sound_manager_get_type ()) 28 | 29 | G_DECLARE_FINAL_TYPE (GsdSoundManager, gsd_sound_manager, GSD, SOUND_MANAGER, GsdApplication) 30 | 31 | G_END_DECLS 32 | 33 | #endif /* __GSD_SOUND_MANAGER_H */ 34 | -------------------------------------------------------------------------------- /plugins/sound/main.c: -------------------------------------------------------------------------------- 1 | #include "gsd-main-helper.h" 2 | #include "gsd-sound-manager.h" 3 | 4 | int 5 | main (int argc, char **argv) 6 | { 7 | return gsd_main_helper (GSD_TYPE_SOUND_MANAGER, argc, argv); 8 | } 9 | -------------------------------------------------------------------------------- /plugins/sound/meson.build: -------------------------------------------------------------------------------- 1 | sources = files( 2 | 'gsd-sound-manager.c', 3 | 'main.c' 4 | ) 5 | sources += main_helper_sources 6 | 7 | deps = plugins_deps + [ 8 | gio_dep, 9 | libpulse_mainloop_glib_dep 10 | ] 11 | 12 | executable( 13 | 'gsd-' + plugin_name, 14 | sources, 15 | include_directories: [top_inc, common_inc], 16 | dependencies: deps, 17 | c_args: cflags, 18 | install: true, 19 | install_rpath: gsd_pkglibdir, 20 | install_dir: gsd_libexecdir 21 | ) 22 | -------------------------------------------------------------------------------- /plugins/usb-protection/gsd-usb-protection-manager.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2018 Ludovico de Nittis 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #ifndef __GSD_USB_PROTECTION_MANAGER_H 21 | #define __GSD_USB_PROTECTION_MANAGER_H 22 | 23 | #include "gsd-application.h" 24 | 25 | G_BEGIN_DECLS 26 | 27 | #define GSD_TYPE_USB_PROTECTION_MANAGER (gsd_usb_protection_manager_get_type ()) 28 | G_DECLARE_FINAL_TYPE (GsdUsbProtectionManager, gsd_usb_protection_manager, GSD, USB_PROTECTION_MANAGER, GsdApplication); 29 | 30 | typedef struct 31 | { 32 | GObjectClass parent_class; 33 | } _GsdUsbProtectionManagerClass; 34 | 35 | GType gsd_usb_protection_manager_get_type (void); 36 | 37 | G_END_DECLS 38 | 39 | #endif /* __GSD_USB_PROTECTION_MANAGER_H */ 40 | -------------------------------------------------------------------------------- /plugins/usb-protection/main.c: -------------------------------------------------------------------------------- 1 | #include "gsd-main-helper.h" 2 | #include "gsd-usb-protection-manager.h" 3 | 4 | int 5 | main (int argc, char **argv) 6 | { 7 | return gsd_main_helper (GSD_TYPE_USB_PROTECTION_MANAGER, argc, argv); 8 | } 9 | -------------------------------------------------------------------------------- /plugins/usb-protection/meson.build: -------------------------------------------------------------------------------- 1 | sources = files( 2 | 'gsd-usb-protection-manager.c', 3 | 'main.c' 4 | ) 5 | sources += main_helper_sources 6 | 7 | deps = plugins_deps + [ 8 | gsd_enums_dep, 9 | gsettings_desktop_dep, 10 | libcommon_dep, 11 | libnotify_dep, 12 | ] 13 | 14 | executable( 15 | 'gsd-' + plugin_name, 16 | sources, 17 | include_directories: [top_inc, common_inc], 18 | dependencies: deps, 19 | c_args: cflags, 20 | install: true, 21 | install_rpath: gsd_pkglibdir, 22 | install_dir: gsd_libexecdir 23 | ) 24 | -------------------------------------------------------------------------------- /plugins/wacom/gsd-wacom-manager.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * Copyright (C) 2010 Red Hat, Inc. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | * 19 | */ 20 | 21 | #ifndef __GSD_WACOM_MANAGER_H 22 | #define __GSD_WACOM_MANAGER_H 23 | 24 | #include "gsd-application.h" 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define GSD_TYPE_WACOM_MANAGER (gsd_wacom_manager_get_type ()) 29 | 30 | G_DECLARE_FINAL_TYPE (GsdWacomManager, gsd_wacom_manager, GSD, WACOM_MANAGER, GsdApplication) 31 | 32 | G_END_DECLS 33 | 34 | #endif /* __GSD_WACOM_MANAGER_H */ 35 | -------------------------------------------------------------------------------- /plugins/wacom/gsd-wacom-oled-constants.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2013 Przemo Firszt 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #ifndef __GSD_WACOM_OLED_CONSTANTS_H 21 | #define __GSD_WACOM_OLED_CONSTANTS_H 22 | 23 | G_BEGIN_DECLS 24 | 25 | typedef enum { 26 | GSD_WACOM_OLED_TYPE_USB, 27 | GSD_WACOM_OLED_TYPE_BLUETOOTH, 28 | GSD_WACOM_OLED_TYPE_RAW_BLUETOOTH 29 | } GsdWacomOledType; 30 | 31 | /* OLED parameters */ 32 | #define OLED_WIDTH 64 /*Width of OLED icon - hardware dependent*/ 33 | #define OLED_HEIGHT 32 /*Height of OLED icon - hardware dependent*/ 34 | #define LABEL_SIZE 30 /*Maximum length of text for OLED icon*/ 35 | #define MAX_TOKEN (LABEL_SIZE >> 1) /*Maximum number of tokens equals half of maximum number of characters*/ 36 | #define MAX_IMAGE_SIZE 1024 /*Size of buffer for storing OLED image*/ 37 | #define MAX_1ST_LINE_LEN 10 /*Maximum number of characters in 1st line of OLED icon*/ 38 | 39 | G_END_DECLS 40 | 41 | #endif /* __GSD_WACOM_OLED_CONSTANTS_H */ 42 | -------------------------------------------------------------------------------- /plugins/wacom/gsd-wacom-oled.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2013 Przemo Firszt 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #include "gsd-wacom-oled-constants.h" 21 | 22 | #include 23 | 24 | #ifndef __GSD_WACOM_OLED_H 25 | #define __GSD_WACOM_OLED_H 26 | 27 | G_BEGIN_DECLS 28 | 29 | gboolean set_oled (const gchar *device_path, gboolean left_handed, guint button, char *label, GError **error); 30 | char *gsd_wacom_oled_gdkpixbuf_to_base64 (GdkPixbuf *pixbuf); 31 | 32 | G_END_DECLS 33 | 34 | #endif /* __GSD_WACOM_OLED_H */ 35 | -------------------------------------------------------------------------------- /plugins/wacom/main.c: -------------------------------------------------------------------------------- 1 | #include "gsd-main-helper.h" 2 | #include "gsd-wacom-manager.h" 3 | 4 | int 5 | main (int argc, char **argv) 6 | { 7 | return gsd_main_helper (GSD_TYPE_WACOM_MANAGER, argc, argv); 8 | } 9 | -------------------------------------------------------------------------------- /plugins/wacom/meson.build: -------------------------------------------------------------------------------- 1 | policy = 'org.gnome.settings-daemon.plugins.wacom.policy' 2 | 3 | policy_in = configure_file( 4 | input: policy + '.in.in', 5 | output: policy + '.in', 6 | configuration: plugins_conf 7 | ) 8 | 9 | i18n.merge_file( 10 | input: policy_in, 11 | output: policy, 12 | po_dir: po_dir, 13 | install: true, 14 | install_dir: join_paths(gsd_datadir, 'polkit-1', 'actions') 15 | ) 16 | 17 | sources = files( 18 | 'gsd-wacom-manager.c', 19 | 'gsd-wacom-oled.c', 20 | 'main.c' 21 | ) 22 | sources += main_helper_sources 23 | 24 | deps = plugins_deps + [ 25 | gsd_enums_dep, 26 | gtk_dep, 27 | libcommon_dep, 28 | m_dep, 29 | pango_dep 30 | ] 31 | 32 | if enable_wacom 33 | deps += libwacom_dep 34 | endif 35 | 36 | cflags += ['-DLIBEXECDIR="@0@"'.format(gsd_libexecdir)] 37 | cflags += ['-DUSE_GTK=1'] 38 | 39 | executable( 40 | 'gsd-' + plugin_name, 41 | sources, 42 | include_directories: top_inc, 43 | dependencies: deps, 44 | c_args: cflags, 45 | install: true, 46 | install_rpath: gsd_pkglibdir, 47 | install_dir: gsd_libexecdir 48 | ) 49 | 50 | if enable_gudev 51 | deps = [ 52 | gudev_dep, 53 | m_dep 54 | ] 55 | 56 | executable( 57 | 'gsd-wacom-oled-helper', 58 | 'gsd-wacom-oled-helper.c', 59 | include_directories: top_inc, 60 | dependencies: deps, 61 | install: true, 62 | install_rpath: gsd_pkglibdir, 63 | install_dir: gsd_libexecdir 64 | ) 65 | endif 66 | -------------------------------------------------------------------------------- /plugins/wacom/org.gnome.settings-daemon.plugins.wacom.policy.in.in: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 10 | 11 | GNOME Settings Daemon 12 | http://git.gnome.org/browse/gnome-settings-daemon 13 | input-tablet 14 | 15 | 16 | 20 | Modify the lit LED for a Wacom tablet 21 | Authentication is required to modify the lit LED for a Wacom tablet 22 | 23 | no 24 | no 25 | yes 26 | 27 | @libexecdir@/gsd-wacom-led-helper 28 | 29 | 30 | 31 | 35 | Modify the OLED image for a Wacom tablet 36 | Authentication is required to modify the OLED image for a Wacom tablet 37 | 38 | no 39 | no 40 | yes 41 | 42 | @libexecdir@/gsd-wacom-oled-helper 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /plugins/wwan/gsd-wwan-manager.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2019 Purism SPC 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | * Author: Guido Günther 19 | * 20 | */ 21 | 22 | # pragma once 23 | 24 | #include "gsd-application.h" 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define GSD_TYPE_WWAN_MANAGER (gsd_wwan_manager_get_type()) 29 | G_DECLARE_FINAL_TYPE (GsdWwanManager, gsd_wwan_manager, GSD, WWAN_MANAGER, GsdApplication) 30 | 31 | G_END_DECLS 32 | -------------------------------------------------------------------------------- /plugins/wwan/main.c: -------------------------------------------------------------------------------- 1 | #include "gsd-main-helper.h" 2 | #include "gsd-wwan-manager.h" 3 | 4 | int 5 | main (int argc, char **argv) 6 | { 7 | return gsd_main_helper (GSD_TYPE_WWAN_MANAGER, argc, argv); 8 | } 9 | -------------------------------------------------------------------------------- /plugins/wwan/meson.build: -------------------------------------------------------------------------------- 1 | sources = files( 2 | 'cc-wwan-device.c', 3 | 'gsd-wwan-manager.c', 4 | 'main.c' 5 | ) 6 | sources += main_helper_sources 7 | 8 | deps = plugins_deps + [gio_dep, gcr_dep, mm_glib_dep, polkit_gobject_dep] 9 | 10 | cflags += ['-DGNOMECC_DATA_DIR="@0@"'.format(gsd_pkgdatadir)] 11 | 12 | executable( 13 | 'gsd-' + plugin_name, 14 | sources, 15 | include_directories: [top_inc, common_inc], 16 | dependencies: deps, 17 | c_args: cflags, 18 | install: true, 19 | install_rpath: gsd_pkglibdir, 20 | install_dir: gsd_libexecdir 21 | ) 22 | 23 | -------------------------------------------------------------------------------- /plugins/xsettings/00-xrdb: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | userresources=$HOME/.Xresources 4 | sysresources=/etc/X11/Xresources 5 | 6 | # merge in defaults 7 | [ -r "$sysresources" ] && xrdb -nocpp -merge "$sysresources" 8 | [ -r "$userresources" ] && xrdb -merge "$userresources" 9 | 10 | -------------------------------------------------------------------------------- /plugins/xsettings/README.xsettings: -------------------------------------------------------------------------------- 1 | This is very simple documentation for the 'override' GSettings key for 2 | gnome-setting-daemon's xsettings plugin. 3 | 4 | The override is given as a dictionary of overrides to be applied on top 5 | of the usual values that are exported to the X server as XSETTINGS. The 6 | intent of this is to allow users to override values of programmatically 7 | determined settings (such as 'Gtk/ShellShowsAppMenu') and to allow 8 | developers to introduce new XSETTINGS for testing (without having to kill the 9 | gnome-settings-daemon running in the session and run their own patched 10 | version). 11 | 12 | The type of the overrides is 'a{sv}'. 13 | 14 | The key gives the full XSETTINGS setting name to override (for example, 15 | 'Gtk/ShellShowsAppMenu'). The value is one of the following: 16 | 17 | - a string ('s') for the case of a string XSETTING 18 | 19 | - an int32 ('i') for the case of an integer XSETTING 20 | 21 | - a 4-tuple of uint16s ('(qqqq)') for the case of a color XSETTING 22 | 23 | Dictionary items with a value that is not one of the above types will be 24 | ignored. Specifically note that XSETTINGS does not have a concept of 25 | booleans -- you must use an integer that is either 0 or 1. 26 | 27 | An example setting for this key (as expressed in GVariant text format) 28 | might be: 29 | 30 | { 'Gtk/ShellShowsAppMenu': < 0 >, 'Xft/DPI': < 98304 > } 31 | 32 | Noting that variants must be specified in the usual way (wrapped in <>). 33 | 34 | Note also that DPI in the above example is expressed in 1024ths of an 35 | inch. 36 | -------------------------------------------------------------------------------- /plugins/xsettings/fc-monitor.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2017 Jan Alexander Steffens (heftig) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | #ifndef FC_MONITOR_H 20 | #define FC_MONITOR_H 21 | 22 | #include 23 | 24 | G_BEGIN_DECLS 25 | 26 | #define FC_TYPE_MONITOR (fc_monitor_get_type ()) 27 | G_DECLARE_FINAL_TYPE (FcMonitor, fc_monitor, FC, MONITOR, GObject) 28 | 29 | FcMonitor *fc_monitor_new (void); 30 | 31 | void fc_monitor_start (FcMonitor *monitor); 32 | void fc_monitor_stop (FcMonitor *monitor); 33 | 34 | G_END_DECLS 35 | 36 | #endif /* FC_MONITOR_H */ 37 | -------------------------------------------------------------------------------- /plugins/xsettings/fontconfig-test/fonts.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | /usr/share/fonts 8 | 9 | -------------------------------------------------------------------------------- /plugins/xsettings/gsd-remote-display-manager.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2012 Bastien Nocera 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #include "config.h" 21 | 22 | #include 23 | 24 | #define GSD_TYPE_REMOTE_DISPLAY_MANAGER (gsd_remote_display_manager_get_type ()) 25 | 26 | G_DECLARE_FINAL_TYPE (GsdRemoteDisplayManager, gsd_remote_display_manager, GSD, REMOTE_DISPLAY_MANAGER, GObject) 27 | 28 | GsdRemoteDisplayManager * gsd_remote_display_manager_new (void); 29 | -------------------------------------------------------------------------------- /plugins/xsettings/gsd-xsettings-gtk.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2010 Bastien Nocera 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #ifndef __GSD_XSETTINGS_GTK_H__ 21 | #define __GSD_XSETTINGS_GTK_H__ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define GSD_TYPE_XSETTINGS_GTK (gsd_xsettings_gtk_get_type ()) 30 | 31 | G_DECLARE_FINAL_TYPE (GsdXSettingsGtk, gsd_xsettings_gtk, GSD, XSETTINGS_GTK, GObject) 32 | 33 | GsdXSettingsGtk *gsd_xsettings_gtk_new (void); 34 | 35 | const char * gsd_xsettings_gtk_get_modules (GsdXSettingsGtk *gtk); 36 | 37 | G_END_DECLS 38 | 39 | #endif /* __GSD_XSETTINGS_GTK_H__ */ 40 | -------------------------------------------------------------------------------- /plugins/xsettings/gsd-xsettings-manager.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2007 William Jon McCann 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | */ 19 | 20 | #ifndef __GSD_XSETTINGS_MANAGER_H 21 | #define __GSD_XSETTINGS_MANAGER_H 22 | 23 | #include "gsd-application.h" 24 | 25 | G_BEGIN_DECLS 26 | 27 | #define GSD_TYPE_XSETTINGS_MANAGER (gsd_xsettings_manager_get_type ()) 28 | 29 | G_DECLARE_FINAL_TYPE (GsdXSettingsManager, gsd_xsettings_manager, GSD, XSETTINGS_MANAGER, GsdApplication) 30 | 31 | G_END_DECLS 32 | 33 | #endif /* __GNOME_XSETTINGS_MANAGER_H */ 34 | -------------------------------------------------------------------------------- /plugins/xsettings/gtk-modules-test/canberra-gtk-module.desktop: -------------------------------------------------------------------------------- 1 | [GTK Module] 2 | Name=canberra-gtk-module 3 | Description=Event Sound Module 4 | X-GTK-Module-Name=canberra-gtk-module 5 | X-GTK-Module-Enabled-Schema=org.gnome.desktop.sound 6 | X-GTK-Module-Enabled-Key=event-sounds 7 | -------------------------------------------------------------------------------- /plugins/xsettings/gtk-modules-test/pk-gtk-module.desktop: -------------------------------------------------------------------------------- 1 | [GTK Module] 2 | Name=PackageKit 3 | Description=PackageKit Font Installer 4 | X-GTK-Module-Name=pk-gtk-module 5 | -------------------------------------------------------------------------------- /plugins/xsettings/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define GDK_BACKEND "x11" 4 | #include "gsd-main-helper.h" 5 | #include "gsd-xsettings-manager.h" 6 | 7 | int 8 | main (int argc, char **argv) 9 | { 10 | const gchar *setup_display = getenv ("GNOME_SETUP_DISPLAY"); 11 | if (setup_display && *setup_display != '\0') 12 | g_setenv ("DISPLAY", setup_display, TRUE); 13 | 14 | gdk_set_allowed_backends (GDK_BACKEND); 15 | 16 | /* GDK would fail to initialize with e.g. GDK_BACKEND=wayland */ 17 | g_unsetenv ("GDK_BACKEND"); 18 | 19 | return gsd_main_helper (GSD_TYPE_XSETTINGS_MANAGER, argc, argv); 20 | } 21 | 22 | -------------------------------------------------------------------------------- /plugins/xsettings/meson.build: -------------------------------------------------------------------------------- 1 | gsd_xsettings_gtk = files('gsd-xsettings-gtk.c') 2 | 3 | fc_monitor = files('fc-monitor.c') 4 | 5 | wm_button_layout_translation = files('wm-button-layout-translation.c') 6 | 7 | sources = gsd_xsettings_gtk + fc_monitor + wm_button_layout_translation + files( 8 | 'gsd-xsettings-manager.c', 9 | 'xsettings-common.c', 10 | 'xsettings-manager.c', 11 | 'main.c' 12 | ) 13 | 14 | sources += main_helper_sources 15 | 16 | deps = plugins_deps + [ 17 | gsd_enums_dep, 18 | gtk_dep, 19 | x11_dep, 20 | xfixes_dep, 21 | libcommon_dep, 22 | gsettings_desktop_dep, 23 | dependency('fontconfig') 24 | ] 25 | 26 | cflags += ['-DGTK_MODULES_DIRECTORY="@0@"'.format(gsd_gtk_modules_directory)] 27 | cflags += ['-DUSE_GTK=1'] 28 | 29 | executable( 30 | 'gsd-' + plugin_name, 31 | sources, 32 | include_directories: [top_inc, common_inc], 33 | dependencies: deps, 34 | c_args: cflags, 35 | install: true, 36 | install_rpath: gsd_pkglibdir, 37 | install_dir: gsd_libexecdir 38 | ) 39 | 40 | programs = [ 41 | ['test-gtk-modules', gsd_xsettings_gtk + ['test-gtk-modules.c'], cflags], 42 | ['test-fontconfig-monitor', fc_monitor, cflags + ['-DFONTCONFIG_MONITOR_TEST']], 43 | ['test-wm-button-layout-translations', wm_button_layout_translation + ['test-wm-button-layout-translations.c'], []] 44 | ] 45 | 46 | foreach program: programs 47 | executable( 48 | program[0], 49 | program[1], 50 | include_directories: top_inc, 51 | dependencies: deps, 52 | c_args: program[2] 53 | ) 54 | endforeach 55 | 56 | install_data( 57 | files('00-xrdb'), 58 | install_dir: join_paths(gsd_sysconfdir, 'xdg/Xwayland-session.d') 59 | ) 60 | 61 | test_py = find_program('test.py') 62 | 63 | envs = [ 64 | 'BUILDDIR=' + meson.current_build_dir(), 65 | 'TOP_BUILDDIR=' + meson.project_build_root() 66 | ] 67 | 68 | test( 69 | 'test-xsettings', 70 | test_py, 71 | env: envs, 72 | timeout: 300 73 | ) 74 | -------------------------------------------------------------------------------- /plugins/xsettings/test-gtk-modules.c: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "gsd-xsettings-gtk.h" 4 | 5 | static void 6 | gtk_modules_callback (GsdXSettingsGtk *gtk, 7 | GParamSpec *spec, 8 | gpointer user_data) 9 | { 10 | const char *modules; 11 | 12 | modules = gsd_xsettings_gtk_get_modules (gtk); 13 | g_message ("GTK+ modules list changed to: %s", modules ? modules : "(empty)"); 14 | } 15 | 16 | int main (int argc, char **argv) 17 | { 18 | GMainLoop *loop; 19 | GsdXSettingsGtk *gtk; 20 | 21 | gtk = gsd_xsettings_gtk_new (); 22 | g_signal_connect (G_OBJECT (gtk), "notify::gtk-modules", 23 | G_CALLBACK (gtk_modules_callback), NULL); 24 | 25 | gtk_modules_callback (gtk, NULL, NULL); 26 | 27 | loop = g_main_loop_new (NULL, TRUE); 28 | g_main_loop_run (loop); 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /plugins/xsettings/test-wm-button-layout-translations.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "wm-button-layout-translation.h" 4 | 5 | static void 6 | test_button_layout_translations (void) 7 | { 8 | static struct { 9 | char *layout; 10 | char *expected; 11 | } tests[] = { 12 | { "", "" }, 13 | { "invalid", "" }, 14 | 15 | { ":", ":" }, 16 | { ":invalid", ":" }, 17 | { "invalid:", ":" }, 18 | { "invalid:invalid", ":" }, 19 | 20 | { "appmenu", "menu" }, 21 | { "appmenu:", "menu:" }, 22 | { ":menu", ":icon" }, 23 | { "appmenu:close", "menu:close" }, 24 | { "appmenu:minimize,maximize,close", "menu:minimize,maximize,close" }, 25 | { "menu,appmenu:minimize,maximize,close", "icon,menu:minimize,maximize,close" }, 26 | 27 | { "close,close,close:close,close,close", "close,close,close:close,close,close" }, 28 | 29 | { "invalid,appmenu:invalid,minimize", "menu:minimize" }, 30 | { "appmenu,invalid:minimize,invalid", "menu:minimize" }, 31 | { "invalidmenu:invalidclose", ":" }, 32 | { "invalid,invalid,invalid:invalid,minimize,maximize,close", ":minimize,maximize,close" }, 33 | }; 34 | int i; 35 | 36 | for (i = 0; i < G_N_ELEMENTS (tests); i++) 37 | { 38 | char *layout = g_strdup (tests[i].layout); 39 | 40 | translate_wm_button_layout_to_gtk (layout); 41 | g_assert_cmpstr (layout, ==, tests[i].expected); 42 | g_free (layout); 43 | } 44 | } 45 | 46 | int 47 | main (int argc, char *argv[]) 48 | { 49 | g_test_init (&argc, &argv, NULL); 50 | 51 | g_test_add_func ("/layout-translations", test_button_layout_translations); 52 | 53 | return g_test_run (); 54 | } 55 | -------------------------------------------------------------------------------- /plugins/xsettings/wm-button-layout-translation.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2014 Red Hat, Inc. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | * Author: Florian Müllner 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | #include "wm-button-layout-translation.h" 26 | 27 | static void 28 | translate_buttons (char *layout, int *len_p) 29 | { 30 | char *strp = layout, *button; 31 | int len = 0; 32 | 33 | if (!layout || !*layout) 34 | goto out; 35 | 36 | while ((button = strsep (&strp, ","))) 37 | { 38 | char *gtkbutton; 39 | 40 | if (strcmp (button, "menu") == 0) 41 | gtkbutton = "icon"; 42 | else if (strcmp (button, "appmenu") == 0) 43 | gtkbutton = "menu"; 44 | else if (strcmp (button, "minimize") == 0) 45 | gtkbutton = "minimize"; 46 | else if (strcmp (button, "maximize") == 0) 47 | gtkbutton = "maximize"; 48 | else if (strcmp (button, "close") == 0) 49 | gtkbutton = "close"; 50 | else 51 | continue; 52 | 53 | if (len) 54 | layout[len++] = ','; 55 | 56 | strcpy (layout + len, gtkbutton); 57 | len += strlen (gtkbutton); 58 | } 59 | layout[len] = '\0'; 60 | 61 | out: 62 | if (len_p) 63 | *len_p = len; 64 | } 65 | 66 | void 67 | translate_wm_button_layout_to_gtk (char *layout) 68 | { 69 | char *strp = layout, *left_buttons, *right_buttons; 70 | int left_len, right_len = 0; 71 | 72 | left_buttons = strsep (&strp, ":"); 73 | right_buttons = strp; 74 | 75 | translate_buttons (left_buttons, &left_len); 76 | memmove (layout, left_buttons, left_len); 77 | 78 | if (strp == NULL) 79 | goto out; /* no ":" in layout */ 80 | 81 | layout[left_len++] = ':'; 82 | 83 | translate_buttons (right_buttons, &right_len); 84 | memmove (layout + left_len, right_buttons, right_len); 85 | 86 | out: 87 | layout[left_len + right_len] = '\0'; 88 | } 89 | -------------------------------------------------------------------------------- /plugins/xsettings/wm-button-layout-translation.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2014 Red Hat, Inc. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | * 18 | * Author: Florian Müllner 19 | */ 20 | 21 | #ifndef __WM_BUTTON_LAYOUT_TRANSLATION__ 22 | #define __WM_BUTTON_LAYOUT_TRANSLATION__ 23 | 24 | void translate_wm_button_layout_to_gtk (char *layout); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /plugins/xsettings/xsettings-common.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2001 Red Hat, Inc. 3 | * 4 | * Permission to use, copy, modify, distribute, and sell this software and its 5 | * documentation for any purpose is hereby granted without fee, provided that 6 | * the above copyright notice appear in all copies and that both that 7 | * copyright notice and this permission notice appear in supporting 8 | * documentation, and that the name of Red Hat not be used in advertising or 9 | * publicity pertaining to distribution of the software without specific, 10 | * written prior permission. Red Hat makes no representations about the 11 | * suitability of this software for any purpose. It is provided "as is" 12 | * without express or implied warranty. 13 | * 14 | * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT 16 | * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 17 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 18 | * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 19 | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 20 | * 21 | * Author: Owen Taylor, Red Hat, Inc. 22 | */ 23 | 24 | #include 25 | 26 | #include "string.h" 27 | #include "stdlib.h" 28 | 29 | #include 30 | #include /* For CARD32 */ 31 | 32 | #include "xsettings-common.h" 33 | 34 | XSettingsSetting * 35 | xsettings_setting_new (const gchar *name) 36 | { 37 | XSettingsSetting *result; 38 | 39 | result = g_new0 (XSettingsSetting, 1); 40 | result->name = g_strdup (name); 41 | 42 | return result; 43 | } 44 | 45 | static gboolean 46 | xsettings_variant_equal0 (GVariant *a, 47 | GVariant *b) 48 | { 49 | if (a == b) 50 | return TRUE; 51 | 52 | if (!a || !b) 53 | return FALSE; 54 | 55 | return g_variant_equal (a, b); 56 | } 57 | 58 | GVariant * 59 | xsettings_setting_get (XSettingsSetting *setting) 60 | { 61 | gint i; 62 | 63 | for (i = G_N_ELEMENTS (setting->value) - 1; 0 <= i; i--) 64 | if (setting->value[i]) 65 | return setting->value[i]; 66 | 67 | return NULL; 68 | } 69 | 70 | void 71 | xsettings_setting_set (XSettingsSetting *setting, 72 | gint tier, 73 | GVariant *value, 74 | guint32 serial) 75 | { 76 | GVariant *old_value; 77 | 78 | old_value = xsettings_setting_get (setting); 79 | if (old_value) 80 | g_variant_ref (old_value); 81 | 82 | if (setting->value[tier]) 83 | g_variant_unref (setting->value[tier]); 84 | setting->value[tier] = value ? g_variant_ref_sink (value) : NULL; 85 | 86 | if (!xsettings_variant_equal0 (old_value, xsettings_setting_get (setting))) 87 | setting->last_change_serial = serial; 88 | 89 | if (old_value) 90 | g_variant_unref (old_value); 91 | } 92 | 93 | void 94 | xsettings_setting_free (XSettingsSetting *setting) 95 | { 96 | gint i; 97 | 98 | for (i = 0; i < G_N_ELEMENTS (setting->value); i++) 99 | if (setting->value[i]) 100 | g_variant_unref (setting->value[i]); 101 | 102 | g_free (setting->name); 103 | g_free (setting); 104 | } 105 | 106 | char 107 | xsettings_byte_order (void) 108 | { 109 | CARD32 myint = 0x01020304; 110 | return (*(char *)&myint == 1) ? MSBFirst : LSBFirst; 111 | } 112 | -------------------------------------------------------------------------------- /plugins/xsettings/xsettings-common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2001 Red Hat, Inc. 3 | * 4 | * Permission to use, copy, modify, distribute, and sell this software and its 5 | * documentation for any purpose is hereby granted without fee, provided that 6 | * the above copyright notice appear in all copies and that both that 7 | * copyright notice and this permission notice appear in supporting 8 | * documentation, and that the name of Red Hat not be used in advertising or 9 | * publicity pertaining to distribution of the software without specific, 10 | * written prior permission. Red Hat makes no representations about the 11 | * suitability of this software for any purpose. It is provided "as is" 12 | * without express or implied warranty. 13 | * 14 | * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT 16 | * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 17 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 18 | * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 19 | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 20 | * 21 | * Author: Owen Taylor, Red Hat, Inc. 22 | */ 23 | #ifndef XSETTINGS_COMMON_H 24 | #define XSETTINGS_COMMON_H 25 | 26 | #include 27 | 28 | #define XSETTINGS_N_TIERS 2 29 | 30 | typedef struct _XSettingsColor XSettingsColor; 31 | typedef struct _XSettingsSetting XSettingsSetting; 32 | 33 | /* Types of settings possible. Enum values correspond to 34 | * protocol values. 35 | */ 36 | typedef enum 37 | { 38 | XSETTINGS_TYPE_INT = 0, 39 | XSETTINGS_TYPE_STRING = 1, 40 | XSETTINGS_TYPE_COLOR = 2 41 | } XSettingsType; 42 | 43 | struct _XSettingsColor 44 | { 45 | unsigned short red, green, blue, alpha; 46 | }; 47 | 48 | struct _XSettingsSetting 49 | { 50 | char *name; 51 | GVariant *value[XSETTINGS_N_TIERS]; 52 | unsigned long last_change_serial; 53 | }; 54 | 55 | XSettingsSetting *xsettings_setting_new (const gchar *name); 56 | GVariant * xsettings_setting_get (XSettingsSetting *setting); 57 | void xsettings_setting_set (XSettingsSetting *setting, 58 | gint tier, 59 | GVariant *value, 60 | guint32 serial); 61 | void xsettings_setting_free (XSettingsSetting *setting); 62 | 63 | char xsettings_byte_order (void); 64 | 65 | #endif /* XSETTINGS_COMMON_H */ 66 | -------------------------------------------------------------------------------- /plugins/xsettings/xsettings-manager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2001 Red Hat, Inc. 3 | * 4 | * Permission to use, copy, modify, distribute, and sell this software and its 5 | * documentation for any purpose is hereby granted without fee, provided that 6 | * the above copyright notice appear in all copies and that both that 7 | * copyright notice and this permission notice appear in supporting 8 | * documentation, and that the name of Red Hat not be used in advertising or 9 | * publicity pertaining to distribution of the software without specific, 10 | * written prior permission. Red Hat makes no representations about the 11 | * suitability of this software for any purpose. It is provided "as is" 12 | * without express or implied warranty. 13 | * 14 | * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT 16 | * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 17 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 18 | * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 19 | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 20 | * 21 | * Author: Owen Taylor, Red Hat, Inc. 22 | */ 23 | #ifndef XSETTINGS_MANAGER_H 24 | #define XSETTINGS_MANAGER_H 25 | 26 | #include 27 | #include 28 | #include "xsettings-common.h" 29 | 30 | typedef struct _XSettingsManager XSettingsManager; 31 | 32 | typedef void (*XSettingsTerminateFunc) (void *cb_data); 33 | 34 | Bool xsettings_manager_check_running (Display *display, 35 | int screen); 36 | 37 | XSettingsManager *xsettings_manager_new (Display *display, 38 | int screen, 39 | XSettingsTerminateFunc terminate, 40 | void *cb_data); 41 | 42 | void xsettings_manager_destroy (XSettingsManager *manager); 43 | 44 | void xsettings_manager_delete_setting (XSettingsManager *manager, 45 | const char *name); 46 | void xsettings_manager_set_int (XSettingsManager *manager, 47 | const char *name, 48 | int value); 49 | void xsettings_manager_set_string (XSettingsManager *manager, 50 | const char *name, 51 | const char *value); 52 | void xsettings_manager_set_color (XSettingsManager *manager, 53 | const char *name, 54 | XSettingsColor *value); 55 | void xsettings_manager_notify (XSettingsManager *manager); 56 | void xsettings_manager_set_overrides (XSettingsManager *manager, 57 | GVariant *overrides); 58 | 59 | #endif /* XSETTINGS_MANAGER_H */ 60 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | ab 2 | af 3 | am 4 | ar 5 | as 6 | ast 7 | az 8 | be 9 | be@latin 10 | bg 11 | bn 12 | bn_IN 13 | br 14 | bs 15 | ca 16 | ca@valencia 17 | ckb 18 | crh 19 | cs 20 | cy 21 | da 22 | de 23 | dz 24 | el 25 | en_CA 26 | en_GB 27 | en@shaw 28 | eo 29 | es 30 | et 31 | eu 32 | fa 33 | fi 34 | fr 35 | fur 36 | ga 37 | gd 38 | gl 39 | gu 40 | he 41 | hi 42 | hr 43 | hu 44 | id 45 | is 46 | it 47 | ja 48 | ka 49 | kab 50 | kk 51 | km 52 | kn 53 | ko 54 | ku 55 | lt 56 | lv 57 | mai 58 | mg 59 | mk 60 | ml 61 | mn 62 | mr 63 | ms 64 | nb 65 | nds 66 | ne 67 | nl 68 | nn 69 | nso 70 | oc 71 | or 72 | pa 73 | pl 74 | pt 75 | pt_BR 76 | ro 77 | ru 78 | rw 79 | si 80 | sk 81 | sl 82 | sq 83 | sr 84 | sr@latin 85 | sv 86 | ta 87 | te 88 | tg 89 | th 90 | tr 91 | ug 92 | uk 93 | uz 94 | vi 95 | wa 96 | xh 97 | zh_CN 98 | zh_HK 99 | zh_TW 100 | zu 101 | -------------------------------------------------------------------------------- /po/POTFILES.in: -------------------------------------------------------------------------------- 1 | # Files with translatable strings. 2 | # Please keep this file in alphabetical order. 3 | data/org.gnome.settings-daemon.global-shortcuts.gschema.xml.in 4 | data/org.gnome.settings-daemon.peripherals.gschema.xml.in 5 | data/org.gnome.settings-daemon.peripherals.wacom.gschema.xml.in 6 | data/org.gnome.settings-daemon.plugins.color.gschema.xml.in 7 | data/org.gnome.settings-daemon.plugins.gschema.xml.in 8 | data/org.gnome.settings-daemon.plugins.housekeeping.gschema.xml.in 9 | data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in 10 | data/org.gnome.settings-daemon.plugins.power.gschema.xml.in 11 | data/org.gnome.settings-daemon.plugins.sharing.gschema.xml.in 12 | data/org.gnome.settings-daemon.plugins.xsettings.gschema.xml.in 13 | plugins/color/gsd-color-calibrate.c 14 | plugins/color/gsd-color-manager.c 15 | plugins/datetime/gsd-datetime-manager.c 16 | plugins/housekeeping/gsd-disk-space.c 17 | plugins/housekeeping/gsd-systemd-notify.c 18 | plugins/keyboard/gsd-keyboard-manager.c 19 | plugins/media-keys/gsd-media-keys-manager.c 20 | plugins/media-keys/shortcuts-list.h 21 | plugins/power/gpm-common.c 22 | plugins/power/gsd-power-manager.c 23 | plugins/power/org.gnome.settings-daemon.plugins.power.policy.in.in 24 | plugins/print-notifications/gsd-printer.c 25 | plugins/print-notifications/gsd-print-notifications-manager.c 26 | plugins/smartcard/gsd-smartcard-manager.c 27 | plugins/smartcard/gsd-smartcard-service.c 28 | plugins/usb-protection/gsd-usb-protection-manager.c 29 | plugins/wacom/gsd-wacom-manager.c 30 | plugins/wacom/org.gnome.settings-daemon.plugins.wacom.policy.in.in 31 | plugins/wwan/cc-wwan-errors-private.h 32 | plugins/wwan/gsd-wwan-manager.c 33 | plugins/xsettings/gsd-xsettings-manager.c 34 | -------------------------------------------------------------------------------- /po/POTFILES.skip: -------------------------------------------------------------------------------- 1 | # Files with translatable strings to skip. 2 | # Please keep this file in alphabetical order. 3 | plugins/automount/gnome-fallback-mount-helper.desktop.in 4 | plugins/power/org.gnome.settings-daemon.plugins.power.policy.in 5 | plugins/usb-protection/org.gnome.SettingsDaemon.UsbProtection.desktop.in 6 | plugins/wacom/org.gnome.settings-daemon.plugins.wacom.policy.in 7 | plugins/dummy/org.gnome.SettingsDaemon.Dummy.desktop.in 8 | # No user-visible translatable strings 9 | plugins/wwan/cc-wwan-device.c 10 | subprojects/gvc/gvc-mixer-control.c 11 | -------------------------------------------------------------------------------- /po/meson.build: -------------------------------------------------------------------------------- 1 | i18n.gettext(meson.project_name(), preset: 'glib') 2 | -------------------------------------------------------------------------------- /tests/dummy.session: -------------------------------------------------------------------------------- 1 | [GNOME Session] 2 | Name=dummy 3 | RequiredComponents=dummyapp 4 | DesktopName=dummy 5 | 6 | -------------------------------------------------------------------------------- /tests/dummyapp.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=dummyapp 3 | Type=Application 4 | Exec=sleep 3600 5 | 6 | -------------------------------------------------------------------------------- /tests/get-display-name.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | echo $DISPLAY > $1 4 | echo $XAUTHORITY > $1 5 | cat $1 | while read line; do 6 | exit 0 7 | done 8 | --------------------------------------------------------------------------------