├── .gitignore ├── .gitlab-ci.yml ├── AUTHORS ├── COPYING ├── COPYING.LIB ├── HACKING ├── Makefile.am ├── NEWS ├── README.md ├── THANKS ├── acinclude.m4 ├── autogen.sh ├── configure.ac ├── docs ├── Makefile.am ├── man │ ├── Makefile.am │ └── exo-open.xml └── reference │ ├── Makefile.am │ ├── exo-docs.xml │ ├── exo-overrides.txt │ ├── exo-sections.txt │ └── exo.types ├── exo-desktop-item-edit ├── Makefile.am ├── exo-die-command-entry.c ├── exo-die-command-entry.h ├── exo-die-command-model.c ├── exo-die-command-model.h ├── exo-die-desktop-model.c ├── exo-die-desktop-model.h ├── exo-die-editor.c ├── exo-die-editor.h ├── exo-die-enum-types.c ├── exo-die-enum-types.h ├── exo-die-utils.c ├── exo-die-utils.h └── main.c ├── exo-open ├── Makefile.am └── main.c ├── exo ├── Makefile.am ├── abicheck.sh ├── exo-2.pc.in ├── exo-binding.c ├── exo-binding.h ├── exo-cell-renderer-icon.c ├── exo-cell-renderer-icon.h ├── exo-config.c ├── exo-config.h.in ├── exo-execute.c ├── exo-execute.h ├── exo-gdk-pixbuf-extensions.c ├── exo-gdk-pixbuf-extensions.h ├── exo-gobject-extensions.c ├── exo-gobject-extensions.h ├── exo-gtk-extensions.c ├── exo-gtk-extensions.h ├── exo-icon-chooser-dialog.c ├── exo-icon-chooser-dialog.h ├── exo-icon-chooser-model.c ├── exo-icon-chooser-model.h ├── exo-icon-view-accessible.c ├── exo-icon-view.c ├── exo-icon-view.h ├── exo-job.c ├── exo-job.h ├── exo-marshal.list ├── exo-private.c ├── exo-private.h ├── exo-simple-job.c ├── exo-simple-job.h ├── exo-string.c ├── exo-string.h ├── exo-thumbnail-preview.c ├── exo-thumbnail-preview.h ├── exo-thumbnail.c ├── exo-thumbnail.h ├── exo-tree-view.c ├── exo-tree-view.h ├── exo-utils.c ├── exo-utils.h ├── exo.h ├── exo.symbols └── make-exo-alias.pl ├── pixmaps ├── Makefile.am └── exo-thumbnail-frame.png ├── po ├── LINGUAS ├── Makevars ├── POTFILES.in ├── POTFILES.skip ├── am.po ├── ar.po ├── ast.po ├── az.po ├── az_AZ.po ├── be.po ├── bg.po ├── bn.po ├── ca.po ├── cs.po ├── cy.po ├── da.po ├── de.po ├── el.po ├── en_AU.po ├── en_GB.po ├── es.po ├── et.po ├── eu.po ├── fa_IR.po ├── fi.po ├── fr.po ├── gl.po ├── he.po ├── hr.po ├── hu.po ├── hy.po ├── hy_AM.po ├── hye.po ├── id.po ├── ie.po ├── is.po ├── it.po ├── ja.po ├── ka.po ├── kab.po ├── kk.po ├── kn.po ├── ko.po ├── lt.po ├── lv.po ├── ms.po ├── nb.po ├── nl.po ├── nn.po ├── oc.po ├── pa.po ├── pl.po ├── pt.po ├── pt_BR.po ├── ro.po ├── ru.po ├── si.po ├── sk.po ├── sl.po ├── sq.po ├── sr.po ├── sv.po ├── te.po ├── th.po ├── tr.po ├── ug.po ├── uk.po ├── ur.po ├── ur_PK.po ├── uz.po ├── vec.po ├── vi.po ├── zh_CN.po ├── zh_HK.po └── zh_TW.po └── tests ├── Makefile.am ├── test-exo-icon-chooser-dialog.c ├── test-exo-noop.c └── test-exo-string.c /.gitignore: -------------------------------------------------------------------------------- 1 | # Files generated by autogen.sh 2 | *~ 3 | .deps/ 4 | aclocal.m4 5 | autom4te.cache/ 6 | compile 7 | config.* 8 | configure 9 | depcomp 10 | docs/reference/version.xml 11 | exo/exo-2.pc 12 | exo/exo-config.h 13 | gtk-doc.make 14 | INSTALL 15 | install-sh 16 | libtool 17 | ltmain.sh 18 | m4/ 19 | Makefile 20 | Makefile.in 21 | missing 22 | po/Makefile.in.in 23 | po/POTFILES 24 | po/stamp-it 25 | stamp-h1 26 | test-driver 27 | ABOUT-NLS 28 | docs/reference/exo.actions 29 | po/Makevars.template 30 | po/Rules-quot 31 | po/boldquot.sed 32 | po/en@boldquot.header 33 | po/en@quot.header 34 | po/*.pot 35 | po/insert-header.sin 36 | po/quot.sed 37 | po/remove-potcdate.sed 38 | po/remove-potcdate.sin 39 | po/stamp-po 40 | 41 | 42 | # Files generated by make 43 | *.1 44 | *.bak 45 | *.desktop 46 | *.gmo 47 | *.mo 48 | *.la 49 | *.lo 50 | *.o 51 | *.stamp 52 | *.tar.bz2 53 | *.tgz 54 | .libs/ 55 | ChangeLog 56 | docs/reference/exo-decl-list.txt 57 | docs/reference/exo-decl.txt 58 | docs/reference/exo-undeclared.txt 59 | docs/reference/exo-undocumented.txt 60 | docs/reference/exo-unused.txt 61 | docs/reference/exo.args 62 | docs/reference/exo.hierarchy 63 | docs/reference/exo.interfaces 64 | docs/reference/exo.prerequisites 65 | docs/reference/exo.signals 66 | docs/reference/html/ 67 | docs/reference/xml/ 68 | exo-desktop-item-edit/exo-desktop-item-edit 69 | exo-open/exo-open 70 | exo/exo-alias.h 71 | exo/exo-aliasdef.c 72 | exo/exo-enum-types.c 73 | exo/exo-enum-types.h 74 | exo/exo-marshal.c 75 | exo/exo-marshal.h 76 | exo/stamp-exo-enum-types.h 77 | exo/stamp-exo-marshal.h 78 | tests/test-exo-icon-chooser-dialog 79 | tests/test-exo-icon-chooser-dialog-gtk3 80 | tests/test-exo-noop 81 | tests/test-exo-string 82 | 83 | # Files generated externally 84 | .vscode/ 85 | cov-int/ 86 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | include: 2 | - project: 'xfce/xfce4-dev-tools' 3 | file: '/ci/build_project.yml' 4 | 5 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Benedikt Meurer 2 | Jannis Pohlmann 3 | Nick Schermer 4 | Sean Davis 5 | 6 | Parts of this library are based on code from libegg, Gtk+, the GNOME project 7 | and the ROX Filer. 8 | 9 | The exo-binding module is based on the GObject Binding Properties library 10 | written by Victor Porton . 11 | -------------------------------------------------------------------------------- /HACKING: -------------------------------------------------------------------------------- 1 | Bug tracking system 2 | =================== 3 | 4 | libexo uses the bug tracking system at https://gitlab.xfce.org/xfce/exo/-/issues 5 | hosted and maintained by the Xfce project. 6 | 7 | 8 | Patches 9 | ======= 10 | 11 | Please submit patches to the Xfce bug tracking system or to the 12 | people listed in the AUTHORS file. Your patch should be in unified 13 | diff format (the -u option to GNU diff). 14 | 15 | Please and send a patch against a recent version of this package. Patches 16 | against the Git master branch are most preferable. You can always 17 | access the master branch from 18 | 19 | https://gitlab.xfce.org/xfce/exo 20 | 21 | 22 | Feature requests 23 | ================ 24 | 25 | Please file feature requests to the Xfce bug tracking system 26 | (https://gitlab.xfce.org/xfce/exo/-/issues) with a Severity of 27 | enhancement. Make sure that your feature request wasn't reported 28 | already before; requesting a feature several times won't increase 29 | the chance that it gets added. 30 | 31 | 32 | Coding Style 33 | ============ 34 | 35 | - GNU coding conventions, with GLib-like extensions, mostly the same as GTK+. 36 | - Always expand tabs. This differs from the GNU suggestion, but is necessary! 37 | 38 | 39 | Release process 40 | =============== 41 | 42 | Please see https://wiki.xfce.org/releng/individual-releases 43 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} 2 | 3 | SUBDIRS = \ 4 | exo \ 5 | exo-desktop-item-edit \ 6 | exo-open \ 7 | docs \ 8 | pixmaps \ 9 | po \ 10 | tests 11 | 12 | distclean-local: 13 | rm -rf *.cache *~ 14 | 15 | distuninstallcheck_listfiles = \ 16 | find . -type f -print | grep -v ./share/icons/hicolor/icon-theme.cache 17 | 18 | .PHONY: ChangeLog 19 | 20 | ChangeLog: Makefile 21 | (GIT_DIR=$(top_srcdir)/.git git log > .changelog.tmp \ 22 | && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) \ 23 | || (touch ChangeLog; echo 'Git directory not found: installing possibly empty changelog.' >&2) 24 | 25 | dist-hook: ChangeLog 26 | 27 | EXTRA_DIST = \ 28 | AUTHORS \ 29 | COPYING \ 30 | COPYING.LIB \ 31 | ChangeLog \ 32 | HACKING \ 33 | NEWS \ 34 | README.md \ 35 | THANKS 36 | 37 | AM_DISTCHECK_CONFIGURE_FLAGS = \ 38 | --enable-gtk-doc 39 | 40 | # vi:set ts=8 sw=8 noet ai nocindent: 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![License](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://gitlab.xfce.org/xfce/exo/COPYING) 2 | 3 | # exo 4 | 5 | ⚠️ **exo has been deprecated in favor of libxfce4ui and libxfce4util. The last 6 | release before archiving the repository will be 4.22.0.** ⚠️ 7 | 8 | exo is an extension library used in the Xfce desktop. It has some helper 9 | applications that are used throughout the entire desktop, to manage preferred 10 | applications and edit .desktop files. 11 | 12 | ---- 13 | 14 | ### Homepage 15 | 16 | [exo documentation](https://docs.xfce.org/xfce/exo/start) 17 | 18 | ### Changelog 19 | 20 | See [NEWS](https://gitlab.xfce.org/xfce/exo/-/blob/master/NEWS) for details on changes and fixes made in the current release. 21 | 22 | ### Source Code Repository 23 | 24 | [exo source code](https://gitlab.xfce.org/xfce/exo) 25 | 26 | ### Download A Release Tarball 27 | 28 | [exo archive](https://archive.xfce.org/src/xfce/exo) 29 | or 30 | [exo tags](https://gitlab.xfce.org/xfce/exo/-/tags) 31 | 32 | ### Installation 33 | 34 | From source: 35 | 36 | % cd exo 37 | % ./autogen.sh 38 | % make 39 | % make install 40 | 41 | From release tarball: 42 | 43 | % tar xf exo-.tar.bz2 44 | % cd exo- 45 | % ./configure 46 | % make 47 | % make install 48 | 49 | ### Reporting Bugs 50 | 51 | Visit the [reporting bugs](https://docs.xfce.org/xfce/exo/bugs) page to view currently open bug reports and instructions on reporting new bugs or submitting bugfixes. 52 | 53 | -------------------------------------------------------------------------------- /THANKS: -------------------------------------------------------------------------------- 1 | Thanks to all the individuals that have contributed to the development of Exo. 2 | Since this project started, there have been so many contributors it has become 3 | unmaintainable to list each individually, but the original contributors are 4 | listed below. 5 | 6 | For contributions on a commit basis, please see the ChangeLog file. 7 | 8 | --- 9 | 10 | What's this file about? 11 | ----------------------- 12 | This file lists all external people that have contributed to this project and 13 | thereby helped to make libexo such a successful project. 14 | 15 | 16 | 17 | Testers (sorted by name): 18 | -------------------------- 19 | These people have contributed to libexo by testing the software, 20 | reporting problems and making useful suggestions. 21 | 22 | 23 | 24 | Translators (sorted by language): 25 | ---------------------------------- 26 | These people have translated libexo to foreign languages. 27 | 28 | Mohamed Magdy 29 | * ar translations 30 | 31 | Alexander Nyakhaychyk 32 | * be translations 33 | 34 | Carles Muñoz Gorriz 35 | * ca translations 36 | 37 | Pau Rul·lan Ferragut 38 | * ca translations 39 | 40 | Michal Várady 41 | * cs translations 42 | 43 | Geraint Rowlands 44 | * cy translations 45 | 46 | Benedikt Meurer 47 | * de translations 48 | 49 | Fabian Nowak 50 | * de translations 51 | 52 | Nico Schümann 53 | * de translations 54 | 55 | Sonam Pelden 56 | * dz translations 57 | 58 | Stathis Kamperis 59 | * el translations 60 | 61 | Stavros Giannouris 62 | * el translations 63 | 64 | Dwayne Bailey 65 | * en_GB translations 66 | 67 | Patricio Carr 68 | * es translations 69 | 70 | Peeter Vois 71 | * et translations 72 | 73 | Piarres Beobide 74 | * eu translations 75 | 76 | Jari Rahkonen 77 | * fi translations 78 | 79 | Mike Massonnet 80 | * fr translations 81 | 82 | Maximilian Schleiss 83 | * fr translations 84 | 85 | Stephane Roy 86 | * fr translations 87 | 88 | Leandro Regueiro 89 | * gl translations 90 | 91 | Dotan Kamber 92 | * he translations 93 | 94 | Yuval Tanny 95 | * he translations 96 | 97 | Szervác Attila 98 | * hu translations 99 | 100 | Dario DOE 101 | * it translations 102 | 103 | Daichi Kawahata 104 | * ja translations 105 | 106 | Dimitri Gogelia 107 | * ka translations 108 | 109 | mantas 110 | * lt translations 111 | 112 | Rihards Priedītis 113 | * lv translations 114 | 115 | Pavle Jonoski 116 | * mk translations 117 | 118 | Terje Uriansrud 119 | * nb_NO translations 120 | 121 | Stephan Arts 122 | * nl translations 123 | 124 | Amanpreet Singh Alam 125 | * pa translations 126 | 127 | Piotr Maliński 128 | * pl translations 129 | 130 | Szymon Kałasz 131 | * pl translations 132 | 133 | Adriano Winter Bess 134 | * pt_BR translations 135 | 136 | Pablo Lerina 137 | * pt_BR translations 138 | 139 | Og Maciel 140 | * pt_BR translations 141 | 142 | Joao Pedrosa 143 | * pt_BR translations 144 | 145 | Nuno Miguel 146 | * pt_PT translations 147 | 148 | Mişu Moldovan 149 | * ro translations 150 | 151 | Andrey Fedoseev 152 | * ru translations 153 | 154 | Maxim Zenin 155 | * ru translations 156 | 157 | Besnik Bleta 158 | * sq translations 159 | 160 | Alexander Toresson 161 | * sv translations 162 | 163 | Muhammad Ali Makki 164 | * ur translations 165 | 166 | Hydonsingore Cia 167 | * zh_TW translations 168 | 169 | 170 | 171 | Other contributers (sorted by name): 172 | ------------------------------------ 173 | 174 | Matt McClinch 175 | * ExoIconView patches 176 | -------------------------------------------------------------------------------- /acinclude.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl Copyright (c) 2002 Dean Povey 3 | dnl Copyright (c) 2006 Benedikt Meurer . 4 | dnl 5 | 6 | 7 | 8 | dnl # AC_PROG_PERL_MODULES([MODULES], [ACTION-IF-TRUE], [ACTION-IF-FALSE]) 9 | dnl # 10 | dnl # Checks to see if the the given perl modules are available. If true the 11 | dnl # shell commands in ACTION-IF-TRUE are executed. If not the shell commands 12 | dnl # in ACTION-IF-FALSE are run. Note if $PERL is not set (for example by 13 | dnl # calling AC_CHECK_PROG(), or AC_PATH_PROG), AC_CHECK_PROG(PERL, perl, perl) 14 | dnl # will be run. 15 | dnl # 16 | AC_DEFUN([AC_PROG_PERL_MODULES],[dnl 17 | ac_perl_modules="$1" 18 | # Make sure we have perl 19 | if test -z "$PERL"; then 20 | AC_CHECK_PROG(PERL,perl,perl) 21 | fi 22 | 23 | if test "x$PERL" != x; then 24 | ac_perl_modules_failed=0 25 | for ac_perl_module in $ac_perl_modules; do 26 | AC_MSG_CHECKING(for perl module $ac_perl_module) 27 | 28 | # Would be nice to log result here, but can't rely on autoconf internals 29 | $PERL "-M$ac_perl_module" -e exit > /dev/null 2>&1 30 | if test $? -ne 0; then 31 | AC_MSG_RESULT(no); 32 | ac_perl_modules_failed=1 33 | else 34 | AC_MSG_RESULT(ok); 35 | fi 36 | done 37 | 38 | # Run optional shell commands 39 | if test "$ac_perl_modules_failed" = 0; then 40 | : 41 | $2 42 | else 43 | : 44 | $3 45 | fi 46 | else 47 | AC_MSG_WARN(could not find perl) 48 | fi])dnl 49 | 50 | 51 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (c) 2002-2019 4 | # The Xfce development team. All rights reserved. 5 | # 6 | # This program is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; version 2 of the License ONLY. 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 Street, Fifth Floor, Boston, 18 | # MA 02110-1301 USA 19 | # 20 | # Written for Xfce by Benedikt Meurer 21 | # and Brian Tarricone . 22 | # 23 | 24 | (type xdt-autogen) >/dev/null 2>&1 || { 25 | cat >&2 < 4 | dnl All rights reserved. 5 | dnl 6 | dnl Written by Benedikt Meurer . 7 | dnl 8 | 9 | dnl *************************** 10 | dnl *** Version information *** 11 | dnl *************************** 12 | m4_define([libexo_verinfo], [1:0:1]) 13 | m4_define([libexo_version_api], [2]) 14 | XDT_VERSION_INIT([4.21.0], [git]) 15 | 16 | dnl *************************** 17 | dnl *** Initialize autoconf *** 18 | dnl *************************** 19 | AC_COPYRIGHT([Copyright (c) 2004-2010 os-cillation. 20 | Copyright (c) 2004-2025 Xfce Development Team]) 21 | AC_INIT([exo], [xdt_version], [https://gitlab.xfce.org/xfce/exo]) 22 | AC_PREREQ([2.69]) 23 | AC_CONFIG_MACRO_DIRS([m4]) 24 | AC_REVISION([xdt_version_build]) 25 | AC_CANONICAL_TARGET() 26 | 27 | dnl *************************** 28 | dnl *** Initialize automake *** 29 | dnl *************************** 30 | AM_INIT_AUTOMAKE([1.11 dist-bzip2 tar-ustar no-dist-gzip foreign]) 31 | AC_CONFIG_HEADERS([config.h]) 32 | AM_MAINTAINER_MODE() 33 | AM_SILENT_RULES([yes]) 34 | 35 | dnl ************************** 36 | dnl *** Libtool versioning *** 37 | dnl ************************** 38 | LIBEXO_VERINFO=libexo_verinfo() 39 | AC_SUBST([LIBEXO_VERINFO]) 40 | 41 | dnl **************************** 42 | dnl *** Subst libexo version *** 43 | dnl **************************** 44 | LIBEXO_VERSION_API=libexo_version_api() 45 | LIBEXO_VERSION_MAJOR=xdt_version_major() 46 | LIBEXO_VERSION_MINOR=xdt_version_minor() 47 | LIBEXO_VERSION_MICRO=xdt_version_micro() 48 | AC_SUBST([LIBEXO_VERSION_API]) 49 | AC_SUBST([LIBEXO_VERSION_MAJOR]) 50 | AC_SUBST([LIBEXO_VERSION_MINOR]) 51 | AC_SUBST([LIBEXO_VERSION_MICRO]) 52 | 53 | dnl ****************************** 54 | dnl *** Set helper path prefix *** 55 | dnl ****************************** 56 | AC_ARG_WITH([helper-path-prefix], 57 | [AS_HELP_STRING([--with-helper-path-prefix=PATH], 58 | [Path prefix under which helper executables will be installed (default: $libdir)])], 59 | [HELPER_PATH_PREFIX="$withval"], 60 | [HELPER_PATH_PREFIX="$libdir"]) 61 | AC_SUBST([HELPER_PATH_PREFIX]) 62 | 63 | dnl ******************************** 64 | dnl *** Check for Win32 variants *** 65 | dnl ******************************** 66 | AC_MSG_CHECKING([if building for some Win32 platform]) 67 | case "$host" in 68 | *-*-mingw*|*-*-cygwin*) 69 | ac_bm_platform_win32=yes 70 | ;; 71 | *) 72 | ac_bm_platform_win32=no 73 | ;; 74 | esac 75 | AC_MSG_RESULT([$ac_bm_platform_win32]) 76 | AM_CONDITIONAL([PLATFORM_WIN32], [test x"$ac_bm_platform_win32" = x"yes"]) 77 | 78 | dnl ************************** 79 | dnl *** Initialize libtool *** 80 | dnl ************************** 81 | LT_PREREQ([2.4]) 82 | LT_INIT([disable-static]) 83 | 84 | dnl ******************************** 85 | dnl *** Check for basic programs *** 86 | dnl ******************************** 87 | AM_PROG_AS() 88 | AC_PROG_CC() 89 | AM_PROG_CC_C_O() 90 | AC_PROG_INSTALL() 91 | AC_CHECK_PROGS([PERL], [perl5 perl]) 92 | 93 | dnl *************************************** 94 | dnl *** Check for standard header files *** 95 | dnl *************************************** 96 | AC_CHECK_HEADERS([assert.h errno.h fcntl.h fnmatch.h libintl.h \ 97 | locale.h math.h mmintrin.h paths.h regex.h \ 98 | signal.h stdarg.h string.h sys/mman.h \ 99 | sys/stat.h sys/time.h sys/types.h sys/wait.h time.h]) 100 | 101 | dnl ************************************ 102 | dnl *** Check for standard functions *** 103 | dnl ************************************ 104 | AC_FUNC_MMAP() 105 | AC_CHECK_FUNCS([realpath]) 106 | 107 | dnl *************************************************************************** 108 | dnl *** Check for strftime() extensions *** 109 | dnl *** *** 110 | dnl *** AC_RUN_IFELSE must be able to build and execute programs natively on *** 111 | dnl *** the build system, so it fails when cross-compiling unless given an *** 112 | dnl *** action in the fourth parameter. This sets its results in a cache *** 113 | dnl *** variable that users can override to specify target system behavior. *** 114 | dnl *************************************************************************** 115 | AC_CACHE_CHECK([for strftime %E and %O modifiers], 116 | [ac_cv_have_strftime_extension], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ 117 | #include 118 | #include 119 | int 120 | main (int argc, char **argv) 121 | { 122 | struct tm tm; 123 | char buffer[16]; 124 | tm.tm_year = 81; 125 | if (strftime (buffer, 16, "%EY", &tm) == 4 && strcmp (buffer, "1981") == 0) 126 | return 0; 127 | return 1; 128 | } 129 | ]])], 130 | [ac_cv_have_strftime_extension=yes], 131 | [ac_cv_have_strftime_extension=no], 132 | [ac_cv_have_strftime_extension=cross])]) 133 | if test x"$ac_cv_have_strftime_extension" != x"no"; then 134 | AC_DEFINE([HAVE_STRFTIME_EXTENSION], 1, [Define if strftime supports %E and %O modifiers.]) 135 | fi 136 | 137 | dnl ****************************** 138 | dnl *** Check for i18n support *** 139 | dnl ****************************** 140 | GETTEXT_PACKAGE="$PACKAGE" 141 | AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$PACKAGE"], [Name of default gettext domain]) 142 | AC_SUBST([GETTEXT_PACKAGE]) 143 | AM_GNU_GETTEXT([external]) 144 | AM_GNU_GETTEXT_VERSION([0.19.8]) 145 | AC_SEARCH_LIBS([bind_textdomain_codeset], [intl], 146 | [AC_DEFINE([HAVE_BIND_TEXTDOMAIN_CODESET], [1], [Define to 1 if you have the 'bind_textdomain_codeset' function.])], 147 | []) 148 | 149 | dnl *********************************** 150 | dnl *** Check for required packages *** 151 | dnl *********************************** 152 | XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.72.0]) 153 | XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.72.0]) 154 | XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.24.0]) 155 | XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.72.0]) 156 | XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.17.2]) 157 | XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.15.1]) 158 | XDT_CHECK_OPTIONAL_PACKAGE([GIO_UNIX], [gio-unix-2.0], [2.72.0], [gio-unix], [GIO-Unix features]) 159 | 160 | dnl ************************* 161 | dnl *** Check for gtk-doc *** 162 | dnl ************************* 163 | GTK_DOC_CHECK([1.20]) 164 | 165 | dnl *********************************** 166 | dnl *** Check for debugging support *** 167 | dnl *********************************** 168 | XDT_FEATURE_DEBUG([xdt_debug_default]) 169 | 170 | dnl ************************************** 171 | dnl *** Check for linker optimizations *** 172 | dnl ************************************** 173 | XDT_FEATURE_LINKER_OPTS() 174 | 175 | dnl **************************************** 176 | dnl *** Check for ELF visibility support *** 177 | dnl **************************************** 178 | AC_ARG_ENABLE([visibility], AS_HELP_STRING([--disable-visibility],[Do not use ELF visibility attributes]), [], [enable_visibility=yes]) 179 | have_gnuc_visibility=no 180 | if test x"$enable_visibility" != x"no"; then 181 | dnl Check whether the compiler supports the visibility attribute 182 | save_CFLAGS="$CFLAGS" 183 | CFLAGS="$CFLAGS -Wall -Werror" 184 | AC_MSG_CHECKING([whether $CC supports the GNUC visibility attribute]) 185 | AC_COMPILE_IFELSE([AC_LANG_SOURCE( 186 | [ 187 | void test_default (void); 188 | void test_hidden (void); 189 | 190 | void __attribute__ ((visibility("default"))) test_default (void) {} 191 | void __attribute__ ((visibility("hidden"))) test_hidden (void) {} 192 | 193 | int main (int argc, char **argv) { test_default (); test_hidden (); return 0; } 194 | ])], 195 | [ 196 | have_gnuc_visibility=yes 197 | AC_MSG_RESULT([yes]) 198 | ], 199 | [ 200 | AC_MSG_RESULT([no]) 201 | ]) 202 | CFLAGS="$save_CFLAGS" 203 | fi 204 | if test x"$have_gnuc_visibility" = x"yes"; then 205 | CPPFLAGS="$CPPFLAGS -DHAVE_GNUC_VISIBILITY" 206 | fi 207 | AM_CONDITIONAL([HAVE_GNUC_VISIBILITY], [test x"$have_gnuc_visibility" = x"yes"]) 208 | 209 | dnl ************************************* 210 | dnl *** Use GSEAL if possible *** 211 | dnl ************************************* 212 | XDT_SUPPORTED_FLAGS([CFLAGS], [-DGSEAL_ENABLE]) 213 | 214 | AC_CONFIG_FILES([ 215 | Makefile 216 | docs/Makefile 217 | docs/reference/Makefile 218 | docs/man/Makefile 219 | exo/Makefile 220 | exo/exo-2.pc 221 | exo/exo-config.h 222 | exo-desktop-item-edit/Makefile 223 | exo-open/Makefile 224 | pixmaps/Makefile 225 | po/Makefile.in 226 | tests/Makefile 227 | ]) 228 | AC_OUTPUT 229 | 230 | dnl *************************** 231 | dnl *** Print configuration *** 232 | dnl *************************** 233 | echo 234 | echo "Build Configuration:" 235 | echo 236 | echo "* Debug Support: $enable_debug" 237 | echo "* GNU Visibility: $have_gnuc_visibility" 238 | echo 239 | -------------------------------------------------------------------------------- /docs/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS = \ 3 | reference \ 4 | man 5 | 6 | # vi:set ts=8 sw=8 noet ai nocindent: 7 | -------------------------------------------------------------------------------- /docs/man/Makefile.am: -------------------------------------------------------------------------------- 1 | # Other files to distribute 2 | EXTRA_DIST = exo-open.1 3 | 4 | # manual pages 5 | man_MANS = exo-open.1 6 | 7 | if MAINTAINER_MODE 8 | %.1: %.xml 9 | xsltproc -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< 10 | endif 11 | -------------------------------------------------------------------------------- /docs/man/exo-open.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | exo-open 11 | 1 12 | Xfce User's Manual 13 | Xfce 14 | 15 | 16 | 17 | exo-open 18 | Open URLs and launch preferred applications 19 | 20 | 21 | 22 | 23 | exo-open 24 | 25 | url 26 | 27 | 28 | 29 | exo-open 30 | --launch 31 | category 32 | 33 | parameter 34 | 35 | 36 | 37 | 38 | 39 | Description 40 | 41 | exo-open is a command line frontend to the Xfce Preferred Applications 42 | framework. It can either be used to open a list of urls with the default URL handler or launch 43 | the preferred application for a certain category. 44 | 45 | 46 | 47 | 48 | Invocation 49 | 50 | exo-open either takes a list of URLs and tries to open each of them using the default handler, 51 | or, when using the tries to launch the preferred application for a certain category, 52 | optionally passing any number of parameters to the application. 53 | 54 | 55 | 56 | Options 57 | 58 | 59 | , 60 | 61 | Print brief help and exit. 62 | 63 | 64 | 65 | 66 | , 67 | 68 | Print version information and exit. 69 | 70 | 71 | 72 | 73 | directory 74 | 75 | 76 | When using the option and this option is specified as well, the application will 77 | be run in the given directory. This is primarily useful when running the preferred 78 | TerminalEmulator from another application and you want the command in the 79 | terminal window to be run in a specific directory. 80 | 81 | 82 | 83 | 84 | 85 | category parameters... 86 | 87 | 88 | Launch the preferred application for the given category with the optional 89 | parameters..., where category is either 90 | WebBrowser, MailReader, 91 | TerminalEmulator or FileManager. 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | If you do not specify the option, exo-open will open all specified 100 | URLs with their preferred URL handlers. Else, if you specify the option, you can 101 | select which preferred application you want to run, and pass additional parameters to 102 | the application (i.e. for TerminalEmulator you can pass the command line that 103 | should be run in the terminal). 104 | 105 | 106 | 107 | 108 | Composing emails 109 | 110 | exo-open allows users and developers to open the preferred email composer from the command 111 | line by simply invoking exo-open mailto:USER@HOST.TLD. This will 112 | open the composer window with USER@HOST.TLD as the recipient. This syntax is supported 113 | by all MailReaders. In addition the MailReaders 114 | that ship as part of libexo also support extended mailto:-URIs (but be aware that user-defined mailers do 115 | not necessarily support this), which allows you to also specify default values for the subject and the body 116 | of the mail, add additional recipients (both Cc: and To:) and attach files to emails. For example 117 | mailto:foo@foo.org?cc=bar@bar.org&subject=Foo&attach=/foo/bar.txt 118 | tells the composer to start an email to foo@foo.org and bar@bar.org with Foo in the subject and the file 119 | /foo/bar.txt attached to the message. 120 | 121 | 122 | 123 | 124 | Author 125 | 126 | exo-open was written by Benedikt Meurer benny@xfce.org. 127 | 128 | 129 | This manual page was provided by Benedikt Meurer benny@xfce.org. 130 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /docs/reference/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | # The name of the module. 4 | DOC_MODULE=exo 5 | 6 | # Uncomment for versioned docs and specify the version of the module, e.g. '2'. 7 | DOC_MODULE_VERSION=$(LIBEXO_VERSION_API) 8 | 9 | # The top-level SGML file. 10 | DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml 11 | 12 | # Extra options to supply to gtkdoc-scan 13 | SCAN_OPTIONS=--deprecated-guards="EXO_DISABLE_DEPRECATED" 14 | 15 | # The directory containing the source code. Relative to $(srcdir) 16 | DOC_SOURCE_DIR=$(top_srcdir) 17 | 18 | # Extra options to supply to gtkdoc-mkdb 19 | MKDB_OPTIONS=--output-format=xml --xml-mode 20 | 21 | # Extra options to supply to gtkdoc-fixref 22 | FIXXREF_OPTIONS= 23 | 24 | # Used for dependencies 25 | HFILE_GLOB= 26 | CFILE_GLOB= 27 | 28 | # Header files to ignore when scanning 29 | IGNORE_HFILES= 30 | 31 | # Extra files to add when scanning (relative to $srcdir) 32 | EXTRA_HFILES= 33 | 34 | # Images to copy into HTML directory 35 | HTML_IMAGES = 36 | 37 | # Extra SGML files that are included by DOC_MAIN_SGML_FILE 38 | content_files = 39 | 40 | # CFLAGS and LDFLAGS for compiling scan program. Only needed 41 | # if $(DOC_MODULE).types is non-empty. 42 | GTKDOC_CFLAGS = \ 43 | -I$(top_srcdir) \ 44 | -I$(top_builddir) \ 45 | $(GTK_CFLAGS) \ 46 | $(LIBXFCE4UTIL_CFLAGS) 47 | 48 | GTKDOC_LIBS = \ 49 | $(top_builddir)/exo/libexo-$(LIBEXO_VERSION_API).la \ 50 | $(GTK_LIBS) 51 | 52 | include $(top_srcdir)/gtk-doc.make 53 | 54 | # vi:set ts=8 sw=8 noet ai nocindent syntax=automake: 55 | -------------------------------------------------------------------------------- /docs/reference/exo-docs.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | %gtkdocentities; 8 | ]> 9 | 10 | 11 | 12 | &package_name; Reference Manual 13 | 14 | For &package_string;. 15 | The latest version of this documentation can be found on-line at 16 | https://developer.xfce.org/&package_name;/. 17 | 18 | 19 | 2004-2007 20 | os-cillation e.K. 21 | 22 | 23 | 24 | 2009-2025 25 | Xfce Development Team 26 | 27 | 28 | 29 | 30 | Overview 31 | 32 | exo is an extension library for Xfce, 33 | originally developed by os-cillation. 34 | While Xfce comes with quite a few libraries that are targeted at desktop development, 35 | libexo is targeted at application developement - in particular, developing applications for 36 | the Xfce Desktop Environment. 37 | 38 | 39 | 40 | The exo library depends on the following libraries: 41 | 42 | 43 | 44 | GLib 45 | 46 | 47 | A general-purpose utility library, not specific to graphical user interfaces. 48 | GLib provides many useful data types, macros, type conversions, 49 | string utilities, file utilities, a main loop abstraction, and so on. 50 | 51 | 52 | 53 | 54 | 55 | Pango 56 | 57 | 58 | Pango is a library for internationalized text handling. It centers 59 | around the PangoLayout object, representing 60 | a paragraph of text. Pango provides the engine for GtkTextView, GtkLabel, 62 | GtkEntry, and other widgets that display text. 63 | 64 | 65 | 66 | 67 | 68 | ATK 69 | 70 | 71 | ATK is the Accessibility Toolkit. It provides a set of generic 72 | interfaces allowing accessibility technologies to interact with a 73 | graphical user interface. For example, a screen reader uses ATK to 74 | discover the text in an interface and read it to blind users. GTK+ 75 | widgets have built-in support for accessibility using the ATK 76 | framework. 77 | 78 | 79 | 80 | 81 | 82 | GdkPixbuf 83 | 84 | 85 | This is a small library which allows you to create GdkPixbuf 86 | ("pixel buffer") objects from image data or image files. Use a GdkPixbuf 87 | in combination with GtkImage to display images. 88 | 89 | 90 | 91 | 92 | 93 | GDK 94 | 95 | 96 | GDK is the abstraction layer that allows GTK+ to support multiple 97 | windowing systems. GDK provides drawing and window system facilities 98 | on X11, Windows, and the Linux framebuffer device. 99 | 100 | 101 | 102 | 103 | 104 | GTK+ 105 | 106 | 107 | The GTK+ library contains widgets, that is, GUI 108 | components such as GtkButton or 109 | GtkTextView. 110 | 111 | 112 | 113 | 114 | 115 | libxfce4util 116 | 117 | 118 | The Xfce utility library provides various helper functions and classes for 119 | C programmers, that aren't directly related to GUI tasks. 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | Additional widgets 129 | 130 | 131 | This section describes the additional widgets provided by the exo library. The ExoIconView and ExoTreeView 133 | are views that display data from a GtkTreeModel, and can be seen as extensions to the basic widgets 134 | in Gtk+. For example, both ExoIconView and ExoTreeView offer support 135 | for single-click mode, which is not provided by their Gtk+ counterparts. 136 | 137 | 138 | 139 | The ExoIconChooserDialog is a special widget, that presents a dialog to let the user select 140 | an icon from the current icon theme or from an image file in the file system. You should use this dialog whenever you want the user to 141 | select an icon, instead of just displaying a GtkFileChooserDialog. 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | Additional cell renderers 151 | 152 | 153 | Gtk+ contains various cell renderers that are intended to be used with GtkTreeView 154 | and GtkComboBox, but are difficult to use with ExoIconView 155 | (or even GtkIconView), mainly because the renderers do not follow the state of the view and 156 | render appropriate indicators. 157 | 158 | 159 | 160 | Because of these issues, the ExoCellRendererIcon class is provided, which 161 | includes a follow-state property that tells whether the renderer should follow the state of the view and 162 | draw appropriate indicators. 163 | 164 | 165 | 166 | The ExoCellRendererIcon class should also be preferred over the the GtkCellRendererPixbuf class when using named icons or image files because it uses a fixed 168 | size for layouting and loads the icons only on-demand (utilizing the thumbnail database whenever possible). 169 | 170 | 171 | 172 | 173 | 174 | 175 | Framework for threaded/asynchronous jobs 176 | 177 | 178 | ExoJob provides a simple way to deal with threaded/asynchronous operations (called jobs here). 179 | It can be used to wrap any kind of blocking function calls like file operations or web service communication. It can be 180 | subclassed to add additional signals for progress information or password requests. 181 | ExoSimpleJob is useful in situations where you don't need additional signals. It takes 182 | a ExoSimpleJobFunc callback and creates a job so one doesn't have to subclass 183 | ExoJob just to execute a single function asynchronously. 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | Extensions to existing frameworks 192 | 193 | 194 | This section describes extensions to existing frameworks provided by the exo, that range from additional 195 | methods for certain classes to specialized functions dealing with GdkPixbufs. 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | Miscelleanous 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | API Index 214 | 215 | 216 | All symbols 217 | 218 | 219 | 220 | Added in 0.3.1 221 | 222 | 223 | 224 | Added in 0.3.1.1 225 | 226 | 227 | 228 | Added in 0.3.1.3 229 | 230 | 231 | 232 | Added in 0.3.1.5 233 | 234 | 235 | 236 | Added in 0.3.1.9 237 | 238 | 239 | 240 | Added in 0.3.3 241 | 242 | 243 | 244 | Added in 0.4.0 245 | 246 | 247 | 248 | Added in 0.5.0 249 | 250 | 251 | 252 | Added in 0.7.1 253 | 254 | 255 | 256 | Added in 0.10.2 257 | 258 | 259 | 260 | Added in 0.11.4 261 | 262 | 263 | 264 | Added in 0.11.5 265 | 266 | 267 | 268 | Deprecated symbols 269 | 270 | 271 | 272 | 273 | 274 | Index 275 | 276 | 277 | 278 | 279 | 280 | 283 | -------------------------------------------------------------------------------- /docs/reference/exo-overrides.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xfce-mirror/exo/c7ec1451008d3205d4e48db47d90925c081c3b98/docs/reference/exo-overrides.txt -------------------------------------------------------------------------------- /docs/reference/exo-sections.txt: -------------------------------------------------------------------------------- 1 |
2 | exo-icon-chooser-dialog 3 | ExoIconChooserDialog 4 | ExoIconChooserDialog 5 | exo_icon_chooser_dialog_new 6 | exo_icon_chooser_dialog_get_icon 7 | exo_icon_chooser_dialog_set_icon 8 | 9 | ExoIconChooserDialogPrivate 10 | ExoIconChooserDialogClass 11 | EXO_TYPE_ICON_CHOOSER_DIALOG 12 | EXO_ICON_CHOOSER_DIALOG 13 | EXO_ICON_CHOOSER_DIALOG_CLASS 14 | EXO_IS_ICON_CHOOSER_DIALOG 15 | EXO_IS_ICON_CHOOSER_DIALOG_CLASS 16 | EXO_ICON_CHOOSER_DIALOG_GET_CLASS 17 | 18 | exo_icon_chooser_dialog_get_type 19 |
20 | 21 |
22 | exo-icon-view 23 | ExoIconView 24 | ExoIconView 25 | ExoIconViewDropPosition 26 | ExoIconViewLayoutMode 27 | exo_icon_view_new 28 | exo_icon_view_new_with_model 29 | exo_icon_view_get_model 30 | exo_icon_view_set_model 31 | exo_icon_view_get_orientation 32 | exo_icon_view_set_orientation 33 | exo_icon_view_get_columns 34 | exo_icon_view_set_columns 35 | exo_icon_view_get_item_width 36 | exo_icon_view_set_item_width 37 | exo_icon_view_get_spacing 38 | exo_icon_view_set_spacing 39 | exo_icon_view_get_row_spacing 40 | exo_icon_view_set_row_spacing 41 | exo_icon_view_get_column_spacing 42 | exo_icon_view_set_column_spacing 43 | exo_icon_view_get_margin 44 | exo_icon_view_set_margin 45 | exo_icon_view_get_selection_mode 46 | exo_icon_view_set_selection_mode 47 | exo_icon_view_get_layout_mode 48 | exo_icon_view_set_layout_mode 49 | exo_icon_view_get_single_click 50 | exo_icon_view_set_single_click 51 | exo_icon_view_get_single_click_timeout 52 | exo_icon_view_set_single_click_timeout 53 | exo_icon_view_widget_to_icon_coords 54 | exo_icon_view_icon_to_widget_coords 55 | exo_icon_view_get_path_at_pos 56 | exo_icon_view_get_item_at_pos 57 | exo_icon_view_get_visible_range 58 | ExoIconViewForeachFunc 59 | exo_icon_view_selected_foreach 60 | exo_icon_view_select_path 61 | exo_icon_view_unselect_path 62 | exo_icon_view_path_is_selected 63 | exo_icon_view_get_item_column 64 | exo_icon_view_get_item_row 65 | exo_icon_view_get_selected_items 66 | exo_icon_view_select_all 67 | exo_icon_view_unselect_all 68 | exo_icon_view_selection_invert 69 | exo_icon_view_item_activated 70 | exo_icon_view_get_cursor 71 | exo_icon_view_set_cursor 72 | exo_icon_view_scroll_to_path 73 | exo_icon_view_enable_model_drag_source 74 | exo_icon_view_enable_model_drag_dest 75 | exo_icon_view_unset_model_drag_source 76 | exo_icon_view_unset_model_drag_dest 77 | exo_icon_view_set_reorderable 78 | exo_icon_view_get_reorderable 79 | exo_icon_view_set_drag_dest_item 80 | exo_icon_view_get_drag_dest_item 81 | exo_icon_view_get_dest_item_at_pos 82 | exo_icon_view_create_drag_icon 83 | ExoIconViewSearchEqualFunc 84 | ExoIconViewSearchPositionFunc 85 | exo_icon_view_get_enable_search 86 | exo_icon_view_set_enable_search 87 | exo_icon_view_get_search_column 88 | exo_icon_view_set_search_column 89 | exo_icon_view_get_search_equal_func 90 | exo_icon_view_set_search_equal_func 91 | exo_icon_view_get_search_position_func 92 | exo_icon_view_set_search_position_func 93 | 94 | ExoIconViewPrivate 95 | ExoIconViewClass 96 | EXO_TYPE_ICON_VIEW 97 | EXO_ICON_VIEW 98 | EXO_ICON_VIEW_CLASS 99 | EXO_IS_ICON_VIEW 100 | EXO_IS_ICON_VIEW_CLASS 101 | EXO_ICON_VIEW_GET_CLASS 102 | 103 | exo_icon_view_get_type 104 |
105 | 106 |
107 | exo-tree-view 108 | ExoTreeView 109 | ExoTreeView 110 | exo_tree_view_new 111 | exo_tree_view_get_single_click 112 | exo_tree_view_set_single_click 113 | exo_tree_view_get_single_click_timeout 114 | exo_tree_view_set_single_click_timeout 115 | 116 | ExoTreeViewPrivate 117 | ExoTreeViewClass 118 | EXO_TYPE_TREE_VIEW 119 | EXO_TREE_VIEW 120 | EXO_TREE_VIEW_CLASS 121 | EXO_IS_TREE_VIEW 122 | EXO_IS_TREE_VIEW_CLASS 123 | EXO_TREE_VIEW_GET_CLASS 124 | 125 | exo_tree_view_get_type 126 |
127 | 128 |
129 | exo-cell-renderer-icon 130 | ExoCellRendererIcon 131 | ExoCellRendererIcon 132 | exo_cell_renderer_icon_new 133 | 134 | ExoCellRendererIconPrivate 135 | ExoCellRendererIconClass 136 | EXO_TYPE_CELL_RENDERER_ICON 137 | EXO_CELL_RENDERER_ICON 138 | EXO_CELL_RENDERER_ICON_CLASS 139 | EXO_IS_CELL_RENDERER_ICON 140 | EXO_IS_CELL_RENDERER_ICON_CLASS 141 | EXO_CELL_RENDERER_ICON_GET_CLASS 142 | 143 | exo_cell_renderer_icon_get_type 144 |
145 | 146 |
147 | exo-job 148 | ExoJob 149 | ExoJob 150 | exo_job_launch 151 | exo_job_cancel 152 | exo_job_is_cancelled 153 | exo_job_get_cancellable 154 | exo_job_set_error_if_cancelled 155 | exo_job_emit 156 | exo_job_info_message 157 | exo_job_percent 158 | exo_job_send_to_mainloop 159 | 160 | ExoJobPrivate 161 | ExoJobClass 162 | EXO_TYPE_JOB 163 | EXO_JOB 164 | EXO_JOB_CLASS 165 | EXO_IS_JOB 166 | EXO_IS_JOB_CLASS 167 | EXO_JOB_GET_CLASS 168 | 169 | exo_job_get_type 170 |
171 | 172 |
173 | exo-simple-job 174 | ExoSimpleJob 175 | ExoSimpleJob 176 | ExoSimpleJobFunc 177 | exo_simple_job_launch 178 | 179 | ExoSimpleJobClass 180 | EXO_TYPE_SIMPLE_JOB 181 | EXO_SIMPLE_JOB 182 | EXO_SIMPLE_JOB_CLASS 183 | EXO_IS_SIMPLE_JOB 184 | EXO_IS_SIMPLE_JOB_CLASS 185 | EXO_SIMPLE_JOB_GET_CLASS 186 | 187 | exo_simple_job_get_type 188 |
189 | 190 |
191 | exo-gdk-pixbuf-extensions 192 | Extensions to gdk-pixbuf 193 | exo_gdk_pixbuf_colorize 194 | exo_gdk_pixbuf_frame 195 | exo_gdk_pixbuf_lucent 196 | exo_gdk_pixbuf_spotlight 197 | exo_gdk_pixbuf_scale_down 198 | exo_gdk_pixbuf_scale_ratio 199 | exo_gdk_pixbuf_new_from_file_at_max_size 200 |
201 | 202 |
203 | exo-gobject-extensions 204 | Extensions to GObject 205 | exo_g_value_transform_negate 206 |
207 | 208 |
209 | exo-gtk-extensions 210 | Extensions to Gtk 211 | exo_gtk_object_destroy_later 212 | exo_gtk_file_chooser_add_thumbnail_preview 213 | exo_gtk_url_about_dialog_hook 214 | exo_gtk_dialog_get_action_area 215 | exo_gtk_dialog_add_secondary_button 216 |
217 | 218 |
219 | exo-config 220 | Version Information 221 | exo_major_version 222 | exo_minor_version 223 | exo_micro_version 224 | exo_check_version 225 | 226 | EXO_MAJOR_VERSION 227 | EXO_MINOR_VERSION 228 | EXO_MICRO_VERSION 229 | EXO_CHECK_VERSION 230 |
231 | 232 |
233 | exo-binding 234 | Binding Properties Functions 235 | ExoBinding 236 | ExoMutualBinding 237 | ExoBindingTransform 238 | exo_binding_new 239 | exo_binding_new_full 240 | exo_binding_new_with_negation 241 | exo_binding_unbind 242 | exo_mutual_binding_new 243 | exo_mutual_binding_new_full 244 | exo_mutual_binding_new_with_negation 245 | exo_mutual_binding_unbind 246 |
247 | 248 |
249 | exo-execute 250 | Executing Applications 251 | exo_execute_preferred_application 252 | exo_execute_preferred_application_on_screen 253 | exo_execute_terminal_shell 254 | exo_execute_terminal_shell_on_screen 255 |
256 | 257 |
258 | exo-string 259 | String Utility Functions 260 | exo_str_elide_underscores 261 | exo_str_is_equal 262 | exo_str_is_empty 263 | exo_str_is_flag 264 | exo_str_looks_like_an_uri 265 | exo_str_replace 266 | exo_strdup_strftime 267 | exo_strndupv 268 | I_ 269 |
270 | 271 |
272 | exo-utils 273 | Miscellaneous Utility Functions 274 | exo_noop 275 | exo_noop_one 276 | exo_noop_zero 277 | exo_noop_null 278 | exo_noop_true 279 | exo_noop_false 280 |
281 | -------------------------------------------------------------------------------- /docs/reference/exo.types: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | exo_icon_chooser_dialog_get_type 4 | exo_icon_view_get_type 5 | exo_tree_view_get_type 6 | 7 | exo_cell_renderer_icon_get_type 8 | 9 | exo_job_get_type 10 | exo_simple_job_get_type 11 | -------------------------------------------------------------------------------- /exo-desktop-item-edit/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AM_CPPFLAGS = \ 3 | -I$(top_builddir) \ 4 | -I$(top_srcdir) \ 5 | -DBINDIR=\"$(bindir)\" \ 6 | -DDATADIR=\"$(datadir)\" \ 7 | -DG_LOG_DOMAIN=\"exo-desktop-item-edit\" \ 8 | -DPACKAGE_LOCALE_DIR=\"$(localedir)\" 9 | 10 | bin_PROGRAMS = \ 11 | exo-desktop-item-edit 12 | 13 | exo_desktop_item_edit_SOURCES = \ 14 | exo-die-command-entry.c \ 15 | exo-die-command-entry.h \ 16 | exo-die-command-model.c \ 17 | exo-die-command-model.h \ 18 | exo-die-desktop-model.c \ 19 | exo-die-desktop-model.h \ 20 | exo-die-editor.c \ 21 | exo-die-editor.h \ 22 | exo-die-enum-types.c \ 23 | exo-die-enum-types.h \ 24 | exo-die-utils.c \ 25 | exo-die-utils.h \ 26 | main.c 27 | 28 | exo_desktop_item_edit_CFLAGS = \ 29 | $(GTK_CFLAGS) \ 30 | $(GTHREAD_CFLAGS) \ 31 | $(LIBXFCE4UTIL_CFLAGS) \ 32 | $(GIO_CFLAGS) \ 33 | $(LIBXFCE4UI_CFLAGS) 34 | 35 | exo_desktop_item_edit_LDFLAGS = \ 36 | -no-undefined 37 | 38 | exo_desktop_item_edit_DEPENDENCIES = \ 39 | $(top_builddir)/exo/libexo-2.la 40 | 41 | exo_desktop_item_edit_LDADD = \ 42 | $(GTK_LIBS) \ 43 | $(GTHREAD_LIBS) \ 44 | $(LIBXFCE4UTIL_LIBS) \ 45 | $(GIO_LIBS) \ 46 | $(LIBXFCE4UI_LIBS) \ 47 | $(top_builddir)/exo/libexo-2.la 48 | 49 | # vi:set ts=8 sw=8 noet ai nocindent syntax=automake: 50 | -------------------------------------------------------------------------------- /exo-desktop-item-edit/exo-die-command-entry.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2006 Benedikt Meurer . 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef __EXO_DIE_COMMAND_ENTRY_H__ 21 | #define __EXO_DIE_COMMAND_ENTRY_H__ 22 | 23 | #include 24 | 25 | G_BEGIN_DECLS; 26 | 27 | typedef struct _ExoDieCommandEntryClass ExoDieCommandEntryClass; 28 | typedef struct _ExoDieCommandEntry ExoDieCommandEntry; 29 | 30 | #define EXO_DIE_TYPE_COMMAND_ENTRY (exo_die_command_entry_get_type ()) 31 | #define EXO_DIE_COMMAND_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXO_DIE_TYPE_COMMAND_ENTRY, ExoDieCommandEntry)) 32 | #define EXO_DIE_COMMAND_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXO_DIE_TYPE_COMMAND_ENTRY, ExoDieCommandEntryClass)) 33 | #define EXO_DIE_IS_COMMAND_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXO_DIE_TYPE_COMMAND_ENTRY)) 34 | #define EXO_DIE_IS_COMMAND_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXO_DIE_TYPE_COMMAND_ENTRY)) 35 | #define EXO_DIE_COMMAND_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXO_DIE_TYPE_COMMAND_ENTRY, ExoDieCommandEntryClass)) 36 | 37 | GType exo_die_command_entry_get_type (void) G_GNUC_CONST; 38 | 39 | GtkWidget *exo_die_command_entry_new (void) G_GNUC_MALLOC; 40 | 41 | const gchar *exo_die_command_entry_get_text (ExoDieCommandEntry *command_entry); 42 | void exo_die_command_entry_set_text (ExoDieCommandEntry *command_entry, 43 | const gchar *text); 44 | 45 | G_END_DECLS; 46 | 47 | #endif /* !__EXO_DIE_COMMAND_ENTRY_H__ */ 48 | -------------------------------------------------------------------------------- /exo-desktop-item-edit/exo-die-command-model.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2006 Benedikt Meurer . 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef __EXO_DIE_COMMAND_MODEL_H__ 21 | #define __EXO_DIE_COMMAND_MODEL_H__ 22 | 23 | #include 24 | 25 | G_BEGIN_DECLS; 26 | 27 | typedef struct _ExoDieCommandModelClass ExoDieCommandModelClass; 28 | typedef struct _ExoDieCommandModel ExoDieCommandModel; 29 | 30 | #define EXO_DIE_TYPE_COMMAND_MODEL (exo_die_command_model_get_type ()) 31 | #define EXO_DIE_COMMAND_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXO_DIE_TYPE_COMMAND_MODEL, ExoDieCommandModel)) 32 | #define EXO_DIE_COMMAND_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXO_DIE_TYPE_COMMAND_MODEL, ExoDieCommandModelClass)) 33 | #define EXO_DIE_IS_COMMAND_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXO_DIE_TYPE_COMMAND_MODEL)) 34 | #define EXO_DIE_IS_COMMAND_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXO_DIE_TYPE_COMMAND_MODEL)) 35 | #define EXO_DIE_COMMAND_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXO_DIE_TYPE_COMMAND_MODEL, ExoDieCommandModelClass)) 36 | 37 | /** 38 | * ExoDieCommandModelColumn: 39 | * @EXO_DIE_COMMAND_MODEL_COLUMN_NAME : the column with the file name. 40 | * 41 | * The columns provided by the #ExoDieCommandModel. 42 | **/ 43 | typedef enum /*< enum >*/ 44 | { 45 | EXO_DIE_COMMAND_MODEL_COLUMN_NAME, 46 | EXO_DIE_COMMAND_MODEL_N_COLUMNS, 47 | } ExoDieCommandModelColumn; 48 | 49 | GType exo_die_command_model_get_type (void) G_GNUC_CONST; 50 | 51 | ExoDieCommandModel *exo_die_command_model_new (void) G_GNUC_MALLOC; 52 | 53 | G_END_DECLS; 54 | 55 | #endif /* !__EXO_DIE_COMMAND_MODEL_H__ */ 56 | -------------------------------------------------------------------------------- /exo-desktop-item-edit/exo-die-desktop-model.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2006 Benedikt Meurer . 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef __EXO_DIE_DESKTOP_MODEL_H__ 21 | #define __EXO_DIE_DESKTOP_MODEL_H__ 22 | 23 | #include 24 | 25 | G_BEGIN_DECLS; 26 | 27 | typedef struct _ExoDieDesktopModelClass ExoDieDesktopModelClass; 28 | typedef struct _ExoDieDesktopModel ExoDieDesktopModel; 29 | 30 | #define EXO_DIE_TYPE_DESKTOP_MODEL (exo_die_desktop_model_get_type ()) 31 | #define EXO_DIE_DESKTOP_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXO_DIE_TYPE_DESKTOP_MODEL, ExoDieDesktopModel)) 32 | #define EXO_DIE_DESKTOP_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXO_DIE_TYPE_DESKTOP_MODEL, ExoDieDesktopModelClass)) 33 | #define EXO_DIE_IS_DESKTOP_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXO_DIE_TYPE_DESKTOP_MODEL)) 34 | #define EXO_DIE_IS_DESKTOP_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXO_DIE_TYPE_DESKTOP_MODEL)) 35 | #define EXO_DIE_DESKTOP_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXO_DIE_TYPE_DESKTOP_MODEL, ExoDieDesktopModelClass)) 36 | 37 | /** 38 | * ExoDieDesktopModelColumn: 39 | * @EXO_DIE_DESKTOP_MODEL_COLUMN_ABSTRACT : the column with the markup text for the renderer. 40 | * @EXO_DIE_DESKTOP_MODEL_COLUMN_COMMAND : the column with the application command. 41 | * @EXO_DIE_DESKTOP_MODEL_COLUMN_COMMENT : the column with the application comment. 42 | * @EXO_DIE_DESKTOP_MODEL_COLUMN_ICON : the column with the application icon. 43 | * @EXO_DIE_DESKTOP_MODEL_COLUMN_NAME : the column with the application name. 44 | * @EXO_DIE_DESKTOP_MODEL_COLUMN_SNOTIFY : the column with the applications StartupNotify setting. 45 | * @EXO_DIE_DESKTOP_MODEL_COLUMN_TERMINAL : the column with the applications Terminal setting. 46 | * 47 | * The columns provided by the #ExoDieDesktopModel. 48 | **/ 49 | typedef enum /*< enum >*/ 50 | { 51 | EXO_DIE_DESKTOP_MODEL_COLUMN_ABSTRACT, 52 | EXO_DIE_DESKTOP_MODEL_COLUMN_COMMAND, 53 | EXO_DIE_DESKTOP_MODEL_COLUMN_COMMENT, 54 | EXO_DIE_DESKTOP_MODEL_COLUMN_ICON, 55 | EXO_DIE_DESKTOP_MODEL_COLUMN_NAME, 56 | EXO_DIE_DESKTOP_MODEL_COLUMN_SNOTIFY, 57 | EXO_DIE_DESKTOP_MODEL_COLUMN_TERMINAL, 58 | EXO_DIE_DESKTOP_MODEL_N_COLUMNS, 59 | } ExoDieDesktopModelColumn; 60 | 61 | GType exo_die_desktop_model_get_type (void) G_GNUC_CONST; 62 | 63 | ExoDieDesktopModel *exo_die_desktop_model_new (void) G_GNUC_MALLOC; 64 | 65 | gboolean exo_die_desktop_model_match_func (GtkEntryCompletion *completion, 66 | const gchar *key, 67 | GtkTreeIter *iter, 68 | gpointer user_data); 69 | 70 | G_END_DECLS; 71 | 72 | #endif /* !__EXO_DIE_DESKTOP_MODEL_H__ */ 73 | -------------------------------------------------------------------------------- /exo-desktop-item-edit/exo-die-editor.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2006 Benedikt Meurer . 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef __EXO_DIE_EDITOR_H__ 21 | #define __EXO_DIE_EDITOR_H__ 22 | 23 | #include 24 | 25 | G_BEGIN_DECLS; 26 | 27 | typedef struct _ExoDieEditorClass ExoDieEditorClass; 28 | typedef struct _ExoDieEditor ExoDieEditor; 29 | 30 | #define EXO_DIE_TYPE_EDITOR (exo_die_editor_get_type ()) 31 | #define EXO_DIE_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXO_DIE_TYPE_EDITOR, ExoDieEditor)) 32 | #define EXO_DIE_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXO_DIE_TYPE_EDITOR, ExoDieEditorClass)) 33 | #define EXO_DIE_IS_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXO_DIE_TYPE_EDITOR)) 34 | #define EXO_DIE_IS_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXO_DIE_TYPE_EDITOR)) 35 | #define EXO_DIE_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXO_DIE_TYPE_EDITOR, ExoDieEditorClass)) 36 | 37 | GType exo_die_editor_get_type (void) G_GNUC_CONST; 38 | 39 | GtkWidget *exo_die_editor_new (void) G_GNUC_MALLOC; 40 | 41 | gboolean exo_die_editor_get_complete (ExoDieEditor *editor); 42 | 43 | ExoDieEditorMode exo_die_editor_get_mode (ExoDieEditor *editor); 44 | void exo_die_editor_set_mode (ExoDieEditor *editor, 45 | ExoDieEditorMode mode); 46 | 47 | const gchar *exo_die_editor_get_name (ExoDieEditor *editor); 48 | void exo_die_editor_set_name (ExoDieEditor *editor, 49 | const gchar *name); 50 | 51 | const gchar *exo_die_editor_get_comment (ExoDieEditor *editor); 52 | void exo_die_editor_set_comment (ExoDieEditor *editor, 53 | const gchar *comment); 54 | 55 | const gchar *exo_die_editor_get_command (ExoDieEditor *editor); 56 | void exo_die_editor_set_command (ExoDieEditor *editor, 57 | const gchar *command); 58 | 59 | const gchar *exo_die_editor_get_url (ExoDieEditor *editor); 60 | void exo_die_editor_set_url (ExoDieEditor *editor, 61 | const gchar *url); 62 | 63 | const gchar *exo_die_editor_get_path (ExoDieEditor *editor); 64 | void exo_die_editor_set_path (ExoDieEditor *editor, 65 | const gchar *path); 66 | 67 | const gchar *exo_die_editor_get_icon (ExoDieEditor *editor); 68 | void exo_die_editor_set_icon (ExoDieEditor *editor, 69 | const gchar *icon); 70 | 71 | gboolean exo_die_editor_get_snotify (ExoDieEditor *editor); 72 | void exo_die_editor_set_snotify (ExoDieEditor *editor, 73 | gboolean snotify); 74 | 75 | gboolean exo_die_editor_get_terminal (ExoDieEditor *editor); 76 | void exo_die_editor_set_terminal (ExoDieEditor *editor, 77 | gboolean terminal); 78 | 79 | G_END_DECLS; 80 | 81 | #endif /* !__EXO_DIE_EDITOR_H__ */ 82 | -------------------------------------------------------------------------------- /exo-desktop-item-edit/exo-die-enum-types.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2006 Benedikt Meurer . 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #ifdef HAVE_CONFIG_H 21 | #include 22 | #endif 23 | 24 | #include 25 | #include 26 | 27 | 28 | 29 | GType 30 | exo_die_editor_mode_get_type (void) 31 | { 32 | static GType type = G_TYPE_INVALID; 33 | 34 | if (G_UNLIKELY (type == G_TYPE_INVALID)) 35 | { 36 | static const GEnumValue values[] = 37 | { 38 | { EXO_DIE_EDITOR_MODE_APPLICATION, "EXO_DIE_EDITOR_MODE_APPLICATION", "Application", }, 39 | { EXO_DIE_EDITOR_MODE_LINK, "EXO_DIE_EDITOR_MODE_LINK", "Link", }, 40 | { EXO_DIE_EDITOR_MODE_DIRECTORY, "EXO_DIE_EDITOR_MODE_DIRECTORY", "Directory", }, 41 | { 0, NULL, NULL, }, 42 | }; 43 | 44 | type = g_enum_register_static (I_("ExoDieEditorMode"), values); 45 | } 46 | 47 | return type; 48 | } 49 | 50 | -------------------------------------------------------------------------------- /exo-desktop-item-edit/exo-die-enum-types.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2006 Benedikt Meurer . 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef __EXO_DIE_ENUM_TYPES_H__ 21 | #define __EXO_DIE_ENUM_TYPES_H__ 22 | 23 | #include 24 | 25 | G_BEGIN_DECLS 26 | 27 | #define EXO_DIE_TYPE_EDITOR_MODE (exo_die_editor_mode_get_type ()) 28 | 29 | /** 30 | * ExoDieEditorMode: 31 | * @EXO_DIE_EDITOR_MODE_APPLICATION : application launcher editing. 32 | * @EXO_DIE_EDITOR_MODE_LINK : link editing. 33 | * @EXO_DIE_EDITOR_MODE_DIRECTORY : menu directory editing. 34 | * 35 | * Editing mode for exo-desktop-item-edit 36 | * 37 | **/ 38 | typedef enum 39 | { 40 | EXO_DIE_EDITOR_MODE_APPLICATION, 41 | EXO_DIE_EDITOR_MODE_LINK, 42 | EXO_DIE_EDITOR_MODE_DIRECTORY 43 | } ExoDieEditorMode; 44 | 45 | GType exo_die_editor_mode_get_type (void) G_GNUC_CONST; 46 | 47 | G_END_DECLS 48 | 49 | #endif /* !__EXO_DIE_ENUM_TYPES_H__ */ 50 | -------------------------------------------------------------------------------- /exo-desktop-item-edit/exo-die-utils.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2006 Benedikt Meurer . 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #ifdef HAVE_CONFIG_H 21 | #include 22 | #endif 23 | 24 | #ifdef HAVE_ERRNO_H 25 | #include 26 | #endif 27 | #include 28 | 29 | #include 30 | #include 31 | 32 | 33 | 34 | /** 35 | * exo_die_g_key_file_set_locale_value: 36 | * @key_file : the #GKeyFile. 37 | * @group : the group name. 38 | * @key : the key name. 39 | * @value : the new value. 40 | * 41 | * Stores @value localized for @key in @group if it 42 | * is already localized. 43 | **/ 44 | void 45 | exo_die_g_key_file_set_locale_value (GKeyFile *key_file, 46 | const gchar *group, 47 | const gchar *key, 48 | const gchar *value) 49 | { 50 | const gchar * const *locale; 51 | gchar *name; 52 | 53 | g_return_if_fail (key_file != NULL); 54 | g_return_if_fail (group != NULL); 55 | g_return_if_fail (key != NULL); 56 | g_return_if_fail (value != NULL); 57 | 58 | /* try localized first */ 59 | for (locale = g_get_language_names (); *locale != NULL; ++locale) 60 | { 61 | name = g_strdup_printf ("%s[%s]", key, *locale); 62 | if (g_key_file_has_key (key_file, group, name, NULL)) 63 | { 64 | g_key_file_set_string (key_file, group, name, value); 65 | g_free (name); 66 | break; 67 | } 68 | g_free (name); 69 | } 70 | 71 | /* fallback to unlocalized */ 72 | if (G_UNLIKELY (*locale == NULL)) 73 | g_key_file_set_string (key_file, group, key, value); 74 | } 75 | 76 | 77 | 78 | static void trust_launcher (GFile *gfile) 79 | { 80 | /* trust the launcher since the user created it */ 81 | guint32 mode = 0111, mask = 0111; 82 | guint32 old_mode, new_mode; 83 | GFileInfo *info; 84 | 85 | info = g_file_query_info (gfile, 86 | G_FILE_ATTRIBUTE_UNIX_MODE, 87 | G_FILE_QUERY_INFO_NONE, 88 | NULL, 89 | NULL); 90 | 91 | if (info == NULL) 92 | return; 93 | 94 | old_mode = g_file_info_get_attribute_uint32 (info, G_FILE_ATTRIBUTE_UNIX_MODE); 95 | new_mode = (old_mode & ~mask) | mode; 96 | 97 | if (old_mode != new_mode) { 98 | g_file_set_attribute_uint32 (gfile, 99 | G_FILE_ATTRIBUTE_UNIX_MODE, new_mode, 100 | G_FILE_QUERY_INFO_NONE, 101 | NULL, 102 | NULL); 103 | } 104 | 105 | g_object_unref (info); 106 | 107 | if (xfce_g_file_metadata_is_supported (gfile)) 108 | xfce_g_file_set_trusted (gfile, TRUE, NULL, NULL); 109 | } 110 | 111 | 112 | 113 | /** 114 | * exo_die_g_key_file_save: 115 | * @key_file : the #GKeyFile. 116 | * @create : whether to create. 117 | * @trust : whether to trust the launcher. 118 | * @base : file or folder (if @create). 119 | * @mode : file mode for .directory or .desktop suffix. 120 | * @error : return location for errors or %NULL. 121 | * 122 | * Writes changes to the @key_file .desktop or .directory file. 123 | * 124 | * Return value: #GFile that was written, or %NULL on error. 125 | **/ 126 | GFile * 127 | exo_die_g_key_file_save (GKeyFile *key_file, 128 | gboolean create, 129 | gboolean trust, 130 | GFile *base, 131 | ExoDieEditorMode mode, 132 | GError **error) 133 | { 134 | GFileType file_type; 135 | GFile *file; 136 | gchar *name, *s; 137 | gchar *filename, *data; 138 | gsize length; 139 | gboolean result; 140 | guint n; 141 | gboolean desktop_suffix; 142 | const gchar *suffix; 143 | 144 | g_return_val_if_fail (G_IS_FILE (base), NULL); 145 | g_return_val_if_fail (key_file != NULL, NULL); 146 | g_return_val_if_fail (error == NULL || *error == NULL, NULL); 147 | 148 | /* check if we should create a new file */ 149 | if (G_LIKELY (create)) 150 | { 151 | if (mode == EXO_DIE_EDITOR_MODE_DIRECTORY) 152 | suffix = ".directory"; 153 | else 154 | suffix = ".desktop"; 155 | 156 | /* if the filename end with .desktop, then use the base as file */ 157 | name = g_file_get_basename (base); 158 | desktop_suffix = g_str_has_suffix (name, suffix); 159 | g_free (name); 160 | if (desktop_suffix) 161 | { 162 | file = g_object_ref (base); 163 | } 164 | else 165 | { 166 | file_type = g_file_query_file_type (base, G_FILE_QUERY_INFO_NONE, NULL); 167 | if (file_type == G_FILE_TYPE_REGULAR) 168 | { 169 | file = g_object_ref (base); 170 | } 171 | else if (file_type == G_FILE_TYPE_DIRECTORY) 172 | { 173 | /* determine the desktop entry name */ 174 | name = g_key_file_get_locale_string (key_file, G_KEY_FILE_DESKTOP_GROUP, 175 | G_KEY_FILE_DESKTOP_KEY_NAME, NULL, NULL); 176 | if (G_UNLIKELY (name == NULL)) 177 | name = g_strdup ("launcher"); 178 | 179 | /* replace invalid file system characters */ 180 | for (s = name; *s != '\0'; ++s) 181 | if (G_IS_DIR_SEPARATOR (*s) || *s == '.') 182 | *s = '_'; 183 | 184 | /* create a unique filename */ 185 | filename = g_strconcat (name, suffix, NULL); 186 | file = g_file_get_child_for_display_name (base, filename, error); 187 | for (n = 0; file != NULL && g_file_query_exists (file, NULL); n++) 188 | { 189 | /* release the previous name */ 190 | g_free (filename); 191 | g_object_unref (file); 192 | 193 | /* generate a new file name */ 194 | filename = g_strdup_printf ("%s%d%s", name, n, suffix); 195 | file = g_file_get_child_for_display_name (base, filename, error); 196 | } 197 | 198 | /* cleanup */ 199 | g_free (filename); 200 | g_free (name); 201 | 202 | if (G_UNLIKELY (file == NULL)) 203 | return NULL; 204 | } 205 | else 206 | { 207 | /* base is not a directory, cannot save */ 208 | g_set_error_literal (error, G_FILE_ERROR, g_file_error_from_errno (ENOTDIR), 209 | _("File location is not a regular file or directory")); 210 | return NULL; 211 | } 212 | } 213 | } 214 | else 215 | { 216 | /* base is the file */ 217 | file = g_object_ref (base); 218 | } 219 | 220 | /* determine the data for the key file */ 221 | data = g_key_file_to_data (key_file, &length, error); 222 | if (G_UNLIKELY (data == NULL)) 223 | { 224 | g_object_unref (file); 225 | return NULL; 226 | } 227 | 228 | /* need to recalculate checksum */ 229 | trust = trust || xfce_g_file_is_trusted (file, NULL, NULL); 230 | 231 | result = g_file_replace_contents (file, data, length, NULL, FALSE, 232 | G_FILE_CREATE_NONE, 233 | NULL, NULL, error); 234 | 235 | if (trust) 236 | trust_launcher (file); 237 | 238 | /* cleanup */ 239 | g_free (data); 240 | 241 | if (result) 242 | { 243 | return file; 244 | } 245 | else 246 | { 247 | g_object_unref (file); 248 | return NULL; 249 | } 250 | } 251 | -------------------------------------------------------------------------------- /exo-desktop-item-edit/exo-die-utils.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2006 Benedikt Meurer . 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef __EXO_DIE_UTILS_H__ 21 | #define __EXO_DIE_UTILS_H__ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | void exo_die_g_key_file_set_locale_value (GKeyFile *key_file, 30 | const gchar *group, 31 | const gchar *key, 32 | const gchar *value); 33 | 34 | GFile *exo_die_g_key_file_save (GKeyFile *key_file, 35 | gboolean create, 36 | gboolean trust, 37 | GFile *base, 38 | ExoDieEditorMode mode, 39 | GError **error); 40 | 41 | G_END_DECLS 42 | 43 | #endif /* !__EXO_DIE_UTILS_H__ */ 44 | -------------------------------------------------------------------------------- /exo-open/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AM_CPPFLAGS = \ 3 | -I$(top_srcdir) \ 4 | -DG_LOG_DOMAIN=\"exo-open\" \ 5 | -DPACKAGE_LOCALE_DIR=\"$(localedir)\" 6 | 7 | bin_PROGRAMS = \ 8 | exo-open 9 | 10 | exo_open_SOURCES = \ 11 | main.c 12 | 13 | exo_open_CFLAGS = \ 14 | $(GTK_CFLAGS) \ 15 | $(LIBXFCE4UTIL_CFLAGS) \ 16 | $(GIO_CFLAGS) \ 17 | $(GIO_UNIX_CFLAGS) 18 | 19 | exo_open_LDFLAGS = \ 20 | -no-undefined 21 | 22 | exo_open_LDADD = \ 23 | $(GTK_LIBS) \ 24 | $(LIBXFCE4UTIL_LIBS) \ 25 | $(GIO_LIBS) \ 26 | $(GIO_UNIX_LIBS) \ 27 | $(top_builddir)/exo/libexo-2.la 28 | 29 | EXTRA_DIST = \ 30 | $(desktop_in_files) 31 | 32 | DISTCLEANFILES = \ 33 | $(desktop_DATA) 34 | 35 | # vi:set ts=8 sw=8 noet ai nocindent syntax=automake: 36 | -------------------------------------------------------------------------------- /exo/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AM_CPPFLAGS = \ 3 | -I$(top_srcdir) \ 4 | -DDATADIR=\"$(datadir)\" \ 5 | -DEXO_COMPILATION \ 6 | -DG_LOG_DOMAIN=\"exo\" \ 7 | -DHELPERDIR=\"$(HELPER_PATH_PREFIX)/xfce4/exo-$(LIBEXO_VERSION_API)\" \ 8 | -DLIBEXO_VERSION_API=\"$(LIBEXO_VERSION_API)\" \ 9 | -DPACKAGE_LOCALE_DIR=\"$(localedir)\" 10 | 11 | libexo_headers = \ 12 | exo-binding.h \ 13 | exo-cell-renderer-icon.h \ 14 | exo-execute.h \ 15 | exo-gdk-pixbuf-extensions.h \ 16 | exo-gtk-extensions.h \ 17 | exo-gobject-extensions.h \ 18 | exo-icon-chooser-dialog.h \ 19 | exo-icon-view.h \ 20 | exo-job.h \ 21 | exo-simple-job.h \ 22 | exo-string.h \ 23 | exo-tree-view.h \ 24 | exo-utils.h 25 | 26 | libexo_2_built_sources = \ 27 | exo-enum-types.h \ 28 | exo-alias.h \ 29 | exo-aliasdef.c \ 30 | exo-enum-types.c \ 31 | exo-marshal.c \ 32 | exo-marshal.h 33 | 34 | libexo_2_includedir = $(includedir)/exo-2/exo 35 | 36 | lib_LTLIBRARIES = libexo-2.la 37 | 38 | libexo_2_include_HEADERS = \ 39 | exo.h \ 40 | exo-binding.h \ 41 | exo-config.h \ 42 | exo-execute.h \ 43 | exo-gdk-pixbuf-extensions.h \ 44 | exo-gtk-extensions.h \ 45 | exo-gobject-extensions.h \ 46 | exo-job.h \ 47 | exo-simple-job.h \ 48 | exo-string.h \ 49 | exo-utils.h \ 50 | exo-icon-chooser-dialog.h \ 51 | exo-icon-chooser-model.h \ 52 | exo-icon-view.h \ 53 | exo-enum-types.h \ 54 | exo-cell-renderer-icon.h \ 55 | exo-thumbnail.h \ 56 | exo-thumbnail-preview.h \ 57 | exo-tree-view.h 58 | 59 | libexo_2_la_SOURCES = \ 60 | $(libexo_2_include_HEADERS) \ 61 | exo-binding.c \ 62 | exo-marshal.c \ 63 | exo-marshal.h \ 64 | exo-private.c \ 65 | exo-private.h \ 66 | exo-config.c \ 67 | exo-execute.c \ 68 | exo-gdk-pixbuf-extensions.c \ 69 | exo-gtk-extensions.c \ 70 | exo-gobject-extensions.c \ 71 | exo-job.c \ 72 | exo-simple-job.c \ 73 | exo-string.c \ 74 | exo-utils.c \ 75 | exo-icon-chooser-dialog.c \ 76 | exo-icon-chooser-model.c \ 77 | exo-icon-view.c \ 78 | exo-enum-types.c \ 79 | exo-cell-renderer-icon.c \ 80 | exo-thumbnail.c \ 81 | exo-thumbnail-preview.c \ 82 | exo-tree-view.c 83 | 84 | libexo_2_la_CFLAGS = \ 85 | $(LIBXFCE4UTIL_CFLAGS) \ 86 | $(GIO_CFLAGS) \ 87 | $(GIO_UNIX_CFLAGS) \ 88 | $(GTK_CFLAGS) 89 | 90 | libexo_2_la_LDFLAGS = \ 91 | -export-dynamic \ 92 | -version-info $(LIBEXO_VERINFO) \ 93 | -export-symbols-regex "^[^_].*" \ 94 | -no-undefined 95 | 96 | libexo_2_la_LIBADD = \ 97 | $(LIBXFCE4UTIL_LIBS) \ 98 | $(GIO_LIBS) \ 99 | $(GIO_UNIX_LIBS) \ 100 | $(GTK_LIBS) \ 101 | -lm 102 | 103 | pkgconfigdir = $(libdir)/pkgconfig 104 | pkgconfig_DATA = exo-2.pc 105 | 106 | ## 107 | ## Rules to auto-generate built sources 108 | ## 109 | ## This is a bit tricky with automake, and non-trivial to implement. The 110 | ## rules below seem to work fine and don't seem to break the build, but 111 | ## they are only enabled in maintainer mode, so arbitrary users don't get 112 | ## trapped in automake's oddities. Therefore we ship the autogenerated 113 | ## files as part of the dist tarball. 114 | ## 115 | if MAINTAINER_MODE 116 | CLEANFILES = \ 117 | actual-abi \ 118 | expected-abi \ 119 | xgen-eetc \ 120 | xgen-eeth \ 121 | xgen-emc \ 122 | xgen-emh 123 | 124 | DISTCLEANFILES = \ 125 | stamp-exo-enum-types.h \ 126 | stamp-exo-marshal.h \ 127 | $(libexo_2_built_sources) 128 | 129 | BUILT_SOURCES = \ 130 | $(libexo_2_built_sources) 131 | 132 | exo-alias.h: make-exo-alias.pl exo.symbols 133 | $(AM_V_GEN) $(PERL) $(srcdir)/make-exo-alias.pl < $(srcdir)/exo.symbols > exo-alias.h 134 | 135 | exo-aliasdef.c: make-exo-alias.pl exo.symbols 136 | $(AM_V_GEN) $(PERL) $(srcdir)/make-exo-alias.pl -def < $(srcdir)/exo.symbols > exo-aliasdef.c 137 | 138 | exo-enum-types.h: stamp-exo-enum-types.h 139 | @true 140 | stamp-exo-enum-types.h: $(libexo_headers) Makefile 141 | $(AM_V_GEN) ( cd $(srcdir) && glib-mkenums \ 142 | --fhead "#ifndef __EXO_ENUM_TYPES_H__\n#define __EXO_ENUM_TYPES_H__\n#include \nG_BEGIN_DECLS\n" \ 143 | --fprod "/* enumerations from \"@filename@\" */\n" \ 144 | --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define EXO_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ 145 | --ftail "G_END_DECLS\n\n#endif /* !__EXO_ENUM_TYPES_H__ */" \ 146 | $(libexo_headers) ) >> xgen-eeth \ 147 | && (cmp -s xgen-eeth exo-enum-types.h || cp xgen-eeth exo-enum-types.h ) \ 148 | && rm -f xgen-eeth \ 149 | && echo timestamp > $(@F) 150 | 151 | exo-enum-types.c: $(libexo_headers) Makefile 152 | $(AM_V_GEN) ( cd $(srcdir) && glib-mkenums \ 153 | --fhead "#undef GTK_DISABLE_DEPRECATED\n#define GTK_ENABLE_BROKEN\n#include \n#include \n" \ 154 | --fprod "\n/* enumerations from \"@filename@\" */" \ 155 | --vhead "GType\n@enum_name@_get_type (void)\n{\n\tstatic GType type = 0;\n\tif (type == 0) {\n\tstatic const G@Type@Value values[] = {"\ 156 | --vprod "\t{ @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ 157 | --vtail "\t{ 0, NULL, NULL }\n\t};\n\ttype = g_@type@_register_static (\"@EnumName@\", values);\n }\n\treturn type;\n}\n" \ 158 | --ftail "\n#define __EXO_ENUM_TYPES_C__\n#include \n" \ 159 | $(libexo_headers) ) >> xgen-eetc \ 160 | && cp xgen-eetc exo-enum-types.c \ 161 | && rm -f xgen-eetc 162 | 163 | exo-marshal.h: stamp-exo-marshal.h 164 | @true 165 | stamp-exo-marshal.h: exo-marshal.list Makefile 166 | $(AM_V_GEN) ( cd $(srcdir) && glib-genmarshal \ 167 | --prefix=_exo_marshal \ 168 | --header exo-marshal.list ) >> xgen-emh \ 169 | && ( cmp -s xgen-emh exo-marshal.h || cp xgen-emh exo-marshal.h ) \ 170 | && rm -f xgen-emh \ 171 | && echo timestamp > $(@F) 172 | 173 | exo-marshal.c: exo-marshal.list Makefile 174 | $(AM_V_GEN) echo "#include " > xgen-emc \ 175 | && ( cd $(srcdir) && glib-genmarshal \ 176 | --prefix=_exo_marshal \ 177 | --body exo-marshal.list ) >> xgen-emc \ 178 | && cp xgen-emc exo-marshal.c \ 179 | && rm -f xgen-emc 180 | endif 181 | 182 | 183 | # required for gtk-doc 184 | dist-hook: all 185 | 186 | EXTRA_DIST = \ 187 | abicheck.sh \ 188 | exo.symbols \ 189 | exo-alias.h \ 190 | exo-aliasdef.c \ 191 | exo-icon-view-accessible.c \ 192 | exo-marshal.list \ 193 | make-exo-alias.pl 194 | 195 | if HAVE_GNUC_VISIBILITY 196 | TESTS = \ 197 | abicheck.sh 198 | endif 199 | 200 | # vi:set ts=8 sw=8 noet ai nocindent syntax=automake: 201 | -------------------------------------------------------------------------------- /exo/abicheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (c) 2004 The GLib Development Team. 4 | # Copyright (c) 2005 Benedikt Meurer . 5 | # Copyright (c) 2011 Guido Berhoerster 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; version 2 of the License ONLY. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program; if not, write to the Free Software 18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | # MA 02110-1301 USA 20 | # 21 | 22 | trap 'rm expected-abi actual-abi' EXIT 23 | ${CPP:-cpp} -DINCLUDE_INTERNAL_SYMBOLS -DINCLUDE_VARIABLES -DALL_FILES ${srcdir:-.}/exo.symbols | sed 's/ G_GNUC.*$//;s/ PRIVATE//;/^ *$/d;/^#/d' | sort >expected-abi 24 | ${NM:-nm} -D -g -P .libs/libexo-2.so | awk '$2~/^[DRTG]$/&&$1~/^[^_]/{print $1}' | sort >actual-abi 25 | diff -u expected-abi actual-abi 26 | -------------------------------------------------------------------------------- /exo/exo-2.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | exo_api_version=@LIBEXO_VERSION_API@ 7 | 8 | Name: @PACKAGE_TARNAME@ 9 | Description: Extension library for Xfce 10 | Requires: gtk+-3.0 libxfce4util-1.0 11 | Version: @PACKAGE_VERSION@ 12 | Libs: -L${libdir} -lexo-${exo_api_version} 13 | Cflags: -I${includedir}/exo-${exo_api_version} 14 | -------------------------------------------------------------------------------- /exo/exo-binding.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004 os-cillation e.K. 3 | * Copyright (c) 2004 Victor Porton (http://ex-code.com/~porton/) 4 | * 5 | * Written by Benedikt Meurer . 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Library General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 20 | * MA 02110-1301 USA 21 | */ 22 | 23 | #if !defined (EXO_INSIDE_EXO_H) && !defined (EXO_COMPILATION) 24 | #error "Only can be included directly, this file may disappear or change contents." 25 | #endif 26 | 27 | #ifndef __EXO_BINDING_H__ 28 | #define __EXO_BINDING_H__ 29 | 30 | #include 31 | 32 | G_BEGIN_DECLS 33 | 34 | typedef struct _ExoBinding ExoBinding; 35 | typedef struct _ExoMutualBinding ExoMutualBinding; 36 | 37 | /** 38 | * ExoBindingTransform: 39 | * @src_value : Value to transform. 40 | * @dst_value : Value to store the result of the transformation into. 41 | * @user_data : User data supplied at binding creation. 42 | * 43 | * Function type used for binding transformation functions. 44 | * 45 | * Accomplished transformation from @src_value to @dst_value. 46 | * @src_value and @dst_value are already initialized before 47 | * this function gets called. 48 | * 49 | * Returns: %FALSE if transformation failed, else %TRUE. 50 | **/ 51 | typedef gboolean (*ExoBindingTransform) (const GValue *src_value, 52 | GValue *dst_value, 53 | gpointer user_data); 54 | 55 | 56 | 57 | ExoBinding *exo_binding_new (GObject *src_object, 58 | const gchar *src_property, 59 | GObject *dst_object, 60 | const gchar *dst_property) 61 | G_GNUC_DEPRECATED_FOR (g_object_bind_property() with G_BINDING_SYNC_CREATE flag); 62 | ExoBinding *exo_binding_new_full (GObject *src_object, 63 | const gchar *src_property, 64 | GObject *dst_object, 65 | const gchar *dst_property, 66 | ExoBindingTransform transform, 67 | GDestroyNotify destroy_notify, 68 | gpointer user_data) 69 | G_GNUC_DEPRECATED_FOR (g_object_bind_property_full() with G_BINDING_SYNC_CREATE flag); 70 | ExoBinding *exo_binding_new_with_negation (GObject *src_object, 71 | const gchar *src_property, 72 | GObject *dst_object, 73 | const gchar *dst_property) 74 | G_GNUC_DEPRECATED_FOR (g_object_bind_property() with G_BINDING_INVERT_BOOLEAN | G_BINDING_SYNC_CREATE flag); 75 | void exo_binding_unbind (ExoBinding *binding) 76 | G_GNUC_DEPRECATED_FOR (g_binding_unbind() or g_object_unref()); 77 | 78 | ExoMutualBinding *exo_mutual_binding_new (GObject *object1, 79 | const gchar *property1, 80 | GObject *object2, 81 | const gchar *property2) 82 | G_GNUC_DEPRECATED_FOR (g_object_bind_property() with G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE flag); 83 | ExoMutualBinding *exo_mutual_binding_new_full (GObject *object1, 84 | const gchar *property1, 85 | GObject *object2, 86 | const gchar *property2, 87 | ExoBindingTransform transform, 88 | ExoBindingTransform reverse_transform, 89 | GDestroyNotify destroy_notify, 90 | gpointer user_data) 91 | G_GNUC_DEPRECATED_FOR (g_object_bind_property_full() with G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE flag); 92 | ExoMutualBinding *exo_mutual_binding_new_with_negation (GObject *object1, 93 | const gchar *property1, 94 | GObject *object2, 95 | const gchar *property2) 96 | G_GNUC_DEPRECATED_FOR (g_object_bind_property() with G_BINDING_INVERT_BOOLEAN | G_BINDING_SYNC_CREATE flag); 97 | void exo_mutual_binding_unbind (ExoMutualBinding *binding) 98 | G_GNUC_DEPRECATED_FOR (g_binding_unbind() or g_object_unref()); 99 | 100 | G_END_DECLS 101 | 102 | #endif /* !__EXO_BINDING_H__ */ 103 | -------------------------------------------------------------------------------- /exo/exo-cell-renderer-icon.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2005-2006 Benedikt Meurer . 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #if !defined (EXO_INSIDE_EXO_H) && !defined (EXO_COMPILATION) 21 | #error "Only can be included directly, this file may disappear or change contents." 22 | #endif 23 | 24 | #ifndef __EXO_CELL_RENDERER_ICON_H__ 25 | #define __EXO_CELL_RENDERER_ICON_H__ 26 | 27 | #include 28 | 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | typedef struct _ExoCellRendererIconPrivate ExoCellRendererIconPrivate; 34 | typedef struct _ExoCellRendererIconClass ExoCellRendererIconClass; 35 | typedef struct _ExoCellRendererIcon ExoCellRendererIcon; 36 | 37 | #define EXO_TYPE_CELL_RENDERER_ICON (exo_cell_renderer_icon_get_type ()) 38 | #define EXO_CELL_RENDERER_ICON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXO_TYPE_CELL_RENDERER_ICON, ExoCellRendererIcon)) 39 | #define EXO_CELL_RENDERER_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXO_TYPE_CELL_RENDERER_ICON, ExoCellRendererIconClass)) 40 | #define EXO_IS_CELL_RENDERER_ICON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXO_TYPE_CELL_RENDERER_ICON)) 41 | #define EXO_IS_CELL_RENDERER_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXO_TYPE_CELL_RENDERER_ICON)) 42 | #define EXO_CELL_RENDERER_ICON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXO_TYPE_CELL_RENDERER_ICON, ExoCellRendererIconClass)) 43 | 44 | struct _ExoCellRendererIconClass 45 | { 46 | /*< private >*/ 47 | GtkCellRendererClass __parent__; 48 | 49 | /* reserved for future expansion */ 50 | void (*reserved1) (void); 51 | void (*reserved2) (void); 52 | void (*reserved3) (void); 53 | void (*reserved4) (void); 54 | void (*reserved5) (void); 55 | void (*reserved6) (void); 56 | }; 57 | 58 | /** 59 | * ExoCellRendererIcon: 60 | * 61 | * The #ExoIconChooserDialog struct contains only private fields and 62 | * should not be directly accessed. 63 | **/ 64 | struct _ExoCellRendererIcon 65 | { 66 | /*< private >*/ 67 | GtkCellRenderer __parent__; 68 | }; 69 | 70 | GType exo_cell_renderer_icon_get_type (void) G_GNUC_CONST; 71 | 72 | G_DEPRECATED_FOR (xfce_cell_renderer_icon_new) 73 | GtkCellRenderer *exo_cell_renderer_icon_new (void) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; 74 | 75 | G_END_DECLS 76 | 77 | #endif /* !__EXO_CELL_RENDERER_ICON_H__ */ 78 | -------------------------------------------------------------------------------- /exo/exo-config.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004 os-cillation e.K. 3 | * 4 | * Written by Benedikt Meurer . 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library 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 Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | * MA 02110-1301 USA 20 | */ 21 | 22 | #ifdef HAVE_CONFIG_H 23 | #include 24 | #endif 25 | 26 | #include 27 | #include 28 | 29 | /** 30 | * SECTION: exo-config 31 | * @title: Version Information 32 | * @short_description: Variables and macros to check the exo version 33 | * @include: exo/exo.h 34 | * 35 | * Exo provides version information, primarily useful in configure for 36 | * builds that have a configure script. Applications may use it to 37 | * check if a certain feature is available in the version of libexo 38 | * they are being built against or being linked with. 39 | **/ 40 | 41 | /** 42 | * exo_major_version: 43 | * 44 | * The major version number of the exo library (e.g. in exo 1.2.3 this is 1). 45 | * 46 | * This variable is in the library, and therefore represents the exo 47 | * library you have linked against. Contrast with the #EXO_MAJOR_VERSION 48 | * macro, which represents the major version of the libexo headers you 49 | * have included. 50 | **/ 51 | const guint exo_major_version = EXO_MAJOR_VERSION; 52 | 53 | /** 54 | * exo_minor_version: 55 | * 56 | * The minor version number of the exo library (e.g. in exo 1.2.3 this is 2). 57 | * 58 | * This variable is in the library, and therefore represents the exo 59 | * library you have linked against. Contrast with the #EXO_MINOR_VERSION 60 | * macro, which represents the minor version of the libexo headers you 61 | * have included. 62 | **/ 63 | const guint exo_minor_version = EXO_MINOR_VERSION; 64 | 65 | /** 66 | * exo_micro_version: 67 | * 68 | * The micro version number of the exo library (e.g. in exo 1.2.3 this is 3). 69 | * 70 | * This variable is in the library, and therefore represents the exo 71 | * library you have linked against. Contrast with the #EXO_MICRO_VERSION 72 | * macro, which represents the micro version of the libexo headers you 73 | * have included. 74 | **/ 75 | const guint exo_micro_version = EXO_MICRO_VERSION; 76 | 77 | 78 | 79 | /** 80 | * exo_check_version: 81 | * @required_major : the required major version. 82 | * @required_minor : the required minor version. 83 | * @required_micro : the required micro version. 84 | * 85 | * Checks that the exo library 86 | * in use is compatible with the given version. Generally you would pass in 87 | * the constants #EXO_MAJOR_VERSION, #EXO_MINOR_VERSION and #EXO_MICRO_VERSION 88 | * as the three arguments to this function; that produces 89 | * a check that the library in use is compatible with the version of 90 | * exo the application was 91 | * compiled against. 92 | * 93 | * 94 | * Checking the runtime version of the exo library 95 | * 96 | * const gchar *mismatch; 97 | * mismatch = exo_check_version (EXO_VERSION_MAJOR, 98 | * EXO_VERSION_MINOR, 99 | * EXO_VERSION_MICRO); 100 | * if (G_UNLIKELY (mismatch != NULL)) 101 | * g_error ("Version mismatch: %s", mismatch); 102 | * 103 | * 104 | * 105 | * Returns: %NULL if the library is compatible with the given version, 106 | * or a string describing the version mismatch. The returned 107 | * string is owned by the library and must not be freed or 108 | * modified by the caller. 109 | * 110 | * Since: 0.3.1 111 | **/ 112 | const gchar* 113 | exo_check_version (guint required_major, 114 | guint required_minor, 115 | guint required_micro) 116 | { 117 | return NULL; 118 | } 119 | 120 | 121 | 122 | #define __EXO_CONFIG_C__ 123 | #include 124 | -------------------------------------------------------------------------------- /exo/exo-config.h.in: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004-2006 os-cillation e.K. 3 | * 4 | * Written by Benedikt Meurer . 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library 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 Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | * MA 02110-1301 USA 20 | */ 21 | 22 | #if !defined (EXO_INSIDE_EXO_H) && !defined (EXO_COMPILATION) 23 | #error "Only can be included directly, this file may disappear or change contents." 24 | #endif 25 | 26 | #ifndef __EXO_CONFIG_H__ 27 | #define __EXO_CONFIG_H__ 28 | 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | /** 34 | * EXO_MAJOR_VERSION: 35 | * 36 | * Like #exo_major_version, but from the headers used at application 37 | * compile time, rather than from the library linked against at 38 | * application run time. 39 | **/ 40 | #define EXO_MAJOR_VERSION @LIBEXO_VERSION_MAJOR@ 41 | 42 | /** 43 | * EXO_MINOR_VERSION: 44 | * 45 | * Like #exo_minor_version, but from the headers used at application 46 | * compile time, rather than from the library linked against at 47 | * application run time. 48 | **/ 49 | #define EXO_MINOR_VERSION @LIBEXO_VERSION_MINOR@ 50 | 51 | /** 52 | * EXO_MICRO_VERSION: 53 | * 54 | * Like #exo_micro_version, but from the headers used at application 55 | * compile time, rather than from the library linked against at 56 | * application run time. 57 | **/ 58 | #define EXO_MICRO_VERSION @LIBEXO_VERSION_MICRO@ 59 | 60 | /** 61 | * EXO_CHECK_VERSION: 62 | * @major: major version (e.g. 1 for version 1.2.3) 63 | * @minor: minor version (e.g. 2 for version 1.2.3) 64 | * @micro: micro version (e.g. 3 for version 1.2.3) 65 | * 66 | * Checks the exo version. 67 | * 68 | * Returns: %TRUE if the version of the exo header files is equal or 69 | * better than the passed-in version. 70 | **/ 71 | #define EXO_CHECK_VERSION(major, minor, micro) \ 72 | (EXO_MAJOR_VERSION > (major) \ 73 | || (EXO_MAJOR_VERSION == (major) \ 74 | && EXO_MINOR_VERSION > (minor)) \ 75 | || (EXO_MAJOR_VERSION == (major) \ 76 | && EXO_MINOR_VERSION == (minor) \ 77 | && EXO_MICRO_VERSION >= (micro))) 78 | 79 | extern const guint exo_major_version; 80 | extern const guint exo_minor_version; 81 | extern const guint exo_micro_version; 82 | 83 | const gchar *exo_check_version (guint required_major, 84 | guint required_minor, 85 | guint required_micro); 86 | 87 | /* verify that G_GNUC_NULL_TERMINATED is defined */ 88 | #if !defined(G_GNUC_NULL_TERMINATED) 89 | #if __GNUC__ >= 4 90 | #define G_GNUC_NULL_TERMINATED __attribute__((__sentinel__)) 91 | #else 92 | #define G_GNUC_NULL_TERMINATED 93 | #endif /* __GNUC__ */ 94 | #endif /* !defined(G_GNUC_NULL_TERMINATED) */ 95 | 96 | /* verify that G_GNUC_WARN_UNUSED_RESULT is defined */ 97 | #if !defined(G_GNUC_WARN_UNUSED_RESULT) 98 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) 99 | #define G_GNUC_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) 100 | #else 101 | #define G_GNUC_WARN_UNUSED_RESULT 102 | #endif /* __GNUC__ */ 103 | #endif /* !defined(G_GNUC_WARN_UNUSED_RESULT) */ 104 | 105 | /* shorter macros for the GParamSpecs with static strings */ 106 | #define EXO_PARAM_READABLE (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS) 107 | #define EXO_PARAM_WRITABLE (G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS) 108 | #define EXO_PARAM_READWRITE (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS) 109 | 110 | G_END_DECLS 111 | 112 | #endif /* !__EXO_CONFIG_H__ */ 113 | -------------------------------------------------------------------------------- /exo/exo-execute.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2005-2006 Benedikt Meurer . 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #if !defined (EXO_INSIDE_EXO_H) && !defined (EXO_COMPILATION) 21 | #error "Only can be included directly, this file may disappear or change contents." 22 | #endif 23 | 24 | #ifndef __EXO_EXECUTE_H__ 25 | #define __EXO_EXECUTE_H__ 26 | 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | G_DEPRECATED_FOR (xfce_execute_preferred_application) 32 | gboolean exo_execute_preferred_application (const gchar *category, 33 | const gchar *parameter, 34 | const gchar *working_directory, 35 | gchar **envp, 36 | GError **error); 37 | G_DEPRECATED_FOR (xfce_execute_preferred_application) 38 | gboolean exo_execute_preferred_application_on_screen (const gchar *category, 39 | const gchar *parameter, 40 | const gchar *working_directory, 41 | gchar **envp, 42 | GdkScreen *screen, 43 | GError **error); 44 | 45 | G_DEPRECATED_FOR (xfce_execute_terminal_shell) 46 | gboolean exo_execute_terminal_shell (const gchar *command_line, 47 | const gchar *working_directory, 48 | gchar **envp, 49 | GError **error); 50 | G_DEPRECATED_FOR (xfce_execute_terminal_shell) 51 | gboolean exo_execute_terminal_shell_on_screen (const gchar *command_line, 52 | const gchar *working_directory, 53 | gchar **envp, 54 | GdkScreen *screen, 55 | GError **error); 56 | 57 | G_END_DECLS 58 | 59 | #endif /* !__EXO_EXECUTE_H__ */ 60 | -------------------------------------------------------------------------------- /exo/exo-gdk-pixbuf-extensions.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004-2006 os-cillation e.K. 3 | * 4 | * Written by Benedikt Meurer . 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library 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 Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | * MA 02110-1301 USA 20 | */ 21 | 22 | #if !defined (EXO_INSIDE_EXO_H) && !defined (EXO_COMPILATION) 23 | #error "Only can be included directly, this file may disappear or change contents." 24 | #endif 25 | 26 | #ifndef __EXO_GDK_PIXBUF_EXTENSIONS_H__ 27 | #define __EXO_GDK_PIXBUF_EXTENSIONS_H__ 28 | 29 | #include 30 | 31 | #include 32 | 33 | G_BEGIN_DECLS 34 | 35 | G_DEPRECATED 36 | GdkPixbuf *exo_gdk_pixbuf_colorize (const GdkPixbuf *source, 37 | const GdkColor *color) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; 38 | 39 | G_DEPRECATED_FOR (xfce_gdk_pixbuf_frame) 40 | GdkPixbuf *exo_gdk_pixbuf_frame (const GdkPixbuf *source, 41 | const GdkPixbuf *frame, 42 | gint left_offset, 43 | gint top_offset, 44 | gint right_offset, 45 | gint bottom_offset) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; 46 | 47 | G_DEPRECATED_FOR (xfce_gdk_pixbuf_lucent) 48 | GdkPixbuf *exo_gdk_pixbuf_lucent (const GdkPixbuf *source, 49 | guint percent) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; 50 | 51 | G_DEPRECATED 52 | GdkPixbuf *exo_gdk_pixbuf_spotlight (const GdkPixbuf *source) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; 53 | 54 | G_DEPRECATED_FOR (xfce_gdk_pixbuf_scale_down) 55 | GdkPixbuf *exo_gdk_pixbuf_scale_down (GdkPixbuf *source, 56 | gboolean preserve_aspect_ratio, 57 | gint dest_width, 58 | gint dest_height) G_GNUC_WARN_UNUSED_RESULT; 59 | 60 | G_DEPRECATED_FOR (xfce_gdk_pixbuf_scale_ratio) 61 | GdkPixbuf *exo_gdk_pixbuf_scale_ratio (GdkPixbuf *source, 62 | gint dest_size) G_GNUC_WARN_UNUSED_RESULT; 63 | 64 | G_DEPRECATED_FOR (xfce_gdk_pixbuf_new_from_file_at_max_size) 65 | GdkPixbuf *exo_gdk_pixbuf_new_from_file_at_max_size (const gchar *filename, 66 | gint max_width, 67 | gint max_height, 68 | gboolean preserve_aspect_ratio, 69 | GError **error) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; 70 | 71 | G_END_DECLS 72 | 73 | #endif /* !__EXO_GDK_PIXBUF_EXTENSIONS_H__ */ 74 | -------------------------------------------------------------------------------- /exo/exo-gobject-extensions.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004 os-cillation e.K. 3 | * 4 | * Written by Benedikt Meurer . 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library 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 Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | * MA 02110-1301 USA 20 | */ 21 | 22 | #ifdef HAVE_CONFIG_H 23 | #include 24 | #endif 25 | 26 | #include 27 | #include 28 | 29 | /** 30 | * SECTION: exo-gobject-extensions 31 | * @title: Extensions to GObject 32 | * @short_description: Miscelleanous extensions to the gdk-pixbuf library 33 | * @include: exo/exo.h 34 | * @see_also: 35 | * GObject Reference Manual 36 | * 37 | * This facility includes several functions to extend the basic 38 | * functionality provided by the GObject library. 39 | **/ 40 | 41 | 42 | 43 | /** 44 | * exo_g_value_transform_negate: 45 | * @src_value : A value convertible to gboolean. 46 | * @dst_value : A value which can be assigned a gboolean. 47 | * 48 | * Applies boolean negation to @src_value and stores the result 49 | * in @dst_value. 50 | * 51 | * This function is mostly useful for binding boolean properties 52 | * with inversing. 53 | * 54 | * Deprecated: xfce 4.18: Rarely used API 55 | * 56 | * Returns: %TRUE on successful transformation. 57 | **/ 58 | gboolean 59 | exo_g_value_transform_negate (const GValue *src_value, 60 | GValue *dst_value) 61 | { 62 | if (g_value_transform (src_value, dst_value)) 63 | { 64 | g_value_set_boolean (dst_value, !g_value_get_boolean (dst_value)); 65 | return TRUE; 66 | } 67 | 68 | return FALSE; 69 | } 70 | 71 | 72 | 73 | #define __EXO_GOBJECT_EXTENSIONS_C__ 74 | #include 75 | -------------------------------------------------------------------------------- /exo/exo-gobject-extensions.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004 os-cillation e.K. 3 | * 4 | * Written by Benedikt Meurer . 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library 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 Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | * MA 02110-1301 USA 20 | */ 21 | 22 | #if !defined (EXO_INSIDE_EXO_H) && !defined (EXO_COMPILATION) 23 | #error "Only can be included directly, this file may disappear or change contents." 24 | #endif 25 | 26 | #ifndef __EXO_GOBJECT_EXTENSIONS_H__ 27 | #define __EXO_GOBJECT_EXTENSIONS_H__ 28 | 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | G_DEPRECATED 34 | gboolean exo_g_value_transform_negate (const GValue *src_value, 35 | GValue *dst_value); 36 | 37 | G_END_DECLS 38 | 39 | #endif /* !__EXO_GOBJECT_EXTENSIONS_H__ */ 40 | -------------------------------------------------------------------------------- /exo/exo-gtk-extensions.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004-2006 os-cillation e.K. 3 | * 4 | * Written by Benedikt Meurer . 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library 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 Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | * MA 02110-1301 USA 20 | */ 21 | 22 | #if !defined (EXO_INSIDE_EXO_H) && !defined (EXO_COMPILATION) 23 | #error "Only can be included directly, this file may disappear or change contents." 24 | #endif 25 | 26 | #ifndef __EXO_GTK_EXTENSIONS_H__ 27 | #define __EXO_GTK_EXTENSIONS_H__ 28 | 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | G_DEPRECATED 34 | void exo_gtk_object_destroy_later (GtkWidget *object); 35 | 36 | G_DEPRECATED_FOR (xfce_gtk_file_chooser_add_thumbnail_preview) 37 | void exo_gtk_file_chooser_add_thumbnail_preview (GtkFileChooser *chooser); 38 | 39 | G_DEPRECATED_FOR (xfce_gtk_url_about_dialog_hook) 40 | void exo_gtk_url_about_dialog_hook (GtkAboutDialog *about_dialog, 41 | const gchar *address, 42 | gpointer user_data); 43 | 44 | G_DEPRECATED_FOR (xfce_gtk_dialog_get_action_area) 45 | GtkWidget * exo_gtk_dialog_get_action_area (GtkDialog *dialog); 46 | 47 | G_DEPRECATED 48 | void exo_gtk_dialog_add_secondary_button (GtkDialog *dialog, 49 | GtkWidget *button); 50 | G_DEPRECATED 51 | void exo_gtk_position_search_box (GtkWidget *view, 52 | GtkWidget *search_dialog, 53 | gpointer user_data); 54 | G_END_DECLS 55 | 56 | #endif /* !__EXO_GTK_EXTENSIONS_H__ */ 57 | -------------------------------------------------------------------------------- /exo/exo-icon-chooser-dialog.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2005-2006 Benedikt Meurer 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #if !defined (EXO_INSIDE_EXO_H) && !defined (EXO_COMPILATION) 21 | #error "Only can be included directly, this file may disappear or change contents." 22 | #endif 23 | 24 | #ifndef __EXO_ICON_CHOOSER_DIALOG_H__ 25 | #define __EXO_ICON_CHOOSER_DIALOG_H__ 26 | 27 | #include 28 | 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | typedef struct _ExoIconChooserDialogPrivate ExoIconChooserDialogPrivate; 34 | typedef struct _ExoIconChooserDialogClass ExoIconChooserDialogClass; 35 | typedef struct _ExoIconChooserDialog ExoIconChooserDialog; 36 | 37 | #define EXO_TYPE_ICON_CHOOSER_DIALOG (exo_icon_chooser_dialog_get_type ()) 38 | #define EXO_ICON_CHOOSER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXO_TYPE_ICON_CHOOSER_DIALOG, ExoIconChooserDialog)) 39 | #define EXO_ICON_CHOOSER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXO_TYPE_ICON_CHOOSER_DIALOG, ExoIconChooserDialogClass)) 40 | #define EXO_IS_ICON_CHOOSER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXO_TYPE_ICON_CHOOSER_DIALOG)) 41 | #define EXO_IS_ICON_CHOOSER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXO_TYPE_ICON_CHOOSER_DIALOG)) 42 | #define EXO_ICON_CHOOSER_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXO_TYPE_ICON_CHOOSER_DIALOG, ExoIconChooserDialogClass)) 43 | 44 | struct _ExoIconChooserDialogClass 45 | { 46 | /*< private >*/ 47 | GtkDialogClass __parent__; 48 | 49 | /* reserved for future expansion */ 50 | void (*reserved1) (void); 51 | void (*reserved2) (void); 52 | void (*reserved3) (void); 53 | void (*reserved4) (void); 54 | void (*reserved5) (void); 55 | void (*reserved6) (void); 56 | }; 57 | 58 | /** 59 | * ExoIconChooserDialog: 60 | * 61 | * The #ExoIconChooserDialog class provides an easy to use dialog to ask 62 | * the user to select either a named icon from the selected icon theme, 63 | * or an image file from the local file system. 64 | **/ 65 | struct _ExoIconChooserDialog 66 | { 67 | /*< private >*/ 68 | GtkDialog __parent__; 69 | }; 70 | 71 | GType exo_icon_chooser_dialog_get_type (void) G_GNUC_CONST; 72 | 73 | G_DEPRECATED_FOR (xfce_icon_chooser_dialog_new) 74 | GtkWidget *exo_icon_chooser_dialog_new (const gchar *title, 75 | GtkWindow *parent, 76 | const gchar *first_button_text, 77 | ...) G_GNUC_MALLOC G_GNUC_NULL_TERMINATED G_GNUC_WARN_UNUSED_RESULT; 78 | 79 | G_DEPRECATED_FOR (xfce_icon_chooser_dialog_get_icon) 80 | gchar *exo_icon_chooser_dialog_get_icon (ExoIconChooserDialog *icon_chooser_dialog) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; 81 | G_DEPRECATED_FOR (xfce_icon_chooser_dialog_set_icon) 82 | gboolean exo_icon_chooser_dialog_set_icon (ExoIconChooserDialog *icon_chooser_dialog, 83 | const gchar *icon); 84 | 85 | G_END_DECLS 86 | 87 | #endif /* !__EXO_ICON_CHOOSER_DIALOG_H__ */ 88 | -------------------------------------------------------------------------------- /exo/exo-icon-chooser-model.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2005-2006 Benedikt Meurer 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #if !defined (EXO_COMPILATION) 21 | #error "Only can be included directly, this file is not part of the public API." 22 | #endif 23 | 24 | #ifndef __EXO_ICON_CHOOSER_MODEL_H__ 25 | #define __EXO_ICON_CHOOSER_MODEL_H__ 26 | 27 | #include 28 | 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | typedef struct _ExoIconChooserModelClass ExoIconChooserModelClass; 34 | typedef struct _ExoIconChooserModel ExoIconChooserModel; 35 | 36 | #define EXO_TYPE_ICON_CHOOSER_MODEL (exo_icon_chooser_model_get_type ()) 37 | #define EXO_ICON_CHOOSER_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXO_TYPE_ICON_CHOOSER_MODEL, ExoIconChooserModel)) 38 | #define EXO_ICON_CHOOSER_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXO_TYPE_ICON_CHOOSER_MODEL, ExoIconChooserModelClass)) 39 | #define EXO_IS_ICON_CHOOSER_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXO_TYPE_ICON_CHOOSER_MODEL)) 40 | #define EXO_IS_ICON_CHOOSER_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXO_TYPE_ICON_CHOOSER_MODEL)) 41 | #define EXO_ICON_CHOOSER_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXO_TYPE_ICON_CHOOSER_MODEL, ExoIconChooserModelClass)) 42 | 43 | /** 44 | * ExoIconChooserContexts: 45 | * 46 | * The list of default contexts for the icon themes 47 | * according to the Icon Naming Spec, Version 0.7. 48 | **/ 49 | typedef enum 50 | { 51 | /* the contexts provided by the model */ 52 | EXO_ICON_CHOOSER_CONTEXT_ACTIONS, 53 | EXO_ICON_CHOOSER_CONTEXT_ANIMATIONS, 54 | EXO_ICON_CHOOSER_CONTEXT_APPLICATIONS, 55 | EXO_ICON_CHOOSER_CONTEXT_CATEGORIES, 56 | EXO_ICON_CHOOSER_CONTEXT_DEVICES, 57 | EXO_ICON_CHOOSER_CONTEXT_EMBLEMS, 58 | EXO_ICON_CHOOSER_CONTEXT_EMOTES, 59 | EXO_ICON_CHOOSER_CONTEXT_MIME_TYPES, 60 | EXO_ICON_CHOOSER_CONTEXT_PLACES, 61 | EXO_ICON_CHOOSER_CONTEXT_STATUS, 62 | EXO_ICON_CHOOSER_CONTEXT_STOCK, 63 | EXO_ICON_CHOOSER_CONTEXT_OTHER, 64 | EXO_ICON_CHOOSER_N_CONTEXTS, 65 | 66 | /* not provided by the model (plus separators before them) */ 67 | EXO_ICON_CHOOSER_CONTEXT_ALL = EXO_ICON_CHOOSER_CONTEXT_OTHER + 2, 68 | EXO_ICON_CHOOSER_CONTEXT_FILE = EXO_ICON_CHOOSER_CONTEXT_OTHER + 4, 69 | EXO_ICON_CHOOSER_CONTEXT_NO_ICON = EXO_ICON_CHOOSER_CONTEXT_OTHER + 6, 70 | } ExoIconChooserContext; 71 | 72 | /** 73 | * ExoIconChooserModelColumns: 74 | * @EXO_ICON_CHOOSER_MODEL_COLUMN_CONTEXT : the context of the icon. 75 | * @EXO_ICON_CHOOSER_MODEL_COLUMN_ICON_NAME : the name of the icon. 76 | * @EXO_ICON_CHOOSER_MODEL_N_COLUMNS : the number of columns. 77 | * 78 | * The columns provided by the #ExoIconChooserModel. 79 | **/ 80 | typedef enum 81 | { 82 | EXO_ICON_CHOOSER_MODEL_COLUMN_CONTEXT, 83 | EXO_ICON_CHOOSER_MODEL_COLUMN_ICON_NAME, 84 | EXO_ICON_CHOOSER_MODEL_N_COLUMNS, 85 | } ExoIconChooserModelColumn; 86 | 87 | G_GNUC_INTERNAL GType exo_icon_chooser_model_get_type (void) G_GNUC_CONST; 88 | 89 | G_GNUC_INTERNAL ExoIconChooserModel *_exo_icon_chooser_model_get_for_widget (GtkWidget *widget) G_GNUC_WARN_UNUSED_RESULT; 90 | G_GNUC_INTERNAL ExoIconChooserModel *_exo_icon_chooser_model_get_for_icon_theme (GtkIconTheme *icon_theme) G_GNUC_WARN_UNUSED_RESULT; 91 | 92 | G_GNUC_INTERNAL gboolean _exo_icon_chooser_model_get_iter_for_icon_name (ExoIconChooserModel *model, 93 | GtkTreeIter *iter, 94 | const gchar *icon_name); 95 | 96 | G_END_DECLS 97 | 98 | #endif /* !__EXO_ICON_CHOOSER_MODEL_H__ */ 99 | -------------------------------------------------------------------------------- /exo/exo-job.h: -------------------------------------------------------------------------------- 1 | /* vi:set et ai sw=2 sts=2 ts=2: */ 2 | /*- 3 | * Copyright (c) 2009 Jannis Pohlmann 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library 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 | * 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 this library; if not, write to the 17 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #if !defined (EXO_INSIDE_EXO_H) && !defined (EXO_COMPILATION) 22 | #error "Only can be included directly, this file may disappear or change contents." 23 | #endif 24 | 25 | #ifndef __EXO_JOB_H__ 26 | #define __EXO_JOB_H__ 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define EXO_TYPE_JOB (exo_job_get_type ()) 33 | #define EXO_JOB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXO_TYPE_JOB, ExoJob)) 34 | #define EXO_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXO_TYPE_JOB, ExoJobClass)) 35 | #define EXO_IS_JOB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXO_TYPE_JOB)) 36 | #define EXO_IS_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXO_TYPE_JOB) 37 | #define EXO_JOB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXO_TYPE_JOB, ExoJobClass)) 38 | 39 | typedef struct _ExoJobPrivate ExoJobPrivate; 40 | typedef struct _ExoJobClass ExoJobClass; 41 | typedef struct _ExoJob ExoJob; 42 | 43 | struct _ExoJobClass 44 | { 45 | GObjectClass __parent__; 46 | 47 | /* virtual methods */ 48 | gboolean (*execute) (ExoJob *job, 49 | GError **error); 50 | 51 | /* signals */ 52 | void (*error) (ExoJob *job, 53 | GError *error); 54 | void (*finished) (ExoJob *job); 55 | void (*info_message) (ExoJob *job, 56 | const gchar *message); 57 | void (*percent) (ExoJob *job, 58 | gdouble percent); 59 | }; 60 | 61 | /** 62 | * ExoJob: 63 | * 64 | * The #ExoJob struct contains only private fields and should not be 65 | * directly accessed. 66 | * 67 | * Deprecated: 4.21.0: Merged into thunar. 68 | **/ 69 | struct _ExoJob 70 | { 71 | GObject __parent__; 72 | 73 | /*< private >*/ 74 | ExoJobPrivate *priv; 75 | }; 76 | 77 | GType exo_job_get_type (void) G_GNUC_CONST; 78 | 79 | G_DEPRECATED 80 | ExoJob *exo_job_launch (ExoJob *job); 81 | G_DEPRECATED 82 | void exo_job_cancel (ExoJob *job); 83 | G_DEPRECATED 84 | gboolean exo_job_is_cancelled (const ExoJob *job); 85 | G_DEPRECATED 86 | GCancellable *exo_job_get_cancellable (const ExoJob *job); 87 | G_DEPRECATED 88 | gboolean exo_job_set_error_if_cancelled (ExoJob *job, 89 | GError **error); 90 | G_DEPRECATED 91 | void exo_job_emit (ExoJob *job, 92 | guint signal_id, 93 | GQuark signal_detail, 94 | ...); 95 | G_DEPRECATED 96 | void exo_job_info_message (ExoJob *job, 97 | const gchar *format, 98 | ...); 99 | G_DEPRECATED 100 | void exo_job_percent (ExoJob *job, 101 | gdouble percent); 102 | G_DEPRECATED 103 | gboolean exo_job_send_to_mainloop (ExoJob *job, 104 | GSourceFunc func, 105 | gpointer user_data, 106 | GDestroyNotify destroy_notify); 107 | 108 | G_END_DECLS 109 | 110 | #endif /* !__EXO_JOB_H__ */ 111 | -------------------------------------------------------------------------------- /exo/exo-marshal.list: -------------------------------------------------------------------------------- 1 | VOID:INT,INT 2 | VOID:OBJECT,OBJECT 3 | STRING:POINTER 4 | STRING:STRING,STRING 5 | BOOLEAN:VOID 6 | BOOLEAN:ENUM,INT 7 | BOOLEAN:INT,ENUM,BOOLEAN,ENUM,BOOLEAN 8 | -------------------------------------------------------------------------------- /exo/exo-private.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004-2006 os-cillation e.K. 3 | * 4 | * Written by Benedikt Meurer . 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library 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 Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | * MA 02110-1301 USA 20 | */ 21 | 22 | #ifdef HAVE_CONFIG_H 23 | #include 24 | #endif 25 | 26 | #ifdef HAVE_LIBINTL_H 27 | #include 28 | #endif 29 | #ifdef HAVE_LOCALE_H 30 | #include 31 | #endif 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | 38 | 39 | void 40 | _exo_i18n_init (void) 41 | { 42 | static gboolean inited = FALSE; 43 | 44 | if (G_UNLIKELY (!inited)) 45 | { 46 | inited = TRUE; 47 | 48 | bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); 49 | #ifdef HAVE_BIND_TEXTDOMAIN_CODESET 50 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 51 | #endif 52 | } 53 | } 54 | 55 | 56 | 57 | void 58 | _exo_gtk_widget_send_focus_change (GtkWidget *widget, 59 | gboolean in) 60 | { 61 | GdkEvent *fevent; 62 | 63 | g_object_ref (G_OBJECT (widget)); 64 | 65 | fevent = gdk_event_new (GDK_FOCUS_CHANGE); 66 | fevent->focus_change.type = GDK_FOCUS_CHANGE; 67 | fevent->focus_change.window = g_object_ref (gtk_widget_get_window (widget)); 68 | fevent->focus_change.in = in; 69 | 70 | gtk_widget_send_focus_change (widget, fevent); 71 | 72 | g_object_unref (G_OBJECT (widget)); 73 | gdk_event_free (fevent); 74 | } 75 | -------------------------------------------------------------------------------- /exo/exo-private.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004-2006 os-cillation e.K. 3 | * 4 | * Written by Benedikt Meurer . 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library 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 Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | * MA 02110-1301 USA 20 | */ 21 | 22 | #if !defined (EXO_COMPILATION) 23 | #error "Only can be included directly, this file is not part of the public API." 24 | #endif 25 | 26 | #ifndef __EXO_PRIVATE_H__ 27 | #define __EXO_PRIVATE_H__ 28 | 29 | #include 30 | 31 | #include 32 | 33 | G_BEGIN_DECLS 34 | 35 | /* support macros for debugging */ 36 | #ifndef NDEBUG 37 | #define _exo_assert(expr) g_assert (expr) 38 | #define _exo_assert_not_reached() g_assert_not_reached () 39 | #define _exo_return_if_fail(expr) g_return_if_fail (expr) 40 | #define _exo_return_val_if_fail(expr, val) g_return_val_if_fail (expr, (val)) 41 | #else 42 | #define _exo_assert(expr) G_STMT_START{ (void)0; }G_STMT_END 43 | #define _exo_assert_not_reached() G_STMT_START{ (void)0; }G_STMT_END 44 | #define _exo_return_if_fail(expr) G_STMT_START{ (void)0; }G_STMT_END 45 | #define _exo_return_val_if_fail(expr, val) G_STMT_START{ (void)0; }G_STMT_END 46 | #endif 47 | 48 | /* avoid trivial g_value_get_*() function calls */ 49 | #ifdef NDEBUG 50 | #define g_value_get_boolean(v) (((const GValue *) (v))->data[0].v_int) 51 | #define g_value_get_char(v) (((const GValue *) (v))->data[0].v_int) 52 | #define g_value_get_uchar(v) (((const GValue *) (v))->data[0].v_uint) 53 | #define g_value_get_int(v) (((const GValue *) (v))->data[0].v_int) 54 | #define g_value_get_uint(v) (((const GValue *) (v))->data[0].v_uint) 55 | #define g_value_get_long(v) (((const GValue *) (v))->data[0].v_long) 56 | #define g_value_get_ulong(v) (((const GValue *) (v))->data[0].v_ulong) 57 | #define g_value_get_int64(v) (((const GValue *) (v))->data[0].v_int64) 58 | #define g_value_get_uint64(v) (((const GValue *) (v))->data[0].v_uint64) 59 | #define g_value_get_enum(v) (((const GValue *) (v))->data[0].v_long) 60 | #define g_value_get_flags(v) (((const GValue *) (v))->data[0].v_ulong) 61 | #define g_value_get_float(v) (((const GValue *) (v))->data[0].v_float) 62 | #define g_value_get_double(v) (((const GValue *) (v))->data[0].v_double) 63 | #define g_value_get_string(v) (((const GValue *) (v))->data[0].v_pointer) 64 | #define g_value_get_param(v) (((const GValue *) (v))->data[0].v_pointer) 65 | #define g_value_get_boxed(v) (((const GValue *) (v))->data[0].v_pointer) 66 | #define g_value_get_pointer(v) (((const GValue *) (v))->data[0].v_pointer) 67 | #define g_value_get_object(v) (((const GValue *) (v))->data[0].v_pointer) 68 | #endif 69 | 70 | G_GNUC_INTERNAL void _exo_i18n_init (void); 71 | 72 | G_GNUC_INTERNAL void _exo_gtk_widget_send_focus_change (GtkWidget *widget, 73 | gboolean in); 74 | 75 | G_END_DECLS 76 | 77 | #endif /* !__EXO_PRIVATE_H__ */ 78 | -------------------------------------------------------------------------------- /exo/exo-simple-job.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2006 Benedikt Meurer 3 | * Copyright (c) 2009 Jannis Pohlmann 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library 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 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 18 | * MA 02110-1301 USA 19 | */ 20 | 21 | #ifdef HAVE_CONFIG_H 22 | #include 23 | #endif 24 | 25 | #ifdef HAVE_MEMORY_H 26 | #include 27 | #endif 28 | #ifdef HAVE_STDARG_H 29 | #include 30 | #endif 31 | #ifdef HAVE_STRING_H 32 | #include 33 | #endif 34 | 35 | /* avoid warning in the gvalue collector, since it will break the api */ 36 | #ifdef GLIB_VERSION_MIN_REQUIRED 37 | #undef GLIB_VERSION_MIN_REQUIRED 38 | #endif 39 | #define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_30 40 | 41 | #include 42 | 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | /** 49 | * SECTION: exo-simple-job 50 | * @title: ExoSimpleJob 51 | * @short_description: Simple interface to execute functions asynchronously 52 | * @include: exo/exo.h 53 | * @see_also: ExoJob 54 | * 55 | * ExoSimpleJob can be used to execute 56 | * functions asynchronously in an #ExoJob wrapper object. It is easier to 57 | * use than the #GThread system and provides basic signals to follow the 58 | * progress of an operation. 59 | **/ 60 | 61 | 62 | 63 | static void exo_simple_job_finalize (GObject *object); 64 | static gboolean exo_simple_job_execute (ExoJob *job, 65 | GError **error); 66 | 67 | 68 | 69 | struct _ExoSimpleJobClass 70 | { 71 | ExoJobClass __parent__; 72 | }; 73 | 74 | /** 75 | * ExoSimpleJob: 76 | * 77 | * The #ExoSimpleJob struct contains only private fields and should not be 78 | * directly accessed. 79 | * 80 | * Deprecated: 4.21.0: Unused. 81 | **/ 82 | struct _ExoSimpleJob 83 | { 84 | ExoSimpleJobFunc func; 85 | GValueArray *param_values; 86 | ExoJob __parent__; 87 | }; 88 | 89 | 90 | 91 | G_DEFINE_TYPE (ExoSimpleJob, exo_simple_job, EXO_TYPE_JOB) 92 | 93 | 94 | 95 | static void 96 | exo_simple_job_class_init (ExoSimpleJobClass *klass) 97 | { 98 | ExoJobClass *exojob_class; 99 | GObjectClass *gobject_class; 100 | 101 | gobject_class = G_OBJECT_CLASS (klass); 102 | gobject_class->finalize = exo_simple_job_finalize; 103 | 104 | exojob_class = EXO_JOB_CLASS (klass); 105 | exojob_class->execute = exo_simple_job_execute; 106 | } 107 | 108 | 109 | 110 | static void 111 | exo_simple_job_init (ExoSimpleJob *simple_job) 112 | { 113 | } 114 | 115 | 116 | 117 | static void 118 | exo_simple_job_finalize (GObject *object) 119 | { 120 | ExoSimpleJob *simple_job = EXO_SIMPLE_JOB (object); 121 | 122 | /* release the param values */ 123 | g_value_array_free (simple_job->param_values); 124 | 125 | (*G_OBJECT_CLASS (exo_simple_job_parent_class)->finalize) (object); 126 | } 127 | 128 | 129 | 130 | static gboolean 131 | exo_simple_job_execute (ExoJob *job, 132 | GError **error) 133 | { 134 | ExoSimpleJob *simple_job = EXO_SIMPLE_JOB (job); 135 | gboolean success = TRUE; 136 | GError *err = NULL; 137 | 138 | _exo_return_val_if_fail (EXO_IS_SIMPLE_JOB (job), FALSE); 139 | _exo_return_val_if_fail (simple_job->func != NULL, FALSE); 140 | 141 | /* try to execute the job using the supplied function */ 142 | success = (*simple_job->func) (job, simple_job->param_values, &err); 143 | 144 | if (!success) 145 | { 146 | g_assert (err != NULL || exo_job_is_cancelled (job)); 147 | 148 | /* set error if the job was cancelled. otherwise just propagate 149 | * the results of the processing function */ 150 | if (exo_job_set_error_if_cancelled (job, error)) 151 | { 152 | g_clear_error (&err); 153 | } 154 | else 155 | { 156 | if (err != NULL) 157 | g_propagate_error (error, err); 158 | } 159 | 160 | return FALSE; 161 | } 162 | else 163 | return TRUE; 164 | } 165 | 166 | 167 | 168 | /** 169 | * exo_simple_job_launch: 170 | * @func : the #ExoSimpleJobFunc to execute the job. 171 | * @n_param_values : the number of parameters to pass to the @func. 172 | * @... : a list of #GType and parameter pairs (exactly 173 | * @n_param_values pairs) that are passed to @func. 174 | * 175 | * Allocates a new #ExoJob which executes the specified @func with 176 | * the specified parameters. 177 | * 178 | * An example could be: 179 | * 180 | * 181 | * static gboolean 182 | * list_directory (ExoJob *job, 183 | * GValueArray *param_values, 184 | * GError **error) 185 | * { 186 | * GFileEnumerator *enumerator; 187 | * GFileInfo *info; 188 | * GError *err = NULL; 189 | * GFile *directory; 190 | * 191 | * if (exo_job_set_error_if_cancelled (EXO_JOB (job), error)) 192 | * return FALSE; 193 | * 194 | * directory = g_value_get_object (g_value_array_get_nth (param_values, 0)); 195 | * 196 | * enumerator = g_file_enumerate_children (directory, 197 | * "standard::display-name", 198 | * G_FILE_QUERY_INFO_NONE, 199 | * exo_job_get_cancellable (job), 200 | * &err); 201 | * 202 | * if (err != NULL) 203 | * { 204 | * g_propagate_error (error, err); 205 | * return FALSE; 206 | * } 207 | * 208 | * while (TRUE) 209 | * { 210 | * info = g_file_enumerator_next_file (enumerator, 211 | * exo_job_get_cancellable (job), 212 | * &err); 213 | * 214 | * if (info == NULL) 215 | * break; 216 | * 217 | * exo_job_info_message (job, _("Child: %s"), 218 | * g_file_info_get_display_name (info)); 219 | * 220 | * g_object_unref (info); 221 | * } 222 | * 223 | * g_object_unref (enumerator); 224 | * 225 | * if (err != NULL) 226 | * { 227 | * g_propagate_error (error, err); 228 | * return FALSE; 229 | * } 230 | * else 231 | * { 232 | * return TRUE; 233 | * } 234 | * } 235 | * 236 | * ... 237 | * 238 | * GFile *file = g_file_new_for_path ("/home/user"); 239 | * ExoJob *job = exo_simple_job_launch (list_directory, 1, G_TYPE_FILE, file); 240 | * g_signal_connect (job, "info-message", G_CALLBACK (update_some_widget), widget); 241 | * g_signal_connect (job, "finished", G_CALLBACK (unref_the_job_object), NULL); 242 | * 243 | * 244 | * The caller is responsible to release the returned #ExoJob object 245 | * using g_object_unref() when no longer needed. 246 | * 247 | * Returns: the launched #ExoJob. 248 | * 249 | * Deprecated: 4.21.0: Unused. 250 | **/ 251 | ExoJob* 252 | exo_simple_job_launch (ExoSimpleJobFunc func, 253 | guint n_param_values, 254 | ...) 255 | { 256 | ExoSimpleJob *simple_job; 257 | va_list var_args; 258 | GValue value = { 0, }; 259 | gchar *error_message; 260 | guint n; 261 | 262 | /* allocate and initialize the simple job */ 263 | simple_job = g_object_new (EXO_TYPE_SIMPLE_JOB, NULL); 264 | simple_job->func = func; 265 | simple_job->param_values = g_value_array_new (n_param_values); 266 | 267 | /* collect the parameters */ 268 | va_start (var_args, n_param_values); 269 | for (n = 0; n < n_param_values; ++n) 270 | { 271 | /* initialize the value to hold the next parameter */ 272 | g_value_init (&value, va_arg (var_args, GType)); 273 | 274 | /* collect the value from the stack */ 275 | G_VALUE_COLLECT (&value, var_args, 0, &error_message); 276 | 277 | /* check if an error occurred */ 278 | if (G_UNLIKELY (error_message != NULL)) 279 | { 280 | g_error ("%s: %s", G_STRLOC, error_message); 281 | g_free (error_message); 282 | } 283 | 284 | g_value_array_insert (simple_job->param_values, n, &value); 285 | g_value_unset (&value); 286 | } 287 | va_end (var_args); 288 | 289 | /* launch the job */ 290 | return exo_job_launch (EXO_JOB (simple_job)); 291 | } 292 | 293 | 294 | #define __EXO_SIMPLE_JOB_C__ 295 | #include 296 | -------------------------------------------------------------------------------- /exo/exo-simple-job.h: -------------------------------------------------------------------------------- 1 | /* vi:set et ai sw=2 sts=2 ts=2: */ 2 | /*- 3 | * Copyright (c) 2009 Jannis Pohlmann 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library 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 | * 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 this library; if not, write to the 17 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #if !defined (EXO_INSIDE_EXO_H) && !defined (EXO_COMPILATION) 22 | #error "Only can be included directly, this file may disappear or change contents." 23 | #endif 24 | 25 | #ifndef __EXO_SIMPLE_JOB_H__ 26 | #define __EXO_SIMPLE_JOB_H__ 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | /** 33 | * ExoSimpleJobFunc: 34 | * @job : an #ExoJob. 35 | * @param_values : a #GValueArray of the #GValues passed to 36 | * exo_simple_job_launch(). 37 | * @error : return location for errors. 38 | * 39 | * Used by the #ExoSimpleJob to process the @job. See exo_simple_job_launch() 40 | * for further details. 41 | * 42 | * Returns: %TRUE on success, %FALSE in case of an error. 43 | * 44 | * Deprecated: 4.21.0: Unused. 45 | **/ 46 | typedef gboolean (*ExoSimpleJobFunc) (ExoJob *job, 47 | GValueArray *param_values, 48 | GError **error); 49 | 50 | 51 | #define EXO_TYPE_SIMPLE_JOB (exo_simple_job_get_type ()) 52 | #define EXO_SIMPLE_JOB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXO_TYPE_SIMPLE_JOB, ExoSimpleJob)) 53 | #define EXO_SIMPLE_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXO_TYPE_SIMPLE_JOB, ExoSimpleJobClass)) 54 | #define EXO_IS_SIMPLE_JOB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXO_TYPE_SIMPLE_JOB)) 55 | #define EXO_IS_SIMPLE_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXO_TYPE_SIMPLE_JOB)) 56 | #define EXO_SIMPLE_JOB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXO_TYPE_SIMPLE_JOB, ExoSimpleJobClass)) 57 | 58 | typedef struct _ExoSimpleJobClass ExoSimpleJobClass; 59 | typedef struct _ExoSimpleJob ExoSimpleJob; 60 | 61 | GType exo_simple_job_get_type (void) G_GNUC_CONST; 62 | 63 | G_DEPRECATED 64 | ExoJob *exo_simple_job_launch (ExoSimpleJobFunc func, 65 | guint n_param_values, 66 | ...) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; 67 | 68 | G_END_DECLS 69 | 70 | #endif /* !__EXO_SIMPLE_JOB_H__ */ 71 | -------------------------------------------------------------------------------- /exo/exo-string.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004-2007 os-cillation e.K. 3 | * 4 | * Written by Benedikt Meurer . 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library 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 Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | * MA 02110-1301 USA 20 | */ 21 | 22 | #if !defined (EXO_INSIDE_EXO_H) && !defined (EXO_COMPILATION) 23 | #error "Only can be included directly, this file may disappear or change contents." 24 | #endif 25 | 26 | #ifndef __EXO_STRING_H__ 27 | #define __EXO_STRING_H__ 28 | 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | gchar *exo_str_elide_underscores (const gchar *text) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT G_GNUC_DEPRECATED; 34 | 35 | gboolean exo_str_is_equal (const gchar *a, 36 | const gchar *b) G_GNUC_DEPRECATED_FOR (g_strcmp0()); 37 | 38 | gchar *exo_str_replace (const gchar *str, 39 | const gchar *pattern, 40 | const gchar *replacement) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT G_GNUC_DEPRECATED_FOR (xfce_str_replace()); 41 | 42 | gchar *exo_strdup_strftime (const gchar *format, 43 | const struct tm *tm) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT G_GNUC_DEPRECATED_FOR(g_date_time_format()); 44 | 45 | gchar **exo_strndupv (gchar **strv, 46 | guint num) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT G_GNUC_DEPRECATED_FOR (g_strdupv()); 47 | 48 | gboolean exo_str_looks_like_an_uri (const gchar *str) G_GNUC_DEPRECATED_FOR (g_uri_is_valid()); 49 | 50 | gboolean exo_str_is_flag (const gchar *str) G_GNUC_DEPRECATED_FOR (g_str_has_prefix()); 51 | 52 | 53 | /** 54 | * exo_str_is_empty: 55 | * @string : a string 56 | * 57 | * Macro to check if a string is %NULL or empty. You should prefer 58 | * this function over strlen (str) == 0. 59 | * 60 | * Deprecated: xfce 4.18: Replaced with xfce_str_is_empty() 61 | * 62 | * Returns: %TRUE if the string is not %NULL and its length > 1, 63 | * %FALSE otherwise. 64 | * 65 | * Since : 0.5.0 66 | **/ 67 | #define exo_str_is_empty(string) ((string) == NULL || *(string) == '\0') 68 | 69 | /** 70 | * I_: 71 | * @string : A static string. 72 | * 73 | * Shortcut for g_intern_static_string() to return a 74 | * canonical representation for @string. 75 | * 76 | * Deprecated: xfce 4.18: Use libxfce4util instead 77 | * 78 | * Returns: a canonical representation for the string. 79 | * 80 | * Since : 0.3.1.1 81 | **/ 82 | #define I_(string) (g_intern_static_string ((string))) 83 | 84 | G_END_DECLS 85 | 86 | #endif /* !__EXO_STRING_H__ */ 87 | -------------------------------------------------------------------------------- /exo/exo-thumbnail-preview.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2006 Benedikt Meurer 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #ifdef HAVE_CONFIG_H 21 | #include 22 | #endif 23 | 24 | #ifdef HAVE_SYS_TYPES_H 25 | #include 26 | #endif 27 | #ifdef HAVE_SYS_STAT_H 28 | #include 29 | #endif 30 | 31 | #ifdef HAVE_MEMORY_H 32 | #include 33 | #endif 34 | #ifdef HAVE_STRING_H 35 | #include 36 | #endif 37 | 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | 48 | 49 | static void exo_thumbnail_preview_style_set (GtkWidget *ebox, 50 | GtkStyle *previous_style, 51 | ExoThumbnailPreview *thumbnail_preview); 52 | 53 | 54 | 55 | struct _ExoThumbnailPreviewClass 56 | { 57 | GtkFrameClass __parent__; 58 | }; 59 | 60 | struct _ExoThumbnailPreview 61 | { 62 | GtkFrame __parent__; 63 | GtkWidget *image; 64 | GtkWidget *name_label; 65 | GtkWidget *size_label; 66 | }; 67 | 68 | 69 | 70 | G_DEFINE_TYPE (ExoThumbnailPreview, exo_thumbnail_preview, GTK_TYPE_FRAME) 71 | 72 | 73 | 74 | static void 75 | exo_thumbnail_preview_class_init (ExoThumbnailPreviewClass *klass) 76 | { 77 | } 78 | 79 | 80 | 81 | static void 82 | exo_thumbnail_preview_init (ExoThumbnailPreview *thumbnail_preview) 83 | { 84 | GtkWidget *ebox; 85 | GtkWidget *vbox; 86 | GtkWidget *box; 87 | 88 | /* initialize the library's i18n support */ 89 | _exo_i18n_init (); 90 | 91 | gtk_frame_set_shadow_type (GTK_FRAME (thumbnail_preview), GTK_SHADOW_IN); 92 | gtk_frame_set_label (GTK_FRAME (thumbnail_preview), _("Preview")); 93 | gtk_widget_set_sensitive (GTK_WIDGET (thumbnail_preview), FALSE); 94 | 95 | ebox = gtk_event_box_new (); 96 | g_signal_connect (G_OBJECT (ebox), "style-set", G_CALLBACK (exo_thumbnail_preview_style_set), thumbnail_preview); 97 | gtk_container_add (GTK_CONTAINER (thumbnail_preview), ebox); 98 | gtk_widget_show (ebox); 99 | 100 | vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); 101 | gtk_container_add (GTK_CONTAINER (ebox), vbox); 102 | gtk_widget_show (vbox); 103 | 104 | box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); 105 | 106 | gtk_container_set_border_width (GTK_CONTAINER (box), 2); 107 | gtk_box_pack_start (GTK_BOX (vbox), box, FALSE, FALSE, 0); 108 | gtk_widget_show (box); 109 | 110 | thumbnail_preview->image = gtk_image_new_from_icon_name ("image-missing", GTK_ICON_SIZE_DIALOG); 111 | gtk_widget_set_size_request (thumbnail_preview->image, EXO_THUMBNAIL_SIZE_NORMAL + 2 * 12, EXO_THUMBNAIL_SIZE_NORMAL + 2 * 12); 112 | gtk_image_set_pixel_size (GTK_IMAGE (thumbnail_preview->image), EXO_THUMBNAIL_SIZE_NORMAL / 2); 113 | gtk_box_pack_start (GTK_BOX (box), thumbnail_preview->image, FALSE, FALSE, 0); 114 | gtk_widget_show (thumbnail_preview->image); 115 | 116 | thumbnail_preview->name_label = gtk_label_new (_("No file selected")); 117 | gtk_label_set_justify (GTK_LABEL (thumbnail_preview->name_label), GTK_JUSTIFY_CENTER); 118 | gtk_label_set_ellipsize (GTK_LABEL (thumbnail_preview->name_label), PANGO_ELLIPSIZE_MIDDLE); 119 | gtk_box_pack_start (GTK_BOX (box), thumbnail_preview->name_label, FALSE, FALSE, 0); 120 | gtk_widget_show (thumbnail_preview->name_label); 121 | 122 | thumbnail_preview->size_label = gtk_label_new (""); 123 | gtk_box_pack_start (GTK_BOX (box), thumbnail_preview->size_label, FALSE, FALSE, 0); 124 | gtk_widget_show (thumbnail_preview->size_label); 125 | } 126 | 127 | 128 | 129 | static void 130 | exo_thumbnail_preview_style_set (GtkWidget *ebox, 131 | GtkStyle *previous_style, 132 | ExoThumbnailPreview *thumbnail_preview) 133 | { 134 | _exo_return_if_fail (EXO_IS_THUMBNAIL_PREVIEW (thumbnail_preview)); 135 | _exo_return_if_fail (GTK_IS_EVENT_BOX (ebox)); 136 | 137 | /* check if the ebox is already realized */ 138 | if (gtk_widget_get_realized (ebox)) 139 | { 140 | /* set background color (using the base color) */ 141 | g_signal_handlers_block_by_func (G_OBJECT (ebox), exo_thumbnail_preview_style_set, thumbnail_preview); 142 | g_signal_handlers_unblock_by_func (G_OBJECT (ebox), exo_thumbnail_preview_style_set, thumbnail_preview); 143 | } 144 | } 145 | 146 | 147 | 148 | /** 149 | * _exo_thumbnail_preview_new: 150 | * 151 | * Allocates a new #ExoThumbnailPreview instance. 152 | * 153 | * Returns: the newly allocated #ExoThumbnailPreview. 154 | **/ 155 | GtkWidget* 156 | _exo_thumbnail_preview_new (void) 157 | { 158 | return g_object_new (EXO_TYPE_THUMBNAIL_PREVIEW, NULL); 159 | } 160 | 161 | 162 | 163 | static inline GdkPixbuf* 164 | thumbnail_add_frame (GdkPixbuf *thumbnail) 165 | { 166 | const guchar *pixels; 167 | GdkPixbuf *frame; 168 | gint rowstride; 169 | gint height; 170 | gint width; 171 | gint n; 172 | 173 | /* determine the thumbnail dimensions */ 174 | width = gdk_pixbuf_get_width (thumbnail); 175 | height = gdk_pixbuf_get_height (thumbnail); 176 | 177 | /* don't add frames to small thumbnails */ 178 | if (width < EXO_THUMBNAIL_SIZE_NORMAL && height < EXO_THUMBNAIL_SIZE_NORMAL) 179 | goto none; 180 | 181 | /* always add a frame to thumbnails w/o alpha channel */ 182 | if (gdk_pixbuf_get_has_alpha (thumbnail)) 183 | { 184 | /* get a pointer to the thumbnail data */ 185 | pixels = gdk_pixbuf_get_pixels (thumbnail); 186 | 187 | /* check if we have a transparent pixel on the first row */ 188 | for (n = width * 4; n > 0; n -= 4) 189 | if (pixels[n - 1] < 255u) 190 | goto none; 191 | 192 | /* determine the rowstride */ 193 | rowstride = gdk_pixbuf_get_rowstride (thumbnail); 194 | 195 | /* skip the first row */ 196 | pixels += rowstride; 197 | 198 | /* check if we have a transparent pixel in the first or last column */ 199 | for (n = height - 2; n > 0; --n, pixels += rowstride) 200 | if (pixels[3] < 255u || pixels[width * 4 - 1] < 255u) 201 | goto none; 202 | 203 | /* check if we have a transparent pixel on the last row */ 204 | for (n = width * 4; n > 0; n -= 4) 205 | if (pixels[n - 1] < 255u) 206 | goto none; 207 | } 208 | 209 | /* try to load the frame image */ 210 | frame = gdk_pixbuf_new_from_file (DATADIR G_DIR_SEPARATOR_S "pixmaps" G_DIR_SEPARATOR_S "exo" 211 | G_DIR_SEPARATOR_S "exo-thumbnail-frame.png", NULL); 212 | if (G_LIKELY (frame != NULL)) 213 | { 214 | /* add a frame to the thumbnail */ 215 | thumbnail = exo_gdk_pixbuf_frame (thumbnail, frame, 4, 3, 5, 6); 216 | g_object_unref (G_OBJECT (frame)); 217 | } 218 | else 219 | { 220 | none: /* just add a ref on the thumbnail */ 221 | g_object_ref (G_OBJECT (thumbnail)); 222 | } 223 | 224 | return thumbnail; 225 | } 226 | 227 | 228 | 229 | /** 230 | * _exo_thumbnail_preview_set_uri: 231 | * @thumbnail_preview : an #ExoThumbnailPreview. 232 | * @uri : the new URI for which to show a preview or %NULL. 233 | * 234 | * Updates the @thumbnail_preview to display a preview of the specified @uri. 235 | **/ 236 | void 237 | _exo_thumbnail_preview_set_uri (ExoThumbnailPreview *thumbnail_preview, 238 | const gchar *uri) 239 | { 240 | struct stat statb; 241 | GdkPixbuf *thumbnail_framed; 242 | GdkPixbuf *thumbnail; 243 | cairo_surface_t *surface; 244 | gchar *icon_name = NULL; 245 | gchar *size_name = NULL; 246 | gchar *displayname; 247 | gchar *filename; 248 | gchar *slash; 249 | gint scale_factor; 250 | ExoThumbnailSize thumbnail_size; 251 | 252 | _exo_return_if_fail (EXO_IS_THUMBNAIL_PREVIEW (thumbnail_preview)); 253 | 254 | /* check if we have an URI to preview */ 255 | if (G_UNLIKELY (uri == NULL)) 256 | { 257 | /* the preview widget is insensitive if we don't have an URI */ 258 | gtk_widget_set_sensitive (GTK_WIDGET (thumbnail_preview), FALSE); 259 | gtk_image_set_from_icon_name (GTK_IMAGE (thumbnail_preview->image), "image-missing", GTK_ICON_SIZE_DIALOG); 260 | gtk_label_set_text (GTK_LABEL (thumbnail_preview->name_label), _("No file selected")); 261 | } 262 | else 263 | { 264 | /* make the preview widget appear sensitive */ 265 | gtk_widget_set_sensitive (GTK_WIDGET (thumbnail_preview), TRUE); 266 | 267 | /* check if we have a local file here */ 268 | filename = g_filename_from_uri (uri, NULL, NULL); 269 | if (G_LIKELY (filename != NULL)) 270 | { 271 | /* try to stat the file */ 272 | if (stat (filename, &statb) == 0) 273 | { 274 | /* icon and size label depends on the mode */ 275 | if (S_ISBLK (statb.st_mode)) 276 | { 277 | icon_name = g_strdup ("drive-harddisk"); 278 | size_name = g_strdup (_("Block Device")); 279 | } 280 | else if (S_ISCHR (statb.st_mode)) 281 | { 282 | icon_name = g_strdup ("drive-harddisk"); 283 | size_name = g_strdup (_("Character Device")); 284 | } 285 | else if (S_ISDIR (statb.st_mode)) 286 | { 287 | icon_name = g_strdup ("folder"); 288 | size_name = g_strdup (_("Folder")); 289 | } 290 | else if (S_ISFIFO (statb.st_mode)) 291 | { 292 | icon_name = g_strdup ("drive-harddisk"); 293 | size_name = g_strdup (_("FIFO")); 294 | } 295 | else if (S_ISSOCK (statb.st_mode)) 296 | { 297 | icon_name = g_strdup ("drive-harddisk"); 298 | size_name = g_strdup (_("Socket")); 299 | } 300 | else if (S_ISREG (statb.st_mode)) 301 | { 302 | if (G_UNLIKELY ((gulong) statb.st_size > 1024ul * 1024ul * 1024ul)) 303 | size_name = g_strdup_printf ("%0.1f GB", statb.st_size / (1024.0 * 1024.0 * 1024.0)); 304 | else if ((gulong) statb.st_size > 1024ul * 1024ul) 305 | size_name = g_strdup_printf ("%0.1f MB", statb.st_size / (1024.0 * 1024.0)); 306 | else if ((gulong) statb.st_size > 1024ul) 307 | size_name = g_strdup_printf ("%0.1f kB", statb.st_size / 1024.0); 308 | else 309 | size_name = g_strdup_printf ("%lu B", (gulong) statb.st_size); 310 | } 311 | } 312 | 313 | /* determine the basename from the filename */ 314 | displayname = g_filename_display_basename (filename); 315 | } 316 | else 317 | { 318 | /* determine the basename from the URI */ 319 | slash = strrchr (uri, '/'); 320 | if (G_LIKELY (!xfce_str_is_empty (slash))) 321 | displayname = g_filename_display_name (slash + 1); 322 | else 323 | displayname = g_filename_display_name (uri); 324 | } 325 | 326 | /* check if we have an icon-name */ 327 | if (G_UNLIKELY (icon_name != NULL)) 328 | { 329 | /* setup the named icon then */ 330 | gtk_image_set_from_icon_name (GTK_IMAGE (thumbnail_preview->image), icon_name, GTK_ICON_SIZE_DIALOG); 331 | g_free (icon_name); 332 | } 333 | else 334 | { 335 | /* try to load a thumbnail for the URI */ 336 | scale_factor = gtk_widget_get_scale_factor (GTK_WIDGET (thumbnail_preview)); 337 | thumbnail_size = scale_factor > 1 ? EXO_THUMBNAIL_SIZE_LARGE : EXO_THUMBNAIL_SIZE_NORMAL; 338 | 339 | thumbnail = _exo_thumbnail_get_for_uri (uri, thumbnail_size, NULL); 340 | if (thumbnail == NULL && G_LIKELY (filename != NULL)) 341 | { 342 | /* but we can try to generate a thumbnail */ 343 | thumbnail = _exo_thumbnail_get_for_file (filename, thumbnail_size, NULL); 344 | } 345 | 346 | /* check if we have a thumbnail */ 347 | if (G_LIKELY (thumbnail != NULL)) 348 | { 349 | /* setup the thumbnail for the image (using a frame if possible) */ 350 | thumbnail_framed = thumbnail_add_frame (thumbnail); 351 | surface = gdk_cairo_surface_create_from_pixbuf (thumbnail_framed, scale_factor, gtk_widget_get_window (GTK_WIDGET (thumbnail_preview))); 352 | gtk_image_set_from_surface (GTK_IMAGE (thumbnail_preview->image), surface); 353 | g_object_unref (G_OBJECT (thumbnail_framed)); 354 | g_object_unref (G_OBJECT (thumbnail)); 355 | cairo_surface_destroy (surface); 356 | } 357 | else 358 | { 359 | /* no thumbnail, cannot display anything useful then */ 360 | gtk_image_set_from_icon_name (GTK_IMAGE (thumbnail_preview->image), "image-missing", GTK_ICON_SIZE_DIALOG); 361 | } 362 | } 363 | 364 | /* setup the name label */ 365 | gtk_label_set_text (GTK_LABEL (thumbnail_preview->name_label), displayname); 366 | 367 | /* cleanup */ 368 | g_free (displayname); 369 | g_free (filename); 370 | } 371 | 372 | /* setup the new size label */ 373 | gtk_label_set_text (GTK_LABEL (thumbnail_preview->size_label), (size_name != NULL) ? size_name : ""); 374 | g_free (size_name); 375 | } 376 | 377 | 378 | 379 | #define __EXO_THUMBNAIL_PREVIEW_C__ 380 | #include 381 | -------------------------------------------------------------------------------- /exo/exo-thumbnail-preview.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2006 Benedikt Meurer 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #if !defined (EXO_COMPILATION) 21 | #error "Only can be included directly, this file is not part of the public API." 22 | #endif 23 | 24 | #ifndef __EXO_THUMBNAIL_PREVIEW_H__ 25 | #define __EXO_THUMBNAIL_PREVIEW_H__ 26 | 27 | #include 28 | 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | typedef struct _ExoThumbnailPreviewClass ExoThumbnailPreviewClass; 34 | typedef struct _ExoThumbnailPreview ExoThumbnailPreview; 35 | 36 | #define EXO_TYPE_THUMBNAIL_PREVIEW (exo_thumbnail_preview_get_type ()) 37 | #define EXO_THUMBNAIL_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXO_TYPE_THUMBNAIL_PREVIEW, ExoThumbnailPreview)) 38 | #define EXO_THUMBNAIL_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXO_TYPE_THUMBNAIL_PREVIEW, ExoThumbnailPreviewClass)) 39 | #define EXO_IS_THUMBNAIL_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXO_TYPE_THUMBNAIL_PREVIEW)) 40 | #define EXO_IS_THUMBNAIL_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXO_TYPE_THUMBNAIL_PREVIEW)) 41 | #define EXO_THUMBNAIL_PREVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXO_TYPE_THUMBNAIL_PREVIEW, ExoThumbnailPreviewClass)) 42 | 43 | G_GNUC_INTERNAL GType exo_thumbnail_preview_get_type (void) G_GNUC_CONST; 44 | 45 | G_GNUC_INTERNAL GtkWidget *_exo_thumbnail_preview_new (void) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; 46 | 47 | G_GNUC_INTERNAL void _exo_thumbnail_preview_set_uri (ExoThumbnailPreview *thumbnail_preview, 48 | const gchar *uri); 49 | 50 | G_END_DECLS 51 | 52 | #endif /* !__EXO_THUMBNAIL_PREVIEW_H__ */ 53 | -------------------------------------------------------------------------------- /exo/exo-thumbnail.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2005-2006 Benedikt Meurer 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #ifdef HAVE_CONFIG_H 21 | #include 22 | #endif 23 | 24 | #ifdef HAVE_SYS_TYPES_H 25 | #include 26 | #endif 27 | #ifdef HAVE_SYS_STAT_H 28 | #include 29 | #endif 30 | 31 | #ifdef HAVE_ERRNO_H 32 | #include 33 | #endif 34 | #ifdef HAVE_MEMORY_H 35 | #include 36 | #endif 37 | #include 38 | #ifdef HAVE_STDLIB_H 39 | #include 40 | #endif 41 | #ifdef HAVE_STRING_H 42 | #include 43 | #endif 44 | #ifdef HAVE_TIME_H 45 | #include 46 | #endif 47 | #ifdef HAVE_UNISTD_H 48 | #include 49 | #endif 50 | 51 | #include 52 | 53 | #include 54 | #include 55 | #include 56 | #include 57 | 58 | /* use g_rename() and g_unlink() on win32 */ 59 | #if defined(G_OS_WIN32) 60 | #include 61 | #else 62 | #define g_rename(oldfilename, newfilename) (rename ((oldfilename), (newfilename))) 63 | #define g_unlink(filename) (unlink ((filename))) 64 | #endif 65 | 66 | 67 | 68 | static GdkPixbuf *exo_thumbnail_load (const gchar *thumbnail_path, 69 | const gchar *uri, 70 | time_t mtime, 71 | GError **error) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;; 72 | static gboolean exo_thumbnail_save (GdkPixbuf *thumbnail, 73 | const gchar *thumbnail_path, 74 | const gchar *uri, 75 | time_t mtime, 76 | GError **error); 77 | 78 | 79 | 80 | static GdkPixbuf* 81 | exo_thumbnail_load (const gchar *thumbnail_path, 82 | const gchar *uri, 83 | time_t mtime, 84 | GError **error) 85 | { 86 | const gchar *thumbnail_mtime; 87 | const gchar *thumbnail_uri; 88 | GdkPixbuf *thumbnail; 89 | 90 | /* try to load the thumbnail */ 91 | thumbnail = gdk_pixbuf_new_from_file (thumbnail_path, error); 92 | if (G_LIKELY (thumbnail != NULL)) 93 | { 94 | /* determine the URI and the mtime from the thumbnail */ 95 | thumbnail_uri = gdk_pixbuf_get_option (thumbnail, "tEXt::Thumb::URI"); 96 | thumbnail_mtime = gdk_pixbuf_get_option (thumbnail, "tEXt::Thumb::MTime"); 97 | 98 | /* verify both the URI and the mtime for the thumbnail */ 99 | if (G_UNLIKELY (thumbnail_uri == NULL || thumbnail_mtime == NULL || strcmp (thumbnail_uri, uri) != 0 100 | || (mtime != (time_t) -1 && strtoul (thumbnail_mtime, NULL, 10) != (gulong) mtime))) 101 | { 102 | /* the thumbnail is invalid */ 103 | g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_NOENT, "%s", g_strerror (ENOENT)); 104 | g_object_unref (G_OBJECT (thumbnail)); 105 | thumbnail = NULL; 106 | } 107 | } 108 | 109 | /* return the thumbnail */ 110 | return thumbnail; 111 | } 112 | 113 | 114 | 115 | static gboolean 116 | exo_thumbnail_save (GdkPixbuf *thumbnail, 117 | const gchar *thumbnail_path, 118 | const gchar *uri, 119 | time_t mtime, 120 | GError **error) 121 | { 122 | gboolean succeed; 123 | gchar *tmp_path; 124 | gchar *dirname; 125 | gchar smtime[32]; 126 | gint tmp_fd; 127 | 128 | /* verify that the thumbnail directory exists */ 129 | dirname = g_path_get_dirname (thumbnail_path); 130 | succeed = xfce_mkdirhier (dirname, 0700, error); 131 | g_free (dirname); 132 | 133 | /* check if we succeed so far */ 134 | if (G_LIKELY (succeed)) 135 | { 136 | /* try to create a temporary file to write the thumbnail to */ 137 | tmp_path = g_strconcat (thumbnail_path, ".XXXXXX", NULL); 138 | tmp_fd = g_mkstemp (tmp_path); 139 | if (G_UNLIKELY (tmp_fd < 0)) 140 | { 141 | g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), "%s", g_strerror (errno)); 142 | g_free (tmp_path); 143 | return FALSE; 144 | } 145 | close (tmp_fd); 146 | 147 | /* determine the string representation of the mtime */ 148 | g_snprintf (smtime, sizeof (smtime), "%lu", (gulong) mtime); 149 | 150 | /* write the thumbnail to the temporary location */ 151 | succeed = gdk_pixbuf_save (thumbnail, tmp_path, "png", error, 152 | "tEXt::Thumb::URI", uri, 153 | "tEXt::Thumb::MTime", smtime, 154 | "tEXt::Software", PACKAGE_STRING, 155 | NULL); 156 | 157 | /* rename the file to the final location */ 158 | if (succeed && g_rename (tmp_path, thumbnail_path) < 0) 159 | { 160 | /* set an error and unlink the temporary file */ 161 | g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), "%s", g_strerror (errno)); 162 | g_unlink (tmp_path); 163 | succeed = FALSE; 164 | } 165 | 166 | /* cleanup */ 167 | g_free (tmp_path); 168 | } 169 | 170 | return succeed; 171 | } 172 | 173 | 174 | 175 | /** 176 | * _exo_thumbnail_get_for_file: 177 | * @filename : the absolute path to the file for which to load or generate a thumbnail. 178 | * @size : the desired thumbnail size, either %EXO_THUMBNAIL_SIZE_NORMAL or %EXO_THUMBNAIL_SIZE_LARGE. 179 | * @error : return location for errors or %NULL. 180 | * 181 | * Loads the thumbnail stored for @filename in the thumbnail database if such a thumbnail exists. If no 182 | * such thumbnail exists, the function tries to generate a store a thumbnail for the @filename. 183 | * 184 | * The caller is responsible to free the returned pixbuf using g_object_unref() when no longer needed. 185 | * 186 | * Returns: the #GdkPixbuf for the thumbnail of @filename or %NULL in case of an error. 187 | **/ 188 | GdkPixbuf* 189 | _exo_thumbnail_get_for_file (const gchar *filename, 190 | ExoThumbnailSize size, 191 | GError **error) 192 | { 193 | struct stat statb; 194 | GdkPixbuf *thumbnail = NULL; 195 | GError *err = NULL; 196 | gchar *name; 197 | gchar *path; 198 | gchar *md5; 199 | gchar *uri; 200 | 201 | _exo_return_val_if_fail (size == EXO_THUMBNAIL_SIZE_NORMAL || size == EXO_THUMBNAIL_SIZE_LARGE, NULL); 202 | _exo_return_val_if_fail (error == NULL || *error == NULL, NULL); 203 | _exo_return_val_if_fail (g_path_is_absolute (filename), NULL); 204 | 205 | /* stat the file first */ 206 | if (stat (filename, &statb) < 0) 207 | { 208 | /* we cannot recover from here */ 209 | g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), "%s", g_strerror (errno)); 210 | } 211 | else 212 | { 213 | /* determine the URI of the file */ 214 | uri = g_filename_to_uri (filename, NULL, error); 215 | if (G_LIKELY (uri != NULL)) 216 | { 217 | /* determine the filename of the thumbnail */ 218 | md5 = g_compute_checksum_for_string (G_CHECKSUM_MD5, uri, -1); 219 | name = g_strconcat (md5, ".png", NULL); 220 | g_free (md5); 221 | 222 | /* determine the path of the thumbnail */ 223 | path = g_build_path ("/", g_get_user_cache_dir(), "thumbnails", (size == EXO_THUMBNAIL_SIZE_NORMAL) ? "normal" : "large", name, NULL); 224 | g_free (name); 225 | 226 | /* try to load the thumbnail */ 227 | thumbnail = exo_thumbnail_load (path, uri, statb.st_mtime, NULL); 228 | if (G_UNLIKELY (thumbnail == NULL)) 229 | { 230 | /* try to generate a thumbnail for the file using the available GdkPixbufLoaders */ 231 | thumbnail = exo_gdk_pixbuf_new_from_file_at_max_size (filename, size, size, TRUE, error); 232 | if (G_LIKELY (thumbnail != NULL)) 233 | { 234 | /* save the generated thumbnail into the thumbnail database */ 235 | if (!exo_thumbnail_save (thumbnail, path, uri, statb.st_mtime, &err)) 236 | { 237 | /* better let the user know whats going on, but no need to fail here */ 238 | g_warning ("Failed to save generated thumbnail for \"%s\" to \"%s\": %s", filename, path, err->message); 239 | g_error_free (err); 240 | } 241 | } 242 | } 243 | 244 | /* cleanup */ 245 | g_free (path); 246 | g_free (uri); 247 | } 248 | } 249 | 250 | return thumbnail; 251 | } 252 | 253 | 254 | 255 | /** 256 | * _exo_thumbnail_get_for_uri: 257 | * @uri : the URI for which to load the thumbnail. 258 | * @size : the desired thumbnail size. 259 | * @error : return location for errors or %NULL. 260 | * 261 | * Similar to _exo_thumbnail_get_for_file(), but does not try to generate 262 | * a thumbnail if no valid thumbnail is found. 263 | * 264 | * Returns: the thumbnail for the @uri or %NULL. 265 | **/ 266 | GdkPixbuf* 267 | _exo_thumbnail_get_for_uri (const gchar *uri, 268 | ExoThumbnailSize size, 269 | GError **error) 270 | { 271 | GdkPixbuf *thumbnail; 272 | gchar *name; 273 | gchar *path; 274 | gchar *md5; 275 | 276 | _exo_return_val_if_fail (size == EXO_THUMBNAIL_SIZE_NORMAL || size == EXO_THUMBNAIL_SIZE_LARGE, NULL); 277 | _exo_return_val_if_fail (error == NULL || *error == NULL, NULL); 278 | _exo_return_val_if_fail (uri != NULL, NULL); 279 | 280 | /* determine the filename of the thumbnail */ 281 | md5 = g_compute_checksum_for_string (G_CHECKSUM_MD5, uri, -1); 282 | name = g_strconcat (md5, ".png", NULL); 283 | g_free (md5); 284 | 285 | /* determine the path of the thumbnail */ 286 | path = g_build_path ("/", g_get_user_cache_dir(), "thumbnails", (size == EXO_THUMBNAIL_SIZE_NORMAL) ? "normal" : "large", name, NULL); 287 | g_free (name); 288 | 289 | /* try to load the thumbnail */ 290 | thumbnail = exo_thumbnail_load (path, uri, (time_t) -1, error); 291 | g_free (path); 292 | 293 | return thumbnail; 294 | } 295 | 296 | 297 | 298 | #define __EXO_THUMBNAIL_C__ 299 | #include 300 | -------------------------------------------------------------------------------- /exo/exo-thumbnail.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2005-2006 Benedikt Meurer 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #if !defined (EXO_COMPILATION) 21 | #error "Only can be included directly, this file is not part of the public API." 22 | #endif 23 | 24 | #ifndef __EXO_THUMBNAIL_H__ 25 | #define __EXO_THUMBNAIL_H__ 26 | 27 | #include 28 | 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | /** 34 | * ExoThumbnailSize: 35 | * @EXO_THUMBNAIL_SIZE_NORMAL : normal sized thumbnails (up to 128px). 36 | * @EXO_THUMBNAIL_SIZE_LARGE : large sized thumbnails. 37 | * 38 | * Thumbnail sizes used by the thumbnail database. 39 | **/ 40 | typedef enum /*< skip >*/ 41 | { 42 | EXO_THUMBNAIL_SIZE_NORMAL = 128, 43 | EXO_THUMBNAIL_SIZE_LARGE = 256, 44 | } ExoThumbnailSize; 45 | 46 | G_GNUC_INTERNAL GdkPixbuf *_exo_thumbnail_get_for_file (const gchar *filename, 47 | ExoThumbnailSize size, 48 | GError **error) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; 49 | G_GNUC_INTERNAL GdkPixbuf *_exo_thumbnail_get_for_uri (const gchar *uri, 50 | ExoThumbnailSize size, 51 | GError **error) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; 52 | 53 | G_END_DECLS 54 | 55 | #endif /* !__EXO_THUMBNAIL_H__ */ 56 | -------------------------------------------------------------------------------- /exo/exo-tree-view.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004-2006 Benedikt Meurer 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #if !defined (EXO_INSIDE_EXO_H) && !defined (EXO_COMPILATION) 21 | #error "Only can be included directly, this file may disappear or change contents." 22 | #endif 23 | 24 | #ifndef __EXO_TREE_VIEW_H__ 25 | #define __EXO_TREE_VIEW_H__ 26 | 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | typedef struct _ExoTreeViewPrivate ExoTreeViewPrivate; 32 | typedef struct _ExoTreeViewClass ExoTreeViewClass; 33 | typedef struct _ExoTreeView ExoTreeView; 34 | 35 | #define EXO_TYPE_TREE_VIEW (exo_tree_view_get_type ()) 36 | #define EXO_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXO_TYPE_TREE_VIEW, ExoTreeView)) 37 | #define EXO_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXO_TYPE_TREE_VIEW, ExoTreeViewClass)) 38 | #define EXO_IS_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXO_TYPE_TREE_VIEW)) 39 | #define EXO_IS_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXO_TYPE_TREE_VIEW)) 40 | #define EXO_TREE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXO_TYPE_TREE_VIEW, ExoTreeViewClass)) 41 | 42 | struct _ExoTreeViewClass 43 | { 44 | /*< private >*/ 45 | GtkTreeViewClass __parent__; 46 | 47 | /*< private >*/ 48 | void (*reserved1) (void); 49 | void (*reserved2) (void); 50 | void (*reserved3) (void); 51 | void (*reserved4) (void); 52 | void (*reserved5) (void); 53 | void (*reserved6) (void); 54 | void (*reserved7) (void); 55 | void (*reserved8) (void); 56 | }; 57 | 58 | /** 59 | * ExoTreeView: 60 | * 61 | * The #ExoIconView struct contains only private fields and should 62 | * not be directly accessed. 63 | * 64 | * Deprecated: 4.21.0. 65 | **/ 66 | struct _ExoTreeView 67 | { 68 | /*< private >*/ 69 | GtkTreeView __parent__; 70 | 71 | /*< private >*/ 72 | ExoTreeViewPrivate *priv; 73 | }; 74 | 75 | GType exo_tree_view_get_type (void) G_GNUC_CONST; 76 | 77 | G_DEPRECATED_FOR (xfce_tree_view_new) 78 | GtkWidget *exo_tree_view_new (void) G_GNUC_MALLOC; 79 | 80 | G_DEPRECATED_FOR (xfce_tree_view_get_single_click) 81 | gboolean exo_tree_view_get_single_click (const ExoTreeView *tree_view); 82 | G_DEPRECATED_FOR (xfce_tree_view_set_single_click) 83 | void exo_tree_view_set_single_click (ExoTreeView *tree_view, 84 | gboolean single_click); 85 | 86 | G_DEPRECATED_FOR (xfce_tree_view_get_single_click_timeout) 87 | guint exo_tree_view_get_single_click_timeout (const ExoTreeView *tree_view); 88 | G_DEPRECATED_FOR (xfce_tree_view_set_single_click_timeout) 89 | void exo_tree_view_set_single_click_timeout (ExoTreeView *tree_view, 90 | guint single_click_timeout); 91 | 92 | G_END_DECLS 93 | 94 | #endif /* !__EXO_TREE_VIEW_H__ */ 95 | -------------------------------------------------------------------------------- /exo/exo-utils.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2005 Benedikt Meurer . 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #ifdef HAVE_CONFIG_H 21 | #include 22 | #endif 23 | 24 | /* implement exo-utils's inline functions */ 25 | #define G_IMPLEMENT_INLINES 1 26 | #define __EXO_UTILS_C__ 27 | #include 28 | #include 29 | 30 | /** 31 | * SECTION: exo-utils 32 | * @title: Miscellaneous Utility Functions 33 | * @short_description: Various utility functions 34 | * @include: exo/exo.h 35 | * @see_also: 36 | * GLib Atomic Operations 37 | * 38 | * This module contains various utility functions that extend the basic 39 | * utility functions provided by the GLib library. 41 | **/ 42 | 43 | 44 | 45 | /** 46 | * exo_noop: 47 | * 48 | * This function has no effect. It does nothing but 49 | * returning instantly. It is mostly useful in 50 | * situations that require a function to be called, 51 | * but that function does not need to do anything 52 | * useful. 53 | * 54 | * Deprecated: xfce 4.18: Use NULL pointer instead 55 | * 56 | * Since: 0.3.1 57 | **/ 58 | void 59 | exo_noop (void) 60 | { 61 | } 62 | 63 | 64 | 65 | /** 66 | * exo_noop_one: 67 | * 68 | * This function has no effect but simply returns 69 | * the integer value %1. It is mostly useful in 70 | * situations where you just need a function that 71 | * returns %1, but don't want to perform any other 72 | * actions. 73 | * 74 | * Deprecated: xfce 4.18: Use NULL pointer instead 75 | * 76 | * Returns: the integer value %1. 77 | * 78 | * Since: 0.3.1 79 | **/ 80 | gint 81 | exo_noop_one (void) 82 | { 83 | return 1; 84 | } 85 | 86 | 87 | 88 | /** 89 | * exo_noop_zero: 90 | * 91 | * This function has no effect but simply returns 92 | * the integer value %0. It is mostly useful in 93 | * situations where you just need a function that 94 | * returns %0, but don't want to perform any other 95 | * actions. 96 | * 97 | * Deprecated: xfce 4.18: Use NULL pointer instead 98 | * 99 | * Returns: the integer value %0. 100 | * 101 | * Since: 0.3.1 102 | **/ 103 | gint 104 | exo_noop_zero (void) 105 | { 106 | return 0; 107 | } 108 | 109 | 110 | 111 | /** 112 | * exo_noop_null: 113 | * 114 | * This function has no effect but simply returns 115 | * a %NULL pointer. It is mostly useful in 116 | * situations where you just need a function that 117 | * returns %NULL, but don't want to perform any 118 | * other actions. 119 | * 120 | * Deprecated: xfce 4.18: Use NULL pointer instead 121 | * 122 | * Returns: a %NULL pointer. 123 | * 124 | * Since: 0.3.1 125 | **/ 126 | gpointer 127 | exo_noop_null (void) 128 | { 129 | return NULL; 130 | } 131 | 132 | 133 | 134 | /** 135 | * exo_noop_true: 136 | * 137 | * This function has no effect, but simply returns 138 | * the boolean value %TRUE. It is mostly useful in 139 | * situations where you just need a function that 140 | * returns %TRUE, but don't want to perform any 141 | * other actions. 142 | * 143 | * Deprecated: xfce 4.18: Use NULL pointer instead 144 | * 145 | * Returns: the boolean value %TRUE. 146 | * 147 | * Since: 0.3.1 148 | **/ 149 | gboolean 150 | exo_noop_true (void) 151 | { 152 | return TRUE; 153 | } 154 | 155 | 156 | 157 | /** 158 | * exo_noop_false: 159 | * 160 | * This function has no effect, but simply returns 161 | * the boolean value %FALSE. It is mostly useful in 162 | * situations where you just need a function that 163 | * returns %FALSE, but don't want to perform any 164 | * other actions. 165 | * 166 | * Deprecated: xfce 4.18: Use NULL pointer instead 167 | * 168 | * Returns: the boolean value %FALSE. 169 | * 170 | * Since: 0.3.1 171 | **/ 172 | gboolean 173 | exo_noop_false (void) 174 | { 175 | return FALSE; 176 | } 177 | 178 | 179 | 180 | #define __EXO_UTILS_C__ 181 | #include 182 | -------------------------------------------------------------------------------- /exo/exo-utils.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2005-2006 Benedikt Meurer . 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #if !defined (EXO_INSIDE_EXO_H) && !defined (EXO_COMPILATION) 21 | #error "Only can be included directly, this file may disappear or change contents." 22 | #endif 23 | 24 | #ifndef __EXO_UTILS_H__ 25 | #define __EXO_UTILS_H__ 26 | 27 | #include 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | void exo_noop (void) G_GNUC_DEPRECATED; 33 | gint exo_noop_one (void) G_GNUC_PURE G_GNUC_DEPRECATED; 34 | gint exo_noop_zero (void) G_GNUC_PURE G_GNUC_DEPRECATED; 35 | gpointer exo_noop_null (void) G_GNUC_PURE G_GNUC_DEPRECATED; 36 | gboolean exo_noop_true (void) G_GNUC_PURE G_GNUC_DEPRECATED; 37 | gboolean exo_noop_false (void) G_GNUC_PURE G_GNUC_DEPRECATED; 38 | 39 | G_END_DECLS 40 | 41 | #endif /* !__EXO_UTILS_H__ */ 42 | -------------------------------------------------------------------------------- /exo/exo.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004-2007 os-cillation e.K. 3 | * 4 | * Written by Benedikt Meurer . 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library 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 Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | * MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef __EXO_H__ 23 | #define __EXO_H__ 24 | 25 | /* be sure to have i18n macros available and libintl.h included! */ 26 | #if defined(GETTEXT_PACKAGE) 27 | #include 28 | #else 29 | #include 30 | #endif 31 | 32 | #include 33 | 34 | #define EXO_INSIDE_EXO_H 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | 52 | #undef EXO_INSIDE_EXO_H 53 | 54 | #endif /* !__EXO_H__ */ 55 | -------------------------------------------------------------------------------- /exo/exo.symbols: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2005-2007 Benedikt Meurer . 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | /* This file lists all exported symbols. It is used to generate 21 | * the gobject.def file used to control exports on Windows and the 22 | * exo-alias.h/exo-aliasdef.c files used to avoid PLT entries for 23 | * internal uses of exported functions (see make-exo-alias.pl). 24 | * 25 | * Every symbol must be included in the right 26 | * #ifdef IN_HEADER(sym) #endif and 27 | * #ifdef IN_SOURCE(sym) #endif sections. 28 | */ 29 | 30 | #ifdef ALL_FILES 31 | #define IN_HEADER(x) 1 32 | #define IN_SOURCE(x) 1 33 | #endif 34 | 35 | /* exo-binding functions */ 36 | #if IN_HEADER(__EXO_BINDING_H__) 37 | #if IN_SOURCE(__EXO_BINDING_C__) 38 | exo_binding_new 39 | exo_binding_new_full 40 | exo_binding_new_with_negation 41 | exo_binding_unbind 42 | exo_mutual_binding_new 43 | exo_mutual_binding_new_full 44 | exo_mutual_binding_new_with_negation 45 | exo_mutual_binding_unbind 46 | #endif 47 | #endif 48 | 49 | /* ExoCellRendererIcon methods */ 50 | #if IN_HEADER(__EXO_CELL_RENDERER_ICON_H__) 51 | #if IN_SOURCE(__EXO_CELL_RENDERER_ICON_C__) 52 | exo_cell_renderer_icon_get_type G_GNUC_CONST 53 | exo_cell_renderer_icon_new G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT 54 | #endif 55 | #endif 56 | 57 | /* exo-config variables */ 58 | #if IN_HEADER(__EXO_CONFIG_H__) 59 | #if IN_SOURCE(__EXO_CONFIG_C__) 60 | #ifdef INCLUDE_VARIABLES 61 | exo_major_version 62 | exo_minor_version 63 | exo_micro_version 64 | #endif 65 | exo_check_version 66 | #endif 67 | #endif 68 | 69 | /* exo-enum-types functions */ 70 | #if IN_HEADER(__EXO_ENUM_TYPES_H__) 71 | #if IN_SOURCE(__EXO_ENUM_TYPES_C__) 72 | exo_icon_view_drop_position_get_type G_GNUC_CONST 73 | exo_icon_view_layout_mode_get_type G_GNUC_CONST 74 | #endif 75 | #endif 76 | 77 | /* exo-execute functions */ 78 | #if IN_HEADER(__EXO_EXECUTE_H__) 79 | #if IN_SOURCE(__EXO_EXECUTE_C__) 80 | exo_execute_preferred_application 81 | exo_execute_preferred_application_on_screen 82 | exo_execute_terminal_shell 83 | exo_execute_terminal_shell_on_screen 84 | #endif 85 | #endif 86 | 87 | /* exo-gdk-pixbuf-extensions functions */ 88 | #if IN_HEADER(__EXO_GDK_PIXBUF_EXTENSIONS_H__) 89 | #if IN_SOURCE(__EXO_GDK_PIXBUF_EXTENSIONS_C__) 90 | exo_gdk_pixbuf_colorize G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT 91 | exo_gdk_pixbuf_frame G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT 92 | exo_gdk_pixbuf_lucent G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT 93 | exo_gdk_pixbuf_spotlight G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT 94 | exo_gdk_pixbuf_scale_down G_GNUC_WARN_UNUSED_RESULT 95 | exo_gdk_pixbuf_scale_ratio G_GNUC_WARN_UNUSED_RESULT 96 | exo_gdk_pixbuf_new_from_file_at_max_size G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT 97 | #endif 98 | #endif 99 | 100 | /* exo-gobject-extensions functions */ 101 | #if IN_HEADER(__EXO_GOBJECT_EXTENSIONS_H__) 102 | #if IN_SOURCE(__EXO_GOBJECT_EXTENSIONS_C__) 103 | exo_g_value_transform_negate 104 | #endif 105 | #endif 106 | 107 | /* exo-gtk-extensions functions */ 108 | #if IN_HEADER(__EXO_GTK_EXTENSIONS_H__) 109 | #if IN_SOURCE(__EXO_GTK_EXTENSIONS_C__) 110 | exo_gtk_object_destroy_later 111 | exo_gtk_file_chooser_add_thumbnail_preview 112 | exo_gtk_url_about_dialog_hook 113 | exo_gtk_dialog_get_action_area 114 | exo_gtk_dialog_add_secondary_button 115 | exo_gtk_position_search_box 116 | #endif 117 | #endif 118 | 119 | /* ExoIconChooserDialog methods */ 120 | #if IN_HEADER(__EXO_ICON_CHOOSER_DIALOG_H__) 121 | #if IN_SOURCE(__EXO_ICON_CHOOSER_DIALOG_C__) 122 | exo_icon_chooser_dialog_get_type G_GNUC_CONST 123 | exo_icon_chooser_dialog_new G_GNUC_MALLOC G_GNUC_NULL_TERMINATED G_GNUC_WARN_UNUSED_RESULT 124 | exo_icon_chooser_dialog_get_icon G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT 125 | exo_icon_chooser_dialog_set_icon 126 | #endif 127 | #endif 128 | 129 | /* ExoIconView methods */ 130 | #if IN_HEADER(__EXO_ICON_VIEW_H__) 131 | #if IN_SOURCE(__EXO_ICON_VIEW_C__) 132 | exo_icon_view_get_type G_GNUC_CONST 133 | exo_icon_view_new 134 | exo_icon_view_new_with_model 135 | exo_icon_view_get_model 136 | exo_icon_view_set_model 137 | exo_icon_view_get_orientation 138 | exo_icon_view_set_orientation 139 | exo_icon_view_get_columns 140 | exo_icon_view_set_columns 141 | exo_icon_view_get_item_width 142 | exo_icon_view_set_item_width 143 | exo_icon_view_get_spacing 144 | exo_icon_view_set_spacing 145 | exo_icon_view_get_row_spacing 146 | exo_icon_view_set_row_spacing 147 | exo_icon_view_get_column_spacing 148 | exo_icon_view_set_column_spacing 149 | exo_icon_view_get_margin 150 | exo_icon_view_set_margin 151 | exo_icon_view_get_selection_mode 152 | exo_icon_view_set_selection_mode 153 | exo_icon_view_get_single_click 154 | exo_icon_view_set_single_click 155 | exo_icon_view_get_single_click_timeout 156 | exo_icon_view_set_single_click_timeout 157 | exo_icon_view_get_layout_mode 158 | exo_icon_view_set_layout_mode 159 | exo_icon_view_widget_to_icon_coords 160 | exo_icon_view_icon_to_widget_coords 161 | exo_icon_view_get_path_at_pos 162 | exo_icon_view_get_item_at_pos 163 | exo_icon_view_get_visible_range 164 | exo_icon_view_selected_foreach 165 | exo_icon_view_select_path 166 | exo_icon_view_unselect_path 167 | exo_icon_view_path_is_selected 168 | exo_icon_view_get_item_column 169 | exo_icon_view_get_item_row 170 | exo_icon_view_get_selected_items 171 | exo_icon_view_select_all 172 | exo_icon_view_unselect_all 173 | exo_icon_view_selection_invert 174 | exo_icon_view_item_activated 175 | exo_icon_view_get_cursor 176 | exo_icon_view_set_cursor 177 | exo_icon_view_scroll_to_path 178 | exo_icon_view_enable_model_drag_source 179 | exo_icon_view_enable_model_drag_dest 180 | exo_icon_view_unset_model_drag_source 181 | exo_icon_view_unset_model_drag_dest 182 | exo_icon_view_set_reorderable 183 | exo_icon_view_get_reorderable 184 | exo_icon_view_set_drag_dest_item 185 | exo_icon_view_get_drag_dest_item 186 | exo_icon_view_get_dest_item_at_pos 187 | exo_icon_view_create_drag_icon 188 | exo_icon_view_get_enable_search 189 | exo_icon_view_set_enable_search 190 | exo_icon_view_get_search_column 191 | exo_icon_view_set_search_column 192 | exo_icon_view_get_search_equal_func 193 | exo_icon_view_set_search_equal_func 194 | exo_icon_view_get_search_position_func 195 | exo_icon_view_set_search_position_func 196 | #endif 197 | #endif 198 | 199 | /* exo-job functions */ 200 | #if IN_HEADER(__EXO_JOB_H__) 201 | #if IN_SOURCE(__EXO_JOB_C__) 202 | exo_job_cancel 203 | exo_job_emit 204 | exo_job_get_cancellable 205 | exo_job_get_type G_GNUC_CONST 206 | exo_job_info_message 207 | exo_job_is_cancelled 208 | exo_job_launch 209 | exo_job_percent 210 | exo_job_send_to_mainloop 211 | exo_job_set_error_if_cancelled 212 | #endif 213 | #endif 214 | 215 | /* exo-utils functions */ 216 | #if IN_HEADER(__EXO_UTILS_H__) 217 | #if IN_SOURCE(__EXO_UTILS_C__) 218 | exo_noop 219 | exo_noop_one G_GNUC_PURE 220 | exo_noop_zero G_GNUC_PURE 221 | exo_noop_null G_GNUC_PURE 222 | exo_noop_true G_GNUC_PURE 223 | exo_noop_false G_GNUC_PURE 224 | #endif 225 | #endif 226 | 227 | /* exo-simple-job functions */ 228 | #if IN_HEADER(__EXO_SIMPLE_JOB_H__) 229 | #if IN_SOURCE(__EXO_SIMPLE_JOB_C__) 230 | exo_simple_job_get_type G_GNUC_CONST 231 | exo_simple_job_launch G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT 232 | #endif 233 | #endif 234 | 235 | /* exo-string functions */ 236 | #if IN_HEADER(__EXO_STRING_H__) 237 | #if IN_SOURCE(__EXO_STRING_C__) 238 | exo_str_elide_underscores G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT 239 | exo_str_is_equal 240 | exo_str_is_flag 241 | exo_str_replace G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT 242 | exo_strdup_strftime G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT 243 | exo_strndupv G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT 244 | exo_str_looks_like_an_uri 245 | #endif 246 | #endif 247 | 248 | #if IN_HEADER(__EXO_TREE_VIEW_H__) 249 | #if IN_SOURCE(__EXO_TREE_VIEW_C__) 250 | exo_tree_view_get_type G_GNUC_CONST 251 | exo_tree_view_new G_GNUC_MALLOC 252 | exo_tree_view_get_single_click 253 | exo_tree_view_set_single_click 254 | exo_tree_view_get_single_click_timeout 255 | exo_tree_view_set_single_click_timeout 256 | #endif 257 | #endif 258 | -------------------------------------------------------------------------------- /exo/make-exo-alias.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl -w 2 | # 3 | # Copyright (c) 2004 The GLib Development Team. 4 | # Copyright (c) 2005 Benedikt Meurer . 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU Library 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 Lesser General Public 17 | # License along with this library; if not, write to the Free Software 18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | # 20 | 21 | my $option_def = 0; 22 | 23 | if (($#ARGV >= 0) && ($ARGV[0] eq "-def")) 24 | { 25 | shift; 26 | $option_def = 1; 27 | } 28 | 29 | print < 35 | 36 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS 37 | 38 | EOF 39 | 40 | my $in_comment = 0; 41 | my $in_skipped_section = 0; 42 | 43 | while (<>) 44 | { 45 | # ignore empty lines 46 | next if /^\s*$/; 47 | 48 | # skip comments 49 | if ($_ =~ /^\s*\/\*/) 50 | { 51 | $in_comment = 1; 52 | } 53 | 54 | if ($in_comment) 55 | { 56 | if ($_ =~ /\*\/\s$/) 57 | { 58 | $in_comment = 0; 59 | } 60 | next; 61 | } 62 | 63 | # handle ifdefs 64 | if ($_ =~ /^\#endif/) 65 | { 66 | if (!$in_skipped_section) 67 | { 68 | print $_; 69 | } 70 | 71 | $in_skipped_section = 0; 72 | next; 73 | } 74 | 75 | if ($_ =~ /^\#ifdef\s+(INCLUDE_VARIABLES|INCLUDE_INTERNAL_SYMBOLS|ALL_FILES)/) 76 | { 77 | $in_skipped_section = 1; 78 | } 79 | 80 | if ($in_skipped_section) 81 | { 82 | next; 83 | } 84 | 85 | if ($_ =~ /^\#ifn?def\s+G/) 86 | { 87 | print $_; 88 | next; 89 | } 90 | 91 | if ($_ =~ /^\#if.*IN_SOURCE\((.*)\)/) 92 | { 93 | if ($option_def) 94 | { 95 | print "#ifdef $1\n"; 96 | } 97 | else 98 | { 99 | print "#if 1\n"; 100 | } 101 | next; 102 | } 103 | 104 | if ($_ =~ /^\#if.*IN_HEADER\((.*)\)/) 105 | { 106 | if ($option_def) 107 | { 108 | print "#if 1\n"; 109 | } 110 | else 111 | { 112 | print "#ifdef $1\n"; 113 | } 114 | next; 115 | } 116 | 117 | chop; 118 | my $line = $_; 119 | my @words; 120 | my $attributes = ""; 121 | 122 | @words = split (/ /, $line); 123 | my $symbol = shift (@words); 124 | chomp ($symbol); 125 | my $alias = "IA__".$symbol; 126 | 127 | # Drop any Win32 specific .def file syntax, but keep attributes 128 | foreach $word (@words) 129 | { 130 | $attributes = "$attributes $word" unless $word eq "PRIVATE"; 131 | } 132 | 133 | if (!$option_def) 134 | { 135 | print < 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #ifdef HAVE_CONFIG_H 21 | #include 22 | #endif 23 | 24 | #ifdef HAVE_STDLIB_H 25 | #include 26 | #endif 27 | 28 | #include 29 | 30 | 31 | 32 | int 33 | main (int argc, char **argv) 34 | { 35 | GtkWidget *dialog; 36 | gchar *icon; 37 | 38 | g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); 39 | 40 | gtk_init (&argc, &argv); 41 | 42 | dialog = exo_icon_chooser_dialog_new ("Select an icon", NULL, 43 | "Cancel", GTK_RESPONSE_CANCEL, 44 | "OK", GTK_RESPONSE_ACCEPT, 45 | NULL); 46 | gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT); 47 | if (argc > 1) 48 | exo_icon_chooser_dialog_set_icon (EXO_ICON_CHOOSER_DIALOG (dialog), argv[1]); 49 | if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) 50 | { 51 | icon = exo_icon_chooser_dialog_get_icon (EXO_ICON_CHOOSER_DIALOG (dialog)); 52 | g_message ("icon = '%s'", icon); 53 | g_free (icon); 54 | } 55 | gtk_widget_destroy (dialog); 56 | 57 | return EXIT_SUCCESS; 58 | } 59 | -------------------------------------------------------------------------------- /tests/test-exo-noop.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009 Nick Schermer 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #ifdef HAVE_CONFIG_H 21 | #include 22 | #endif 23 | 24 | #ifdef HAVE_STDLIB_H 25 | #include 26 | #endif 27 | 28 | /* prevent g_test_init from aborting */ 29 | #ifdef G_DISABLE_ASSERT 30 | #undef G_DISABLE_ASSERT 31 | #endif 32 | 33 | #include 34 | 35 | 36 | 37 | static void 38 | test_noop_one (void) 39 | { 40 | g_assert (exo_noop_one () == 1); 41 | } 42 | 43 | 44 | 45 | static void 46 | test_noop_zero (void) 47 | { 48 | g_assert (exo_noop_zero () == 0); 49 | } 50 | 51 | 52 | 53 | static void 54 | test_noop_null (void) 55 | { 56 | g_assert (exo_noop_null () == NULL); 57 | } 58 | 59 | 60 | 61 | static void 62 | test_noop_true (void) 63 | { 64 | g_assert (exo_noop_true () == TRUE); 65 | } 66 | 67 | 68 | 69 | static void 70 | test_noop_false (void) 71 | { 72 | g_assert (exo_noop_false () == FALSE); 73 | } 74 | 75 | 76 | 77 | gint 78 | main (gint argc, 79 | gchar **argv) 80 | { 81 | g_test_init (&argc, &argv, NULL); 82 | 83 | g_test_add_func ("/noop/test-noop-one", test_noop_one); 84 | g_test_add_func ("/noop/test-noop-zero", test_noop_zero); 85 | g_test_add_func ("/noop/test-noop-null", test_noop_null); 86 | g_test_add_func ("/noop/test-noop-true", test_noop_true); 87 | g_test_add_func ("/noop/test-noop-false", test_noop_false); 88 | 89 | return g_test_run (); 90 | } 91 | -------------------------------------------------------------------------------- /tests/test-exo-string.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009 Nick Schermer 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #ifdef HAVE_CONFIG_H 21 | #include 22 | #endif 23 | 24 | #ifdef HAVE_STDLIB_H 25 | #include 26 | #endif 27 | 28 | /* prevent g_test_init from aborting */ 29 | #ifdef G_DISABLE_ASSERT 30 | #undef G_DISABLE_ASSERT 31 | #endif 32 | 33 | #include 34 | 35 | 36 | 37 | static void 38 | test_str_elide_underscores (void) 39 | { 40 | gchar *res; 41 | 42 | res = exo_str_elide_underscores ("this_is_a_sample"); 43 | g_assert_cmpstr (res, ==, "thisisasample"); 44 | g_free (res); 45 | 46 | res = exo_str_elide_underscores ("m__nemonic"); 47 | g_assert_cmpstr (res, ==, "m_nemonic"); 48 | g_free (res); 49 | } 50 | 51 | 52 | 53 | static void 54 | test_str_is_equal (void) 55 | { 56 | const gchar *p = "cde"; 57 | 58 | /* comparison that should return FALSE */ 59 | g_assert (!exo_str_is_equal ("a", NULL)); 60 | g_assert (!exo_str_is_equal (NULL, "b")); 61 | g_assert (!exo_str_is_equal ("a", "abcde")); 62 | g_assert (!exo_str_is_equal (p, "a")); 63 | 64 | /* comparison that should return TRUE */ 65 | g_assert (exo_str_is_equal (NULL, NULL)); 66 | g_assert (exo_str_is_equal ("test", "test")); 67 | g_assert (exo_str_is_equal (p, p)); 68 | } 69 | 70 | 71 | 72 | static void 73 | test_str_is_empty (void) 74 | { 75 | const gchar *p; 76 | 77 | p = NULL; 78 | g_assert (exo_str_is_empty (p)); 79 | 80 | p = ""; 81 | g_assert (exo_str_is_empty (p)); 82 | 83 | p = "a"; 84 | g_assert (!exo_str_is_empty (p)); 85 | } 86 | 87 | 88 | 89 | static void 90 | test_str_replace (void) 91 | { 92 | gchar *res; 93 | const gchar *test = "You should eat fruits every day."; 94 | 95 | res = exo_str_replace (test, "fruits", "pizza"); 96 | g_assert_cmpstr (res, ==, "You should eat pizza every day."); 97 | g_free (res); 98 | 99 | res = exo_str_replace (test, " fruits every day", NULL); 100 | g_assert_cmpstr (res, ==, "You should eat."); 101 | g_free (res); 102 | 103 | res = exo_str_replace (NULL, NULL, NULL); 104 | g_assert (res == NULL); 105 | 106 | res = exo_str_replace (test, NULL, NULL); 107 | g_assert_cmpstr (res, ==, test); 108 | g_free (res); 109 | } 110 | 111 | 112 | 113 | static void 114 | test_strdup_strftime (void) 115 | { 116 | /* TODO */ 117 | } 118 | 119 | 120 | 121 | static void 122 | test_strndupv (void) 123 | { 124 | gchar **res, **input; 125 | guint i; 126 | 127 | input = g_strsplit ("v,w,x,y,z", ",", -1); 128 | 129 | res = exo_strndupv (input, 2); 130 | g_assert_cmpuint (g_strv_length (res), ==, 2); 131 | for (i = 0; i < g_strv_length (res); i++) 132 | g_assert_cmpstr (res[i], ==, input[i]); 133 | g_strfreev (res); 134 | 135 | res = exo_strndupv (input, 500); 136 | g_assert_cmpuint (g_strv_length (res), ==, g_strv_length (input)); 137 | for (i = 0; i < g_strv_length (res); i++) 138 | g_assert_cmpstr (res[i], ==, input[i]); 139 | g_strfreev (res); 140 | 141 | res = exo_strndupv (input, 0); 142 | g_assert (res == NULL); 143 | 144 | res = exo_strndupv (NULL, 2); 145 | g_assert (res == NULL); 146 | 147 | g_strfreev (input); 148 | } 149 | 150 | 151 | 152 | gint 153 | main (gint argc, 154 | gchar **argv) 155 | { 156 | g_test_init (&argc, &argv, NULL); 157 | 158 | g_test_add_func ("/string/test-str-elide-underscores", test_str_elide_underscores); 159 | g_test_add_func ("/string/test-str-is-equal", test_str_is_equal); 160 | g_test_add_func ("/string/test-str-is-empty", test_str_is_empty); 161 | g_test_add_func ("/string/test-str-replace", test_str_replace); 162 | g_test_add_func ("/string/test-strdup-strftime", test_strdup_strftime); 163 | g_test_add_func ("/string/test-strndupv", test_strndupv); 164 | 165 | return g_test_run (); 166 | } 167 | --------------------------------------------------------------------------------