pax_global_header00006660000000000000000000000064137030420060014505gustar00rootroot0000000000000052 comment=5f63845339b308a6fb37e2f2a6480461ebee20ad xfce4-sntray-plugin-0.4.13.1/000077500000000000000000000000001370304200600155545ustar00rootroot00000000000000xfce4-sntray-plugin-0.4.13.1/.clang-format000066400000000000000000000050341370304200600201310ustar00rootroot00000000000000--- AccessModifierOffset: 0 AlignAfterOpenBracket: true AlignConsecutiveAssignments: true #uncomment for clang 3.9 #AlignConsecutiveDeclarations: false AlignEscapedNewlinesLeft: false AlignOperands: true AlignTrailingComments: true AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: None AllowShortIfStatementsOnASingleLine: false AllowShortLoopsOnASingleLine: false # AlwaysBreakAfterDefinitionReturnType: None #uncomment for clang 3.9 #AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: true AlwaysBreakTemplateDeclarations: false BinPackArguments: false BinPackParameters: true # BraceWrapping: (not set since BreakBeforeBraces is not Custom) BreakBeforeBinaryOperators: None # BreakAfterJavaFieldAnnotations: (not java) BreakBeforeBinaryOperators: None BreakBeforeBraces: Allman BreakBeforeTernaryOperators: true BreakConstructorInitializersBeforeComma: false #uncomment for clang 3.9 #BreakStringLiterals: false ColumnLimit: 100 CommentPragmas: '\*\<' ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 4 Cpp11BracedListStyle: false DerivePointerAlignment: false DisableFormat: false ExperimentalAutoDetectBinPacking: false #Uncomment for clang 3.9 #IncludeCategories: # - Regex: '^"' # Priority: 1 # IncludeIsMainRegex: (project doesn't use a main includes that can add other includes via regex) IndentCaseLabels: false IndentWidth: 8 IndentWrappedFunctionNames: false # JavaScriptQuotes: (not javascript) KeepEmptyLinesAtTheStartOfBlocks: false Language: Cpp MacroBlockBegin: '' MacroBlockEnd: '' MaxEmptyLinesToKeep: 1 NamespaceIndentation: None # ObjCBlockIndentWidth: (not objc) # ObjCSpaceAfterProperty: (not objc) # ObjCSpaceBeforeProtocolList: (not objc) PenaltyBreakBeforeFirstCallParameter: 400 PenaltyBreakComment: 0 # PenaltyBreakFirstLessLess: (not cpp) PenaltyBreakString: 500 PenaltyExcessCharacter: 10000 PenaltyReturnTypeOnItsOwnLine: 600 PointerAlignment: Right #uncomment for clang 3.9 #ReflowComments: true #uncomment for clang 3.9 #SortIncludes: true SpaceAfterCStyleCast: false SpaceBeforeAssignmentOperators: true SpaceBeforeParens: ControlStatements SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 1 SpacesInAngles: false SpacesInCStyleCastParentheses: false # SpacesInContainerLiterals: (not objc or javascript) SpacesInParentheses: false SpacesInSquareBrackets: false Standard: Cpp11 TabWidth: 8 UseTab: ForIndentation ... xfce4-sntray-plugin-0.4.13.1/.gitlab-ci.yml000066400000000000000000000022411370304200600202070ustar00rootroot00000000000000stages: - build - release before_script: - mkdir -p _ccache - export CCACHE_BASEDIR=${PWD} - export CCACHE_DIR=${PWD}/_ccache cache: paths: - _ccache/ build: image: archlinux/base stage: build script: - pacman -Syy --noconfirm glibc libwnck3 gtk3 vala cmake git base-devel clang ninja xfce4-panel mate-panel budgie-desktop gobject-introspection - git clone https://gitlab.com/vala-panel-project/cmake-vala.git - cd cmake-vala && cmake . -DCMAKE_INSTALL_PREFIX=/usr -GNinja && ninja install && cd .. && rm -rf cmake-vala - git clone https://gitlab.com/vala-panel-project/vala-panel.git - cd vala-panel && cmake . -DCMAKE_INSTALL_PREFIX=/usr -GNinja && ninja install && cd .. && rm -rf vala-panel - mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr -GNinja - ninja - ninja install - ninja dist artifacts: paths: - "build/xfce4-sntray-plugin*.tar.xz" expire_in: 1 week release-main: image: alpine:edge stage: release script: - apk add --no-cache python3 py3-pip - pip3 install gitlab_release - python3 -m gitlab_release ${PRIVATE_TOKEN} build/xfce4-sntray-plugin*.tar.xz only: - tags xfce4-sntray-plugin-0.4.13.1/.gitmodules000066400000000000000000000001361370304200600177310ustar00rootroot00000000000000[submodule "cmake"] path = cmake url = https://gitlab.com/vala-panel-project/cmake-vala.git xfce4-sntray-plugin-0.4.13.1/CMakeLists.txt000066400000000000000000000064041370304200600203200ustar00rootroot00000000000000project(xfce4-sntray-plugin C) cmake_minimum_required(VERSION 3.6 FATAL_ERROR) cmake_policy (VERSION 3.6) include(GNUInstallDirs) set (GETTEXT_PACKAGE ${CMAKE_PROJECT_NAME}) if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/VCMSubmodule.cmake) include(${CMAKE_SOURCE_DIR}/cmake/VCMSubmodule.cmake) use_vcm(${CMAKE_SOURCE_DIR}/cmake) else() find_package(VCM REQUIRED NO_MODULE) list(APPEND CMAKE_MODULE_PATH ${VCM_MODULE_PATH}) endif() include(GitVersion) determine_fallback_version(${CMAKE_SOURCE_DIR}/cmake) include(${CMAKE_SOURCE_DIR}/cmake/FallbackVersion.cmake) include(Format) find_package (PkgConfig) find_package(GLIB2 2.50 REQUIRED COMPONENTS GOBJECT GIO GIO_UNIX GMODULE GTHREAD CODEGEN MKENUMS GENMARSHAL COMPILE_SCHEMAS COMPILE_RESOURCES) include(GLibProgramHandlers) find_package(GTK 3.22 REQUIRED COMPONENTS GDK X11 WAYLAND) find_package(Vala 0.36 REQUIRED) include(ValaPrecompile) add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\") add_definitions(-Wall -Wextra -Wno-unused -Wno-unused-parameter# Vala loves to create variables # -pedantic -Wno-ignored-qualifiers -Wno-incompatible-pointer-types -Wno-missing-field-initializers -Wno-sign-compare ) #Vala often forgot cast to GtkWidget or gpointer include(CMakeDependentOption) include(FeatureSummary) #set build options pkg_check_modules(XFCE libxfce4panel-2.0 libxfconf-0 IMPORTED_TARGET) cmake_dependent_option(ENABLE_XFCE "Enable Xfce Panel Integration" ON "XFCE_FOUND" OFF) add_feature_info(Xfce ENABLE_XFCE "Xfce Panel Integration") pkg_check_modules(MATE libmatepanelapplet-4.0>=1.20 IMPORTED_TARGET) cmake_dependent_option(ENABLE_MATE "Enable mate-panel Integration" ON "MATE_FOUND" OFF) add_feature_info(MATE ENABLE_MATE "MATE Panel Integration") find_package(PEAS 1.14 COMPONENTS PEAS) pkg_check_modules(VALAPANEL vala-panel>=0.4.89 IMPORTED_TARGET) pkg_check_modules(BUDGIE budgie-1.0>=2 IMPORTED_TARGET) cmake_dependent_option(ENABLE_VALAPANEL "Enable Vala Panel Integration" ON "VALAPANEL_FOUND" OFF) if (VALAPANEL_FOUND) add_feature_info(ValaPanel ENABLE_VALAPANEL "Vala Panel Integration - 0.5.x") endif() cmake_dependent_option(ENABLE_BUDGIE "Enable budgie-desktop plugin" ON "BUDGIE_FOUND; PEAS_FOUND" OFF) add_feature_info(Budgie ENABLE_BUDGIE "Budgie Desktop Integration") # Configuration configure_file (${CMAKE_SOURCE_DIR}/src/config.vala.in ${CMAKE_BINARY_DIR}/src/config.vala) # Common include dir INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) add_subdirectory(data) add_subdirectory(po) add_subdirectory(src) #add_subdirectory(xembedsniproxy) # Add 'make dist' command for creating release tarball set (CPACK_PACKAGE_VERSION ${VERSION}) set (CPACK_PACKAGE_RELEASE "1") set (CPACK_SOURCE_GENERATOR "TXZ") set (CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}") set (CPACK_SOURCE_IGNORE_FILES "/build/;/.git;/.gitignore;/.gitmodules;~$;${CPACK_SOURCE_IGNORE_FILES}") include (CPack) add_custom_target (dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) #Add RPM build support include (UseRPMTools) if (RPMTools_FOUND) RPMTools_ADD_RPM_TARGETS(package ${CMAKE_SOURCE_DIR}/rpm/xfce4-sntray-plugin.spec.in) endif(RPMTools_FOUND) feature_summary(WHAT ALL) xfce4-sntray-plugin-0.4.13.1/LICENSE000066400000000000000000000164171370304200600165720ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright © 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. “The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. xfce4-sntray-plugin-0.4.13.1/README.md000066400000000000000000000006171370304200600170370ustar00rootroot00000000000000--- Vala Panel SNTray --- Panel plugin to show StatusNotifierItems (also known as AppIndicators) for use with Vala Panel, xfce4-panel and mate-panel (Budgie 10.x is also planned). **REQUIRED DEPENDENCES** * GLib (>= 2.50.0) * GTK+ (>= 3.22.0) * valac (>= 0.24.0) *Special thanks:* snw-plugin by equiem (https://github.com/equeim/snw-plugin) Author === * Athor xfce4-sntray-plugin-0.4.13.1/cmake/000077500000000000000000000000001370304200600166345ustar00rootroot00000000000000xfce4-sntray-plugin-0.4.13.1/data/000077500000000000000000000000001370304200600164655ustar00rootroot00000000000000xfce4-sntray-plugin-0.4.13.1/data/CMakeLists.txt000066400000000000000000000021741370304200600212310ustar00rootroot00000000000000if (ENABLE_XFCE) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/sntray.desktop DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/xfce4/panel/plugins) endif() if (ENABLE_MATE) add_schema("org.valapanel.toplevel.sntray.gschema.xml") configure_file(${CMAKE_SOURCE_DIR}/data/sntray-mate.desktop.plugin.in ${CMAKE_SOURCE_DIR}/data/sntray-mate.desktop.in) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/sntray-mate.desktop DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/mate-panel/applets/ RENAME org.vala-panel.SNTray.mate-panel-applet) endif() if (ENABLE_VALAPANEL) add_schema("org.valapanel.toplevel.sntray.gschema.xml") configure_file(${CMAKE_SOURCE_DIR}/data/sntray.desktop.plugin.in.cmake ${CMAKE_SOURCE_DIR}/data/sntray.desktop.plugin.in) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/sntray.plugin DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/vala-panel/applets RENAME org.valapanel.sntray.plugin) endif() if (ENABLE_BUDGIE) add_schema("org.valapanel.toplevel.sntray.gschema.xml") install(FILES ${CMAKE_CURRENT_BINARY_DIR}/sntray-budgie.plugin DESTINATION ${CMAKE_INSTALL_LIBDIR}/budgie-desktop/plugins/budgie-sntray-plugin) endif() xfce4-sntray-plugin-0.4.13.1/data/org.valapanel.toplevel.sntray.gschema.xml000066400000000000000000000037551370304200600265300ustar00rootroot00000000000000 22 [] [] true true true true true true true true 22 [] [] true true true true true true true true xfce4-sntray-plugin-0.4.13.1/data/sntray-budgie.desktop.plugin.in000066400000000000000000000004101370304200600245320ustar00rootroot00000000000000[Plugin] Module=sntray-budgie.so Name=StatusNotifier Description=System tray in KDE StatusNotifierItem format Authors=Konstantin Pugin Copyright=Copyright © 2016 Konstantin Pugin Website=https://github.com/rilian-la-te/xfce4-sntray-plugin Icon=view-grid-symbolic xfce4-sntray-plugin-0.4.13.1/data/sntray-mate.desktop.plugin.in000066400000000000000000000004131370304200600242240ustar00rootroot00000000000000[Applet Factory] Id=SNTrayAppletFactory Location=@CMAKE_INSTALL_FULL_LIBDIR@/mate-panel/libsntray-mate.so Name=SNTray applet factory InProcess=true [SNTrayApplet] Name=SNI Notification area Description=Area where StatusNotifierItem's appear Icon=applications-system xfce4-sntray-plugin-0.4.13.1/data/sntray.desktop.plugin.in.cmake000066400000000000000000000005121370304200600243570ustar00rootroot00000000000000[Plugin] Module=sntray Name=StatusNotifier Description=System tray in KDE StatusNotifierItem format Icon=applications-utilities-symbolic Website=https://gitlab.com/vala-panel-project/xfce4-sntray-plugin HelpURI=https://gitlab.com/vala-panel-project/xfce4-sntray-plugin License=lgpl Version=@VERSION@ X-ValaPanel-Configurable=true xfce4-sntray-plugin-0.4.13.1/data/sntray.desktop.xfce.in000066400000000000000000000002721370304200600227320ustar00rootroot00000000000000[Xfce Panel] Type=X-XFCE-PanelPlugin Encoding=UTF-8 Name=StatusNotifier Plugin Comment=Display AppIndicators in FlowBox Icon=applications-system X-XFCE-Module=sntray-xfce X-XFCE-API=2.0 xfce4-sntray-plugin-0.4.13.1/include/000077500000000000000000000000001370304200600171775ustar00rootroot00000000000000xfce4-sntray-plugin-0.4.13.1/include/sn-common.h000066400000000000000000000026161370304200600212630ustar00rootroot00000000000000/* * xfce4-sntray-plugin * Copyright (C) 2015-2019 Konstantin Pugin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ #ifndef SN_COMMON_H #define SN_COMMON_H #include #include G_BEGIN_DECLS typedef enum { SN_CATEGORY_APPLICATION, /*< nick=ApplicationStatus >*/ SN_CATEGORY_COMMUNICATIONS, /*< nick=Communications >*/ SN_CATEGORY_SYSTEM, /*< nick=SystemServices >*/ SN_CATEGORY_HARDWARE, /*< nick=Hardware >*/ SN_CATEGORY_OTHER /*< nick=Other >*/ } SnCategory; typedef enum { SN_STATUS_PASSIVE, /*< nick=Passive >*/ SN_STATUS_ACTIVE, /*< nick=Active >*/ SN_STATUS_ATTENTION /*< nick=NeedsAttention >*/ } SnStatus; #define string_empty(str) (!(str) ? true : (!strlen(str) ? true : false)) G_END_DECLS #endif xfce4-sntray-plugin-0.4.13.1/po/000077500000000000000000000000001370304200600161725ustar00rootroot00000000000000xfce4-sntray-plugin-0.4.13.1/po/CMakeLists.txt000066400000000000000000000004011370304200600207250ustar00rootroot00000000000000configure_file(${CMAKE_SOURCE_DIR}/data/sntray-mate.desktop.plugin.in ${CMAKE_SOURCE_DIR}/data/sntray-mate.desktop.in) include(Translations) add_translations_directory(${GETTEXT_PACKAGE}) add_translations_catalog(${GETTEXT_PACKAGE} ../src ../data ) xfce4-sntray-plugin-0.4.13.1/po/LINGUAS.in000066400000000000000000000000121370304200600176150ustar00rootroot00000000000000@LINGUAS@ xfce4-sntray-plugin-0.4.13.1/po/aa.po000066400000000000000000000001251370304200600171110ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ab.po000066400000000000000000000001251370304200600171120ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ae.po000066400000000000000000000001251370304200600171150ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/af.po000066400000000000000000000001251370304200600171160ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ak.po000066400000000000000000000001251370304200600171230ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/am.po000066400000000000000000000001251370304200600171250ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/an.po000066400000000000000000000001251370304200600171260ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ar.po000066400000000000000000000001251370304200600171320ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/as.po000066400000000000000000000001251370304200600171330ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ast.po000066400000000000000000000001251370304200600173170ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/av.po000066400000000000000000000001251370304200600171360ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ay.po000066400000000000000000000001251370304200600171410ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/az.po000066400000000000000000000001251370304200600171420ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ba.po000066400000000000000000000001251370304200600171120ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/be.po000066400000000000000000000003141370304200600171160ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" xfce4-sntray-plugin-0.4.13.1/po/bg.po000066400000000000000000000002021370304200600171140ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" xfce4-sntray-plugin-0.4.13.1/po/bh.po000066400000000000000000000001251370304200600171210ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/bi.po000066400000000000000000000001251370304200600171220ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/bm.po000066400000000000000000000001251370304200600171260ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/bn.po000066400000000000000000000001251370304200600171270ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/bo.po000066400000000000000000000001251370304200600171300ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/br.po000066400000000000000000000001251370304200600171330ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/bs.po000066400000000000000000000001251370304200600171340ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ca.po000066400000000000000000000001251370304200600171130ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ce.po000066400000000000000000000001251370304200600171170ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ch.po000066400000000000000000000001251370304200600171220ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ckb.po000066400000000000000000000001251370304200600172670ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/co.po000066400000000000000000000001251370304200600171310ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/cr.po000066400000000000000000000001251370304200600171340ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/cs.po000066400000000000000000000002371370304200600171410ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" xfce4-sntray-plugin-0.4.13.1/po/cu.po000066400000000000000000000001251370304200600171370ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/cv.po000066400000000000000000000001251370304200600171400ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/cy.po000066400000000000000000000001251370304200600171430ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/da.po000066400000000000000000000001251370304200600171140ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/de.po000066400000000000000000000002021370304200600171140ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" xfce4-sntray-plugin-0.4.13.1/po/dv.po000066400000000000000000000001251370304200600171410ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/dz.po000066400000000000000000000001251370304200600171450ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ee.po000066400000000000000000000001251370304200600171210ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/el.po000066400000000000000000000001251370304200600171300ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/en_AU.po000066400000000000000000000001251370304200600175170ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/en_CA.po000066400000000000000000000001251370304200600174750ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/en_GB.po000066400000000000000000000001251370304200600175020ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/eo.po000066400000000000000000000002021370304200600171270ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" xfce4-sntray-plugin-0.4.13.1/po/es.po000066400000000000000000000002021370304200600171330ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" xfce4-sntray-plugin-0.4.13.1/po/et.po000066400000000000000000000002021370304200600171340ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" xfce4-sntray-plugin-0.4.13.1/po/eu.po000066400000000000000000000001251370304200600171410ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/fa.po000066400000000000000000000001251370304200600171160ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ff.po000066400000000000000000000001251370304200600171230ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/fi.po000066400000000000000000000002021370304200600171220ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" xfce4-sntray-plugin-0.4.13.1/po/fj.po000066400000000000000000000001251370304200600171270ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/fo.po000066400000000000000000000002021370304200600171300ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" xfce4-sntray-plugin-0.4.13.1/po/fr.po000066400000000000000000000001771370304200600171460ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n>1;\n" xfce4-sntray-plugin-0.4.13.1/po/fr_CA.po000066400000000000000000000001771370304200600175110ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n>1;\n" xfce4-sntray-plugin-0.4.13.1/po/fy.po000066400000000000000000000001251370304200600171460ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ga.po000066400000000000000000000001251370304200600171170ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/gd.po000066400000000000000000000001251370304200600171220ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/gl.po000066400000000000000000000001251370304200600171320ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/gn.po000066400000000000000000000001251370304200600171340ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/gu.po000066400000000000000000000001251370304200600171430ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/gv.po000066400000000000000000000001251370304200600171440ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ha.po000066400000000000000000000001251370304200600171200ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/he.po000066400000000000000000000002021370304200600171200ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" xfce4-sntray-plugin-0.4.13.1/po/hi.po000066400000000000000000000001251370304200600171300ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ho.po000066400000000000000000000001251370304200600171360ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/hr.po000066400000000000000000000003141370304200600171410ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" xfce4-sntray-plugin-0.4.13.1/po/ht.po000066400000000000000000000001251370304200600171430ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/hu.po000066400000000000000000000002021370304200600171400ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" xfce4-sntray-plugin-0.4.13.1/po/hy.po000066400000000000000000000001251370304200600171500ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/hz.po000066400000000000000000000001251370304200600171510ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ia.po000066400000000000000000000001251370304200600171210ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/id.po000066400000000000000000000001251370304200600171240ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ie.po000066400000000000000000000001251370304200600171250ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ig.po000066400000000000000000000001251370304200600171270ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ii.po000066400000000000000000000001251370304200600171310ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ik.po000066400000000000000000000001251370304200600171330ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/io.po000066400000000000000000000001251370304200600171370ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/is.po000066400000000000000000000001251370304200600171430ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/it.po000066400000000000000000000002021370304200600171400ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" xfce4-sntray-plugin-0.4.13.1/po/iu.po000066400000000000000000000001251370304200600171450ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ja.po000066400000000000000000000002121370304200600171170ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;\n" xfce4-sntray-plugin-0.4.13.1/po/jv.po000066400000000000000000000001251370304200600171470ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ka.po000066400000000000000000000001251370304200600171230ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/kg.po000066400000000000000000000001251370304200600171310ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ki.po000066400000000000000000000001251370304200600171330ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/kj.po000066400000000000000000000001251370304200600171340ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/kk.po000066400000000000000000000001251370304200600171350ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/kl.po000066400000000000000000000001251370304200600171360ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/km.po000066400000000000000000000001251370304200600171370ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/kn.po000066400000000000000000000001251370304200600171400ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ko.po000066400000000000000000000002121370304200600171360ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;\n" xfce4-sntray-plugin-0.4.13.1/po/kr.po000066400000000000000000000001251370304200600171440ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ks.po000066400000000000000000000001251370304200600171450ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ku.po000066400000000000000000000001251370304200600171470ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/kv.po000066400000000000000000000001251370304200600171500ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/kw.po000066400000000000000000000001251370304200600171510ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ky.po000066400000000000000000000001251370304200600171530ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/la.po000066400000000000000000000001251370304200600171240ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/lb.po000066400000000000000000000001251370304200600171250ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/lg.po000066400000000000000000000001251370304200600171320ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/li.po000066400000000000000000000001251370304200600171340ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ln.po000066400000000000000000000001251370304200600171410ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/lo.po000066400000000000000000000001251370304200600171420ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/lt.po000066400000000000000000000003011370304200600171430ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2;\n" xfce4-sntray-plugin-0.4.13.1/po/lu.po000066400000000000000000000001251370304200600171500ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/lv.po000066400000000000000000000002451370304200600171540ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2;\n" xfce4-sntray-plugin-0.4.13.1/po/mg.po000066400000000000000000000001251370304200600171330ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/mh.po000066400000000000000000000001251370304200600171340ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/mi.po000066400000000000000000000001251370304200600171350ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/mk.po000066400000000000000000000001251370304200600171370ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ml.po000066400000000000000000000001251370304200600171400ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/mn.po000066400000000000000000000001251370304200600171420ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/mo.po000066400000000000000000000001251370304200600171430ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/mr.po000066400000000000000000000001251370304200600171460ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ms.po000066400000000000000000000001251370304200600171470ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/mt.po000066400000000000000000000001251370304200600171500ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/my.po000066400000000000000000000001251370304200600171550ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/na.po000066400000000000000000000001251370304200600171260ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/nb.po000066400000000000000000000002021370304200600171230ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" xfce4-sntray-plugin-0.4.13.1/po/nd.po000066400000000000000000000001251370304200600171310ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ne.po000066400000000000000000000001251370304200600171320ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ng.po000066400000000000000000000001251370304200600171340ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/nl.po000066400000000000000000000002021370304200600171350ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" xfce4-sntray-plugin-0.4.13.1/po/nn.po000066400000000000000000000002021370304200600171370ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" xfce4-sntray-plugin-0.4.13.1/po/no.po000066400000000000000000000002021370304200600171400ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" xfce4-sntray-plugin-0.4.13.1/po/nr.po000066400000000000000000000001251370304200600171470ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/nv.po000066400000000000000000000001251370304200600171530ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ny.po000066400000000000000000000001251370304200600171560ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/oc.po000066400000000000000000000001251370304200600171310ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/oj.po000066400000000000000000000001251370304200600171400ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/om.po000066400000000000000000000001251370304200600171430ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/or.po000066400000000000000000000001251370304200600171500ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/os.po000066400000000000000000000001251370304200600171510ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/pa.po000066400000000000000000000001251370304200600171300ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/pi.po000066400000000000000000000001251370304200600171400ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/pl.po000066400000000000000000000002741370304200600171500ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" xfce4-sntray-plugin-0.4.13.1/po/ps.po000066400000000000000000000001251370304200600171520ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/pt.po000066400000000000000000000002021370304200600171470ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" xfce4-sntray-plugin-0.4.13.1/po/pt_BR.po000066400000000000000000000001771370304200600175450ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n>1;\n" xfce4-sntray-plugin-0.4.13.1/po/qu.po000066400000000000000000000001251370304200600171550ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/rm.po000066400000000000000000000001251370304200600171460ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/rn.po000066400000000000000000000001251370304200600171470ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ro.po000066400000000000000000000002621370304200600171520ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2;\n" xfce4-sntray-plugin-0.4.13.1/po/ru.po000066400000000000000000000117341370304200600171660ustar00rootroot00000000000000# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # Gofer , 2008. # msgid "" msgstr "" "Project-Id-Version: xfce4-sntray-plugin\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-08-17 15:55+0300\n" "PO-Revision-Date: 2018-08-17 15:57+0300\n" "Last-Translator: Andriy Grytsenko \n" "Language-Team: Russian \n" "Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "X-Generator: Poedit 1.8.7.1\n" "X-POOTLE-MTIME: 1407841216.000000\n" #: ../src/snconfig.ui:38 ../src/snconfig.vala:63 msgid "StatusNotifier Configuration" msgstr "Настройка апплета StatusNotifier" #: ../src/snconfig.ui:86 ../src/snconfig.ui:79 msgid "Show Application Status" msgstr "Показывать значки приложений" #: ../src/snconfig.ui:101 ../src/snconfig.ui:93 msgid "Show Communications" msgstr "Показывать значки коммуникаций" #: ../src/snconfig.ui:116 ../src/snconfig.ui:107 msgid "Show System Services" msgstr "Показывать значки системных служб" #: ../src/snconfig.ui:131 ../src/snconfig.ui:121 msgid "Show Hardware" msgstr "Показывать значки служб устройств" #: ../src/snconfig.ui:146 ../src/snconfig.ui:135 msgid "Show Other" msgstr "Показывать остальные значки" #: ../src/snconfig.ui:161 ../src/snconfig.ui:149 msgid "Show Passive" msgstr "Показывать значки служб в пассивном режиме" #: ../src/snconfig.ui:180 ../src/snconfig.ui:167 msgid "Categories visibility" msgstr "Фильтр по категориям" #: ../src/snconfig.ui:206 ../src/snconfig.ui:221 ../src/snconfig.ui:207 msgid "Use symbolic icons" msgstr "Использовать монохромные значки" #: ../src/snconfig.ui:228 ../src/snconfig.ui:243 msgid "Indicator size:" msgstr "Размер значка:" #: ../src/snconfig.ui:266 ../src/snconfig.ui:281 msgid "Appearance properties" msgstr "Внешний вид" #: ../src/snconfig.ui:285 ../src/snconfig.ui:300 ../src/snconfig.ui:282 msgid "Core" msgstr "Общее" #: ../src/snconfig.ui:309 ../src/snconfig.ui:396 ../src/snconfig.ui:324 #: ../src/snconfig.ui:411 ../src/snconfig.ui:303 ../src/snconfig.ui:381 msgid "Icon" msgstr "Значок" #: ../src/snconfig.ui:320 ../src/snconfig.ui:407 ../src/snconfig.ui:335 #: ../src/snconfig.ui:422 ../src/snconfig.ui:314 ../src/snconfig.ui:392 msgid "Name" msgstr "Имя" #: ../src/snconfig.ui:331 ../src/snconfig.ui:418 ../src/snconfig.ui:346 #: ../src/snconfig.ui:433 ../src/snconfig.ui:325 ../src/snconfig.ui:403 msgid "Override" msgstr "Настройка" #: ../src/snconfig.ui:344 ../src/snconfig.ui:359 ../src/snconfig.ui:338 msgid "Index" msgstr "Индекс" #: ../src/snconfig.ui:369 ../src/snconfig.ui:384 ../src/snconfig.ui:357 msgid "Order" msgstr "Порядок" #: ../src/snconfig.ui:431 ../src/snconfig.ui:446 ../src/snconfig.ui:416 msgid "Visible" msgstr "Видимый" #: ../src/snconfig.ui:454 ../src/snconfig.ui:469 ../src/snconfig.ui:433 msgid "Visibility" msgstr "Видимость" #: ../data/sntray.desktop.xfce.in:5 msgid "StatusNotifier Plugin" msgstr "Апплет StatusNotifier" #: ../data/sntray.desktop.xfce.in:6 msgid "Display AppIndicators in FlowBox" msgstr "Показывает значки AppIndicators (трей KDE)" #: ../data/sntray.desktop.xfce.in:7 ../data/sntray-mate.desktop.plugin.in:11 #: ../data/sntray-mate.desktop.in:11 msgid "applications-system" msgstr "applications-system" #: ../src/snconfig.ui:206 ../src/snconfig.ui:193 msgid "Show labels near icons (if applications provides some)" msgstr "Показывать текст рядом с иконками (если приложение показывает)" #: ../data/sntray.desktop.plugin.in:4 ../data/sntray-budgie.desktop.plugin.in:4 msgid "StatusNotifier" msgstr "StatusNotifier" #: ../data/sntray.desktop.plugin.in:5 ../data/sntray-budgie.desktop.plugin.in:5 msgid "System tray in KDE StatusNotifierItem format" msgstr "Системный лоток в формате KDE StatusNotifierItem." #: ../src/mate-sntray-applet.vala:67 msgid "_Preferences" msgstr "_Настройки" #: ../data/sntray-budgie.desktop.plugin.in:9 msgid "view-grid-symbolic" msgstr "view-grid-symbolic" #: ../data/sntray-mate.desktop.plugin.in:5 ../data/sntray-mate.desktop.in:5 msgid "SNTray applet factory" msgstr "Фабрика апплета SNTray" #: ../data/sntray-mate.desktop.plugin.in:9 ../data/sntray-mate.desktop.in:9 msgid "SNI Notification area" msgstr "Зона для апплетов SNI" #: ../data/sntray-mate.desktop.plugin.in:10 msgid "Area where StatusNotifierItem's appear" msgstr "Зона, где появляются апплеты типа StatusNotifierItem" xfce4-sntray-plugin-0.4.13.1/po/rue.po000066400000000000000000000001251370304200600173230ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/rw.po000066400000000000000000000001251370304200600171600ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/sa.po000066400000000000000000000001251370304200600171330ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/sc.po000066400000000000000000000001251370304200600171350ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/sd.po000066400000000000000000000001251370304200600171360ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/se.po000066400000000000000000000001251370304200600171370ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/sg.po000066400000000000000000000001251370304200600171410ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/si.po000066400000000000000000000001251370304200600171430ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/sk.po000066400000000000000000000002371370304200600171510ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" xfce4-sntray-plugin-0.4.13.1/po/sl.po000066400000000000000000000002661370304200600171540ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3;\n" xfce4-sntray-plugin-0.4.13.1/po/sm.po000066400000000000000000000001251370304200600171470ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/sma.po000066400000000000000000000001251370304200600173100ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/sn.po000066400000000000000000000001251370304200600171500ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/so.po000066400000000000000000000001251370304200600171510ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/sq.po000066400000000000000000000001251370304200600171530ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/sr.po000066400000000000000000000003141370304200600171540ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" xfce4-sntray-plugin-0.4.13.1/po/ss.po000066400000000000000000000001251370304200600171550ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/st.po000066400000000000000000000001251370304200600171560ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/stamp-it000066400000000000000000000000001370304200600176410ustar00rootroot00000000000000xfce4-sntray-plugin-0.4.13.1/po/su.po000066400000000000000000000001251370304200600171570ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/sv.po000066400000000000000000000002021370304200600171540ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" xfce4-sntray-plugin-0.4.13.1/po/sw.po000066400000000000000000000001251370304200600171610ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ta.po000066400000000000000000000001251370304200600171340ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/te.po000066400000000000000000000001251370304200600171400ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/tg.po000066400000000000000000000001251370304200600171420ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/th.po000066400000000000000000000001251370304200600171430ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ti.po000066400000000000000000000001251370304200600171440ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/tk.po000066400000000000000000000001251370304200600171460ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/tl.po000066400000000000000000000001251370304200600171470ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/tn.po000066400000000000000000000001251370304200600171510ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/to.po000066400000000000000000000001251370304200600171520ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/tr.po000066400000000000000000000002021370304200600171510ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" xfce4-sntray-plugin-0.4.13.1/po/ts.po000066400000000000000000000001251370304200600171560ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/tt.po000066400000000000000000000001251370304200600171570ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/tw.po000066400000000000000000000001251370304200600171620ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ty.po000066400000000000000000000001251370304200600171640ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ug.po000066400000000000000000000001251370304200600171430ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/uk.po000066400000000000000000000003141370304200600171470ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" xfce4-sntray-plugin-0.4.13.1/po/ur.po000066400000000000000000000001251370304200600171560ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/uz.po000066400000000000000000000001251370304200600171660ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/ve.po000066400000000000000000000001251370304200600171420ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/vi.po000066400000000000000000000002121370304200600171430ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;\n" xfce4-sntray-plugin-0.4.13.1/po/vo.po000066400000000000000000000001251370304200600171540ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/wa.po000066400000000000000000000001251370304200600171370ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/wo.po000066400000000000000000000001251370304200600171550ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/xfce4-sntray-plugin.pot000066400000000000000000000072431370304200600225470ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-08-17 15:53+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/snconfig.ui:38 ../src/snconfig.vala:63 msgid "StatusNotifier Configuration" msgstr "" #: ../src/snconfig.ui:86 ../src/snconfig.ui:79 msgid "Show Application Status" msgstr "" #: ../src/snconfig.ui:101 ../src/snconfig.ui:93 msgid "Show Communications" msgstr "" #: ../src/snconfig.ui:116 ../src/snconfig.ui:107 msgid "Show System Services" msgstr "" #: ../src/snconfig.ui:131 ../src/snconfig.ui:121 msgid "Show Hardware" msgstr "" #: ../src/snconfig.ui:146 ../src/snconfig.ui:135 msgid "Show Other" msgstr "" #: ../src/snconfig.ui:161 ../src/snconfig.ui:149 msgid "Show Passive" msgstr "" #: ../src/snconfig.ui:180 ../src/snconfig.ui:167 msgid "Categories visibility" msgstr "" #: ../src/snconfig.ui:206 ../src/snconfig.ui:221 ../src/snconfig.ui:207 msgid "Use symbolic icons" msgstr "" #: ../src/snconfig.ui:228 ../src/snconfig.ui:243 msgid "Indicator size:" msgstr "" #: ../src/snconfig.ui:266 ../src/snconfig.ui:281 msgid "Appearance properties" msgstr "" #: ../src/snconfig.ui:285 ../src/snconfig.ui:300 ../src/snconfig.ui:282 msgid "Core" msgstr "" #: ../src/snconfig.ui:309 ../src/snconfig.ui:396 ../src/snconfig.ui:324 #: ../src/snconfig.ui:411 ../src/snconfig.ui:303 ../src/snconfig.ui:381 msgid "Icon" msgstr "" #: ../src/snconfig.ui:320 ../src/snconfig.ui:407 ../src/snconfig.ui:335 #: ../src/snconfig.ui:422 ../src/snconfig.ui:314 ../src/snconfig.ui:392 msgid "Name" msgstr "" #: ../src/snconfig.ui:331 ../src/snconfig.ui:418 ../src/snconfig.ui:346 #: ../src/snconfig.ui:433 ../src/snconfig.ui:325 ../src/snconfig.ui:403 msgid "Override" msgstr "" #: ../src/snconfig.ui:344 ../src/snconfig.ui:359 ../src/snconfig.ui:338 msgid "Index" msgstr "" #: ../src/snconfig.ui:369 ../src/snconfig.ui:384 ../src/snconfig.ui:357 msgid "Order" msgstr "" #: ../src/snconfig.ui:431 ../src/snconfig.ui:446 ../src/snconfig.ui:416 msgid "Visible" msgstr "" #: ../src/snconfig.ui:454 ../src/snconfig.ui:469 ../src/snconfig.ui:433 msgid "Visibility" msgstr "" #: ../data/sntray.desktop.xfce.in:5 msgid "StatusNotifier Plugin" msgstr "" #: ../data/sntray.desktop.xfce.in:6 msgid "Display AppIndicators in FlowBox" msgstr "" #: ../data/sntray.desktop.xfce.in:7 ../data/sntray-mate.desktop.plugin.in:11 #: ../data/sntray-mate.desktop.in:11 msgid "applications-system" msgstr "" #: ../src/snconfig.ui:206 ../src/snconfig.ui:193 msgid "Show labels near icons (if applications provides some)" msgstr "" #: ../data/sntray.desktop.plugin.in:4 ../data/sntray-budgie.desktop.plugin.in:4 msgid "StatusNotifier" msgstr "" #: ../data/sntray.desktop.plugin.in:5 ../data/sntray-budgie.desktop.plugin.in:5 msgid "System tray in KDE StatusNotifierItem format" msgstr "" #: ../src/mate-sntray-applet.vala:67 msgid "_Preferences" msgstr "" #: ../data/sntray-budgie.desktop.plugin.in:9 msgid "view-grid-symbolic" msgstr "" #: ../data/sntray-mate.desktop.plugin.in:5 ../data/sntray-mate.desktop.in:5 msgid "SNTray applet factory" msgstr "" #: ../data/sntray-mate.desktop.plugin.in:9 ../data/sntray-mate.desktop.in:9 msgid "SNI Notification area" msgstr "" #: ../data/sntray-mate.desktop.plugin.in:10 msgid "Area where StatusNotifierItem's appear" msgstr "" xfce4-sntray-plugin-0.4.13.1/po/xh.po000066400000000000000000000001251370304200600171470ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/yi.po000066400000000000000000000001251370304200600171510ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/yo.po000066400000000000000000000001251370304200600171570ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/za.po000066400000000000000000000001251370304200600171420ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/zh.po000066400000000000000000000001251370304200600171510ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/zh_CN.po000066400000000000000000000055461370304200600175450ustar00rootroot00000000000000# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR: CUI Wei , 2018. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: 0.3.74\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-05-04 01:39+0600\n" "PO-Revision-Date: 2018-03-11 01:40+0800\n" "Last-Translator: CUI Wei \n" "Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/snconfig.ui:38 msgid "StatusNotifier Configuration" msgstr "通知指示器首选项" #: ../src/snconfig.ui:86 msgid "Show Application Status" msgstr "显示状态" #: ../src/snconfig.ui:101 msgid "Show Communications" msgstr "显示交互" #: ../src/snconfig.ui:116 msgid "Show System Services" msgstr "显示服务" #: ../src/snconfig.ui:131 msgid "Show Hardware" msgstr "显示硬件" #: ../src/snconfig.ui:146 msgid "Show Other" msgstr "显示其他" #: ../src/snconfig.ui:161 msgid "Show Passive" msgstr "显示静态" #: ../src/snconfig.ui:180 msgid "Categories visibility" msgstr "类别可见性" #: ../src/snconfig.ui:206 ../src/snconfig.ui:221 msgid "Use symbolic icons" msgstr "使用系统图标" #: ../src/snconfig.ui:228 ../src/snconfig.ui:243 msgid "Indicator size:" msgstr "指示器大小:" #: ../src/snconfig.ui:266 ../src/snconfig.ui:281 msgid "Appearance properties" msgstr "外观选项" #: ../src/snconfig.ui:285 ../src/snconfig.ui:300 msgid "Core" msgstr "核心选项" #: ../src/snconfig.ui:309 ../src/snconfig.ui:396 ../src/snconfig.ui:324 #: ../src/snconfig.ui:411 msgid "Icon" msgstr "图标" #: ../src/snconfig.ui:320 ../src/snconfig.ui:407 ../src/snconfig.ui:335 #: ../src/snconfig.ui:422 msgid "Name" msgstr "名称" #: ../src/snconfig.ui:331 ../src/snconfig.ui:418 ../src/snconfig.ui:346 #: ../src/snconfig.ui:433 msgid "Override" msgstr "覆盖" #: ../src/snconfig.ui:344 ../src/snconfig.ui:359 msgid "Index" msgstr "编号" #: ../src/snconfig.ui:369 ../src/snconfig.ui:384 msgid "Order" msgstr "顺序" #: ../src/snconfig.ui:431 ../src/snconfig.ui:446 msgid "Visible" msgstr "可见" #: ../src/snconfig.ui:454 ../src/snconfig.ui:469 msgid "Visibility" msgstr "可见性" #: ../data/sntray.desktop.xfce.in:5 msgid "StatusNotifier Plugin" msgstr "通知指示器插件" #: ../data/sntray.desktop.xfce.in:6 msgid "Display AppIndicators in FlowBox" msgstr "在组件中显示应用指示器" #: ../data/sntray.desktop.xfce.in:7 msgid "applications-system" msgstr "" #: ../src/snconfig.ui:206 msgid "Show labels near icons (if applications provides some)" msgstr "显示图标标签(如果应用程序提供)" #: ../data/sntray.desktop.plugin.in:4 msgid "StatusNotifier" msgstr "通知指示器" #: ../data/sntray.desktop.plugin.in:5 msgid "System tray in KDE StatusNotifierItem format" msgstr "新的系统通知指示器" xfce4-sntray-plugin-0.4.13.1/po/zh_HK.po000066400000000000000000000001251370304200600175330ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/zh_TW.po000066400000000000000000000001251370304200600175630ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/po/zu.po000066400000000000000000000001251370304200600171660ustar00rootroot00000000000000msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" xfce4-sntray-plugin-0.4.13.1/rpm/000077500000000000000000000000001370304200600163525ustar00rootroot00000000000000xfce4-sntray-plugin-0.4.13.1/rpm/xfce4-sntray-plugin.spec.in000066400000000000000000000120021370304200600234510ustar00rootroot00000000000000Name: @CMAKE_PROJECT_NAME@ Version: @CPACK_PACKAGE_VERSION@ Release: @CPACK_PACKAGE_RELEASE@%{?dist} Group: User Interface/Desktops %if %{defined suse_version} License: LGPL-3.0+ %else License: LGPLv3.0+ %endif URL: https://github.com/rilian-la-te/%{name} Source: @CPACK_SOURCE_PACKAGE_FILE_NAME@.tar.gz Summary: This package provides StatusNotifier plugin for xfce4-panel BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: cmake >= 2.8.0 BuildRequires: gettext BuildRequires: vala >= 0.24.0 BuildRequires: pkgconfig(gtk+-3.0) >= 3.22.0 BuildRequires: pkgconfig(libpeas-1.0) >= 1.2.0 BuildRequires: pkgconfig(libxfce4panel-2.0) BuildRequires: pkgconfig(libxfconf-0) BuildRequires: pkgconfig(vala-panel) BuildRequires: pkgconfig(libmatepanelapplet-4.0) >= 1.18.0 BuildRequires: pkgconfig(budgie-1.0) Provides: vala-panel-sntray-plugin %description StatusNotifier is new D-Bus standard for system tray. It is shared both by Ubuntu Unity and KDE. There is several plugins for show StatusNotifiers for different DEs, for XFCE it is indicator-application and xfce4-snw-plugin %prep %setup -q %build cmake . -DGSETTINGS_COMPILE=OFF -DCMAKE_INSTALL_PREFIX=%{_prefix} -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} -DCMAKE_INSTALL_LIBDIR=%{_libdir} -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir} -DCMAKE_INSTALL_DATAROOTDIR=%{_datarootdir} -DCMAKE_INSTALL_DATADIR=%{_datadir} -DCMAKE_INSTALL_LIBEXECDIR=%{_libexecdir} make %{?_smp_mflags} %install make install DESTDIR=%{buildroot} %find_lang %{name} %clean rm -rf %{buildroot} %files %defattr(644,root,root,755) %dir %{_libdir}/xfce4 %dir %{_libdir}/xfce4/panel %dir %{_libdir}/xfce4/panel/plugins %dir %{_datadir}/xfce4 %dir %{_datadir}/xfce4/panel %dir %{_datadir}/xfce4/panel/plugins %{_libdir}/xfce4/panel/plugins/libsntray-xfce.so %{_datadir}/xfce4/panel/plugins/sntray.desktop %package common Group: User Interface/Desktops Summary: GSettings scheme for %{name} BuildArch: noarch Requires: vala-panel-sntray-plugin %description common This is a GSettings scheme for %{name} package. %files common %defattr(644,root,root,755) %{_datadir}/glib-2.0/schemas/org.valapanel.toplevel.sntray.gschema.xml %postun common set -o monitor if [ $1 -eq 0 ] ; then /usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : fi %posttrans common set -o monitor /usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %package lang Group: User Interface/Desktops Summary: Translations for %{name} BuildArch: noarch Requires: vala-panel-sntray-plugin %description lang This is a translation files for %{name} package. %files lang -f %{name}.lang %defattr(644,root,root,755) %package -n vala-panel-sntray Group: User Interface/Desktops Summary: This package provides StatusNotifier plugin for vala-panel Requires: %{name}-common Provides: vala-panel-sntray-plugin %description -n vala-panel-sntray StatusNotifier is new D-Bus standard for system tray. It is shared both by Ubuntu Unity and KDE. There is several plugins for show StatusNotifiers for different DEs, but for vala-panel only this implementation exists yet. %files -n vala-panel-sntray %defattr(644,root,root,755) %doc README.md %dir %{_libdir}/vala-panel %dir %{_libdir}/vala-panel/applets %{_libdir}/vala-panel/applets/libsntray-valapanel.so %{_libdir}/vala-panel/applets/sntray.plugin %package -n mate-panel-sntray Group: User Interface/Desktops Summary: This package provides StatusNotifier plugin for mate-panel Requires: %{name}-common Provides: vala-panel-sntray-plugin %description -n mate-panel-sntray StatusNotifier is new D-Bus standard for system tray. It is shared both by Ubuntu Unity and KDE. There is several plugins for show StatusNotifiers for different DEs, for mate-panel it is builtin, indicator-application, xfce4-snw-plugin and this. However, this is most configurable. %files -n mate-panel-sntray %defattr(644,root,root,755) %doc README.md %dir %{_libexecdir}/mate-panel %dir %{_datarootdir}/mate-panel %dir %{_datarootdir}/mate-panel/applets %{_libexecdir}/mate-panel/sntray-mate %{_datarootdir}/mate-panel/applets/org.vala-panel.SNTray.mate-panel-applet %{_datarootdir}/dbus-1/services/org.mate.panel.applet.SNTrayAppletFactory.service %package -n budgie-panel-sntray Group: User Interface/Desktops Summary: This package provides StatusNotifier plugin for mate-panel Requires: %{name}-common Provides: vala-panel-sntray-plugin %description -n budgie-panel-sntray StatusNotifier is new D-Bus standard for system tray. It is shared both by Ubuntu Unity and KDE. There is several plugins for show StatusNotifiers for different DEs, for mate-panel it is builtin, indicator-application, xfce4-snw-plugin and this. However, this is most configurable. %files -n budgie-panel-sntray %defattr(644,root,root,755) %doc README.md %dir %{_libdir}/budgie-desktop %dir %{_libdir}/budgie-desktop/plugins %{_libdir}/budgie-desktop/plugins/libsntray-budgie.so %{_libdir}/budgie-desktop/plugins/sntray-budgie.plugin %changelog * Mon Apr 27 2015 Konstantin - @CPACK_PACKAGE_VERSION@ Generated by CMake UseRPMTools macros xfce4-sntray-plugin-0.4.13.1/src/000077500000000000000000000000001370304200600163435ustar00rootroot00000000000000xfce4-sntray-plugin-0.4.13.1/src/CMakeLists.txt000066400000000000000000000030151370304200600211020ustar00rootroot00000000000000##### # DBusMenu ##### add_subdirectory(dbusmenu) ##### # Core Parts (GResource, definitions) ##### set(CMAKE_INCLUDE_CURRENT_DIR ON) set(VALA_FILES_CORE sntray-backend.vapi snwatcher.vala snhost.vala snitembox.vala snconfig.vala snchild.vala ${CMAKE_CURRENT_BINARY_DIR}/config.vala ) vala_precompile(VALA_C_CORE sntray-core ${VALA_FILES_CORE} PACKAGES gtk+-3.0 vala-dbusmenu OPTIONS --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi --vapidir=${CMAKE_CURRENT_SOURCE_DIR} --vapidir=${CMAKE_CURRENT_BINARY_DIR} --vapidir=${CMAKE_CURRENT_BINARY_DIR}/dbusmenu --target-glib=2.44 --gresources=${CMAKE_CURRENT_SOURCE_DIR}/sntray.gresource.xml GENERATE_VAPI vala-panel-sntray ) set(ENUM_FILES ${CMAKE_SOURCE_DIR}/include/sn-common.h ) add_glib_enumtypes(ENUMSC ENUMSH sni-enums ${ENUM_FILES}) add_library(sntray-core STATIC ${VALA_C_CORE} ${CMAKE_SOURCE_DIR}/include/sn-common.h ${ENUMSC} ${ENUMSH} dbus-utils.c snproxy.c snproxy.h rtparser.h rtparser.c icon-pixmap.c icon-pixmap.h $) target_include_directories(sntray-core PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/dbusmenu) target_link_libraries (sntray-core GLIB2::GIO_UNIX GTK3::GDK GTK3::GTK m) set_target_properties(sntray-core PROPERTIES POSITION_INDEPENDENT_CODE ON) # Compile this object code position independent. add_custom_target(sntray-core-ide SOURCES ${VALA_FILES_DBUSMENU} ${VALA_FILES_CORE} ${VALA_FILES_NEW}) add_subdirectory(panels) xfce4-sntray-plugin-0.4.13.1/src/config.vala.in000066400000000000000000000020051370304200600210570ustar00rootroot00000000000000namespace Config { public const string DATADIR = "@DATADIR@"; public const string PKGDATADIR = "@PKGDATADIR@"; public const string GETTEXT_PACKAGE = "@GETTEXT_PACKAGE@"; public const string RELEASE_NAME = "@RELEASE_NAME@"; public const string VERSION = "@VERSION@"; public const string VERSION_INFO = "@VERSION_INFO@"; public const string PLUGINS_DIRECTORY = "@PLUGINS_DIRECTORY@"; public const string PLUGINS_DATA = "@PLUGINS_DATA@"; public const string INSTALL_PREFIX = "@CMAKE_INSTALL_PREFIX@"; public const string LOCALE_DIR = "@CMAKE_INSTALL_PREFIX@/share/locale"; /* Translatable launcher (.desktop) strings to be added to */ /* template (.pot) file. These strings should reflect any */ /* changes in these launcher keys in .desktop file. */ /* public const string COMMENT = N_("Edit text files"); public const string GENERIC = N_("Text Editor"); public const string NEW_DOCUMENT = N_("New Document"); public const string NEW_WINDOW = N_("New Window"); */ } xfce4-sntray-plugin-0.4.13.1/src/css/000077500000000000000000000000001370304200600171335ustar00rootroot00000000000000xfce4-sntray-plugin-0.4.13.1/src/css/vala-panel.css000066400000000000000000000005261370304200600216700ustar00rootroot00000000000000.-panel-launch-button { padding: 2px; margin: 0px; border-radius: 2px; } .-panel-launch-button:hover, .-panel-launch-button:hover, .-panel-launch-button.highlight, .-panel-launch-button:active:hover, .-panel-launch-button-selected { -gtk-icon-effect: highlight; } .-panel-launch-button:selected { outline-offset: -2px; } xfce4-sntray-plugin-0.4.13.1/src/dbus-utils.c000066400000000000000000000234201370304200600206030ustar00rootroot00000000000000/* * xfce4-sntray-plugin * Copyright (C) 2015-2019 Konstantin Pugin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ #include G_GNUC_INTERNAL GVariant *take_names_from_dbus() { GVariant *names; g_autoptr(GError) error = NULL; GDBusConnection *connection = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, &error); if (connection == NULL) { g_warning("Unable to connect to dbus: %s", error->message); return NULL; } g_autoptr(GVariant) ret = g_dbus_connection_call_sync(connection, "org.freedesktop.DBus", "/org/freedesktop/DBus", "org.freedesktop.DBus", "ListNames", NULL, G_VARIANT_TYPE("(as)"), G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error); if (ret == NULL) { g_warning("Unable to query dbus: %s", error->message); return NULL; } names = g_variant_get_child_value(ret, 0); return names; } G_GNUC_INTERNAL char *get_unique_bus_name_sync(GDBusConnection *bus, const char *name) { g_autoptr(GError) error = NULL; if (name && name[0] == ':') return g_strdup(name); if (!bus) { bus = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, &error); if (bus == NULL) { g_warning("Unable to connect to dbus: %s", error->message); return NULL; } } g_autoptr(GVariant) var_name = g_variant_new_string(name); g_autoptr(GVariant) ret = g_dbus_connection_call_sync(bus, "org.freedesktop.DBus", "/org/freedesktop/DBus", "org.freedesktop.DBus", "GetNameOwner", var_name, G_VARIANT_TYPE("s"), G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error); if (ret == NULL) { g_warning("Unable to query dbus: %s", error->message); return NULL; } char *unique = g_variant_dup_string(ret, NULL); return unique; } void refresh_property_on_proxy_sync(GDBusProxy *proxy, const char *prop_name) { GVariantBuilder b; g_variant_builder_init(&b, "(ss)"); g_variant_builder_add(&b, "(ss)", g_dbus_proxy_get_interface_name(proxy), prop_name); g_autoptr(GVariant) ins = g_variant_builder_end(&b); g_autoptr(GVariant) var = g_dbus_connection_call_sync(g_dbus_proxy_get_connection(proxy), g_dbus_proxy_get_name(proxy), g_dbus_proxy_get_object_path(proxy), "org.freedesktop.DBus.Properties", "Get", ins, "v", G_DBUS_CALL_FLAGS_NONE, 500, NULL, NULL); g_autoptr(GVariant) val_var = g_variant_get_child_value(var, 0); g_dbus_proxy_set_cached_property(proxy, prop_name, val_var); GVariantDict dict; g_variant_dict_init(&dict, NULL); g_variant_dict_insert_value(&dict, prop_name, val_var); g_autoptr(GVariant) em = g_variant_dict_end(&dict); g_dbus_connection_emit_signal(g_dbus_proxy_get_connection(proxy), NULL, g_dbus_proxy_get_object_path(proxy), g_dbus_proxy_get_interface_name(proxy), "g-properties-changed", em, NULL); } // var refreshPropertyOnProxy = function(proxy, property_name) { // proxy.g_connection.call(proxy.g_name, // proxy.g_object_path, // 'org.freedesktop.DBus.Properties', // 'Get', // GLib.Variant.new('(ss)', [ proxy.g_interface_name, property_name ]), // GLib.VariantType.new('(v)'), // Gio.DBusCallFlags.NONE, // -1, // null, // function(conn, result) { // try { // let value_variant = conn.call_finish(result).deep_unpack()[0] // proxy.set_cached_property(property_name, value_variant) // // synthesize a property changed event // let changed_obj = {} // changed_obj[property_name] = value_variant // proxy.emit('g-properties-changed', GLib.Variant.new('a{sv}', // changed_obj), []) // } catch (e) { // // the property may not even exist, silently ignore it // //Logger.debug("While refreshing property "+property_name+": // "+e) // } // }) //} // var getUniqueBusNameSync = function(bus, name) { // if (name[0] == ':') // return name; // if (typeof bus === "undefined" || !bus) // bus = Gio.DBus.session; // let variant_name = new GLib.Variant("(s)", [name]); // let [unique] = bus.call_sync("org.freedesktop.DBus", "/", "org.freedesktop.DBus", // "GetNameOwner", variant_name, null, // Gio.DBusCallFlags.NONE, -1, null).deep_unpack(); // return unique; //} // var traverseBusNames = function(bus, cancellable, callback) { // if (typeof bus === "undefined" || !bus) // bus = Gio.DBus.session; // if (typeof(callback) !== "function") // throw new Error("No traversal callback provided"); // bus.call("org.freedesktop.DBus", "/", "org.freedesktop.DBus", // "ListNames", null, new GLib.VariantType("(as)"), 0, -1, cancellable, // function (bus, task) { // if (task.had_error()) // return; // let [names] = bus.call_finish(task).deep_unpack(); // let unique_names = []; // for (let name of names) { // let unique = getUniqueBusNameSync(bus, name); // if (unique_names.indexOf(unique) == -1) // unique_names.push(unique); // } // for (let name of unique_names) // callback(bus, name, cancellable); // }); //} // var introspectBusObject = function(bus, name, cancellable, filterFunction, targetCallback, path) // { // if (typeof path === "undefined" || !path) // path = "/"; // if (typeof targetCallback !== "function") // throw new Error("No introspection callback defined"); // bus.call (name, path, "org.freedesktop.DBus.Introspectable", "Introspect", // null, new GLib.VariantType("(s)"), Gio.DBusCallFlags.NONE, -1, // cancellable, function (bus, task) { // if (task.had_error()) // return; // let introspection = bus.call_finish(task).deep_unpack().toString(); // let node_info = Gio.DBusNodeInfo.new_for_xml(introspection); // if ((typeof filterFunction === "function" && filterFunction(node_info) === true) // || // typeof filterFunction === "undefined" || !filterFunction) { // targetCallback(name, path); // } // if (path === "/") // path = "" // for (let sub_nodes of node_info.nodes) { // let sub_path = path+"/"+sub_nodes.path; // introspectBusObject (bus, name, cancellable, filterFunction, // targetCallback, sub_path); // } // }); //} // var dbusNodeImplementsInterfaces = function(node_info, interfaces) { // if (!(node_info instanceof Gio.DBusNodeInfo) || !Array.isArray(interfaces)) // return false; // for (let iface of interfaces) { // if (node_info.lookup_interface(iface) !== null) // return true; // } // return false; //} xfce4-sntray-plugin-0.4.13.1/src/dbusmenu/000077500000000000000000000000001370304200600201655ustar00rootroot00000000000000xfce4-sntray-plugin-0.4.13.1/src/dbusmenu/CMakeLists.txt000066400000000000000000000035741370304200600227360ustar00rootroot00000000000000cmake_minimum_required (VERSION 2.8.8) cmake_policy (VERSION 2.8) cmake_policy (SET CMP0063 NEW) project (vala-dbusmenu C) list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) if(${VALA_VERSION} VERSION_LESS "0.40.4") set(ADDONS_PACKAGE gio-addons-2.0) endif() # Vala find_package (Vala 0.24 REQUIRED) include (ValaPrecompile) add_definitions(-DVALA_VERSION="${VALA_SHORTVER}") add_definitions(-Wall -Wextra -Wno-unused -Wno-unused-parameter# Vala loves to create variables #-pedantic -Wno-ignored-qualifiers -Wno-incompatible-pointer-types -Wno-missing-field-initializers -Wno-sign-compare ) #Vala often forgot cast to GtkWidget or gpointer find_package (PkgConfig) pkg_check_modules(GTK3 REQUIRED QUIET gtk+-3.0>=3.10) set(VALA_FILES_DBUSMENU_CORE item.vala proxy.vala client.vala property-store.vala ) set(VALA_FILES_DBUSMENU_GTK gtk/client.vala gtk/main-item.vala gtk/separator-item.vala gtk/item-iface.vala gtk/scale-item.vala ) vala_precompile(VALA_C_DBUSMENU vala-dbusmenu ${VALA_FILES_DBUSMENU_CORE} ${VALA_FILES_DBUSMENU_GTK} PACKAGES gtk+-3.0 gio-2.0 glib-2.0 gobject-2.0 ${ADDONS_PACKAGE} OPTIONS --vapidir=${CMAKE_SOURCE_DIR}/vapi --target-glib=2.44 GENERATE_VAPI vala-dbusmenu GENERATE_HEADER vala-dbusmenu ) add_library(vala-dbusmenu-o OBJECT ${VALA_C_DBUSMENU}) set_target_properties(vala-dbusmenu-o PROPERTIES # C_VISIBILITY_PRESET hidden # Make global variables and functions HIDDEN by default. POSITION_INDEPENDENT_CODE ON # Compile this object code position independent. ) target_include_directories (vala-dbusmenu-o PRIVATE ${GTK3_INCLUDE_DIRS}) add_custom_target(vala-dbusmenu-ide SOURCES ${VALA_FILES_DBUSMENU_CORE} ${VALA_FILES_DBUSMENU_GTK}) xfce4-sntray-plugin-0.4.13.1/src/dbusmenu/client.vala000066400000000000000000000224201370304200600223100ustar00rootroot00000000000000using GLib; using ValaDBusMenu; namespace ValaDBusMenu { public class Client { private HashTable items; private bool layout_update_required; private bool layout_update_in_progress; private int[] requested_props_ids; private uint layout_revision; public Iface iface {get; private set;} public Client(string object_name, string object_path) { items = new HashTable(direct_hash, direct_equal); layout_revision = 0; try{ this.iface = Bus.get_proxy_sync(BusType.SESSION, object_name, object_path); } catch (Error e) {stderr.printf("Cannot get menu! Error: %s",e.message);} var props = new VariantDict(); props.insert("children-display","s","submenu"); var item = new Item(0,this,props.end(),new List()); items.insert(0,item); request_layout_update(); iface.set_default_timeout(200); iface.layout_updated.connect((rev,parent)=>{Idle.add(request_layout_update);}); iface.items_properties_updated.connect(props_updated_cb); iface.item_activation_requested.connect(request_activation_cb); iface.x_valapanel_item_value_changed.connect(request_value_cb); requested_props_ids = {}; } public unowned Item? get_root_item() { return items.lookup(0); } public unowned Item? get_item(int id) { return items.lookup(id); } private void request_activation_cb(int id, uint timestamp) { get_item(id).handle_event("clicked",new Variant.int32(0),timestamp); } private void request_value_cb(int id, uint timestamp) { get_item(id).handle_event("value-changed",new Variant.double(get_item(id).get_variant_property("x-valapanel-current-value").get_double()),timestamp); } private bool request_layout_update() { if(layout_update_in_progress) layout_update_required = true; else layout_update.begin(); return false; } /* the original implementation will only request partial layouts if somehow possible / we try to save us from multiple kinds of race conditions by always requesting a full layout */ private async void layout_update() { /* Sanity check: Version can be 0 only if dbusmenu iface is not loaded yet*/ if (iface.version < 1) { yield layout_update(); return; } layout_update_required = false; layout_update_in_progress = true; string[2] props = {"type", "children-display"}; uint rev; Variant layout; try{ iface.get_layout(0,-1,props,out rev, out layout); } catch (Error e) { debug("Cannot update layout. Error: %s\n Yielding another update...\n",e.message); return; } parse_layout(rev,layout); clean_items(); if (layout_update_required) yield layout_update(); else layout_update_in_progress = false; } private void parse_layout(uint rev, Variant layout) { /* Removed revision handling because of bug */ //~ if (rev < layout_revision) return; /* layout signature must be "(ia{sv}av)" */ int id = layout.get_child_value(0).get_int32(); Variant props = layout.get_child_value(1); Variant children = layout.get_child_value(2); VariantIter chiter = children.iterator(); List children_ids = new List(); for(var child = chiter.next_value(); child != null; child = chiter.next_value()) { child = child.get_variant(); parse_layout(rev,child); int child_id = child.get_child_value(0).get_int32(); children_ids.append(child_id); } if (id in items) { unowned Item item = items.lookup(id); VariantIter props_iter = props.iterator(); string name; Variant val; while(props_iter.next("{sv}",out name, out val)) item.set_variant_property(name, val); /* make sure our children are all at the right place, and exist */ var old_children_ids = item.get_children_ids(); int i = 0; foreach(var new_id in children_ids) { var old_child = -1; foreach(var old_id in old_children_ids) if (new_id == old_id) { old_child = old_id; old_children_ids.remove(old_id); break; } if (old_child < 0) item.add_child(new_id,i); else item.move_child(old_child,i); i++; } foreach (var old_id in old_children_ids) item.remove_child(old_id); } else { items.insert(id, new Item(id,this,props,children_ids)); request_properties.begin(id); } layout_revision = rev; } private void clean_items() { /* Traverses the list of cached menu items and removes everyone that is not in the list / so we don't keep alive unused items */ var tag = new DateTime.now_utc(); List traverse = new List(); traverse.append(0); while (traverse.length() > 0) { var item = this.get_item(traverse.data); traverse.delete_link(traverse); item.gc_tag = tag; traverse.concat(item.get_children_ids()); } SList remover = new SList(); items.foreach((k,v)=>{if (v.gc_tag != tag) remover.append(k);}); foreach(var i in remover) items.remove(i); } /* we don't need to cache and burst-send that since it will not happen that frequently */ public void request_about_to_show(int id) { var need_update = false; try { iface.about_to_show(id,out need_update); } catch (Error e) { stderr.printf("Error requesting about to show:%s\n",e.message); return; } if (need_update) Idle.add(request_layout_update); } public void handle_item_event(int item_id, string event_id, Variant? data, uint timestamp) { try { if (iface is Iface) iface.event(item_id,event_id,data ?? new Variant.int32(0),timestamp); } catch (Error e) { stderr.printf("Error handling event:%s\n",e.message); } } private async void request_properties(int id) { Variant props; string[] names = {}; if (!(id in requested_props_ids)) requested_props_ids += id; try{ iface.get_group_properties(requested_props_ids,names,out props); } catch (GLib.Error e) { stderr.printf("Error requesting properties:%s\n",e.message); return; } requested_props_ids = {}; parse_props(props); } private void props_updated_cb (Variant updated_props, Variant removed_props) { parse_props(updated_props); parse_props(removed_props); } private void parse_props(Variant props) { /*updated properties signature is a(ia{sv}), removed is a(ias)*/ var iter = props.iterator(); for (var props_req = iter.next_value(); props_req!=null; props_req = iter.next_value()) { int req_id = props_req.get_child_value(0).get_int32(); Variant props_id = props_req.get_child_value(1); var ch_iter = props_id.iterator(); Variant? val; for (val = ch_iter.next_value(); val != null; val = ch_iter.next_value()) { if (val.get_type_string() == "{sv}") { unowned string key = val.get_child_value(0).get_string(); var prop = val.get_child_value(1).get_variant(); if (items.lookup(req_id) != null) items.lookup(req_id).set_variant_property(key,prop); } else if (val.get_type_string() == "s") { unowned string key = val.get_string(); if (items.lookup(req_id) != null) items.lookup(req_id).set_variant_property(key,null); } } } } ~Client() { items.remove_all(); } } } xfce4-sntray-plugin-0.4.13.1/src/dbusmenu/gtk/000077500000000000000000000000001370304200600207525ustar00rootroot00000000000000xfce4-sntray-plugin-0.4.13.1/src/dbusmenu/gtk/client.vala000066400000000000000000000073431370304200600231040ustar00rootroot00000000000000using GLib; using Gtk; using ValaDBusMenu; namespace ValaDBusMenu { public class GtkClient : Client { private unowned Gtk.MenuShell root_menu; public static Gtk.MenuItem new_item(Item item, bool show_im_pl = true) { if (item.get_string_property("type") == "separator") return new GtkSeparatorItem(item); else if (item.get_string_property("type") == "scale") return new GtkScaleItem(item); return new GtkMainItem(item,show_im_pl); } public GtkClient(string object_name, string object_path) { base(object_name,object_path); this.root_menu = null; } public void attach_to_menu(Gtk.MenuShell menu) { if (iface.icon_theme_path != null && iface.icon_theme_path.length > 0) foreach (unowned string path in iface.icon_theme_path) IconTheme.get_default().prepend_search_path(path != null ? path : ""); root_menu = menu; root_menu.foreach((c)=>{menu.remove(c); c.destroy();}); root_menu.realize.connect(open_cb); root_menu.unrealize.connect(close_cb); get_root_item().child_added.connect(on_child_added_cb); get_root_item().child_moved.connect(on_child_moved_cb); get_root_item().child_removed.connect(on_child_removed_cb); foreach(unowned Item ch in get_root_item().get_children()) on_child_added_cb(ch.id,ch); root_menu.show(); } public void detach() { SignalHandler.disconnect_matched (get_root_item(), SignalMatchType.DATA, 0, 0, null, null, &this); if (root_menu != null) root_menu.foreach((c)=>{root_menu.remove(c); c.destroy();}); } private void open_cb() { get_root_item().handle_event("opened",null,0); get_root_item().request_about_to_show(); root_menu.queue_resize(); foreach(unowned Item i in get_root_item().get_children()) { i.request_about_to_show(); i.handle_event("opened",null,0); } foreach(unowned Item i in get_root_item().get_children()) { i.handle_event("closed",null,0); } } private void close_cb() { get_root_item().handle_event("closed",null,0); } private void on_child_added_cb(int id, Item item) { Gtk.MenuItem menuitem; bool show_image = !(this.root_menu is Gtk.MenuBar); menuitem = new_item(item,show_image); root_menu.insert(menuitem,get_root_item().get_child_position(item.id)); } private void on_child_moved_cb(int oldpos, int newpos, Item item) { foreach(Widget ch in root_menu.get_children()) if ((ch as GtkItemIface).item == item) { root_menu.remove(ch); root_menu.insert(ch,newpos); } } private void on_child_removed_cb(int id, Item item) { foreach(unowned Widget ch in root_menu.get_children()) if ((ch as GtkItemIface).item == item) ch.destroy(); } public static bool check (string bus_name, string object_path) { Iface? iface = null; try { iface = Bus.get_proxy_sync(BusType.SESSION,bus_name,object_path); if (iface.version < 2) return false; else return true; } catch (Error e){} return false; } } } xfce4-sntray-plugin-0.4.13.1/src/dbusmenu/gtk/item-iface.vala000066400000000000000000000021141370304200600236200ustar00rootroot00000000000000using GLib; using Gtk; namespace ValaDBusMenu { public interface GtkItemIface : Object { public abstract unowned Item item {get; protected set construct;} public static void parse_shortcut_variant(Variant shortcut, out uint key, out Gdk.ModifierType modifier) { key = 0; modifier = 0; VariantIter iter = shortcut.iterator(); string str; while(iter.next("s", out str)) { if (str == "Control") { modifier |= Gdk.ModifierType.CONTROL_MASK; } else if (str == "Alt") { modifier |= Gdk.ModifierType.MOD1_MASK; } else if (str == "Shift") { modifier |= Gdk.ModifierType.SHIFT_MASK; } else if (str == "Super") { modifier |= Gdk.ModifierType.SUPER_MASK; } else { Gdk.ModifierType tempmod; accelerator_parse(str, out key, out tempmod); } } return; } } } xfce4-sntray-plugin-0.4.13.1/src/dbusmenu/gtk/main-item.vala000066400000000000000000000217531370304200600235070ustar00rootroot00000000000000using GLib; using Gtk; using ValaDBusMenu; namespace ValaDBusMenu { public class GtkMainItem : CheckMenuItem, GtkItemIface { private const string[] allowed_properties = {"visible","enabled","label","type", "children-display","toggle-type", "toggle-state","icon-name","icon-data","accessible-desc", "x-valapanel-icon-size"}; public unowned Item item {get; protected set construct;} public bool always_show_image_placeholder { get; construct; default = true; } private bool has_indicator = false; private unowned Image image; private unowned AccelLabel accel_label; private ulong activate_handler; private bool is_themed_icon = false; construct { this.item = item; var box = new Box(Orientation.HORIZONTAL, 5); var img = new Image(); image = img; var label = new AccelLabel(""); accel_label = label; box.pack_start(image,false,false,2); box.add(accel_label); accel_label.show(); image.show(); box.show(); this.add(box); this.show_all(); this.init(); item.property_changed.connect(on_prop_changed_cb); item.child_added.connect(on_child_added_cb); item.child_removed.connect(on_child_removed_cb); item.child_moved.connect(on_child_moved_cb); item.removing.connect(()=>{this.destroy();}); activate_handler = this.activate.connect(on_toggled_cb); this.select.connect(on_select_cb); this.deselect.connect(on_deselect_cb); this.notify["visible"].connect(()=>{this.visible = item.get_bool_property("visible");}); } public GtkMainItem(Item item, bool show_im_pl = true) { Object(item:item, always_show_image_placeholder: show_im_pl); } private void init() { foreach (var prop in allowed_properties) on_prop_changed_cb(prop,item.get_variant_property(prop)); } private void on_prop_changed_cb(string name, Variant? val) { if(activate_handler > 0) SignalHandler.block(this,activate_handler); switch (name) { case "visible": this.visible = val.get_boolean(); break; case "enabled": this.sensitive = val.get_boolean(); break; case "label": accel_label.set_text_with_mnemonic(val.get_string()); break; case "children-display": if (this.submenu != null) { this.submenu.destroy(); this.submenu = null; } if (val != null && val.get_string() == "submenu") { this.submenu = new Gtk.Menu(); this.submenu.insert.connect(on_child_insert_cb); foreach(unowned Item item in this.item.get_children()) submenu.add(GtkClient.new_item(item)); } break; case "toggle-type": if (val == null) this.set_toggle_type("normal"); else this.set_toggle_type(val.get_string()); break; case "toggle-state": if (val != null && val.get_int32()>0) this.active = true; else this.active = false; break; case "accessible-desc": this.set_tooltip_text(val != null ? val.get_string() : null); break; case "icon-name": case "icon-data": update_icon(val); break; case "shortcut": update_shortcut(val); break; } if(activate_handler > 0) SignalHandler.unblock(this,activate_handler); } private void set_toggle_type(string type) { if (type=="radio") { this.set_accessible_role(Atk.Role.RADIO_MENU_ITEM); this.has_indicator = true; this.draw_as_radio = true; } else if (type=="checkmark") { this.set_accessible_role(Atk.Role.CHECK_MENU_ITEM); this.has_indicator = true; this.draw_as_radio = false; } else { this.set_accessible_role(Atk.Role.MENU_ITEM); this.has_indicator = false; } } protected override void toggle_size_request(void* req) { if(has_indicator) base.toggle_size_request(req); else { int* req_int = req; *req_int = 0; } } protected override void toggle_size_allocate(int alloc) { base.toggle_size_allocate(has_indicator ? alloc : 0); } private void update_icon(Variant? val) { if (val == null) { var icon = image.gicon; if (has_indicator || (icon == null && !always_show_image_placeholder)) image.hide(); else if (!(icon != null && icon is ThemedIcon && is_themed_icon)) is_themed_icon = false; return; } Icon? icon = null; if (val.get_type_string() == "s") { is_themed_icon = true; icon = new ThemedIcon.with_default_fallbacks(val.get_string()+"-symbolic"); } else if (!is_themed_icon && val.get_type_string() == "ay") icon = new BytesIcon(val.get_data_as_bytes()); else return; image.set_from_gicon(icon,IconSize.MENU); image.set_pixel_size(16); } private void update_shortcut(Variant? val) { if (val == null) return; uint key; Gdk.ModifierType mod; parse_shortcut_variant(val, out key, out mod); this.accel_label.set_accel(key,mod); } private void on_child_added_cb(int id,Item item) { if (this.submenu != null) this.submenu.append (GtkClient.new_item(item)); else { debug("Adding new item to item without submenu! Creating new submenu...\n"); this.submenu = new Gtk.Menu(); this.submenu.append (GtkClient.new_item(item)); } } private void on_child_removed_cb(int id, Item item) { if (this.submenu != null) foreach(unowned Widget ch in this.submenu.get_children()) if ((ch as GtkItemIface).item == item) ch.destroy(); else debug("Cannot remove a child from item without submenu!\n"); } private void on_child_moved_cb(int oldpos, int newpos, Item item) { if (this.submenu != null) foreach(unowned Widget ch in this.submenu.get_children()) if ((ch as GtkItemIface).item == item) this.submenu.reorder_child(ch,newpos); else debug("Cannot move a child of item with has no children!\n"); } private void on_toggled_cb() { item.handle_event("clicked",new Variant.int32(0),get_current_event_time()); } private void on_select_cb() { if (this.submenu != null) { item.handle_event("opened",null,0); item.request_about_to_show(); } } private void on_deselect_cb() { if (this.submenu != null) item.handle_event("closed",null,0); } private void on_child_insert_cb(Widget w, int pos) { unowned GtkItemIface ch = w as GtkItemIface; this.submenu.reorder_child(w,item.get_child_position(ch.item.id)); this.submenu.queue_resize(); } protected override void draw_indicator(Cairo.Context cr) { if (has_indicator) base.draw_indicator(cr); } protected override void destroy() { if (this.submenu != null) { this.submenu.destroy(); this.submenu = null; } base.destroy(); } } } xfce4-sntray-plugin-0.4.13.1/src/dbusmenu/gtk/scale-item.vala000066400000000000000000000130141370304200600236410ustar00rootroot00000000000000using GLib; using Gtk; using ValaDBusMenu; namespace ValaDBusMenu { public class GtkScaleItem: Gtk.MenuItem, GtkItemIface { private const string[] allowed_properties = {"visible","enabled","icon-name", "x-valapanel-min-value","x-valapanel-current-value","x-valapanel-max-value", "x-valapanel-step-increment","x-valapanel-page-increment","x-valapanel-draw-value", "x-valapanel-format-value"}; public unowned Item item {get; protected set construct;} private unowned Image primary; private unowned Scale scale; private string item_format; private bool grabbed; public GtkScaleItem(Item item) { this.item = item; var box = new Box(Orientation.HORIZONTAL,5); var img = new Image(); primary = img; var adj = new Adjustment(0,0,double.MAX,0,0,0); var new_scale = new Scale(Orientation.HORIZONTAL,adj); scale = new_scale; scale.hexpand = true; primary.show(); scale.show(); box.add(primary); box.add(scale); this.add(box); box.show(); this.show(); this.init(); item.property_changed.connect(on_prop_changed_cb); item.removing.connect(()=>{this.destroy();}); adj.value_changed.connect(on_value_changed_cb); scale.format_value.connect(on_value_format_cb); scale.value_pos = PositionType.RIGHT; this.add_events (Gdk.EventMask.SCROLL_MASK |Gdk.EventMask.POINTER_MOTION_MASK |Gdk.EventMask.BUTTON_MOTION_MASK |Gdk.EventMask.KEY_PRESS_MASK); this.set_size_request(200,-1); } private void on_prop_changed_cb(string name, Variant? val) { unowned Adjustment adj = scale.adjustment; switch (name) { case "visible": this.visible = val.get_boolean(); break; case "enabled": this.sensitive = val.get_boolean(); break; case "icon-name": primary.set_from_gicon (icon_from_name(val),IconSize.MENU); break; case "x-valapanel-min-value": adj.lower = val.get_double(); break; case "x-valapanel-current-value": adj.value = val.get_double(); break; case "x-valapanel-max-value": adj.upper = val.get_double(); break; case "x-valapanel-step-increment": adj.step_increment = val.get_double(); break; case "x-valapanel-page-increment": adj.page_increment = val.get_double(); break; case "x-valapanel-draw-value": scale.draw_value = val.get_boolean(); break; case "x-valapanel-format-value": this.item_format = val.get_string(); break; } } private Icon icon_from_name(Variant? namev) { if (namev != null) { return new ThemedIcon.with_default_fallbacks(namev.get_string() + "-symbolic"); } return new ThemedIcon.with_default_fallbacks("image-missing-symbolic"); } private void on_value_changed_cb() { var adj = scale.adjustment; item.handle_event("value-changed",new Variant.double(adj.value),get_current_event_time()); } private string on_value_format_cb(double val) { return item_format.printf(val); } private void init() { foreach (unowned string prop in allowed_properties) on_prop_changed_cb(prop,item.get_variant_property(prop)); } protected override bool button_press_event(Gdk.EventButton event) { scale.event(event); if (!grabbed) grabbed = true; return true; } protected override bool button_release_event(Gdk.EventButton event) { scale.event (event); if (grabbed) { grabbed = false; this.grab_broken_event ((Gdk.EventGrabBroken)event); } return true; } protected override bool motion_notify_event(Gdk.EventMotion event) { scale.event (event); return true; } protected override bool scroll_event(Gdk.EventScroll event) { scale.event (event); return true; } protected override bool key_press_event(Gdk.EventKey event) { if(event.keyval == Gdk.Key.KP_Prior || event.keyval == Gdk.Key.KP_Next || event.keyval == Gdk.Key.Prior || event.keyval == Gdk.Key.Next || event.keyval == Gdk.Key.KP_Left || event.keyval == Gdk.Key.KP_Right || event.keyval == Gdk.Key.Left || event.keyval == Gdk.Key.Right) { scale.event (event); return true; } return false; } } } xfce4-sntray-plugin-0.4.13.1/src/dbusmenu/gtk/separator-item.vala000066400000000000000000000021121370304200600245470ustar00rootroot00000000000000using GLib; using Gtk; using ValaDBusMenu; namespace ValaDBusMenu { public class GtkSeparatorItem: SeparatorMenuItem, GtkItemIface { private const string[] allowed_properties = {"visible","enabled"}; public unowned Item item {get; protected set construct;} public GtkSeparatorItem(Item item) { this.item = item; this.show(); this.init(); item.property_changed.connect(on_prop_changed_cb); item.removing.connect(()=>{this.destroy();}); } private void on_prop_changed_cb(string name, Variant? val) { switch (name) { case "visible": this.visible = val.get_boolean(); break; case "enabled": this.sensitive = val.get_boolean(); break; } } private void init() { foreach (var prop in allowed_properties) on_prop_changed_cb(prop,item.get_variant_property(prop)); } } } xfce4-sntray-plugin-0.4.13.1/src/dbusmenu/item.vala000066400000000000000000000125731370304200600220000ustar00rootroot00000000000000using GLib; namespace ValaDBusMenu { public class Item : Object { private static HashTable checker; static construct { checker = new HashTable(str_hash,str_equal); checker.insert("visible", VariantType.BOOLEAN); checker.insert("enabled", VariantType.BOOLEAN); checker.insert("label", VariantType.STRING); checker.insert("type", VariantType.STRING); checker.insert("children-display", VariantType.STRING); checker.insert("toggle-type", VariantType.STRING); checker.insert("icon-name", VariantType.STRING); checker.insert("accessible-desc", VariantType.STRING); checker.insert("shortcut", new VariantType("aas")); checker.insert("toggle-state", VariantType.INT32); checker.insert("icon-data", new VariantType("ay")); checker.insert("disposition", VariantType.STRING); checker.insert("x-valapanel-secondary-icon-name", VariantType.STRING); checker.insert("x-valapanel-icon-size", VariantType.INT32); checker.insert("x-valapanel-min-value", VariantType.DOUBLE); checker.insert("x-valapanel-current-value", VariantType.DOUBLE); checker.insert("x-valapanel-max-value", VariantType.DOUBLE); checker.insert("x-valapanel-step-increment", VariantType.DOUBLE); checker.insert("x-valapanel-page-increment", VariantType.DOUBLE); checker.insert("x-valapanel-draw-value", VariantType.BOOLEAN); checker.insert("x-valapanel-format-value", VariantType.STRING); /* * JAyatana properties */ checker.insert("jayatana-menuid", VariantType.INT32); checker.insert("jayatana-windowxid", VariantType.VARIANT); checker.insert("jayatana-parent-menuid", VariantType.INT32); checker.insert("jayatana-need-open", VariantType.BOOLEAN); checker.insert("jayatana-hashcode", VariantType.INT32); } private unowned Client client; private PropertyStore store; private List children_ids; public int id {get; private set;} internal DateTime gc_tag; public signal void property_changed(string name, Variant? val); public signal void child_added(int id, Item item); public signal void child_removed(int id, Item item); public signal void child_moved(int oldpos, int newpos, Item item); public signal void removing(); public Item (int id, Client iface, Variant props, List children_ids) { this.children_ids = children_ids.copy(); this.client = iface; this.store = new PropertyStore(props, checker); this.id = id; } ~Item() { removing(); } public Variant get_variant_property(string name) { return store.get_prop(name); } public string get_string_property(string name) { return store.get_prop(name).get_string(); } public bool get_bool_property(string name) { return (store.get_prop(name)!=null) ? store.get_prop(name).get_boolean() : false; } public int get_int_property(string name) { return (store.get_prop(name)!=null) ? store.get_prop(name).get_int32() : 0; } public List get_children_ids() { return children_ids.copy(); } public void set_variant_property(string name, Variant? val) { var old_value = this.store.get_prop(name); this.store.set_prop(name, val); var new_value = this.store.get_prop(name); if ((old_value ?? new_value) == null) return; if (new_value != null && old_value == null || old_value == null && new_value != null || !old_value.equal(new_value)) this.property_changed(name,new_value); } public void add_child(int id, int pos) { children_ids.insert(id,pos); child_added(id,client.get_item(id)); } public void remove_child(int id) { children_ids.remove(id); child_removed(id,client.get_item(id)); } public void move_child(int id, int newpos) { var oldpos = children_ids.index(id); if (oldpos == newpos) return; children_ids.remove(id); children_ids.insert(id,newpos); child_moved(oldpos,newpos,client.get_item(id)); } public List get_children() { List ret = new List(); foreach (var id in children_ids) ret.append(client.get_item(id)); return ret; } public int get_child_position(int child_id) { return children_ids.index(child_id); } public void handle_event(string event_id, Variant? data, uint timestamp) { if (client is ValaDBusMenu.Client) client.handle_item_event(this.id,event_id,data,timestamp); } public void request_about_to_show() { if (client is ValaDBusMenu.Client) client.request_about_to_show(this.id); } } } xfce4-sntray-plugin-0.4.13.1/src/dbusmenu/property-store.vala000066400000000000000000000030501370304200600240460ustar00rootroot00000000000000using GLib; using ValaDBusMenu; namespace ValaDBusMenu { [Compact] private class PropertyStore { internal const string[] persist_names = {"visible","enabled","type","label","disposition"}; internal VariantDict dict; internal unowned HashTable checker; public Variant? get_prop(string name) { unowned VariantType type = checker.lookup(name); Variant? prop = dict.lookup_value(name,type); return (type != null && prop != null && prop.is_of_type(type)) ? prop : return_default(name); } public void set_prop(string name, Variant? val) { unowned VariantType type = checker.lookup(name); if (val == null) dict.remove(name); else if (val != null && type != null && val.is_of_type(type)) dict.insert_value(name,val); } public PropertyStore (Variant? props,HashTable checker) { dict = new VariantDict(props); this.checker = checker; } private Variant? return_default(string name) { if (name == "visible" || name == "enabled") return new Variant.boolean(true); if (name == "type") return new Variant.string("standard"); if (name == "label") return new Variant.string(""); if (name == "disposition") return new Variant.string("normal"); return null; } } } xfce4-sntray-plugin-0.4.13.1/src/dbusmenu/proxy.vala000066400000000000000000000046311370304200600222170ustar00rootroot00000000000000using GLib; namespace ValaDBusMenu { [DBus (use_string_marshalling = true)] public enum Status { [DBus (value = "normal")] NORMAL, [DBus (value = "notice")] NOTICE } [DBus (name = "com.canonical.dbusmenu")] public interface Iface : DBusProxy { public abstract uint version {get;} public abstract string text_direction {owned get;} [DBus (use_string_marshalling = true)] public abstract Status status {get;} public abstract string[] icon_theme_path {owned get;} /* layout signature is "(ia{sv}av)" */ public abstract void get_layout(int parent_id, int recursion_depth, string[] property_names, out uint revision, [DBus (signature = "(ia{sv}av)")] out Variant layout) throws DBusError,IOError; /* properties signature is "a(ia{sv})" */ public abstract void get_group_properties( int[] ids, string[] property_names, [DBus (signature = "a(ia{sv})")] out Variant properties) throws DBusError,IOError; public abstract void get_property(int id, string name, out Variant value) throws DBusError,IOError; public abstract void event(int id, string event_id, Variant? data, uint timestamp) throws DBusError,IOError; /* events signature is a(isvu) */ public abstract void event_group( [DBus (signature = "a(isvu)")] Variant events, out int[] id_errors) throws DBusError,IOError; public abstract void about_to_show(int id, out bool need_update) throws DBusError,IOError; public abstract void about_to_show_group(int[] ids, out int[] updates_needed, out int[] id_errors) throws DBusError,IOError; /*updated properties signature is a(ia{sv}), removed is a(ias)*/ public abstract signal void items_properties_updated( [DBus (signature = "a(ia{sv})")] Variant updated_props, [DBus (signature="a(ias)")] Variant removed_props); public abstract signal void layout_updated(uint revision, int parent); public abstract signal void item_activation_requested(int id, uint timestamp); public abstract signal void x_valapanel_item_value_changed(int id, uint timestamp); } } xfce4-sntray-plugin-0.4.13.1/src/icon-pixmap.c000066400000000000000000000213531370304200600207370ustar00rootroot00000000000000/* * xfce4-sntray-plugin * Copyright (C) 2015-2019 Konstantin Pugin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ #include "icon-pixmap.h" #include "rtparser.h" #include "sn-common.h" #include #include G_GNUC_INTERNAL IconPixmap *icon_pixmap_new_with_size(GVariant *pixmaps, int icon_size) // Format: // a@(ii@ay) { IconPixmap *self = g_new0(IconPixmap, 1); if (!pixmaps) return self; GVariantIter pixmap_iter; g_variant_iter_init(&pixmap_iter, pixmaps); size_t i = 0, max = g_variant_n_children(pixmaps); g_autoptr(GVariant) pixmap_variant = NULL; while ((pixmap_variant = g_variant_iter_next_value(&pixmap_iter))) { int width; int height; g_variant_get(pixmap_variant, "(ii@ay)", &width, &height, NULL); if ((height >= icon_size && width >= icon_size) || i >= max - 1) { self->height = height; self->width = width; g_autoptr(GVariant) bytes_var = g_variant_get_child_value(pixmap_variant, 2); self->bytes = (u_int8_t *)g_variant_get_fixed_array(bytes_var, &self->bytes_size, sizeof(u_int8_t)); self->bytes = g_memdup(self->bytes, self->bytes_size); self->is_gicon = false; break; } g_clear_pointer(&pixmap_variant, g_variant_unref); i++; } return self; } G_GNUC_INTERNAL void icon_pixmap_free(IconPixmap *self) { if (!self->is_gicon) g_clear_pointer(&self->bytes, g_free); g_clear_pointer(&self, g_free); } G_GNUC_INTERNAL GIcon *icon_pixmap_to_gicon(IconPixmap *self) { if (!self->bytes) return NULL; { u_int32_t *data = (u_int32_t *)self->bytes; for (size_t i = 0; i < self->bytes_size / 4; i++) { data[i] = GUINT32_FROM_BE(data[i]); u_int8_t a = (data[i] >> 24) & 0xFF; u_int8_t b = (data[i] >> 16) & 0xFF; u_int8_t g = (data[i] >> 8) & 0xFF; u_int8_t r = data[i] & 0xFF; data[i] = a << 24 | r << 16 | g << 8 | b; } } GIcon *icon = G_ICON(gdk_pixbuf_new_from_data(self->bytes, GDK_COLORSPACE_RGB, true, 8, self->width, self->height, cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, self->width), g_free, NULL)); self->is_gicon = true; self->bytes = NULL; return icon; } static GIcon *icon_pixmap_find_file_icon(const char *icon_name, const char *path) { if (string_empty(path)) return NULL; g_autoptr(GError) err = NULL; g_autoptr(GDir) dir = g_dir_open(path, 0, &err); if (err) return NULL; for (const char *ch = g_dir_read_name(dir); ch != NULL; ch = g_dir_read_name(dir)) { g_autofree char *new_path = g_build_filename(path, ch, NULL); g_autoptr(GFile) f = g_file_new_for_path(new_path); char *sstr = g_strrstr(ch, "."); long diff = -1; if (sstr != NULL) diff = sstr - ch; long index = labs(diff); g_autofree char *icon = index >= 0 ? g_strndup(ch, (ulong)index) : g_strdup(ch); if (!g_strcmp0(icon_name, icon)) return g_file_icon_new(f); GIcon *ret = NULL; GFileType t = g_file_query_file_type(f, G_FILE_QUERY_INFO_NONE, NULL); if (t == G_FILE_TYPE_DIRECTORY) ret = icon_pixmap_find_file_icon(icon_name, new_path); if (ret) return ret; } return NULL; } GIcon *icon_pixmap_select_icon(const char *icon_name, IconPixmap *pixmap, GtkIconTheme *theme, const char *icon_theme_path, const int icon_size, const bool use_symbolic) { if (!string_empty(icon_name)) { g_autofree char *new_name = (use_symbolic && !g_strrstr(icon_name, "-symbolic")) ? g_strdup_printf("%s-symbolic", icon_name) : g_strdup(icon_name); if (icon_name[0] == '/') { g_autoptr(GFile) f = g_file_new_for_path(icon_name); return g_file_icon_new(f); } else if (string_empty(icon_theme_path) || gtk_icon_theme_has_icon(theme, new_name)) return g_themed_icon_new_with_default_fallbacks(new_name); else return icon_pixmap_find_file_icon(icon_name, icon_theme_path); } else if (pixmap != NULL) { GdkPixbuf *pixbuf = GDK_PIXBUF(icon_pixmap_to_gicon(pixmap)); if (pixbuf && (gdk_pixbuf_get_width(pixbuf) > icon_size || gdk_pixbuf_get_height(pixbuf) > icon_size)) { GdkPixbuf *tmp = gdk_pixbuf_scale_simple(pixbuf, icon_size, icon_size, GDK_INTERP_BILINEAR); g_clear_object(&pixbuf); pixbuf = tmp; } return G_ICON(pixbuf); } return NULL; } G_DEFINE_AUTOPTR_CLEANUP_FUNC(IconPixmap, icon_pixmap_free) G_GNUC_INTERNAL ToolTip *tooltip_new(GVariant *variant) { ToolTip *self = g_new0(ToolTip, 1); if (!variant) return self; const char *type_string = g_variant_get_type_string(variant); bool is_full = !g_strcmp0(type_string, "(sa(iiay)ss)"); if (is_full) { g_variant_get_child(variant, 0, "s", &self->icon_name, NULL); g_autoptr(GVariant) ch = g_variant_get_child_value(variant, 1); self->pixmap = icon_pixmap_new_with_size(ch, GTK_ICON_SIZE_DIALOG); g_variant_get_child(variant, 2, "s", &self->title, NULL); g_variant_get_child(variant, 3, "s", &self->description, NULL); } else if (!g_strcmp0(g_variant_get_type_string(variant), "s")) self->title = g_variant_dup_string(variant, NULL); return self; } G_GNUC_INTERNAL void unbox_tooltip(ToolTip *tooltip, GtkIconTheme *theme, const char *icon_theme_path, GIcon **icon, char **markup) { g_autofree char *raw_text = g_strdup_printf("%s\n%s", tooltip->title, tooltip->description); bool is_pango_markup = true; g_autoptr(GString) bldr = g_string_new(""); if (raw_text) { g_autoptr(GError) err = NULL; pango_parse_markup(raw_text, -1, '\0', NULL, NULL, NULL, &err); if (err) is_pango_markup = false; } if (!is_pango_markup) { g_string_append(bldr, ""); if (!string_empty(tooltip->title)) g_string_append(bldr, tooltip->title); if (!string_empty(tooltip->description)) { if (bldr->len > 8) g_string_append(bldr, "
"); g_string_append(bldr, tooltip->description); } g_string_append(bldr, "
"); g_autoptr(QRichTextParser) markup_parser = qrich_text_parser_new(bldr->str); qrich_text_parser_translate_markup(markup_parser); *markup = (!string_empty(markup_parser->pango_markup)) ? g_strdup(markup_parser->pango_markup) : g_strdup(raw_text); g_autoptr(GIcon) res_icon = icon_pixmap_select_icon(tooltip->icon_name, tooltip->pixmap, theme, icon_theme_path, GTK_ICON_SIZE_DIALOG, false); *icon = (markup_parser->icon != NULL) ? g_object_ref(markup_parser->icon) : g_object_ref(res_icon); } else { *markup = g_strdup(raw_text); *icon = icon_pixmap_select_icon(tooltip->icon_name, tooltip->pixmap, theme, icon_theme_path, 48, false); } } G_GNUC_INTERNAL void tooltip_free(ToolTip *self) { g_clear_pointer(&self->title, g_free); g_clear_pointer(&self->description, g_free); g_clear_pointer(&self->icon_name, g_free); g_clear_pointer(&self->pixmap, icon_pixmap_free); g_clear_pointer(&self, g_free); } G_DEFINE_AUTOPTR_CLEANUP_FUNC(ToolTip, tooltip_free) xfce4-sntray-plugin-0.4.13.1/src/icon-pixmap.h000066400000000000000000000035301370304200600207410ustar00rootroot00000000000000/* * xfce4-sntray-plugin * Copyright (C) 2015-2019 Konstantin Pugin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ #ifndef ICONPIXMAP_H #define ICONPIXMAP_H #include #include G_BEGIN_DECLS typedef struct { int width; int height; size_t bytes_size; bool is_gicon; u_int8_t *bytes; } IconPixmap; G_GNUC_INTERNAL IconPixmap *icon_pixmap_new_with_size(GVariant *pixmaps, int icon_size); G_GNUC_INTERNAL void icon_pixmap_free(IconPixmap *self); G_GNUC_INTERNAL GIcon *icon_pixmap_to_gicon(IconPixmap *self); G_GNUC_INTERNAL GIcon *icon_pixmap_select_icon(const char *icon_name, IconPixmap *pixmap, GtkIconTheme *theme, const char *icon_theme_path, const int icon_size, const bool use_symbolic); typedef struct { char *icon_name; IconPixmap *pixmap; char *title; char *description; } ToolTip; G_GNUC_INTERNAL ToolTip *tooltip_new(GVariant *variant); G_GNUC_INTERNAL void unbox_tooltip(ToolTip *tooltip, GtkIconTheme *theme, const char *icon_theme_path, GIcon **icon, char **markup); G_GNUC_INTERNAL void tooltip_free(ToolTip *self); G_END_DECLS #endif // ICONPIXMAP_H xfce4-sntray-plugin-0.4.13.1/src/panels/000077500000000000000000000000001370304200600176255ustar00rootroot00000000000000xfce4-sntray-plugin-0.4.13.1/src/panels/CMakeLists.txt000066400000000000000000000110751370304200600223710ustar00rootroot00000000000000glib_compile_resources(RESOURCES source ../sntray.gresource.xml ) ################# # Xfce Panel part ################# set(VALA_FILES_XFCE xfce4-sntray-applet.vala) if (ENABLE_XFCE) vala_precompile(VALA_C_XFCE sntray-xfce ${VALA_FILES_XFCE} PACKAGES gtk+-3.0 libxfce4panel-2.0 libxfconf-0 CUSTOM_VAPIS ${CMAKE_BINARY_DIR}/src/vala-panel-sntray.vapi ${CMAKE_SOURCE_DIR}/src/sntray-backend.vapi OPTIONS --vapidir=${CMAKE_SOURCE_DIR}/vapi --vapidir=${CMAKE_CURRENT_BINARY_DIR} --target-glib=2.44 --gresources=${CMAKE_CURRENT_SOURCE_DIR}/${PLUGIN_NAME}.gresource.xml ) ##### # Plugin Library ##### add_library (sntray-xfce MODULE ${VALA_C_XFCE} ${RESOURCES} ) target_include_directories(sntray-xfce PRIVATE ${CMAKE_SOURCE_DIR}/src) target_link_libraries(sntray-xfce sntray-core PkgConfig::XFCE) add_custom_target(sntray-xfce-ide SOURCES ${VALA_FILES_XFCE}) # Install plugin stuffs install(TARGETS sntray-xfce DESTINATION ${CMAKE_INSTALL_LIBDIR}/xfce4/panel/plugins) endif() ################# # Vala Panel part ################# set(VALA_FILES_VALAPANEL vala-panel-sntray-applet.vala) if (ENABLE_VALAPANEL) if(NEW_IFACE) set(PLUGIN_PACKAGE "") else() set(PLUGIN_PACKAGE libpeas-1.0) endif() vala_precompile(VALA_C_VALAPANEL sntray-valapanel ${VALA_FILES_VALAPANEL} PACKAGES gtk+-3.0 ${PLUGIN_PACKAGE} vala-panel CUSTOM_VAPIS ${CMAKE_BINARY_DIR}/src/vala-panel-sntray.vapi ${CMAKE_SOURCE_DIR}/src/sntray-backend.vapi OPTIONS --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi --vapidir=${CMAKE_CURRENT_BINARY_DIR} --target-glib=2.44 --gresources=${CMAKE_SOURCE_DIR}/${PLUGIN_NAME}.gresource.xml ) ##### # Plugin Library ##### add_library (sntray-valapanel MODULE ${VALA_C_VALAPANEL} ${RESOURCES} ) target_include_directories(sntray-valapanel PRIVATE ${CMAKE_SOURCE_DIR}/src) target_link_libraries(sntray-valapanel sntray-core PkgConfig::VALAPANEL) add_custom_target(sntray-valapanel-ide SOURCES ${VALA_FILES_VALAPANEL}) set_target_properties(sntray-valapanel PROPERTIES OUTPUT_NAME sntray) # Install plugin stuffs install(TARGETS sntray-valapanel DESTINATION ${CMAKE_INSTALL_LIBDIR}/vala-panel/applets) endif() ################# # Budgie Panel part ################# set(VALA_FILES_BUDGIE sntray-applet-budgie.vala) if (ENABLE_BUDGIE) vala_precompile(VALA_C_BUDGIE sntray-budgie ${VALA_FILES_BUDGIE} PACKAGES gtk+-3.0 budgie-1.0 CUSTOM_VAPIS ${CMAKE_BINARY_DIR}/src/vala-panel-sntray.vapi ${CMAKE_SOURCE_DIR}/src/sntray-backend.vapi OPTIONS --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi --vapidir=${CMAKE_CURRENT_BINARY_DIR} --target-glib=2.44 --gresources=${CMAKE_SOURCE_DIR}/${PLUGIN_NAME}.gresource.xml ) ##### # Plugin Library ##### add_library (sntray-budgie MODULE ${VALA_C_BUDGIE} ${RESOURCES} ) target_include_directories(sntray-budgie PRIVATE ${CMAKE_SOURCE_DIR}/src) target_link_libraries(sntray-budgie sntray-core PkgConfig::BUDGIE) add_custom_target(sntray-budgie-ide SOURCES ${VALA_FILES_BUDGIE}) # Install plugin stuffs install(TARGETS sntray-budgie DESTINATION ${CMAKE_INSTALL_LIBDIR}/budgie-desktop/plugins/budgie-sntray-plugin) endif() ################# # MATE Panel part ################# set(VALA_FILES_MATE mate-sntray-applet.vala) if (ENABLE_MATE) vala_precompile(VALA_C_MATE sntray-mate ${VALA_FILES_MATE} PACKAGES gdk-3.0 gtk+-3.0 libmatepanelapplet-4.0 CUSTOM_VAPIS ${CMAKE_BINARY_DIR}/src/vala-panel-sntray.vapi ${CMAKE_SOURCE_DIR}/src/sntray-backend.vapi OPTIONS --vapidir=${CMAKE_SOURCE_DIR}/vapi --vapidir=${CMAKE_CURRENT_BINARY_DIR} --target-glib=2.44 --gresources=${CMAKE_CURRENT_SOURCE_DIR}/${PLUGIN_NAME}.gresource.xml ) ##### # Plugin Library ##### add_library (sntray-mate MODULE ${VALA_C_MATE} ${RESOURCES} ) target_include_directories(sntray-mate PRIVATE ${CMAKE_SOURCE_DIR}/src) add_dependencies(sntray-mate sntray-core) target_link_libraries(sntray-mate sntray-core PkgConfig::MATE) add_custom_target(sntray-mate-ide SOURCES ${VALA_FILES_MATE}) # Install plugin stuffs install(TARGETS sntray-mate DESTINATION ${CMAKE_INSTALL_LIBDIR}/mate-panel) endif() xfce4-sntray-plugin-0.4.13.1/src/panels/mate-sntray-applet.vala000066400000000000000000000115151370304200600242240ustar00rootroot00000000000000/* * xfce4-sntray-plugin * Copyright (C) 2015-2017 Konstantin Pugin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ namespace StatusNotifier { private Gtk.Orientation get_orientation(uint orient) { switch (orient) { case MatePanel.AppletOrient.UP: case MatePanel.AppletOrient.DOWN: return Gtk.Orientation.VERTICAL; } return Gtk.Orientation.HORIZONTAL; } private bool factory_callback(MatePanel.Applet applet, string iid) { if (iid != "SNTrayApplet") { return false; } applet.flags = MatePanel.AppletFlags.HAS_HANDLE | MatePanel.AppletFlags.EXPAND_MINOR; var layout = new ItemBox(); var widget = layout; var settings = MatePanel.AppletSettings.new(applet,"org.valapanel.sntray"); settings.bind(SHOW_APPS,layout,SHOW_APPS,SettingsBindFlags.DEFAULT); settings.bind(SHOW_COMM,layout,SHOW_COMM,SettingsBindFlags.DEFAULT); settings.bind(SHOW_SYS,layout,SHOW_SYS,SettingsBindFlags.DEFAULT); settings.bind(SHOW_HARD,layout,SHOW_HARD,SettingsBindFlags.DEFAULT); settings.bind(SHOW_OTHER,layout,SHOW_OTHER,SettingsBindFlags.DEFAULT); settings.bind(SHOW_PASSIVE,layout,SHOW_PASSIVE,SettingsBindFlags.DEFAULT); settings.bind(INDICATOR_SIZE,layout,INDICATOR_SIZE,SettingsBindFlags.DEFAULT); settings.bind(USE_SYMBOLIC,layout,USE_SYMBOLIC,SettingsBindFlags.DEFAULT); settings.bind(USE_LABELS,layout,USE_LABELS,SettingsBindFlags.DEFAULT); settings.bind_with_mapping(INDEX_OVERRIDE,layout,INDEX_OVERRIDE,SettingsBindFlags.DEFAULT, (SettingsBindGetMappingShared)get_vardict, (SettingsBindSetMappingShared)set_vardict, (void*)"i",null); settings.bind_with_mapping(FILTER_OVERRIDE,layout,FILTER_OVERRIDE,SettingsBindFlags.DEFAULT, (SettingsBindGetMappingShared)get_vardict, (SettingsBindSetMappingShared)set_vardict, (void*)"b",null); applet.change_orient.connect((orient) => { widget.orientation = get_orientation(orient); }); widget.orientation = get_orientation(applet.orient); widget.show(); applet.add(widget); applet.show(); var action_group = new Gtk.ActionGroup ("SNTrayApplet Menu Actions"); action_group.set_translation_domain (Config.GETTEXT_PACKAGE); Gtk.Action a = new Gtk.Action("SNTrayPreferences",N_("_Preferences"),null,Gtk.Stock.PREFERENCES); a.activate.connect(()=> { var dlg = ConfigWidget.get_config_dialog(layout,true); dlg.show(); dlg.response.connect(()=>{ dlg.destroy(); }); }); action_group.add_action (a); applet.setup_menu("""""",action_group); return true; } private static bool get_vardict(Value val, Variant variant,void* data) { var iter = variant.iterator(); string name; Variant inner_val; var dict = new HashTable(str_hash,str_equal); while(iter.next("{sv}",out name, out inner_val)) dict.insert(name,inner_val); val.set_boxed((void*)dict); return true; } private static Variant set_vardict(Value val, VariantType type,void* data) { var builder = new VariantBuilder(type); unowned HashTable table = (HashTable)val.get_boxed(); table.foreach((k,v)=>{ builder.add("{sv}",k,v); }); return builder.end(); } } public int _mate_panel_applet_shlib_factory() { GLib.Intl.bindtextdomain(Config.GETTEXT_PACKAGE,Config.LOCALE_DIR); GLib.Intl.bind_textdomain_codeset(Config.GETTEXT_PACKAGE,"UTF-8"); return MatePanel.Applet.factory_setup_in_process("SNTrayAppletFactory", typeof (MatePanel.Applet), StatusNotifier.factory_callback); } //void main(string[] args) { // Gtk.init(ref args); // MatePanel.Applet.factory_main("SNTrayAppletFactory", true, typeof (MatePanel.Applet), StatusNotifier.factory_callback); //} xfce4-sntray-plugin-0.4.13.1/src/panels/sntray-applet-budgie.vala000066400000000000000000000106771370304200600245450ustar00rootroot00000000000000/* * xfce4-sntray-plugin * Copyright (C) 2015-2017 Konstantin Pugin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ using Gtk; using GLib; using Budgie; using StatusNotifier; public class SNApplet : Budgie.Plugin, Peas.ExtensionBase { public Applet get_panel_widget(string uid) { return new SNTray(uid); } } public class SNTray: Budgie.Applet { unowned ItemBox widget; GLib.Settings settings; public string uuid { public set ; public get; } public override Gtk.Widget? get_settings_ui() { var dlg = new ConfigWidget(widget); dlg.configure_icon_size = false; return dlg; } public override bool supports_settings() { return true; } public SNTray (string uuid) { Object(uuid: uuid); var layout = new ItemBox(); widget = layout; settings_schema = "org.valapanel.sntray"; settings_prefix = "/com/solus-project/budgie-panel/instance/sntray"; settings = get_applet_settings(uuid); settings.bind(SHOW_APPS,layout,SHOW_APPS,SettingsBindFlags.DEFAULT); settings.bind(SHOW_COMM,layout,SHOW_COMM,SettingsBindFlags.DEFAULT); settings.bind(SHOW_SYS,layout,SHOW_SYS,SettingsBindFlags.DEFAULT); settings.bind(SHOW_HARD,layout,SHOW_HARD,SettingsBindFlags.DEFAULT); settings.bind(SHOW_OTHER,layout,SHOW_OTHER,SettingsBindFlags.DEFAULT); settings.bind(SHOW_PASSIVE,layout,SHOW_PASSIVE,SettingsBindFlags.DEFAULT); settings.bind(INDICATOR_SIZE,layout,INDICATOR_SIZE,SettingsBindFlags.DEFAULT); settings.bind(USE_SYMBOLIC,layout,USE_SYMBOLIC,SettingsBindFlags.DEFAULT); settings.bind(USE_LABELS,layout,USE_LABELS,SettingsBindFlags.DEFAULT); settings.bind_with_mapping(INDEX_OVERRIDE,layout,INDEX_OVERRIDE,SettingsBindFlags.DEFAULT, (SettingsBindGetMappingShared)get_vardict, (SettingsBindSetMappingShared)set_vardict, (void*)"i",null); settings.bind_with_mapping(FILTER_OVERRIDE,layout,FILTER_OVERRIDE,SettingsBindFlags.DEFAULT, (SettingsBindGetMappingShared)get_vardict, (SettingsBindSetMappingShared)set_vardict, (void*)"b",null); layout.orientation = Orientation.VERTICAL; //Just setup panel_size_changed.connect((p,i,s)=> { layout.indicator_size = (int)s; }); this.add(layout); show_all(); } protected override void panel_position_changed(Budgie.PanelPosition position) { if (position == Budgie.PanelPosition.LEFT || position == Budgie.PanelPosition.RIGHT) widget.orientation = Gtk.Orientation.HORIZONTAL; else widget.orientation = Gtk.Orientation.VERTICAL; } private static bool get_vardict(Value val, Variant variant,void* data) { var iter = variant.iterator(); string name; Variant inner_val; var dict = new HashTable(str_hash,str_equal); while(iter.next("{sv}",out name, out inner_val)) dict.insert(name,inner_val); val.set_boxed((void*)dict); return true; } private static Variant set_vardict(Value val, VariantType type,void* data) { var builder = new VariantBuilder(type); unowned HashTable table = (HashTable)val.get_boxed(); table.foreach((k,v)=>{ builder.add("{sv}",k,v); }); return builder.end(); } } // End class [ModuleInit] public void peas_register_types(TypeModule module) { // boilerplate - all modules need this var objmodule = module as Peas.ObjectModule; objmodule.register_extension_type(typeof(Budgie.Plugin), typeof(SNApplet)); } xfce4-sntray-plugin-0.4.13.1/src/panels/vala-panel-sntray-applet.vala000066400000000000000000000101511370304200600253110ustar00rootroot00000000000000/* * xfce4-sntray-plugin * Copyright (C) 2015-2017 Konstantin Pugin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ using Gtk; using GLib; using ValaPanel; using StatusNotifier; public class SNTray: Applet { unowned ItemBox widget; public SNTray (Toplevel top, GLib.Settings? settings, string number) { base(top,settings,number); } public override void constructed() { (this.action_group.lookup_action(AppletAction.CONFIGURE) as SimpleAction).set_enabled(true); var layout = new ItemBox(); widget = layout; settings.bind(SHOW_APPS,layout,SHOW_APPS,SettingsBindFlags.DEFAULT); settings.bind(SHOW_COMM,layout,SHOW_COMM,SettingsBindFlags.DEFAULT); settings.bind(SHOW_SYS,layout,SHOW_SYS,SettingsBindFlags.DEFAULT); settings.bind(SHOW_HARD,layout,SHOW_HARD,SettingsBindFlags.DEFAULT); settings.bind(SHOW_OTHER,layout,SHOW_OTHER,SettingsBindFlags.DEFAULT); settings.bind(SHOW_PASSIVE,layout,SHOW_PASSIVE,SettingsBindFlags.DEFAULT); toplevel.bind_property(Key.ICON_SIZE,layout,INDICATOR_SIZE,BindingFlags.SYNC_CREATE); settings.bind(USE_SYMBOLIC,layout,USE_SYMBOLIC,SettingsBindFlags.DEFAULT); settings.bind(USE_LABELS,layout,USE_LABELS,SettingsBindFlags.DEFAULT); settings.bind_with_mapping(INDEX_OVERRIDE,layout,INDEX_OVERRIDE,SettingsBindFlags.DEFAULT, (SettingsBindGetMappingShared)get_vardict, (SettingsBindSetMappingShared)set_vardict, (void*)"i",null); settings.bind_with_mapping(FILTER_OVERRIDE,layout,FILTER_OVERRIDE,SettingsBindFlags.DEFAULT, (SettingsBindGetMappingShared)get_vardict, (SettingsBindSetMappingShared)set_vardict, (void*)"b",null); layout.orientation = (toplevel.orientation == Orientation.HORIZONTAL) ? Orientation.VERTICAL:Orientation.HORIZONTAL; toplevel.notify["orientation"].connect((o,a)=> { layout.orientation = (toplevel.orientation == Orientation.HORIZONTAL) ? Orientation.VERTICAL:Orientation.HORIZONTAL; }); this.add(layout); layout.show(); this.show(); } public override Widget get_settings_ui() { var dlg = new ConfigWidget(widget); dlg.configure_icon_size = false; return dlg; } private static bool get_vardict(Value val, Variant variant,void* data) { var iter = variant.iterator(); string name; Variant inner_val; var dict = new HashTable(str_hash,str_equal); while(iter.next("{sv}",out name, out inner_val)) dict.insert(name,inner_val); val.set_boxed((void*)dict); return true; } private static Variant set_vardict(Value val, VariantType type,void* data) { var builder = new VariantBuilder(type); unowned HashTable table = (HashTable)val.get_boxed(); table.foreach((k,v)=>{ builder.add("{sv}",k,v); }); return builder.end(); } } // End class [ModuleInit] public void g_io_sntray_load(GLib.TypeModule module) { // boilerplate - all modules need this GLib.IOExtensionPoint.implement(ValaPanel.Applet.EXTENSION_POINT,typeof(SNTray),"org.valapanel.sntray",10); } public void g_io_sntray_unload(GLib.IOModule module) { // boilerplate - all modules need this } xfce4-sntray-plugin-0.4.13.1/src/panels/xfce4-sntray-applet.vala000066400000000000000000000131401370304200600243030ustar00rootroot00000000000000/* * xfce4-sntray-plugin * Copyright (C) 2015-2017 Konstantin Pugin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ using GLib; using StatusNotifier; using Xfce; public class StatusNotifierPlugin : Xfce.PanelPlugin { public override void @construct() { GLib.Intl.setlocale(LocaleCategory.CTYPE,""); GLib.Intl.bindtextdomain(Config.GETTEXT_PACKAGE,Config.LOCALE_DIR); GLib.Intl.bind_textdomain_codeset(Config.GETTEXT_PACKAGE,"UTF-8"); GLib.Intl.textdomain(Config.GETTEXT_PACKAGE); var widget = new ItemBox(); layout = widget; add(widget); add_action_widget(widget); widget.indicator_size = (int)this.size/(int)this.nrows - 2; widget.show_passive = true; widget.orientation = (this.mode != Xfce.PanelPluginMode.DESKBAR) ? Gtk.Orientation.VERTICAL : Gtk.Orientation.HORIZONTAL; this.width_request = -1; try{ Xfconf.init(); wrapper = new ItemBoxWrapper(widget); channel = this.get_channel(); Xfconf.Property.bind(channel,this.get_property_base()+"/"+SHOW_APPS,typeof(bool),widget,SHOW_APPS); Xfconf.Property.bind(channel,this.get_property_base()+"/"+SHOW_COMM,typeof(bool),widget,SHOW_COMM); Xfconf.Property.bind(channel,this.get_property_base()+"/"+SHOW_SYS,typeof(bool),widget,SHOW_SYS); Xfconf.Property.bind(channel,this.get_property_base()+"/"+SHOW_HARD,typeof(bool),widget,SHOW_HARD); Xfconf.Property.bind(channel,this.get_property_base()+"/"+SHOW_OTHER,typeof(bool),widget,SHOW_OTHER); Xfconf.Property.bind(channel,this.get_property_base()+"/"+SHOW_PASSIVE,typeof(bool),widget,SHOW_PASSIVE); Xfconf.Property.bind(channel,this.get_property_base()+"/"+USE_SYMBOLIC,typeof(bool),widget,USE_SYMBOLIC); Xfconf.Property.bind(channel,this.get_property_base()+"/"+USE_LABELS,typeof(bool),widget,USE_LABELS); Xfconf.Property.bind(channel,this.get_property_base()+"/"+INDEX_OVERRIDE,typeof(string),wrapper,INDEX_OVERRIDE); Xfconf.Property.bind(channel,this.get_property_base()+"/"+FILTER_OVERRIDE,typeof(string),wrapper,FILTER_OVERRIDE); this.menu_show_configure(); } catch (Xfconf.Error e) { stderr.printf("Xfconf init failed. Configuration will not be saved.\n"); } this.notify.connect((pspec)=>{ if (pspec.name == "mode") widget.orientation = (this.mode != Xfce.PanelPluginMode.DESKBAR) ? Gtk.Orientation.VERTICAL : Gtk.Orientation.HORIZONTAL; if (pspec.name == "size" || pspec.name == "nrows") { widget.indicator_size = (int)this.size/(int)this.nrows - 8; this.width_request = -1; } }); this.shrink = true; widget.show(); } public override void configure_plugin() { var dlg = ConfigWidget.get_config_dialog(layout, false); dlg.present(); dlg.unmap.connect(()=>{ dlg.destroy(); }); } unowned ItemBox layout; Xfconf.Channel channel; ItemBoxWrapper wrapper; } internal class ItemBoxWrapper: Object { internal string index_override { owned get { return hashtable_to_string(layout.index_override); } set { layout.index_override = string_to_hashtable(value); } } internal string filter_override { owned get { return hashtable_to_string(layout.filter_override); } set { layout.filter_override = string_to_hashtable(value); } } internal ItemBoxWrapper(ItemBox box) { this.layout = box; layout.notify.connect((pspec)=>{ if (pspec.name == INDEX_OVERRIDE) this.notify_property(INDEX_OVERRIDE); if (pspec.name == FILTER_OVERRIDE) this.notify_property(FILTER_OVERRIDE); }); } unowned ItemBox layout; private string hashtable_to_string(HashTable table) { var builder = new VariantBuilder(VariantType.VARDICT); table.foreach((k,v)=>{ builder.add("{sv}",k,v); }); var val = builder.end(); return val.print(false); } private HashTable string_to_hashtable(string str) { Variant variant; try { variant = Variant.parse(VariantType.VARDICT,str); var iter = variant.iterator(); string name; Variant inner_val; var dict = new HashTable(str_hash,str_equal); while(iter.next("{sv}",out name, out inner_val)) dict.insert(name,inner_val); return dict; } catch (Error e) { stderr.printf("Cannot convert string\n"); } return new HashTable(str_hash,str_equal); } } [ModuleInit] public Type xfce_panel_module_init (TypeModule module) { return typeof (StatusNotifierPlugin); } xfce4-sntray-plugin-0.4.13.1/src/rtparser.c000066400000000000000000000341751370304200600203630ustar00rootroot00000000000000/* * xfce4-sntray-plugin * Copyright (C) 2015-2019 Konstantin Pugin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ #include "rtparser.h" #include static void init_sets(QRichTextParser *parser); static void visit_start(GMarkupParseContext *context, const char *element_name, const char **attribute_names, const char **attribute_values, void *obj, GError **error); static void visit_end(GMarkupParseContext *context, const char *element_name, void *obj, GError **error); static void visit_text(GMarkupParseContext *context, const char *text, size_t text_len, void *obj, GError **error); static const GMarkupParser parser = { visit_start, visit_end, visit_text, NULL, NULL }; QRichTextParser *qrich_text_parser_new(const char *markup) { g_return_val_if_fail(markup != NULL, NULL); QRichTextParser *self = g_slice_new0(QRichTextParser); self->pango_markup_builder = g_string_new(""); self->context = g_markup_parse_context_new(&parser, 0, self, NULL); init_sets(self); self->icon = NULL; self->table_depth = 0; self->rich_markup = g_strdup(markup); return self; } void qrich_text_parser_free(QRichTextParser *self) { g_clear_pointer(&self->pango_names, g_hash_table_unref); g_clear_pointer(&self->division_names, g_hash_table_unref); g_clear_pointer(&self->span_aliases, g_hash_table_unref); g_clear_pointer(&self->lists, g_hash_table_unref); g_clear_pointer(&self->newline_at_end, g_hash_table_unref); g_clear_pointer(&self->translated_to_pango, g_hash_table_unref); g_clear_pointer(&self->special_spans, g_hash_table_unref); g_clear_pointer(&self->context, g_markup_parse_context_unref); g_clear_pointer(&self->rich_markup, g_free); if (self->pango_markup_builder != NULL) g_string_free(self->pango_markup_builder, true); g_clear_pointer(&self->pango_markup, g_free); g_clear_object(&self->icon); g_slice_free(QRichTextParser, self); } void qrich_text_parser_free(QRichTextParser *self); static void init_sets(QRichTextParser *parser) { #define D(s) s, s parser->pango_names = g_hash_table_new(g_str_hash, g_str_equal); g_hash_table_insert(parser->pango_names, D("i")); g_hash_table_insert(parser->pango_names, D("b")); g_hash_table_insert(parser->pango_names, D("big")); g_hash_table_insert(parser->pango_names, D("s")); g_hash_table_insert(parser->pango_names, D("small")); g_hash_table_insert(parser->pango_names, D("sub")); g_hash_table_insert(parser->pango_names, D("sup")); g_hash_table_insert(parser->pango_names, D("tt")); g_hash_table_insert(parser->pango_names, D("u")); parser->translated_to_pango = g_hash_table_new(g_str_hash, g_str_equal); g_hash_table_insert(parser->translated_to_pango, "dfn", "i"); g_hash_table_insert(parser->translated_to_pango, "cite", "i"); g_hash_table_insert(parser->translated_to_pango, "code", "tt"); g_hash_table_insert(parser->translated_to_pango, "em", "i"); g_hash_table_insert(parser->translated_to_pango, "samp", "tt"); g_hash_table_insert(parser->translated_to_pango, "strong", "b"); g_hash_table_insert(parser->translated_to_pango, "var", "i"); parser->division_names = g_hash_table_new(g_str_hash, g_str_equal); g_hash_table_insert(parser->division_names, D("markup")); g_hash_table_insert(parser->division_names, D("div")); g_hash_table_insert(parser->division_names, D("dl")); g_hash_table_insert(parser->division_names, D("dt")); g_hash_table_insert(parser->division_names, D("p")); g_hash_table_insert(parser->division_names, D("html")); g_hash_table_insert(parser->division_names, D("center")); parser->span_aliases = g_hash_table_new(g_str_hash, g_str_equal); g_hash_table_insert(parser->span_aliases, D("span")); g_hash_table_insert(parser->span_aliases, D("font")); g_hash_table_insert(parser->span_aliases, D("tr")); g_hash_table_insert(parser->span_aliases, D("td")); g_hash_table_insert(parser->span_aliases, D("th")); g_hash_table_insert(parser->span_aliases, D("table")); g_hash_table_insert(parser->span_aliases, D("body")); parser->special_spans = g_hash_table_new(g_str_hash, g_str_equal); g_hash_table_insert(parser->special_spans, "h1", "span size=\"large\" weight=\"bold\""); g_hash_table_insert(parser->special_spans, "h2", "span size=\"large\" style=\"italic\""); g_hash_table_insert(parser->special_spans, "h3", "span size=\"large\""); g_hash_table_insert(parser->special_spans, "h4", "span size=\"larger\" weight=\"bold\""); g_hash_table_insert(parser->special_spans, "h5", "span size=\"larger\" style=\"italic\""); g_hash_table_insert(parser->special_spans, "h6", "span size=\"larger\""); parser->newline_at_end = g_hash_table_new(g_str_hash, g_str_equal); g_hash_table_insert(parser->newline_at_end, D("hr")); g_hash_table_insert(parser->newline_at_end, D("tr")); g_hash_table_insert(parser->newline_at_end, D("li")); parser->lists = g_hash_table_new(g_str_hash, g_str_equal); g_hash_table_insert(parser->lists, D("ol")); g_hash_table_insert(parser->lists, D("ul")); #undef D } static char *string_slice(const char *self, long start, long end) { char *result = NULL; g_return_val_if_fail(self != NULL, NULL); size_t string_length = strlen(self); bool slice_allowed = false; if (start < 0) start = (long)string_length + start; if (end < 0) end = (long)string_length + end; if (start >= 0) slice_allowed = start <= string_length; else slice_allowed = false; g_return_val_if_fail(slice_allowed, NULL); if (end >= 0) slice_allowed = end <= string_length; else slice_allowed = false; g_return_val_if_fail(slice_allowed, NULL); g_return_val_if_fail(start <= end, NULL); result = g_strndup(((char *)self) + start, (size_t)(end - start)); return result; } static long string_last_index_of(const gchar *self, const gchar *needle, gint start_index) { g_return_val_if_fail(self != NULL, 0); g_return_val_if_fail(needle != NULL, 0); char *index = g_strrstr(((gchar *)self) + start_index, (gchar *)needle); if (index != NULL) return index - self; else return -1; } static char *string_replace(const gchar *self, const gchar *old, const gchar *replacement) { g_return_val_if_fail(self != NULL, NULL); g_return_val_if_fail(old != NULL, NULL); g_return_val_if_fail(replacement != NULL, NULL); if (self[0] == '\0' || old[0] == '\0' || g_str_equal(old, replacement)) return g_strdup(self); g_autoptr(GError) err = NULL; g_autofree char *escaped = g_regex_escape_string(old, -1); g_autoptr(GRegex) regex = g_regex_new(escaped, 0, 0, &err); if (err) { g_critical("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, err->message, g_quark_to_string(err->domain), err->code); return NULL; } g_autofree char *res = g_regex_replace_literal(regex, self, -1, 0, replacement, 0, &err); if (err) { g_critical("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, err->message, g_quark_to_string(err->domain), err->code); return NULL; } return g_strdup(res); } static char *parse_size(const char *size) { if (strstr(size, "+")) return g_strdup("larger"); else if (strstr(size, "-")) return "smaller"; else if (strstr(size, "pt") || strstr(size, "px")) return g_strdup_printf("%d", atoi(size) * PANGO_SCALE); else return g_strdup(size); } // static void visit_start(GMarkupParseContext *context, const char *name, const char **attribute_names, const char **attr_values, void *obj, GError **error) { QRichTextParser *self = (QRichTextParser *)obj; if (g_hash_table_lookup(self->pango_names, name)) g_string_append_printf(self->pango_markup_builder, "<%s>", name); if (g_hash_table_lookup(self->translated_to_pango, name)) g_string_append_printf(self->pango_markup_builder, "<%s>", (char *)g_hash_table_lookup(self->translated_to_pango, name)); if (g_hash_table_lookup(self->division_names, name)) g_debug("Found block. Pango markup not support blocks for now.\n"); if (g_hash_table_lookup(self->span_aliases, name)) { g_string_append_printf(self->pango_markup_builder, "pango_markup_builder, " background=\"%s\" ", attr_values[i]); if (g_str_equal(attr, "color")) g_string_append_printf(self->pango_markup_builder, " foreground=\"%s\" ", attr_values[i]); if (g_str_equal(attr, "size")) g_string_append_printf(self->pango_markup_builder, " size=\"%s\" ", parse_size(attr_values[i])); if (g_str_equal(attr, "face")) g_string_append_printf(self->pango_markup_builder, " face=\"%s\" ", attr_values[i]); } g_string_append_printf(self->pango_markup_builder, ">"); } if (g_hash_table_lookup(self->special_spans, name)) g_string_append_printf(self->pango_markup_builder, "<%s>", (char *)g_hash_table_lookup(self->special_spans, name)); if (g_hash_table_lookup(self->lists, name)) { self->list_order = 0; if (g_str_equal(name, "ol")) self->list_type = NUM; else self->list_type = DOT; } if (g_str_equal(name, "li")) { if (self->list_type == NUM) g_string_append_printf(self->pango_markup_builder, "%d. ", self->list_order); if (self->list_type == DOT) g_string_append_printf(self->pango_markup_builder, "+ "); self->list_order++; } if (g_str_equal(name, "img")) { int i = 0; for (size_t i = 0; attribute_names[i] != NULL; i++) { const char *attr = attribute_names[i]; if (g_str_equal(attr, "src") || g_str_equal(attr, "source")) { if (self->icon != NULL) fprintf( stderr, "Multiple icons is not supported. Used only first\n"); if (attr_values[i][0] == '/') { g_autoptr(GFile) f = g_file_new_for_path(attr_values[i]); self->icon = g_file_icon_new(f); } else { g_autofree char *basename = g_path_get_basename(attr_values[i]); g_autofree char *icon_name = string_slice(basename, 0, string_last_index_of(basename, ".", 0)); g_autofree char *symb_name = g_strdup_printf("%s-symbolic", icon_name); self->icon = g_themed_icon_new_with_default_fallbacks(symb_name); } } } } if (g_str_equal(name, "br")) g_string_append_printf(self->pango_markup_builder, "\n"); if (g_str_equal(name, "table")) self->table_depth++; } // static void visit_end(GMarkupParseContext *context, const char *element_name, void *obj, GError **error) { QRichTextParser *self = (QRichTextParser *)obj; const char *ins_name; if (g_hash_table_contains(self->span_aliases, element_name) || g_hash_table_contains(self->special_spans, element_name)) ins_name = "span"; else if (g_hash_table_contains(self->translated_to_pango, element_name)) ins_name = g_hash_table_lookup(self->translated_to_pango, element_name); else ins_name = element_name; if (g_hash_table_contains(self->span_aliases, element_name) || g_hash_table_contains(self->pango_names, element_name) || g_hash_table_contains(self->translated_to_pango, element_name) || g_hash_table_contains(self->special_spans, element_name)) g_string_append_printf(self->pango_markup_builder, "", ins_name); if (g_hash_table_contains(self->newline_at_end, element_name)) g_string_append_printf(self->pango_markup_builder, "\n"); if (g_str_equal(element_name, "td")) g_string_append_printf(self->pango_markup_builder, " "); if (g_str_equal(element_name, "table")) self->table_depth--; if (g_hash_table_contains(self->lists, element_name)) self->list_type = NONE; } static void visit_text(GMarkupParseContext *context, const char *text, size_t text_len, void *obj, GError **error) { QRichTextParser *self = (QRichTextParser *)obj; g_autofree char *new_text = string_replace(text, "\n", ""); g_autofree char *stripped = NULL; if (self->table_depth > 0) stripped = g_strstrip(string_replace(new_text, "\n", "")); else stripped = g_strdup(new_text); g_string_append_printf(self->pango_markup_builder, "%s", stripped); } static char *prepare(const char *raw) { g_autofree char *str1 = NULL; g_autofree char *str2 = NULL; if (strstr(raw, " ")) str1 = string_replace(raw, " ", " "); if (strstr(raw, "&")) str2 = string_replace(str1, "&", "&"); if (str2) return g_strdup(str2); if (str1) return g_strdup(str2); return g_strdup(raw); } static bool parse(QRichTextParser *self, const char *markup) { g_autofree char *prepared = prepare(markup); g_autoptr(GError) err = NULL; bool res = g_markup_parse_context_parse(self->context, prepared, strlen(prepared), &err); if (err) return false; return res; } void qrich_text_parser_translate_markup(QRichTextParser *self) { g_clear_object(&self->icon); parse(self, self->rich_markup); self->pango_markup = g_strdup(self->pango_markup_builder->str); g_string_erase(self->pango_markup_builder, 0, -1); if (strstr(self->pango_markup, "&")) { char *tmp = string_replace(self->pango_markup, "&", "&"); g_clear_pointer(&self->pango_markup, g_free); self->pango_markup = tmp; } } xfce4-sntray-plugin-0.4.13.1/src/rtparser.h000066400000000000000000000032471370304200600203640ustar00rootroot00000000000000/* * xfce4-sntray-plugin * Copyright (C) 2015-2019 Konstantin Pugin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ #ifndef RTPARSER_H #define RTPARSER_H #include #include #include #include #include #include #include typedef enum { NONE, NUM, DOT, } ListType; struct _QRichTextParser { GHashTable *pango_names; GHashTable *division_names; GHashTable *span_aliases; GHashTable *lists; GHashTable *newline_at_end; GHashTable *translated_to_pango; GHashTable *special_spans; GMarkupParseContext *context; char *rich_markup; GString *pango_markup_builder; ListType list_type; gint list_order; gint table_depth; char *pango_markup; GIcon *icon; }; typedef struct _QRichTextParser QRichTextParser; QRichTextParser *qrich_text_parser_new(const char *markup); void qrich_text_parser_free(QRichTextParser *self); void qrich_text_parser_translate_markup(QRichTextParser *self); G_DEFINE_AUTOPTR_CLEANUP_FUNC(QRichTextParser, qrich_text_parser_free) #endif xfce4-sntray-plugin-0.4.13.1/src/snchild.vala000066400000000000000000000233461370304200600206440ustar00rootroot00000000000000/* * xfce4-sntray-plugin * Copyright (C) 2015-2017 Konstantin Pugin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ using GLib; using Gtk; namespace StatusNotifier { public class Item : FlowBoxChild { public ObjectPath object_path {private get; internal construct;} public string object_name {private get; internal construct;} public Status status {get; private set;} public uint ordering_index {get; private set;} public Category cat {get; private set;} public string id {get; private set;} internal string title {get; private set;} internal Icon icon {owned get { return proxy.icon; } } Label label; Image image; EventBox ebox; ValaDBusMenu.GtkClient? client; Gtk.Menu menu; StatusNotifier.Proxy proxy; public Item (string n, ObjectPath p) { Object(object_path: p, object_name: n); } public override void destroy() { if (menu != null) menu.destroy(); if (client != null) client = null; base.destroy(); } construct { unowned StyleContext context = this.get_style_context(); this.reset_style(); var provider = new Gtk.CssProvider(); provider.load_from_resource("/org/vala-panel/sntray/style.css"); context.add_provider(provider,STYLE_PROVIDER_PRIORITY_APPLICATION); context.add_class("-panel-launch-button"); proxy = new StatusNotifier.Proxy(object_name,object_path); client = null; this.has_tooltip = true; ebox = new EventBox(); var box = new Box(Orientation.HORIZONTAL,0); label = new Label(null); image = new Image(); box.add(image); image.valign = Align.CENTER; image.show(); box.add(label); label.valign = Align.CENTER; label.show(); ebox.add(box); box.show(); this.add(ebox); ebox.add_events(Gdk.EventMask.SCROLL_MASK); ebox.scroll_event.connect((e)=>{ switch (e.direction) { case Gdk.ScrollDirection.LEFT: proxy.scroll(-120, 0); break; case Gdk.ScrollDirection.RIGHT: proxy.scroll(120, 0); break; case Gdk.ScrollDirection.DOWN: proxy.scroll(0, -120); break; case Gdk.ScrollDirection.UP: proxy.scroll(0, 120); break; case Gdk.ScrollDirection.SMOOTH: double dx,dy; e.get_scroll_deltas(out dx, out dy); var x = (int) Math.round(dx); var y = (int) Math.round(dy); proxy.scroll(x,y); break; } return false; }); ebox.button_release_event.connect(button_press_event_cb); ebox.enter_notify_event.connect((e)=>{ this.get_style_context().add_class("-panel-launch-button-selected"); return false; }); ebox.leave_notify_event.connect((e)=>{ this.get_style_context().remove_class("-panel-launch-button-selected"); return false; }); this.query_tooltip.connect(query_tooltip_cb); this.popup_menu.connect(context_menu); this.parent_set.connect((prev)=>{ if (get_applet() != null) { get_applet().bind_property(INDICATOR_SIZE,image,"pixel-size",BindingFlags.SYNC_CREATE); get_applet().bind_property(INDICATOR_SIZE,proxy,"icon-size",BindingFlags.SYNC_CREATE); get_applet().bind_property(USE_SYMBOLIC,proxy,"use-symbolic",BindingFlags.SYNC_CREATE); get_applet().bind_property(USE_LABELS,label,"visible",BindingFlags.SYNC_CREATE); } }); ebox.show(); proxy.initialized.connect(()=>{ init_proxy(); }); proxy.start(); } private void init_proxy() { if (proxy.menu != null) setup_inner_menu(); title = proxy.title; this.ordering_index = proxy.x_ayatana_ordering_index; this.cat = proxy.category; this.id = proxy.id; this.title = proxy.title; iface_new_status_cb(); proxy.notify.connect((pspec)=>{ if(pspec.name == "status") iface_new_status_cb(); if(pspec.name == "icon") iface_new_icon_cb(); if(pspec.name == "tooltip-text" || pspec.name == "tooltip-title") this.trigger_tooltip_query(); if(pspec.name == "x-ayatana-label" || pspec.name == "x-ayatana-label-guide") this.label.set_text(proxy.x_ayatana_label); /* FIXME: Guided labels */ }); this.changed(); this.show(); get_applet().item_added(object_name+(string)object_path); } private bool button_press_event_cb(Gdk.EventButton e) { if (e.button == 3) { proxy.activate((int)Math.round(e.x_root),(int)Math.round(e.y_root)); return true; } else if (e.button == 2) { bool ayatana = proxy.ayatana_secondary_activate(e.time); if(!ayatana) { proxy.secondary_activate((int)Math.round(e.x_root),(int)Math.round(e.y_root)); return true; } } return false; } private void iface_new_status_cb() { this.label.set_text(proxy.x_ayatana_label); iface_new_icon_cb(); this.trigger_tooltip_query(); this.status = proxy.status; switch(this.status) { case Status.PASSIVE: case Status.ACTIVE: this.get_style_context().remove_class(STYLE_CLASS_NEEDS_ATTENTION); break; case Status.ATTENTION: this.get_style_context().add_class(STYLE_CLASS_NEEDS_ATTENTION); break; } } private bool query_tooltip_cb(int x, int y, bool keyboard, Tooltip tip) { tip.set_icon_from_gicon(proxy.tooltip_icon,IconSize.DIALOG); tip.set_markup(proxy.tooltip_text); return true; } private unowned ItemBox get_applet() { return this.get_parent() as ItemBox; } private void setup_inner_menu() { menu = new Gtk.Menu(); menu.attach_to_widget(this,null); menu.vexpand = true; /*FIXME: MenuModel support */ /* if (client == null && remote_menu_model == null) { use_menumodel = !ValaDBusMenu.GtkClient.check(object_name,iface.menu); if (use_menumodel) { try { var connection = Bus.get_sync(BusType.SESSION); remote_action_group = DBusActionGroup.get(connection,object_name,iface.x_valapanel_action_group); remote_menu_model = DBusMenuModel.get(connection,object_name,iface.menu); this.insert_action_group("indicator",remote_action_group); } catch (Error e) {stderr.printf("Cannot create GMenuModel: %s",e.message);} } else */ { client = new ValaDBusMenu.GtkClient(object_name,proxy.menu); client.attach_to_menu(menu); } } // } public bool context_menu() { int x,y; if (proxy.menu != null) { menu.hide.connect(()=>{(this.get_parent() as FlowBox).unselect_child(this);}); menu.popup_at_widget(get_applet(),Gdk.Gravity.NORTH,Gdk.Gravity.NORTH,null); menu.reposition(); return true; } ebox.get_window().get_origin(out x, out y); proxy.context_menu(x,y); return true; } private void iface_new_icon_cb() { var icon = proxy.icon; if(icon != null) { if(icon is Gdk.Pixbuf) image.set_from_pixbuf(icon as Gdk.Pixbuf); else image.set_from_gicon(icon,Gtk.IconSize.INVALID); image.show(); } else image.hide(); } } } xfce4-sntray-plugin-0.4.13.1/src/snconfig.ui000066400000000000000000000555431370304200600205240ustar00rootroot00000000000000 -10000000 10000000 1 10 16 48 16 1 5 xfce4-sntray-plugin-0.4.13.1/src/snconfig.vala000066400000000000000000000206471370304200600210270ustar00rootroot00000000000000/* * xfce4-sntray-plugin * Copyright (C) 2015-2017 Konstantin Pugin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ using GLib; using Gtk; namespace StatusNotifier { [GtkTemplate (ui = "/org/vala-panel/sntray/snconfig.ui"), CCode (cname = "StatusNotifierConfig")] public class ConfigWidget : Box { private const int COLUMN_ID = 0; private const int COLUMN_NAME = 1; private const int COLUMN_OVERRIDE_INDEX = 2; private const int COLUMN_INDEX = 3; private const int COLUMN_OVERRIDE_VISIBLE = 4; private const int COLUMN_VISIBLE = 5; private const int COLUMN_ICON = 6; [GtkChild (name = "check-application")] CheckButton check_application; [GtkChild (name = "check-communications")] CheckButton check_communications; [GtkChild (name = "check-system")] CheckButton check_system; [GtkChild (name = "check-hardware")] CheckButton check_hardware; [GtkChild (name = "check-other")] CheckButton check_other; [GtkChild (name = "check-passive")] CheckButton check_passive; [GtkChild (name = "check-symbolic")] CheckButton check_symbolic; [GtkChild (name = "check-labels")] CheckButton check_labels; [GtkChild (name = "store")] Gtk.ListStore store; [GtkChild (name = "box-indicator")] Box box_indicator; [GtkChild (name = "scale-indicator")] Scale scale_indicator; unowned ItemBox layout; public bool configure_icon_size {get; set;} public static Gtk.Dialog get_config_dialog(ItemBox layout, bool configure_icon_size) { var widget = new ConfigWidget(layout); widget.configure_icon_size = configure_icon_size; var dlg = new Dialog(); dlg.set_title(_("StatusNotifier Configuration")); widget.show(); dlg.get_content_area().add(widget); return dlg; } public ConfigWidget(ItemBox box) { layout = box; this.bind_property("configure-icon-size",box_indicator,"visible",BindingFlags.SYNC_CREATE); layout.bind_property(SHOW_APPS,check_application,"active",BindingFlags.BIDIRECTIONAL|BindingFlags.SYNC_CREATE); layout.bind_property(SHOW_COMM,check_communications,"active",BindingFlags.BIDIRECTIONAL|BindingFlags.SYNC_CREATE); layout.bind_property(SHOW_SYS,check_system,"active",BindingFlags.BIDIRECTIONAL|BindingFlags.SYNC_CREATE); layout.bind_property(SHOW_HARD,check_hardware,"active",BindingFlags.BIDIRECTIONAL|BindingFlags.SYNC_CREATE); layout.bind_property(SHOW_OTHER,check_other,"active",BindingFlags.BIDIRECTIONAL|BindingFlags.SYNC_CREATE); layout.bind_property(SHOW_PASSIVE,check_passive,"active",BindingFlags.BIDIRECTIONAL|BindingFlags.SYNC_CREATE); layout.bind_property(USE_SYMBOLIC,check_symbolic,"active",BindingFlags.BIDIRECTIONAL|BindingFlags.SYNC_CREATE); layout.bind_property(USE_LABELS,check_labels,"active",BindingFlags.BIDIRECTIONAL|BindingFlags.SYNC_CREATE); layout.bind_property(INDICATOR_SIZE,scale_indicator.adjustment,"value",BindingFlags.BIDIRECTIONAL|BindingFlags.SYNC_CREATE); layout.item_added.connect((id)=>{ item_to_store(layout.items.lookup(id)); }); layout.item_removed.connect((id)=>{ TreeIter iter; for(store.get_iter_first(out iter);store.iter_next(ref iter);) { string inner_id; store.get(iter, COLUMN_ID, out inner_id); if (id == inner_id) store.remove(ref iter); } }); build_stores(); } private void build_stores() { layout.items.foreach((k,v)=>{ item_to_store(v); }); } private void item_to_store(Item v) { unowned string name = v.title; unowned string id = v.id; Icon icon = v.icon; var over_index = layout.index_override.contains(v.id); var index = layout.get_index(v); var over_filter = layout.filter_override.contains(v.id); bool filter = layout.filter_cb(v); TreeIter iter; store.append(out iter); store.set(iter,COLUMN_ID,id,COLUMN_NAME,name,COLUMN_OVERRIDE_INDEX,over_index,COLUMN_INDEX,index.to_string(), COLUMN_OVERRIDE_VISIBLE,over_filter,COLUMN_VISIBLE,filter, COLUMN_ICON,icon); } private void layout_notify_by_pspec(string prop) { Type type = typeof (ItemBox); ObjectClass ocl = (ObjectClass) type.class_ref (); unowned ParamSpec? spec = ocl.find_property (prop); layout.notify[prop](spec); } [GtkCallback] private void on_index_override(string path) { TreeIter iter; store.get_iter_from_string(out iter, path); bool over; string id; store.get(iter,COLUMN_ID,out id, COLUMN_OVERRIDE_INDEX, out over); over = !over; var index = layout.get_index(layout.get_item_by_id(id)); if (over) { store.set(iter,COLUMN_INDEX,"%d".printf(index)); layout.index_override.insert(id,new Variant.int32(index)); } else { layout.index_override.remove(id); var new_index = layout.get_index(layout.get_item_by_id(id)); store.set(iter,COLUMN_INDEX,"%d".printf(new_index)); } store.set(iter,COLUMN_OVERRIDE_INDEX,over); var over_dict = layout.index_override; layout.index_override = over_dict; } [GtkCallback] private void on_filter_override(string path) { TreeIter iter; store.get_iter_from_string(out iter, path); bool over; string id; store.get(iter,COLUMN_ID,out id, COLUMN_OVERRIDE_VISIBLE, out over); over = !over; var filter = layout.filter_cb(layout.get_item_by_id(id)); if (over) { store.set(iter,COLUMN_VISIBLE,filter); layout.filter_override.insert(id,new Variant.boolean(filter)); } else { layout.filter_override.remove(id); var new_filter = layout.filter_cb(layout.get_item_by_id(id)); store.set(iter,COLUMN_VISIBLE,new_filter); } store.set(iter,COLUMN_OVERRIDE_VISIBLE,over); var over_dict = layout.filter_override; layout.filter_override = over_dict; } [GtkCallback] private void on_index_index(string path, string val) { TreeIter iter; store.get_iter_from_string(out iter, path); string id; store.get(iter,COLUMN_ID,out id); store.set(iter,COLUMN_INDEX,val); layout.index_override.insert(id,new Variant.int32(int.parse(val))); layout_notify_by_pspec("index-override"); } [GtkCallback] private void on_filter_visible(string path) { TreeIter iter; store.get_iter_from_string(out iter, path); bool over; string id; store.get(iter,COLUMN_ID,out id, COLUMN_VISIBLE, out over); over = !over; store.set(iter,COLUMN_VISIBLE,over); layout.filter_override.insert(id,new Variant.boolean(over)); layout_notify_by_pspec("filter-override"); } } } xfce4-sntray-plugin-0.4.13.1/src/snhost.vala000066400000000000000000000116321370304200600205310ustar00rootroot00000000000000/* * xfce4-sntray-plugin * Copyright (C) 2015-2017 Konstantin Pugin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ using GLib; namespace StatusNotifier { public class Host: Object { public string object_path {private get; construct;} public bool watcher_registered {get; private set;} private Watcher nested_watcher; private WatcherIface outer_watcher; private uint owned_name; private uint watched_name; private bool is_nested_watcher; public signal void watcher_item_added(string id); public signal void watcher_item_removed(string id); public Host(string path) { Object(object_path: path); } public string[] watcher_items() { if (is_nested_watcher) return nested_watcher.registered_status_notifier_items; else { WatcherIface? outer = null; try { outer = Bus.get_proxy_sync(BusType.SESSION,"org.kde.StatusNotifierWatcher","/StatusNotifierWatcher"); } catch (Error e) {stderr.printf("%s\n",e.message);} return (outer != null) ? outer.registered_status_notifier_items : outer_watcher.registered_status_notifier_items; } } private void on_bus_aquired(DBusConnection conn) { try { nested_watcher = new Watcher(); conn.register_object ("/StatusNotifierWatcher", nested_watcher); nested_watcher.register_status_notifier_host(object_path); nested_watcher.status_notifier_item_registered.connect((id)=>{watcher_item_added(id);}); nested_watcher.status_notifier_item_unregistered.connect((id)=>{watcher_item_removed(id);}); } catch (IOError e) { stderr.printf ("Could not register service. Waiting for external watcher\n"); } } private void create_nested_watcher() { owned_name = Bus.own_name (BusType.SESSION, "org.kde.StatusNotifierWatcher", BusNameOwnerFlags.NONE, on_bus_aquired, () => { watcher_registered = true; is_nested_watcher = true; }, () => { is_nested_watcher = false; create_out_watcher(); }); } private void create_out_watcher() { try{ outer_watcher = Bus.get_proxy_sync(BusType.SESSION,"org.kde.StatusNotifierWatcher","/StatusNotifierWatcher"); watched_name = Bus.watch_name(BusType.SESSION,"org.kde.StatusNotifierWatcher",GLib.BusNameWatcherFlags.NONE, () => { nested_watcher = null; is_nested_watcher = false; watcher_registered = true; }, () => { Bus.unwatch_name(watched_name); is_nested_watcher = true; create_nested_watcher(); } ); outer_watcher.register_status_notifier_host(object_path); outer_watcher.status_notifier_item_registered.connect((id)=>{watcher_item_added(id);}); outer_watcher.status_notifier_item_unregistered.connect((id)=>{watcher_item_removed(id);}); } catch (Error e) { stderr.printf("%s\n",e.message); return; } } construct { is_nested_watcher = true; watcher_registered = false; create_nested_watcher(); } ~Host() { if (is_nested_watcher) Bus.unown_name(owned_name); else Bus.unwatch_name(watched_name); } } } xfce4-sntray-plugin-0.4.13.1/src/sni-enums.c.template000066400000000000000000000033671370304200600222500ustar00rootroot00000000000000/*** BEGIN file-header ***/ #include "sni-enums.h" /*** END file-header ***/ /*** BEGIN file-production ***/ /* enumerations from "@filename@" */ #include "@filename@" /*** END file-production ***/ /*** BEGIN value-header ***/ GType @enum_name@_get_type (void) { static GType the_type = 0; if (the_type == 0) { static const G@Type@Value values[] = { /*** END value-header ***/ /*** BEGIN value-production ***/ { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, /*** END value-production ***/ /*** BEGIN value-tail ***/ { 0, NULL, NULL } }; the_type = g_@type@_register_static ( g_intern_static_string ("@EnumName@"), values); } return the_type; } /** @enum_name@_get_nick: @value: The value of @EnumName@ to get the nick of Looks up in the enum table for the nick of @value. Return value: The nick for the given value or #NULL on error */ const char * @enum_name@_get_nick (@EnumName@ value) { GEnumClass * class = G_ENUM_CLASS(g_type_class_ref(@enum_name@_get_type())); g_return_val_if_fail(class != NULL, NULL); const char * ret = NULL; GEnumValue * val = g_enum_get_value(class, value); if (val != NULL) { ret = val->value_nick; } g_type_class_unref(class); return ret; } /** @enum_name@_get_value_from_nick: @nick: The enum nick to lookup Looks up in the enum table for the value of @nick. Return value: The value for the given @nick */ @EnumName@ @enum_name@_get_value_from_nick (const char * nick) { GEnumClass * class = G_ENUM_CLASS(g_type_class_ref(@enum_name@_get_type())); g_return_val_if_fail(class != NULL, 0); @EnumName@ ret = 0; GEnumValue * val = g_enum_get_value_by_nick(class, nick); if (val != NULL) { ret = val->value; } g_type_class_unref(class); return ret; } /*** END value-tail ***/ xfce4-sntray-plugin-0.4.13.1/src/sni-enums.h.template000066400000000000000000000013041370304200600222420ustar00rootroot00000000000000/*** BEGIN file-header ***/ #ifndef VALA_PANEL_ENUM_TYPES_H #define VALA_PANEL_ENUM_TYPES_H #include G_BEGIN_DECLS /*** END file-header ***/ /*** BEGIN file-production ***/ /* Enumerations from "@filename@" */ #include "@basename@" /*** END file-production ***/ /*** BEGIN enumeration-production ***/ #define SN_TYPE_@ENUMSHORT@ (@enum_name@_get_type()) GType @enum_name@_get_type (void) G_GNUC_CONST; const char * @enum_name@_get_nick (@EnumName@ value) G_GNUC_CONST; @EnumName@ @enum_name@_get_value_from_nick (const char * nick) G_GNUC_CONST; /*** END enumeration-production ***/ /*** BEGIN file-tail ***/ G_END_DECLS #endif /* VALA_PANEL_ENUM_TYPES_H */ /*** END file-tail ***/ xfce4-sntray-plugin-0.4.13.1/src/snitembox.vala000066400000000000000000000157141370304200600212300ustar00rootroot00000000000000/* * xfce4-sntray-plugin * Copyright (C) 2015-2017 Konstantin Pugin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ using Gtk; using GLib; namespace StatusNotifier { public const string SHOW_APPS = "show-application-status"; public const string SHOW_COMM = "show-communications"; public const string SHOW_SYS = "show-system"; public const string SHOW_HARD = "show-hardware"; public const string SHOW_OTHER = "show-other"; public const string SHOW_PASSIVE = "show-passive"; public const string INDICATOR_SIZE = "indicator-size"; public const string USE_SYMBOLIC = "symbolic-icons"; public const string USE_LABELS = "show-ayatana-labels"; public const string INDEX_OVERRIDE = "index-override"; public const string FILTER_OVERRIDE = "filter-override"; public class ItemBox : FlowBox { static Host host; ulong watcher_registration_handler; internal HashTable items {get; private set;} public HashTable index_override {get; set;} public HashTable filter_override {get; set;} public bool symbolic_icons {get; set;} public bool show_application_status {get; set;} public bool show_communications {get; set;} public bool show_system {get; set;} public bool show_hardware {get; set;} public bool show_other {get; set;} public bool show_passive {get; set;} public int indicator_size {get; set;} public bool show_ayatana_labels {get; set;} internal signal void item_added(string id); internal signal void item_removed(string id); static construct { host = new Host("org.kde.StatusNotifierHost-itembox%d".printf(Gdk.CURRENT_TIME)); } construct { items = new HashTable(str_hash, str_equal); index_override = new HashTable(str_hash,str_equal); filter_override = new HashTable(str_hash,str_equal); show_application_status = true; show_communications = true; show_system = true; show_hardware = true; show_passive = false; child_activated.connect((ch)=>{ select_child(ch); (ch as Item).context_menu(); }); notify.connect((pspec)=>{ if (pspec.name == "index-override") invalidate_sort(); else invalidate_filter(); }); set_sort_func(sort_cb); set_filter_func(filter_cb); host.watcher_item_added.connect((item)=>{ string[] np = item.split("/",2); if (!items.contains(item)) { var snitem = new Item(np[0],(ObjectPath)("/"+np[1])); items.insert(item, snitem); this.add(snitem); } }); host.watcher_item_removed.connect((item)=>{ unowned Item child = items.lookup(item); if (child != null) { item_removed(child.id); child.destroy(); items.remove(item); } }); watcher_registration_handler = host.notify["watcher-registered"].connect(()=>{ if (host.watcher_registered) { recreate_items(); SignalHandler.disconnect(host,watcher_registration_handler); } }); if (host.watcher_registered) { recreate_items(); SignalHandler.disconnect(host,watcher_registration_handler); } } public ItemBox() { Object(orientation: Orientation.HORIZONTAL, selection_mode: SelectionMode.SINGLE, activate_on_single_click: true); } private void recreate_items() { string[] new_items = host.watcher_items(); foreach (var item in new_items) { string[] np = item.split("/",2); if (!items.contains(item)) { var snitem = new Item(np[0],(ObjectPath)("/"+np[1])); items.insert(item, snitem); this.add(snitem); } } } internal bool filter_cb(FlowBoxChild ch) { unowned Item item = ch as Item; if (item.id != null && filter_override.contains(item.id)) return filter_override.lookup(item.id).get_boolean(); if (!show_passive && item.status == Status.PASSIVE) return false; if (show_application_status && item.cat == Category.APPLICATION) return true; if (show_communications && item.cat == Category.COMMUNICATIONS) return true; if (show_system && item.cat == Category.SYSTEM) return true; if (show_hardware && item.cat == Category.HARDWARE) return true; if (show_other && item.cat == Category.OTHER) return true; return false; } private int sort_cb(FlowBoxChild ch1, FlowBoxChild ch2) { unowned Item left = ch1 as Item; unowned Item right = ch2 as Item; int lpos = (int)left.ordering_index; int rpos = (int)right.ordering_index; if (left.id != null && index_override.contains(left.id)) lpos = index_override.lookup(left.id).get_int32(); if (right.id != null && index_override.contains(right.id)) rpos = index_override.lookup(right.id).get_int32(); return lpos - rpos; } internal int get_index(Item v) { var over_index = index_override.contains(v.id); int index = (int)v.ordering_index; if (over_index) index = index_override.lookup(v.id).get_int32(); return index; } internal unowned Item? get_item_by_id(string id) { unowned Item? item = null; items.foreach((k,v)=>{ if (v.id == id) { item = v; return; } }); return item; } } } xfce4-sntray-plugin-0.4.13.1/src/snproxy.c000066400000000000000000001006331370304200600202340ustar00rootroot00000000000000/* * xfce4-sntray-plugin * Copyright (C) 2019 Konstantin Pugin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ #include "snproxy.h" #include "icon-pixmap.h" #include "sni-enums.h" #include #include struct _SnProxy { GObject __parent__; bool started; bool initialized; GCancellable *cancellable; GDBusProxy *item_proxy; GDBusProxy *properties_proxy; uint properties_timeout; /* Exposed as properties */ char *bus_name; char *object_path; char *id; char *title; SnCategory category; SnStatus status; char *x_ayatana_label; char *x_ayatana_label_guide; GIcon *icon; GIcon *attention_icon; char *icon_theme_path; char *tooltip_text; GIcon *tooltip_icon; char *menu_object_path; uint x_ayatana_ordering_index; /* Internal now */ char *icon_desc; char *attention_desc; int icon_size; bool item_is_menu; GtkIconTheme *theme; bool use_symbolic; }; G_DEFINE_TYPE(SnProxy, sn_proxy, G_TYPE_OBJECT) enum { PROP_0, PROP_BUS_NAME, PROP_OBJECT_PATH, PROP_ICON_SIZE, PROP_SYMBOLIC, PROP_ID, PROP_TITLE, PROP_CATEGORY, PROP_STATUS, PROP_DESC, PROP_ICON, PROP_TOOLTIP_TEXT, PROP_TOOLTIP_ICON, PROP_MENU_OBJECT_PATH, PROP_LABEL, PROP_LABEL_GUIDE, PROP_ORDERING_INDEX, PROP_LAST }; enum { INITIALIZED, FAIL, LAST_SIGNAL }; static GParamSpec *pspecs[PROP_LAST]; static uint signals[LAST_SIGNAL] = { 0 }; void sn_proxy_reload(SnProxy *self); static void sn_proxy_finalize(GObject *object); static void sn_proxy_get_property(GObject *object, uint prop_id, GValue *value, GParamSpec *pspec); static void sn_proxy_set_property(GObject *object, uint prop_id, const GValue *value, GParamSpec *pspec); typedef struct { GDBusConnection *connection; uint handler; } SubscriptionContext; static void sn_proxy_class_init(SnProxyClass *klass) { GObjectClass *oclass = G_OBJECT_CLASS(klass); oclass->finalize = sn_proxy_finalize; oclass->get_property = sn_proxy_get_property; oclass->set_property = sn_proxy_set_property; pspecs[PROP_BUS_NAME] = g_param_spec_string(PROXY_PROP_BUS_NAME, PROXY_PROP_BUS_NAME, PROXY_PROP_BUS_NAME, NULL, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); pspecs[PROP_OBJECT_PATH] = g_param_spec_string(PROXY_PROP_OBJ_PATH, PROXY_PROP_OBJ_PATH, PROXY_PROP_OBJ_PATH, NULL, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); pspecs[PROP_ICON_SIZE] = g_param_spec_int(PROXY_PROP_ICON_SIZE, PROXY_PROP_ICON_SIZE, PROXY_PROP_ICON_SIZE, 0, 256, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS); pspecs[PROP_SYMBOLIC] = g_param_spec_boolean(PROXY_PROP_SYMBOLIC, PROXY_PROP_SYMBOLIC, PROXY_PROP_SYMBOLIC, true, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS); pspecs[PROP_CATEGORY] = g_param_spec_enum(PROXY_PROP_CATEGORY, PROXY_PROP_CATEGORY, PROXY_PROP_CATEGORY, sn_category_get_type(), SN_CATEGORY_APPLICATION, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); pspecs[PROP_STATUS] = g_param_spec_enum(PROXY_PROP_STATUS, PROXY_PROP_STATUS, PROXY_PROP_STATUS, sn_status_get_type(), SN_STATUS_PASSIVE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); pspecs[PROP_ID] = g_param_spec_string(PROXY_PROP_ID, PROXY_PROP_ID, PROXY_PROP_ID, NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); pspecs[PROP_TITLE] = g_param_spec_string(PROXY_PROP_TITLE, PROXY_PROP_TITLE, PROXY_PROP_TITLE, NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); pspecs[PROP_DESC] = g_param_spec_string(PROXY_PROP_DESC, PROXY_PROP_DESC, PROXY_PROP_DESC, NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); pspecs[PROP_ICON] = g_param_spec_object(PROXY_PROP_ICON, PROXY_PROP_ICON, PROXY_PROP_ICON, G_TYPE_ICON, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); pspecs[PROP_TOOLTIP_TEXT] = g_param_spec_string(PROXY_PROP_TOOLTIP_TITLE, PROXY_PROP_TOOLTIP_TITLE, PROXY_PROP_TOOLTIP_TITLE, NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); pspecs[PROP_TOOLTIP_ICON] = g_param_spec_object(PROXY_PROP_TOOLTIP_ICON, PROXY_PROP_TOOLTIP_ICON, PROXY_PROP_TOOLTIP_ICON, G_TYPE_ICON, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); pspecs[PROP_MENU_OBJECT_PATH] = g_param_spec_string(PROXY_PROP_MENU_OBJECT_PATH, PROXY_PROP_MENU_OBJECT_PATH, PROXY_PROP_MENU_OBJECT_PATH, NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); pspecs[PROP_LABEL] = g_param_spec_string(PROXY_PROP_LABEL, PROXY_PROP_LABEL, PROXY_PROP_LABEL, NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); pspecs[PROP_LABEL_GUIDE] = g_param_spec_string(PROXY_PROP_LABEL_GUIDE, PROXY_PROP_LABEL_GUIDE, PROXY_PROP_LABEL_GUIDE, NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); pspecs[PROP_ORDERING_INDEX] = g_param_spec_uint(PROXY_PROP_ORDERING_INDEX, PROXY_PROP_ORDERING_INDEX, PROXY_PROP_ORDERING_INDEX, 0, G_MAXUINT, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_properties(oclass, PROP_LAST, pspecs); signals[FAIL] = g_signal_new(g_intern_static_string(PROXY_SIGNAL_FAIL), G_TYPE_FROM_CLASS(oclass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); signals[INITIALIZED] = g_signal_new(g_intern_static_string(PROXY_SIGNAL_INITIALIZED), G_TYPE_FROM_CLASS(oclass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); } static void sn_proxy_init(SnProxy *self) { self->started = false; self->initialized = false; self->cancellable = g_cancellable_new(); self->item_proxy = NULL; self->properties_proxy = NULL; self->properties_timeout = 0; self->bus_name = NULL; self->object_path = NULL; self->id = NULL; self->category = SN_CATEGORY_APPLICATION; self->status = SN_STATUS_PASSIVE; self->attention_icon = NULL; self->icon = NULL; self->icon_theme_path = NULL; self->tooltip_text = NULL; self->tooltip_icon = NULL; self->menu_object_path = NULL; self->x_ayatana_label = NULL; self->x_ayatana_label_guide = NULL; self->x_ayatana_ordering_index = 0; self->title = NULL; self->icon_desc = NULL; self->attention_desc = NULL; self->theme = gtk_icon_theme_get_default(); /*DBusMenu ones is much more likely than Activate ones */ self->item_is_menu = true; } static void sn_proxy_finalize(GObject *object) { SnProxy *self = SN_PROXY(object); g_clear_object(&self->cancellable); if (self->properties_timeout != 0) g_source_remove(self->properties_timeout); if (GTK_IS_ICON_THEME(self->theme)) g_signal_handlers_disconnect_by_data(self->theme, self); if (self->item_proxy) g_signal_handlers_disconnect_by_data(self->item_proxy, self); g_clear_object(&self->properties_proxy); g_clear_object(&self->item_proxy); g_clear_pointer(&self->bus_name, g_free); g_clear_pointer(&self->object_path, g_free); g_clear_pointer(&self->id, g_free); g_clear_object(&self->icon); g_clear_object(&self->attention_icon); g_clear_pointer(&self->icon_theme_path, g_free); g_clear_pointer(&self->tooltip_text, g_free); g_clear_object(&self->tooltip_icon); g_clear_pointer(&self->menu_object_path, g_free); g_clear_pointer(&self->x_ayatana_label, g_free); g_clear_pointer(&self->x_ayatana_label_guide, g_free); g_clear_pointer(&self->title, g_free); g_clear_pointer(&self->icon_desc, g_free); g_clear_pointer(&self->attention_desc, g_free); G_OBJECT_CLASS(sn_proxy_parent_class)->finalize(object); } static void sn_proxy_get_property(GObject *object, uint prop_id, GValue *value, GParamSpec *pspec) { SnProxy *self = SN_PROXY(object); bool is_attention = self->status == SN_STATUS_ATTENTION; switch (prop_id) { case PROP_ID: g_value_set_string(value, self->id); break; case PROP_TITLE: g_value_set_string(value, self->title); break; case PROP_CATEGORY: g_value_set_enum(value, self->category); break; case PROP_STATUS: g_value_set_enum(value, self->status); break; case PROP_SYMBOLIC: g_value_set_uint(value, self->use_symbolic); break; case PROP_ICON_SIZE: g_value_set_int(value, self->icon_size); break; case PROP_DESC: g_value_set_string(value, is_attention && !string_empty(self->attention_desc) ? self->attention_desc : self->icon_desc); break; case PROP_ICON: g_value_set_object(value, is_attention && self->attention_icon ? self->attention_icon : self->icon); break; case PROP_TOOLTIP_TEXT: if (!string_empty(self->tooltip_text)) g_value_set_string(value, self->tooltip_text); else if (!string_empty(self->attention_desc) && is_attention) g_value_set_string(value, self->attention_desc); else if (!string_empty(self->icon_desc)) g_value_set_string(value, self->icon_desc); else if (!string_empty(self->title)) g_value_set_string(value, self->title); break; case PROP_TOOLTIP_ICON: if (self->tooltip_icon) g_value_set_object(value, self->tooltip_icon); else if (self->attention_icon && is_attention) g_value_set_object(value, self->attention_icon); else if (self->icon) g_value_set_object(value, self->icon); break; case PROP_LABEL: g_value_set_string(value, self->x_ayatana_label); break; case PROP_LABEL_GUIDE: g_value_set_string(value, self->x_ayatana_label_guide); break; case PROP_ORDERING_INDEX: g_value_set_uint(value, self->x_ayatana_ordering_index); break; case PROP_MENU_OBJECT_PATH: g_value_set_string(value, self->menu_object_path); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void sn_proxy_set_property(GObject *object, uint prop_id, const GValue *value, GParamSpec *pspec) { SnProxy *self = SN_PROXY(object); switch (prop_id) { case PROP_BUS_NAME: g_free(self->bus_name); self->bus_name = g_value_dup_string(value); break; case PROP_OBJECT_PATH: g_free(self->object_path); self->object_path = g_value_dup_string(value); break; case PROP_ICON_SIZE: if (self->icon_size != g_value_get_int(value)) { self->icon_size = g_value_get_int(value); if (self->initialized) sn_proxy_reload(self); } break; case PROP_SYMBOLIC: if (self->use_symbolic != g_value_get_boolean(value)) { self->use_symbolic = g_value_get_boolean(value); if (self->initialized) sn_proxy_reload(self); } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void sn_proxy_unsubscribe(void *data, GObject *unused) { SubscriptionContext *context = data; g_dbus_connection_signal_unsubscribe(context->connection, context->handler); g_clear_pointer(&context, g_free); } static void sn_proxy_name_owner_changed(GDBusConnection *connection, const char *sender_name, const char *object_path, const char *interface_name, const char *signal_name, GVariant *parameters, void *user_data) { SnProxy *self = user_data; g_autofree char *new_owner = NULL; g_variant_get(parameters, "(sss)", NULL, NULL, &new_owner); if (string_empty(new_owner)) g_signal_emit(self, signals[FAIL], 0); } static GIcon *sn_proxy_load_icon(SnProxy *self, const char *icon_name, IconPixmap *pixmap, const char *overlay, IconPixmap *opixmap) { g_autoptr(GIcon) tmp_main_icon = icon_pixmap_select_icon(icon_name, pixmap, self->theme, self->icon_theme_path, self->icon_size, self->use_symbolic); g_autoptr(GIcon) tmp_overlay_icon = icon_pixmap_select_icon(overlay, opixmap, self->theme, self->icon_theme_path, self->icon_size / 4, self->use_symbolic); g_autoptr(GEmblem) overlay_icon = NULL; g_autoptr(GIcon) icon = NULL; if (tmp_overlay_icon) overlay_icon = g_emblem_new(tmp_overlay_icon); if (tmp_main_icon) icon = g_emblemed_icon_new(tmp_main_icon, overlay_icon); if (!icon) return NULL; return g_object_ref(icon); } static void sn_proxy_reload_finish(GObject *source_object, GAsyncResult *res, gpointer user_data) { if (!SN_IS_PROXY(user_data)) return; SnProxy *self = SN_PROXY(user_data); bool update_tooltip = false; bool update_icon = false; bool update_attention_icon = false; bool update_desc = false; bool update_menu = false; ToolTip *new_tooltip = NULL; g_autofree char *icon_name = NULL; g_autofree char *att_name = NULL; g_autofree char *overlay_name = NULL; IconPixmap *icon_pixmap = NULL; IconPixmap *att_pixmap = NULL; IconPixmap *overlay_pixmap = NULL; g_autoptr(GError) error = NULL; g_autoptr(GVariant) properties = g_dbus_proxy_call_finish(G_DBUS_PROXY(source_object), res, &error); if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) return; if (!properties) { g_signal_emit(self, signals[FAIL], 0); return; } GVariantIter *iter; g_variant_get(properties, "(a{sv})", &iter); char *name; GVariant *value; while (g_variant_iter_loop(iter, "{&sv}", &name, &value)) { if (!g_strcmp0(name, "XAyatanaLabel")) { if (g_strcmp0(g_variant_get_string(value, NULL), self->x_ayatana_label)) { g_clear_pointer(&self->x_ayatana_label, g_free); self->x_ayatana_label = g_variant_dup_string(value, NULL); g_object_notify_by_pspec(G_OBJECT(self), pspecs[PROP_LABEL]); } } else if (!g_strcmp0(name, "XAyatanaLabelGuide")) { if (g_strcmp0(g_variant_get_string(value, NULL), self->x_ayatana_label_guide)) { g_clear_pointer(&self->x_ayatana_label_guide, g_free); self->x_ayatana_label_guide = g_variant_dup_string(value, NULL); g_object_notify_by_pspec(G_OBJECT(self), pspecs[PROP_LABEL_GUIDE]); } } else if (!g_strcmp0(name, "XAyatanaOrderingIndex")) { if (g_variant_get_uint32(value) != self->x_ayatana_ordering_index) { self->x_ayatana_ordering_index = g_variant_get_uint32(value); g_object_notify_by_pspec(G_OBJECT(self), pspecs[PROP_ORDERING_INDEX]); } } else if (!g_strcmp0(name, "Category")) { SnCategory new_cat = sn_category_get_value_from_nick(g_variant_get_string(value, NULL)); if (self->category != new_cat) g_object_notify_by_pspec(G_OBJECT(self), pspecs[PROP_CATEGORY]); } else if (!g_strcmp0(name, "Id")) { if (!self->id || g_strcmp0(g_variant_get_string(value, NULL), self->id)) { g_clear_pointer(&self->id, g_free); self->id = g_variant_dup_string(value, NULL); g_object_notify_by_pspec(G_OBJECT(self), pspecs[PROP_ID]); } } else if (!g_strcmp0(name, "Status")) { SnStatus new_st = sn_status_get_value_from_nick(g_variant_get_string(value, NULL)); if (self->status != new_st) { self->status = new_st; g_object_notify_by_pspec(G_OBJECT(self), pspecs[PROP_STATUS]); } } else if (!g_strcmp0(name, "Title")) { if (g_strcmp0(g_variant_get_string(value, NULL), self->title)) { g_clear_pointer(&self->title, g_free); self->title = g_variant_dup_string(value, NULL); g_object_notify_by_pspec(G_OBJECT(self), pspecs[PROP_TITLE]); update_tooltip = true; } } else if (!g_strcmp0(name, "Menu")) { if (g_strcmp0(g_variant_get_string(value, NULL), self->menu_object_path)) { g_clear_pointer(&self->menu_object_path, g_free); self->menu_object_path = g_variant_dup_string(value, NULL); update_menu = true; } } else if (!g_strcmp0(name, "ItemIsMenu")) { if (g_variant_get_boolean(value) != self->item_is_menu) { self->item_is_menu = g_variant_get_boolean(value); update_menu = true; } } else if (!g_strcmp0(name, "IconAccessibleDesc")) { if (g_strcmp0(g_variant_get_string(value, NULL), self->icon_desc)) { g_clear_pointer(&self->icon_desc, g_free); self->icon_desc = g_variant_dup_string(value, NULL); update_desc = true; update_tooltip = true; } } else if (!g_strcmp0(name, "AttentionAccessibleDesc")) { if (g_strcmp0(g_variant_get_string(value, NULL), self->attention_desc)) { g_clear_pointer(&self->attention_desc, g_free); self->attention_desc = g_variant_dup_string(value, NULL); if (self->status == SN_STATUS_ATTENTION) { update_desc = true; update_tooltip = true; } } } else if (!g_strcmp0(name, "IconThemePath")) { if (g_strcmp0(g_variant_get_string(value, NULL), self->icon_theme_path)) { g_clear_pointer(&self->icon_theme_path, g_free); self->icon_theme_path = g_variant_dup_string(value, NULL); gtk_icon_theme_append_search_path(self->theme, self->icon_theme_path); update_icon = true; update_attention_icon = true; } } else if (!g_strcmp0(name, "IconName")) { icon_name = g_variant_dup_string(value, NULL); update_icon = true; } else if (!g_strcmp0(name, "AttentionIconName")) { att_name = g_variant_dup_string(value, NULL); update_attention_icon = true; } else if (!g_strcmp0(name, "OverlayIconName")) { overlay_name = g_variant_dup_string(value, NULL); update_icon = true; update_attention_icon = true; } else if (!g_strcmp0(name, "IconPixmap")) { icon_pixmap = icon_pixmap_new_with_size(value, self->icon_size); update_icon = true; } else if (!g_strcmp0(name, "AttentionIconPixmap")) { att_pixmap = icon_pixmap_new_with_size(value, self->icon_size); update_attention_icon = true; } else if (!g_strcmp0(name, "OverlayIconPixmap")) { overlay_pixmap = icon_pixmap_new_with_size(value, self->icon_size); update_icon = true; update_attention_icon = true; } else if (!g_strcmp0(name, "ToolTip")) { new_tooltip = tooltip_new(value); update_tooltip = true; } } g_clear_pointer(&iter, g_variant_iter_free); g_clear_pointer(&name, g_free); g_clear_pointer(&value, g_variant_unref); if (update_desc) g_object_notify_by_pspec(G_OBJECT(self), pspecs[PROP_DESC]); if (update_menu) g_object_notify_by_pspec(G_OBJECT(self), pspecs[PROP_MENU_OBJECT_PATH]); if (update_tooltip) { char *markup = NULL; GIcon *icon = NULL; bool notify_text = false; bool notify_icon = false; if (new_tooltip) { unbox_tooltip(new_tooltip, self->theme, self->icon_theme_path, &icon, &markup); g_clear_pointer(&new_tooltip, tooltip_free); } if (g_strcmp0(markup, self->tooltip_text)) notify_text = true; if (!g_icon_equal(self->tooltip_icon, icon)) notify_icon = true; g_clear_pointer(&self->tooltip_text, g_free); self->tooltip_text = markup; g_clear_object(&self->tooltip_icon); self->tooltip_icon = icon; if (notify_text) g_object_notify_by_pspec(G_OBJECT(self), pspecs[PROP_TOOLTIP_TEXT]); if (notify_icon) g_object_notify_by_pspec(G_OBJECT(self), pspecs[PROP_TOOLTIP_ICON]); } if (update_icon) { g_autoptr(GIcon) new_icon = sn_proxy_load_icon(self, icon_name, icon_pixmap, overlay_name, overlay_pixmap); if (!g_icon_equal(self->icon, new_icon)) { g_clear_object(&self->icon); self->icon = g_object_ref(new_icon); g_object_notify_by_pspec(G_OBJECT(self), pspecs[PROP_ICON]); } } if (update_attention_icon) { g_autoptr(GIcon) new_icon = sn_proxy_load_icon(self, att_name, att_pixmap, overlay_name, overlay_pixmap); if (!g_icon_equal(self->attention_icon, new_icon)) { g_clear_object(&self->attention_icon); self->attention_icon = g_object_ref(new_icon); if (self->status == SN_STATUS_ATTENTION) g_object_notify_by_pspec(G_OBJECT(self), pspecs[PROP_ICON]); } } g_clear_pointer(&icon_pixmap, icon_pixmap_free); g_clear_pointer(&att_pixmap, icon_pixmap_free); g_clear_pointer(&overlay_pixmap, icon_pixmap_free); if (!self->initialized) { if (self->id != NULL) { self->initialized = true; g_signal_connect_swapped(self->theme, "changed", G_CALLBACK(sn_proxy_reload), self); g_signal_emit(self, signals[INITIALIZED], 0); } } } static int sn_proxy_reload_begin(gpointer user_data) { SnProxy *self = user_data; self->properties_timeout = 0; g_dbus_proxy_call(self->properties_proxy, "GetAll", g_variant_new("(s)", "org.kde.StatusNotifierItem"), G_DBUS_CALL_FLAGS_NONE, -1, self->cancellable, sn_proxy_reload_finish, self); return G_SOURCE_REMOVE; } void sn_proxy_reload(SnProxy *self) { g_return_if_fail(SN_IS_PROXY(self)); g_return_if_fail(self->properties_proxy != NULL); /* same approach as in Plasma Workspace */ if (self->properties_timeout != 0) g_source_remove(self->properties_timeout); self->properties_timeout = g_timeout_add(10, sn_proxy_reload_begin, self); } static void sn_proxy_properties_callback(GObject *source_object, GAsyncResult *res, gpointer user_data) { if (!SN_IS_PROXY(user_data)) return; SnProxy *self = SN_PROXY(user_data); g_autoptr(GError) error = NULL; self->properties_proxy = g_dbus_proxy_new_for_bus_finish(res, &error); if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) return; if (self->properties_proxy == NULL) { g_signal_emit(self, signals[FAIL], 0); return; } sn_proxy_reload(self); } static void sn_proxy_signal_received(GDBusProxy *proxy, gchar *sender_name, gchar *signal_name, GVariant *parameters, gpointer user_data) { SnProxy *self = SN_PROXY(user_data); if (!self->initialized) return; if (!g_strcmp0(signal_name, "NewTitle") || !g_strcmp0(signal_name, "NewIcon") || !g_strcmp0(signal_name, "NewAttentionIcon") || !g_strcmp0(signal_name, "NewOverlayIcon") || !g_strcmp0(signal_name, "NewToolTip")) { // Reload all properties in async mode. sn_proxy_reload(self); } else if (!g_strcmp0(signal_name, "NewStatus")) { // Just notify for status change, requires fast reaction. g_autofree char *status = NULL; g_variant_get(parameters, "(s)", &status); self->status = sn_status_get_value_from_nick(status); g_object_notify_by_pspec(G_OBJECT(self), pspecs[PROP_STATUS]); } } static void sn_proxy_item_callback(GObject *source_object, GAsyncResult *res, gpointer user_data) { if (!SN_IS_PROXY(user_data)) return; SnProxy *self = SN_PROXY(user_data); g_autoptr(GError) error = NULL; self->item_proxy = g_dbus_proxy_new_for_bus_finish(res, &error); if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) return; if (self->item_proxy == NULL) { g_signal_emit(G_OBJECT(self), signals[FAIL], 0); return; } SubscriptionContext *context = g_new0(SubscriptionContext, 1); context->connection = g_dbus_proxy_get_connection(self->item_proxy); context->handler = g_dbus_connection_signal_subscribe(g_dbus_proxy_get_connection(self->item_proxy), "org.freedesktop.DBus", "org.freedesktop.DBus", "NameOwnerChanged", "/org/freedesktop/DBus", g_dbus_proxy_get_name(self->item_proxy), G_DBUS_SIGNAL_FLAGS_NONE, sn_proxy_name_owner_changed, self, NULL); g_object_weak_ref(G_OBJECT(self->item_proxy), sn_proxy_unsubscribe, context); g_signal_connect(self->item_proxy, "g-signal", G_CALLBACK(sn_proxy_signal_received), self); g_dbus_proxy_new(g_dbus_proxy_get_connection(self->item_proxy), G_DBUS_PROXY_FLAGS_NONE, NULL, self->bus_name, self->object_path, "org.freedesktop.DBus.Properties", self->cancellable, sn_proxy_properties_callback, self); } static int sn_proxy_start_failed(void *user_data) { SnProxy *self = user_data; /* start is failed, emit the signel in next loop iteration */ g_signal_emit(G_OBJECT(self), signals[FAIL], 0); return G_SOURCE_REMOVE; } SnProxy *sn_proxy_new(const char *bus_name, const char *object_path) { return SN_PROXY(g_object_new(sn_proxy_get_type(), PROXY_PROP_BUS_NAME, bus_name, PROXY_PROP_OBJ_PATH, object_path, NULL)); } void sn_proxy_start(SnProxy *self) { g_return_if_fail(SN_IS_PROXY(self)); g_return_if_fail(!self->started); if (!g_dbus_is_name(self->bus_name)) { g_idle_add(sn_proxy_start_failed, self); return; } self->started = true; g_dbus_proxy_new_for_bus(G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_NONE, NULL, self->bus_name, self->object_path, "org.kde.StatusNotifierItem", self->cancellable, sn_proxy_item_callback, self); } void sn_proxy_context_menu(SnProxy *self, int x_root, int y_root) { g_return_if_fail(SN_IS_PROXY(self)); g_return_if_fail(self->initialized); g_return_if_fail(self->item_proxy != NULL); g_dbus_proxy_call(self->item_proxy, "ContextMenu", g_variant_new("(ii)", x_root, y_root), G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, NULL); } void sn_proxy_activate(SnProxy *self, int x_root, int y_root) { g_return_if_fail(SN_IS_PROXY(self)); g_return_if_fail(self->initialized); g_return_if_fail(self->item_proxy != NULL); g_dbus_proxy_call(self->item_proxy, "Activate", g_variant_new("(ii)", x_root, y_root), G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, NULL); } void sn_proxy_secondary_activate(SnProxy *self, int x_root, int y_root) { g_return_if_fail(SN_IS_PROXY(self)); g_return_if_fail(self->initialized); g_return_if_fail(self->item_proxy != NULL); g_dbus_proxy_call(self->item_proxy, "SecondaryActivate", g_variant_new("(ii)", x_root, y_root), G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, NULL); } bool sn_proxy_ayatana_secondary_activate(SnProxy *self, u_int32_t event_time) { g_return_val_if_fail(SN_IS_PROXY(self), false); g_return_val_if_fail(self->initialized, false); g_return_val_if_fail(self->item_proxy != NULL, false); g_autoptr(GError) err = NULL; g_dbus_proxy_call_sync(self->item_proxy, "XAyatanaSecondaryActivate", g_variant_new("(u)", event_time), G_DBUS_CALL_FLAGS_NONE, -1, NULL, &err); if (err) return false; return true; } void sn_proxy_scroll(SnProxy *self, int delta_x, int delta_y) { g_return_if_fail(SN_IS_PROXY(self)); g_return_if_fail(self->initialized); g_return_if_fail(self->item_proxy != NULL); if (delta_x != 0) { g_dbus_proxy_call(self->item_proxy, "Scroll", g_variant_new("(is)", delta_x, "horizontal"), G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, NULL); } if (delta_y != 0) { g_dbus_proxy_call(self->item_proxy, "Scroll", g_variant_new("(is)", delta_y, "vertical"), G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, NULL); } } xfce4-sntray-plugin-0.4.13.1/src/snproxy.h000066400000000000000000000051721370304200600202430ustar00rootroot00000000000000/* * xfce4-sntray-plugin * Copyright (C) 2019 Konstantin Pugin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ #ifndef __SN_PROXY_H__ #define __SN_PROXY_H__ #include #include G_BEGIN_DECLS #define PROXY_PROP_BUS_NAME "bus-name" #define PROXY_PROP_OBJ_PATH "object-path" #define PROXY_PROP_ID "id" #define PROXY_PROP_TITLE "title" #define PROXY_PROP_CATEGORY "category" #define PROXY_PROP_STATUS "status" #define PROXY_PROP_LABEL "x-ayatana-label" #define PROXY_PROP_LABEL_GUIDE "x-ayatana-label-guide" #define PROXY_PROP_DESC "accessible-desc" #define PROXY_PROP_ICON "icon" #define PROXY_PROP_ICON_SIZE "icon-size" #define PROXY_PROP_SYMBOLIC "use-symbolic" #define PROXY_PROP_TOOLTIP_TITLE "tooltip-text" #define PROXY_PROP_TOOLTIP_ICON "tooltip-icon" #define PROXY_PROP_MENU_OBJECT_PATH "menu" #define PROXY_PROP_ORDERING_INDEX "x-ayatana-ordering-index" #define PROXY_SIGNAL_FAIL "fail" #define PROXY_SIGNAL_INITIALIZED "initialized" #define PROXY_DBUS_IFACE_DEFAULT "org.freedesktop.DBus" #define PROXY_DBUS_PATH_DEFAULT "/org/freedesktop/DBus" #define PROXY_DBUS_IFACE_PROPS "org.freedesktop.DBus.Properties" #define PROXY_DBUS_IFACE_KDE "org.kde.StatusNotifierItem" #define PROXY_SIGNAL_NAME_OWNER_CHANGED "NameOwnerChanged" #define PROXY_KDE_METHOD_GET_ALL "GetAll" G_DECLARE_FINAL_TYPE(SnProxy, sn_proxy, SN, PROXY, GObject) G_GNUC_INTERNAL SnProxy *sn_proxy_new(const char *bus_name, const char *object_path); G_GNUC_INTERNAL void sn_proxy_start(SnProxy *self); G_GNUC_INTERNAL void sn_proxy_reload(SnProxy *self); G_GNUC_INTERNAL void sn_proxy_context_menu(SnProxy *self, gint x_root, gint y_root); G_GNUC_INTERNAL void sn_proxy_activate(SnProxy *self, gint x_root, gint y_root); G_GNUC_INTERNAL void sn_proxy_secondary_activate(SnProxy *self, gint x_root, gint y_root); G_GNUC_INTERNAL bool sn_proxy_ayatana_secondary_activate(SnProxy *self, u_int32_t event_time); G_GNUC_INTERNAL void sn_proxy_scroll(SnProxy *self, gint delta_x, gint delta_y); G_END_DECLS #endif /* !__SN_ITEM_H__ */ xfce4-sntray-plugin-0.4.13.1/src/sntray-backend.vapi000066400000000000000000000052221370304200600221320ustar00rootroot00000000000000/* * xfce4-sntray-plugin * Copyright (C) 2019 Konstantin Pugin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ using GLib; [CCode(cprefix="Sn",lower_case_cprefix="sn_")] namespace StatusNotifier { [CCode(cheader_filename="sni-enums.h")] public enum Category { APPLICATION, COMMUNICATIONS, SYSTEM, HARDWARE, OTHER } [CCode(cheader_filename="sni-enums.h")] public enum Status { PASSIVE, ACTIVE, ATTENTION, } [CCode(cheader_filename="snproxy.h")] public class Proxy: GLib.Object { [NoAccessorMethod] public string bus_name {construct;} [NoAccessorMethod] public string object_path {construct;} [NoAccessorMethod] public int icon_size {get; set construct;} [NoAccessorMethod] public bool use_symbolic {get; set construct;} /* Base properties */ [NoAccessorMethod] public Category category {get;} [NoAccessorMethod] public string id {owned get;} [NoAccessorMethod] public string title {owned get;} [NoAccessorMethod] public Status status {get;} [NoAccessorMethod] public string accessible_desc {owned get;} /* Menu properties */ [NoAccessorMethod] public ObjectPath menu {owned get;} /* Icon properties */ [NoAccessorMethod] public GLib.Icon icon {owned get;} /* Tooltip */ [NoAccessorMethod] public string tooltip_text {owned get;} [NoAccessorMethod] public GLib.Icon tooltip_icon {owned get;} /* Signals */ public signal void fail(); public signal void initialized(); /* Ayatana */ [NoAccessorMethod] public string x_ayatana_label {owned get;} [NoAccessorMethod] public string x_ayatana_label_guide {owned get;} [NoAccessorMethod] public uint x_ayatana_ordering_index {get;} /*Internal Methods */ public Proxy(string bus_name, string object_path); public void start(); public void reload(); /*DBus Methods */ public void context_menu(int x, int y); public void activate(int x, int y); public void secondary_activate(int x, int y); public void scroll(int dx, int dy); public bool ayatana_secondary_activate(uint32 timestamp); } } xfce4-sntray-plugin-0.4.13.1/src/sntray.gresource.xml000066400000000000000000000004241370304200600224020ustar00rootroot00000000000000 css/vala-panel.css snconfig.ui xfce4-sntray-plugin-0.4.13.1/src/snwatcher.vala000066400000000000000000000144601370304200600212130ustar00rootroot00000000000000/* * xfce4-sntray-plugin * Copyright (C) 2015-2017 Konstantin Pugin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ using GLib; using Gtk; namespace StatusNotifier { [DBus (name = "org.kde.StatusNotifierItem")] private interface ItemIface : Object { public abstract string id {owned get;} public abstract string title {owned get;} } [DBus (name = "org.kde.StatusNotifierWatcher")] public interface WatcherIface: Object { /* Signals */ public signal void status_notifier_item_registered(string item); public signal void status_notifier_host_registered(); public signal void status_notifier_item_unregistered(string item); public signal void status_notifier_host_unregistered(); /* Public properties */ public abstract string[] registered_status_notifier_items {owned get;} public abstract bool is_status_notifier_host_registered {get;} public abstract int protocol_version {get;} /* Public methods */ public abstract void register_status_notifier_item(string service) throws Error; public abstract void register_status_notifier_host(string service) throws Error; } [DBus (name = "org.kde.StatusNotifierWatcher")] public class Watcher : Object { /* Signals */ public signal void status_notifier_item_registered(string item); public signal void status_notifier_host_registered(); public signal void status_notifier_item_unregistered(string item); public signal void status_notifier_host_unregistered(); /* Hashes */ private HashTable name_watcher = new HashTable(str_hash, str_equal); private HashTable hosts = new HashTable(str_hash, str_equal); /* Public properties */ public string[] registered_status_notifier_items {owned get {return get_registered_items();}} public bool is_status_notifier_host_registered {get; private set; default = true;} public int protocol_version {get {return 0;}} /* Public methods */ public void register_status_notifier_item(string service, BusName sender) { var is_path = (service[0]=='/') ? true : false; string path, name; if (is_path) { name = (string)sender; path = service; } else { name = service; path = "/StatusNotifierItem"; } var id = get_id(name,path); if (id in name_watcher) { warning("Trying to register already registered item. Reregistering new..."); remove(id); } var name_handler = Bus.watch_name(BusType.SESSION,name,GLib.BusNameWatcherFlags.NONE, ()=>{ try { ItemIface ping_iface = Bus.get_proxy_sync(BusType.SESSION,name,path); ping_iface.notify.connect((pspec)=>{ if (ping_iface.id == null || ping_iface.title == null || ping_iface.id.length <= 0 || ping_iface.title.length <= 0) remove(get_id(name,path)); }); } catch (Error e) {remove(get_id(name,path));} }, () => {remove(get_id(name,path));} ); name_watcher.insert(id,name_handler); status_notifier_item_registered(id); this.notify_property("registered-status-notifier-items"); } public void register_status_notifier_host(string service) throws Error { /* FIXME: Hosts management untested with non-ValaPanel hosts*/ hosts.insert(service,Bus.watch_name(BusType.SESSION,service,GLib.BusNameWatcherFlags.NONE, null, () => {remove_host(service);} )); status_notifier_host_registered(); } private void remove_host(string id) { uint name = hosts.lookup(id); hosts.remove(id); Bus.unwatch_name(name); status_notifier_host_unregistered(); } private void remove(string id) { string outer = id.dup(); uint name = name_watcher.lookup(id); if(name != 0) Bus.unwatch_name(name); name_watcher.remove(id); status_notifier_item_unregistered(outer); this.notify_property("registered-status-notifier-items"); /* FIXME PropertiesChanged for RegisteredStatusNotifierItems*/ } private string get_id(string name, string path) { return name + path; } private string[] get_registered_items() { var items_list = name_watcher.get_keys(); string [] ret = {}; foreach(var item in items_list) ret += item; return ret; } ~Watcher() { name_watcher.foreach((k,v)=>{Bus.unwatch_name(v);}); hosts.foreach((k,v)=>{Bus.unwatch_name(v);}); } } } xfce4-sntray-plugin-0.4.13.1/vapi/000077500000000000000000000000001370304200600165135ustar00rootroot00000000000000xfce4-sntray-plugin-0.4.13.1/vapi/libmatepanelapplet-4.0.vapi000066400000000000000000000070071370304200600235420ustar00rootroot00000000000000/* MatePanelApplet-4.0.vapi generated by vapigen, do not modify. */ [CCode (cprefix = "MatePanel", gir_namespace = "MatePanelApplet", gir_version = "4.0", lower_case_cprefix = "mate_panel_")] namespace MatePanel { [CCode (cheader_filename = "mate-panel-applet.h", type_id = "mate_panel_applet_get_type ()")] public class Applet : Gtk.EventBox, Atk.Implementor, Gtk.Buildable { [CCode (has_construct_function = false, type = "GtkWidget*")] public Applet (); public static int factory_main (string factory_id, bool out_process, GLib.Type applet_type, MatePanel.AppletFactoryCallback callback); public static int factory_setup_in_process (string factory_id, GLib.Type applet_type, MatePanel.AppletFactoryCallback callback); public MatePanel.AppletBackgroundType get_background (out Gdk.RGBA color,out Cairo.Pattern pixmap); public MatePanel.AppletFlags get_flags (); public bool get_locked_down (); public MatePanel.AppletOrient get_orient (); public string get_preferences_path (); public uint get_size (); public void request_focus (uint32 timestamp); [Version (deprecated = true, deprecated_since = "3.20")] public void set_background_widget (Gtk.Widget widget); public void set_flags (MatePanel.AppletFlags flags); public void set_size_hints (int size_hints, int n_elements, int base_size); public void setup_menu (string xml, Gtk.ActionGroup action_group); public void setup_menu_from_file (string filename, Gtk.ActionGroup action_group); [NoAccessorMethod] public string background { owned get; set; } [NoAccessorMethod] public void* closure { get; construct; } [NoAccessorMethod] public GLib.DBusConnection connection { owned get; construct; } public uint flags { get; set; } [NoAccessorMethod] public string id { owned get; construct; } [NoAccessorMethod] public bool locked { get; set; } [NoAccessorMethod] public bool locked_down { get; set; } [NoAccessorMethod] public uint orient { get; set; } [NoAccessorMethod] public string prefs_path { owned get; set; } [NoAccessorMethod] public uint size { get; set; } [NoAccessorMethod] public void* size_hints { get; set; } public virtual signal void change_background (MatePanel.AppletBackgroundType type, Gdk.RGBA color, Cairo.Pattern pixmap); public virtual signal void change_orient (uint orient); public virtual signal void change_size (int size); public virtual signal void move_focus_out_of_applet (Gtk.DirectionType direction); } [CCode (cheader_filename = "mate-panel-applet-enums.h", cprefix = "PANEL_", type_id = "mate_panel_applet_background_type_get_type ()")] public enum AppletBackgroundType { NO_BACKGROUND, COLOR_BACKGROUND, PIXMAP_BACKGROUND } [CCode (cheader_filename = "mate-panel-applet-enums.h", cprefix = "MATE_PANEL_APPLET_", type_id = "mate_panel_applet_flags_get_type ()")] [Flags] public enum AppletFlags { FLAGS_NONE, EXPAND_MAJOR, EXPAND_MINOR, HAS_HANDLE } [CCode (cheader_filename = "mate-panel-applet-enums.h", cprefix = "MATE_PANEL_APPLET_ORIENT_", type_id = "mate_panel_applet_orient_get_type ()")] public enum AppletOrient { UP, DOWN, LEFT, RIGHT } [CCode (cheader_filename = "mate-panel-applet.h", instance_pos = 2.9)] public delegate bool AppletFactoryCallback (MatePanel.Applet applet, string iid); [CCode (cheader_filename = "mate-panel-applet.h", cname = "MATE_PANEL_APPLET_FLAGS_ALL")] public const int APPLET_FLAGS_ALL; [CCode (cheader_filename = "mate-panel-applet-gsettings.h")] namespace AppletSettings { public GLib.Settings @new(Applet applet, string schema); } } xfce4-sntray-plugin-0.4.13.1/vapi/libxfce4panel-2.0.vapi000066400000000000000000000251661370304200600224230ustar00rootroot00000000000000/* libxfce4panel-1.0.vapi generated by vapigen-0.16, do not modify. */ namespace Xfce { [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")] public class ArrowButton : Gtk.ToggleButton, Atk.Implementor, Gtk.Buildable, Gtk.Activatable { [CCode (has_construct_function = false, type = "GtkWidget*")] public ArrowButton (Gtk.ArrowType arrow_type); public Gtk.ArrowType get_arrow_type (); public bool get_blinking (); public void set_arrow_type (Gtk.ArrowType arrow_type); public void set_blinking (bool blinking); public Gtk.ArrowType arrow_type { get; set; } public virtual signal void arrow_type_changed (Gtk.ArrowType type); } [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")] public class HVBox : Gtk.Box, Atk.Implementor, Gtk.Buildable, Gtk.Orientable { public Gtk.Orientation orientation; [CCode (cname = "xfce_hvbox_new", has_construct_function = false, type = "GtkWidget*")] public HVBox (Gtk.Orientation orientation, bool homogeneous, int spacing); [CCode (cname = "xfce_hvbox_get_orientation")] public Gtk.Orientation get_orientation (); [CCode (cname = "xfce_hvbox_set_orientation")] public void set_orientation (Gtk.Orientation orientation); } [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")] public class PanelImage : Gtk.Widget, Atk.Implementor, Gtk.Buildable { [CCode (has_construct_function = false, type = "GtkWidget*")] public PanelImage (); public void clear (); [CCode (has_construct_function = false, type = "GtkWidget*")] public PanelImage.from_pixbuf (Gdk.Pixbuf pixbuf); [CCode (has_construct_function = false, type = "GtkWidget*")] public PanelImage.from_source (string source); public int get_size (); public void set_from_pixbuf (Gdk.Pixbuf pixbuf); public void set_from_source (string source); public void set_size (int size); [NoAccessorMethod] public Gdk.Pixbuf pixbuf { owned get; set; } public int size { get; set; } [NoAccessorMethod] public string source { owned get; set; } } [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")] public class PanelPlugin : Gtk.EventBox, Atk.Implementor, Gtk.Buildable, Xfce.PanelPluginProvider { [CCode (has_construct_function = false)] protected PanelPlugin (); public void add_action_widget (Gtk.Widget widget); public Gtk.ArrowType arrow_type (); public void block_autohide (bool blocked); public void block_menu (); [NoWrapper] public virtual void @construct (); public void focus_widget (Gtk.Widget widget); public unowned string get_arguments (); public unowned string get_comment (); public unowned string get_display_name (); public bool get_expand (); public bool get_locked (); public Xfce.PanelPluginMode get_mode (); public uint get_nrows (); public Gtk.Orientation get_orientation (); public unowned string get_property_base (); [CCode (cname = "xfce_panel_plugin_xfconf_channel_new")] public Xfconf.Channel get_channel(); public Xfce.ScreenPosition get_screen_position (); public bool get_shrink (); public int get_size (); public bool get_small (); public unowned string lookup_rc_file (); public void menu_insert_item (Gtk.MenuItem item); public void menu_show_about (); public void menu_show_configure (); public static void position_menu (Gtk.Menu menu, ref int x, ref int y, out bool push_in, void* panel_plugin); public void position_widget (Gtk.Widget menu_widget, Gtk.Widget attach_widget, int x, int y); public void register_menu (Gtk.Menu menu); public void remove (); public unowned string save_location (bool create); public void set_expand (bool expand); public void set_shrink (bool shrink); public void set_small (bool small); public void take_window (Gtk.Window window); public void unblock_menu (); [CCode (array_length = false, array_null_terminated = true)] public string[] arguments { get; construct; } public string comment { get; construct; } public string display_name { get; construct; } public bool expand { get; set; } public Xfce.PanelPluginMode mode { get; } public string name { get; construct; } public uint nrows { get; } public Gtk.Orientation orientation { get; } public Xfce.ScreenPosition screen_position { get; } public bool shrink { get; set; } public int size { get; } public bool small { get; set; } public int unique_id { get; construct; } public virtual signal void about (); public virtual signal void configure_plugin (); public virtual signal void free_data (); public virtual signal void mode_changed (Xfce.PanelPluginMode mode); public virtual signal void nrows_changed (uint rows); public virtual signal void orientation_changed (Gtk.Orientation orientation); public virtual signal bool remote_event (string name, GLib.Value value, uint handle); public virtual signal void removed (); public virtual signal void save (); public virtual signal void screen_position_changed (Xfce.ScreenPosition position); public virtual signal bool size_changed (int size); } [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")] [Compact] public class PanelTypeModule { } [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")] public interface PanelPluginProvider { public abstract void ask_remove (); public void emit_signal (Xfce.PanelPluginProviderSignal provider_signal); public abstract unowned string get_name (); public abstract bool get_show_about (); public abstract bool get_show_configure (); public abstract int get_unique_id (); public abstract bool remote_event (string name, GLib.Value value, uint handle); public abstract void removed (); public abstract void save (); public abstract void set_locked (bool locked); public abstract void set_mode (Xfce.PanelPluginMode mode); public abstract void set_nrows (uint rows); public abstract void set_screen_position (Xfce.ScreenPosition screen_position); public abstract void set_size (int size); public abstract void show_about (); public abstract void show_configure (); public signal void provider_signal (uint p0); } [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h", cprefix = "XFCE_PANEL_PLUGIN_MODE_")] public enum PanelPluginMode { HORIZONTAL, VERTICAL, DESKBAR } [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h", cprefix = "PROVIDER_PROP_TYPE_", has_type_id = false)] public enum PanelPluginProviderPropType { SET_SIZE, SET_MODE, SET_SCREEN_POSITION, SET_BACKGROUND_ALPHA, SET_NROWS, SET_LOCKED, SET_SENSITIVE, SET_BACKGROUND_COLOR, SET_BACKGROUND_IMAGE, ACTION_REMOVED, ACTION_SAVE, ACTION_QUIT, ACTION_QUIT_FOR_RESTART, ACTION_BACKGROUND_UNSET, ACTION_SHOW_CONFIGURE, ACTION_SHOW_ABOUT, ACTION_ASK_REMOVE } [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h", cprefix = "PROVIDER_SIGNAL_", has_type_id = false)] public enum PanelPluginProviderSignal { MOVE_PLUGIN, EXPAND_PLUGIN, COLLAPSE_PLUGIN, SMALL_PLUGIN, UNSMALL_PLUGIN, LOCK_PANEL, UNLOCK_PANEL, REMOVE_PLUGIN, ADD_NEW_ITEMS, PANEL_PREFERENCES, PANEL_LOGOUT, PANEL_ABOUT, PANEL_HELP, SHOW_CONFIGURE, SHOW_ABOUT, FOCUS_PLUGIN, SHRINK_PLUGIN, UNSHRINK_PLUGIN } [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h", cprefix = "XFCE_SCREEN_POSITION_")] public enum ScreenPosition { NONE, NW_H, N, NE_H, NW_V, W, SW_V, NE_V, E, SE_V, SW_H, S, SE_H, FLOATING_H, FLOATING_V } [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h", has_target = false)] public delegate bool PanelPluginCheck (Gdk.Screen screen); [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h", has_target = false)] public delegate void PanelPluginFunc (Xfce.PanelPlugin plugin); [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h", has_target = false)] public delegate bool PanelPluginPreInit (int argc, string argv); [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h", has_target = false)] public delegate unowned Gtk.Widget PluginConstructFunc (string name, int unique_id, string display_name, string comment, string arguments, Gdk.Screen screen); [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h", has_target = false)] public delegate GLib.Type PluginInitFunc (GLib.TypeModule module, bool make_resident); [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")] public const int LIBXFCE4PANEL_MAJOR_VERSION; [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")] public const int LIBXFCE4PANEL_MICRO_VERSION; [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")] public const int LIBXFCE4PANEL_MINOR_VERSION; [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")] public const string LIBXFCE4PANEL_VERSION; [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h", cname = "libxfce4panel_check_version")] public static unowned string libxfce4panel_check_version (uint required_major, uint required_minor, uint required_micro); [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")] public static unowned Gtk.Widget panel_create_button (); [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")] public static unowned Gtk.Widget panel_create_toggle_button (); [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")] public static unowned string panel_get_channel_name (); [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")] public static unowned Gdk.Pixbuf panel_pixbuf_from_source (string source, Gtk.IconTheme icon_theme, int size); [CCode (cheader_filename = "libxfce4panel/libxfce4panel.h")] public static unowned Gdk.Pixbuf panel_pixbuf_from_source_at_size (string source, Gtk.IconTheme icon_theme, int dest_width, int dest_height); } xfce4-sntray-plugin-0.4.13.1/vapi/libxfconf-0.vapi000066400000000000000000000102061370304200600215020ustar00rootroot00000000000000/* libxfconf-0.vapi generated by vapigen-0.16, do not modify. */ namespace Xfconf { [CCode (cheader_filename = "xfconf/xfconf.h")] public class Channel : GLib.Object { [CCode (has_construct_function = false)] public Channel (string channel_name); public static unowned Xfconf.Channel @get (string channel_name); public bool get_bool (string property, bool default_value); public double get_double (string property, double default_value); public int32 get_int (string property, int32 default_value); public bool get_named_struct (string property, string struct_name, void* value_struct); public unowned GLib.HashTable get_properties (string property_base); public bool get_property (string property, GLib.Value value); public string get_string (string property, string default_value); [CCode (array_length = false)] public string[] get_string_list (string property); [CCode (sentinel = "G_TYPE_INVALID")] public bool get_struct (string property, void* value_struct, ...); public bool get_structv (string property, void* value_struct, [CCode (array_length_pos = 2)] GLib.Type[] member_types); public uint32 get_uint (string property, uint32 default_value); public uint64 get_uint64 (string property, uint64 default_value); public bool has_property (string property); public bool is_property_locked (string property); public void reset_property (string property_base, bool recursive); public bool set_bool (string property, bool value); public bool set_double (string property, double value); public bool set_int (string property, int32 value); public bool set_named_struct (string property, string struct_name, void* value_struct); public bool set_property (string property, GLib.Value value); public bool set_string (string property, string value); public bool set_string_list (string property, [CCode (array_length = false, type = "const gchar* const*")] string[] values); [CCode (sentinel = "G_TYPE_INVALID")] public bool set_struct (string property, void* value_struct, ...); public bool set_structv (string property, void* value_struct, [CCode (array_length_pos = 2)] GLib.Type[] member_types); public bool set_uint (string property, uint32 value); public bool set_uint64 (string property, uint64 value); [CCode (has_construct_function = false)] public Channel.with_property_base (string channel_name, string property_base); [NoAccessorMethod] public bool is_singleton { get; construct; } public virtual signal void property_changed (string p0, GLib.Value p1); } [CCode (cheader_filename = "xfconf/xfconf.h")] [Compact] public class Property { [CCode (cname = "xfconf_g_property_bind")] public static ulong bind (Xfconf.Channel channel, string xfconf_property, GLib.Type xfconf_property_type, void* object, string object_property); [CCode (cname = "xfconf_g_property_bind_gdkcolor")] public static ulong bind_gdkcolor (Xfconf.Channel channel, string xfconf_property, void* object, string object_property); [CCode (cname = "xfconf_g_property_unbind")] public static void unbind (ulong id); [CCode (cname = "xfconf_g_property_unbind_all")] public static void unbind_all (void* channel_or_object); [CCode (cname = "xfconf_g_property_unbind_by_property")] public static void unbind_by_property (Xfconf.Channel channel, string xfconf_property, void* object, string object_property); } [CCode (cheader_filename = "xfconf/xfconf.h", cprefix = "XFCONF_ERROR_")] public errordomain Error { UNKNOWN, CHANNEL_NOT_FOUND, PROPERTY_NOT_FOUND, READ_FAILURE, WRITE_FAILURE, PERMISSION_DENIED, INTERNAL_ERROR, NO_BACKEND, INVALID_PROPERTY, INVALID_CHANNEL } [CCode (cheader_filename = "xfconf/xfconf.h")] public static void array_free (GLib.PtrArray arr); [CCode (cheader_filename = "xfconf/xfconf.h")] public static bool init () throws Xfconf.Error; [CCode (array_length = false, cheader_filename = "xfconf/xfconf.h")] public static string[] list_channels (); [CCode (cheader_filename = "xfconf/xfconf.h")] public static void named_struct_register (string struct_name, [CCode (array_length_pos = 1)] GLib.Type[] member_types); [CCode (cheader_filename = "xfconf/xfconf.h")] public static void shutdown (); } xfce4-sntray-plugin-0.4.13.1/xembedsniproxy/000077500000000000000000000000001370304200600206345ustar00rootroot00000000000000xfce4-sntray-plugin-0.4.13.1/xembedsniproxy/CMakeLists.txt000066400000000000000000000035211370304200600233750ustar00rootroot00000000000000pkg_check_modules(XCB xcb-atom xcb-damage xcb-icccm xcb-ewmh xcb xcb-proto xcb-randr xcb-util xcb-xtest IMPORTED_TARGET) pkg_check_modules(X11_XCB x11-xcb IMPORTED_TARGET) pkg_check_modules(GDK_PIXBUF gdk-pixbuf-2.0 IMPORTED_TARGET) pkg_check_modules(CAIRO cairo IMPORTED_TARGET) cmake_dependent_option(ENABLE_SHIM "Enable XEmbed shim for SNI" ON "XCB_FOUND;X11_XCB_FOUND;GDK_PIXBUF_FOUND;CAIRO_FOUND" OFF) add_feature_info(Shim ENABLE_SHIM "XEmbed shim for using in Wayland/non-Xembed environment") configure_file (${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) set(ENUM_FILES ${CMAKE_SOURCE_DIR}/include/sn-common.h ) add_glib_enumtypes(ENUMSC ENUMSH sni-enums ${ENUM_FILES}) set(XEMBED_SNI_PROXY_SOURCES application.c application.h xcb-utils.c xcb-utils.h ${CMAKE_CURRENT_BINARY_DIR}/config.h xtestsender.c xtestsender.h gwater-xcb.c gwater-xcb.h sn.c sn.h ${MARSHALC} ${ENUMSC} ${ENUMSH} ) if(XCB_FOUND AND X11_XCB_FOUND) file(STRINGS org.kde.StatusNotifierWatcher.xml XML_RAW) string(CONCAT WATCHER_XML ${XML_RAW}) file(STRINGS org.kde.StatusNotifierItem.xml PRIVATE_RAW) string(CONCAT ITEM_XML ${PRIVATE_RAW}) configure_file(interfaces.h.in interfaces.h ESCAPE_QUOTES) set(CMAKE_INCLUDE_CURRENT_DIR ON) add_executable(xembedsniproxy ${XEMBED_SNI_PROXY_SOURCES}) set(CMAKE_INCLUDE_CURRENT_DIR ON) target_link_libraries(xembedsniproxy PkgConfig::XCB PkgConfig::X11_XCB PkgConfig::GDK_PIXBUF PkgConfig::CAIRO GLIB2::GOBJECT GLIB2::GIO_UNIX ) install(TARGETS xembedsniproxy RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/vala-panel ) #install(FILES xembedsniproxy.desktop DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() xfce4-sntray-plugin-0.4.13.1/xembedsniproxy/application.c000066400000000000000000000433131370304200600233070ustar00rootroot00000000000000/* * Copyright (C) 2017 David Edmundson * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include "application.h" #include "config.h" #include "gwater-xcb.h" #include "sn.h" #include "xcb-utils.h" #include #include #include #include #include #include #include #include #include struct _XEmbedSNIApplication { GApplication parent; uint8_t damageEventBase; GWaterXcbSource *src; int default_screen; xcb_window_t selection; GHashTable *damageWatches; GHashTable *proxies; }; G_DEFINE_TYPE(XEmbedSNIApplication, xembed_sni_application, G_TYPE_APPLICATION) static const GOptionEntry entries[] = { { "version", 'v', 0, G_OPTION_ARG_NONE, NULL, N_("Print version and exit"), NULL }, { NULL } }; enum { XEMBED_SNI_APP_DUMMY_PROPERTY, XEMBED_SNI_APP_ALL }; XEmbedSNIApplication *xembed_sni_application_new() { return XEMBED_SNI_APPLICATION(g_object_new(xembed_sni_application_get_type(), "application-id", "org.valapanel.xembedsni", "flags", G_APPLICATION_HANDLES_COMMAND_LINE, "resource-base-path", "/org/vala-panel/xembedsni", NULL)); } static void xembed_sni_application_init(XEmbedSNIApplication *self) { self->damageWatches = g_hash_table_new(g_direct_hash, g_direct_equal); self->proxies = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, g_object_unref); self->selection = XCB_WINDOW_NONE; g_application_add_main_option_entries(G_APPLICATION(self), entries); } bool xembed_sni_application_add_damage_watch(XEmbedSNIApplication *self, xcb_window_t client) { g_debug("adding damage watch for %u\n", client); xcb_connection_t *c = g_water_xcb_source_get_connection(self->src); const xcb_get_window_attributes_cookie_t attribsCookie = xcb_get_window_attributes_unchecked(c, client); const xcb_window_t damageId = xcb_generate_id(c); g_hash_table_insert(self->damageWatches, GUINT_TO_POINTER(client), GUINT_TO_POINTER(damageId)); xcb_damage_create(c, damageId, client, XCB_DAMAGE_REPORT_LEVEL_NON_EMPTY); g_autofree xcb_generic_error_t *error = NULL; g_autofree xcb_get_window_attributes_reply_t *attr = xcb_get_window_attributes_reply(c, attribsCookie, &error); uint32_t events = XCB_EVENT_MASK_STRUCTURE_NOTIFY; if (attr) { events = events | attr->your_event_mask; } // if window is already gone, there is no need to handle it. if (error && error->error_code == XCB_WINDOW) { g_free(error); return false; } // the event mask will not be removed again. We cannot track whether another component also // needs STRUCTURE_NOTIFY (e.g. KWindowSystem). if we would remove the event mask again, // other areas will break. const xcb_void_cookie_t changeAttrCookie = xcb_change_window_attributes_checked(c, client, XCB_CW_EVENT_MASK, &events); g_autofree xcb_generic_error_t *changeAttrError = xcb_request_check(c, changeAttrCookie); // if window is gone by this point, it will be catched by eventFilter, so no need to check // later errors. if (changeAttrError && changeAttrError->error_code == XCB_WINDOW) { return false; } return true; } static void xembed_sni_application_dock(XEmbedSNIApplication *self, xcb_window_t winId) { g_debug("trying to dock window %u\n", winId); if (g_hash_table_contains(self->proxies, GUINT_TO_POINTER(winId))) { return; } if (xembed_sni_application_add_damage_watch(self, winId)) { g_autofree char *id = g_strdup_printf("0x%x", winId); StatusNotifierItem *item = status_notifier_item_new_from_xcb_window(id, SN_CATEGORY_APPLICATION, g_water_xcb_source_get_connection( self->src), winId); g_hash_table_insert(self->proxies, GUINT_TO_POINTER(winId), item); } } static void xembed_sni_application_undock(XEmbedSNIApplication *self, xcb_window_t winId) { g_debug("trying to undock window %u\n", winId); if (g_hash_table_contains(self->proxies, GUINT_TO_POINTER(winId))) { return; } g_hash_table_remove(self->proxies, GUINT_TO_POINTER(winId)); } /*XCB event filter * TODO: Baloon messages * TODO: Any strange tray types */ static bool xcb_event_filter(xcb_generic_event_t *event, XEmbedSNIApplication *self) { const uint8_t responseType = event->response_type; if (responseType == XCB_CLIENT_MESSAGE) { const xcb_client_message_event_t *ce = (xcb_client_message_event_t *)event; if (ce->type == a_NET_SYSTEM_TRAY_OPCODE) { switch (ce->data.data32[1]) { case SYSTEM_TRAY_REQUEST_DOCK: xembed_sni_application_dock(self, ce->data.data32[2]); // return GDK_FILTER_REMOVE; break; case SYSTEM_TRAY_BEGIN_MESSAGE: /* If a Begin Message event. look up the tray icon and execute it. */ // balloon_message_begin_event(tr, // (XClientMessageEvent *)xev); return // GDK_FILTER_REMOVE; break; case SYSTEM_TRAY_CANCEL_MESSAGE: /* If a Cancel Message event. look up the tray icon and execute it. */ // balloon_message_cancel_event(tr, // (XClientMessageEvent *)xev); return // GDK_FILTER_REMOVE; break; } } else if (ce->type == a_NET_SYSTEM_TRAY_MESSAGE_DATA) { /* Client message of type _NET_SYSTEM_TRAY_MESSAGE_DATA. * Look up the tray icon and execute it. */ // balloon_message_data_event(tr, (XClientMessageEvent *)xev); // return GDK_FILTER_REMOVE; } } else if (responseType == XCB_UNMAP_NOTIFY) { const xcb_window_t unmappedWId = ((xcb_unmap_notify_event_t *)event)->window; if (g_hash_table_contains(self->proxies, GUINT_TO_POINTER(unmappedWId))) { xembed_sni_application_undock(self, unmappedWId); } } else if (responseType == XCB_DESTROY_NOTIFY) { /* Look for DestroyNotify events on tray icon windows and update state. * We do it this way rather than with a "plug_removed" event because delivery * of plug_removed events is observed to be unreliable if the client * disconnects within less than 10 ms. */ const xcb_window_t destroyedWId = ((xcb_destroy_notify_event_t *)event)->window; if (g_hash_table_contains(self->proxies, GUINT_TO_POINTER(destroyedWId))) { xembed_sni_application_undock(self, destroyedWId); } } else if (responseType == self->damageEventBase + XCB_DAMAGE_NOTIFY) { const xcb_window_t damagedWId = ((xcb_damage_notify_event_t *)event)->drawable; GObject *sniProxy = G_OBJECT(g_hash_table_lookup(self->proxies, GUINT_TO_POINTER(damagedWId))); if (sniProxy) { // sniProx->update(); xcb_damage_subtract(g_water_xcb_source_get_connection(self->src), GPOINTER_TO_UINT( g_hash_table_lookup(self->damageWatches, GUINT_TO_POINTER(damagedWId))), XCB_NONE, XCB_NONE); } } else if (responseType == XCB_SELECTION_CLEAR) { const xcb_window_t damagedWId = ((xcb_selection_clear_event_t *)event)->owner; /* Look for SelectionClear events on the invisible window, which is holding the * manager selection. * This should not happen. */ if (damagedWId == self->selection) g_application_quit(G_APPLICATION(self)); } return G_SOURCE_CONTINUE; } static void claim_systray_selection(XEmbedSNIApplication *self) { xcb_connection_t *con = g_water_xcb_source_get_connection(self->src); g_autofree char *selection_atom_name = g_strdup_printf("_NET_SYSTEM_TRAY_S%d", self->default_screen); xcb_atom_t selection_atom = (xcb_atom_t)xcb_atom_get_for_connection(g_water_xcb_source_get_connection(self->src), selection_atom_name); g_autofree xcb_generic_error_t *err = NULL; xcb_get_selection_owner_cookie_t sel_c = xcb_get_selection_owner(con, selection_atom); g_autofree xcb_get_selection_owner_reply_t *sel_r = xcb_get_selection_owner_reply(con, sel_c, &err); if (err) { g_printerr("tray: selection claiming error"); g_application_quit(G_APPLICATION(self)); } /* If the selection is already owned, there is another tray running. */ else if (sel_r->owner != XCB_WINDOW_NONE) { g_printerr("tray: another systray already running"); g_application_quit(G_APPLICATION(self)); } /* Create an invisible window to hold the selection. */ uint32_t values[] = { true, XCB_EVENT_MASK_PROPERTY_CHANGE | XCB_EVENT_MASK_STRUCTURE_NOTIFY }; self->selection = xcb_generate_id(con); xcb_window_t root = (xcb_window_t)xcb_get_root_for_connection(g_water_xcb_source_get_connection(self->src), self->default_screen); xcb_create_window(con, XCB_COPY_FROM_PARENT, self->selection, root, 0, 0, 1, 1, 0, XCB_WINDOW_CLASS_INPUT_ONLY, XCB_COPY_FROM_PARENT, XCB_CW_OVERRIDE_REDIRECT | XCB_CW_EVENT_MASK, values); xcb_icccm_set_wm_name(con, self->selection, XCB_ATOM_STRING, 8, sizeof(GETTEXT_PACKAGE) - 1, GETTEXT_PACKAGE); xcb_icccm_set_wm_class(con, self->selection, sizeof(GETTEXT_PACKAGE), GETTEXT_PACKAGE); xcb_client_message_event_t ev = { 0 }; /* Fill event */ ev.response_type = XCB_CLIENT_MESSAGE; ev.window = root; ev.format = 32; ev.type = a_MANAGER; ev.data.data32[0] = XCB_CURRENT_TIME; ev.data.data32[1] = selection_atom; ev.data.data32[2] = self->selection; ev.data.data32[3] = ev.data.data32[4] = 0 /* manager specific data */; xcb_void_cookie_t ret = xcb_set_selection_owner_checked(con, self->selection, selection_atom, XCB_CURRENT_TIME); g_autofree xcb_generic_error_t *oerr = xcb_request_check(con, ret); if (!oerr) { /* Send MANAGER client event (ICCCM). XCB_CURRENT_TIME is bad, but I do not know how * to avoid it*/ xcb_send_event(con, false, root, 0xFFFFFF, (char *)&ev); /* Set the orientation property. * We always set "horizontal" since even vertical panels are designed to use a lot * of width. */ uint32_t data = SYSTEM_TRAY_ORIENTATION_HORZ; xcb_change_property(con, XCB_PROP_MODE_REPLACE, self->selection, a_NET_SYSTEM_TRAY_ORIENTATION, XCB_ATOM_CARDINAL, 32, 1, &data); } else { xcb_unmap_window(con, self->selection); g_printerr("tray: System tray didn't get the system tray manager selection\n"); g_application_quit(G_APPLICATION(self)); } } static void release_systray_selection(XEmbedSNIApplication *self) { if (self->selection != XCB_WINDOW_NONE) { xcb_connection_t *con = g_water_xcb_source_get_connection(self->src); g_autofree char *selection_atom_name = g_strdup_printf("_NET_SYSTEM_TRAY_S%d", self->default_screen); xcb_atom_t selection_atom = xcb_atom_get_for_connection(g_water_xcb_source_get_connection(self->src), selection_atom_name); g_autofree xcb_generic_error_t *err = NULL; xcb_get_selection_owner_cookie_t sel_c = xcb_get_selection_owner(con, selection_atom); g_autofree xcb_get_selection_owner_reply_t *sel_r = xcb_get_selection_owner_reply(con, sel_c, &err); if (err) { g_printerr("tray: selection releasing error"); g_application_quit(G_APPLICATION(self)); } if (sel_r->owner == self->selection) { xcb_void_cookie_t ret = xcb_set_selection_owner_checked(con, self->selection, selection_atom, XCB_CURRENT_TIME); g_autofree xcb_generic_error_t *oerr = xcb_request_check(con, ret); } self->selection = XCB_WINDOW_NONE; } } static void xembed_sni_application_startup(GApplication *base) { XEmbedSNIApplication *self = XEMBED_SNI_APPLICATION(base); G_APPLICATION_CLASS(xembed_sni_application_parent_class) ->startup((GApplication *)G_TYPE_CHECK_INSTANCE_CAST(self, g_application_get_type(), GApplication)); g_application_mark_busy((GApplication *)self); setlocale(LC_CTYPE, ""); bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); textdomain(GETTEXT_PACKAGE); // We only support X11 self->src = g_water_xcb_source_new(g_main_context_default(), "0", &self->default_screen, (GWaterXcbEventCallback)xcb_event_filter, self, NULL); g_application_hold(base); xcb_connection_t *con = g_water_xcb_source_get_connection(self->src); xcb_prefetch_extension_data(con, &xcb_damage_id); const xcb_query_extension_reply_t *reply = xcb_get_extension_data(con, &xcb_damage_id); if (reply->present) { self->damageEventBase = reply->first_event; xcb_damage_query_version_unchecked(con, XCB_DAMAGE_MAJOR_VERSION, XCB_DAMAGE_MINOR_VERSION); } else { // no XDamage means g_critical("could not load damage extension. Quitting"); g_application_quit(base); } resolve_atoms(con); claim_systray_selection(self); } static void xembed_sni_application_shutdown(GApplication *base) { XEmbedSNIApplication *self = XEMBED_SNI_APPLICATION(base); release_systray_selection(self); G_APPLICATION_CLASS(xembed_sni_application_parent_class) ->shutdown((GApplication *)G_TYPE_CHECK_INSTANCE_CAST(base, g_application_get_type(), GApplication)); } static gint xembed_sni_app_handle_local_options(GApplication *application, GVariantDict *options) { if (g_variant_dict_contains(options, "version")) { g_print(_("%s - Version %s\n"), g_get_application_name(), VERSION); return 0; } return -1; } static int xembed_sni_app_command_line(GApplication *application, GApplicationCommandLine *commandline) { return 0; } void xembed_sni_application_activate(GApplication *app) { XEmbedSNIApplication *self = XEMBED_SNI_APPLICATION(app); } static void xembed_sni_app_finalize(GObject *object) { XEmbedSNIApplication *app = XEMBED_SNI_APPLICATION(object); g_clear_pointer(&app->damageWatches, g_hash_table_destroy); g_clear_pointer(&app->proxies, g_hash_table_destroy); (*G_OBJECT_CLASS(xembed_sni_application_parent_class)->finalize)(object); } static void xembed_sni_app_set_property(GObject *object, uint prop_id, const GValue *value, GParamSpec *pspec) { XEmbedSNIApplication *app; g_return_if_fail(XEMBED_SNI_IS_APPLICATION(object)); app = XEMBED_SNI_APPLICATION(object); switch (prop_id) { default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void xembed_sni_app_get_property(GObject *object, uint prop_id, GValue *value, GParamSpec *pspec) { XEmbedSNIApplication *app; g_return_if_fail(XEMBED_SNI_IS_APPLICATION(object)); app = XEMBED_SNI_APPLICATION(object); switch (prop_id) { default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void xembed_sni_application_class_init(XEmbedSNIApplicationClass *klass) { xembed_sni_application_parent_class = g_type_class_peek_parent(klass); ((GApplicationClass *)klass)->startup = xembed_sni_application_startup; ((GApplicationClass *)klass)->shutdown = xembed_sni_application_shutdown; ((GApplicationClass *)klass)->activate = xembed_sni_application_activate; ((GApplicationClass *)klass)->handle_local_options = xembed_sni_app_handle_local_options; ((GApplicationClass *)klass)->command_line = xembed_sni_app_command_line; G_OBJECT_CLASS(klass)->get_property = xembed_sni_app_get_property; G_OBJECT_CLASS(klass)->set_property = xembed_sni_app_set_property; G_OBJECT_CLASS(klass)->finalize = xembed_sni_app_finalize; } int main(int argc, char *argv[]) { XEmbedSNIApplication *app = xembed_sni_application_new(); return g_application_run(G_APPLICATION(app), argc, argv); } xfce4-sntray-plugin-0.4.13.1/xembedsniproxy/application.h000066400000000000000000000021131370304200600233050ustar00rootroot00000000000000/* * Copyright (C) 2017 David Edmundson * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef APPLICATIONNEW_H #define APPLICATIONNEW_H #include #include G_BEGIN_DECLS G_DECLARE_FINAL_TYPE(XEmbedSNIApplication, xembed_sni_application, XEMBED_SNI, APPLICATION, GApplication) G_END_DECLS #endif // APPLICATIONNEW_H xfce4-sntray-plugin-0.4.13.1/xembedsniproxy/config.h.in000066400000000000000000000003651370304200600226630ustar00rootroot00000000000000#ifndef CONFIG_H_IN #define CONFIG_H_IN #define LOCALE_DIR "@CMAKE_INSTALL_FULL_DATAROOTDIR@/locale" #define GETTEXT_PACKAGE "@GETTEXT_PACKAGE@" #define INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@" #define VERSION "@VERSION@" #endif // CONFIG_H_IN xfce4-sntray-plugin-0.4.13.1/xembedsniproxy/gwater-xcb.c000066400000000000000000000123331370304200600230450ustar00rootroot00000000000000/* * libgwater-xcb - XCB GSource * * Copyright © 2014-2017 Quentin "Sardem FF7" Glidic * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef G_LOG_DOMAIN #undef G_LOG_DOMAIN #endif /* G_LOG_DOMAIN */ #define G_LOG_DOMAIN "GWaterXcb" #include #include #include #include "gwater-xcb.h" struct _GWaterXcbSource { GSource source; bool connection_owned; xcb_connection_t *connection; gpointer fd; GQueue *queue; }; static void _g_water_xcb_source_event_free(gpointer data) { free(data); } static bool _g_water_xcb_source_prepare(GSource *source, gint *timeout) { GWaterXcbSource *self = (GWaterXcbSource *)source; xcb_flush(self->connection); *timeout = -1; return !g_queue_is_empty(self->queue); } static bool _g_water_xcb_source_check(GSource *source) { GWaterXcbSource *self = (GWaterXcbSource *)source; GIOCondition revents; revents = g_source_query_unix_fd(source, self->fd); if (revents & G_IO_IN) { xcb_generic_event_t *event; if (xcb_connection_has_error(self->connection)) return TRUE; while ((event = xcb_poll_for_event(self->connection)) != NULL) g_queue_push_tail(self->queue, event); } return !g_queue_is_empty(self->queue); } static bool _g_water_xcb_source_dispatch(GSource *source, GSourceFunc callback, gpointer user_data) { GWaterXcbSource *self = (GWaterXcbSource *)source; xcb_generic_event_t *event; bool ret; event = g_queue_pop_head(self->queue); ret = ((GWaterXcbEventCallback)callback)(event, user_data); _g_water_xcb_source_event_free(event); return ret; } static void _g_water_xcb_source_finalize(GSource *source) { GWaterXcbSource *self = (GWaterXcbSource *)source; g_queue_free_full(self->queue, _g_water_xcb_source_event_free); if (self->connection_owned) xcb_disconnect(self->connection); } static GSourceFuncs _g_water_xcb_source_funcs = { .prepare = _g_water_xcb_source_prepare, .check = _g_water_xcb_source_check, .dispatch = _g_water_xcb_source_dispatch, .finalize = _g_water_xcb_source_finalize, }; GWaterXcbSource *g_water_xcb_source_new(GMainContext *context, const char *display, gint *screen, GWaterXcbEventCallback callback, gpointer user_data, GDestroyNotify destroy_func) { g_return_val_if_fail(callback != NULL, NULL); xcb_connection_t *connection; GWaterXcbSource *self; connection = xcb_connect(display, screen); if (xcb_connection_has_error(connection)) { xcb_disconnect(connection); return NULL; } self = g_water_xcb_source_new_for_connection(context, connection, callback, user_data, destroy_func); self->connection_owned = TRUE; return self; } GWaterXcbSource *g_water_xcb_source_new_for_connection(GMainContext *context, xcb_connection_t *connection, GWaterXcbEventCallback callback, gpointer user_data, GDestroyNotify destroy_func) { g_return_val_if_fail(connection != NULL, NULL); g_return_val_if_fail(callback != NULL, NULL); GSource *source; GWaterXcbSource *self; source = g_source_new(&_g_water_xcb_source_funcs, sizeof(GWaterXcbSource)); self = (GWaterXcbSource *)source; self->connection = connection; self->queue = g_queue_new(); self->fd = g_source_add_unix_fd(source, xcb_get_file_descriptor(self->connection), G_IO_IN); g_source_attach(source, context); g_source_set_callback(source, (GSourceFunc)callback, user_data, destroy_func); return self; } void g_water_xcb_source_free(GWaterXcbSource *self) { GSource *source = (GSource *)self; g_return_if_fail(self != NULL); g_source_destroy(source); g_source_unref(source); } xcb_connection_t *g_water_xcb_source_get_connection(GWaterXcbSource *self) { g_return_val_if_fail(self != NULL, NULL); return self->connection; } xfce4-sntray-plugin-0.4.13.1/xembedsniproxy/gwater-xcb.h000066400000000000000000000043631370304200600230560ustar00rootroot00000000000000/* * libgwater-xcb - XCB GSource * * Copyright © 2014-2017 Quentin "Sardem FF7" Glidic * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ #ifndef __G_WATER_XCB_H__ #define __G_WATER_XCB_H__ #include #include #include G_BEGIN_DECLS typedef struct _GWaterXcbSource GWaterXcbSource; typedef bool (*GWaterXcbEventCallback)(xcb_generic_event_t *event, gpointer user_data); GWaterXcbSource *g_water_xcb_source_new(GMainContext *context, const char *display, gint *screen, GWaterXcbEventCallback callback, gpointer user_data, GDestroyNotify destroy_func); GWaterXcbSource *g_water_xcb_source_new_for_connection(GMainContext *context, xcb_connection_t *connection, GWaterXcbEventCallback callback, gpointer user_data, GDestroyNotify destroy_func); void g_water_xcb_source_free(GWaterXcbSource *self); xcb_connection_t *g_water_xcb_source_get_connection(GWaterXcbSource *source); G_END_DECLS #endif /* __G_WATER_XCB_H__ */ xfce4-sntray-plugin-0.4.13.1/xembedsniproxy/interfaces.h.in000066400000000000000000000010721370304200600235350ustar00rootroot00000000000000 #ifndef __INTERFACES_H__ #define __INTERFACES_H__ #include G_BEGIN_DECLS #define WATCHER_NAME "org.kde.StatusNotifierWatcher" #define WATCHER_OBJECT "/StatusNotifierWatcher" #define WATCHER_INTERFACE "org.kde.StatusNotifierWatcher" #define ITEM_NAME "org.kde.StatusNotifierItem" #define ITEM_OBJECT "/StatusNotifierItem" #define ITEM_INTERFACE "org.kde.StatusNotifierItem" static const char watcher_xml[] = "@WATCHER_XML@"; static const char item_xml[] = "@ITEM_XML@"; G_END_DECLS #endif /* __INTERFACES_H__ */ xfce4-sntray-plugin-0.4.13.1/xembedsniproxy/org.kde.StatusNotifierItem.xml000066400000000000000000000025241370304200600265130ustar00rootroot00000000000000 xfce4-sntray-plugin-0.4.13.1/xembedsniproxy/org.kde.StatusNotifierWatcher.xml000066400000000000000000000017771370304200600272230ustar00rootroot00000000000000 xfce4-sntray-plugin-0.4.13.1/xembedsniproxy/sn.c000066400000000000000000000610701370304200600214240ustar00rootroot00000000000000#include "sn.h" #include "interfaces.h" #include "sni-enums.h" #include "xcb-utils.h" #include "xtestsender.h" #include #include #include #include #define _UNUSED_ __attribute__((unused)) enum { PROP_0, PROP_ID, PROP_TITLE, PROP_CATEGORY, PROP_STATUS, PROP_CONNECTION, PROP_WINDOW_ID, PROP_ICON, NB_PROPS = PROP_ICON, }; enum { SIGNAL_REGISTRATION_FAILED, NB_SIGNALS }; enum InjectMode { INJECT_DIRECT, INJECT_XTEST }; typedef struct { char *id; SnCategory category; char *title; SnStatus status; bool always_use_pixbuf; enum InjectMode mode; xcb_window_t window_id; xcb_window_t container_id; xcb_connection_t *conn; uint tooltip_freeze; uint dbus_watch_id; gulong dbus_sid; uint dbus_owner_id; uint dbus_reg_id; GDBusProxy *dbus_proxy; GDBusConnection *dbus_conn; GError *dbus_err; bool initialized; bool registered; } StatusNotifierItemPrivate; static uint uniq_id = 0; static GParamSpec *sn_item_props[NB_PROPS] = { NULL, }; static uint sn_item_signals[NB_SIGNALS] = { 0, }; #define notify(sn, prop) g_object_notify_by_pspec((GObject *)sn, sn_item_props[prop]) static void sn_item_set_property(GObject *object, uint prop_id, const GValue *value, GParamSpec *pspec); static void sn_item_get_property(GObject *object, uint prop_id, GValue *value, GParamSpec *pspec); static void sn_item_finalize(GObject *object); G_DEFINE_TYPE_WITH_PRIVATE(StatusNotifierItem, sn_item, G_TYPE_OBJECT) static void sn_item_class_init(StatusNotifierItemClass *klass) { GObjectClass *o_class; o_class = G_OBJECT_CLASS(klass); o_class->set_property = sn_item_set_property; o_class->get_property = sn_item_get_property; o_class->finalize = sn_item_finalize; sn_item_props[PROP_ID] = g_param_spec_string("id", "id", "Unique application identifier", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); sn_item_props[PROP_TITLE] = g_param_spec_string("title", "title", "Descriptive name for the item", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); sn_item_props[PROP_CATEGORY] = g_param_spec_enum("category", "category", "Category of the item", sn_category_get_type(), SN_CATEGORY_APPLICATION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); sn_item_props[PROP_STATUS] = g_param_spec_enum("status", "status", "Status of the item", sn_status_get_type(), SN_STATUS_PASSIVE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); sn_item_props[PROP_CONNECTION] = g_param_spec_pointer("connection", "connection", "XCB connection to serve for XWwindow", G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); sn_item_props[PROP_WINDOW_ID] = g_param_spec_uint("window-id", "window-id", "XCB Window ID for XWindow", 0, G_MAXUINT, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_properties(o_class, NB_PROPS, sn_item_props); sn_item_signals[SIGNAL_REGISTRATION_FAILED] = g_signal_new("registration-failed", sn_item_get_type(), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(StatusNotifierItemClass, registration_failed), NULL, NULL, g_cclosure_marshal_VOID__BOXED, G_TYPE_NONE, 1, G_TYPE_ERROR); } static void sn_item_init(StatusNotifierItem *sn) { } static void dbus_free(StatusNotifierItem *sn) { StatusNotifierItemPrivate *priv = (StatusNotifierItemPrivate *)sn_item_get_instance_private(sn); if (priv->dbus_watch_id > 0) { g_bus_unwatch_name(priv->dbus_watch_id); priv->dbus_watch_id = 0; } if (priv->dbus_sid > 0) { g_signal_handler_disconnect(priv->dbus_proxy, priv->dbus_sid); priv->dbus_sid = 0; } if (G_LIKELY(priv->dbus_owner_id > 0)) { g_bus_unown_name(priv->dbus_owner_id); priv->dbus_owner_id = 0; } if (priv->dbus_proxy) { g_clear_object(&priv->dbus_proxy); priv->dbus_proxy = NULL; } if (priv->dbus_reg_id > 0) { g_dbus_connection_unregister_object(priv->dbus_conn, priv->dbus_reg_id); priv->dbus_reg_id = 0; } if (priv->dbus_conn) { g_clear_object(&priv->dbus_conn); priv->dbus_conn = NULL; } } static void sn_item_finalize(GObject *object) { StatusNotifierItem *sn = (StatusNotifierItem *)object; StatusNotifierItemPrivate *priv = (StatusNotifierItemPrivate *)sn_item_get_instance_private(sn); g_free(priv->id); g_free(priv->title); dbus_free(sn); G_OBJECT_CLASS(sn_item_parent_class)->finalize(object); } static void dbus_notify(StatusNotifierItem *sn, uint prop) { StatusNotifierItemPrivate *priv = (StatusNotifierItemPrivate *)sn_item_get_instance_private(sn); const char *signal; if (!priv->registered) return; switch (prop) { case PROP_STATUS: { signal = "NewStatus"; g_dbus_connection_emit_signal(priv->dbus_conn, NULL, ITEM_OBJECT, ITEM_INTERFACE, signal, g_variant_new("(s)", sn_status_get_nick(priv->status)), NULL); return; } case PROP_TITLE: signal = "NewTitle"; break; case PROP_ICON: signal = "NewIcon"; break; default: g_return_if_reached(); } g_dbus_connection_emit_signal(priv->dbus_conn, NULL, ITEM_OBJECT, ITEM_INTERFACE, signal, NULL, NULL); } StatusNotifierItem *status_notifier_item_new_from_xcb_window(const char *id, SnCategory category, xcb_connection_t *conn, xcb_window_t window) { return (StatusNotifierItem *)g_object_new(sn_item_get_type(), "id", id, "category", category, "connection", conn, "window-id", window, NULL); } void sn_item_set_title(StatusNotifierItem *sn, const char *title) { StatusNotifierItemPrivate *priv; g_return_if_fail(SN_IS_ITEM(sn)); priv = (StatusNotifierItemPrivate *)sn_item_get_instance_private(sn); g_free(priv->title); priv->title = g_strdup(title); notify(sn, PROP_TITLE); dbus_notify(sn, PROP_TITLE); } void sn_item_set_status(StatusNotifierItem *sn, SnStatus status) { StatusNotifierItemPrivate *priv; g_return_if_fail(SN_IS_ITEM(sn)); priv = (StatusNotifierItemPrivate *)sn_item_get_instance_private(sn); priv->status = status; notify(sn, PROP_STATUS); dbus_notify(sn, PROP_STATUS); } SnStatus sn_item_get_status(StatusNotifierItem *sn) { g_return_val_if_fail(SN_IS_ITEM(sn), -1); StatusNotifierItemPrivate *priv = (StatusNotifierItemPrivate *)sn_item_get_instance_private(sn); return priv->status; } void sn_item_set_window_id(StatusNotifierItem *sn, u_int32_t window_id) { StatusNotifierItemPrivate *priv; g_return_if_fail(SN_IS_ITEM(sn)); priv = (StatusNotifierItemPrivate *)sn_item_get_instance_private(sn); priv->window_id = window_id; notify(sn, PROP_WINDOW_ID); } void sn_item_send_click(StatusNotifierItem *sn, uint8_t mouseButton, int x, int y) { // it's best not to look at this code // GTK doesn't like send_events and double checks the mouse position matches where the // window is and is top level // in order to solve this we move the embed container over to where the mouse is then replay // the event using send_event // if patching, test with xchat + xchat context menus // note x,y are not actually where the mouse is, but the plasmoid // ideally we should make this match the plasmoid hit area g_debug("sn: received click %d with x=%d,y=%d\n", mouseButton, x, y); StatusNotifierItemPrivate *priv = (StatusNotifierItemPrivate *)sn_item_get_instance_private(sn); xcb_get_geometry_cookie_t cookieSize = xcb_get_geometry(priv->conn, priv->window_id); g_autofree xcb_get_geometry_reply_t *clientGeom = xcb_get_geometry_reply(priv->conn, cookieSize, NULL); if (!clientGeom) { return; } xcb_query_pointer_cookie_t cookie = xcb_query_pointer(priv->conn, priv->window_id); g_autofree xcb_query_pointer_reply_t *pointer = xcb_query_pointer_reply(priv->conn, cookie, NULL); /*qCDebug(SNIPROXY) << "samescreen" << pointer->same_screen << endl << "root x*y" << pointer->root_x << pointer->root_y << endl << "win x*y" << pointer->win_x << pointer->win_y;*/ // move our window so the mouse is within its geometry uint32_t configVals[2] = { 0, 0 }; if (mouseButton >= XCB_BUTTON_INDEX_4) { // scroll event, take pointer position configVals[0] = pointer->root_x; configVals[1] = pointer->root_y; } else { if (pointer->root_x > x + clientGeom->width) configVals[0] = pointer->root_x - clientGeom->width + 1; else configVals[0] = (uint32_t)(x); if (pointer->root_y > y + clientGeom->height) configVals[1] = pointer->root_y - clientGeom->height + 1; else configVals[1] = (uint32_t)(y); } xcb_configure_window(priv->conn, priv->container_id, XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y, configVals); // pull window up const uint32_t stackAboveData[] = { XCB_STACK_MODE_ABOVE }; xcb_configure_window(priv->conn, priv->container_id, XCB_CONFIG_WINDOW_STACK_MODE, stackAboveData); // mouse down if (priv->mode == INJECT_DIRECT) { xcb_button_press_event_t *event = (xcb_button_press_event_t *)g_malloc0(sizeof(xcb_button_press_event_t)); memset(event, 0x00, sizeof(xcb_button_press_event_t)); event->response_type = XCB_BUTTON_PRESS; event->event = priv->window_id; event->time = xcb_get_timestamp_for_connection(priv->conn); event->same_screen = 1; event->root = xcb_get_screen_for_connection(priv->conn, 0)->root; event->root_x = x; event->root_y = y; event->event_x = 0; event->event_y = 0; event->child = 0; event->state = 0; event->detail = mouseButton; xcb_send_event(priv->conn, false, priv->window_id, XCB_EVENT_MASK_BUTTON_PRESS, (char *)event); g_free(event); } else { sendXTestPressed(priv->conn, mouseButton); } // mouse up if (priv->mode == INJECT_DIRECT) { xcb_button_release_event_t *event = (xcb_button_press_event_t *)g_malloc0(sizeof(xcb_button_release_event_t)); memset(event, 0x00, sizeof(xcb_button_release_event_t)); event->response_type = XCB_BUTTON_RELEASE; event->event = priv->window_id; event->time = xcb_get_timestamp_for_connection(priv->conn); event->same_screen = 1; event->root = xcb_get_screen_for_connection(priv->conn, 0)->root; event->root_x = x; event->root_y = y; event->event_x = 0; event->event_y = 0; event->child = 0; event->state = 0; event->detail = mouseButton; xcb_send_event(priv->conn, false, priv->window_id, XCB_EVENT_MASK_BUTTON_RELEASE, (char *)event); g_free(event); } else { sendXTestReleased(priv->conn, mouseButton); } #ifndef VISUAL_DEBUG const uint32_t stackBelowData[] = { XCB_STACK_MODE_BELOW }; xcb_configure_window(priv->conn, priv->container_id, XCB_CONFIG_WINDOW_STACK_MODE, stackBelowData); #endif } static void method_call(GDBusConnection *conn _UNUSED_, const char *sender _UNUSED_, const char *object _UNUSED_, const char *interface _UNUSED_, const char *method, GVariant *params, GDBusMethodInvocation *invocation, gpointer data) { StatusNotifierItem *sn = (StatusNotifierItem *)data; StatusNotifierItemPrivate *priv = (StatusNotifierItemPrivate *)sn_item_get_instance_private(sn); uint signal; gint x, y; bool ret; if (!g_strcmp0(method, "Scroll")) { gint delta, orientation; char *s_orientation; g_variant_get(params, "(is)", &delta, &s_orientation); if (!g_ascii_strcasecmp(s_orientation, "vertical")) { sn_item_send_click(sn, delta > 0 ? XCB_BUTTON_INDEX_4 : XCB_BUTTON_INDEX_5, 0, 0); } else { sn_item_send_click(sn, delta > 0 ? 6 : 7, 0, 0); } g_free(s_orientation); return; } else if (!g_strcmp0(method, "ContextMenu")) { g_variant_get(params, "(ii)", &x, &y); sn_item_send_click(sn, XCB_BUTTON_INDEX_3, x, y); } else if (!g_strcmp0(method, "Activate")) { g_variant_get(params, "(ii)", &x, &y); sn_item_send_click(sn, XCB_BUTTON_INDEX_1, x, y); } else if (!g_strcmp0(method, "SecondaryActivate")) { g_variant_get(params, "(ii)", &x, &y); sn_item_send_click(sn, XCB_BUTTON_INDEX_2, x, y); } else /* should never happen */ g_return_if_reached(); g_dbus_method_invocation_return_value(invocation, NULL); } static GVariantBuilder *get_builder_for_xcb_window(StatusNotifierItem *sn) { StatusNotifierItemPrivate *priv = (StatusNotifierItemPrivate *)sn_item_get_instance_private(sn); GVariantBuilder *builder; cairo_surface_t *surface; cairo_t *cr; gint width, height, stride; uint *data; // TODO: Implement this. return builder; } static void sn_item_set_property(GObject *object, uint prop_id, const GValue *value, GParamSpec *pspec) { StatusNotifierItem *sn = (StatusNotifierItem *)object; StatusNotifierItemPrivate *priv = (StatusNotifierItemPrivate *)sn_item_get_instance_private(sn); switch (prop_id) { case PROP_ID: /* G_PARAM_CONSTRUCT_ONLY */ priv->id = g_value_dup_string(value); break; case PROP_TITLE: sn_item_set_title(sn, g_value_get_string(value)); break; case PROP_CATEGORY: /* G_PARAM_CONSTRUCT_ONLY */ priv->category = g_value_get_enum(value); break; case PROP_STATUS: sn_item_set_status(sn, g_value_get_enum(value)); break; case PROP_WINDOW_ID: sn_item_set_window_id(sn, g_value_get_uint(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void sn_item_get_property(GObject *object, uint prop_id, GValue *value, GParamSpec *pspec) { StatusNotifierItem *sn = (StatusNotifierItem *)object; StatusNotifierItemPrivate *priv = (StatusNotifierItemPrivate *)sn_item_get_instance_private(sn); switch (prop_id) { case PROP_ID: g_value_set_string(value, priv->id); break; case PROP_TITLE: g_value_set_string(value, priv->title); break; case PROP_CATEGORY: g_value_set_enum(value, priv->category); break; case PROP_STATUS: g_value_set_enum(value, priv->status); break; case PROP_WINDOW_ID: g_value_set_uint(value, priv->window_id); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static GVariant *get_prop(GDBusConnection *conn _UNUSED_, const char *sender _UNUSED_, const char *object _UNUSED_, const char *interface _UNUSED_, const char *property, GError **error _UNUSED_, gpointer data) { StatusNotifierItem *sn = (StatusNotifierItem *)data; StatusNotifierItemPrivate *priv = (StatusNotifierItemPrivate *)sn_item_get_instance_private(sn); if (!g_strcmp0(property, "Id")) return g_variant_new("s", priv->id); else if (!g_strcmp0(property, "Category")) { return g_variant_new("s", sn_category_get_nick(priv->category)); } else if (!g_strcmp0(property, "Title")) return g_variant_new("s", (priv->title) ? priv->title : ""); else if (!g_strcmp0(property, "Status")) return g_variant_new("s", sn_status_get_nick(priv->status)); else if (!g_strcmp0(property, "WindowId")) return g_variant_new("i", priv->window_id); else if (!g_strcmp0(property, "IconPixmap")) return g_variant_new("a(iiay)", get_builder_for_xcb_window(sn)); else if (!g_strcmp0(property, "ItemIsMenu")) return g_variant_new("b", false); return NULL; } static void dbus_failed(StatusNotifierItem *sn, GError *error, bool fatal) { StatusNotifierItemPrivate *priv = (StatusNotifierItemPrivate *)sn_item_get_instance_private(sn); dbus_free(sn); g_signal_emit(sn, sn_item_signals[SIGNAL_REGISTRATION_FAILED], 0, error); g_error_free(error); } static void bus_acquired(GDBusConnection *conn, const char *name _UNUSED_, gpointer data) { GError *err = NULL; StatusNotifierItem *sn = (StatusNotifierItem *)data; StatusNotifierItemPrivate *priv = (StatusNotifierItemPrivate *)sn_item_get_instance_private(sn); GDBusInterfaceVTable interface_vtable = { .method_call = method_call, .get_property = get_prop, .set_property = NULL }; GDBusNodeInfo *info; info = g_dbus_node_info_new_for_xml(item_xml, NULL); priv->dbus_reg_id = g_dbus_connection_register_object(conn, ITEM_OBJECT, info->interfaces[0], &interface_vtable, sn, NULL, &err); g_dbus_node_info_unref(info); if (priv->dbus_reg_id == 0) { dbus_failed(sn, err, TRUE); return; } priv->dbus_conn = g_object_ref(conn); } static void register_item_cb(GObject *sce, GAsyncResult *result, gpointer data) { GError *err = NULL; StatusNotifierItem *sn = (StatusNotifierItem *)data; StatusNotifierItemPrivate *priv = (StatusNotifierItemPrivate *)sn_item_get_instance_private(sn); GVariant *variant; variant = g_dbus_proxy_call_finish((GDBusProxy *)sce, result, &err); if (!variant) { dbus_failed(sn, err, TRUE); return; } g_variant_unref(variant); // notify(sn, PROP_STATE); } static void name_acquired(GDBusConnection *conn _UNUSED_, const char *name, gpointer data) { StatusNotifierItem *sn = (StatusNotifierItem *)data; StatusNotifierItemPrivate *priv = (StatusNotifierItemPrivate *)sn_item_get_instance_private(sn); g_dbus_proxy_call(priv->dbus_proxy, "RegisterStatusNotifierItem", g_variant_new("(s)", name), G_DBUS_CALL_FLAGS_NONE, -1, NULL, register_item_cb, sn); g_clear_object(&priv->dbus_proxy); priv->dbus_proxy = NULL; } static void name_lost(GDBusConnection *conn, const char *name _UNUSED_, gpointer data) { GError *err = NULL; StatusNotifierItem *sn = (StatusNotifierItem *)data; if (!conn) g_set_error(&err, SN_ERROR, SN_ERROR_NO_CONNECTION, "Failed to establish DBus connection"); else g_set_error(&err, SN_ERROR, SN_ERROR_NO_NAME, "Failed to acquire name for item"); dbus_failed(sn, err, TRUE); } static void dbus_reg_item(StatusNotifierItem *sn) { StatusNotifierItemPrivate *priv = (StatusNotifierItemPrivate *)sn_item_get_instance_private(sn); char buf[64], *b = buf; if (G_UNLIKELY( g_snprintf(buf, 64, "org.kde.StatusNotifierItem-%u-%u", getpid(), ++uniq_id) >= 64)) b = g_strdup_printf("org.kde.StatusNotifierItem-%u-%u", getpid(), uniq_id); priv->dbus_owner_id = g_bus_own_name(G_BUS_TYPE_SESSION, b, G_BUS_NAME_OWNER_FLAGS_NONE, bus_acquired, name_acquired, name_lost, sn, NULL); if (G_UNLIKELY(b != buf)) g_free(b); } static void watcher_signal(GDBusProxy *proxy _UNUSED_, const char *sender _UNUSED_, const char *signal, GVariant *params _UNUSED_, StatusNotifierItem *sn) { StatusNotifierItemPrivate *priv = (StatusNotifierItemPrivate *)sn_item_get_instance_private(sn); if (!g_strcmp0(signal, "StatusNotifierHostRegistered")) { g_signal_handler_disconnect(priv->dbus_proxy, priv->dbus_sid); priv->dbus_sid = 0; dbus_reg_item(sn); } } static void proxy_cb(GObject *sce _UNUSED_, GAsyncResult *result, gpointer data) { GError *err = NULL; StatusNotifierItem *sn = (StatusNotifierItem *)data; StatusNotifierItemPrivate *priv = (StatusNotifierItemPrivate *)sn_item_get_instance_private(sn); GVariant *variant; priv->dbus_proxy = g_dbus_proxy_new_for_bus_finish(result, &err); if (!priv->dbus_proxy) { dbus_failed(sn, err, TRUE); return; } variant = g_dbus_proxy_get_cached_property(priv->dbus_proxy, "IsStatusNotifierHostRegistered"); if (!variant || !g_variant_get_boolean(variant)) { GDBusProxy *proxy; g_set_error(&err, SN_ERROR, SN_ERROR_NO_HOST, "No Host registered on the Watcher"); if (variant) g_variant_unref(variant); /* keep the proxy, we'll wait for the signal when a host registers */ proxy = priv->dbus_proxy; /* (so dbus_free() from dbus_failed() doesn't unref) */ priv->dbus_proxy = NULL; dbus_failed(sn, err, FALSE); priv->dbus_proxy = proxy; priv->dbus_sid = g_signal_connect(priv->dbus_proxy, "g-signal", (GCallback)watcher_signal, sn); return; } g_variant_unref(variant); dbus_reg_item(sn); } static void watcher_appeared(GDBusConnection *conn _UNUSED_, const char *name _UNUSED_, const char *owner _UNUSED_, gpointer data) { StatusNotifierItem *sn = data; StatusNotifierItemPrivate *priv = (StatusNotifierItemPrivate *)sn_item_get_instance_private(sn); GDBusNodeInfo *info; g_bus_unwatch_name(priv->dbus_watch_id); priv->dbus_watch_id = 0; info = g_dbus_node_info_new_for_xml(watcher_xml, NULL); g_dbus_proxy_new_for_bus(G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_NONE, info->interfaces[0], WATCHER_NAME, WATCHER_OBJECT, WATCHER_INTERFACE, NULL, proxy_cb, sn); g_dbus_node_info_unref(info); } static void watcher_vanished(GDBusConnection *conn _UNUSED_, const char *name _UNUSED_, gpointer data) { GError *err = NULL; StatusNotifierItem *sn = data; StatusNotifierItemPrivate *priv = (StatusNotifierItemPrivate *)sn_item_get_instance_private(sn); uint id; /* keep the watch active, so if a watcher shows up we'll resume the * registering automatically */ id = priv->dbus_watch_id; /* (so dbus_free() from dbus_failed() doesn't unwatch) */ priv->dbus_watch_id = 0; g_set_error(&err, SN_ERROR, SN_ERROR_NO_WATCHER, "No Watcher found"); dbus_failed(sn, err, FALSE); priv->dbus_watch_id = id; } void sn_item_register(StatusNotifierItem *sn) { StatusNotifierItemPrivate *priv; g_return_if_fail(SN_IS_ITEM(sn)); priv = (StatusNotifierItemPrivate *)sn_item_get_instance_private(sn); if (priv->registered) return; priv->dbus_watch_id = g_bus_watch_name(G_BUS_TYPE_SESSION, WATCHER_NAME, G_BUS_NAME_WATCHER_FLAGS_AUTO_START, watcher_appeared, watcher_vanished, sn, NULL); } xfce4-sntray-plugin-0.4.13.1/xembedsniproxy/sn.h000066400000000000000000000017041370304200600214270ustar00rootroot00000000000000#ifndef __SN_H__ #define __SN_H__ #include #include #include #include #include #include #include #include "sn-common.h" G_BEGIN_DECLS G_DECLARE_DERIVABLE_TYPE(StatusNotifierItem, sn_item, SN, ITEM, GObject) #define SN_ERROR g_quark_from_static_string("StatusNotifier error") typedef enum { SN_ERROR_NO_CONNECTION = 0, SN_ERROR_NO_NAME, SN_ERROR_NO_WATCHER, SN_ERROR_NO_HOST } StatusNotifierError; struct _StatusNotifierItemClass { GObjectClass parent_class; /* signals */ void (*registration_failed)(StatusNotifierItem *sn, GError *error); }; StatusNotifierItem *status_notifier_item_new_from_xcb_window(const char *id, SnCategory category, xcb_connection_t *conn, xcb_window_t window); G_END_DECLS #endif /* __SN_H__ */ xfce4-sntray-plugin-0.4.13.1/xembedsniproxy/sni-enums.c.template000066400000000000000000000033671370304200600245410ustar00rootroot00000000000000/*** BEGIN file-header ***/ #include "sni-enums.h" /*** END file-header ***/ /*** BEGIN file-production ***/ /* enumerations from "@filename@" */ #include "@filename@" /*** END file-production ***/ /*** BEGIN value-header ***/ GType @enum_name@_get_type (void) { static GType the_type = 0; if (the_type == 0) { static const G@Type@Value values[] = { /*** END value-header ***/ /*** BEGIN value-production ***/ { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, /*** END value-production ***/ /*** BEGIN value-tail ***/ { 0, NULL, NULL } }; the_type = g_@type@_register_static ( g_intern_static_string ("@EnumName@"), values); } return the_type; } /** @enum_name@_get_nick: @value: The value of @EnumName@ to get the nick of Looks up in the enum table for the nick of @value. Return value: The nick for the given value or #NULL on error */ const char * @enum_name@_get_nick (@EnumName@ value) { GEnumClass * class = G_ENUM_CLASS(g_type_class_ref(@enum_name@_get_type())); g_return_val_if_fail(class != NULL, NULL); const char * ret = NULL; GEnumValue * val = g_enum_get_value(class, value); if (val != NULL) { ret = val->value_nick; } g_type_class_unref(class); return ret; } /** @enum_name@_get_value_from_nick: @nick: The enum nick to lookup Looks up in the enum table for the value of @nick. Return value: The value for the given @nick */ @EnumName@ @enum_name@_get_value_from_nick (const char * nick) { GEnumClass * class = G_ENUM_CLASS(g_type_class_ref(@enum_name@_get_type())); g_return_val_if_fail(class != NULL, 0); @EnumName@ ret = 0; GEnumValue * val = g_enum_get_value_by_nick(class, nick); if (val != NULL) { ret = val->value; } g_type_class_unref(class); return ret; } /*** END value-tail ***/ xfce4-sntray-plugin-0.4.13.1/xembedsniproxy/sni-enums.h.template000066400000000000000000000013041370304200600245330ustar00rootroot00000000000000/*** BEGIN file-header ***/ #ifndef VALA_PANEL_ENUM_TYPES_H #define VALA_PANEL_ENUM_TYPES_H #include G_BEGIN_DECLS /*** END file-header ***/ /*** BEGIN file-production ***/ /* Enumerations from "@filename@" */ #include "@basename@" /*** END file-production ***/ /*** BEGIN enumeration-production ***/ #define SN_TYPE_@ENUMSHORT@ (@enum_name@_get_type()) GType @enum_name@_get_type (void) G_GNUC_CONST; const char * @enum_name@_get_nick (@EnumName@ value) G_GNUC_CONST; @EnumName@ @enum_name@_get_value_from_nick (const char * nick) G_GNUC_CONST; /*** END enumeration-production ***/ /*** BEGIN file-tail ***/ G_END_DECLS #endif /* VALA_PANEL_ENUM_TYPES_H */ /*** END file-tail ***/ xfce4-sntray-plugin-0.4.13.1/xembedsniproxy/xcb-tray.c000066400000000000000000000202541370304200600225340ustar00rootroot00000000000000#include #include #include #include #include #include #include #include #include #include #include #define SYSTEM_TRAY_REQUEST_DOCK 0 void clientmessage(xcb_client_message_event_t *); void event_handle(xcb_generic_event_t *); void update_systray(unsigned int, unsigned int); char *get_atom_name(xcb_atom_t); xcb_connection_t *conn; xcb_window_t bar_id; xcb_pixmap_t bar_buffer; xcb_screen_t *screen; uint16_t wpx, hpx; int xrandr_eventbase; volatile sig_atomic_t running = 1; unsigned int mapped = 0; enum { _NET_SYSTEM_TRAY_OPCODE, _XEMBED, MANAGER, XEMBED_EMBEDDED_NOTIFY, }; struct mapped_clients { unsigned char cidx; uint32_t cid; TAILQ_ENTRY(mapped_clients) entries; }; TAILQ_HEAD(foo, mapped_clients) mapped_clients_head; struct ewmh_hint { char *name; xcb_atom_t atom; } ewmh[10] = { { "_NET_SYSTEM_TRAY_OPCODE", XCB_ATOM_NONE }, { "_XEMBED", XCB_ATOM_NONE }, { "MANAGER", XCB_ATOM_NONE }, { "XEMBED_EMBEDDED_NOTIFY", XCB_ATOM_NONE }, }; void clientmessage(xcb_client_message_event_t *e) { uint32_t values[2]; uint32_t buf[32]; char *name; unsigned long xembed_info[2]; struct mapped_clients *t_client, *t_clients; unsigned char mapping; t_clients = t_client = malloc(sizeof(*t_client)); mapping = 0; if (!TAILQ_EMPTY(&mapped_clients_head)) { t_clients = TAILQ_LAST(&mapped_clients_head, foo); mapping = t_clients->cidx + 1; } printf("Mapped clients %d\n", mapping + 1); name = get_atom_name(e->type); t_client->cid = e->data.data32[2]; t_client->cidx = mapping; printf("clientmessage: window: 0x%x, atom: %s(%u), client 0x%x\n", e->window, name, e->type, t_client->cid); free(name); if (!(e->data.data32[1] == SYSTEM_TRAY_REQUEST_DOCK) && !(e->type == ewmh[_NET_SYSTEM_TRAY_OPCODE].atom && e->format == 32)) return; values[0] = 16; values[1] = 16; xcb_configure_window(conn, t_client->cid, XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, values); xcb_client_message_event_t *ev = (xcb_client_message_event_t *)buf; ev->response_type = XCB_CLIENT_MESSAGE; ev->window = t_client->cid; ev->type = ewmh[_XEMBED].atom; ev->format = 32; ev->data.data32[0] = XCB_CURRENT_TIME; ev->data.data32[1] = ewmh[XEMBED_EMBEDDED_NOTIFY].atom; ev->data.data32[2] = bar_id; ev->data.data32[3] = 1; xcb_send_event(conn, 0, t_client->cid, XCB_EVENT_MASK_NO_EVENT, (char *)e); xcb_change_save_set(conn, XCB_SET_MODE_INSERT, t_client->cid); update_systray(t_client->cid, mapping); TAILQ_INSERT_TAIL(&mapped_clients_head, t_client, entries); } void update_systray(unsigned int cid, unsigned int slot) { xcb_reparent_window(conn, cid, bar_id, (wpx - 16) - slot * 18, 0); xcb_map_window(conn, cid); xcb_flush(conn); } char *get_atom_name(xcb_atom_t atom) { char *name = NULL; #if 0 /* * This should be disabled during most debugging since * xcb_get_* causes an xcb_flush. */ size_t len; xcb_get_atom_name_reply_t *r; r = xcb_get_atom_name_reply(conn, xcb_get_atom_name(conn, atom), NULL); if (r) { len = xcb_get_atom_name_name_length(r); if (len > 0) { name = malloc(len + 1); if (name) { memcpy(name, xcb_get_atom_name_name(r), len); name[len] = '\0'; } } free(r); } #else (void)atom; #endif return (name); } void unmapnotify(xcb_unmap_notify_event_t *e) { struct mapped_clients *t_client; uint32_t cid; int mappings; char changed; cid = e->window; changed = 0; mappings = 0; TAILQ_FOREACH(t_client, &mapped_clients_head, entries) { if (t_client->cid == cid) { TAILQ_REMOVE(&mapped_clients_head, t_client, entries); changed = 1; } else { mappings++; if (changed) { t_client->cidx = mappings - 1; update_systray(t_client->cid, t_client->cidx); } } } printf("%d clients left\n", mappings); } void event_handle(xcb_generic_event_t *evt) { uint8_t type = XCB_EVENT_RESPONSE_TYPE(evt); printf("Event type %s(%u)\n", xcb_event_get_label(type), type); switch (type) { #define EVENT(type, callback) \ case type: \ callback((void *)evt); \ return EVENT(XCB_CLIENT_MESSAGE, clientmessage); EVENT(XCB_DESTROY_NOTIFY, unmapnotify); #undef EVENT } if (type - xrandr_eventbase == XCB_RANDR_SCREEN_CHANGE_NOTIFY) { printf("jackpot\n"); } } int main(void) { char atomname[strlen("_NET_SYSTEM_TRAY_S") + 11]; char *title = "Hello World !"; uint32_t wa[3], buf[32]; xcb_drawable_t bar; xcb_intern_atom_cookie_t stc; xcb_intern_atom_reply_t *bar_rpy; xcb_get_selection_owner_cookie_t gsoc; xcb_get_selection_owner_reply_t *gso_rpy; xcb_client_message_event_t *ev = (xcb_client_message_event_t *)buf; xcb_generic_event_t *evt; xcb_randr_query_version_cookie_t c; xcb_randr_query_version_reply_t *r; const xcb_query_extension_reply_t *qep; TAILQ_INIT(&mapped_clients_head); conn = xcb_connect(NULL, NULL); bar_id = xcb_generate_id(conn); screen = xcb_setup_roots_iterator(xcb_get_setup(conn)).data; wpx = screen->width_in_pixels; hpx = screen->height_in_pixels; wa[0] = screen->white_pixel; wa[1] = 1; wa[2] = XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY; xcb_create_window(conn, 0, bar_id, screen->root, 0, hpx - 16, wpx, 16, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, screen->root_visual, XCB_CW_BACK_PIXEL | XCB_CW_OVERRIDE_REDIRECT | XCB_CW_EVENT_MASK, wa); xcb_change_property(conn, XCB_PROP_MODE_REPLACE, bar_id, XCB_ATOM_WM_NAME, XCB_ATOM_STRING, 8, strlen(title), title); xcb_map_window(conn, bar_id); /* System Tray Stuff */ snprintf(atomname, strlen("_NET_SYSTEM_TRAY_S") + 11, "_NET_SYSTEM_TRAY_S0"); stc = xcb_intern_atom(conn, 0, strlen(atomname), atomname); if (!(bar_rpy = xcb_intern_atom_reply(conn, stc, NULL))) errx(1, "could not get atom %s\n", atomname); xcb_set_selection_owner(conn, bar_id, bar_rpy->atom, XCB_CURRENT_TIME); gsoc = xcb_get_selection_owner(conn, bar_rpy->atom); if (!(gso_rpy = xcb_get_selection_owner_reply(conn, gsoc, NULL))) errx(1, "could not get selection owner for %s\n", atomname); if (gso_rpy->owner != bar_id) { warnx("Another system tray running?\n"); free(gso_rpy); return (1); } printf("Selection owner id: %x\n", gso_rpy->owner); /* Let everybody know that there is a system tray running */ ev->response_type = XCB_CLIENT_MESSAGE; ev->window = screen->root; ev->type = ewmh[MANAGER].atom; ev->format = 32; ev->data.data32[0] = XCB_CURRENT_TIME; ev->data.data32[1] = bar_rpy->atom; ev->data.data32[2] = bar_id; xcb_send_event(conn, 0, screen->root, 0xFFFFFF, (char *)buf); /* initial Xrandr setup */ qep = xcb_get_extension_data(conn, &xcb_randr_id); if (qep->present) { c = xcb_randr_query_version(conn, 1, 1); r = xcb_randr_query_version_reply(conn, c, NULL); if (r) { if (r->major_version >= 1) { xrandr_eventbase = qep->first_event; printf("XRandR supported\n"); } free(r); } } printf("wxh: %ux%u\n", screen->width_in_pixels, screen->height_in_pixels); while (running) { nanosleep((struct timespec[]){ { 0, 500000000 } }, NULL); xcb_aux_sync(conn); while ((evt = xcb_wait_for_event(conn))) { event_handle(evt); free(evt); } } return 0; } xfce4-sntray-plugin-0.4.13.1/xembedsniproxy/xcb-utils.c000066400000000000000000000176141370304200600227230ustar00rootroot00000000000000/* * Copyright (C) 2017 David Edmundson * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include "xcb-utils.h" #include #include #include "xcb-utils.h" #include #include /* X11 temporary atom */ xcb_atom_t a_CLIP_TEMPORARY; /* X11 data types */ xcb_atom_t a_UTF8_STRING; xcb_atom_t a_XROOTPMAP_ID; /* SYSTEM TRAY spec */ xcb_atom_t a_XEMBED; xcb_atom_t a_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR; xcb_atom_t a_NET_SYSTEM_TRAY_OPCODE; xcb_atom_t a_NET_SYSTEM_TRAY_MESSAGE_DATA; xcb_atom_t a_NET_SYSTEM_TRAY_ORIENTATION; xcb_atom_t a_NET_SYSTEM_TRAY_VISUAL; xcb_atom_t a_MANAGER; enum { I_UTF8_STRING, I_XROOTPMAP_ID, I_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR, I_NET_SYSTEM_TRAY_OPCODE, I_NET_SYSTEM_TRAY_MESSAGE_DATA, I_NET_SYSTEM_TRAY_ORIENTATION, I_NET_SYSTEM_TRAY_VISUAL, I_MANAGER, I_CLIP_TEMPORARY, I_XEMBED, N_ATOMS }; void resolve_atoms(xcb_connection_t *con) { static const char *atom_names[N_ATOMS]; atom_names[I_UTF8_STRING] = "UTF8_STRING"; atom_names[I_XROOTPMAP_ID] = "_XROOTPMAP_ID"; atom_names[I_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR] = "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR"; atom_names[I_NET_SYSTEM_TRAY_OPCODE] = "_NET_SYSTEM_TRAY_OPCODE"; atom_names[I_NET_SYSTEM_TRAY_MESSAGE_DATA] = "_NET_SYSTEM_TRAY_MESSAGE_DATA"; atom_names[I_NET_SYSTEM_TRAY_ORIENTATION] = "_NET_SYSTEM_TRAY_ORIENTATION"; atom_names[I_NET_SYSTEM_TRAY_VISUAL] = "_NET_SYSTEM_TRAY_VISUAL"; atom_names[I_MANAGER] = "MANAGER"; atom_names[I_XEMBED] = "_XEMBED"; atom_names[I_CLIP_TEMPORARY] = "CLIP_TEMPORARY"; xcb_atom_t atoms[N_ATOMS]; for (int i = 0; i < N_ATOMS; i++) { uint16_t len = (uint16_t)strlen(atom_names[i]); xcb_intern_atom_cookie_t cookie = xcb_intern_atom(con, 0, len, atom_names[i]); g_autofree xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(con, cookie, NULL); /* ... do other work here if possible ... */ if (!reply) { g_warning("Error: unable to return Atoms"); return; } else { atoms[i] = reply->atom; } } a_UTF8_STRING = atoms[I_UTF8_STRING]; a_XROOTPMAP_ID = atoms[I_XROOTPMAP_ID]; a_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR = atoms[I_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR]; a_NET_SYSTEM_TRAY_OPCODE = atoms[I_NET_SYSTEM_TRAY_OPCODE]; a_NET_SYSTEM_TRAY_MESSAGE_DATA = atoms[I_NET_SYSTEM_TRAY_MESSAGE_DATA]; a_NET_SYSTEM_TRAY_ORIENTATION = atoms[I_NET_SYSTEM_TRAY_ORIENTATION]; a_NET_SYSTEM_TRAY_VISUAL = atoms[I_NET_SYSTEM_TRAY_VISUAL]; a_MANAGER = atoms[I_MANAGER]; a_XEMBED = atoms[I_XEMBED]; a_CLIP_TEMPORARY = atoms[I_CLIP_TEMPORARY]; return; } void xembed_message_send(xcb_connection_t *conn, xcb_window_t towin, long message, long d1, long d2, long d3) { xcb_client_message_event_t ev; ev.response_type = XCB_CLIENT_MESSAGE; ev.window = towin; ev.format = 32; ev.data.data32[0] = XCB_CURRENT_TIME; ev.data.data32[1] = message; ev.data.data32[2] = d1; ev.data.data32[3] = d2; ev.data.data32[4] = d3; ev.type = a_XEMBED; xcb_send_event(conn, false, towin, XCB_EVENT_MASK_NO_EVENT, (char *)&ev); } void xcb_connection_set_composited_for_xcb_window(xcb_connection_t *c, xcb_window_t win, bool composited) { xcb_screen_t *screen = xcb_setup_roots_iterator(xcb_get_setup(c)).data; xcb_visualid_t trayVisual = screen->root_visual; if (composited) { xcb_depth_iterator_t depth_iterator = xcb_screen_allowed_depths_iterator(screen); xcb_depth_t *depth = NULL; while (depth_iterator.rem) { if (depth_iterator.data->depth == 32) { depth = depth_iterator.data; break; } xcb_depth_next(&depth_iterator); } if (depth) { xcb_visualtype_iterator_t visualtype_iterator = xcb_depth_visuals_iterator(depth); while (visualtype_iterator.rem) { xcb_visualtype_t *visualtype = visualtype_iterator.data; if (visualtype->_class == XCB_VISUAL_CLASS_TRUE_COLOR) { trayVisual = visualtype->visual_id; break; } xcb_visualtype_next(&visualtype_iterator); } } } xcb_change_property(c, XCB_PROP_MODE_REPLACE, win, a_NET_SYSTEM_TRAY_VISUAL, XCB_ATOM_VISUALID, 32, 1, &trayVisual); } xcb_screen_t *xcb_get_screen_for_connection(xcb_connection_t *connection, int screen_num) { xcb_screen_t *screen = NULL; xcb_screen_iterator_t iter = xcb_setup_roots_iterator(xcb_get_setup(connection)); for (; iter.rem; --screen_num, xcb_screen_next(&iter)) if (screen_num == 0) { screen = iter.data; break; } return screen; } xcb_window_t xcb_get_root_for_connection(xcb_connection_t *connection, int screen_num) { xcb_screen_t *screen = xcb_get_screen_for_connection(connection, screen_num); if (screen) return screen->root; return 0; } xcb_atom_t xcb_atom_get_for_connection(xcb_connection_t *connection, const char *atom_name) { xcb_intern_atom_cookie_t atom_q; xcb_intern_atom_reply_t *atom_r; g_autofree char *true_atom_name = xcb_atom_name_by_screen(atom_name, 0); if (!true_atom_name) g_warning("error getting %s atom name", atom_name); atom_q = xcb_intern_atom_unchecked(connection, false, strlen(true_atom_name), true_atom_name); atom_r = xcb_intern_atom_reply(connection, atom_q, NULL); if (!atom_r) g_warning("error getting %s atom", true_atom_name); return atom_r->atom; } static bool check_xcb_event(xcb_generic_event_t *event, xcb_window_t root_win) { if (!event) return false; if ((event->response_type & ~0x80) != XCB_PROPERTY_NOTIFY) { return false; } else { xcb_property_notify_event_t *pn = (xcb_property_notify_event_t *)(event); if ((pn->window == root_win) && (pn->atom == a_CLIP_TEMPORARY)) return true; } return false; } xcb_timestamp_t xcb_get_timestamp_for_connection(xcb_connection_t *conn) { // send a dummy event to myself to get the timestamp from X server. xcb_window_t root_win = xcb_get_screen_for_connection(conn, 0)->root; xcb_change_property(conn, XCB_PROP_MODE_APPEND, root_win, a_CLIP_TEMPORARY, XCB_ATOM_INTEGER, 32, 0, NULL); xcb_flush(conn); xcb_generic_event_t *event = 0; bool check = false; // lets keep this inside a loop to avoid a possible race condition, where // reader thread has not yet had the time to acquire the mutex in order // to add the new set of events to its event queue while (!event && !check) { xcb_get_input_focus_cookie_t cookie = xcb_get_input_focus(conn); g_free(xcb_get_input_focus_reply(conn, cookie, NULL)); check = check_xcb_event(event, root_win); } xcb_property_notify_event_t *pn = (xcb_property_notify_event_t *)event; xcb_timestamp_t timestamp = pn->time; g_free(event); xcb_delete_property(conn, root_win, a_CLIP_TEMPORARY); return timestamp; } xfce4-sntray-plugin-0.4.13.1/xembedsniproxy/xcb-utils.h000066400000000000000000000044321370304200600227220ustar00rootroot00000000000000/* * Copyright (C) 2017 David Edmundson * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef XCBUTILS_H #define XCBUTILS_H #include #include /* X11 temporary atom */ extern xcb_atom_t a_CLIP_TEMPORARY; /* X11 data types */ extern xcb_atom_t a_UTF8_STRING; extern xcb_atom_t a_XROOTPMAP_ID; /* SYSTEM TRAY spec */ extern xcb_atom_t a_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR; extern xcb_atom_t a_NET_SYSTEM_TRAY_OPCODE; extern xcb_atom_t a_NET_SYSTEM_TRAY_MESSAGE_DATA; extern xcb_atom_t a_NET_SYSTEM_TRAY_ORIENTATION; extern xcb_atom_t a_NET_SYSTEM_TRAY_VISUAL; extern xcb_atom_t a_XEMBED; extern xcb_atom_t a_MANAGER; /* SYSTEM TRAY Protocol constants. */ #define SYSTEM_TRAY_REQUEST_DOCK 0 #define SYSTEM_TRAY_BEGIN_MESSAGE 1 #define SYSTEM_TRAY_CANCEL_MESSAGE 2 #define SYSTEM_TRAY_MESSAGE_DATA 3 #define SYSTEM_TRAY_ORIENTATION_HORZ 0 #define SYSTEM_TRAY_ORIENTATION_VERT 1 void resolve_atoms(xcb_connection_t *con); void xcb_connection_set_composited_for_xcb_window(xcb_connection_t *display, xcb_window_t win, bool composited); xcb_screen_t *xcb_get_screen_for_connection(xcb_connection_t *c, int screen); xcb_window_t xcb_get_root_for_connection(xcb_connection_t *connection, int screen_num); xcb_atom_t xcb_atom_get_for_connection(xcb_connection_t *connection, const char *atom_nate); xcb_timestamp_t xcb_get_timestamp_for_connection(xcb_connection_t *conn); void xembed_message_send(xcb_connection_t *conn, xcb_window_t towin, long message, long d1, long d2, long d3); #endif // XCBUTILS_H xfce4-sntray-plugin-0.4.13.1/xembedsniproxy/xtestsender.c000066400000000000000000000025551370304200600233570ustar00rootroot00000000000000/* * Copyright (C) 2017 David Edmundson * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include "xtestsender.h" #include #include int xcb_test_fake_button_event(xcb_connection_t *dpy, uint8_t button, bool is_press, uint32_t delay) { uint8_t type = is_press ? XCB_BUTTON_PRESS : XCB_BUTTON_RELEASE; xcb_test_fake_input(dpy, type, button, delay, XCB_NONE, 0, 0, 0); return 1; } void sendXTestPressed(xcb_connection_t *display, uint8_t button) { xcb_test_fake_button_event(display, button, true, 0); } void sendXTestReleased(xcb_connection_t *display, uint8_t button) { xcb_test_fake_button_event(display, button, false, 0); } xfce4-sntray-plugin-0.4.13.1/xembedsniproxy/xtestsender.h000066400000000000000000000021201370304200600233500ustar00rootroot00000000000000/* Wrap XLIB code in a new file as it defines keywords that conflict with Qt * * Copyright (C) 2017 David Edmundson * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef XTEST_SENDER_H #define XTEST_SENDER_H #include void sendXTestPressed(xcb_connection_t *display, uint8_t button); void sendXTestReleased(xcb_connection_t *display, uint8_t button); #endif