├── .build.yml ├── .github ├── FUNDING.yml └── issue_template.md ├── .travis.yml ├── .tx ├── config └── config_20221028215503.bak ├── AUTHORS ├── COPYING ├── ChangeLog ├── Makefile.am ├── NEWS ├── README ├── audio-video-properties ├── Makefile.am ├── bacon-video-widget-properties.c ├── bacon-video-widget-properties.h ├── libcaja-av.caja-extension.desktop.in.in ├── org.mate.caja.extensions.totemproperties.gresource.xml ├── totem-gst-helpers.c ├── totem-gst-helpers.h ├── totem-mime-types.h ├── totem-properties-main.c ├── totem-properties-view.c ├── totem-properties-view.h └── ui │ └── properties.ui ├── autogen.sh ├── caja-extensions.pot ├── configure.ac ├── git.mk ├── gksu ├── Makefile.am ├── libcaja-gksu.c └── libcaja-gksu.caja-extension.desktop.in.in ├── image-converter ├── Makefile.am ├── caja-image-converter.c ├── caja-image-converter.h ├── caja-image-resize.ui ├── caja-image-resizer.c ├── caja-image-resizer.h ├── caja-image-rotate.ui ├── caja-image-rotator.c ├── caja-image-rotator.h ├── error-dialog.ui ├── image-converter.c ├── libcaja-image-converter.caja-extension.desktop.in.in └── org.mate.caja.extensions.imageconverter.gresource.xml ├── makepot ├── open-terminal ├── Makefile.am ├── caja-open-terminal.c ├── caja-open-terminal.h ├── libcaja-open-terminal.caja-extension.desktop.in.in ├── open-terminal.c └── org.mate.caja-open-terminal.gschema.xml.in ├── po ├── LINGUAS ├── Makevars ├── POTFILES.in ├── af.po ├── am.po ├── ar.po ├── as.po ├── ast.po ├── az.po ├── be.po ├── bg.po ├── bn.po ├── bn_IN.po ├── br.po ├── bs.po ├── ca.po ├── ca@valencia.po ├── cmn.po ├── crh.po ├── cs.po ├── cy.po ├── da.po ├── de.po ├── dz.po ├── el.po ├── en_AU.po ├── en_CA.po ├── en_GB.po ├── en_US.po ├── eo.po ├── es.po ├── es_AR.po ├── es_CL.po ├── es_CO.po ├── es_CR.po ├── es_DO.po ├── es_EC.po ├── es_ES.po ├── es_MX.po ├── es_NI.po ├── es_PA.po ├── es_PE.po ├── es_PR.po ├── es_SV.po ├── es_UY.po ├── es_VE.po ├── et.po ├── eu.po ├── fa.po ├── fi.po ├── fr.po ├── fr_CA.po ├── frp.po ├── fur.po ├── fy.po ├── ga.po ├── gl.po ├── gu.po ├── ha.po ├── he.po ├── hi.po ├── hr.po ├── hu.po ├── hy.po ├── ia.po ├── id.po ├── ie.po ├── ig.po ├── is.po ├── it.po ├── ja.po ├── jv.po ├── ka.po ├── kab.po ├── kk.po ├── kn.po ├── ko.po ├── ku.po ├── ku_IQ.po ├── ky.po ├── li.po ├── lt.po ├── lv.po ├── mai.po ├── mg.po ├── mk.po ├── ml.po ├── mn.po ├── mr.po ├── ms.po ├── nan.po ├── nb.po ├── nds.po ├── ne.po ├── nl.po ├── nn.po ├── nso.po ├── oc.po ├── or.po ├── pa.po ├── pl.po ├── pms.po ├── ps.po ├── pt.po ├── pt_BR.po ├── ro.po ├── ru.po ├── rw.po ├── sc.po ├── si.po ├── sk.po ├── sl.po ├── sq.po ├── sr.po ├── sr@latin.po ├── sv.po ├── ta.po ├── te.po ├── th.po ├── tk.po ├── tr.po ├── ug.po ├── uk.po ├── ur.po ├── uz.po ├── vi.po ├── wa.po ├── xh.po ├── yo.po ├── zh_CN.po ├── zh_HK.po ├── zh_TW.po └── zu.po ├── sendto ├── Makefile.am ├── caja-nste.c ├── caja-nste.h ├── caja-sendto-command.c ├── caja-sendto-module.c ├── caja-sendto-plugin.h ├── caja-sendto.1 ├── caja-sendto.pc.in ├── caja-sendto.ui ├── docs │ ├── Makefile.am │ ├── caja-sendto-docs.sgml │ ├── caja-sendto-overrides.txt │ ├── caja-sendto-sections.txt │ ├── caja-sendto.types │ └── version.xml.in ├── libcaja-sendto.caja-extension.desktop.in.in ├── org.mate.Caja.Sendto.gschema.xml.in ├── org.mate.caja.extensions.sendto.gresource.xml └── plugins │ ├── Makefile.am │ ├── caja-burn │ ├── Makefile.am │ └── caja-burn.c │ ├── emailclient │ ├── Makefile.am │ └── emailclient.c │ ├── gajim │ ├── Makefile.am │ └── gajim.c │ ├── nst-common.c │ ├── nst-common.h │ ├── pidgin │ ├── Makefile.am │ └── pidgin.c │ ├── removable-devices │ ├── Makefile.am │ └── removable-devices.c │ └── upnp │ ├── Makefile.am │ └── upnp.c ├── share ├── Makefile.am ├── caja-share.c ├── caja-share.h ├── libcaja-share.caja-extension.desktop.in.in ├── share-dialog.ui ├── shares.c └── shares.h ├── wallpaper ├── Makefile.am ├── caja-wallpaper-command.c ├── caja-wallpaper-extension.c ├── caja-wallpaper-extension.h └── libcaja-wallpaper.caja-extension.desktop.in.in └── xattr-tags ├── Makefile.am ├── caja-xattr-tags-extension.c ├── caja-xattr-tags-extension.h └── libcaja-xattr-tags.caja-extension.desktop.in.in /.build.yml: -------------------------------------------------------------------------------- 1 | ########################################################## 2 | # THE FOLLOWING LINES IS USED BY docker-build 3 | ########################################################## 4 | requires: 5 | archlinux: 6 | # Useful URL: https://git.archlinux.org/svntogit/community.git/tree/caja-extensions 7 | - autoconf-archive 8 | - caja 9 | - clang 10 | - dbus-glib 11 | - gcc 12 | - git 13 | - gstreamer-plugins-base 14 | - gupnp 15 | - imagemagick 16 | - make 17 | - mate-common 18 | - python 19 | - samba 20 | - which 21 | 22 | debian: 23 | # Useful URL: https://github.com/mate-desktop/debian-packages 24 | # Useful URL: https://salsa.debian.org/debian-mate-team/caja-extensions 25 | - autoconf-archive 26 | - autopoint 27 | - clang 28 | - clang-tools 29 | - cppcheck 30 | - gcc 31 | - git 32 | - libcaja-extension-dev 33 | - libdbus-1-dev 34 | - libdbus-glib-1-dev 35 | - libdconf-dev 36 | - libgtk-3-dev 37 | - libgupnp-1.6-dev 38 | - libmate-desktop-dev 39 | - libstartup-notification0-dev 40 | - libxml2-utils 41 | - make 42 | - mate-common 43 | - pkg-config 44 | - libgstreamer-plugins-base1.0-dev 45 | 46 | fedora: 47 | # Useful URL: https://src.fedoraproject.org/cgit/rpms/caja-extensions.git 48 | - autoconf-archive 49 | - caja-devel 50 | - clang 51 | - clang-analyzer 52 | - cppcheck-htmlreport 53 | - dbus-glib-devel 54 | - dbus-glib-devel 55 | - gajim 56 | - gcc 57 | - git 58 | - gstreamer1-plugins-base-devel 59 | - gtk3-devel 60 | - gupnp-devel 61 | - make 62 | - mate-common 63 | - mate-desktop-devel 64 | - redhat-rpm-config 65 | 66 | ubuntu: 67 | - autoconf-archive 68 | - autopoint 69 | - clang 70 | - clang-tools 71 | - gcc 72 | - git 73 | - libcaja-extension-dev 74 | - libdbus-1-dev 75 | - libdbus-glib-1-dev 76 | - libdconf-dev 77 | - libgtk-3-dev 78 | - libgupnp-1.2-dev 79 | - libmate-desktop-dev 80 | - libstartup-notification0-dev 81 | - libxml2-utils 82 | - make 83 | - mate-common 84 | - pkg-config 85 | - libgstreamer-plugins-base1.0-dev 86 | 87 | variables: 88 | - 'CHECKERS=" 89 | -enable-checker deadcode.DeadStores 90 | -enable-checker alpha.deadcode.UnreachableCode 91 | -enable-checker alpha.core.CastSize 92 | -enable-checker alpha.core.CastToStruct 93 | -enable-checker alpha.core.IdenticalExpr 94 | -enable-checker alpha.core.SizeofPtr 95 | -enable-checker alpha.security.ArrayBoundV2 96 | -enable-checker alpha.security.MallocOverflow 97 | -enable-checker alpha.security.ReturnPtrRange 98 | -enable-checker alpha.unix.SimpleStream 99 | -enable-checker alpha.unix.cstring.BufferOverlap 100 | -enable-checker alpha.unix.cstring.NotNullTerminated 101 | -enable-checker alpha.unix.cstring.OutOfBounds 102 | -enable-checker alpha.core.FixedAddr 103 | -enable-checker security.insecureAPI.strcpy"' 104 | 105 | before_scripts: 106 | 107 | build_scripts: 108 | - if [ ${DISTRO_NAME} == "debian" ];then 109 | - export CFLAGS+=" -Wsign-compare -Wunused-macros" 110 | - cppcheck --enable=warning,style,performance,portability,information,missingInclude . 111 | - fi 112 | 113 | - NOCONFIGURE=1 ./autogen.sh 114 | - scan-build $CHECKERS ./configure --enable-compile-warnings=maximum 115 | - if [ $CPU_COUNT -gt 1 ]; then 116 | - if [ ${DISTRO_NAME} == "debian" ];then 117 | - scan-build $CHECKERS --keep-cc --use-cc=clang --use-c++=clang++ -o html-report make -j $CPU_COUNT 118 | - make clean 119 | - fi 120 | - scan-build $CHECKERS --keep-cc -o html-report make -j $CPU_COUNT 121 | - else 122 | - if [ ${DISTRO_NAME} == "debian" ];then 123 | - scan-build $CHECKERS --keep-cc --use-cc=clang --use-c++=clang++ -o html-report make 124 | - make clean 125 | - fi 126 | - scan-build $CHECKERS --keep-cc -o html-report make 127 | - fi 128 | 129 | after_scripts: 130 | - if [ ${DISTRO_NAME} == "fedora" ];then 131 | - cppcheck --xml --output-file=cppcheck.xml --enable=warning,style,performance,portability,information,missingInclude . 132 | - cppcheck-htmlreport --title=${REPO_NAME} --file=cppcheck.xml --report-dir=cppcheck-htmlreport 133 | - ./gen-index -l 20 -i https://github.com/${OWNER_NAME}/mate-icon-theme/raw/master/mate/16x16/apps/system-file-manager.png 134 | - fi 135 | - make distcheck 136 | 137 | releases: 138 | draft: false 139 | prerelease: false 140 | checksum: true 141 | file_glob: true 142 | files: caja-extensions-*.tar.xz 143 | github_release: 144 | tags: true 145 | overwrite: true 146 | base_version: 1.20.0 147 | notify_servers: 148 | - https://release.mate-desktop.org/release 149 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | custom: https://mate-desktop.org/donate/ 10 | -------------------------------------------------------------------------------- /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | #### Expected behaviour 2 | 3 | 4 | #### Actual behaviour 5 | 6 | 7 | #### Steps to reproduce the behaviour 8 | 9 | 10 | #### MATE general version 11 | 12 | 13 | #### Package version 14 | 15 | 16 | #### Linux Distribution 17 | 18 | 19 | #### Link to bugreport of your Distribution (requirement) 20 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # vim: set ts=2 sts=2 sw=2 expandtab : 2 | dist: jammy 3 | language: shell 4 | os: linux 5 | services: 6 | - docker 7 | addons: 8 | apt: 9 | packages: 10 | - python3-pip 11 | - python3-setuptools 12 | 13 | branches: 14 | except: 15 | - gh-pages 16 | 17 | before_install: 18 | - curl -Ls -o docker-build https://github.com/mate-desktop/mate-dev-scripts/raw/master/travis/docker-build 19 | - curl -Ls -o gen-index https://github.com/mate-desktop/mate-dev-scripts/raw/master/travis/gen-index.sh 20 | - chmod +x docker-build gen-index 21 | 22 | install: 23 | - pip3 install PyGithub 24 | - ./docker-build --name ${DISTRO} --config .build.yml --install 25 | 26 | script: 27 | - ./docker-build --name ${DISTRO} --verbose --config .build.yml --build scripts 28 | 29 | notifications: 30 | irc: 31 | if: (tag OR branch = master) AND 32 | repo = "mate-desktop/caja-extensions" 33 | channels: 34 | - "irc.libera.chat#mate-dev" 35 | template: 36 | - "[%{repository_name}] %{author}: %{commit_subject}" 37 | - "[%{branch}] %{commit} %{message} %{build_url}" 38 | on_success: never 39 | on_failure: always 40 | 41 | deploy: 42 | - provider: pages 43 | edge: true 44 | token: $GITHUB_TOKEN 45 | keep_history: false 46 | committer_from_gh: true 47 | target_branch: gh-pages 48 | local_dir: html-report 49 | strategy: git 50 | on: 51 | all_branches: true 52 | condition: ${DISTRO} =~ ^fedora.*$ 53 | - provider: script 54 | edge: true 55 | script: ./docker-build --verbose --config .build.yml --release github 56 | on: 57 | tags: true 58 | condition: "${TRAVIS_TAG} =~ ^v.*$ && ${DISTRO} =~ ^fedora.*$" 59 | 60 | after_success: 61 | - 'if [[ "$TRAVIS_SECURE_ENV_VARS" == "true" && "$TRAVIS_PULL_REQUEST" != "false" && ${DISTRO} =~ ^fedora.*$ ]]; then 62 | REPO_SLUG_ARRAY=(${TRAVIS_REPO_SLUG//\// }); 63 | REPO_NAME=${REPO_SLUG_ARRAY[1]}; 64 | URL="https://${REPO_NAME}.mate-desktop.dev"; 65 | COMMENT="Code analysis completed"; 66 | curl -H "Authorization: token $GITHUB_TOKEN" -X POST 67 | -d "{\"state\": \"success\", \"description\": \"$COMMENT\", \"context\":\"scan-build\", \"target_url\": \"$URL\"}" 68 | https://api.github.com/repos/${TRAVIS_REPO_SLUG}/statuses/${TRAVIS_PULL_REQUEST_SHA}; 69 | fi' 70 | 71 | env: 72 | # - DISTRO="archlinux:latest" 73 | - DISTRO="debian:testing" 74 | - DISTRO="fedora:latest" 75 | # - DISTRO="ubuntu:rolling" 76 | -------------------------------------------------------------------------------- /.tx/config: -------------------------------------------------------------------------------- 1 | [main] 2 | host = https://www.transifex.com 3 | 4 | [o:mate:p:MATE:r:master--caja-extensions] 5 | file_filter = po/.po 6 | source_file = po/caja-extensions.pot 7 | source_lang = en 8 | type = PO 9 | minimum_perc = 2 10 | 11 | -------------------------------------------------------------------------------- /.tx/config_20221028215503.bak: -------------------------------------------------------------------------------- 1 | [main] 2 | host = https://www.transifex.com 3 | 4 | [MATE.master--caja-extensions] 5 | file_filter = po/.po 6 | source_file = po/caja-extensions.pot 7 | source_lang = en 8 | type = PO 9 | minimum_perc = 2 10 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | MATE: 2 | 3 | Perberos 4 | Steve Zesch 5 | Stefano Karapetsas 6 | 7 | GNOME: 8 | 9 | nautilus-gksu: 10 | Gustavo Noronha Silva 11 | Allan Douglas 12 | Álvaro Peña 13 | 14 | nautilus-image-converter: 15 | Jürg Billeter 16 | 17 | nautilus-open-terminal: 18 | Christian Neumair 19 | 20 | nautilus-sendto: 21 | Roberto Majadas 22 | This module it's highly influenced by file-roller module 23 | Thanks Paolo Bacchilega :) 24 | Bluetooth plugin: Bastien Nocera 25 | 26 | nautilus-share: 27 | Sebastien Estienne 28 | Federico Mena Quintero 29 | Ed Catmur : dbus 0.3x API 30 | VoJcEK : polish translation 31 | Michael Kanis : german translation 32 | WareKala : finnish translation 33 | Mirko Maischberger : italian translation 34 | Aaron Kurtz : Fedora Core 4 package 35 | Lucius Curado : brazilian translation 36 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | The ChangeLog is auto-generated when releasing. If you are seeing this, use 2 | 'git log' for a detailed list of changes. 3 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} 2 | 3 | SUBDIRS = 4 | 5 | if USE_NLS 6 | SUBDIRS += po 7 | endif 8 | 9 | if ENABLE_TOTEM_PROPERTIES 10 | SUBDIRS += audio-video-properties 11 | endif 12 | 13 | if ENABLE_OPEN_TERMINAL 14 | SUBDIRS += open-terminal 15 | endif 16 | 17 | if ENABLE_SENDTO 18 | SUBDIRS += sendto 19 | endif 20 | 21 | if ENABLE_IMAGE_CONVERTER 22 | SUBDIRS += image-converter 23 | endif 24 | 25 | if ENABLE_GKSU 26 | SUBDIRS += gksu 27 | endif 28 | 29 | if ENABLE_SHARE 30 | SUBDIRS += share 31 | endif 32 | 33 | if ENABLE_WALLPAPER 34 | SUBDIRS += wallpaper 35 | endif 36 | 37 | if ENABLE_XATTR_TAGS 38 | SUBDIRS += xattr-tags 39 | endif 40 | 41 | EXTRA_DIST = autogen.sh 42 | 43 | DISTCLEANFILES = 44 | 45 | DISTCHECK_CONFIGURE_FLAGS = \ 46 | --enable-gtk-doc \ 47 | --with-cajadir='$${libdir}/caja/extensions-2.0-distcheck' \ 48 | --enable-compile-warnings=no \ 49 | CFLAGS='-Wno-deprecated-declarations' 50 | 51 | # Build ChangeLog from GIT history 52 | ChangeLog: 53 | $(AM_V_GEN) if test -d $(top_srcdir)/.git; then \ 54 | GIT_DIR="$(top_srcdir)/.git" git log --stat > $@; \ 55 | fi 56 | 57 | dist: ChangeLog 58 | 59 | .PHONY: ChangeLog 60 | 61 | -include $(top_srcdir)/git.mk 62 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | ### caja-extensions 1.28.0 2 | 3 | * Translations update 4 | 5 | ### caja-extensions 1.27.1 6 | 7 | * Translations update 8 | * sendto: require gupnp-1.6 9 | * xattr-tags-extension: avoid check xattr for mtp:// and gphoto2:// 10 | * Fix missing GtkRadioButton id 11 | 12 | ### caja-extensions 1.27.0 13 | 14 | * Translations update 15 | * travis-CI: update build dependencies for debian:testing 16 | * tx: migrate config file 17 | * Failed to resolve the path to caja-extensions.mo on guix system 18 | * bacon-video-widget-properties: fix warning 'g_type_class_add_private' is deprecated 19 | * add audio-video-properties plugin 20 | * build warning: AC_OUTPUT should be used without arguments 21 | * Fixed caja-share not working under Arch Linux 22 | * Fix build warnings about missing field initializer 23 | * Fix build warning -Wmissing-prototypes 24 | * ci: drop -Wunused-parameter compiler cflag from debian build 25 | * Use a blank line at most 26 | 27 | ### caja-extensions 1.26.0 28 | 29 | * Translations update 30 | * update copyright to 2021 31 | 32 | ### caja-extensions 1.25.1 33 | 34 | * Translations update 35 | * image-converter: remove hardcoded filepath to convert (portability) 36 | * build: allow users to disable gettext support (--disable-nls) 37 | * build: set GETTEXT_PACKAGE=AC_PACKAGE_NAME 38 | * gksu: do not run the command on a new thread 39 | * Do not call bindtextdomain/bind_textdomain_codeset in libraries 40 | * Include i18n header after defining GETTEXT_PACKAGE macro 41 | * caja-image-rotator: remove user_data cast on signal handler 42 | * caja-image-resizer: remove user_data cast on signal handler 43 | * caja-image-resizer: use gtk_builder_new_from_resource 44 | * caja-image-rotator: use gtk_builder_new_from_resource 45 | * caja-image-resizer: promote to final class 46 | * caja-image-rotator: promote to final class 47 | * build: Use PACKAGE_URL variable 48 | * Print status messages 49 | * Update copyright 50 | * Remove warning -Wshadow 51 | * caja-sendto-command: use g_list_free_full 52 | * lookup_in_data_dir, caja_open_terminal_get_file_items are static 53 | * Use `#include ` 54 | * Remove USE_MATE2_MACROS from autogen.sh (legacy) 55 | * Remove unused macros 56 | 57 | ### caja-extensions 1.25.0 58 | 59 | * Translations update 60 | * update resource for transifex 61 | * add git.mk to generate .gitignore 62 | * Require gtk+ 3.22 in glade files 63 | * sendto: Fix evolution command for sending an email 64 | * build: silent build warnings for distcheck 65 | * image-converter: Add error-dialog.ui 66 | * use MATE_COMPILE_WARNINGS from mate-common 67 | * Fix memory leak allocated with 'gtk_builder_new ()' 68 | * caja-image-rotator: fix memory leak pointed to by 'angle' 69 | * caja-image-resizer: fix memory leak pointed to by 'size' 70 | * image-converter: use gresources for UI files 71 | * share: rewrite share-dialog.ui from scratch 72 | * caja-sendto-command: fix memory leak pointed to by 'p' 73 | * image-converter: rewrite caja-image-rotate.ui from scratch 74 | * Do not collect the translation for Icon 75 | * automake: do not include CFLAGS in CPPFLAGS 76 | 77 | ### caja-extensions 1.24.0 78 | 79 | * Translations update 80 | * caja-sendto: rewrite caja-sendto.ui from scratch fixing deprecations 81 | * caja-sendto-command: add .7z,.tar.xz to packed type drop-down list 82 | * caja-wallpaper-extension: remove unused pointer 'GError *err' 83 | * caja-wallpaper-extension: fix memory leak 84 | * image-converter: i18n select an angle drop-down list 85 | * image-converter: rewrite caja-image-resize.ui from scratch fixing deprecations 86 | * sendto: value stored to 'file' is never read 87 | * configure: get quieter output from make 88 | 89 | ### caja-extensions 1.23.1 90 | 91 | * Translations update 92 | * migrate from intltool to gettext 93 | * caja-image-resizer: avoid 'g_type_class_add_private' 94 | * caja-image-rotator: avoid 'g_type_class_add_private' 95 | * i18n caja extension copyright 96 | * Build either with gupnp version 1.0 or 1.2. 97 | * image-converter: don't use non-existing icons in context menu 98 | 99 | ### caja-extensions 1.23.0 100 | 101 | * Translations update 102 | * Remove trailing whitespaces 103 | * Strings resistance 104 | * Change url project's website 105 | * [ci] Add cppcheck html report 106 | * [ci] Enable Clang Static Analyzer 107 | 108 | ### caja-extensions 1.22.0 109 | 110 | * Translations update 111 | * Initialize Travis CI support 112 | * require caja >= 1.21.3 113 | 114 | ### caja-extensions 1.21.0 115 | 116 | * Translations update 117 | * disable deprecation warnings for distcheck 118 | * Make caja-open-terminal configurable (Depends on caja GitHub PR caja#1050) 119 | 120 | ### caja-extensions 1.20.0 121 | 122 | * Translations update 123 | * require GTK+ 3.22 and GLib 2.50 124 | * xattr-tags: use better English in extension description 125 | * po: add missing translatable strings from xattrs extension 126 | * xattr-tags: fix extension description 127 | 128 | ### caja-extensions 1.19.0 129 | 130 | * Translations update 131 | * open-terminal: don't use excessive string duplication 132 | * avoid deprecated gdk_screen_make_display_name 133 | * sendto burn: avoid deprecated gtk_show_uri 134 | * xattr-tags: remove hack, it's not needed now 135 | * xattr-tags: fix typo causing undefined reference 136 | * fix the libcaja_gksu_la_LDFLAGS variable declaration 137 | * xattr-tags: add missing newline to startup message 138 | * xattr-tags: unescaping stored attributes. 139 | * README: Added development info. 140 | 141 | ### caja-extensions 1.18.0 142 | 143 | * NEWS: use consistent, project wide, markdown-like formatting to make 144 | generating release announcements easier 145 | * Build: require caja >= 1.17.1 and libmate-desktop >= 1.17.0 146 | * Move to GTK+3 (require GTK+ >= 3.14), drop GTK+2 code and --with-gtk 147 | build option 148 | * Add xattr-tags extension to show xattr tags in a new column 149 | * Translations update 150 | 151 | ### caja-extensions 1.16.0 152 | 153 | * open-terminal: fix opening terminal in remote folders with single 154 | or double quote in their names 155 | * open-terminal: some code cleanups 156 | * Translations update 157 | 158 | ### caja-extensions 1.14.1 159 | 160 | * Translations update 161 | * Make distcheck use currently selected GTK+ version 162 | 163 | ### caja-extensions 1.14.0 164 | 165 | * Drop MateConf migration scripts 166 | * GTK+3: some deprecation fixes 167 | * Some more fixes and cleanups 168 | * Translations update 169 | * Add Changelog generation 170 | 171 | ### caja-extensions 1.12.0 172 | 173 | * Some string fixes 174 | * Translations update 175 | 176 | ### caja-extensions 1.10.1 177 | 178 | * open-terminal: fixed bugs with non-standard ssh ports 179 | 180 | ### caja-extensions 1.10.0 181 | 182 | * wallpaper: Added new 'Set as wallpaper' extension 183 | * sendto: re-introduce the option to select plugins to build 184 | 185 | ### caja-extensions 1.8.0 186 | 187 | * New release merging all current official MATE caja extensions in a single 188 | package. 189 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Set of extensions for Caja, the MATE file manager. 2 | 3 | Debug 4 | ----- 5 | 6 | In order to see caja debug messages, you need to set the CAJA_DEBUG env variable. 7 | e.g.: $ CAJA_DEBUG=y caja 8 | 9 | Notes 10 | ----- 11 | 12 | To test caja-extensions with a custom caja build you need to specify the 13 | caja-extension dir. e.g.: 14 | 15 | $ ./configure --with-cajadir=/usr/local/lib/caja/extensions-2.0/ \ 16 | --prefix=/usr/local 17 | -------------------------------------------------------------------------------- /audio-video-properties/Makefile.am: -------------------------------------------------------------------------------- 1 | NULL = 2 | AM_CPPFLAGS = \ 3 | $(DISABLE_DEPRECATED_CPPFLAGS) \ 4 | -DMATELOCALEDIR=\""$(datadir)/locale"\" \ 5 | -I$(top_srcdir) \ 6 | -I$(top_builddir) \ 7 | $(NULL) 8 | 9 | AM_CFLAGS = \ 10 | $(WARN_CFLAGS) \ 11 | $(NULL) 12 | 13 | caja_extensiondir=$(CAJA_EXTENSION_DIR) 14 | 15 | caja_extension_LTLIBRARIES=libcaja-av.la 16 | 17 | resources_built_sources = caja-av-resources.h caja-av-resources.c 18 | $(resources_built_sources): org.mate.caja.extensions.totemproperties.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/org.mate.caja.extensions.totemproperties.gresource.xml) 19 | $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate --c-name totemproperties $< 20 | 21 | libcaja_av_la_SOURCES = \ 22 | totem-properties-main.c \ 23 | totem-properties-view.c \ 24 | totem-properties-view.h \ 25 | bacon-video-widget-properties.c \ 26 | bacon-video-widget-properties.h \ 27 | totem-gst-helpers.c \ 28 | totem-gst-helpers.h \ 29 | totem-mime-types.h \ 30 | $(resources_built_sources) \ 31 | $(NULL) 32 | libcaja_av_la_CPPFLAGS = \ 33 | $(AM_CPPFLAGS) \ 34 | -DG_LOG_DOMAIN=\"Caja-Image-Converter\" \ 35 | $(NULL) 36 | libcaja_av_la_CFLAGS = \ 37 | $(AM_CFLAGS) \ 38 | $(CAJA_CFLAGS) \ 39 | $(TOTEM_PROPERTIES_CFLAGS) \ 40 | $(NULL) 41 | libcaja_av_la_LDFLAGS = -module -avoid-version 42 | libcaja_av_la_LIBADD = \ 43 | -lm \ 44 | $(CAJA_LIBS) \ 45 | $(TOTEM_PROPERTIES_LIBS) \ 46 | $(NULL) 47 | 48 | extensiondir = $(datadir)/caja/extensions 49 | extension_in_files = libcaja-av.caja-extension.desktop.in 50 | extension_DATA = $(extension_in_files:.caja-extension.desktop.in=.caja-extension) 51 | $(extension_DATA): $(extension_in_files) 52 | if USE_NLS 53 | $(AM_V_GEN) $(MSGFMT) --desktop --keyword= --keyword=Copyright --keyword=Name --keyword=Description --template $< -d $(top_srcdir)/po -o $@ 54 | else 55 | $(AM_V_GEN) cp $< $@ 56 | endif 57 | 58 | EXTRA_DIST = \ 59 | ui/properties.ui \ 60 | org.mate.caja.extensions.totemproperties.gresource.xml \ 61 | $(NULL) 62 | 63 | CLEANFILES = \ 64 | $(extension_DATA) \ 65 | $(resources_built_sources) \ 66 | $(NULL) 67 | 68 | -include $(top_srcdir)/git.mk 69 | -------------------------------------------------------------------------------- /audio-video-properties/bacon-video-widget-properties.c: -------------------------------------------------------------------------------- 1 | /* bacon-video-widget-properties.c 2 | 3 | Copyright (C) 2002 Bastien Nocera 4 | 5 | The Gnome Library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library 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 | The Gnome Library 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 GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with the Gnome Library; see the file COPYING.LIB. If not, 17 | write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | Boston, MA 02110-1301 USA. 19 | 20 | Author: Bastien Nocera 21 | */ 22 | 23 | #include "config.h" 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #include "bacon-video-widget-properties.h" 31 | 32 | static void bacon_video_widget_properties_dispose (GObject *object); 33 | 34 | struct BaconVideoWidgetPropertiesPrivate { 35 | GtkBuilder *xml; 36 | int time; 37 | }; 38 | 39 | G_DEFINE_TYPE_WITH_PRIVATE (BaconVideoWidgetProperties, bacon_video_widget_properties, GTK_TYPE_BOX) 40 | 41 | static void 42 | bacon_video_widget_properties_class_init (BaconVideoWidgetPropertiesClass *klass) 43 | { 44 | GObjectClass *object_class = G_OBJECT_CLASS (klass); 45 | 46 | object_class->dispose = bacon_video_widget_properties_dispose; 47 | } 48 | 49 | static void 50 | bacon_video_widget_properties_init (BaconVideoWidgetProperties *props) 51 | { 52 | props->priv = bacon_video_widget_properties_get_instance_private (props); 53 | 54 | gtk_orientable_set_orientation (GTK_ORIENTABLE (props), GTK_ORIENTATION_VERTICAL); 55 | } 56 | 57 | static void 58 | bacon_video_widget_properties_dispose (GObject *object) 59 | { 60 | BaconVideoWidgetProperties *props; 61 | 62 | g_return_if_fail (object != NULL); 63 | g_return_if_fail (BACON_IS_VIDEO_WIDGET_PROPERTIES (object)); 64 | 65 | props = BACON_VIDEO_WIDGET_PROPERTIES (object); 66 | 67 | g_clear_object (&props->priv->xml); 68 | 69 | G_OBJECT_CLASS (bacon_video_widget_properties_parent_class)->dispose (object); 70 | } 71 | 72 | void 73 | bacon_video_widget_properties_set_label (BaconVideoWidgetProperties *props, 74 | const char *name, 75 | const char *text) 76 | { 77 | GtkLabel *item; 78 | 79 | g_return_if_fail (props != NULL); 80 | g_return_if_fail (BACON_IS_VIDEO_WIDGET_PROPERTIES (props)); 81 | g_return_if_fail (name != NULL); 82 | 83 | item = GTK_LABEL (gtk_builder_get_object (props->priv->xml, name)); 84 | g_return_if_fail (item != NULL); 85 | gtk_label_set_text (item, text); 86 | } 87 | 88 | void 89 | bacon_video_widget_properties_reset (BaconVideoWidgetProperties *props) 90 | { 91 | GtkWidget *item; 92 | 93 | g_return_if_fail (props != NULL); 94 | g_return_if_fail (BACON_IS_VIDEO_WIDGET_PROPERTIES (props)); 95 | 96 | item = GTK_WIDGET (gtk_builder_get_object (props->priv->xml, "video_vbox")); 97 | gtk_widget_show (item); 98 | item = GTK_WIDGET (gtk_builder_get_object (props->priv->xml, "video")); 99 | gtk_widget_set_sensitive (item, FALSE); 100 | item = GTK_WIDGET (gtk_builder_get_object (props->priv->xml, "audio")); 101 | gtk_widget_set_sensitive (item, FALSE); 102 | 103 | /* Title */ 104 | bacon_video_widget_properties_set_label (props, "title", C_("Title", "Unknown")); 105 | /* Artist */ 106 | bacon_video_widget_properties_set_label (props, "artist", C_("Artist", "Unknown")); 107 | /* Album */ 108 | bacon_video_widget_properties_set_label (props, "album", C_("Album", "Unknown")); 109 | /* Year */ 110 | bacon_video_widget_properties_set_label (props, "year", C_("Year", "Unknown")); 111 | /* Duration */ 112 | bacon_video_widget_properties_set_duration (props, 0); 113 | /* Comment */ 114 | bacon_video_widget_properties_set_label (props, "comment", ""); 115 | /* Container */ 116 | bacon_video_widget_properties_set_label (props, "container", C_("Media container", "Unknown")); 117 | 118 | /* Dimensions */ 119 | bacon_video_widget_properties_set_label (props, "dimensions", C_("Dimensions", "N/A")); 120 | /* Video Codec */ 121 | bacon_video_widget_properties_set_label (props, "vcodec", C_("Video codec", "N/A")); 122 | /* Video Bitrate */ 123 | bacon_video_widget_properties_set_label (props, "video_bitrate", 124 | C_("Video bit rate", "N/A")); 125 | /* Framerate */ 126 | bacon_video_widget_properties_set_label (props, "framerate", 127 | C_("Frame rate", "N/A")); 128 | 129 | /* Audio Bitrate */ 130 | bacon_video_widget_properties_set_label (props, "audio_bitrate", 131 | C_("Audio bit rate", "N/A")); 132 | /* Audio Codec */ 133 | bacon_video_widget_properties_set_label (props, "acodec", C_("Audio codec", "N/A")); 134 | /* Sample rate */ 135 | bacon_video_widget_properties_set_label (props, "samplerate", _("0 Hz")); 136 | /* Channels */ 137 | bacon_video_widget_properties_set_label (props, "channels", _("0 Channels")); 138 | } 139 | 140 | static char * 141 | time_to_string_text (gint64 msecs) 142 | { 143 | char *secs, *mins, *hours, *string; 144 | int sec, min, hour, _time; 145 | 146 | _time = (int) (msecs / 1000); 147 | sec = _time % 60; 148 | _time = _time - sec; 149 | min = (_time % (60*60)) / 60; 150 | _time = _time - (min * 60); 151 | hour = _time / (60*60); 152 | 153 | hours = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE, "%d hour", "%d hours", hour), hour); 154 | 155 | mins = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE, "%d minute", 156 | "%d minutes", min), min); 157 | 158 | secs = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE, "%d second", 159 | "%d seconds", sec), sec); 160 | 161 | if (hour > 0) 162 | { 163 | /* 5 hours 2 minutes 12 seconds */ 164 | string = g_strdup_printf (C_("time", "%s %s %s"), hours, mins, secs); 165 | } else if (min > 0) { 166 | /* 2 minutes 12 seconds */ 167 | string = g_strdup_printf (C_("time", "%s %s"), mins, secs); 168 | } else if (sec > 0) { 169 | /* 10 seconds */ 170 | string = g_strdup (secs); 171 | } else { 172 | /* 0 seconds */ 173 | string = g_strdup (_("0 seconds")); 174 | } 175 | 176 | g_free (hours); 177 | g_free (mins); 178 | g_free (secs); 179 | 180 | return string; 181 | } 182 | 183 | void 184 | bacon_video_widget_properties_set_duration (BaconVideoWidgetProperties *props, 185 | int _time) 186 | { 187 | char *string; 188 | 189 | g_return_if_fail (props != NULL); 190 | g_return_if_fail (BACON_IS_VIDEO_WIDGET_PROPERTIES (props)); 191 | 192 | if (_time == props->priv->time) 193 | return; 194 | 195 | string = time_to_string_text (_time); 196 | bacon_video_widget_properties_set_label (props, "duration", string); 197 | g_free (string); 198 | 199 | props->priv->time = _time; 200 | } 201 | 202 | void 203 | bacon_video_widget_properties_set_has_type (BaconVideoWidgetProperties *props, 204 | gboolean has_video, 205 | gboolean has_audio) 206 | { 207 | GtkWidget *item; 208 | 209 | g_return_if_fail (props != NULL); 210 | g_return_if_fail (BACON_IS_VIDEO_WIDGET_PROPERTIES (props)); 211 | 212 | /* Video */ 213 | item = GTK_WIDGET (gtk_builder_get_object (props->priv->xml, "video")); 214 | gtk_widget_set_sensitive (item, has_video); 215 | item = GTK_WIDGET (gtk_builder_get_object (props->priv->xml, "video_vbox")); 216 | gtk_widget_set_visible (item, has_video); 217 | 218 | /* Audio */ 219 | item = GTK_WIDGET (gtk_builder_get_object (props->priv->xml, "audio")); 220 | gtk_widget_set_sensitive (item, has_audio); 221 | } 222 | 223 | void 224 | bacon_video_widget_properties_set_framerate (BaconVideoWidgetProperties *props, 225 | float framerate) 226 | { 227 | gchar *temp; 228 | 229 | g_return_if_fail (props != NULL); 230 | g_return_if_fail (BACON_IS_VIDEO_WIDGET_PROPERTIES (props)); 231 | 232 | if (framerate > 1.0) { 233 | temp = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE, "%0.2f frame per second", "%0.2f frames per second", (int) (ceilf (framerate))), framerate); 234 | } else { 235 | temp = g_strdup (C_("Frame rate", "N/A")); 236 | } 237 | bacon_video_widget_properties_set_label (props, "framerate", temp); 238 | g_free (temp); 239 | } 240 | 241 | GtkWidget* 242 | bacon_video_widget_properties_new (void) 243 | { 244 | BaconVideoWidgetProperties *props; 245 | GtkBuilder *xml; 246 | GtkWidget *vbox; 247 | GtkSizeGroup *group; 248 | const char *labels[] = { "title_label", "artist_label", "album_label", 249 | "year_label", "duration_label", "comment_label", "container_label", 250 | "dimensions_label", "vcodec_label", "framerate_label", 251 | "vbitrate_label", "abitrate_label", "acodec_label", 252 | "samplerate_label", "channels_label" }; 253 | guint i; 254 | 255 | xml = gtk_builder_new (); 256 | gtk_builder_set_translation_domain (xml, GETTEXT_PACKAGE); 257 | if (gtk_builder_add_from_resource (xml, "/org/mate/caja/extensions/totemproperties/ui/properties.ui", NULL) == 0) { 258 | g_object_unref (xml); 259 | return NULL; 260 | } 261 | 262 | props = BACON_VIDEO_WIDGET_PROPERTIES (g_object_new 263 | (BACON_TYPE_VIDEO_WIDGET_PROPERTIES, NULL)); 264 | 265 | props->priv->xml = xml; 266 | vbox = GTK_WIDGET (gtk_builder_get_object (props->priv->xml, "vbox1")); 267 | gtk_box_pack_start (GTK_BOX (props), vbox, FALSE, FALSE, 0); 268 | 269 | bacon_video_widget_properties_reset (props); 270 | 271 | group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); 272 | 273 | for (i = 0; i < G_N_ELEMENTS (labels); i++) 274 | gtk_size_group_add_widget (group, GTK_WIDGET (gtk_builder_get_object (xml, labels[i]))); 275 | 276 | g_object_unref (group); 277 | 278 | gtk_widget_show_all (GTK_WIDGET (props)); 279 | 280 | return GTK_WIDGET (props); 281 | } 282 | -------------------------------------------------------------------------------- /audio-video-properties/bacon-video-widget-properties.h: -------------------------------------------------------------------------------- 1 | /* bacon-video-widget-properties.h: Properties dialog for BaconVideoWidget 2 | 3 | Copyright (C) 2002 Bastien Nocera 4 | 5 | The Gnome Library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library 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 | The Gnome Library 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 GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with the Gnome Library; see the file COPYING.LIB. If not, 17 | write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | Boston, MA 02110-1301 USA. 19 | 20 | Author: Bastien Nocera 21 | */ 22 | 23 | #ifndef BACON_VIDEO_WIDGET_PROPERTIES_H 24 | #define BACON_VIDEO_WIDGET_PROPERTIES_H 25 | 26 | #include 27 | 28 | #define BACON_TYPE_VIDEO_WIDGET_PROPERTIES (bacon_video_widget_properties_get_type ()) 29 | #define BACON_VIDEO_WIDGET_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BACON_TYPE_VIDEO_WIDGET_PROPERTIES, BaconVideoWidgetProperties)) 30 | #define BACON_VIDEO_WIDGET_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BACON_TYPE_VIDEO_WIDGET_PROPERTIES, BaconVideoWidgetPropertiesClass)) 31 | #define BACON_IS_VIDEO_WIDGET_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BACON_TYPE_VIDEO_WIDGET_PROPERTIES)) 32 | #define BACON_IS_VIDEO_WIDGET_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BACON_TYPE_VIDEO_WIDGET_PROPERTIES)) 33 | 34 | typedef struct BaconVideoWidgetProperties BaconVideoWidgetProperties; 35 | typedef struct BaconVideoWidgetPropertiesClass BaconVideoWidgetPropertiesClass; 36 | typedef struct BaconVideoWidgetPropertiesPrivate BaconVideoWidgetPropertiesPrivate; 37 | 38 | struct BaconVideoWidgetProperties { 39 | GtkBox parent; 40 | BaconVideoWidgetPropertiesPrivate *priv; 41 | }; 42 | 43 | struct BaconVideoWidgetPropertiesClass { 44 | GtkBoxClass parent_class; 45 | }; 46 | 47 | GType bacon_video_widget_properties_get_type (void); 48 | GtkWidget *bacon_video_widget_properties_new (void); 49 | 50 | void bacon_video_widget_properties_reset (BaconVideoWidgetProperties *props); 51 | void bacon_video_widget_properties_set_label (BaconVideoWidgetProperties *props, 52 | const char *name, 53 | const char *text); 54 | void bacon_video_widget_properties_set_duration (BaconVideoWidgetProperties *props, 55 | int duration); 56 | void bacon_video_widget_properties_set_has_type (BaconVideoWidgetProperties *props, 57 | gboolean has_video, 58 | gboolean has_audio); 59 | void bacon_video_widget_properties_set_framerate (BaconVideoWidgetProperties *props, 60 | float framerate); 61 | 62 | #endif /* BACON_VIDEO_WIDGET_PROPERTIES_H */ 63 | -------------------------------------------------------------------------------- /audio-video-properties/libcaja-av.caja-extension.desktop.in.in: -------------------------------------------------------------------------------- 1 | [Caja Extension] 2 | # Translators: Do NOT translate or transliterate this text (this is an icon file name)! 3 | Icon=video 4 | Name=Audio/Video Properties 5 | Description=Display audio/video properties 6 | Author=Bastien Nocera 7 | Copyright=Copyright (C) 2005 Bastien Nocera\nCopyright (C) 2005-2019 Totem Media Player developers\nCopyright (C) 2019-2021 Nautilus developers\nCopyright (C) 2021 MATE developers 8 | Version=@VERSION@ 9 | Website=@PACKAGE_URL@ 10 | -------------------------------------------------------------------------------- /audio-video-properties/org.mate.caja.extensions.totemproperties.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ui/properties.ui 5 | 6 | 7 | -------------------------------------------------------------------------------- /audio-video-properties/totem-gst-helpers.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2007 the GStreamer project 3 | * Julien Moutte 4 | * Ronald Bultje 5 | * Copyright (C) 2005-2008 Tim-Philipp Müller 6 | * Copyright (C) 2009 Sebastian Dröge 7 | * Copyright © 2009 Christian Persch 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 22 | * 23 | */ 24 | 25 | #include "totem-gst-helpers.h" 26 | #include 27 | 28 | /* Disable decoders that require a display environment to work, 29 | * and that might cause crashes */ 30 | void 31 | totem_gst_disable_display_decoders (void) 32 | { 33 | GstRegistry *registry; 34 | const char *blacklisted_plugins[] = { 35 | "bmcdec", 36 | "vaapi", 37 | "video4linux2" 38 | }; 39 | guint i; 40 | 41 | /* Disable the vaapi plugin as it will not work with the 42 | * fakesink we use: 43 | * See: https://bugzilla.gnome.org/show_bug.cgi?id=700186 and 44 | * https://bugzilla.gnome.org/show_bug.cgi?id=749605 */ 45 | registry = gst_registry_get (); 46 | 47 | for (i = 0; i < G_N_ELEMENTS (blacklisted_plugins); i++) { 48 | GstPlugin *plugin = 49 | gst_registry_find_plugin (registry, 50 | blacklisted_plugins[i]); 51 | if (plugin) 52 | gst_registry_remove_plugin (registry, plugin); 53 | } 54 | } 55 | 56 | /* 57 | * vim: sw=2 ts=8 cindent noai bs=2 58 | */ 59 | -------------------------------------------------------------------------------- /audio-video-properties/totem-gst-helpers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001,2002,2003,2004,2005 Bastien Nocera 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, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | * 18 | */ 19 | 20 | #ifndef HAVE_TOTEM_GST_HELPERS_H 21 | #define HAVE_TOTEM_GST_HELPERS_H 22 | 23 | void totem_gst_disable_display_decoders (void); 24 | 25 | #endif /* HAVE_TOTEM_GST_HELPERS_H */ 26 | -------------------------------------------------------------------------------- /audio-video-properties/totem-mime-types.h: -------------------------------------------------------------------------------- 1 | /* generated with mime-types-include.sh, don't edit */ 2 | G_GNUC_UNUSED static const gchar *mime_types[] = { 3 | "application/mxf", 4 | "application/ogg", 5 | "application/ram", 6 | "application/sdp", 7 | "application/smil", 8 | "application/smil+xml", 9 | "application/vnd.apple.mpegurl", 10 | "application/vnd.ms-asf", 11 | "application/vnd.ms-wpl", 12 | "application/vnd.rn-realmedia", 13 | "application/vnd.rn-realmedia-vbr", 14 | "application/x-extension-m4a", 15 | "application/x-extension-mp4", 16 | "application/x-flac", 17 | "application/x-flash-video", 18 | "application/x-matroska", 19 | "application/x-netshow-channel", 20 | "application/x-ogg", 21 | "application/x-quicktime-media-link", 22 | "application/x-quicktimeplayer", 23 | "application/x-shorten", 24 | "application/x-smil", 25 | "application/xspf+xml", 26 | "audio/3gpp", 27 | "audio/3gpp2", 28 | "audio/aac", 29 | "audio/ac3", 30 | "audio/AMR", 31 | "audio/AMR-WB", 32 | "audio/basic", 33 | "audio/dv", 34 | "audio/eac3", 35 | "audio/flac", 36 | "audio/m4a", 37 | "audio/midi", 38 | "audio/mp1", 39 | "audio/mp2", 40 | "audio/mp3", 41 | "audio/mp4", 42 | "audio/mpeg", 43 | "audio/mpegurl", 44 | "audio/mpg", 45 | "audio/ogg", 46 | "audio/opus", 47 | "audio/prs.sid", 48 | "audio/scpls", 49 | "audio/vnd.rn-realaudio", 50 | "audio/wav", 51 | "audio/webm", 52 | "audio/x-aac", 53 | "audio/x-aiff", 54 | "audio/x-ape", 55 | "audio/x-flac", 56 | "audio/x-gsm", 57 | "audio/x-it", 58 | "audio/x-m4a", 59 | "audio/x-m4b", 60 | "audio/x-matroska", 61 | "audio/x-mod", 62 | "audio/x-mp1", 63 | "audio/x-mp2", 64 | "audio/x-mp3", 65 | "audio/x-mpg", 66 | "audio/x-mpeg", 67 | "audio/x-mpegurl", 68 | "audio/x-ms-asf", 69 | "audio/x-ms-asx", 70 | "audio/x-ms-wax", 71 | "audio/x-ms-wma", 72 | "audio/x-musepack", 73 | "audio/x-opus+ogg", 74 | "audio/x-pn-aiff", 75 | "audio/x-pn-au", 76 | "audio/x-pn-realaudio", 77 | "audio/x-pn-realaudio-plugin", 78 | "audio/x-pn-wav", 79 | "audio/x-pn-windows-acm", 80 | "audio/x-realaudio", 81 | "audio/x-real-audio", 82 | "audio/x-s3m", 83 | "audio/x-sbc", 84 | "audio/x-scpls", 85 | "audio/x-shorten", 86 | "audio/x-speex", 87 | "audio/x-stm", 88 | "audio/x-tta", 89 | "audio/x-wav", 90 | "audio/x-wavpack", 91 | "audio/x-vorbis", 92 | "audio/x-vorbis+ogg", 93 | "audio/x-xm", 94 | "image/vnd.rn-realpix", 95 | "image/x-pict", 96 | "misc/ultravox", 97 | "text/google-video-pointer", 98 | "text/x-google-video-pointer", 99 | "video/3gp", 100 | "video/3gpp", 101 | "video/3gpp2", 102 | "video/dv", 103 | "video/divx", 104 | "video/fli", 105 | "video/flv", 106 | "video/mp2t", 107 | "video/mp4", 108 | "video/mp4v-es", 109 | "video/mpeg", 110 | "video/mpeg-system", 111 | "video/msvideo", 112 | "video/ogg", 113 | "video/quicktime", 114 | "video/vivo", 115 | "video/vnd.divx", 116 | "video/vnd.mpegurl", 117 | "video/vnd.rn-realvideo", 118 | "video/vnd.vivo", 119 | "video/webm", 120 | "video/x-anim", 121 | "video/x-avi", 122 | "video/x-flc", 123 | "video/x-fli", 124 | "video/x-flic", 125 | "video/x-flv", 126 | "video/x-m4v", 127 | "video/x-matroska", 128 | "video/x-mjpeg", 129 | "video/x-mpeg", 130 | "video/x-mpeg2", 131 | "video/x-ms-asf", 132 | "video/x-ms-asf-plugin", 133 | "video/x-ms-asx", 134 | "video/x-msvideo", 135 | "video/x-ms-wm", 136 | "video/x-ms-wmv", 137 | "video/x-ms-wmx", 138 | "video/x-ms-wvx", 139 | "video/x-nsv", 140 | "video/x-ogm+ogg", 141 | "video/x-theora", 142 | "video/x-theora+ogg", 143 | "video/x-totem-stream", 144 | NULL 145 | }; 146 | G_GNUC_UNUSED static const gchar *audio_mime_types[] = { 147 | "audio/3gpp", 148 | "audio/3gpp2", 149 | "audio/aac", 150 | "audio/ac3", 151 | "audio/AMR", 152 | "audio/AMR-WB", 153 | "audio/basic", 154 | "audio/dv", 155 | "audio/eac3", 156 | "audio/flac", 157 | "audio/m4a", 158 | "audio/midi", 159 | "audio/mp1", 160 | "audio/mp2", 161 | "audio/mp3", 162 | "audio/mp4", 163 | "audio/mpeg", 164 | "audio/mpg", 165 | "audio/ogg", 166 | "audio/opus", 167 | "audio/prs.sid", 168 | "audio/scpls", 169 | "audio/vnd.rn-realaudio", 170 | "audio/wav", 171 | "audio/webm", 172 | "audio/x-aac", 173 | "audio/x-aiff", 174 | "audio/x-ape", 175 | "audio/x-flac", 176 | "audio/x-gsm", 177 | "audio/x-it", 178 | "audio/x-m4a", 179 | "audio/x-m4b", 180 | "audio/x-matroska", 181 | "audio/x-mod", 182 | "audio/x-mp1", 183 | "audio/x-mp2", 184 | "audio/x-mp3", 185 | "audio/x-mpg", 186 | "audio/x-mpeg", 187 | "audio/x-ms-asf", 188 | "audio/x-ms-asx", 189 | "audio/x-ms-wax", 190 | "audio/x-ms-wma", 191 | "audio/x-musepack", 192 | "audio/x-opus+ogg", 193 | "audio/x-pn-aiff", 194 | "audio/x-pn-au", 195 | "audio/x-pn-wav", 196 | "audio/x-pn-windows-acm", 197 | "audio/x-realaudio", 198 | "audio/x-real-audio", 199 | "audio/x-s3m", 200 | "audio/x-sbc", 201 | "audio/x-shorten", 202 | "audio/x-speex", 203 | "audio/x-stm", 204 | "audio/x-tta", 205 | "audio/x-wav", 206 | "audio/x-wavpack", 207 | "audio/x-vorbis", 208 | "audio/x-vorbis+ogg", 209 | "audio/x-xm", 210 | "application/x-flac", 211 | NULL 212 | }; 213 | G_GNUC_UNUSED static const gchar *video_mime_types[] = { 214 | "application/mxf", 215 | "application/ogg", 216 | "application/ram", 217 | "application/sdp", 218 | "application/vnd.apple.mpegurl", 219 | "application/vnd.ms-asf", 220 | "application/vnd.ms-wpl", 221 | "application/vnd.rn-realmedia", 222 | "application/vnd.rn-realmedia-vbr", 223 | "application/x-extension-m4a", 224 | "application/x-extension-mp4", 225 | "application/x-flash-video", 226 | "application/x-matroska", 227 | "application/x-netshow-channel", 228 | "application/x-ogg", 229 | "application/x-quicktimeplayer", 230 | "application/x-shorten", 231 | "image/vnd.rn-realpix", 232 | "image/x-pict", 233 | "misc/ultravox", 234 | "text/x-google-video-pointer", 235 | "video/3gp", 236 | "video/3gpp", 237 | "video/3gpp2", 238 | "video/dv", 239 | "video/divx", 240 | "video/fli", 241 | "video/flv", 242 | "video/mp2t", 243 | "video/mp4", 244 | "video/mp4v-es", 245 | "video/mpeg", 246 | "video/mpeg-system", 247 | "video/msvideo", 248 | "video/ogg", 249 | "video/quicktime", 250 | "video/vivo", 251 | "video/vnd.divx", 252 | "video/vnd.mpegurl", 253 | "video/vnd.rn-realvideo", 254 | "video/vnd.vivo", 255 | "video/webm", 256 | "video/x-anim", 257 | "video/x-avi", 258 | "video/x-flc", 259 | "video/x-fli", 260 | "video/x-flic", 261 | "video/x-flv", 262 | "video/x-m4v", 263 | "video/x-matroska", 264 | "video/x-mjpeg", 265 | "video/x-mpeg", 266 | "video/x-mpeg2", 267 | "video/x-ms-asf", 268 | "video/x-ms-asf-plugin", 269 | "video/x-ms-asx", 270 | "video/x-msvideo", 271 | "video/x-ms-wm", 272 | "video/x-ms-wmv", 273 | "video/x-ms-wmx", 274 | "video/x-ms-wvx", 275 | "video/x-nsv", 276 | "video/x-ogm+ogg", 277 | "video/x-theora", 278 | "video/x-theora+ogg", 279 | "video/x-totem-stream", 280 | "audio/x-pn-realaudio", 281 | NULL 282 | }; 283 | -------------------------------------------------------------------------------- /audio-video-properties/totem-properties-main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000, 2001 Eazel Inc. 3 | * Copyright (C) 2003 Andrew Sobala 4 | * Copyright (C) 2005 Bastien Nocera 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library 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 GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | #define GST_USE_UNSTABLE_API 1 26 | #include 27 | 28 | #include "totem-properties-view.h" 29 | #include "totem-gst-helpers.h" 30 | #include 31 | #include 32 | #include 33 | 34 | #define WANT_MIME_TYPES 1 35 | #include "totem-mime-types.h" 36 | 37 | static GType tpp_type = 0; 38 | static void property_page_provider_iface_init 39 | (CajaPropertyPageProviderIface *iface); 40 | static GList *totem_properties_get_pages 41 | (CajaPropertyPageProvider *provider, GList *files); 42 | 43 | static void 44 | totem_properties_plugin_register_type (GTypeModule *module) 45 | { 46 | const GTypeInfo info = { 47 | sizeof (GObjectClass), 48 | (GBaseInitFunc) NULL, 49 | (GBaseFinalizeFunc) NULL, 50 | (GClassInitFunc) NULL, 51 | NULL, 52 | NULL, 53 | sizeof (GObject), 54 | 0, 55 | (GInstanceInitFunc) NULL 56 | }; 57 | const GInterfaceInfo property_page_provider_iface_info = { 58 | (GInterfaceInitFunc)property_page_provider_iface_init, 59 | NULL, 60 | NULL 61 | }; 62 | 63 | tpp_type = g_type_module_register_type (module, G_TYPE_OBJECT, 64 | "TotemPropertiesPlugin", 65 | &info, 0); 66 | g_type_module_add_interface (module, 67 | tpp_type, 68 | CAJA_TYPE_PROPERTY_PAGE_PROVIDER, 69 | &property_page_provider_iface_info); 70 | } 71 | 72 | static void 73 | property_page_provider_iface_init (CajaPropertyPageProviderIface *iface) 74 | { 75 | iface->get_pages = totem_properties_get_pages; 76 | } 77 | 78 | static gpointer 79 | init_backend (gpointer data) 80 | { 81 | gst_init (NULL, NULL); 82 | totem_gst_disable_display_decoders (); 83 | return NULL; 84 | } 85 | 86 | static GList * 87 | totem_properties_get_pages (CajaPropertyPageProvider *provider, 88 | GList *files) 89 | { 90 | static GOnce backend_inited = G_ONCE_INIT; 91 | CajaFileInfo *file; 92 | char *uri; 93 | GtkWidget *page, *label; 94 | CajaPropertyPage *property_page; 95 | guint i; 96 | gboolean found; 97 | 98 | /* only add properties page if a single file is selected */ 99 | if (files == NULL || files->next != NULL) 100 | return NULL; 101 | file = files->data; 102 | 103 | /* only add the properties page to these mime types */ 104 | found = FALSE; 105 | for (i = 0; mime_types[i] != NULL; i++) { 106 | if (caja_file_info_is_mime_type (file, mime_types[i])) { 107 | found = TRUE; 108 | break; 109 | } 110 | } 111 | if (found == FALSE) 112 | return NULL; 113 | 114 | /* okay, make the page, init'ing the backend first if necessary */ 115 | g_once (&backend_inited, init_backend, NULL); 116 | 117 | uri = caja_file_info_get_uri (file); 118 | label = gtk_label_new (_("Audio/Video")); 119 | page = totem_properties_view_new (uri, label); 120 | g_free (uri); 121 | 122 | gtk_container_set_border_width (GTK_CONTAINER (page), 6); 123 | property_page = caja_property_page_new ("video-properties", 124 | label, page); 125 | 126 | return g_list_prepend (NULL, property_page); 127 | } 128 | 129 | /* --- extension interface --- */ 130 | void 131 | caja_module_initialize (GTypeModule *module) 132 | { 133 | /* set up translation catalog */ 134 | bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR); 135 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 136 | 137 | totem_properties_plugin_register_type (module); 138 | totem_properties_view_register_type (module); 139 | } 140 | 141 | void 142 | caja_module_shutdown (void) 143 | { 144 | } 145 | 146 | void 147 | caja_module_list_types (const GType **types, 148 | int *num_types) 149 | { 150 | static GType type_list[1]; 151 | 152 | type_list[0] = tpp_type; 153 | *types = type_list; 154 | *num_types = G_N_ELEMENTS (type_list); 155 | } 156 | -------------------------------------------------------------------------------- /audio-video-properties/totem-properties-view.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003 Andrew Sobala 3 | * Copyright (C) 2004 Bastien Nocera 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library 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 GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | * 19 | */ 20 | 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | #define GST_USE_UNSTABLE_API 1 27 | #include 28 | #include 29 | 30 | #include "totem-properties-view.h" 31 | #include "bacon-video-widget-properties.h" 32 | 33 | struct TotemPropertiesViewPriv { 34 | GtkWidget *label; 35 | GtkWidget *vbox; 36 | BaconVideoWidgetProperties *props; 37 | GstDiscoverer *disco; 38 | }; 39 | 40 | static GObjectClass *parent_class = NULL; 41 | static void totem_properties_view_finalize (GObject *object); 42 | 43 | G_DEFINE_TYPE (TotemPropertiesView, totem_properties_view, GTK_TYPE_GRID) 44 | 45 | void 46 | totem_properties_view_register_type (GTypeModule *module) 47 | { 48 | totem_properties_view_get_type (); 49 | } 50 | 51 | static void 52 | totem_properties_view_class_init (TotemPropertiesViewClass *class) 53 | { 54 | parent_class = g_type_class_peek_parent (class); 55 | G_OBJECT_CLASS (class)->finalize = totem_properties_view_finalize; 56 | } 57 | 58 | static void 59 | update_general (TotemPropertiesView *props, 60 | const GstTagList *list) 61 | { 62 | struct { 63 | const char *tag_name; 64 | const char *widget; 65 | } items[] = { 66 | { GST_TAG_TITLE, "title" }, 67 | { GST_TAG_ARTIST, "artist" }, 68 | { GST_TAG_ALBUM, "album" }, 69 | }; 70 | guint i; 71 | GDate *date; 72 | GstDateTime *datetime; 73 | gchar *comment; 74 | 75 | for (i = 0; i < G_N_ELEMENTS(items); i++) { 76 | char *string; 77 | 78 | if (gst_tag_list_get_string_index (list, items[i].tag_name, 0, &string) != FALSE) { 79 | bacon_video_widget_properties_set_label (props->priv->props, 80 | items[i].widget, 81 | string); 82 | g_free (string); 83 | } 84 | } 85 | 86 | /* Comment else use Description defined by: 87 | * http://xiph.org/vorbis/doc/v-comment.html */ 88 | if (gst_tag_list_get_string (list, GST_TAG_COMMENT, &comment) || 89 | gst_tag_list_get_string (list, GST_TAG_DESCRIPTION, &comment)) { 90 | 91 | bacon_video_widget_properties_set_label (props->priv->props, 92 | "comment", 93 | comment); 94 | g_free (comment); 95 | } 96 | 97 | /* Date */ 98 | if (gst_tag_list_get_date (list, GST_TAG_DATE, &date)) { 99 | char *string; 100 | 101 | string = g_strdup_printf ("%d", g_date_get_year (date)); 102 | g_date_free (date); 103 | bacon_video_widget_properties_set_label (props->priv->props, 104 | "year", 105 | string); 106 | g_free (string); 107 | } else if (gst_tag_list_get_date_time (list, GST_TAG_DATE_TIME, &datetime)) { 108 | char *string; 109 | 110 | string = g_strdup_printf ("%d", gst_date_time_get_year (datetime)); 111 | gst_date_time_unref (datetime); 112 | bacon_video_widget_properties_set_label (props->priv->props, 113 | "year", 114 | string); 115 | g_free (string); 116 | } 117 | } 118 | 119 | static void 120 | set_codec (TotemPropertiesView *props, 121 | GstDiscovererStreamInfo *info, 122 | const char *widget) 123 | { 124 | GstCaps *caps; 125 | const char *nick; 126 | 127 | nick = gst_discoverer_stream_info_get_stream_type_nick (info); 128 | if (g_str_equal (nick, "audio") == FALSE && 129 | g_str_equal (nick, "video") == FALSE && 130 | g_str_equal (nick, "container") == FALSE) { 131 | bacon_video_widget_properties_set_label (props->priv->props, 132 | widget, 133 | _("N/A")); 134 | return; 135 | } 136 | 137 | caps = gst_discoverer_stream_info_get_caps (info); 138 | if (caps) { 139 | if (gst_caps_is_fixed (caps)) { 140 | char *string; 141 | 142 | string = gst_pb_utils_get_codec_description (caps); 143 | bacon_video_widget_properties_set_label (props->priv->props, 144 | widget, 145 | string); 146 | g_free (string); 147 | } 148 | gst_caps_unref (caps); 149 | } 150 | } 151 | 152 | static void 153 | set_bitrate (TotemPropertiesView *props, 154 | guint bitrate, 155 | const char *widget) 156 | { 157 | char *string; 158 | 159 | if (!bitrate) { 160 | bacon_video_widget_properties_set_label (props->priv->props, 161 | widget, 162 | C_("Stream bit rate", "N/A")); 163 | return; 164 | } 165 | string = g_strdup_printf (_("%d kbps"), bitrate / 1000); 166 | bacon_video_widget_properties_set_label (props->priv->props, 167 | widget, 168 | string); 169 | g_free (string); 170 | } 171 | 172 | static void 173 | update_video (TotemPropertiesView *props, 174 | GstDiscovererVideoInfo *info) 175 | { 176 | guint width, height; 177 | guint fps_n, fps_d; 178 | char *string; 179 | 180 | width = gst_discoverer_video_info_get_width (info); 181 | height = gst_discoverer_video_info_get_height (info); 182 | string = g_strdup_printf (N_("%d × %d"), width, height); 183 | bacon_video_widget_properties_set_label (props->priv->props, 184 | "dimensions", 185 | string); 186 | g_free (string); 187 | 188 | set_codec (props, (GstDiscovererStreamInfo *) info, "vcodec"); 189 | set_bitrate (props, gst_discoverer_video_info_get_bitrate (info), "video_bitrate"); 190 | 191 | /* Round up/down to the nearest integer framerate */ 192 | fps_n = gst_discoverer_video_info_get_framerate_num (info); 193 | fps_d = gst_discoverer_video_info_get_framerate_denom (info); 194 | if (fps_d > 0.0) 195 | bacon_video_widget_properties_set_framerate (props->priv->props, 196 | (float) fps_n / (float) fps_d); 197 | else 198 | bacon_video_widget_properties_set_framerate (props->priv->props, 0.0); 199 | } 200 | 201 | static void 202 | update_audio (TotemPropertiesView *props, 203 | GstDiscovererAudioInfo *info) 204 | { 205 | guint samplerate, channels; 206 | 207 | set_codec (props, (GstDiscovererStreamInfo *) info, "acodec"); 208 | 209 | set_bitrate (props, gst_discoverer_audio_info_get_bitrate (info), "audio_bitrate"); 210 | 211 | samplerate = gst_discoverer_audio_info_get_sample_rate (info); 212 | if (samplerate) { 213 | char *string; 214 | string = g_strdup_printf (_("%d Hz"), samplerate); 215 | bacon_video_widget_properties_set_label (props->priv->props, 216 | "samplerate", 217 | string); 218 | g_free (string); 219 | } else { 220 | bacon_video_widget_properties_set_label (props->priv->props, 221 | "samplerate", 222 | C_("Sample rate", "N/A")); 223 | } 224 | 225 | channels = gst_discoverer_audio_info_get_channels (info); 226 | if (channels) { 227 | char *string; 228 | 229 | if (channels > 2) { 230 | string = g_strdup_printf ("%s %d.1", _("Surround"), channels - 1); 231 | } else if (channels == 1) { 232 | string = g_strdup (_("Mono")); 233 | } else if (channels == 2) { 234 | string = g_strdup (_("Stereo")); 235 | } else { 236 | string = g_strdup (""); //Should not happen 237 | } 238 | bacon_video_widget_properties_set_label (props->priv->props, 239 | "channels", 240 | string); 241 | g_free (string); 242 | } else { 243 | bacon_video_widget_properties_set_label (props->priv->props, 244 | "channels", 245 | C_("Number of audio channels", "N/A")); 246 | } 247 | } 248 | 249 | static void 250 | discovered_cb (GstDiscoverer *discoverer, 251 | GstDiscovererInfo *info, 252 | GError *error, 253 | TotemPropertiesView *props) 254 | { 255 | GList *video_streams, *audio_streams; 256 | const GstTagList *taglist; 257 | gboolean has_audio, has_video; 258 | const char *label; 259 | GstClockTime duration; 260 | GstDiscovererStreamInfo *sinfo; 261 | 262 | if (error) { 263 | g_warning ("Couldn't get information about '%s': %s", 264 | gst_discoverer_info_get_uri (info), 265 | error->message); 266 | return; 267 | } 268 | 269 | video_streams = gst_discoverer_info_get_video_streams (info); 270 | has_video = (video_streams != NULL); 271 | audio_streams = gst_discoverer_info_get_audio_streams (info); 272 | has_audio = (audio_streams != NULL); 273 | 274 | if (has_audio == has_video) 275 | label = N_("Audio/Video"); 276 | else if (has_audio) 277 | label = N_("Audio"); 278 | else 279 | label = N_("Video"); 280 | 281 | gtk_label_set_text (GTK_LABEL (props->priv->label), _(label)); 282 | 283 | /* Widgets */ 284 | bacon_video_widget_properties_set_has_type (props->priv->props, 285 | has_video, 286 | has_audio); 287 | 288 | /* General */ 289 | duration = gst_discoverer_info_get_duration (info); 290 | bacon_video_widget_properties_set_duration (props->priv->props, duration / GST_SECOND * 1000); 291 | 292 | sinfo = gst_discoverer_info_get_stream_info (info); 293 | if (sinfo) { 294 | set_codec (props, sinfo, "container"); 295 | gst_discoverer_stream_info_unref (sinfo); 296 | } 297 | 298 | taglist = gst_discoverer_info_get_tags (info); 299 | update_general (props, taglist); 300 | 301 | /* Video and Audio */ 302 | if (video_streams) 303 | update_video (props, video_streams->data); 304 | if (audio_streams) 305 | update_audio (props, audio_streams->data); 306 | 307 | gst_discoverer_stream_info_list_free (video_streams); 308 | gst_discoverer_stream_info_list_free (audio_streams); 309 | } 310 | 311 | static void 312 | totem_properties_view_init (TotemPropertiesView *props) 313 | { 314 | GError *err = NULL; 315 | 316 | props->priv = g_new0 (TotemPropertiesViewPriv, 1); 317 | 318 | props->priv->vbox = bacon_video_widget_properties_new (); 319 | gtk_grid_attach (GTK_GRID (props), props->priv->vbox, 0, 0, 1, 1); 320 | gtk_widget_show (GTK_WIDGET (props)); 321 | 322 | props->priv->props = BACON_VIDEO_WIDGET_PROPERTIES (props->priv->vbox); 323 | 324 | props->priv->disco = gst_discoverer_new (GST_SECOND * 60, &err); 325 | if (props->priv->disco == NULL) { 326 | g_warning ("Could not create discoverer object: %s", err->message); 327 | g_error_free (err); 328 | return; 329 | } 330 | g_signal_connect (props->priv->disco, "discovered", 331 | G_CALLBACK (discovered_cb), props); 332 | } 333 | 334 | static void 335 | totem_properties_view_finalize (GObject *object) 336 | { 337 | TotemPropertiesView *props; 338 | 339 | props = TOTEM_PROPERTIES_VIEW (object); 340 | 341 | if (props->priv != NULL) { 342 | if (props->priv->disco) { 343 | g_signal_handlers_disconnect_by_func (props->priv->disco, 344 | discovered_cb, 345 | props); 346 | gst_discoverer_stop (props->priv->disco); 347 | g_clear_object (&props->priv->disco); 348 | } 349 | g_clear_object (&props->priv->label); 350 | g_free (props->priv); 351 | } 352 | props->priv = NULL; 353 | 354 | G_OBJECT_CLASS (parent_class)->finalize (object); 355 | } 356 | 357 | static void 358 | totem_properties_view_set_location (TotemPropertiesView *props, 359 | const char *location) 360 | { 361 | g_assert (TOTEM_IS_PROPERTIES_VIEW (props)); 362 | 363 | if (props->priv->disco) 364 | gst_discoverer_stop (props->priv->disco); 365 | 366 | bacon_video_widget_properties_reset (props->priv->props); 367 | 368 | if (location != NULL && props->priv->disco != NULL) { 369 | gst_discoverer_start (props->priv->disco); 370 | 371 | if (gst_discoverer_discover_uri_async (props->priv->disco, location) == FALSE) { 372 | g_warning ("Couldn't add %s to list", location); 373 | return; 374 | } 375 | } 376 | } 377 | 378 | GtkWidget * 379 | totem_properties_view_new (const char *location, GtkWidget *label) 380 | { 381 | TotemPropertiesView *self; 382 | 383 | self = g_object_new (TOTEM_TYPE_PROPERTIES_VIEW, NULL); 384 | g_object_ref (label); 385 | self->priv->label = label; 386 | totem_properties_view_set_location (self, location); 387 | 388 | return GTK_WIDGET (self); 389 | } 390 | -------------------------------------------------------------------------------- /audio-video-properties/totem-properties-view.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003 Andrew Sobala 3 | * Copyright (C) 2005 Bastien Nocera 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library 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 GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | * 19 | */ 20 | 21 | #ifndef TOTEM_PROPERTIES_VIEW_H 22 | #define TOTEM_PROPERTIES_VIEW_H 23 | 24 | #include 25 | 26 | #define TOTEM_TYPE_PROPERTIES_VIEW (totem_properties_view_get_type ()) 27 | #define TOTEM_PROPERTIES_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOTEM_TYPE_PROPERTIES_VIEW, TotemPropertiesView)) 28 | #define TOTEM_PROPERTIES_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOTEM_TYPE_PROPERTIES_VIEW, TotemPropertiesViewClass)) 29 | #define TOTEM_IS_PROPERTIES_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOTEM_TYPE_PROPERTIES_VIEW)) 30 | #define TOTEM_IS_PROPERTIES_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOTEM_TYPE_PROPERTIES_VIEW)) 31 | 32 | typedef struct TotemPropertiesViewPriv TotemPropertiesViewPriv; 33 | 34 | typedef struct { 35 | GtkGrid parent; 36 | TotemPropertiesViewPriv *priv; 37 | } TotemPropertiesView; 38 | 39 | typedef struct { 40 | GtkGridClass parent; 41 | } TotemPropertiesViewClass; 42 | 43 | GType totem_properties_view_get_type (void); 44 | void totem_properties_view_register_type (GTypeModule *module); 45 | 46 | GtkWidget *totem_properties_view_new (const char *location, 47 | GtkWidget *label); 48 | 49 | #endif /* TOTEM_PROPERTIES_VIEW_H */ 50 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Run this to generate all the initial makefiles, etc. 3 | 4 | srcdir=`dirname $0` 5 | test -z "$srcdir" && srcdir=. 6 | 7 | PKG_NAME="caja-extensions" 8 | 9 | (test -f $srcdir/configure.ac) || { 10 | echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" 11 | echo " top-level $PKG_NAME directory" 12 | exit 1 13 | } 14 | 15 | which mate-autogen || { 16 | echo "You need to install mate-common from the MATE Git" 17 | exit 1 18 | } 19 | 20 | REQUIRED_AUTOMAKE_VERSION=1.9 21 | USE_COMMON_DOC_BUILD=yes 22 | 23 | . mate-autogen 24 | -------------------------------------------------------------------------------- /gksu/Makefile.am: -------------------------------------------------------------------------------- 1 | NULL = 2 | 3 | AM_CPPFLAGS = \ 4 | $(DISABLE_DEPRECATED_CPPFLAGS) \ 5 | -DMATELOCALEDIR=\""$(datadir)/locale"\" \ 6 | -I$(top_builddir) \ 7 | $(NULL) 8 | 9 | AM_CFLAGS = \ 10 | $(WARN_CFLAGS) \ 11 | $(NULL) 12 | 13 | caja_extensiondir = $(libdir)/caja/extensions-2.0 14 | 15 | caja_extension_LTLIBRARIES = libcaja-gksu.la 16 | 17 | libcaja_gksu_la_SOURCES = libcaja-gksu.c 18 | libcaja_gksu_la_CPPFLAGS = \ 19 | $(AM_CPPFLAGS) \ 20 | -DDATA_DIR=\"$(datadir)\" \ 21 | -DPREFIX=\"$(prefix)\" \ 22 | $(NULL) 23 | libcaja_gksu_la_CFLAGS = \ 24 | $(AM_CFLAGS) \ 25 | $(CAJA_CFLAGS) \ 26 | $(NULL) 27 | libcaja_gksu_la_LDFLAGS = -module -avoid-version -no-undefined 28 | libcaja_gksu_la_LIBADD = $(CAJA_LIBS) 29 | 30 | extensiondir = $(datadir)/caja/extensions 31 | extension_in_files = libcaja-gksu.caja-extension.desktop.in 32 | extension_DATA = $(extension_in_files:.caja-extension.desktop.in=.caja-extension) 33 | $(extension_DATA): $(extension_in_files) 34 | if USE_NLS 35 | $(AM_V_GEN) $(MSGFMT) --desktop --keyword= --keyword=Copyright --keyword=Name --keyword=Description --template $< -d $(top_srcdir)/po -o $@ 36 | else 37 | $(AM_V_GEN) cp $< $@ 38 | endif 39 | 40 | CLEANFILES = $(extension_DATA) 41 | 42 | -include $(top_srcdir)/git.mk 43 | -------------------------------------------------------------------------------- /gksu/libcaja-gksu.c: -------------------------------------------------------------------------------- 1 | #ifdef HAVE_CONFIG_H 2 | #include 3 | #endif 4 | 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #define GKSU_TYPE_CONTEXT_MENU (gksu_context_menu_get_type ()) 17 | 18 | typedef struct { 19 | GObject parent; 20 | } GksuContextMenu; 21 | 22 | typedef struct { 23 | GObjectClass parent_class; 24 | } GksuContextMenuClass; 25 | 26 | static GType gksucm_type = 0; 27 | static GObjectClass *parent_class = NULL; 28 | 29 | static void 30 | gksu_context_menu_init (GksuContextMenu *self); 31 | static void 32 | gksu_context_menu_class_init (GksuContextMenuClass *class); 33 | static void 34 | menu_provider_iface_init (CajaMenuProviderIface *iface); 35 | 36 | static GList* 37 | gksu_context_menu_get_file_items (CajaMenuProvider *provider, 38 | GtkWidget *window, 39 | GList *files); 40 | static void 41 | gksu_context_menu_activate (CajaMenuItem *item, 42 | CajaFileInfo *file); 43 | 44 | static GType 45 | gksu_context_menu_get_type (void) 46 | { 47 | return gksucm_type; 48 | } 49 | 50 | static void 51 | gksu_context_menu_register_type (GTypeModule *module) 52 | { 53 | static const GTypeInfo info = { 54 | sizeof (GksuContextMenuClass), 55 | (GBaseInitFunc) NULL, 56 | (GBaseFinalizeFunc) NULL, 57 | (GClassInitFunc) gksu_context_menu_class_init, 58 | NULL, 59 | NULL, 60 | sizeof (GksuContextMenu), 61 | 0, 62 | (GInstanceInitFunc) gksu_context_menu_init, 63 | NULL 64 | }; 65 | static const GInterfaceInfo menu_provider_iface_info = { 66 | (GInterfaceInitFunc)menu_provider_iface_init, 67 | NULL, 68 | NULL 69 | }; 70 | 71 | gksucm_type = g_type_module_register_type (module, 72 | G_TYPE_OBJECT, 73 | "GksuContextMenu", 74 | &info, 0); 75 | g_type_module_add_interface (module, 76 | gksucm_type, 77 | CAJA_TYPE_MENU_PROVIDER, 78 | &menu_provider_iface_info); 79 | } 80 | 81 | static void 82 | gksu_context_menu_class_init (GksuContextMenuClass *class) 83 | { 84 | parent_class = g_type_class_peek_parent (class); 85 | } 86 | 87 | static void menu_provider_iface_init (CajaMenuProviderIface *iface) 88 | { 89 | iface->get_file_items = gksu_context_menu_get_file_items; 90 | } 91 | 92 | static void 93 | gksu_context_menu_init (GksuContextMenu *self) 94 | { 95 | g_message ("Initializing gksu extension..."); 96 | } 97 | 98 | static GList * 99 | gksu_context_menu_get_file_items (CajaMenuProvider *provider, 100 | GtkWidget *window, 101 | GList *files) 102 | { 103 | GList *items = NULL; 104 | CajaFileInfo *file; 105 | CajaMenuItem *item; 106 | 107 | /* if we're already root, really or effectively, do not add 108 | the menu item */ 109 | if (geteuid () == 0) 110 | return NULL; 111 | 112 | /* only add a menu item if a single file is selected ... */ 113 | if (files == NULL || files->next != NULL) 114 | return NULL; 115 | 116 | file = files->data; 117 | 118 | /* ... and if it is not a caja special item */ 119 | { 120 | gchar *uri_scheme = NULL; 121 | 122 | uri_scheme = caja_file_info_get_uri_scheme (file); 123 | if (!strncmp (uri_scheme, "x-caja-desktop", 18)) 124 | { 125 | g_free (uri_scheme); 126 | return NULL; 127 | } 128 | g_free (uri_scheme); 129 | } 130 | 131 | /* create the context menu item */ 132 | item = caja_menu_item_new ("Gksu::open_as_root", 133 | _("Open as administrator"), 134 | _("Opens the file with administrator privileges"), 135 | NULL); 136 | g_signal_connect_object (item, "activate", 137 | G_CALLBACK (gksu_context_menu_activate), 138 | file, 0); 139 | items = g_list_prepend (items, item); 140 | 141 | return items; 142 | } 143 | 144 | static void 145 | gksu_context_menu_activate (CajaMenuItem *item, 146 | CajaFileInfo *file) 147 | { 148 | gchar *exec_path; 149 | gchar *uri = NULL; 150 | gchar *mime_type = NULL; 151 | gchar *cmd = NULL; 152 | gchar *full_cmd = NULL; 153 | gchar *tmp = NULL; 154 | gboolean is_desktop = FALSE; 155 | 156 | uri = caja_file_info_get_uri (file); 157 | mime_type = caja_file_info_get_mime_type (file); 158 | 159 | if (!strcmp (mime_type, "application/x-desktop")) 160 | { /* we're handling a .desktop file */ 161 | GKeyFile *key_file = g_key_file_new (); 162 | gint retval = 0; 163 | 164 | is_desktop = TRUE; 165 | 166 | gchar *file_path = g_filename_from_uri (uri, NULL, NULL); 167 | retval = g_key_file_load_from_file (key_file, file_path, 0, NULL); 168 | g_free (file_path); 169 | 170 | if (retval) 171 | cmd = g_key_file_get_string (key_file, "Desktop Entry", "Exec", NULL); 172 | g_key_file_free (key_file); 173 | } 174 | else 175 | { 176 | GAppInfo *app_info = g_app_info_get_default_for_type (mime_type, strncmp (uri, "file://", 7)); 177 | if (app_info) 178 | { 179 | cmd = g_strdup (g_app_info_get_executable (app_info)); 180 | g_object_unref (app_info); 181 | } 182 | } 183 | 184 | if (cmd == NULL) 185 | { 186 | GtkWidget *dialog; 187 | 188 | dialog = gtk_message_dialog_new_with_markup (NULL, 0, 189 | GTK_MESSAGE_ERROR, 190 | GTK_BUTTONS_CLOSE, 191 | _("" 192 | "Unable to determine the program to run." 193 | "\n\n" 194 | "The item you selected cannot be open with " 195 | "administrator powers because the correct " 196 | "application cannot be determined.")); 197 | gtk_dialog_run (GTK_DIALOG(dialog)); 198 | gtk_widget_destroy (dialog); 199 | return; 200 | } 201 | 202 | /* 203 | * FIXME: remove any FreeDesktop substitution variable for now; we 204 | * need to process them! 205 | */ 206 | tmp = strstr (cmd, "%"); 207 | if (tmp) 208 | *tmp = '\0'; 209 | 210 | if (is_desktop) 211 | full_cmd = cmd; 212 | else 213 | { 214 | full_cmd = g_strdup_printf ("%s '%s'", cmd, uri); 215 | g_free (cmd); 216 | } 217 | 218 | if ((exec_path = g_find_program_in_path ("gksu")) == NULL) 219 | { 220 | if ((exec_path = g_find_program_in_path ("beesu")) == NULL) 221 | { 222 | GtkWidget *dialog; 223 | 224 | dialog = gtk_message_dialog_new_with_markup (NULL, 0, 225 | GTK_MESSAGE_ERROR, 226 | GTK_BUTTONS_CLOSE, 227 | _("" 228 | "Unable to determine the graphical wrapper for su" 229 | "\n\n" 230 | "The item you selected cannot be open with " 231 | "administrator powers because the graphical wrapper " 232 | "for su cannot be determined, such as gtksu or beesu.")); 233 | gtk_dialog_run (GTK_DIALOG (dialog)); 234 | gtk_widget_destroy (dialog); 235 | } 236 | } 237 | 238 | if (exec_path != NULL) 239 | { 240 | GError *error = NULL; 241 | gchar **argv = (gchar**) g_malloc (sizeof (gchar*) * 3); 242 | 243 | argv[0] = exec_path; 244 | argv[1] = full_cmd; 245 | argv[2] = NULL; 246 | 247 | if (!g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error)) 248 | { 249 | GtkWidget *dialog; 250 | 251 | dialog = gtk_message_dialog_new (NULL, 0, 252 | GTK_MESSAGE_ERROR, 253 | GTK_BUTTONS_CLOSE, 254 | _("Error: %s"), 255 | error->message); 256 | gtk_dialog_run (GTK_DIALOG (dialog)); 257 | gtk_widget_destroy (dialog); 258 | g_error_free (error); 259 | } 260 | g_strfreev (argv); 261 | } 262 | else 263 | { 264 | g_free (full_cmd); 265 | } 266 | 267 | g_free (uri); 268 | g_free (mime_type); 269 | } 270 | 271 | /* --- extension interface --- */ 272 | void 273 | caja_module_initialize (GTypeModule *module) 274 | { 275 | g_print ("Initializing caja-gksu extension\n"); 276 | gksu_context_menu_register_type (module); 277 | #ifdef ENABLE_NLS 278 | bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR); 279 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 280 | #endif /* ENABLE_NLS */ 281 | } 282 | 283 | void 284 | caja_module_shutdown (void) 285 | { 286 | g_print ("Shutting down caja-gksu extension\n"); 287 | } 288 | 289 | void 290 | caja_module_list_types (const GType **types, 291 | int *num_types) 292 | { 293 | static GType type_list[1]; 294 | 295 | type_list[0] = GKSU_TYPE_CONTEXT_MENU; 296 | *types = type_list; 297 | *num_types = G_N_ELEMENTS (type_list); 298 | } 299 | -------------------------------------------------------------------------------- /gksu/libcaja-gksu.caja-extension.desktop.in.in: -------------------------------------------------------------------------------- 1 | [Caja Extension] 2 | # Translators: Do NOT translate or transliterate this text (this is an icon file name)! 3 | Icon=system 4 | Name=Gksu 5 | Description=Privilege granting extension 6 | Author=Gustavo Noronha Silva 7 | Copyright=Copyright (C) 2002-2005 Gustavo Noronha Silva\nCopyright (C) 2013-2014 Stefano Karapetsas\nCopyright (C) 2015-2021 MATE developers 8 | Version=@VERSION@ 9 | Website=@PACKAGE_URL@ 10 | -------------------------------------------------------------------------------- /image-converter/Makefile.am: -------------------------------------------------------------------------------- 1 | NULL = 2 | AM_CPPFLAGS = \ 3 | $(DISABLE_DEPRECATED_CPPFLAGS) \ 4 | -DMATELOCALEDIR=\""$(datadir)/locale"\" \ 5 | -I$(top_srcdir) \ 6 | -I$(top_builddir) \ 7 | $(NULL) 8 | 9 | AM_CFLAGS = \ 10 | $(WARN_CFLAGS) \ 11 | $(NULL) 12 | 13 | caja_extensiondir=$(CAJA_EXTENSION_DIR) 14 | 15 | caja_extension_LTLIBRARIES=libcaja-image-converter.la 16 | 17 | resources_built_sources = caja-image-converter-resources.h caja-image-converter-resources.c 18 | $(resources_built_sources): org.mate.caja.extensions.imageconverter.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/org.mate.caja.extensions.imageconverter.gresource.xml) 19 | $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate --c-name imageconverter $< 20 | 21 | libcaja_image_converter_la_SOURCES = \ 22 | image-converter.c \ 23 | caja-image-converter.c \ 24 | caja-image-converter.h \ 25 | caja-image-resizer.c \ 26 | caja-image-resizer.h \ 27 | caja-image-rotator.c \ 28 | caja-image-rotator.h \ 29 | $(resources_built_sources) \ 30 | $(NULL) 31 | libcaja_image_converter_la_CPPFLAGS = \ 32 | $(AM_CPPFLAGS) \ 33 | -DG_LOG_DOMAIN=\"Caja-Image-Converter\" \ 34 | $(NULL) 35 | libcaja_image_converter_la_CFLAGS = \ 36 | $(AM_CFLAGS) \ 37 | $(CAJA_CFLAGS) \ 38 | $(IMAGE_CONVERTER_CFLAGS) \ 39 | $(NULL) 40 | libcaja_image_converter_la_LDFLAGS = -module -avoid-version 41 | libcaja_image_converter_la_LIBADD = \ 42 | $(CAJA_LIBS) \ 43 | $(IMAGE_CONVERTER_LIBS) \ 44 | $(NULL) 45 | 46 | extensiondir = $(datadir)/caja/extensions 47 | extension_in_files = libcaja-image-converter.caja-extension.desktop.in 48 | extension_DATA = $(extension_in_files:.caja-extension.desktop.in=.caja-extension) 49 | $(extension_DATA): $(extension_in_files) 50 | if USE_NLS 51 | $(AM_V_GEN) $(MSGFMT) --desktop --keyword= --keyword=Copyright --keyword=Name --keyword=Description --template $< -d $(top_srcdir)/po -o $@ 52 | else 53 | $(AM_V_GEN) cp $< $@ 54 | endif 55 | 56 | EXTRA_DIST = \ 57 | caja-image-resize.ui \ 58 | caja-image-rotate.ui \ 59 | error-dialog.ui \ 60 | org.mate.caja.extensions.imageconverter.gresource.xml \ 61 | $(NULL) 62 | 63 | CLEANFILES = \ 64 | $(extension_DATA) \ 65 | $(resources_built_sources) \ 66 | $(NULL) 67 | 68 | -include $(top_srcdir)/git.mk 69 | -------------------------------------------------------------------------------- /image-converter/caja-image-converter.c: -------------------------------------------------------------------------------- 1 | /* 2 | * caja-image-converter.c 3 | * 4 | * Copyright (C) 2004-2005 Jürg Billeter 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library 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 GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this library; if not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | * 20 | * Author: Jürg Billeter 21 | * 22 | */ 23 | 24 | #ifdef HAVE_CONFIG_H 25 | #include 26 | #endif 27 | 28 | #include 29 | 30 | #include "caja-image-converter.h" 31 | #include "caja-image-resizer.h" 32 | #include "caja-image-rotator.h" 33 | 34 | #include 35 | 36 | #include 37 | 38 | #include /* for strcmp */ 39 | 40 | static void caja_image_converter_instance_init (CajaImageConverter *img); 41 | static void caja_image_converter_class_init (CajaImageConverterClass *class); 42 | GList * caja_image_converter_get_file_items (CajaMenuProvider *provider, 43 | GtkWidget *window, 44 | GList *files); 45 | 46 | static GType image_converter_type = 0; 47 | 48 | static gboolean 49 | image_converter_file_is_image (CajaFileInfo *file_info) 50 | { 51 | gchar *uri_scheme; 52 | gchar *mime_type; 53 | gboolean maybe_image; 54 | 55 | maybe_image = TRUE; 56 | uri_scheme = caja_file_info_get_uri_scheme (file_info); 57 | if (strcmp (uri_scheme, "file") != 0) 58 | maybe_image = FALSE; 59 | g_free (uri_scheme); 60 | 61 | mime_type = caja_file_info_get_mime_type (file_info); 62 | if (strncmp (mime_type, "image/", 6) != 0) 63 | maybe_image = FALSE; 64 | g_free (mime_type); 65 | 66 | return maybe_image; 67 | } 68 | 69 | static GList * 70 | image_converter_filter_images (GList *files) 71 | { 72 | GList *images; 73 | GList *file; 74 | 75 | images = NULL; 76 | 77 | for (file = files; file != NULL; file = file->next) { 78 | if (image_converter_file_is_image (file->data)) 79 | images = g_list_prepend (images, file->data); 80 | } 81 | 82 | return images; 83 | } 84 | 85 | static void 86 | image_resize_callback (CajaMenuItem *item, 87 | GList *files) 88 | { 89 | CajaImageResizer *resizer = caja_image_resizer_new (image_converter_filter_images (files)); 90 | caja_image_resizer_show_dialog (resizer); 91 | } 92 | 93 | static void 94 | image_rotate_callback (CajaMenuItem *item, 95 | GList *files) 96 | { 97 | CajaImageRotator *rotator = caja_image_rotator_new (image_converter_filter_images (files)); 98 | caja_image_rotator_show_dialog (rotator); 99 | } 100 | 101 | static GList * 102 | caja_image_converter_get_background_items (CajaMenuProvider *provider, 103 | GtkWidget *window, 104 | CajaFileInfo *file_info) 105 | { 106 | return NULL; 107 | } 108 | 109 | GList * 110 | caja_image_converter_get_file_items (CajaMenuProvider *provider, 111 | GtkWidget *window, 112 | GList *files) 113 | { 114 | CajaMenuItem *item; 115 | GList *file; 116 | GList *items = NULL; 117 | 118 | for (file = files; file != NULL; file = file->next) { 119 | if (image_converter_file_is_image (file->data)) { 120 | item = caja_menu_item_new ("CajaImageConverter::resize", 121 | _("_Resize Images..."), 122 | _("Resize each selected image"), 123 | NULL); 124 | g_signal_connect (item, "activate", 125 | G_CALLBACK (image_resize_callback), 126 | caja_file_info_list_copy (files)); 127 | 128 | items = g_list_prepend (items, item); 129 | 130 | item = caja_menu_item_new ("CajaImageConverter::rotate", 131 | _("Ro_tate Images..."), 132 | _("Rotate each selected image"), 133 | NULL); 134 | g_signal_connect (item, "activate", 135 | G_CALLBACK (image_rotate_callback), 136 | caja_file_info_list_copy (files)); 137 | 138 | items = g_list_prepend (items, item); 139 | 140 | items = g_list_reverse (items); 141 | 142 | return items; 143 | } 144 | } 145 | 146 | return NULL; 147 | } 148 | 149 | static void 150 | caja_image_converter_menu_provider_iface_init (CajaMenuProviderIface *iface) 151 | { 152 | iface->get_background_items = caja_image_converter_get_background_items; 153 | iface->get_file_items = caja_image_converter_get_file_items; 154 | } 155 | 156 | static void 157 | caja_image_converter_instance_init (CajaImageConverter *img) 158 | { 159 | } 160 | 161 | static void 162 | caja_image_converter_class_init (CajaImageConverterClass *class) 163 | { 164 | } 165 | 166 | GType 167 | caja_image_converter_get_type (void) 168 | { 169 | return image_converter_type; 170 | } 171 | 172 | void 173 | caja_image_converter_register_type (GTypeModule *module) 174 | { 175 | static const GTypeInfo info = { 176 | sizeof (CajaImageConverterClass), 177 | (GBaseInitFunc) NULL, 178 | (GBaseFinalizeFunc) NULL, 179 | (GClassInitFunc) caja_image_converter_class_init, 180 | NULL, 181 | NULL, 182 | sizeof (CajaImageConverter), 183 | 0, 184 | (GInstanceInitFunc) caja_image_converter_instance_init, 185 | NULL 186 | }; 187 | 188 | static const GInterfaceInfo menu_provider_iface_info = { 189 | (GInterfaceInitFunc) caja_image_converter_menu_provider_iface_init, 190 | NULL, 191 | NULL 192 | }; 193 | 194 | image_converter_type = g_type_module_register_type (module, 195 | G_TYPE_OBJECT, 196 | "CajaImageConverter", 197 | &info, 0); 198 | 199 | g_type_module_add_interface (module, 200 | image_converter_type, 201 | CAJA_TYPE_MENU_PROVIDER, 202 | &menu_provider_iface_info); 203 | } 204 | -------------------------------------------------------------------------------- /image-converter/caja-image-converter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * caja-image-converter.h 3 | * 4 | * Copyright (C) 2004-2005 Jürg Billeter 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library 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 GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this library; if not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | * 20 | * Author: Jürg Billeter 21 | * 22 | */ 23 | 24 | #ifndef CAJA_IMAGE_CONVERTER_H 25 | #define CAJA_IMAGE_CONVERTER_H 26 | 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | /* Declarations for the open terminal extension object. This object will be 32 | * instantiated by caja. It implements the GInterfaces 33 | * exported by libcaja. */ 34 | 35 | #define CAJA_TYPE_IMAGE_CONVERTER (caja_image_converter_get_type ()) 36 | #define CAJA_IMAGE_CONVERTER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CAJA_TYPE_IMAGE_CONVERTER, CajaImageConverter)) 37 | #define CAJA_IS_IMAGE_CONVERTER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CAJA_TYPE_IMAGE_CONVERTER)) 38 | typedef struct _CajaImageConverter CajaImageConverter; 39 | typedef struct _CajaImageConverterClass CajaImageConverterClass; 40 | 41 | struct _CajaImageConverter { 42 | GObject parent_slot; 43 | }; 44 | 45 | struct _CajaImageConverterClass { 46 | GObjectClass parent_slot; 47 | }; 48 | 49 | GType caja_image_converter_get_type (void); 50 | void caja_image_converter_register_type (GTypeModule *module); 51 | 52 | G_END_DECLS 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /image-converter/caja-image-resizer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * caja-image-resize-dialog.h 3 | * 4 | * Copyright (C) 2004-2005 Jürg Billeter 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library 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 GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this library; if not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | * 20 | * Author: Jürg Billeter 21 | * 22 | */ 23 | 24 | #ifndef __CAJA_IMAGE_RESIZER_H__ 25 | #define __CAJA_IMAGE_RESIZER_H__ 26 | 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define CAJA_TYPE_IMAGE_RESIZER (caja_image_resizer_get_type ()) 32 | G_DECLARE_FINAL_TYPE (CajaImageResizer, caja_image_resizer, CAJA, IMAGE_RESIZER, GObject) 33 | 34 | CajaImageResizer *caja_image_resizer_new (GList *files); 35 | void caja_image_resizer_show_dialog (CajaImageResizer *dialog); 36 | 37 | G_END_DECLS 38 | 39 | #endif /* __CAJA_IMAGE_RESIZER_H__ */ 40 | -------------------------------------------------------------------------------- /image-converter/caja-image-rotator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * caja-image-rotator.h 3 | * 4 | * Copyright (C) 2004-2006 Jürg Billeter 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library 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 GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this library; if not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | * 20 | * Author: Jürg Billeter 21 | * 22 | */ 23 | 24 | #ifndef __CAJA_IMAGE_ROTATOR_H__ 25 | #define __CAJA_IMAGE_ROTATOR_H__ 26 | 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define CAJA_TYPE_IMAGE_ROTATOR (caja_image_rotator_get_type ()) 32 | G_DECLARE_FINAL_TYPE (CajaImageRotator, caja_image_rotator, CAJA, IMAGE_ROTATOR, GObject) 33 | 34 | CajaImageRotator *caja_image_rotator_new (GList *files); 35 | void caja_image_rotator_show_dialog (CajaImageRotator *dialog); 36 | 37 | G_END_DECLS 38 | 39 | #endif /* __CAJA_IMAGE_ROTATOR_H__ */ 40 | -------------------------------------------------------------------------------- /image-converter/error-dialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | True 7 | False 8 | process-stop 9 | 10 | 11 | False 12 | 12 13 | Error 14 | center 15 | dialog-error 16 | dialog 17 | 18 | 19 | 20 | 21 | 22 | True 23 | False 24 | vertical 25 | 26 | 27 | True 28 | False 29 | True 30 | True 31 | expand 32 | 33 | 34 | _Skip 35 | True 36 | True 37 | True 38 | True 39 | 40 | 41 | True 42 | True 43 | 0 44 | 45 | 46 | 47 | 48 | _Cancel 49 | True 50 | True 51 | True 52 | image1 53 | True 54 | True 55 | 56 | 57 | True 58 | True 59 | 1 60 | 61 | 62 | 63 | 64 | _Retry 65 | True 66 | True 67 | True 68 | True 69 | 70 | 71 | True 72 | True 73 | 2 74 | 75 | 76 | 79 | 80 | 81 | False 82 | True 83 | end 84 | 0 85 | 86 | 87 | 88 | 89 | True 90 | False 91 | 92 | 93 | True 94 | False 95 | 12 96 | 97 | 98 | True 99 | False 100 | dialog-error 101 | 6 102 | 103 | 104 | False 105 | False 106 | 0 107 | 108 | 109 | 110 | 111 | True 112 | False 113 | An error has occurred. 114 | True 115 | True 116 | 40 117 | 0 118 | 119 | 120 | False 121 | False 122 | 1 123 | 124 | 125 | 126 | 127 | True 128 | True 129 | 0 130 | 131 | 132 | 133 | 134 | False 135 | True 136 | 1 137 | 138 | 139 | 140 | 141 | 142 | button2 143 | button1 144 | button3 145 | 146 | 147 | 148 | -------------------------------------------------------------------------------- /image-converter/image-converter.c: -------------------------------------------------------------------------------- 1 | /* 2 | * image-converter.c 3 | * 4 | * Copyright (C) 2004-2005 Jürg Billeter 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library 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 GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this library; if not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | * 20 | * Author: Jürg Billeter 21 | * 22 | */ 23 | 24 | #ifdef HAVE_CONFIG_H 25 | #include 26 | #endif 27 | 28 | #include 29 | 30 | #include 31 | 32 | #include "caja-image-converter.h" 33 | 34 | static GType type_list[1]; 35 | 36 | void 37 | caja_module_initialize (GTypeModule *module) 38 | { 39 | g_print ("Initializing caja-image-converter extension\n"); 40 | 41 | caja_image_converter_register_type (module); 42 | type_list[0] = CAJA_TYPE_IMAGE_CONVERTER; 43 | #ifdef ENABLE_NLS 44 | bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR); 45 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 46 | #endif /* ENABLE_NLS */ 47 | } 48 | 49 | void 50 | caja_module_shutdown (void) 51 | { 52 | g_print ("Shutting down caja-image-converter extension\n"); 53 | } 54 | 55 | void 56 | caja_module_list_types (const GType **types, 57 | int *num_types) 58 | { 59 | *types = type_list; 60 | *num_types = G_N_ELEMENTS (type_list); 61 | } 62 | -------------------------------------------------------------------------------- /image-converter/libcaja-image-converter.caja-extension.desktop.in.in: -------------------------------------------------------------------------------- 1 | [Caja Extension] 2 | # Translators: Do NOT translate or transliterate this text (this is an icon file name)! 3 | Icon=image 4 | Name=Image Converter 5 | Description=Rotate and resize images 6 | Author=Jürg Billeter 7 | Copyright=Copyright (C) 2004-2005 Jürg Billeter\nCopyright (C) 2013-2014 Stefano Karapetsas\nCopyright (C) 2015-2021 MATE developers 8 | Version=@VERSION@ 9 | Website=@PACKAGE_URL@ 10 | -------------------------------------------------------------------------------- /image-converter/org.mate.caja.extensions.imageconverter.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | caja-image-resize.ui 21 | caja-image-rotate.ui 22 | error-dialog.ui 23 | 24 | 25 | -------------------------------------------------------------------------------- /makepot: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | PACKAGE=caja-extensions; 4 | 5 | make -C po $PACKAGE.pot && mv po/$PACKAGE.pot . 6 | sed -i "/#, fuzzy/d" $PACKAGE.pot 7 | -------------------------------------------------------------------------------- /open-terminal/Makefile.am: -------------------------------------------------------------------------------- 1 | NULL = 2 | 3 | AM_CPPFLAGS = \ 4 | $(DISABLE_DEPRECATED_CPPFLAGS) \ 5 | -DMATELOCALEDIR=\""$(datadir)/locale"\" \ 6 | -I$(top_builddir) \ 7 | $(NULL) 8 | 9 | AM_CFLAGS = \ 10 | $(WARN_CFLAGS) \ 11 | $(NULL) 12 | 13 | caja_extensiondir = $(CAJA_EXTENSION_DIR) 14 | 15 | caja_extension_LTLIBRARIES = libcaja-open-terminal.la 16 | 17 | libcaja_open_terminal_la_SOURCES = \ 18 | caja-open-terminal.c \ 19 | caja-open-terminal.h \ 20 | open-terminal.c \ 21 | $(NULL) 22 | libcaja_open_terminal_la_CPPFLAGS = \ 23 | $(AM_CPPFLAGS) \ 24 | -DG_LOG_DOMAIN=\"Caja-Open-Terminal\" \ 25 | -DDATADIR=\"$(datadir)\" \ 26 | $(NULL) 27 | libcaja_open_terminal_la_CFLAGS = \ 28 | $(AM_CFLAGS) \ 29 | $(CAJA_CFLAGS) \ 30 | $(OPENTERMINAL_CFLAGS) \ 31 | $(NULL) 32 | libcaja_open_terminal_la_LDFLAGS = -module -avoid-version 33 | libcaja_open_terminal_la_LIBADD = $(CAJA_LIBS) $(OPENTERMINAL_LIBS) 34 | 35 | gsettings_schemas_in_files = org.mate.caja-open-terminal.gschema.xml.in 36 | gsettings_SCHEMAS = $(gsettings_schemas_in_files:.xml.in=.xml) 37 | @GSETTINGS_RULES@ 38 | 39 | extensiondir = $(datadir)/caja/extensions 40 | extension_in_files = libcaja-open-terminal.caja-extension.desktop.in 41 | extension_DATA = $(extension_in_files:.caja-extension.desktop.in=.caja-extension) 42 | $(extension_DATA): $(extension_in_files) 43 | if USE_NLS 44 | $(AM_V_GEN) $(MSGFMT) --desktop --keyword= --keyword=Copyright --keyword=Name --keyword=Description --template $< -d $(top_srcdir)/po -o $@ 45 | else 46 | $(AM_V_GEN) cp $< $@ 47 | endif 48 | 49 | DISTCLEANFILES = \ 50 | org.mate.caja-open-terminal.gschema.xml 51 | 52 | CLEANFILES = \ 53 | $(extension_DATA) \ 54 | $(gsettings_SCHEMAS) \ 55 | *.gschema.valid 56 | 57 | EXTRA_DIST = \ 58 | $(gsettings_schemas_in_files) 59 | 60 | -include $(top_srcdir)/git.mk 61 | -------------------------------------------------------------------------------- /open-terminal/caja-open-terminal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * caja-open-terminal.h 3 | * 4 | * Copyright (C) 2004, 2005 Free Software Foundation, Inc. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library 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 GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this library; if not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | * 20 | * Author: Christian Neumair 21 | * 22 | */ 23 | 24 | #ifndef CAJA_OPEN_TERMINAL_H 25 | #define CAJA_OPEN_TERMINAL_H 26 | 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | /* Declarations for the open terminal extension object. This object will be 32 | * instantiated by caja. It implements the GInterfaces 33 | * exported by libcaja. */ 34 | 35 | #define CAJA_TYPE_OPEN_TERMINAL (caja_open_terminal_get_type ()) 36 | #define CAJA_OPEN_TERMINAL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CAJA_TYPE_OPEN_TERMINAL, CajaOpenTerminal)) 37 | #define CAJA_IS_OPEN_TERMINAL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CAJA_TYPE_OPEN_TERMINAL)) 38 | typedef struct _CajaOpenTerminal CajaOpenTerminal; 39 | typedef struct _CajaOpenTerminalClass CajaOpenTerminalClass; 40 | 41 | struct _CajaOpenTerminal { 42 | GObject parent_slot; 43 | }; 44 | 45 | struct _CajaOpenTerminalClass { 46 | GObjectClass parent_slot; 47 | }; 48 | 49 | GType caja_open_terminal_get_type (void); 50 | void caja_open_terminal_register_type (GTypeModule *module); 51 | 52 | G_END_DECLS 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /open-terminal/libcaja-open-terminal.caja-extension.desktop.in.in: -------------------------------------------------------------------------------- 1 | [Caja Extension] 2 | # Translators: Do NOT translate or transliterate this text (this is an icon file name)! 3 | Icon=terminal 4 | Name=Open terminal 5 | Description=Open terminals from folders 6 | Author=Christian Neumair 7 | Copyright=Copyright (C) 2004-2005 Free Software Foundation, Inc.\nCopyright (C) 2013-2014 Stefano Karapetsas\nCopyright (C) 2015-2021 MATE developers 8 | Version=@VERSION@ 9 | Website=@PACKAGE_URL@ 10 | -------------------------------------------------------------------------------- /open-terminal/open-terminal.c: -------------------------------------------------------------------------------- 1 | /* 2 | * open-terminal.c 3 | * 4 | * Copyright (C) 2004, 2005 Free Software Foundation, Inc. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library 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 GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this library; if not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | * 20 | * Author: Christian Neumair 21 | * 22 | */ 23 | 24 | #ifdef HAVE_CONFIG_H 25 | #include 26 | #endif 27 | 28 | #include 29 | 30 | #include 31 | 32 | #include "caja-open-terminal.h" 33 | 34 | static GType type_list[1]; 35 | 36 | void 37 | caja_module_initialize (GTypeModule *module) 38 | { 39 | g_print ("Initializing caja-open-terminal extension\n"); 40 | 41 | caja_open_terminal_register_type (module); 42 | type_list[0] = CAJA_TYPE_OPEN_TERMINAL; 43 | #ifdef ENABLE_NLS 44 | bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR); 45 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 46 | #endif /* ENABLE_NLS */ 47 | } 48 | 49 | void 50 | caja_module_shutdown (void) 51 | { 52 | g_print ("Shutting down caja-open-terminal extension\n"); 53 | } 54 | 55 | void 56 | caja_module_list_types (const GType **types, 57 | int *num_types) 58 | { 59 | *types = type_list; 60 | *num_types = G_N_ELEMENTS (type_list); 61 | } 62 | -------------------------------------------------------------------------------- /open-terminal/org.mate.caja-open-terminal.gschema.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | false 5 | Whether opening a terminal on the desktop opens a terminal in the home directory 6 | If set to true, then opening a terminal on the desktop will open a terminal in the home directory. Otherwise, it will be opened in the desktop directory. Note that this key is irrelevant if the desktop directory is identical to the home directory. 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | af 2 | am 3 | ar 4 | as 5 | ast 6 | az 7 | be 8 | bg 9 | bn 10 | bn_IN 11 | br 12 | bs 13 | ca 14 | ca@valencia 15 | cmn 16 | crh 17 | cs 18 | cy 19 | da 20 | de 21 | dz 22 | el 23 | en_AU 24 | en_CA 25 | en_GB 26 | en_US 27 | eo 28 | es 29 | es_AR 30 | es_CL 31 | es_CO 32 | es_CR 33 | es_DO 34 | es_EC 35 | es_ES 36 | es_NI 37 | es_MX 38 | es_PA 39 | es_PE 40 | es_SV 41 | es_UY 42 | es_VE 43 | et 44 | eu 45 | fa 46 | fi 47 | fr 48 | fr_CA 49 | frp 50 | fur 51 | fy 52 | ga 53 | gl 54 | gu 55 | ha 56 | he 57 | hi 58 | hr 59 | hu 60 | hy 61 | ia 62 | id 63 | ie 64 | ig 65 | is 66 | it 67 | ja 68 | jv 69 | ka 70 | kab 71 | kk 72 | kn 73 | ko 74 | ku 75 | ku_IQ 76 | ky 77 | li 78 | lt 79 | lv 80 | mai 81 | mg 82 | mk 83 | ml 84 | mn 85 | mr 86 | ms 87 | nan 88 | nb 89 | nds 90 | ne 91 | nl 92 | nn 93 | nso 94 | oc 95 | or 96 | pa 97 | pl 98 | pms 99 | ps 100 | pt 101 | pt_BR 102 | ro 103 | ru 104 | rw 105 | sc 106 | si 107 | sk 108 | sl 109 | sq 110 | sr 111 | sr@latin 112 | sv 113 | ta 114 | te 115 | th 116 | tk 117 | tr 118 | ug 119 | uk 120 | ur 121 | uz 122 | vi 123 | wa 124 | xh 125 | yo 126 | zh_CN 127 | zh_HK 128 | zh_TW 129 | zu 130 | -------------------------------------------------------------------------------- /po/Makevars: -------------------------------------------------------------------------------- 1 | # Makefile variables for PO directory in any package using GNU gettext. 2 | 3 | # Usually the message domain is the same as the package name. 4 | DOMAIN = $(PACKAGE) 5 | 6 | # These two variables depend on the location of this directory. 7 | subdir = po 8 | top_builddir = .. 9 | 10 | # These options get passed to xgettext. 11 | XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3 --keyword=Copyright --keyword=Description --add-comments=Translators: 12 | 13 | # This is the copyright holder that gets inserted into the header of the 14 | # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding 15 | # package. (Note that the msgstr strings, extracted from the package's 16 | # sources, belong to the copyright holder of the package.) Translators are 17 | # expected to transfer the copyright for their translations to this person 18 | # or entity, or to disclaim their copyright. The empty string stands for 19 | # the public domain; in this case the translators are expected to disclaim 20 | # their copyright. 21 | COPYRIGHT_HOLDER = MATE Desktop Environment team 22 | 23 | # This tells whether or not to prepend "GNU " prefix to the package 24 | # name that gets inserted into the header of the $(DOMAIN).pot file. 25 | # Possible values are "yes", "no", or empty. If it is empty, try to 26 | # detect it automatically by scanning the files in $(top_srcdir) for 27 | # "GNU packagename" string. 28 | PACKAGE_GNU = 29 | 30 | # This is the email address or URL to which the translators shall report 31 | # bugs in the untranslated strings: 32 | # - Strings which are not entire sentences, see the maintainer guidelines 33 | # in the GNU gettext documentation, section 'Preparing Strings'. 34 | # - Strings which use unclear terms or require additional context to be 35 | # understood. 36 | # - Strings which make invalid assumptions about notation of date, time or 37 | # money. 38 | # - Pluralisation problems. 39 | # - Incorrect English spelling. 40 | # - Incorrect formatting. 41 | # It can be your email address, or a mailing list address where translators 42 | # can write to without being subscribed, or the URL of a web page through 43 | # which the translators can contact you. 44 | MSGID_BUGS_ADDRESS = 45 | 46 | # This is the list of locale categories, beyond LC_MESSAGES, for which the 47 | # message catalogs shall be used. It is usually empty. 48 | EXTRA_LOCALE_CATEGORIES = 49 | 50 | # This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' 51 | # context. Possible values are "yes" and "no". Set this to yes if the 52 | # package uses functions taking also a message context, like pgettext(), or 53 | # if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. 54 | USE_MSGCTXT = no 55 | 56 | # These options get passed to msgmerge. 57 | # Useful options are in particular: 58 | # --previous to keep previous msgids of translated messages, 59 | # --quiet to reduce the verbosity. 60 | MSGMERGE_OPTIONS = 61 | 62 | # These options get passed to msginit. 63 | # If you want to disable line wrapping when writing PO files, add 64 | # --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and 65 | # MSGINIT_OPTIONS. 66 | MSGINIT_OPTIONS = 67 | 68 | # This tells whether or not to regenerate a PO file when $(DOMAIN).pot 69 | # has changed. Possible values are "yes" and "no". Set this to no if 70 | # the POT file is checked in the repository and the version control 71 | # program ignores timestamps. 72 | PO_DEPENDS_ON_POT = yes 73 | 74 | # This tells whether or not to forcibly update $(DOMAIN).pot and 75 | # regenerate PO files on "make dist". Possible values are "yes" and 76 | # "no". Set this to no if the POT file and PO files are maintained 77 | # externally. 78 | DIST_DEPENDS_ON_UPDATE_PO = yes 79 | -------------------------------------------------------------------------------- /po/POTFILES.in: -------------------------------------------------------------------------------- 1 | # List of source files containing translatable strings. 2 | # Please keep this list in alphabetic order. 3 | audio-video-properties/bacon-video-widget-properties.c 4 | audio-video-properties/libcaja-av.caja-extension.desktop.in.in 5 | audio-video-properties/totem-gst-helpers.c 6 | audio-video-properties/totem-properties-main.c 7 | audio-video-properties/totem-properties-view.c 8 | gksu/libcaja-gksu.c 9 | gksu/libcaja-gksu.caja-extension.desktop.in.in 10 | image-converter/caja-image-converter.c 11 | image-converter/caja-image-resize.ui 12 | image-converter/caja-image-resizer.c 13 | image-converter/caja-image-rotate.ui 14 | image-converter/caja-image-rotator.c 15 | image-converter/libcaja-image-converter.caja-extension.desktop.in.in 16 | open-terminal/caja-open-terminal.c 17 | open-terminal/libcaja-open-terminal.caja-extension.desktop.in.in 18 | open-terminal/org.mate.caja-open-terminal.gschema.xml.in 19 | sendto/caja-nste.c 20 | sendto/caja-nste.h 21 | sendto/caja-sendto-command.c 22 | sendto/caja-sendto-module.c 23 | sendto/libcaja-sendto.caja-extension.desktop.in.in 24 | sendto/org.mate.Caja.Sendto.gschema.xml.in 25 | sendto/caja-sendto.ui 26 | sendto/plugins/emailclient/emailclient.c 27 | sendto/plugins/gajim/gajim.c 28 | sendto/plugins/caja-burn/caja-burn.c 29 | sendto/plugins/pidgin/pidgin.c 30 | sendto/plugins/removable-devices/removable-devices.c 31 | sendto/plugins/upnp/upnp.c 32 | share/libcaja-share.caja-extension.desktop.in.in 33 | share/caja-share.c 34 | share/share-dialog.ui 35 | share/shares.c 36 | wallpaper/caja-wallpaper-extension.c 37 | wallpaper/libcaja-wallpaper.caja-extension.desktop.in.in 38 | xattr-tags/caja-xattr-tags-extension.c 39 | xattr-tags/libcaja-xattr-tags.caja-extension.desktop.in.in 40 | -------------------------------------------------------------------------------- /sendto/Makefile.am: -------------------------------------------------------------------------------- 1 | NULL = 2 | SUBDIRS = . docs plugins 3 | 4 | AM_CPPFLAGS = \ 5 | $(DISABLE_DEPRECATED_CPPFLAGS) \ 6 | -DDATADIR=\"$(datadir)\" \ 7 | -DPLUGINDIR=\"$(libdir)/caja-sendto/plugins\" \ 8 | -DMATELOCALEDIR="\"$(datadir)/locale\"" \ 9 | -I$(top_srcdir) \ 10 | -I$(top_builddir) \ 11 | $(NULL) 12 | 13 | AM_CFLAGS = \ 14 | $(WARN_CFLAGS) \ 15 | $(SENDTO_CFLAGS) \ 16 | $(CAJA_CFLAGS) \ 17 | $(NULL) 18 | 19 | caja_sendto_includedir = $(includedir)/caja-sendto/ 20 | caja_sendto_include_HEADERS = caja-sendto-plugin.h 21 | 22 | pkgconfigdir = $(libdir)/pkgconfig 23 | pkgconfig_DATA = caja-sendto.pc 24 | 25 | noinst_LTLIBRARIES = libnstplugin.la 26 | libnstplugin_la_SOURCES = \ 27 | caja-sendto-plugin.h \ 28 | nst-enum-types.c \ 29 | nst-enum-types.h 30 | libnstplugin_la_LIBADD = $(SENDTO_LIBS) 31 | 32 | bin_PROGRAMS = caja-sendto 33 | 34 | resources_built_sources = caja-sendto-resources.h caja-sendto-resources.c 35 | $(resources_built_sources): org.mate.caja.extensions.sendto.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/org.mate.caja.extensions.sendto.gresource.xml) 36 | $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate --c-name sendto $< 37 | 38 | caja_sendto_SOURCES = caja-sendto-command.c $(resources_built_sources) 39 | caja_sendto_LDADD = $(SENDTO_LIBS) libnstplugin.la 40 | 41 | caja_extensiondir = $(CAJA_EXTENSION_DIR) 42 | caja_extension_LTLIBRARIES = libcaja-sendto.la 43 | libcaja_sendto_la_SOURCES = \ 44 | caja-nste.c \ 45 | caja-nste.h \ 46 | caja-sendto-module.c 47 | 48 | libcaja_sendto_la_LDFLAGS = -module -avoid-version -no-undefined 49 | libcaja_sendto_la_LIBADD = $(CAJA_LIBS) 50 | 51 | nst_headers_to_scan_for_enums = caja-sendto-plugin.h 52 | # Generate the enums source code, with glib-mkenums: 53 | # This is based on the same Makefile.am stuff in pango: 54 | nst_built_headers = nst-enum-types.h 55 | nst_built_cfiles = nst-enum-types.c 56 | 57 | nst-enum-types.h: $(nst_headers_to_scan_for_enums) Makefile 58 | $(AM_V_GEN) (cd $(srcdir) && glib-mkenums \ 59 | --fhead "#ifndef __NST_ENUM_TYPES_H__\n#define __NST_ENUM_TYPES_H__\n\n#include \n\nG_BEGIN_DECLS\n" \ 60 | --fprod "/* enumerations from \"@filename@\" */\n" \ 61 | --vhead "GType @enum_name@_get_type (void);\n#define NST_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ 62 | --ftail "G_END_DECLS\n\n#endif /* __NST_ENUM_TYPES_H__ */" \ 63 | $(nst_headers_to_scan_for_enums)) > $@ 64 | 65 | nst-enum-types.c: $(nst_headers_to_scan_for_enums) Makefile nst-enum-types.h 66 | $(AM_V_GEN) (cd $(srcdir) && glib-mkenums \ 67 | --fhead "#include \n" \ 68 | --fhead "#include \"nst-enum-types.h\"\n" \ 69 | --fhead "#include " \ 70 | --fprod "\n/* enumerations from \"@filename@\" */" \ 71 | --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ 72 | --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ 73 | --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \ 74 | $(nst_headers_to_scan_for_enums)) > $@ 75 | 76 | gsettingsschema_in_files = org.mate.Caja.Sendto.gschema.xml.in 77 | gsettings_SCHEMAS = $(gsettingsschema_in_files:.xml.in=.xml) 78 | @GSETTINGS_RULES@ 79 | 80 | man_MANS = caja-sendto.1 81 | 82 | extensiondir = $(datadir)/caja/extensions 83 | extension_in_files = libcaja-sendto.caja-extension.desktop.in 84 | extension_DATA = $(extension_in_files:.caja-extension.desktop.in=.caja-extension) 85 | $(extension_DATA): $(extension_in_files) 86 | if USE_NLS 87 | $(AM_V_GEN) $(MSGFMT) --desktop --keyword= --keyword=Copyright --keyword=Name --keyword=Description --template $< -d $(top_srcdir)/po -o $@ 88 | else 89 | $(AM_V_GEN) cp $< $@ 90 | endif 91 | 92 | EXTRA_DIST = \ 93 | $(man_MANS) \ 94 | caja-sendto.pc.in \ 95 | caja-sendto.ui \ 96 | $(gsettingsschema_in_files) \ 97 | org.mate.caja.extensions.sendto.gresource.xml \ 98 | $(NULL) 99 | 100 | CLEANFILES = \ 101 | $(nst_built_headers) \ 102 | $(nst_built_cfiles) \ 103 | $(gsettings_SCHEMAS) \ 104 | $(extension_DATA) \ 105 | *.gschema.valid \ 106 | $(resources_built_sources) \ 107 | $(NULL) 108 | 109 | -include $(top_srcdir)/git.mk 110 | -------------------------------------------------------------------------------- /sendto/caja-nste.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Caja-sendto 3 | * 4 | * Copyright (C) 2004 Free Software Foundation, Inc. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library 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 GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this library; if not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | * 20 | * Author: Roberto Majadas 21 | * 22 | */ 23 | 24 | #ifdef HAVE_CONFIG_H 25 | #include 26 | #endif 27 | 28 | #include 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include "caja-nste.h" 35 | 36 | static GObjectClass *parent_class; 37 | 38 | static void 39 | sendto_callback (CajaMenuItem *item, 40 | gpointer user_data) 41 | { 42 | GList *files, *scan; 43 | gchar *uri; 44 | GString *cmd; 45 | 46 | files = g_object_get_data (G_OBJECT (item), "files"); 47 | 48 | cmd = g_string_new ("caja-sendto"); 49 | 50 | for (scan = files; scan; scan = scan->next) { 51 | CajaFileInfo *file = scan->data; 52 | 53 | uri = caja_file_info_get_uri (file); 54 | g_string_append_printf (cmd, " \"%s\"", uri); 55 | g_free (uri); 56 | } 57 | 58 | g_spawn_command_line_async (cmd->str, NULL); 59 | 60 | g_string_free (cmd, TRUE); 61 | } 62 | 63 | static GList * 64 | caja_nste_get_file_items (CajaMenuProvider *provider, 65 | GtkWidget *window, 66 | GList *files) 67 | { 68 | GList *items = NULL; 69 | gboolean one_item; 70 | CajaMenuItem *item; 71 | 72 | if (files == NULL) 73 | return NULL; 74 | 75 | one_item = (files != NULL) && (files->next == NULL); 76 | if (one_item && 77 | !caja_file_info_is_directory ((CajaFileInfo *)files->data)) { 78 | item = caja_menu_item_new ("CajaNste::sendto", 79 | _("Send to..."), 80 | _("Send file by mail, instant message..."), 81 | "document-send"); 82 | } else { 83 | item = caja_menu_item_new ("CajaNste::sendto", 84 | _("Send to..."), 85 | _("Send files by mail, instant message..."), 86 | "document-send"); 87 | } 88 | g_signal_connect (item, 89 | "activate", 90 | G_CALLBACK (sendto_callback), 91 | provider); 92 | g_object_set_data_full (G_OBJECT (item), 93 | "files", 94 | caja_file_info_list_copy (files), 95 | (GDestroyNotify) caja_file_info_list_free); 96 | 97 | items = g_list_append (items, item); 98 | 99 | return items; 100 | } 101 | 102 | static void 103 | caja_nste_menu_provider_iface_init (CajaMenuProviderIface *iface) 104 | { 105 | iface->get_file_items = caja_nste_get_file_items; 106 | } 107 | 108 | static void 109 | caja_nste_instance_init (CajaNste *nste) 110 | { 111 | } 112 | 113 | static void 114 | caja_nste_class_init (CajaNsteClass *class) 115 | { 116 | parent_class = g_type_class_peek_parent (class); 117 | } 118 | 119 | static GType nste_type = 0; 120 | 121 | GType 122 | caja_nste_get_type (void) 123 | { 124 | return nste_type; 125 | } 126 | 127 | void 128 | caja_nste_register_type (GTypeModule *module) 129 | { 130 | static const GTypeInfo info = { 131 | sizeof (CajaNsteClass), 132 | (GBaseInitFunc) NULL, 133 | (GBaseFinalizeFunc) NULL, 134 | (GClassInitFunc) caja_nste_class_init, 135 | NULL, 136 | NULL, 137 | sizeof (CajaNste), 138 | 0, 139 | (GInstanceInitFunc) caja_nste_instance_init, 140 | NULL 141 | }; 142 | 143 | static const GInterfaceInfo menu_provider_iface_info = { 144 | (GInterfaceInitFunc) caja_nste_menu_provider_iface_init, 145 | NULL, 146 | NULL 147 | }; 148 | 149 | nste_type = g_type_module_register_type (module, 150 | G_TYPE_OBJECT, 151 | "CajaNste", 152 | &info, 0); 153 | 154 | g_type_module_add_interface (module, 155 | nste_type, 156 | CAJA_TYPE_MENU_PROVIDER, 157 | &menu_provider_iface_info); 158 | } 159 | -------------------------------------------------------------------------------- /sendto/caja-nste.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Caja SendTo extension 3 | * 4 | * Copyright (C) 2005 Roberto Majadas 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library 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 GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this library; if not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | * 20 | * Author: Roberto Majadas 21 | * 22 | */ 23 | 24 | #ifndef CAJA_NSTE_H 25 | #define CAJA_NSTE_H 26 | 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define CAJA_TYPE_NSTE (caja_nste_get_type ()) 32 | #define CAJA_NSTE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CAJA_TYPE_NSTE, CajaNste)) 33 | #define CAJA_IS_NSTE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CAJA_TYPE_NSTE)) 34 | 35 | typedef struct _CajaNste CajaNste; 36 | typedef struct _CajaNsteClass CajaNsteClass; 37 | 38 | struct _CajaNste { 39 | GObject __parent; 40 | }; 41 | 42 | struct _CajaNsteClass { 43 | GObjectClass __parent; 44 | }; 45 | 46 | GType caja_nste_get_type (void); 47 | void caja_nste_register_type (GTypeModule *module); 48 | 49 | G_END_DECLS 50 | 51 | #endif /* CAJA_NSTE_H */ 52 | -------------------------------------------------------------------------------- /sendto/caja-sendto-module.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Caja SendTo 3 | * 4 | * Copyright (C) 2005 Roberto Majadas 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library 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 GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this library; if not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 | * 20 | * Author: Roberto Majadas 21 | * 22 | */ 23 | 24 | #ifdef HAVE_CONFIG_H 25 | #include 26 | #endif 27 | 28 | #include 29 | 30 | #include 31 | #include 32 | 33 | #include "caja-nste.h" 34 | 35 | void 36 | caja_module_initialize (GTypeModule*module) 37 | { 38 | g_print ("Initializing caja-sendto extension\n"); 39 | caja_nste_register_type (module); 40 | #ifdef ENABLE_NLS 41 | bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR); 42 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 43 | #endif /* ENABLE_NLS */ 44 | } 45 | 46 | void 47 | caja_module_shutdown (void) 48 | { 49 | g_print ("Shutting down caja-sendto extension\n"); 50 | } 51 | 52 | void 53 | caja_module_list_types (const GType **types, 54 | int *num_types) 55 | { 56 | static GType type_list[1]; 57 | 58 | type_list[0] = CAJA_TYPE_NSTE; 59 | *types = type_list; 60 | 61 | *num_types = 1; 62 | } 63 | -------------------------------------------------------------------------------- /sendto/caja-sendto-plugin.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ 2 | 3 | /* 4 | * Copyright (C) 2004 Roberto Majadas 5 | * Copyright (C) 2009 Bastien Nocera 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU 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 | * 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 GNU 15 | * General Public License for more av. 16 | * 17 | * You should have received a copy of the GNU General Public 18 | * License along with this program; if not, write to the 19 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA. 21 | * 22 | * Authors: Roberto Majadas 23 | * Bastien Nocera 24 | */ 25 | 26 | #ifndef _CAJA_SENDTO_PLUGIN_H_ 27 | #define _CAJA_SENDTO_PLUGIN_H_ 28 | 29 | #include 30 | #include 31 | 32 | /** 33 | * SECTION:caja-sendto-plugin 34 | * @short_description: caja-sento plug-in 35 | * @stability: Stable 36 | * @include: bluetooth-plugin.h 37 | * 38 | * Plug-ins can be used to extend caja-sendto. 39 | **/ 40 | 41 | typedef struct _NstPluginInfo NstPluginInfo; 42 | typedef struct _NstPlugin NstPlugin; 43 | 44 | /** 45 | * NstPluginCapabilities: 46 | * @CAJA_CAPS_NONE: No capabilities 47 | * @CAJA_CAPS_SEND_DIRECTORIES: The plugin can send whole directories without compression 48 | * @CAJA_CAPS_SEND_IMAGES: The plugin only sends images which could be resized 49 | * 50 | * Capabilities of the plugin. 51 | **/ 52 | typedef enum { 53 | CAJA_CAPS_NONE = 0, 54 | CAJA_CAPS_SEND_DIRECTORIES = 1 << 0, 55 | CAJA_CAPS_SEND_IMAGES = 1 << 1, 56 | } NstPluginCapabilities; 57 | 58 | /** 59 | * NstPluginInfo: 60 | * @icon: The icon name for the plugin selection drop-down 61 | * @id: A unique ID representing the plugin 62 | * @description: The label used in the plugin selection drop-down 63 | * @gettext_package: The domain to use to translate the description, %NULL if the plugin is part of caja-sendto 64 | * @capabilities: a bitmask of #NstPluginCapabilities 65 | * @init: Check for dependencies, and return %FALSE if dependencies such as programs are missing. 66 | * @get_contacts_widget: Return the contact widget, the widget to select the destination of the files 67 | * @validate_destination: Validate whether the destination can receive the file. This callback is optional. 68 | * @send_files: Actually send the files to the selected destination. The file list is a #GList of URI strings. 69 | * @destroy: Free all the resources used by the plugin. 70 | * 71 | * A structure representing a caja-sendto plugin. You should also call NST_INIT_PLUGIN() on the plugin structure to export it. 72 | **/ 73 | struct _NstPluginInfo 74 | { 75 | gchar *icon; 76 | gchar *id; 77 | gchar *description; 78 | gchar *gettext_package; 79 | NstPluginCapabilities capabilities; 80 | gboolean (*init) (NstPlugin *plugin); 81 | GtkWidget* (*get_contacts_widget) (NstPlugin *plugin); 82 | gboolean (*validate_destination) (NstPlugin *plugin, GtkWidget *contact_widget, char **error); 83 | gboolean (*send_files) (NstPlugin *plugin, 84 | GtkWidget *contact_widget, 85 | GList *file_list); 86 | gboolean (*destroy) (NstPlugin *plugin) ; 87 | }; 88 | 89 | /** 90 | * NstPlugin: 91 | * @module: the #GModule for the opened shared library 92 | * @info: a #NstPluginInfo structure 93 | * 94 | * A structure as used in caja-sendto. 95 | **/ 96 | struct _NstPlugin 97 | { 98 | GModule *module; 99 | NstPluginInfo *info; 100 | }; 101 | 102 | /** 103 | * NST_INIT_PLUGIN: 104 | * @plugininfo: a #NstPluginInfo structure representing the plugin 105 | * 106 | * Call this on an #NstPluginInfo structure to make it available to caja-sendto. 107 | **/ 108 | # define NST_INIT_PLUGIN(plugininfo) \ 109 | gboolean nst_init_plugin(NstPlugin *plugin); \ 110 | G_MODULE_EXPORT gboolean nst_init_plugin(NstPlugin *plugin) { \ 111 | plugin->info = &(plugininfo); \ 112 | return TRUE; \ 113 | } 114 | 115 | #endif /* _CAJA_SENDTO_PLUGIN_H_ */ 116 | 117 | -------------------------------------------------------------------------------- /sendto/caja-sendto.1: -------------------------------------------------------------------------------- 1 | .TH CAJA-SENDTO 1 2006\-07\-18 "MATE" "MATE" 2 | .SH NAME 3 | caja\-sendto \- convenience application to send a file via email or instant messenger 4 | .SH SYNOPSIS 5 | .B caja-sendto 6 | .RI [ OPTIONS " " | " " FILES... ] 7 | .SH DESCRIPTION 8 | Send FILE(s) via email or instant messenger. 9 | 10 | A dialog window presents a choice of carrier application and recipient of the file(s). 11 | Recipent names can be selected from a list or autocompleted. The selected application 12 | is then opened with the file(s) and recipient ready for transfer. 13 | 14 | The application is intented to integrate with caja and is 15 | written for the MATE graphical desktop. 16 | .SH OPTIONS 17 | .TP 18 | .B \-?, \-\-help 19 | Show a help message listing all the options and their meanings. 20 | .SH AUTHOR 21 | Written by Roberto Majadas 22 | .PP 23 | This manual page was originally written by Oystein Gisnas for the 24 | Debian system. 25 | .\" Copyright 2006 Oystein Gisnas 26 | .\" You may copy this manual page under the terms of the version 2 of 27 | .\" the GNU General Public License. 28 | -------------------------------------------------------------------------------- /sendto/caja-sendto.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | includedir=@includedir@ 4 | pluginsdir=@libdir@/caja-sendto/plugins 5 | 6 | Name: caja-sendto 7 | Description: Extend caja-sendto through plugins 8 | Version: @VERSION@ 9 | Requires: glib-2.0 gmodule-2.0 gtk+-3.0 10 | Cflags: -I${includedir}/caja-sendto 11 | -------------------------------------------------------------------------------- /sendto/docs/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | # We require automake 1.6 at least. 4 | AUTOMAKE_OPTIONS = 1.6 5 | 6 | # This is a blank Makefile.am for using gtk-doc. 7 | # Copy this to your project's API docs directory and modify the variables to 8 | # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples 9 | # of using the various options. 10 | 11 | # The name of the module, e.g. 'glib'. 12 | DOC_MODULE=caja-sendto 13 | 14 | # Uncomment for versioned docs and specify the version of the module, e.g. '2'. 15 | #DOC_MODULE_VERSION=2 16 | 17 | 18 | # The top-level SGML file. You can change this if you want to. 19 | DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml 20 | 21 | # The directory containing the source code. Relative to $(srcdir). 22 | # gtk-doc will search all .c & .h files beneath here for inline comments 23 | # documenting the functions and macros. 24 | # e.g. DOC_SOURCE_DIR=../../../gtk 25 | DOC_SOURCE_DIR=../ 26 | 27 | # Extra options to pass to gtkdoc-scangobj. Not normally needed. 28 | SCANGOBJ_OPTIONS= 29 | 30 | # Extra options to supply to gtkdoc-scan. 31 | # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" 32 | SCAN_OPTIONS= 33 | 34 | # Extra options to supply to gtkdoc-mkdb. 35 | # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml 36 | MKDB_OPTIONS=--sgml-mode --output-format=xml 37 | 38 | # Extra options to supply to gtkdoc-mktmpl 39 | # e.g. MKTMPL_OPTIONS=--only-section-tmpl 40 | MKTMPL_OPTIONS= 41 | 42 | # Extra options to supply to gtkdoc-mkhtml 43 | MKHTML_OPTIONS= 44 | 45 | # Extra options to supply to gtkdoc-fixref. Not normally needed. 46 | # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html 47 | FIXXREF_OPTIONS= 48 | 49 | # Used for dependencies. The docs will be rebuilt if any of these change. 50 | # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h 51 | # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c 52 | HFILE_GLOB=$(top_srcdir)/sendto/*.h 53 | CFILE_GLOB=$(top_srcdir)/sendto/*.c 54 | 55 | # Header files to ignore when scanning. 56 | # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h 57 | IGNORE_HFILES=caja-nste.h bluetooth-marshal.h e-contact-entry.h econtactentry-marshal.h nst-common.h 58 | 59 | # Images to copy into HTML directory. 60 | # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png 61 | HTML_IMAGES= 62 | 63 | # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). 64 | # e.g. content_files=running.sgml building.sgml changes-2.0.sgml 65 | content_files=version.xml 66 | 67 | # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded 68 | # These files must be listed here *and* in content_files 69 | # e.g. expand_content_files=running.sgml 70 | expand_content_files= 71 | 72 | # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. 73 | # Only needed if you are using gtkdoc-scangobj to dynamically query widget 74 | # signals and properties. 75 | # e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) 76 | # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) 77 | GTKDOC_CFLAGS=$(SENDTO_CFLAGS) 78 | GTKDOC_LIBS=$(top_builddir)/sendto/libnstplugin.la 79 | 80 | # This includes the standard gtk-doc make rules, copied by gtkdocize. 81 | include $(top_srcdir)/gtk-doc.make 82 | 83 | DISTCLEANFILES = $(DOC_MODULE).actions 84 | 85 | # Other files to distribute 86 | # e.g. EXTRA_DIST += version.xml.in 87 | EXTRA_DIST += version.xml.in 88 | 89 | # Files not to distribute 90 | # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types 91 | # for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt 92 | #DISTCLEANFILES += 93 | 94 | # Comment this out if you want your docs-status tested during 'make check' 95 | #TESTS = $(GTKDOC_CHECK) 96 | 97 | #if ENABLE_GTK_DOC 98 | #TESTS_ENVIRONMENT = cd $(srcdir) && 99 | #TESTS = $(GTKDOC_CHECK) 100 | #endif 101 | 102 | 103 | -------------------------------------------------------------------------------- /sendto/docs/caja-sendto-docs.sgml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | ]> 8 | 9 | 10 | caja-sendto Reference Manual 11 | 12 | for caja-sendto &version; 13 | The latest version of this documentation can be found on-line at 14 | http://library.mate.org/devel/caja-sendto/index.html. 15 | 16 | 17 | 18 | 19 | caja-sendto documentation 20 | 21 | 22 | 23 | 24 | API Index 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /sendto/docs/caja-sendto-overrides.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mate-desktop/caja-extensions/304fe902cf1ba45c16f745cee9fc3f9f716ca473/sendto/docs/caja-sendto-overrides.txt -------------------------------------------------------------------------------- /sendto/docs/caja-sendto-sections.txt: -------------------------------------------------------------------------------- 1 |
2 | caja-sendto-plugin 3 | NstPluginInfo 4 | NstPlugin 5 | NstPluginCapabilities 6 | NST_INIT_PLUGIN 7 |
8 | 9 |
10 | nst-enum-types 11 | nst_plugin_capabilities_get_type 12 | NST_TYPE_PLUGIN_CAPABILITIES 13 |
14 | 15 | -------------------------------------------------------------------------------- /sendto/docs/caja-sendto.types: -------------------------------------------------------------------------------- 1 | nst_plugin_capabilities_get_type 2 | -------------------------------------------------------------------------------- /sendto/docs/version.xml.in: -------------------------------------------------------------------------------- 1 | @VERSION@ 2 | -------------------------------------------------------------------------------- /sendto/libcaja-sendto.caja-extension.desktop.in.in: -------------------------------------------------------------------------------- 1 | [Caja Extension] 2 | # Translators: Do NOT translate or transliterate this text (this is an icon file name)! 3 | Icon=mail-send 4 | Name=Send To 5 | Description=Integrates email clients and Pidgin 6 | Author=Roberto Majadas 7 | Copyright=Copyright (C) 2004 Roberto Majadas\nCopyright (C) 2013-2014 Stefano Karapetsas\nCopyright (C) 2015-2021 MATE developers 8 | Version=@VERSION@ 9 | Website=@PACKAGE_URL@ 10 | -------------------------------------------------------------------------------- /sendto/org.mate.Caja.Sendto.gschema.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | '' 6 | Last plugin used to send 7 | 8 | Used to store which plugin was used the last time 9 | files were sent using caja-sendto. 10 | 11 | 12 | 13 | 0 14 | Last type of archive used 15 | 16 | Used to store which type of archive was used the last time 17 | (0: zip, 1: tar.gz, 2: tar.bz2). 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /sendto/org.mate.caja.extensions.sendto.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | caja-sendto.ui 21 | 22 | 23 | -------------------------------------------------------------------------------- /sendto/plugins/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = . $(SENDTO_PLUGINS) 2 | DIST_SUBDIRS = $(ALL_SENDTO_PLUGINS) 3 | 4 | NST_COMMON_SOURCES = nst-common.c nst-common.h 5 | 6 | if HAVE_GIO 7 | noinst_LTLIBRARIES = libnstcommon.la 8 | libnstcommon_la_SOURCES = $(NST_COMMON_SOURCES) 9 | libnstcommon_la_CFLAGS = $(SENDTO_CFLAGS) 10 | libnstcommon_la_LIBADD = $(SENDTO_LIBS) 11 | endif 12 | 13 | EXTRA_DIST = $(NST_COMMON_SOURCES) 14 | 15 | -include $(top_srcdir)/git.mk 16 | -------------------------------------------------------------------------------- /sendto/plugins/caja-burn/Makefile.am: -------------------------------------------------------------------------------- 1 | NULL = 2 | 3 | AM_CPPFLAGS = \ 4 | $(DISABLE_DEPRECATED_CPPFLAGS) \ 5 | -DMATELOCALEDIR=\""$(datadir)/locale"\" \ 6 | -I$(top_builddir) \ 7 | -I$(top_srcdir)/sendto \ 8 | $(NULL) 9 | 10 | AM_CFLAGS = \ 11 | $(WARN_CFLAGS) \ 12 | $(SENDTO_CFLAGS) \ 13 | $(NULL) 14 | 15 | plugindir = $(libdir)/caja-sendto/plugins 16 | 17 | plugin_LTLIBRARIES = libnstburn.la 18 | 19 | libnstburn_la_SOURCES = caja-burn.c 20 | libnstburn_la_CPPFLAGS = \ 21 | $(AM_CPPFLAGS) \ 22 | -DDATADIR=\"$(datadir)\" \ 23 | -DICONDIR=\"$(icondir)\" \ 24 | -I$(srcdir)/../ \ 25 | $(NULL) 26 | libnstburn_la_CFLAGS = \ 27 | $(AM_CFLAGS) \ 28 | $(GIO_CFLAGS) \ 29 | $(NULL) 30 | libnstburn_la_LDFLAGS = -module -avoid-version 31 | libnstburn_la_LIBADD = $(GIO_LIBS) $(SENDTO_LIBS) $(builddir)/../libnstcommon.la 32 | 33 | -include $(top_srcdir)/git.mk 34 | -------------------------------------------------------------------------------- /sendto/plugins/caja-burn/caja-burn.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ 2 | 3 | /* 4 | * Copyright (C) 2008 Jader Henrique da Silva 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License as 8 | * published by the Free Software Foundation; either version 2 of the 9 | * License, or (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 GNU 14 | * General Public License for more av. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this program; if not, write to the 18 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | * Boston, MA 02110-1301 USA. 20 | * 21 | * Author: Jader Henrique da Silva 22 | */ 23 | 24 | #ifdef HAVE_CONFIG_H 25 | #include 26 | #endif 27 | 28 | #include 29 | 30 | #include 31 | #include "nst-common.h" 32 | #include "caja-sendto-plugin.h" 33 | 34 | enum { 35 | COL_PIXBUF, 36 | COL_LABEL, 37 | NUM_COLS, 38 | }; 39 | 40 | #define COMBOBOX_OPTION_NEW_DVD 0 41 | #define COMBOBOX_OPTION_EXISTING_DVD 1 42 | 43 | static GFile *burn = NULL; 44 | 45 | static 46 | gboolean init (NstPlugin *plugin) 47 | { 48 | GtkIconTheme *it; 49 | char *cmd; 50 | 51 | g_print ("Init caja burn plugin\n"); 52 | 53 | #ifdef ENABLE_NLS 54 | bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR); 55 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 56 | #endif /* ENABLE_NLS */ 57 | 58 | it = gtk_icon_theme_get_default (); 59 | gtk_icon_theme_append_search_path (it, DATADIR "/brasero/icons"); 60 | 61 | cmd = g_find_program_in_path ("brasero"); 62 | if (cmd == NULL) 63 | return FALSE; 64 | g_free (cmd); 65 | 66 | burn = g_file_new_for_uri ("burn:/"); 67 | 68 | return TRUE; 69 | } 70 | 71 | static 72 | GtkWidget* get_contacts_widget (NstPlugin *plugin) 73 | { 74 | GtkWidget *widget; 75 | GtkCellRenderer *renderer; 76 | GtkListStore *store; 77 | GtkTreeModel *model; 78 | GFileEnumerator *fenum; 79 | GFileInfo *file_info = NULL; 80 | int selection = COMBOBOX_OPTION_NEW_DVD; 81 | 82 | fenum = g_file_enumerate_children (burn, 83 | G_FILE_ATTRIBUTE_STANDARD_NAME, 84 | G_FILE_QUERY_INFO_NONE, 85 | NULL, 86 | NULL); 87 | 88 | if (fenum != NULL) { 89 | file_info = g_file_enumerator_next_file (fenum, NULL, NULL); 90 | g_object_unref (fenum); 91 | } 92 | 93 | store = gtk_list_store_new (NUM_COLS, G_TYPE_STRING, G_TYPE_STRING); 94 | 95 | gtk_list_store_insert_with_values (store, NULL, 96 | INT_MAX, 97 | COL_PIXBUF, "media-optical-blank", 98 | COL_LABEL, _("New CD/DVD"), 99 | -1); 100 | 101 | if (file_info != NULL) { 102 | gtk_list_store_insert_with_values (store, NULL, 103 | INT_MAX, 104 | COL_PIXBUF, "media-optical-data-new", 105 | COL_LABEL, _("Existing CD/DVD"), 106 | -1); 107 | g_object_unref (file_info); 108 | selection = COMBOBOX_OPTION_EXISTING_DVD; 109 | } 110 | 111 | model = GTK_TREE_MODEL (store); 112 | widget = gtk_combo_box_new_with_model (model); 113 | renderer = gtk_cell_renderer_pixbuf_new (); 114 | gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (widget), 115 | renderer, 116 | FALSE); 117 | gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (widget), 118 | renderer, 119 | "icon-name", COL_PIXBUF, 120 | NULL); 121 | renderer = gtk_cell_renderer_text_new (); 122 | gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (widget), 123 | renderer, 124 | TRUE); 125 | gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (widget), 126 | renderer, 127 | "text", COL_LABEL, 128 | NULL); 129 | 130 | gtk_combo_box_set_active (GTK_COMBO_BOX (widget), selection); 131 | 132 | return widget; 133 | } 134 | 135 | static 136 | gboolean send_files (NstPlugin *plugin, 137 | GtkWidget *burntype_widget, 138 | GList *file_list) 139 | { 140 | GFileEnumerator *fenum; 141 | GFileInfo *file_info; 142 | GFile *child; 143 | 144 | if (gtk_combo_box_get_active (GTK_COMBO_BOX (burntype_widget)) == COMBOBOX_OPTION_NEW_DVD) { 145 | fenum = g_file_enumerate_children (burn, 146 | G_FILE_ATTRIBUTE_STANDARD_NAME, 147 | G_FILE_QUERY_INFO_NONE, 148 | NULL, 149 | NULL); 150 | 151 | if (fenum != NULL) { 152 | while ((file_info = g_file_enumerator_next_file (fenum, NULL, NULL)) != NULL) { 153 | child = g_file_get_child (burn, 154 | g_file_info_get_name(file_info)); 155 | 156 | g_object_unref (file_info); 157 | g_file_delete (child, NULL, NULL); 158 | g_object_unref (child); 159 | } 160 | g_object_unref (fenum); 161 | } 162 | } 163 | 164 | copy_files_to (file_list, burn); 165 | 166 | gtk_show_uri_on_window (NULL, "burn:///", GDK_CURRENT_TIME, NULL); 167 | 168 | return TRUE; 169 | } 170 | 171 | static 172 | gboolean destroy (NstPlugin *plugin) 173 | { 174 | g_object_unref (burn); 175 | burn = NULL; 176 | return TRUE; 177 | } 178 | 179 | static 180 | NstPluginInfo plugin_info = { 181 | "brasero", 182 | "caja-burn", 183 | N_("CD/DVD Creator"), 184 | NULL, 185 | CAJA_CAPS_SEND_DIRECTORIES, 186 | init, 187 | get_contacts_widget, 188 | NULL, 189 | send_files, 190 | destroy 191 | }; 192 | 193 | NST_INIT_PLUGIN (plugin_info) 194 | -------------------------------------------------------------------------------- /sendto/plugins/emailclient/Makefile.am: -------------------------------------------------------------------------------- 1 | NULL = 2 | 3 | AM_CPPFLAGS = \ 4 | $(DISABLE_DEPRECATED_CPPFLAGS) \ 5 | -DMATELOCALEDIR=\""$(datadir)/locale"\" \ 6 | -I$(top_builddir) \ 7 | -I$(top_srcdir)/sendto \ 8 | $(NULL) 9 | 10 | AM_CFLAGS = \ 11 | $(WARN_CFLAGS) \ 12 | $(SENDTO_CFLAGS) \ 13 | $(NULL) 14 | 15 | plugindir = $(libdir)/caja-sendto/plugins 16 | 17 | plugin_LTLIBRARIES = libnstemailclient.la 18 | 19 | libnstemailclient_la_SOURCES = emailclient.c 20 | libnstemailclient_la_CPPFLAGS = \ 21 | $(AM_CPPFLAGS) \ 22 | -DDATADIR=\"$(datadir)\" \ 23 | -DICONDIR=\"$(icondir)\" \ 24 | $(NULL) 25 | libnstemailclient_la_CFLAGS = \ 26 | $(AM_CFLAGS) \ 27 | $(EMAILCLIENT_CFLAGS) \ 28 | $(NULL) 29 | libnstemailclient_la_LDFLAGS = -module -avoid-version 30 | libnstemailclient_la_LIBADD = $(SENDTO_LIBS) $(EMAILCLIENT_LIBS) 31 | 32 | -include $(top_srcdir)/git.mk 33 | -------------------------------------------------------------------------------- /sendto/plugins/emailclient/emailclient.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ 2 | 3 | /* 4 | * Copyright (C) 2004 Roberto Majadas 5 | * Copyright (C) 2012 Stefano Karapetsas 6 | * Copyright (C) 2012-2021 MATE developers. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of the 11 | * License, or (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 GNU 16 | * General Public License for more av. 17 | * 18 | * You should have received a copy of the GNU General Public 19 | * License along with this program; if not, write to the 20 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 | * Boston, MA 02110-1301 USA. 22 | * 23 | * Authors: Roberto Majadas 24 | * Stefano Karapetsas 25 | */ 26 | 27 | #ifdef HAVE_CONFIG_H 28 | #include 29 | #endif 30 | 31 | #include 32 | 33 | #include 34 | #include "caja-sendto-plugin.h" 35 | #include 36 | 37 | typedef enum { 38 | MAILER_UNKNOWN, 39 | MAILER_EVO, 40 | MAILER_BALSA, 41 | MAILER_SYLPHEED, 42 | MAILER_THUNDERBIRD, 43 | } MailerType; 44 | 45 | static char *mail_cmd = NULL; 46 | static MailerType type = MAILER_UNKNOWN; 47 | 48 | static char * 49 | get_evo_cmd (void) 50 | { 51 | char *tmp = NULL; 52 | char *retval; 53 | char *cmds[] = {"evolution", 54 | "evolution-2.0", 55 | "evolution-2.2", 56 | "evolution-2.4", 57 | "evolution-2.6", 58 | "evolution-2.8", /* for the future */ 59 | "evolution-3.0", /* but how far to go ? */ 60 | NULL}; 61 | guint i; 62 | 63 | for (i = 0; cmds[i] != NULL; i++) { 64 | tmp = g_find_program_in_path (cmds[i]); 65 | if (tmp != NULL) 66 | break; 67 | } 68 | 69 | if (tmp == NULL) 70 | return NULL; 71 | 72 | retval = g_strdup_printf ("%s --component=mail %%s", tmp); 73 | g_free (tmp); 74 | return retval; 75 | } 76 | 77 | static gboolean 78 | init (NstPlugin *plugin) 79 | { 80 | GAppInfo *app_info = NULL; 81 | 82 | g_print ("Init email client plugin\n"); 83 | 84 | #ifdef ENABLE_NLS 85 | bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR); 86 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 87 | #endif /* ENABLE_NLS */ 88 | 89 | app_info = g_app_info_get_default_for_uri_scheme ("mailto"); 90 | if (app_info) { 91 | mail_cmd = g_strdup(g_app_info_get_executable (app_info)); 92 | g_object_unref (app_info); 93 | } 94 | 95 | if (mail_cmd == NULL || *mail_cmd == '\0') { 96 | g_free (mail_cmd); 97 | mail_cmd = get_evo_cmd (); 98 | type = MAILER_EVO; 99 | } else { 100 | /* Find what the default mailer is */ 101 | if (strstr (mail_cmd, "balsa")) 102 | type = MAILER_BALSA; 103 | else if (strstr (mail_cmd, "thunder") || strstr (mail_cmd, "seamonkey")) { 104 | char **strv; 105 | 106 | type = MAILER_THUNDERBIRD; 107 | 108 | /* Thunderbird sucks, see 109 | * https://bugzilla.gnome.org/show_bug.cgi?id=614222 */ 110 | strv = g_strsplit (mail_cmd, " ", -1); 111 | g_free (mail_cmd); 112 | mail_cmd = g_strdup_printf ("%s %%s", strv[0]); 113 | g_strfreev (strv); 114 | } else if (strstr (mail_cmd, "sylpheed") || strstr (mail_cmd, "claws")) 115 | type = MAILER_SYLPHEED; 116 | else if (strstr (mail_cmd, "anjal") || strstr (mail_cmd, "evolution")) { 117 | char *mail_cmd_aux = mail_cmd; 118 | mail_cmd = g_strdup_printf ("%s %%s", mail_cmd_aux); 119 | g_free (mail_cmd_aux); 120 | type = MAILER_EVO; 121 | } 122 | } 123 | 124 | if (mail_cmd == NULL) 125 | return FALSE; 126 | 127 | return TRUE; 128 | } 129 | 130 | static 131 | GtkWidget* get_contacts_widget (NstPlugin *plugin) 132 | { 133 | GtkWidget *entry; 134 | 135 | // TODO: add an email address format check 136 | entry = gtk_entry_new(); 137 | 138 | return entry; 139 | } 140 | 141 | static void 142 | get_evo_mailto (GtkWidget *contact_widget, GString *mailto, GList *file_list) 143 | { 144 | GList *l; 145 | 146 | g_string_append (mailto, "mailto:"); 147 | 148 | const char *text; 149 | 150 | text = gtk_entry_get_text (GTK_ENTRY (contact_widget)); 151 | if (text != NULL && *text != '\0') 152 | g_string_append_printf (mailto, "\"%s\"", text); 153 | else 154 | g_string_append (mailto, "\"\""); 155 | 156 | g_string_append_printf (mailto,"?attach=\"%s\"", (char *)file_list->data); 157 | for (l = file_list->next ; l; l=l->next){ 158 | g_string_append_printf (mailto,"&attach=\"%s\"", (char *)l->data); 159 | } 160 | } 161 | 162 | static void 163 | get_balsa_mailto (GtkWidget *contact_widget, GString *mailto, GList *file_list) 164 | { 165 | GList *l; 166 | 167 | if (strstr (mail_cmd, " -m ") == NULL && strstr (mail_cmd, " --compose=") == NULL) 168 | g_string_append (mailto, " --compose="); 169 | 170 | const char *text; 171 | 172 | text = gtk_entry_get_text (GTK_ENTRY (contact_widget)); 173 | if (text != NULL && *text != '\0') 174 | g_string_append_printf (mailto, "\"%s\"", text); 175 | else 176 | g_string_append (mailto, "\"\""); 177 | 178 | g_string_append_printf (mailto," --attach=\"%s\"", (char *)file_list->data); 179 | for (l = file_list->next ; l; l=l->next){ 180 | g_string_append_printf (mailto," --attach=\"%s\"", (char *)l->data); 181 | } 182 | } 183 | 184 | static void 185 | get_thunderbird_mailto (GtkWidget *contact_widget, GString *mailto, GList *file_list) 186 | { 187 | GList *l; 188 | 189 | g_string_append (mailto, "-compose \""); 190 | 191 | const char *text; 192 | 193 | text = gtk_entry_get_text (GTK_ENTRY (contact_widget)); 194 | if (text != NULL && *text != '\0') 195 | g_string_append_printf (mailto, "to='%s',", text); 196 | 197 | g_string_append_printf (mailto,"attachment='%s", (char *)file_list->data); 198 | for (l = file_list->next ; l; l=l->next){ 199 | g_string_append_printf (mailto,",%s", (char *)l->data); 200 | } 201 | g_string_append (mailto, "'\""); 202 | } 203 | 204 | static void 205 | get_sylpheed_mailto (GtkWidget *contact_widget, GString *mailto, GList *file_list) 206 | { 207 | GList *l; 208 | 209 | g_string_append (mailto, "--compose "); 210 | 211 | const char *text; 212 | 213 | text = gtk_entry_get_text (GTK_ENTRY (contact_widget)); 214 | if (text != NULL && *text != '\0') 215 | g_string_append_printf (mailto, "\"%s\" ", text); 216 | else 217 | g_string_append (mailto, "\"\""); 218 | 219 | g_string_append_printf (mailto,"--attach \"%s\"", (char *)file_list->data); 220 | for (l = file_list->next ; l; l=l->next){ 221 | g_string_append_printf (mailto," \"%s\"", (char *)l->data); 222 | } 223 | } 224 | 225 | static gboolean 226 | send_files (NstPlugin *plugin, 227 | GtkWidget *contact_widget, 228 | GList *file_list) 229 | { 230 | gchar *cmd; 231 | GString *mailto; 232 | 233 | mailto = g_string_new (""); 234 | switch (type) { 235 | case MAILER_BALSA: 236 | get_balsa_mailto (contact_widget, mailto, file_list); 237 | break; 238 | case MAILER_SYLPHEED: 239 | get_sylpheed_mailto (contact_widget, mailto, file_list); 240 | break; 241 | case MAILER_THUNDERBIRD: 242 | get_thunderbird_mailto (contact_widget, mailto, file_list); 243 | break; 244 | case MAILER_EVO: 245 | default: 246 | get_evo_mailto (contact_widget, mailto, file_list); 247 | } 248 | 249 | cmd = g_strdup_printf (mail_cmd, mailto->str); 250 | g_string_free (mailto, TRUE); 251 | 252 | g_message ("Mailer type: %d", type); 253 | g_message ("Command: %s", cmd); 254 | 255 | g_spawn_command_line_async (cmd, NULL); 256 | g_free (cmd); 257 | 258 | return TRUE; 259 | } 260 | 261 | static 262 | gboolean destroy (NstPlugin *plugin){ 263 | g_free (mail_cmd); 264 | mail_cmd = NULL; 265 | return TRUE; 266 | } 267 | 268 | static 269 | NstPluginInfo plugin_info = { 270 | "emblem-mail", 271 | "emailclient", 272 | N_("Email"), 273 | NULL, 274 | CAJA_CAPS_NONE, 275 | init, 276 | get_contacts_widget, 277 | NULL, 278 | send_files, 279 | destroy 280 | }; 281 | 282 | NST_INIT_PLUGIN (plugin_info) 283 | -------------------------------------------------------------------------------- /sendto/plugins/gajim/Makefile.am: -------------------------------------------------------------------------------- 1 | NULL = 2 | 3 | AM_CPPFLAGS = \ 4 | $(DISABLE_DEPRECATED_CPPFLAGS) \ 5 | -DMATELOCALEDIR=\""$(datadir)/locale"\" \ 6 | -I$(top_builddir) \ 7 | -I$(top_srcdir)/sendto \ 8 | $(NULL) 9 | 10 | AM_CFLAGS = \ 11 | $(WARN_CFLAGS) \ 12 | $(SENDTO_CFLAGS) \ 13 | $(NULL) 14 | 15 | plugindir = $(libdir)/caja-sendto/plugins 16 | 17 | plugin_LTLIBRARIES = libnstgajim.la 18 | 19 | libnstgajim_la_SOURCES = gajim.c 20 | libnstgajim_la_CPPFLAGS = \ 21 | $(AM_CPPFLAGS) \ 22 | -DDATADIR=\"$(datadir)\" \ 23 | -DICONDIR=\"$(icondir)\" \ 24 | $(NULL) 25 | libnstgajim_la_CFLAGS = \ 26 | $(AM_CFLAGS) \ 27 | $(DBUS_CFLAGS) \ 28 | $(NULL) 29 | libnstgajim_la_LDFLAGS = -module -avoid-version 30 | libnstgajim_la_LIBADD = $(DBUS_LIBS) $(SENDTO_LIBS) 31 | 32 | -include $(top_srcdir)/git.mk 33 | -------------------------------------------------------------------------------- /sendto/plugins/nst-common.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or 4 | * modify it under the terms of the GNU General Public License as 5 | * published by the Free Software Foundation; either version 2 of the 6 | * License, or (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more av. 12 | * 13 | * You should have received a copy of the GNU General Public 14 | * License along with this program; if not, write to the 15 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 16 | * Boston, MA 02110-1301 USA. 17 | * 18 | * Author: Maxim Ermilov 19 | */ 20 | 21 | #include 22 | 23 | static gboolean 24 | copy_fobject (GFile* source, GFile* dst) 25 | { 26 | GFileEnumerator* en; 27 | GFileInfo* info; 28 | GError *err = NULL; 29 | char *file_name; 30 | GFile *dest; 31 | 32 | file_name = g_file_get_basename (source); 33 | dest = g_file_get_child (dst, file_name); 34 | g_free (file_name); 35 | 36 | if (g_file_query_file_type (source, G_FILE_QUERY_INFO_NONE, NULL) != G_FILE_TYPE_DIRECTORY) { 37 | gboolean ret; 38 | ret = g_file_copy (source, dest, G_FILE_COPY_NONE, NULL, NULL, NULL, NULL); 39 | 40 | g_object_unref (dest); 41 | 42 | return ret; 43 | } 44 | 45 | en = g_file_enumerate_children (source, "*", G_FILE_QUERY_INFO_NONE, NULL, NULL); 46 | if (!g_file_make_directory (dest, NULL, NULL)) { 47 | g_object_unref (en); 48 | g_object_unref (dest); 49 | return FALSE; 50 | } 51 | 52 | while ((info = g_file_enumerator_next_file (en, NULL, &err)) != NULL) { 53 | const char *name; 54 | 55 | name = g_file_info_get_name (G_FILE_INFO (info)); 56 | 57 | if (name != NULL) { 58 | GFile *child; 59 | 60 | child = g_file_get_child (source, name); 61 | 62 | if (!copy_fobject (child, dest)) { 63 | g_object_unref (en); 64 | g_object_unref (dest); 65 | g_object_unref (child); 66 | 67 | return FALSE; 68 | } 69 | g_object_unref (child); 70 | } 71 | 72 | g_object_unref (info); 73 | } 74 | g_object_unref (en); 75 | g_object_unref (dest); 76 | 77 | if (err != NULL) 78 | return FALSE; 79 | return TRUE; 80 | } 81 | 82 | gboolean 83 | copy_files_to (GList *file_list, GFile *dest) 84 | { 85 | GList *l; 86 | gboolean retval = TRUE; 87 | 88 | for (l = file_list; l != NULL; l = l->next) { 89 | GFile *source; 90 | 91 | source = g_file_new_for_commandline_arg (l->data); 92 | if (copy_fobject (source, dest) == FALSE) 93 | retval = FALSE; 94 | g_object_unref (source); 95 | } 96 | 97 | return retval; 98 | } 99 | -------------------------------------------------------------------------------- /sendto/plugins/nst-common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or 4 | * modify it under the terms of the GNU General Public License as 5 | * published by the Free Software Foundation; either version 2 of the 6 | * License, or (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more av. 12 | * 13 | * You should have received a copy of the GNU General Public 14 | * License along with this program; if not, write to the 15 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 16 | * Boston, MA 02110-1301 USA. 17 | * 18 | * Author: Maxim Ermilov 19 | */ 20 | 21 | #include 22 | 23 | gboolean copy_files_to (GList *file_list, GFile *dest); 24 | -------------------------------------------------------------------------------- /sendto/plugins/pidgin/Makefile.am: -------------------------------------------------------------------------------- 1 | NULL = 2 | 3 | AM_CPPFLAGS = \ 4 | $(DISABLE_DEPRECATED_CPPFLAGS) \ 5 | -DMATELOCALEDIR=\""$(datadir)/locale"\" \ 6 | -I$(top_builddir) \ 7 | -I$(top_srcdir)/sendto \ 8 | $(NULL) 9 | 10 | AM_CFLAGS = \ 11 | $(WARN_CFLAGS) \ 12 | $(SENDTO_CFLAGS) \ 13 | $(NULL) 14 | 15 | plugindir = $(libdir)/caja-sendto/plugins 16 | 17 | plugin_LTLIBRARIES = libnstpidgin.la 18 | 19 | libnstpidgin_la_SOURCES = pidgin.c 20 | libnstpidgin_la_CPPFLAG = \ 21 | $(AM_CFLAGS) \ 22 | -DDATADIR=\"$(datadir)\" \ 23 | -DICONDIR=\"$(icondir)\" \ 24 | $(NULL) 25 | libnstpidgin_la_CFLAGS = \ 26 | $(AM_CFLAGS) \ 27 | $(NST_EBOOK_CFLAGS) \ 28 | $(PIDGIN_CFLAGS) \ 29 | $(NULL) 30 | libnstpidgin_la_LDFLAGS = -module -avoid-version 31 | libnstpidgin_la_LIBADD = \ 32 | $(PIDGIN_LIBS) \ 33 | $(SENDTO_LIBS) \ 34 | $(NUll) 35 | 36 | -include $(top_srcdir)/git.mk 37 | -------------------------------------------------------------------------------- /sendto/plugins/removable-devices/Makefile.am: -------------------------------------------------------------------------------- 1 | NULL = 2 | 3 | AM_CPPFLAGS = \ 4 | $(DISABLE_DEPRECATED_CPPFLAGS) \ 5 | -DMATELOCALEDIR=\""$(datadir)/locale"\" \ 6 | -I$(top_builddir) \ 7 | -I$(top_srcdir)/sendto \ 8 | $(NULL) 9 | 10 | AM_CFLAGS = \ 11 | $(WARN_CFLAGS) \ 12 | $(SENDTO_CFLAGS) \ 13 | $(NULL) 14 | 15 | plugindir = $(libdir)/caja-sendto/plugins 16 | 17 | plugin_LTLIBRARIES = libnstremovable_devices.la 18 | 19 | libnstremovable_devices_la_SOURCES = removable-devices.c 20 | libnstremovable_devices_la_CPPFLAGS = \ 21 | $(AM_CPPFLAGS) \ 22 | -DDATADIR=\"$(datadir)\" \ 23 | -DICONDIR=\"$(icondir)\" \ 24 | -I$(srcdir)/../ \ 25 | $(NULL) 26 | libnstremovable_devices_la_CFLAGS = \ 27 | $(AM_CFLAGS) \ 28 | $(NULL) 29 | libnstremovable_devices_la_LDFLAGS = -module -avoid-version 30 | libnstremovable_devices_la_LIBADD = $(GIO_LIBS) $(SENDTO_LIBS) $(builddir)/../libnstcommon.la 31 | 32 | -include $(top_srcdir)/git.mk 33 | -------------------------------------------------------------------------------- /sendto/plugins/removable-devices/removable-devices.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or 4 | * modify it under the terms of the GNU General Public License as 5 | * published by the Free Software Foundation; either version 2 of the 6 | * License, or (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more av. 12 | * 13 | * You should have received a copy of the GNU General Public 14 | * License along with this program; if not, write to the 15 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 16 | * Boston, MA 02110-1301 USA. 17 | * 18 | * Authors: Maxim Ermilov 19 | * Bastien Nocera 20 | */ 21 | 22 | #ifdef HAVE_CONFIG_H 23 | #include 24 | #endif 25 | 26 | #include 27 | 28 | #include 29 | #include 30 | #include "nst-common.h" 31 | #include "caja-sendto-plugin.h" 32 | 33 | enum { 34 | NAME_COL, 35 | ICON_COL, 36 | MOUNT_COL, 37 | NUM_COLS, 38 | }; 39 | 40 | GVolumeMonitor* vol_monitor = NULL; 41 | GtkWidget *cb; 42 | 43 | static void 44 | cb_mount_removed (GVolumeMonitor *volume_monitor, 45 | GMount *mount, 46 | NstPlugin *plugin) 47 | { 48 | GtkTreeIter iter; 49 | GtkListStore *store; 50 | gboolean b, found; 51 | 52 | store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (cb))); 53 | b = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter); 54 | found = FALSE; 55 | 56 | while (b) { 57 | GMount *m; 58 | gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, MOUNT_COL, &m, -1); 59 | if (m == mount) { 60 | gtk_list_store_remove (store, &iter); 61 | g_object_unref (m); 62 | found = TRUE; 63 | break; 64 | } 65 | g_object_unref (m); 66 | b = gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter); 67 | } 68 | 69 | /* If a mount was removed */ 70 | if (found != FALSE) { 71 | /* And it was the selected one */ 72 | if (gtk_combo_box_get_active (GTK_COMBO_BOX (cb)) == -1) { 73 | /* Select the first item in the list */ 74 | gtk_combo_box_set_active (GTK_COMBO_BOX (cb), 0); 75 | } 76 | } 77 | } 78 | 79 | static void 80 | cb_mount_changed (GVolumeMonitor *volume_monitor, 81 | GMount *mount, 82 | NstPlugin *plugin) 83 | { 84 | GtkTreeIter iter; 85 | gboolean b; 86 | GtkListStore *store; 87 | 88 | if (g_mount_is_shadowed (mount) != FALSE) { 89 | cb_mount_removed (volume_monitor, mount, plugin); 90 | return; 91 | } 92 | 93 | store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (cb))); 94 | b = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter); 95 | 96 | while (b) { 97 | GMount *m; 98 | gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, MOUNT_COL, &m, -1); 99 | 100 | if (m == mount) { 101 | char *name; 102 | 103 | name = g_mount_get_name (mount); 104 | gtk_list_store_set (store, &iter, 105 | NAME_COL, name, 106 | ICON_COL, g_mount_get_icon (mount), 107 | -1); 108 | g_free (name); 109 | g_object_unref (m); 110 | break; 111 | } 112 | g_object_unref (m); 113 | b = gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter); 114 | } 115 | } 116 | 117 | static void 118 | cb_mount_added (GVolumeMonitor *volume_monitor, 119 | GMount *mount, 120 | NstPlugin *plugin) 121 | { 122 | char *name; 123 | GtkTreeIter iter; 124 | GtkTreeModel *model; 125 | gboolean select_added; 126 | 127 | if (g_mount_is_shadowed (mount) != FALSE) 128 | return; 129 | 130 | name = g_mount_get_name (mount); 131 | model = gtk_combo_box_get_model (GTK_COMBO_BOX (cb)); 132 | 133 | select_added = gtk_tree_model_iter_n_children (model, NULL) == 0; 134 | 135 | gtk_list_store_append (GTK_LIST_STORE (model), &iter); 136 | gtk_list_store_set (GTK_LIST_STORE (model), &iter, 137 | NAME_COL, name, 138 | ICON_COL, g_mount_get_icon (mount), 139 | MOUNT_COL, mount, 140 | -1); 141 | 142 | g_free (name); 143 | 144 | if (select_added != FALSE) 145 | gtk_combo_box_set_active (GTK_COMBO_BOX (cb), 0); 146 | 147 | } 148 | 149 | static gboolean 150 | init (NstPlugin *plugin) 151 | { 152 | g_print ("Init removable-devices plugin\n"); 153 | 154 | #ifdef ENABLE_NLS 155 | bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR); 156 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 157 | #endif /* ENABLE_NLS */ 158 | 159 | vol_monitor = g_volume_monitor_get (); 160 | cb = gtk_combo_box_new (); 161 | 162 | return TRUE; 163 | } 164 | 165 | static GtkWidget* 166 | get_contacts_widget (NstPlugin *plugin) 167 | { 168 | GtkListStore *store; 169 | GList *l, *mounts; 170 | GtkTreeIter iter; 171 | GtkCellRenderer *text_renderer, *icon_renderer; 172 | 173 | mounts = g_volume_monitor_get_mounts (vol_monitor); 174 | 175 | store = gtk_list_store_new (NUM_COLS, G_TYPE_STRING, G_TYPE_ICON, G_TYPE_OBJECT); 176 | 177 | for (l = mounts; l != NULL; l = l->next) { 178 | char *name; 179 | 180 | if (g_mount_is_shadowed (l->data) != FALSE) { 181 | g_object_unref (l->data); 182 | continue; 183 | } 184 | 185 | name = g_mount_get_name (l->data); 186 | 187 | gtk_list_store_append (store, &iter); 188 | gtk_list_store_set (store, &iter, 189 | NAME_COL, name, 190 | ICON_COL, g_mount_get_icon (l->data), 191 | MOUNT_COL, l->data, 192 | -1); 193 | g_free (name); 194 | 195 | g_object_unref (l->data); 196 | } 197 | g_list_free (mounts); 198 | 199 | gtk_cell_layout_clear (GTK_CELL_LAYOUT (cb)); 200 | gtk_combo_box_set_model (GTK_COMBO_BOX (cb), GTK_TREE_MODEL (store)); 201 | 202 | text_renderer = gtk_cell_renderer_text_new (); 203 | icon_renderer = gtk_cell_renderer_pixbuf_new (); 204 | gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (cb), icon_renderer, FALSE); 205 | gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (cb), text_renderer, TRUE); 206 | 207 | gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (cb), text_renderer, "text", 0, NULL); 208 | gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (cb), icon_renderer, "gicon", 1, NULL); 209 | gtk_combo_box_set_active (GTK_COMBO_BOX (cb), 0); 210 | 211 | g_signal_connect (G_OBJECT (vol_monitor), "mount-removed", G_CALLBACK (cb_mount_removed), plugin); 212 | g_signal_connect (G_OBJECT (vol_monitor), "mount-added", G_CALLBACK (cb_mount_added), plugin); 213 | g_signal_connect (G_OBJECT (vol_monitor), "mount-changed", G_CALLBACK (cb_mount_changed), plugin); 214 | 215 | return cb; 216 | } 217 | 218 | static gboolean 219 | send_files (NstPlugin *plugin, GtkWidget *contact_widget, 220 | GList *file_list) 221 | { 222 | GtkListStore *store; 223 | GtkTreeIter iter; 224 | GMount *dest_mount; 225 | GFile *mount_root; 226 | 227 | if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (contact_widget), &iter) == FALSE) 228 | return TRUE; 229 | 230 | store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (cb))); 231 | gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, MOUNT_COL, &dest_mount, -1); 232 | mount_root = g_mount_get_root (dest_mount); 233 | 234 | copy_files_to (file_list, mount_root); 235 | 236 | g_object_unref (mount_root); 237 | 238 | return TRUE; 239 | } 240 | 241 | static gboolean 242 | destroy (NstPlugin *plugin) 243 | { 244 | gtk_widget_destroy (cb); 245 | 246 | g_object_unref (vol_monitor); 247 | return TRUE; 248 | } 249 | 250 | static 251 | NstPluginInfo plugin_info = { 252 | "folder-remote", 253 | "folder-remote", 254 | N_("Removable disks and shares"), 255 | NULL, 256 | CAJA_CAPS_SEND_DIRECTORIES, 257 | init, 258 | get_contacts_widget, 259 | NULL, 260 | send_files, 261 | destroy 262 | }; 263 | 264 | NST_INIT_PLUGIN (plugin_info) 265 | -------------------------------------------------------------------------------- /sendto/plugins/upnp/Makefile.am: -------------------------------------------------------------------------------- 1 | NULL = 2 | 3 | AM_CPPFLAGS = \ 4 | $(DISABLE_DEPRECATED_CPPFLAGS) \ 5 | -DMATELOCALEDIR=\""$(datadir)/locale"\" \ 6 | -I$(top_builddir) \ 7 | -I$(top_srcdir)/sendto \ 8 | $(NULL) 9 | 10 | AM_CFLAGS = \ 11 | $(WARN_CFLAGS) \ 12 | $(SENDTO_CFLAGS) \ 13 | $(NULL) 14 | 15 | plugindir = $(libdir)/caja-sendto/plugins 16 | 17 | plugin_LTLIBRARIES = libnstupnp.la 18 | 19 | libnstupnp_la_SOURCES = upnp.c 20 | libnstupnp_la_CPPFLAGS = \ 21 | $(AM_CPPFLAGS) \ 22 | -DDATADIR=\"$(datadir)\" \ 23 | -DICONDIR=\"$(icondir)\" \ 24 | $(NULL) 25 | libnstupnp_la_CFLAGS = \ 26 | $(AM_CFLAGS) \ 27 | $(UPNP_CFLAGS) \ 28 | $(NULL) 29 | libnstupnp_la_LDFLAGS = -module -avoid-version 30 | libnstupnp_la_LIBADD = $(UPNP_LIBS) $(SENDTO_LIBS) 31 | 32 | -include $(top_srcdir)/git.mk 33 | -------------------------------------------------------------------------------- /sendto/plugins/upnp/upnp.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ 2 | 3 | /* 4 | * Copyright (C) 2008 Zeeshan Ali (Khattak) 5 | * Copyright (C) 2006 Peter Enseleit 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU 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 | * 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 GNU 15 | * General Public License for more av. 16 | * 17 | * You should have received a copy of the GNU General Public 18 | * License along with this program; if not, write to the 19 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA. 21 | * 22 | * Author: Zeeshan Ali (Khattak) 23 | * Peter Enseleit 24 | * Roberto Majadas 25 | * 26 | */ 27 | 28 | #ifdef HAVE_CONFIG_H 29 | #include 30 | #endif 31 | 32 | #include 33 | 34 | #include 35 | #include "caja-sendto-plugin.h" 36 | 37 | #define MEDIA_SERVER "urn:schemas-upnp-org:device:MediaServer:1" 38 | #define CDS "urn:schemas-upnp-org:service:ContentDirectory" 39 | 40 | enum { 41 | UDN_COL, 42 | NAME_COL, 43 | INTERFACE_COL, 44 | NUM_COLS 45 | }; 46 | 47 | static GtkWidget *combobox; 48 | static GtkTreeModel *model; 49 | static GUPnPContextManager *context_manager; 50 | 51 | static gboolean 52 | find_device (const gchar *udn, 53 | GtkTreeIter *iter) 54 | { 55 | gboolean found = FALSE; 56 | 57 | if (!gtk_tree_model_get_iter_first (model, iter)) 58 | return FALSE; 59 | 60 | do { 61 | gchar *tmp; 62 | 63 | gtk_tree_model_get (model, 64 | iter, 65 | UDN_COL, &tmp, 66 | -1); 67 | 68 | if (tmp != NULL && strcmp (tmp, udn) == 0) 69 | found = TRUE; 70 | 71 | g_free (tmp); 72 | } while (!found && gtk_tree_model_iter_next (model, iter)); 73 | 74 | return found; 75 | } 76 | 77 | static gboolean 78 | check_required_actions (GUPnPServiceIntrospection *introspection) 79 | { 80 | if (gupnp_service_introspection_get_action (introspection, 81 | "CreateObject") == NULL) 82 | return FALSE; 83 | if (gupnp_service_introspection_get_action (introspection, 84 | "ImportResource") == NULL) 85 | return FALSE; 86 | return TRUE; 87 | } 88 | 89 | static void 90 | get_introspection_cb (GObject *source_object, 91 | GAsyncResult *res, 92 | gpointer user_data) 93 | { 94 | GUPnPDeviceInfo *device_info; 95 | gchar *name; 96 | const gchar *udn, *interface; 97 | GtkTreeIter iter; 98 | GUPnPContext *context; 99 | GError *error = NULL; 100 | 101 | device_info = GUPNP_DEVICE_INFO (user_data); 102 | 103 | GUPnPServiceIntrospection *introspection = 104 | gupnp_service_info_introspect_finish (GUPNP_SERVICE_INFO (GUPNP_SERVICE_INFO (source_object)), 105 | res, 106 | &error); 107 | if (error) { 108 | g_warning ("Failed to create introspection for '%s': %s", 109 | gupnp_service_info_get_udn (GUPNP_SERVICE_INFO (source_object)), 110 | error->message); 111 | g_clear_error (&error); 112 | goto error; 113 | } 114 | 115 | /* If introspection is available, make sure required actions 116 | * are implemented. 117 | */ 118 | if (!check_required_actions (introspection)) { 119 | goto error; 120 | } 121 | 122 | udn = gupnp_device_info_get_udn (device_info); 123 | if (G_UNLIKELY (udn == NULL)) 124 | goto error; 125 | 126 | /* First check if the device is already added */ 127 | if (find_device (udn, &iter)) 128 | goto error; 129 | 130 | name = gupnp_device_info_get_friendly_name (device_info); 131 | if (name == NULL) 132 | name = g_strdup (udn); 133 | 134 | context = gupnp_device_info_get_context (device_info); 135 | interface = gssdp_client_get_interface (GSSDP_CLIENT (context)); 136 | 137 | gtk_list_store_insert_with_values (GTK_LIST_STORE (model), NULL, -1, 138 | UDN_COL, udn, 139 | NAME_COL, name, 140 | INTERFACE_COL, interface, 141 | -1); 142 | 143 | g_free (name); 144 | g_object_unref (introspection); 145 | error: 146 | g_object_ref (device_info); 147 | } 148 | 149 | static void 150 | device_proxy_available_cb (GUPnPControlPoint *cp, 151 | GUPnPDeviceProxy *proxy) 152 | { 153 | GUPnPServiceInfo *info; 154 | 155 | info = gupnp_device_info_get_service (GUPNP_DEVICE_INFO (proxy), CDS); 156 | if (G_UNLIKELY (info == NULL)) { 157 | /* No ContentDirectory implemented? Not interesting. */ 158 | return; 159 | } 160 | 161 | gupnp_service_info_introspect_async (info, 162 | NULL, 163 | get_introspection_cb, 164 | g_object_ref (proxy)); 165 | } 166 | 167 | static void 168 | device_proxy_unavailable_cb (GUPnPControlPoint *cp, 169 | GUPnPDeviceProxy *proxy) 170 | { 171 | GtkTreeIter iter; 172 | const gchar *udn; 173 | 174 | udn = gupnp_device_info_get_udn (GUPNP_DEVICE_INFO (proxy)); 175 | if (udn == NULL) 176 | return; 177 | 178 | /* First check if the device is already added */ 179 | if (find_device (udn, &iter)) 180 | gtk_list_store_remove (GTK_LIST_STORE (model), &iter); 181 | } 182 | 183 | static void 184 | on_context_available (GUPnPContextManager *manager, 185 | GUPnPContext *context, 186 | gpointer user_data) 187 | { 188 | GUPnPControlPoint *cp; 189 | 190 | cp = gupnp_control_point_new (context, MEDIA_SERVER); 191 | 192 | g_signal_connect (cp, 193 | "device-proxy-available", 194 | G_CALLBACK (device_proxy_available_cb), 195 | NULL); 196 | g_signal_connect (cp, 197 | "device-proxy-unavailable", 198 | G_CALLBACK (device_proxy_unavailable_cb), 199 | NULL); 200 | 201 | gssdp_resource_browser_set_active (GSSDP_RESOURCE_BROWSER (cp), TRUE); 202 | 203 | /* Let context manager take care of the control point life cycle */ 204 | gupnp_context_manager_manage_control_point (manager, cp); 205 | g_object_unref (cp); 206 | } 207 | 208 | static gboolean 209 | init (NstPlugin *plugin) 210 | { 211 | GtkListStore *store; 212 | GtkCellRenderer *renderer; 213 | char *upload_cmd; 214 | 215 | #ifdef ENABLE_NLS 216 | bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR); 217 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 218 | #endif /* ENABLE_NLS */ 219 | 220 | upload_cmd = g_find_program_in_path ("gupnp-upload"); 221 | if (upload_cmd == NULL) 222 | return FALSE; 223 | g_free (upload_cmd); 224 | 225 | context_manager = gupnp_context_manager_create (0); 226 | g_assert (context_manager != NULL); 227 | g_signal_connect (context_manager, "context-available", 228 | G_CALLBACK (on_context_available), NULL); 229 | 230 | combobox = gtk_combo_box_new (); 231 | 232 | store = gtk_list_store_new (NUM_COLS, 233 | G_TYPE_STRING, /* UDN */ 234 | G_TYPE_STRING, /* Name */ 235 | G_TYPE_STRING); /* Network Interface */ 236 | model = GTK_TREE_MODEL (store); 237 | gtk_combo_box_set_model (GTK_COMBO_BOX (combobox), model); 238 | 239 | renderer = gtk_cell_renderer_text_new (); 240 | 241 | gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combobox), 242 | renderer, 243 | TRUE); 244 | gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (combobox), 245 | renderer, 246 | "text", NAME_COL); 247 | 248 | return TRUE; 249 | } 250 | 251 | static GtkWidget* 252 | get_contacts_widget (NstPlugin *plugin) 253 | { 254 | return combobox; 255 | } 256 | 257 | static gboolean 258 | send_files (NstPlugin *plugin, 259 | GtkWidget *contact_widget, 260 | GList *file_list) 261 | { 262 | gchar *upload_cmd, *udn, *interface; 263 | GPtrArray *argv; 264 | gboolean ret; 265 | GList *l; 266 | GtkTreeIter iter; 267 | GError *err = NULL; 268 | 269 | if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combobox), &iter)) 270 | return FALSE; 271 | 272 | gtk_tree_model_get (model, &iter, UDN_COL, &udn, INTERFACE_COL, 273 | &interface, -1); 274 | 275 | upload_cmd = g_find_program_in_path ("gupnp-upload"); 276 | if (upload_cmd == NULL) 277 | return FALSE; 278 | 279 | argv = g_ptr_array_new (); 280 | g_ptr_array_add (argv, upload_cmd); 281 | g_ptr_array_add (argv, "-t"); 282 | g_ptr_array_add (argv, "15"); /* discovery timeout (seconds) */ 283 | g_ptr_array_add (argv, "-e"); 284 | g_ptr_array_add (argv, interface); 285 | g_ptr_array_add (argv, "-u"); 286 | g_ptr_array_add (argv, udn); 287 | for (l = file_list ; l; l=l->next) { 288 | gchar *file_path; 289 | 290 | file_path = g_filename_from_uri (l->data, NULL, NULL); 291 | g_ptr_array_add (argv, file_path); 292 | } 293 | g_ptr_array_add (argv, NULL); 294 | 295 | ret = g_spawn_async (NULL, (gchar **) argv->pdata, 296 | NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &err); 297 | 298 | if (ret == FALSE) { 299 | g_warning ("Could not send files to MediaServer: %s", 300 | err->message); 301 | g_error_free (err); 302 | } 303 | 304 | g_ptr_array_free (argv, TRUE); 305 | g_free (upload_cmd); 306 | g_free (udn); 307 | 308 | return ret; 309 | } 310 | 311 | static gboolean 312 | destroy (NstPlugin *plugin) 313 | { 314 | gtk_widget_destroy (combobox); 315 | g_object_unref (model); 316 | 317 | g_object_unref (context_manager); 318 | 319 | return TRUE; 320 | } 321 | 322 | static 323 | NstPluginInfo plugin_info = { 324 | "folder-remote", 325 | "upnp", 326 | N_("UPnP Media Server"), 327 | NULL, 328 | CAJA_CAPS_NONE, 329 | init, 330 | get_contacts_widget, 331 | NULL, 332 | send_files, 333 | destroy 334 | }; 335 | 336 | NST_INIT_PLUGIN (plugin_info) 337 | 338 | -------------------------------------------------------------------------------- /share/Makefile.am: -------------------------------------------------------------------------------- 1 | NULL = 2 | 3 | interfacesdir = $(datadir)/caja-extensions 4 | interfaces_DATA = share-dialog.ui 5 | 6 | AM_CPPFLAGS = \ 7 | $(DISABLE_DEPRECATED_CPPFLAGS) \ 8 | -DMATELOCALEDIR=\""$(datadir)/locale"\" \ 9 | -I$(top_builddir) \ 10 | $(NULL) 11 | 12 | AM_CFLAGS = \ 13 | $(WARN_CFLAGS) \ 14 | $(NULL) 15 | 16 | caja_extensiondir = $(CAJA_EXTENSION_DIR) 17 | 18 | caja_extension_LTLIBRARIES = libcaja-share.la 19 | 20 | libcaja_share_la_SOURCES = \ 21 | caja-share.c \ 22 | caja-share.h \ 23 | shares.c \ 24 | shares.h \ 25 | $(NULL) 26 | libcaja_share_la_CPPFLAGS = \ 27 | $(AM_CPPFLAGS) \ 28 | -DG_LOG_DOMAIN=\"Caja-Share\" \ 29 | -DINTERFACES_DIR=\"$(interfacesdir)\" \ 30 | -DDATADIR=\"$(datadir)\" \ 31 | $(NULL) 32 | libcaja_share_la_CFLAGS = \ 33 | $(AM_CFLAGS) \ 34 | $(CAJA_CFLAGS) \ 35 | $(SHARE_CFLAGS) \ 36 | $(NULL) 37 | libcaja_share_la_LDFLAGS = -module -avoid-version 38 | libcaja_share_la_LIBADD = $(SHARE_LIBS) $(CAJA_LIBS) 39 | 40 | extensiondir = $(datadir)/caja/extensions 41 | extension_in_files = libcaja-share.caja-extension.desktop.in 42 | extension_DATA = $(extension_in_files:.caja-extension.desktop.in=.caja-extension) 43 | $(extension_DATA): $(extension_in_files) 44 | if USE_NLS 45 | $(AM_V_GEN) $(MSGFMT) --desktop --keyword= --keyword=Copyright --keyword=Name --keyword=Description --template $< -d $(top_srcdir)/po -o $@ 46 | else 47 | $(AM_V_GEN) cp $< $@ 48 | endif 49 | 50 | EXTRA_DIST = share-dialog.ui 51 | 52 | CLEANFILES = $(extension_DATA) 53 | 54 | -include $(top_srcdir)/git.mk 55 | -------------------------------------------------------------------------------- /share/caja-share.h: -------------------------------------------------------------------------------- 1 | /* caja-share -- Caja File Sharing Extension 2 | * 3 | * Sebastien Estienne 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | * (C) Copyright 2005 Ethium, Inc. 20 | */ 21 | 22 | #ifndef CAJA_SHARE_H 23 | #define CAJA_SHARE_H 24 | 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | /* Declarations for the Share extension object. This object will be 30 | * instantiated by caja. It implements the GInterfaces 31 | * exported by libcaja. */ 32 | 33 | typedef struct _CajaShare CajaShare; 34 | typedef struct _CajaShareClass CajaShareClass; 35 | 36 | struct _CajaShare { 37 | GObject parent_slot; 38 | }; 39 | 40 | struct _CajaShareClass { 41 | GObjectClass parent_slot; 42 | 43 | /* No extra class members */ 44 | }; 45 | 46 | typedef struct _CajaShareData CajaShareData; 47 | 48 | struct _CajaShareData { 49 | gchar *fullpath; 50 | gchar *section; 51 | CajaFileInfo *fileinfo; 52 | }; 53 | 54 | G_END_DECLS 55 | 56 | typedef enum { 57 | CAJA_SHARE_NOT_SHARED, 58 | CAJA_SHARE_SHARED_RO, 59 | CAJA_SHARE_SHARED_RW 60 | } CajaShareStatus; 61 | 62 | #endif 63 | 64 | -------------------------------------------------------------------------------- /share/libcaja-share.caja-extension.desktop.in.in: -------------------------------------------------------------------------------- 1 | [Caja Extension] 2 | # Translators: Do NOT translate or transliterate this text (this is an icon file name)! 3 | Icon=folder-remote 4 | Name=Share 5 | Description=Allows to quickly share a folder 6 | Author=Sebastien Estienne 7 | Copyright=Copyright (C) 2005 Ethium, Inc.\nCopyright (C) 2013-2014 Stefano Karapetsas\nCopyright (C) 2015-2021 MATE developers 8 | Version=@VERSION@ 9 | Website=@PACKAGE_URL@ 10 | -------------------------------------------------------------------------------- /share/shares.h: -------------------------------------------------------------------------------- 1 | #ifndef SHARES_H 2 | #define SHARES_H 3 | 4 | #include 5 | 6 | typedef struct { 7 | char *path; 8 | char *share_name; 9 | char *comment; 10 | gboolean is_writable; 11 | gboolean guest_ok; 12 | } ShareInfo; 13 | 14 | #define SHARES_ERROR (shares_error_quark ()) 15 | 16 | typedef enum { 17 | SHARES_ERROR_FAILED, 18 | SHARES_ERROR_NONEXISTENT 19 | } SharesError; 20 | 21 | GQuark shares_error_quark (void); 22 | 23 | void shares_free_share_info (ShareInfo *info); 24 | 25 | gboolean shares_get_path_is_shared (const char *path, gboolean *ret_is_shared, GError **error); 26 | 27 | gboolean shares_get_share_info_for_path (const char *path, ShareInfo **ret_share_info, GError **error); 28 | 29 | gboolean shares_get_share_name_exists (const char *share_name, gboolean *ret_exists, GError **error); 30 | 31 | gboolean shares_get_share_info_for_share_name (const char *share_name, ShareInfo **ret_share_info, GError **error); 32 | 33 | gboolean shares_modify_share (const char *old_path, ShareInfo *info, GError **error); 34 | 35 | gboolean shares_get_share_info_list (GSList **ret_info_list, GError **error); 36 | 37 | void shares_free_share_info_list (GSList *list); 38 | 39 | gboolean shares_supports_guest_ok (gboolean *supports_guest_ok_ret, 40 | GError **error); 41 | 42 | void shares_set_debug (gboolean error_on_refresh, 43 | gboolean error_on_add, 44 | gboolean error_on_modify, 45 | gboolean error_on_remove); 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /wallpaper/Makefile.am: -------------------------------------------------------------------------------- 1 | NULL = 2 | 3 | AM_CPPFLAGS = \ 4 | $(DISABLE_DEPRECATED_CPPFLAGS) \ 5 | -DMATELOCALEDIR=\""$(datadir)/locale"\" \ 6 | -I$(top_builddir) \ 7 | $(NULL) 8 | 9 | AM_CFLAGS = \ 10 | $(WARN_CFLAGS) \ 11 | $(NULL) 12 | 13 | caja_extensiondir = $(CAJA_EXTENSION_DIR) 14 | 15 | caja_extension_LTLIBRARIES = libcaja-wallpaper.la 16 | 17 | libcaja_wallpaper_la_SOURCES = \ 18 | caja-wallpaper-extension.c \ 19 | caja-wallpaper-extension.h \ 20 | caja-wallpaper-command.c \ 21 | $(NULL) 22 | libcaja_wallpaper_la_CPPFLAGS = \ 23 | $(AM_CPPFLAGS) \ 24 | $(NULL) 25 | libcaja_wallpaper_la_CFLAGS = \ 26 | $(AM_CFLAGS) \ 27 | $(CAJA_CFLAGS) \ 28 | $(NULL) 29 | libcaja_wallpaper_la_LDFLAGS = -module -avoid-version 30 | libcaja_wallpaper_la_LIBADD = $(CAJA_LIBS) 31 | 32 | extensiondir = $(datadir)/caja/extensions 33 | extension_in_files = libcaja-wallpaper.caja-extension.desktop.in 34 | extension_DATA = $(extension_in_files:.caja-extension.desktop.in=.caja-extension) 35 | $(extension_DATA): $(extension_in_files) 36 | if USE_NLS 37 | $(AM_V_GEN) $(MSGFMT) --desktop --keyword= --keyword=Copyright --keyword=Name --keyword=Description --template $< -d $(top_srcdir)/po -o $@ 38 | else 39 | $(AM_V_GEN) cp $< $@ 40 | endif 41 | 42 | CLEANFILES = $(extension_DATA) 43 | 44 | -include $(top_srcdir)/git.mk 45 | -------------------------------------------------------------------------------- /wallpaper/caja-wallpaper-command.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Caja Wallpaper extension 3 | * 4 | * Copyright (C) 2005 Adam Israel 5 | * Copyright (C) 2014 Stefano Karapetsas 6 | * Copyright (C) 2014-2021 MATE developers. 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 Street, Fifth Floor, Boston, MA 02110-1301, USA. 21 | * 22 | * Authors: Adam Israel 23 | * Stefano Karapetsas 24 | */ 25 | 26 | #ifdef HAVE_CONFIG_H 27 | #include 28 | #endif 29 | 30 | #include 31 | 32 | #include 33 | #include 34 | 35 | #include "caja-wallpaper-extension.h" 36 | 37 | void 38 | caja_module_initialize (GTypeModule*module) 39 | { 40 | g_print ("Initializing caja-wallpaper extension\n"); 41 | caja_cwe_register_type (module); 42 | #ifdef ENABLE_NLS 43 | bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR); 44 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 45 | #endif /* ENABLE_NLS */ 46 | } 47 | 48 | void 49 | caja_module_shutdown (void) 50 | { 51 | g_print ("Shutting down caja-wallpaper extension\n"); 52 | } 53 | 54 | void 55 | caja_module_list_types (const GType **types, int *num_types) 56 | { 57 | static GType type_list[1]; 58 | 59 | type_list[0] = CAJA_TYPE_CWE; 60 | *types = type_list; 61 | *num_types = 1; 62 | } 63 | -------------------------------------------------------------------------------- /wallpaper/caja-wallpaper-extension.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Caja Wallpaper extension 3 | * 4 | * Copyright (C) 2005 Adam Israel 5 | * Copyright (C) 2014 Stefano Karapetsas 6 | * Copyright (C) 2014-2021 MATE developers. 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 Street, Fifth Floor, Boston, MA 02110-1301, USA. 21 | * 22 | * Authors: Adam Israel 23 | * Stefano Karapetsas 24 | */ 25 | 26 | #ifdef HAVE_CONFIG_H 27 | #include 28 | #endif 29 | 30 | #include 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include "caja-wallpaper-extension.h" 38 | 39 | #define WP_SCHEMA "org.mate.background" 40 | #define WP_FILE_KEY "picture-filename" 41 | 42 | static GObjectClass *parent_class; 43 | 44 | static void 45 | set_wallpaper_callback (CajaMenuItem *item, 46 | gpointer user_data) 47 | { 48 | GList *files; 49 | GSettings *settings; 50 | CajaFileInfo *file; 51 | gchar *uri; 52 | gchar *filename; 53 | 54 | files = g_object_get_data (G_OBJECT (item), "files"); 55 | file = files->data; 56 | 57 | uri = caja_file_info_get_uri (file); 58 | filename = g_filename_from_uri(uri, NULL, NULL); 59 | 60 | settings = g_settings_new (WP_SCHEMA); 61 | 62 | g_settings_set_string (settings, WP_FILE_KEY, filename); 63 | 64 | g_object_unref (settings); 65 | g_free (filename); 66 | g_free (uri); 67 | 68 | } 69 | 70 | static gboolean 71 | is_image (CajaFileInfo *file) 72 | { 73 | gchar *mimeType; 74 | gboolean isImage; 75 | 76 | mimeType = caja_file_info_get_mime_type (file); 77 | isImage = g_str_has_prefix (mimeType, "image/"); 78 | g_free (mimeType); 79 | return isImage; 80 | } 81 | 82 | static GList * 83 | caja_cwe_get_file_items (CajaMenuProvider *provider, 84 | GtkWidget *window, 85 | GList *files) 86 | { 87 | GList *items = NULL; 88 | GList *scan; 89 | gboolean one_item; 90 | CajaMenuItem *item; 91 | 92 | for (scan = files; scan; scan = scan->next) { 93 | CajaFileInfo *file = scan->data; 94 | gchar *scheme; 95 | gboolean local; 96 | 97 | scheme = caja_file_info_get_uri_scheme (file); 98 | local = strncmp (scheme, "file", 4) == 0; 99 | g_free (scheme); 100 | 101 | if (!local) 102 | return NULL; 103 | } 104 | 105 | one_item = (files != NULL) && (files->next == NULL); 106 | if (one_item && is_image ((CajaFileInfo *)files->data) && 107 | !caja_file_info_is_directory ((CajaFileInfo *)files->data)) { 108 | item = caja_menu_item_new ("CajaCwe::sendto", 109 | _("Set as wallpaper"), 110 | _("Set image as the current wallpaper"), 111 | NULL); 112 | g_signal_connect (item, 113 | "activate", 114 | G_CALLBACK (set_wallpaper_callback), 115 | provider); 116 | g_object_set_data_full (G_OBJECT (item), 117 | "files", 118 | caja_file_info_list_copy (files), 119 | (GDestroyNotify) caja_file_info_list_free); 120 | items = g_list_append (items, item); 121 | } 122 | return items; 123 | } 124 | 125 | static void 126 | caja_cwe_menu_provider_iface_init (CajaMenuProviderIface *iface) 127 | { 128 | iface->get_file_items = caja_cwe_get_file_items; 129 | } 130 | 131 | static void 132 | caja_cwe_instance_init (CajaCwe *cwe) 133 | { 134 | } 135 | 136 | static void 137 | caja_cwe_class_init (CajaCweClass *class) 138 | { 139 | parent_class = g_type_class_peek_parent (class); 140 | } 141 | 142 | static GType cwe_type = 0; 143 | 144 | GType 145 | caja_cwe_get_type (void) 146 | { 147 | return cwe_type; 148 | } 149 | 150 | void 151 | caja_cwe_register_type (GTypeModule *module) 152 | { 153 | static const GTypeInfo info = { 154 | sizeof (CajaCweClass), 155 | (GBaseInitFunc) NULL, 156 | (GBaseFinalizeFunc) NULL, 157 | (GClassInitFunc) caja_cwe_class_init, 158 | NULL, 159 | NULL, 160 | sizeof (CajaCwe), 161 | 0, 162 | (GInstanceInitFunc) caja_cwe_instance_init, 163 | NULL 164 | }; 165 | 166 | static const GInterfaceInfo menu_provider_iface_info = { 167 | (GInterfaceInitFunc) caja_cwe_menu_provider_iface_init, 168 | NULL, 169 | NULL 170 | }; 171 | 172 | cwe_type = g_type_module_register_type (module, 173 | G_TYPE_OBJECT, 174 | "CajaCwe", 175 | &info, 0); 176 | 177 | g_type_module_add_interface (module, 178 | cwe_type, 179 | CAJA_TYPE_MENU_PROVIDER, 180 | &menu_provider_iface_info); 181 | } 182 | -------------------------------------------------------------------------------- /wallpaper/caja-wallpaper-extension.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Caja Wallpaper extension 3 | * 4 | * Copyright (C) 2005 Adam Israel 5 | * Copyright (C) 2014 Stefano Karapetsas 6 | * Copyright (C) 2014-2021 MATE developers. 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 Street, Fifth Floor, Boston, MA 02110-1301, USA. 21 | * 22 | * Authors: Adam Israel 23 | * Stefano Karapetsas 24 | */ 25 | 26 | #ifndef CAJA_WALLPAPER_EXTENSION_H 27 | #define CAJA_WALLPAPER_EXTENSION_H 28 | 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | #define CAJA_TYPE_CWE (caja_cwe_get_type ()) 34 | #define CAJA_CWE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CAJA_TYPE_CWE, CajaCwe)) 35 | #define CAJA_IS_CWE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CAJA_TYPE_CWE)) 36 | 37 | typedef struct _CajaCwe CajaCwe; 38 | typedef struct _CajaCweClass CajaCweClass; 39 | 40 | struct _CajaCwe { 41 | GObject __parent; 42 | }; 43 | 44 | struct _CajaCweClass { 45 | GObjectClass __parent; 46 | }; 47 | 48 | GType caja_cwe_get_type (void); 49 | void caja_cwe_register_type (GTypeModule *module); 50 | 51 | G_END_DECLS 52 | 53 | #endif /* CAJA_WALLPAPER_EXTENSION_H */ 54 | -------------------------------------------------------------------------------- /wallpaper/libcaja-wallpaper.caja-extension.desktop.in.in: -------------------------------------------------------------------------------- 1 | [Caja Extension] 2 | # Translators: Do NOT translate or transliterate this text (this is an icon file name)! 3 | Icon=desktop 4 | Name=Wallpaper 5 | Description=Allows to quickly set wallpaper 6 | Author=Stefano Karapetsas;Adam Israel 7 | Copyright=Copyright (C) 2014 Stefano Karapetsas\nCopyright (C) 2015-2021 MATE developers 8 | Version=@VERSION@ 9 | Website=@PACKAGE_URL@ 10 | -------------------------------------------------------------------------------- /xattr-tags/Makefile.am: -------------------------------------------------------------------------------- 1 | NULL = 2 | 3 | AM_CPPFLAGS = \ 4 | $(DISABLE_DEPRECATED_CPPFLAGS) \ 5 | -DMATELOCALEDIR=\""$(datadir)/locale"\" \ 6 | -I$(top_builddir) \ 7 | $(NULL) 8 | 9 | AM_CFLAGS = \ 10 | $(WARN_CFLAGS) \ 11 | $(NULL) 12 | 13 | caja_extensiondir = $(CAJA_EXTENSION_DIR) 14 | 15 | caja_extension_LTLIBRARIES = libcaja-xattr-tags.la 16 | 17 | libcaja_xattr_tags_la_SOURCES = \ 18 | caja-xattr-tags-extension.c \ 19 | caja-xattr-tags-extension.h \ 20 | $(NULL) 21 | libcaja_xattr_tags_la_CPPFLAGS = \ 22 | $(AM_CPPFLAGS) \ 23 | -I$(top_srcdir) \ 24 | $(NULL) 25 | libcaja_xattr_tags_la_CFLAGS = \ 26 | $(AM_CFLAGS) \ 27 | $(CAJA_CFLAGS) \ 28 | $(NULL) 29 | 30 | libcaja_xattr_tags_la_LDFLAGS = -module -avoid-version 31 | libcaja_xattr_tags_la_LIBADD = $(CAJA_LIBS) 32 | 33 | extensiondir = $(datadir)/caja/extensions 34 | extension_in_files = libcaja-xattr-tags.caja-extension.desktop.in 35 | extension_DATA = $(extension_in_files:.caja-extension.desktop.in=.caja-extension) 36 | $(extension_DATA): $(extension_in_files) 37 | if USE_NLS 38 | $(AM_V_GEN) $(MSGFMT) --desktop --keyword= --keyword=Copyright --keyword=Name --keyword=Description --template $< -d $(top_srcdir)/po -o $@ 39 | else 40 | $(AM_V_GEN) cp $< $@ 41 | endif 42 | 43 | CLEANFILES = $(extension_DATA) 44 | 45 | -include $(top_srcdir)/git.mk 46 | -------------------------------------------------------------------------------- /xattr-tags/caja-xattr-tags-extension.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Caja xattr tags extension 3 | * 4 | * Copyright (C) 2016 Felipe Barriga Richards 5 | * Copyright (C) 2016-2021 MATE developers. 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 | * Authors: Felipe Barriga Richards 22 | */ 23 | 24 | #ifdef HAVE_CONFIG_H 25 | #include 26 | #endif 27 | 28 | #include 29 | 30 | #include 31 | #include 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | #include "caja-xattr-tags-extension.h" 38 | 39 | #define XATTR_TAGS_NAME "Xattr::Tags" 40 | #define XATTR_TAGS_ATTRIBUTE "xattr_tags" 41 | 42 | #define G_FILE_ATTRIBUTE_XATTR_XDG_TAGS "xattr::xdg.tags" 43 | 44 | static GObjectClass *parent_class; 45 | 46 | typedef struct { 47 | gboolean cancelled; 48 | CajaInfoProvider *provider; 49 | CajaFileInfo *file; 50 | GClosure *update_complete; 51 | } CajaXattrTagsHandle; 52 | 53 | /* List of protocols that don't support xattr retriving, 54 | * so we can skip it safetely 55 | */ 56 | static gchar *protocols_blacklist[] = { 57 | "mtp://", 58 | "gphoto2://", 59 | 60 | NULL 61 | }; 62 | 63 | /* Stolen code: why they didn't expose it!? 64 | * file: glocalfileinfo.c 65 | * function: hex_unescape_string 66 | * GIO - GLib Input, Output and Streaming Library 67 | */ 68 | static char * 69 | hex_unescape_string (const char *str, 70 | int *out_len, 71 | gboolean *free_return) 72 | { 73 | int i; 74 | char *unescaped_str, *p; 75 | unsigned char c; 76 | int len; 77 | 78 | len = strlen (str); 79 | 80 | if (strchr (str, '\\') == NULL) 81 | { 82 | if (out_len) 83 | *out_len = len; 84 | *free_return = FALSE; 85 | return (char *)str; 86 | } 87 | 88 | unescaped_str = g_malloc (len + 1); 89 | 90 | p = unescaped_str; 91 | for (i = 0; i < len; i++) 92 | { 93 | if (str[i] == '\\' && 94 | str[i+1] == 'x' && 95 | len - i >= 4) 96 | { 97 | c = 98 | (g_ascii_xdigit_value (str[i+2]) << 4) | 99 | g_ascii_xdigit_value (str[i+3]); 100 | *p++ = c; 101 | i += 3; 102 | } 103 | else 104 | *p++ = str[i]; 105 | } 106 | *p++ = 0; 107 | 108 | if (out_len) 109 | *out_len = p - unescaped_str; 110 | *free_return = TRUE; 111 | return unescaped_str; 112 | } 113 | /* End of stolen code */ 114 | 115 | static gchar *caja_xattr_tags_get_xdg_tags(CajaFileInfo *file) 116 | { 117 | gchar *tags = NULL, *uri; 118 | GFile *location; 119 | GFileInfo *info; 120 | int i; 121 | 122 | uri = caja_file_info_get_activation_uri (file); 123 | for (i = 0 ; protocols_blacklist[i] ; i++) { 124 | int l = strlen(protocols_blacklist[i]); 125 | 126 | if (strlen(uri) < l) 127 | continue; 128 | if (strncasecmp(uri, protocols_blacklist[i], l)) 129 | continue; 130 | 131 | g_free (uri); 132 | return NULL; 133 | } 134 | 135 | location = g_file_new_for_uri (uri); 136 | info = g_file_query_info (location, 137 | G_FILE_ATTRIBUTE_XATTR_XDG_TAGS, 138 | 0, 139 | NULL, 140 | NULL); 141 | 142 | if (info) { 143 | if (g_file_info_has_attribute(info, G_FILE_ATTRIBUTE_XATTR_XDG_TAGS)) { 144 | const gchar *escaped_tags = 145 | g_file_info_get_attribute_string(info, G_FILE_ATTRIBUTE_XATTR_XDG_TAGS); 146 | 147 | gboolean new_created = FALSE; 148 | gchar *un_escaped_tags = hex_unescape_string (escaped_tags, NULL, &new_created); 149 | if (new_created) { 150 | tags = un_escaped_tags; 151 | } else { 152 | /* the string didn't contain any escaped character */ 153 | tags = g_strdup(escaped_tags); 154 | } 155 | } 156 | g_object_unref (info); 157 | } 158 | g_object_unref (location); 159 | g_free (uri); 160 | 161 | return tags; 162 | } 163 | 164 | static CajaOperationResult 165 | caja_xattr_tags_update_file_info(CajaInfoProvider *provider, 166 | CajaFileInfo *file, 167 | GClosure *update_complete, 168 | CajaOperationHandle **handle) 169 | { 170 | gchar *value = caja_xattr_tags_get_xdg_tags(file); 171 | if (value != NULL) { 172 | caja_file_info_add_string_attribute(file, XATTR_TAGS_ATTRIBUTE, value); 173 | g_free(value); 174 | } else { 175 | caja_file_info_add_string_attribute(file, XATTR_TAGS_ATTRIBUTE, ""); 176 | } 177 | return CAJA_OPERATION_COMPLETE; 178 | } 179 | 180 | static void 181 | caja_xattr_tags_cancel_update(CajaInfoProvider *provider, 182 | CajaOperationHandle *handle) 183 | { 184 | CajaXattrTagsHandle *xattr_handle; 185 | 186 | xattr_handle = (CajaXattrTagsHandle*)handle; 187 | xattr_handle->cancelled = TRUE; 188 | } 189 | 190 | static void 191 | caja_xattr_tags_info_provider_iface_init(CajaInfoProviderIface *iface) 192 | { 193 | iface->update_file_info = caja_xattr_tags_update_file_info; 194 | iface->cancel_update = caja_xattr_tags_cancel_update; 195 | } 196 | 197 | static GList * 198 | caja_xattr_tags_get_columns(CajaColumnProvider *provider) 199 | { 200 | GList *ret = NULL; 201 | CajaColumn *column = NULL; 202 | 203 | column = caja_column_new(XATTR_TAGS_NAME, 204 | XATTR_TAGS_ATTRIBUTE, 205 | _("Tags"), 206 | _("Tags stored in extended attributes")); 207 | ret = g_list_append(NULL, column); 208 | 209 | return ret; 210 | } 211 | 212 | static void 213 | caja_xattr_tags_column_provider_iface_init(CajaColumnProviderIface *iface) 214 | { 215 | iface->get_columns = caja_xattr_tags_get_columns; 216 | } 217 | 218 | static void 219 | caja_xattr_tags_instance_init(CajaXattrTags *cajaXattrTags) 220 | { 221 | } 222 | 223 | static void 224 | caja_xattr_tags_class_init(CajaXattrTagsClass *class) 225 | { 226 | parent_class = g_type_class_peek_parent (class); 227 | } 228 | 229 | static GType caja_xattr_tags_type = 0; 230 | 231 | GType 232 | caja_xattr_tags_get_type(void) 233 | { 234 | return caja_xattr_tags_type; 235 | } 236 | 237 | void 238 | caja_xattr_tags_register_type(GTypeModule *module) 239 | { 240 | static const GTypeInfo info = { 241 | sizeof (CajaXattrTagsClass), 242 | (GBaseInitFunc) NULL, 243 | (GBaseFinalizeFunc) NULL, 244 | (GClassInitFunc) caja_xattr_tags_class_init, 245 | NULL, 246 | NULL, 247 | sizeof (CajaXattrTags), 248 | 0, 249 | (GInstanceInitFunc) caja_xattr_tags_instance_init, 250 | NULL 251 | }; 252 | 253 | caja_xattr_tags_type = g_type_module_register_type (module, 254 | G_TYPE_OBJECT, 255 | "CajaXattrTags", 256 | &info, 0); 257 | 258 | static const GInterfaceInfo info_provider_iface_info = { 259 | (GInterfaceInitFunc) caja_xattr_tags_info_provider_iface_init, 260 | NULL, 261 | NULL 262 | }; 263 | 264 | g_type_module_add_interface (module, 265 | CAJA_TYPE_XATTR_TAGS, 266 | CAJA_TYPE_INFO_PROVIDER, 267 | &info_provider_iface_info); 268 | 269 | static const GInterfaceInfo column_provider_iface_info = { 270 | (GInterfaceInitFunc) caja_xattr_tags_column_provider_iface_init, 271 | NULL, 272 | NULL 273 | }; 274 | 275 | g_type_module_add_interface (module, 276 | CAJA_TYPE_XATTR_TAGS, 277 | CAJA_TYPE_COLUMN_PROVIDER, 278 | &column_provider_iface_info); 279 | 280 | } 281 | 282 | void 283 | caja_module_initialize (GTypeModule *module) 284 | { 285 | g_print ("Initializing caja-xattr-tags extension\n"); 286 | caja_xattr_tags_register_type (module); 287 | #ifdef ENABLE_NLS 288 | bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR); 289 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 290 | #endif /* ENABLE_NLS */ 291 | } 292 | 293 | void 294 | caja_module_shutdown (void) 295 | { 296 | g_print ("Shutting down caja-xattr-tags extension\n"); 297 | } 298 | 299 | /* List all the extension types. */ 300 | void 301 | caja_module_list_types (const GType **types, 302 | int *num_types) 303 | { 304 | static GType type_list[1]; 305 | 306 | type_list[0] = CAJA_TYPE_XATTR_TAGS; 307 | 308 | *types = type_list; 309 | *num_types = 1; 310 | } 311 | -------------------------------------------------------------------------------- /xattr-tags/caja-xattr-tags-extension.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Caja xattr tags extension 3 | * 4 | * Copyright (C) 2016 Felipe Barriga Richards 5 | * Copyright (C) 2016-2021 MATE developers. 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 | * Authors: Felipe Barriga Richards 22 | */ 23 | 24 | #ifndef CAJA_XATTR_TAGS_EXTENSION_H 25 | #define CAJA_XATTR_TAGS_EXTENSION_H 26 | 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define CAJA_TYPE_XATTR_TAGS (caja_xattr_tags_get_type ()) 32 | #define CAJA_XATTR_TAGS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CAJA_TYPE_XATTR_TAGS, cajaXattrTags)) 33 | #define CAJA_IS_XATTR_TAGS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CAJA_TYPE_XATTR_TAGS)) 34 | 35 | typedef struct _CajaXattrTags CajaXattrTags; 36 | typedef struct _CajaXattrTagsClass CajaXattrTagsClass; 37 | 38 | struct _CajaXattrTags { 39 | GObject __parent; 40 | }; 41 | 42 | struct _CajaXattrTagsClass { 43 | GObjectClass __parent; 44 | }; 45 | 46 | GType caja_xattr_tags_get_type(void); 47 | void caja_xattr_tags_register_type(GTypeModule *module); 48 | 49 | G_END_DECLS 50 | 51 | #endif /* CAJA_XATTR_TAGS_EXTENSION_H */ 52 | -------------------------------------------------------------------------------- /xattr-tags/libcaja-xattr-tags.caja-extension.desktop.in.in: -------------------------------------------------------------------------------- 1 | [Caja Extension] 2 | # Translators: Do NOT translate or transliterate this text (this is an icon file name)! 3 | Icon=desktop 4 | Name=xattr Tags 5 | Description=View tags stored in extended attributes 6 | Author=Felipe Barriga Richards 7 | Copyright=Copyright (C) 2016 Felipe Barriga Richards\nCopyright (C) 2017-2021 MATE developers 8 | Version=@VERSION@ 9 | Website=@PACKAGE_URL@ 10 | --------------------------------------------------------------------------------