peony/0000755000175000017500000000000013635404631010635 5ustar fengfengpeony/translations/0000755000175000017500000000000013636050131013347 5ustar fengfengpeony/translations/peony-qt-desktop/0000755000175000017500000000000013640373337016605 5ustar fengfengpeony/translations/peony-qt-desktop/peony-qt-desktop_zh_CN.ts0000644000175000017500000002302613640373337023464 0ustar fengfeng Peony::DesktopIconView Desktop Icon View 桌面图标视图 New Folder 新建文件夹 set background 设置壁纸 Peony::DesktopMenu &Open in new Window 在新窗口中打开(&N) &Open "%1" 打开 "%1"(&O) Open "%1" &with... 打开方式...(&W) &More applications... 更多应用(&M) Open "%1" with... 打开方式... &Open 打开(&O) &Open %1 selected files 打开%1个选中文件(&O) &New... 新建(&N) Empty &File 空文件(&E) &Folder 文件夹(&F) New Folder 新建文件夹 View Type... 视图类型... &Small 小图标(&S) &Normal 中图标(&N) &Large 大图标(&L) &Huge 超大图标(&H) Sort By... 排序方式... Name 文件名称 File Type 文件类型 File Size 文件大小 Modified Date 修改日期 Sort Order... 排列顺序... Ascending Order 升序 Descending Order 降序 Zoom &In 放大(&I) Zoom &Out 缩小(&O) &Restore all 恢复全部(&R) &Clean the trash 清空回收站(&C) Delete Permanently 永久删除 Are you sure that you want to delete these files? Once you start a deletion, the files deleting will never be restored again. 确定删除这些文件?一旦确定这些文件将被永久删除且不可恢复。 &Copy 复制(&C) Cu&t 剪切(&T) &Delete 删除(&D) &Rename 重命名(&R) &Paste 粘贴(&P) &Refresh 刷新(&R) &Properties 属性(&P) Peony::DesktopWindow set background 设置壁纸 New Folder 新建文件夹 PeonyDesktopApplication Close the peony-qt desktop window 关闭桌面并退出 Close the peony desktop window 关闭桌面程序 Take over the dbus service. 接管DBus服务。 Take over the desktop displaying 接管桌面 peony/translations/libpeony-qt/0000755000175000017500000000000013640373337015625 5ustar fengfengpeony/translations/libpeony-qt/libpeony-qt_zh_CN.ts0000644000175000017500000023120713640373337021526 0ustar fengfeng ConnectServerDialog Connect to Sever 连接到服务器 Domain 域名 Password 密码 Save Password 记住密码 User 用户名 Anonymous 匿名登录 FileLabelModel Red 红色 Orange 橙色 Yellow 黄色 Green 绿色 Blue 蓝色 Purple 紫色 Gray 灰色 Transparent 透明 Error 错误 Label or color is duplicated. 标签或者颜色重复 Peony::AdvanceSearchBar Key Words 关键词 input key words... 输入关键词... Search Location 搜索路径 choose search path... 选择要搜索的位置... browse 浏览 File Type 文件类型 Choose File Type 选择文件类型 Modify Time 修改时间 Choose Modify Time 选择修改时间 File Size 文件大小 Choose file size 选择文件大小 show hidden file 显示隐藏文件 go back 后退 hidden advance search page 隐藏高级搜索界面 file name 文件名 content 内容 search 搜索 start search 开始搜索 Operate Tips 提示 Have no key words or search location! 没有关键字或路径! Search file name or content at least choose one! 搜索文件名或者内容请至少指定一个! Search content or file name at least choose one! 搜索文件名或者内容请至少指定一个! all 全部 file folder 文件夹 image 图片 video 视频 text file 文本 audio 音频 others 其它 today 今天 this week 本周 this month 本月 this year 今年 year ago 去年 tiny(0-16K) 极小 small(16k-1M) 较小 medium(1M-100M) 中等 big(100M-1G) 较大 large(>1G) 极大 Peony::AdvancedLocationBar Search Content... 搜索内容 Peony::BasicPropertiesPage Type: 类型: Display Name: 名称: Location: 路径: Overview: 概览: Time Created: 创建时间: Time Modified: 修改时间: Time Access: 访问时间: %1 files (include root files), %2 hidden 共%1个文件(包括顶层目录),有%2个隐藏文件 %1 total 共%1 Peony::ComputerPropertiesPage CPU Name: 处理器: CPU Core: 核心数: Memory Size: 内存: User Name: 用户名: Desktop: 桌面环境: You should mount this volume first 你需要挂载该卷才能查看信息 Name: 分区名: File System 文件系统 Total Space: 总容量: Used Space: 使用空间: Free Space: 剩余空间: Type: 文件系统: Unknown 未知的分区 Peony::CreateLinkInternalPlugin Create Link to Desktop 链接到桌面 Create Link to... 链接到... Choose a Directory to Create Link 选择创建链接的目录 Peony-Qt Create Link Extension 创建链接 Create Link Menu Extension. 创建链接. Peony::CreateTemplateOperation NewFile 新建文件 NewFolder 新建文件夹 Peony::DefaultPreviewPage Select the file you want to preview... 选择你想要预览的文件... Can not preview this file. 不能预览该文件. Can not preivew this file. 不能预览该文件 Peony::DefaultPreviewPageFactory Default Preview 详细信息 This is the Default Preview of peony-qt 显示文件的详细信息 Peony::DirectoryView::IconView Icon View 图标视图 Peony::DirectoryView::IconView2 Icon View 图标视图 Peony::DirectoryView::ListView List View 列表视图 Peony::DirectoryView::ListView2 List View 列表视图 Peony::DirectoryViewFactoryManager Icon View 图标视图 Peony::DirectoryViewMenu Open in &New Window 在新窗口中打开(&N) Open in New &Tab 在新标签页中打开(&T) &Open "%1" 打开“%1”(&O) Open "%1" in &New Window 在新窗口中打开“%1”(&N) Open "%1" in New &Tab 在新标签页中打开“%1”(&T) Open "%1" with... 选用其它应用打开“%1”... &More applications... 更多应用...(&M) &Open 打开(&O) &Open %1 selected files 打开%1个选中文件(&O) &New... 新建...(&N) Empty &File 空文件(&E) &Folder 文件夹(&F) New Folder 新建文件夹 View Type... 视图类型... Sort By... 排序类型... Name 文件名称 File Type 文件类型 File Size 文件大小 Modified Date 修改日期 Sort Order... 排序顺序... Ascending Order 升序 Descending Order 降序 Sort Preferences... 排序偏好... Folder First 文件夹优先 Chinese First 中文优先 Show Hidden 显示隐藏文件 &Copy 复制(&C) Cu&t 剪切(&T) &Delete 删除(&D) &Rename 重命名(&R) &Paste 粘贴(&P) &Refresh 刷新(&R) &Properties 属性(&P) &Clean the Trash 清空回收站(&C) Delete Permanently 永久删除 Are you sure that you want to delete these files? Once you start a deletion, the files deleting will never be restored again. 确定永久删除这些文件?一旦确定,这些文件将无法被恢复。 &Restore 还原(&R) Open Parent Folder in New Window 在新窗口中打开文件所在目录 Peony::DirectoryViewWidget Directory View 文件视图 Peony::FMWindow File Manager 文件管理器 advanced search 高级搜索 clear record 清空历史 Loaing... Press Esc to stop a loading. 正在加载...按下Esc键取消. Ctrl+H Show|Hidden Ctrl+H Undo 撤销 Redo 重做 Peony Qt 文件管理器 Authour: Yue Lan <lanyue@kylinos.cn> Meihong He <hemeihong@kylinos.cn> Copyright (C): 2019-2020, Tianjin KYLIN Information Technology Co., Ltd. 作者: Yue Lan <lanyue@kylinos.cn> Meihong He <hemeihong@kylinos.cn> 版权所有(C): 2019-2020,天津麒麟信息技术有限公司. Authour: Yue Lan <lanyue@kylinos.cn> Meihong He <hemeihong@kylinos.cn> Copyright (C): 2019, Tianjin KYLIN Information Technology Co., Ltd. 作者: Yue Lan <lanyue@kylinos.cn> Meihong He <hemeihong@kylinos.cn> 版权所有(C): 2019,天津麒麟信息技术有限公司. New Folder 新建文件夹 Peony::FileEnumerator Error 错误 Peony::FileItemModel child(ren) 个子项 Symbol Link, 快捷方式, File Name 文件名称 File Size 文件大小 File Type 文件类型 Modified Date 修改时间 Peony::FileLabelInternalMenuPlugin Add File Label... 添加标记... Delete All Label 删除所有标记 Peony File Labels Menu Extension 文件标记 Tag a File with Menu. 菜单中增加标记功能. Peony::FileLauchDialog Choose an Application to open this file 选择一个应用打开这个文件 Set as Default 设为默认 OK 确定 Cancel 取消 Peony::FileLaunchAction Open Failed 无法打开 Can not open %1 不能打开%1 Peony::FileLinkOperation - Symbolic Link - 快捷方式 Peony::FileMoveOperation Invalid move operation, cannot move a file itself. 非法的移动操作,不能自移动到自身。 Invalid Operation. 非法的操作. Invalid Operation 非法的操作 Peony::FileOperationAfterProgressPage &More Details 详细信息(&M) Peony::FileOperationErrorDialog File Operation Error 文件操作错误 unkwon 未知原因 null Error message: 错误信息: Source File: 源文件: Dest File: 目标文件: Ignore 忽略 Ignore All 全部忽略 Overwrite 覆盖 Overwrite All 全部覆盖 Backup 备份 Backup All 全部备份 &Retry 重试(&R) &Cancel 取消(&C) Peony::FileOperationInfo - Symbolic Link - 快捷方式 Peony::FileOperationManager Can't delete. 不能删除 You can't delete a file whenthe file is doing another operation 不能删除一个正在进行其它操作的文件 File Operation is Busy 操作正忙 There have been one or more fileoperation(s) executing before. Youroperation will wait for executinguntil it/them done. 在执行该操作之前有操作未完成,它需要等待上一个操作完成后再执行。 Peony::FileOperationPreparePage counting: 总计: state: 状态: Peony::FileOperationProgressPage &More Details 详细信息(&M) From: 从: To: 到: Peony::FileOperationProgressWizard File Manager 文件管理器 &Cancel 取消(&C) Preparing... 准备中... Handling... 正在处理... Clearing... 正在清理... Rollbacking... 回滚中... File Operation 文件操作 A file operation is running backend... 一个文件操作正在后台运行中... %1 files, %2 %1个文件,共%2 %1 done, %2 total, %3 of %4. 完成%1,共%2,%4中的第%3个。 clearing: %1, %2 of %3 正在清理:%1,%3中的第%2个 copying... 复制中... Peony::FilePreviewPage File Name: 文件名称: File Type: 文件类型: Time Access: 访问时间: Time Modified: 修改时间: Children Count: 子项计数: Size: 文件大小: Image size: 图片尺寸: Image format: 图片格式: %1x%2 %1x%2 %1 total, %2 hidden 共%1项,其中%2个隐藏文件 Peony::FileTrashOperation trash:/// trash:/// Peony::LocationBar click the blank area for edit 点击空白区域编辑路径 Search "%1" in "%2" 在%2中搜索%1 File System 文件系统 Peony::MountOperation Operation Cancelled 操作被取消 Peony::NavigationToolBar Go Back 后退 Go Forward 前进 History 历史 Clear History 清空历史 Cd Up 向上 Refresh 刷新 Peony::PathEdit Go To 跳转 Peony::PermissionsPropertiesPage User or Group 用户或组 Type 类型 Readable 可读 Writeable 可写 Excuteable 可执行 File: %1 文件:%1 Can not get the permission info. 无法获取文件权限相关信息。 (Me) (我) Others 其它 Owner 拥有者 Group 用户组 Other Users 其它用户 You can not change the access of this file. 你无法修改该文件的权限。 Me User 用户 Peony::PropertiesWindow Properties 属性 Close 关闭 Peony::RecentAndTrashPropertiesPage Origin Path: 原路径: Size: 文件大小: Original Location: 原路径: Peony::SearchBar Input the search key of files you would like to find. 输入关键词以搜索你想搜索的文件. Input search key... 输入关键词... advance search 高级搜索 clear record 清空历史 Peony::SideBarFavoriteItem Favorite 收藏夹 Peony::SideBarFileSystemItem Computer 计算机 Peony::SideBarMenu &Properties 属性(&P) &Delete Symbolic 删除(&D) &Unmount 卸载(&U) Peony::SideBarPersonalItem Personal 个人 Peony::SideBarSeparatorItem (No Sub Directory) (空) Peony::StatusBar ; %1 folders ;%1个文件夹 ; %1 files, %2 total ;%1个文件,总共%2 ; %1 folder ;%1个文件夹 ; %1 file, %2 ;%1个文件,%2 %1 selected 选中%1项 Peony::ToolBar Open in new &Window 在新窗口中打开(&W) Open in &New window 在新窗口中打开(&N) Open in new &Tab 在新标签页中打开(&T) Sort Type 排序类型 File Name 文件名称 File Type 文件类型 File Size 文件大小 Modified Date 修改日期 Ascending 升序 Descending 降序 Copy 复制 Paste 粘贴 Cut 剪切 Trash 删除 Clean Trash 清空回收站 Delete Permanently 永久删除 Are you sure that you want to delete these files? Once you start a deletion, the files deleting will never be restored again. 确定是否删除这些文件?一旦确定,这些文件将被永久删除并无法恢复。 Restore 还原 Options 选项 Forbid Thumbnail 禁用缩略图 Show Hidden 显示隐藏文件 Resident in Backend 常驻后台 Let the program still run after closing the last window. This will reduce the time for the next launch, but it will also consume resources in backend. 让文件管理器在关闭所有窗口后仍然运行,这将缩短下次启动所需要的时间,但是也会一直占用资源。 &Help 帮助(&H) &About... 关于...(&A) Peony Qt 文件管理器 Authour: Yue Lan <lanyue@kylinos.cn> Meihong He <hemeihong@kylinos.cn> Copyright (C): 2019, Tianjin KYLIN Information Technology Co., Ltd. 作者: Yue Lan <lanyue@kylinos.cn> Meihong He <hemeihong@kylinos.cn> 版权所有(C): 2019,天津麒麟信息技术有限公司. Peony::VolumeManager Error 错误 QObject Icon View 图标视图 Show the folder children as icons. 以图标形式显示目录. List View 列表视图 Show the folder children as rows in a list. 以列表形式显示目录. Basic Preview Page 基本 Show the basic file properties, and allow you to modify the access and name. 显示文件的基本属性,允许修改文件名称。 Permissions Page 权限 Show and modify file's permission, owner and group. 查看和修改文件的权限。 Can not trash 不能回收 Can not trash these files. You can delete them permanently. Are you sure doing that? 不能将这些文件完全放入回收站,但可以选择以永久删除这些文件,确定这样做吗? Delete Permanently 永久删除 Are you sure that you want to delete %1? Once you start a deletion, the files deleting will never be restored again. 确定删除%1?一旦确定,文件将被永久删除并且不可恢复。 Are you sure that you want to delete these %1 files? Once you start a deletion, the files deleting will never be restored again. 确定删除这%1个文件?一旦确定,文件将被永久删除并且不可恢复。 Computer Properties Page 计算机 Show the computer properties or items in computer. 显示计算机属性或计算机中的项。 Trash and Recent Properties Page 最近/回收 Show the file properties or items in trash or recent. 显示“回收站”或“最近”中的文件属性或项目。 peony/translations/update-translations.sh0000755000175000017500000000061513636050131017711 0ustar fengfengecho "update translations..." lupdate $(dirname $0)/../libpeony-qt/libpeony-qt.pro lupdate $(dirname $0)/../src/src.pro lupdate $(dirname $0)/../peony-qt-desktop/peony-qt-desktop.pro echo "generate new translate resources files" for file in $(dirname $0)/*/*.ts do ts="*.ts" qm="*.qm" target=${file%.*}.qm echo ${target} echo "release $file $target" lrelease $file $target done echo "done" peony/translations/peony-qt/0000755000175000017500000000000013640373337015136 5ustar fengfengpeony/translations/peony-qt/peony-qt_zh_CN.ts0000644000175000017500000003174413640373337020354 0ustar fengfeng FileLabelBox Rename 重命名 Edit Color 编辑颜色 Delete 删除标记 Create New Label 创建标记 HeaderBar Create Folder 新建文件夹 Open Terminal 打开终端 Go Back 后退 Go Forward 前进 Search 搜索 View Type 视图类型 Sort Type 排序类型 Option 选项 Operate Tips 操作提示 Don't find any terminal, please install at least one terminal! 没有找到任何终端插件,请确认您至少安装了一个! Minimize 最小化 Close 最大化 HeaderBarContainer Minimize 最小化 Close 最大化 MainWindow File Manager 文件管理器 Undo Redo Delete Permanently 永久删除 Are you sure that you want to delete these files? Once you start a deletion, the files deleting will never be restored again. 您确定要删除这些文件吗?一旦开始删除,这些文件将不可再恢复。 Peony Qt 文件管理器 New Folder 新建文件夹 NavigationSideBar All tags... 所有标记... NavigationSideBarContainer All tags... 所有标记... NavigationTabBar Search "%1" in "%2" 在%2中搜索%1 OperationMenu Advance Search 高级搜索 Keep Allow 置顶窗口 Show Hidden 显示隐藏文件 Forbid thumbnailing 禁用缩略图 Resident in Backend 常驻后台 Help 帮助 About 关于 OperationMenuEditWidget Edit 编辑 PeonyApplication Peony-Qt 文件管理器 Files or directories to open 需要打开的文件或文件夹 [FILE1, FILE2,...] [文件1,文件2...] Warning 警告 Peony-Qt can not get the system's icon theme. There are 2 reasons might lead to this problem: 1. Peony-Qt might be running as root, that means you have the higher permission and can do some things which normally forbidden. But, you should learn that if you were in a root, the virtual file system will lose some featrue such as you can not use "My Computer", the theme and icons might also went wrong. So, run peony-qt in a root is not recommended. 2. You are using a non-qt theme for your system but you didn't install the platform theme plugin for qt's applications. If you are using gtk-theme, try installing the qt5-gtk2-platformtheme package to resolve this problem. 文件管理器无法获取系统图标主题,可能的原因是: 1.正在以管理员用户运行文件管理器,虽然这意味着你拥有更高的权限,但是你必须了解你同时也失去了一些在普通用户下才能够拥有的特征,例如“我的电脑”以及系统主题。如果不是特殊情况,请不要使用管理员用户打开文件管理器。 2.你使用的系统主题不是qt默认支持的主题,并且你没有安装相关的平台插件。如果你正在使用Gtk主题作为系统主题,尝试安装qt5-gtk2-platformtheme以解决此问题。 Peony Qt 文件管理器 Authour: Yue Lan <lanyue@kylinos.cn> Meihong He <hemeihong@kylinos.cn> Copyright (C): 2019-2020, KYLIN Software Co., Ltd. 作者: Yue Lan <lanyue@kylinos.cn> Meihong He <hemeihong@kylinos.cn> 版权所有(C): 2019-2020,麒麟软件有限公司. Authour: Yue Lan <lanyue@kylinos.cn> Meihong He <hemeihong@kylinos.cn> Copyright (C): 2019-2020, Tianjin KYLIN Information Technology Co., Ltd. 作者: Yue Lan <lanyue@kylinos.cn> Meihong He <hemeihong@kylinos.cn> 版权所有(C): 2019-2020,天津麒麟信息技术有限公司. Close all peony-qt windows and quit 关闭所有窗口并退出 Show items 打开文件所在目录并选中它们 Show folders 显示文件夹下的内容 Show properties 打开文件属性窗口 SortTypeMenu File Name 文件名称 File Size 文件大小 File Type 文件类型 Modified Data 修改日期 Ascending 升序 Descending 降序 TabWidget Trash 回收站 Clear 清空 Recover 还原 peony/translations/clean-translated-resources.sh0000755000175000017500000000016213610734767021156 0ustar fengfengecho "clean qm files..." for file in $(dirname $0)/*/*.qm do echo "delete $file" rm -f ${file} done echo "done" peony/peony-qt.pro0000644000175000017500000000066213610734767013150 0ustar fengfengTEMPLATE = subdirs SUBDIRS = src libpeony-qt \ # plugin #libpeony-qt/test \ #plugin-iface #libpeony-qt/model/model-test \ #libpeony-qt/file-operation/file-operation-test \ #peony-qt-plugin-test \ peony-qt-desktop CONFIG += debug_and_release CONFIG(release,debug|release){ DEFINES += QT_NO_DEBUG_OUTPUT } src.depends = libpeony-qt peony-qt-plugin-test.depends = libpeony-qt peony-qt-desktop.depends = libpeony-qt peony/peony-qt-desktop/0000755000175000017500000000000013642614372014063 5ustar fengfengpeony/peony-qt-desktop/desktop-index-widget.h0000644000175000017500000000326213637332342020274 0ustar fengfeng/* * Peony-Qt * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License * along with this program. If not, see . * * Authors: Yue Lan * */ #ifndef DESKTOPINDEXWIDGET_H #define DESKTOPINDEXWIDGET_H #include #include #include class QTextEdit; namespace Peony { class DesktopIconViewDelegate; class DesktopIndexWidget : public QWidget { Q_OBJECT public: explicit DesktopIndexWidget(DesktopIconViewDelegate *delegate, const QStyleOptionViewItem &option, const QModelIndex &index, QWidget *parent = nullptr); ~DesktopIndexWidget(); protected: void paintEvent(QPaintEvent *e); void mousePressEvent(QMouseEvent *event); void mouseDoubleClickEvent(QMouseEvent *event); void updateItem(); private: QStyleOptionViewItem m_option; QModelIndex m_index; const DesktopIconViewDelegate *m_delegate; QFont m_current_font; QRect m_text_rect; }; } #endif // DESKTOPINDEXWIDGET_H peony/peony-qt-desktop/desktop-item-model.h0000644000175000017500000000563013632320605017733 0ustar fengfeng/* * Peony-Qt * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License * along with this program. If not, see . * * Authors: Yue Lan * */ #ifndef DESKTOPITEMMODEL_H #define DESKTOPITEMMODEL_H #include #include #include namespace Peony { class FileEnumerator; class FileInfo; class FileWatcher; class DesktopItemModel : public QAbstractListModel { Q_OBJECT public: enum Role { UriRole = Qt::UserRole, IsLinkRole = Qt::UserRole + 1 }; Q_ENUM(Role) explicit DesktopItemModel(QObject *parent = nullptr); ~DesktopItemModel() override; const QModelIndex indexFromUri(const QString &uri); const QString indexUri(const QModelIndex &index); // Basic functionality: int rowCount(const QModelIndex &parent = QModelIndex()) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; // Add data: bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override; bool insertRow(int row, const QModelIndex &parent = QModelIndex()); // Remove data: bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override; bool removeRow(int row, const QModelIndex &parent = QModelIndex()); Qt::ItemFlags flags(const QModelIndex &index) const override; QMimeData *mimeData(const QModelIndexList& indexes) const override; bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override; Qt::DropActions supportedDropActions() const override; Q_SIGNALS: void requestLayoutNewItem(const QString &uri); void requestClearIndexWidget(); void requestUpdateItemPositions(const QString &uri = nullptr); void refreshed(); void fileCreated(const QString &uri); public Q_SLOTS: void refresh(); protected Q_SLOTS: void onEnumerateFinished(); private: FileEnumerator *m_enumerator; QList> m_files; std::shared_ptr m_trash_watcher; std::shared_ptr m_desktop_watcher; std::shared_ptr m_thumbnail_watcher; //just handle the thumbnail created. QQueue m_info_query_queue; }; } #endif // DESKTOPITEMMODEL_H peony/peony-qt-desktop/man/0000755000175000017500000000000013610734767014644 5ustar fengfengpeony/peony-qt-desktop/man/peony-qt-desktop.10000644000175000017500000000142013610734767020146 0ustar fengfeng.\" Man page for Peony-Qt desktop .TH Peony-Qt 1 "09 December 2019" "UKUI Desktop Environment" .SH "NAME" Peony-Qt-Desktop \- The UKUI3.0 desktop program. .SH "SYNOPSIS" .B peony-qt-desktop [OPTION] .SH "DESCRIPTION" Peony-Qt is the default file manager for UKUI3.0. .PP This is the desktop program command line tool for interaction of terminal. .SH "OPTIONS" .TP \fB -q, --quit\fR Close the desktop window, stop the running service and quit. .TP \fB -d, --daemon\fR Run program with DBus service. .TP \fB -w, --desktop-window\fR Show desktop window. .SH "BUGS" .SS Should you encounter any bugs, they may be reported at: https://github.com/ukui/peony/issues .SH "AUTHORS" .SS This Manual Page has been written for the UKUI Desktop Environment by: Yue Lan (2019) peony/peony-qt-desktop/desktop-icon-view.qss0000644000175000017500000000051613637332342020162 0ustar fengfengPeony--DesktopIconView { background-color: transparent; border: 0px; padding: 0px; } Peony--DesktopIconView::Item { padding-top: 5px; image-position: bottom; } Peony--DesktopIconView::Item:hover { background-color: transparent; } Peony--DesktopIconView::Item:selected { background-color: transparent; } peony/peony-qt-desktop/desktop-menu-plugin-manager.h0000644000175000017500000000276113610734767021567 0ustar fengfeng/* * Peony-Qt * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License * along with this program. If not, see . * * Authors: Yue Lan * */ #ifndef DESKTOPMENUPLUGINMANAGER_H #define DESKTOPMENUPLUGINMANAGER_H #include #include #include "menu-plugin-iface.h" namespace Peony { class DesktopMenuPluginManager : public QObject { Q_OBJECT public: static DesktopMenuPluginManager *getInstance(); bool isLoaded() {return m_is_loaded;} const QStringList getPluginIds(); QList getPlugins(); MenuPluginInterface *getPlugin(const QString &pluginId); protected: void loadAsync(); private: explicit DesktopMenuPluginManager(QObject *parent = nullptr); ~DesktopMenuPluginManager(); QMap m_map; bool m_is_loaded = false; }; } #endif // DESKTOPMENUPLUGINMANAGER_H peony/peony-qt-desktop/desktop-item-proxy-model.h0000644000175000017500000000276113610734767021132 0ustar fengfeng/* * Peony-Qt * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License * along with this program. If not, see . * * Authors: Yue Lan * */ #ifndef DESKTOPITEMPROXYMODEL_H #define DESKTOPITEMPROXYMODEL_H #include namespace Peony { class DesktopItemProxyModel : public QSortFilterProxyModel { Q_OBJECT public: enum SortType { FileName, FileType, FileSize, ModifiedDate, Other }; explicit DesktopItemProxyModel(QObject *parent = nullptr); void setSortType(int type) {m_sort_type = type;} int getSortType() {return m_sort_type;} bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const; bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const; private: int m_sort_type = Other; }; } #endif // DESKTOPITEMPROXYMODEL_H peony/peony-qt-desktop/freedesktop-dbus-interfaces.xml0000644000175000017500000000266013610734767022206 0ustar fengfeng peony/peony-qt-desktop/fm-dbus-service.cpp0000644000175000017500000000371213610734767017573 0ustar fengfeng/* * Peony-Qt * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License * along with this program. If not, see . * * Authors: Yue Lan * */ #include "fm-dbus-service.h" #include #include #include using namespace Peony; FMDBusService::FMDBusService(QObject *parent) : QObject(parent) { qDebug()<registerService(QStringLiteral("org.freedesktop.FileManager1"), QDBusConnectionInterface::QueueService); } void FMDBusService::ShowFolders(const QStringList& uriList, const QString& startUpId) { qDebug()<<"show folders:"<. * * Authors: Yue Lan * */ #ifndef DESKTOPMENU_H #define DESKTOPMENU_H #include namespace Peony { class DirectoryViewIface; class DesktopMenu : public QMenu { Q_OBJECT public: explicit DesktopMenu(DirectoryViewIface *view, QWidget *parent = nullptr); const QStringList urisToEdit() {return m_uris_to_edit;} protected: void fillActions(); const QList constructOpenOpActions(); const QList constructCreateTemplateActions(); const QList constructViewOpActions(); const QList constructFileOpActions(); const QList constructMenuPluginActions(); //directory view menu extension. const QList constructFilePropertiesActions(); void openWindow(const QString &uri); void openWindow(const QStringList &uris); void showProperties(const QString &uri); void showProperties(const QStringList &uris); void gotoAboutComputer(); private: DirectoryViewIface *m_view; QString m_directory; QStringList m_selections; QStringList m_uris_to_edit; }; } #endif // DESKTOPMENU_H peony/peony-qt-desktop/org.ukui.freedesktop.FileManager1.service0000644000175000017500000000012413610734767023757 0ustar fengfeng[D-BUS Service] Name=org.freedesktop.FileManager1 Exec=/usr/bin/peony-qt-desktop -d peony/peony-qt-desktop/desktop-menu.cpp0000644000175000017500000004651413635337635017222 0ustar fengfeng/* * Peony-Qt * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License * along with this program. If not, see . * * Authors: Yue Lan * */ #include "desktop-menu.h" #include "directory-view-plugin-iface.h" #include "file-info.h" #include "file-utils.h" #include "file-launch-action.h" #include "file-launch-manager.h" #include "file-lauch-dialog.h" #include "clipboard-utils.h" #include "file-operation-utils.h" #include "file-enumerator.h" #include "desktop-icon-view.h" #include "desktop-menu-plugin-manager.h" #include "global-settings.h" #include #include #include #include #include #include using namespace Peony; DesktopMenu::DesktopMenu(DirectoryViewIface *view, QWidget *parent) : QMenu(parent) { m_view = view; m_directory = view->getDirectoryUri(); m_selections = view->getSelections(); fillActions(); } void DesktopMenu::fillActions() { //add open actions auto openActions = constructOpenOpActions(); if (!openActions.isEmpty()) addSeparator(); auto createTemplateActions = constructCreateTemplateActions(); if (!createTemplateActions.isEmpty()) addSeparator(); //add view actions auto viewActions = constructViewOpActions(); if (!viewActions.isEmpty()) addSeparator(); //add operation actions auto fileOpActions = constructFileOpActions(); if (!fileOpActions.isEmpty()) addSeparator(); //add plugin actions auto pluginActions = constructMenuPluginActions(); if (!pluginActions.isEmpty()) addSeparator(); //add propertries actions //if this is a backgroud menu, then it should not add propertries actions bool isBackgroundMenu = m_selections.isEmpty(); if(!isBackgroundMenu) { auto propertiesAction = constructFilePropertiesActions(); } } const QList DesktopMenu::constructOpenOpActions() { QList l; bool isBackgroundMenu = m_selections.isEmpty(); if (isBackgroundMenu) { l<openWindow(m_directory); }); } else { if (m_selections.count() == 1) { auto info = FileInfo::fromUri(m_selections.first()); auto displayName = info->displayName(); if (displayName.isEmpty()) displayName = FileUtils::getFileDisplayName(info->uri()); if (info->isDir()) { l<openWindow(m_selections); }); auto openWithAction = addAction(tr("Open \"%1\" &with...").arg(displayName)); QMenu *openWithMenu = new QMenu(this); auto recommendActions = FileLaunchManager::getRecommendActions(m_selections.first()); for (auto action : recommendActions) { action->setParent(openWithMenu); openWithMenu->addAction(static_cast(action)); } auto fallbackActions = FileLaunchManager::getFallbackActions(m_selections.first()); for (auto action : fallbackActions) { action->setParent(openWithMenu); openWithMenu->addAction(static_cast(action)); } openWithMenu->addSeparator(); openWithMenu->addAction(tr("&More applications..."), [=](){ FileLauchDialog d(m_selections.first()); d.exec(); }); openWithAction->setMenu(openWithMenu); } else if (!info->isVolume()) { l<setParent(openWithMenu); openWithMenu->addAction(static_cast(action)); } auto fallbackActions = FileLaunchManager::getFallbackActions(m_selections.first()); for (auto action : fallbackActions) { action->setParent(openWithMenu); openWithMenu->addAction(static_cast(action)); } openWithMenu->addSeparator(); openWithMenu->addAction(tr("&More applications..."), [=](){ FileLauchDialog d(m_selections.first()); d.exec(); }); openWithAction->setMenu(openWithMenu); } else { l<isDir() || info->isVolume()) { dirs<openWindow(dirs); if (!files.isEmpty()) { for (auto uri : files) { FileLaunchManager::openAsync(uri); } } }); } } return l; } const QList DesktopMenu::constructCreateTemplateActions() { QList l; if (m_selections.isEmpty()) { auto createAction = new QAction(tr("&New..."), this); l<setMenu(subMenu); addAction(createAction); //enumerate template dir QDir templateDir(g_get_user_special_dir(G_USER_DIRECTORY_TEMPLATES)); auto templates = templateDir.entryList(QDir::AllEntries|QDir::NoDotAndDotDot); if (!templates.isEmpty()) { QFileIconProvider p; for (auto t : templates) { QFileInfo info(t); QAction *action = new QAction(p.icon(info), info.baseName(), this); connect(action, &QAction::triggered, [=](){ CreateTemplateOperation op(m_directory, CreateTemplateOperation::Template, t); op.run(); auto target = op.target(); m_uris_to_edit<addAction(action); } subMenu->addSeparator(); } QList actions; auto createEmptyFileAction = new QAction(QIcon::fromTheme("document-new-symbolic"), tr("Empty &File"), this); actions<addActions(actions); } return l; } const QList DesktopMenu::constructViewOpActions() { QList l; if (m_selections.isEmpty()) { auto viewTypeAction = addAction(tr("View Type...")); l<(m_view); auto zoomLevel = desktopView->zoomLevel(); auto smallAction = viewTypeSubMenu->addAction(tr("&Small"), [=](){ desktopView->setDefaultZoomLevel(DesktopIconView::Small); }); auto normalAction = viewTypeSubMenu->addAction(tr("&Normal"), [=](){ desktopView->setDefaultZoomLevel(DesktopIconView::Normal); }); auto largeAction = viewTypeSubMenu->addAction(tr("&Large"), [=](){ desktopView->setDefaultZoomLevel(DesktopIconView::Large); }); auto hugeAction = viewTypeSubMenu->addAction(tr("&Huge"), [=](){ desktopView->setDefaultZoomLevel(DesktopIconView::Huge); }); switch (zoomLevel) { case DesktopIconView::Small: smallAction->setCheckable(true); smallAction->setChecked(true); break; case DesktopIconView::Normal: normalAction->setCheckable(true); normalAction->setChecked(true); break; case DesktopIconView::Large: largeAction->setCheckable(true); largeAction->setChecked(true); break; case DesktopIconView::Huge: hugeAction->setCheckable(true); hugeAction->setChecked(true); break; default: break; } viewTypeAction->setMenu(viewTypeSubMenu); //sort type auto sortTypeAction = addAction(tr("Sort By...")); l< tmp; tmp<addAction(tr("Name")); tmp<addAction(tr("File Type")); tmp<addAction(tr("File Size")); tmp<addAction(tr("Modified Date")); // int sortType = m_view->getSortType(); // if (sortType >= 0) { // tmp.at(sortType)->setCheckable(true); // tmp.at(sortType)->setChecked(true); // } for (int i = 0; i < tmp.count(); i++) { connect(tmp.at(i), &QAction::triggered, [=](){ m_view->setSortType(i); GlobalSettings::getInstance()->setValue(LAST_DESKTOP_SORT_ORDER, i); }); } sortTypeAction->setMenu(sortTypeMenu); /* //sort order auto sortOrderAction = addAction(tr("Sort Order...")); l<addAction(tr("Ascending Order")); tmp<addAction(tr("Descending Order")); // int sortOrder = m_view->getSortOrder(); // tmp.at(sortOrder)->setCheckable(true); // tmp.at(sortOrder)->setChecked(true); for (int i = 0; i < tmp.count(); i++) { connect(tmp.at(i), &QAction::triggered, [=](){ m_view->setSortOrder(i); }); } sortOrderAction->setMenu(sortOrderMenu); l<(m_view); desktopView->zoomIn(); }); l<(m_view); desktopView->zoomOut(); }); */ } return l; } const QList DesktopMenu::constructFileOpActions() { QList l; if (!m_selections.isEmpty()) { //don't show file operations when select home path QString homeUri = "file://" + QStandardPaths::writableLocation(QStandardPaths::HomeLocation); if (m_selections.count() == 1 && m_selections.first() == "trash:///") { FileEnumerator e; e.setEnumerateDirectory("trash:///"); e.enumerateSync(); auto trashChildren = e.getChildrenUris(); l<setEnabled(!trashChildren.isEmpty()); l<setEnabled(!trashChildren.isEmpty()); } else if (m_selections.count() == 1 && m_selections.first() == "computer:///") { } else if (! m_selections.contains(homeUri)) { l<editUri(m_selections.first()); }); } } } else { auto pasteAction = addAction(QIcon::fromTheme("edit-paste-symbolic"), tr("&Paste")); l<setEnabled(ClipboardUtils::isClipboardHasFiles()); connect(l.last(), &QAction::triggered, [=](){ ClipboardUtils::pasteClipboardFiles(m_directory); }); l<(m_view); desktopView->refresh(); }); } return l; } const QList DesktopMenu::constructFilePropertiesActions() { QList l; l<showProperties(m_directory); } else { this->showProperties(m_selections); } }); return l; } void DesktopMenu::openWindow(const QString &uri) { QUrl url = uri; QProcess p; #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) p.setProgram("peony"); p.setArguments(QStringList()<<"--show-folders"< DesktopMenu::constructMenuPluginActions() { QList l; //FIXME: auto mgr = DesktopMenuPluginManager::getInstance(); if (mgr->isLoaded()) { //sort plugiins by name, so the menu option orders is relatively fixed auto pluginIds = mgr->getPluginIds(); qSort(pluginIds.begin(), pluginIds.end()); for (auto id : pluginIds) { auto plugin = mgr->getPlugin(id); auto actions = plugin->menuActions(MenuPluginInterface::DesktopWindow, m_directory, m_selections); for (auto action : actions) { action->setParent(this); } l<= QT_VERSION_CHECK(5, 10, 0) p.setProgram("peony"); p.setArguments(QStringList()<<"--show-folders"<= QT_VERSION_CHECK(5, 10, 0) p.setProgram("peony"); p.setArguments(QStringList()<<"--show-properties"<= QT_VERSION_CHECK(5, 10, 0) p.setProgram("peony"); p.setArguments(QStringList()<<"--show-properties"<. * * Authors: Yue Lan * */ #include "desktop-item-proxy-model.h" #include "file-info.h" #include "file-meta-info.h" #include "file-operation-utils.h" #include using namespace Peony; bool startWithChinese(const QString &displayName) { //NOTE: a newly created file might could not get display name soon. if (displayName.isEmpty()) { return false; } auto firstStrUnicode = displayName.at(0).unicode(); return (firstStrUnicode <=0x9FA5 && firstStrUnicode >= 0x4E00); } DesktopItemProxyModel::DesktopItemProxyModel(QObject *parent) : QSortFilterProxyModel(parent) { setSortCaseSensitivity(Qt::CaseInsensitive); } bool DesktopItemProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const { if (!sourceModel()) return false; auto sourceIndex = sourceModel()->index(source_row, 0, source_parent); auto uri = sourceIndex.data(Qt::UserRole).toString(); auto info = FileInfo::fromUri(uri); //qDebug()<<"fiter"<displayName(); if (info->displayName().isNull()) { return false; } if (info->displayName().startsWith(".")) { return false; } return true; } bool DesktopItemProxyModel::lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const { //qDebug()<<"less than"; if (m_sort_type == Other) { return true; } auto leftUri = source_left.data(Qt::UserRole).toString(); auto leftInfo = FileInfo::fromUri(leftUri); auto leftMetaInfo = FileMetaInfo::fromUri(leftUri); auto rightUri = source_right.data(Qt::UserRole).toString(); auto rightInfo = FileInfo::fromUri(rightUri); auto rightMetaInfo = FileMetaInfo::fromUri(rightUri); //computer home and trash first if (source_left.row() < 3) { if (source_right.row() < source_left.row()) { return (sortOrder()==Qt::AscendingOrder)? false: true; } return (sortOrder()==Qt::AscendingOrder)? true: false; } if (source_right.row() < 3) { if (source_left.row() < source_right.row()) { return (sortOrder()==Qt::AscendingOrder)? true: false; } return (sortOrder()==Qt::AscendingOrder)? false: true; } //dir first if (leftInfo->isDir()) { if (rightInfo->isDir()) { //do nothing } else { return (sortOrder()==Qt::AscendingOrder)? true: false; } } else { if (rightInfo->isDir()) { return (sortOrder()==Qt::AscendingOrder)? false: true; } } //qDebug()<<"sort===================================="<displayName(), rightInfo->displayName())) { return FileOperationUtils::leftNameLesserThanRightName(leftInfo->displayName(), rightInfo->displayName()); } if (startWithChinese(leftInfo->displayName())) { if (!startWithChinese(rightInfo->displayName())) { return (sortOrder()==Qt::AscendingOrder)? true: false; } else { //chinese pinyin sort order is reversed compared with english. return !QSortFilterProxyModel::lessThan(source_left, source_right); } } else { if (startWithChinese(rightInfo->displayName())) { return (sortOrder()==Qt::AscendingOrder)? false: true; } } return QSortFilterProxyModel::lessThan(source_left, source_right); } case FileType: { return leftInfo->type() < rightInfo->type(); } case FileSize: { return leftInfo->size() < rightInfo->size(); } case ModifiedDate: { return leftInfo->modifiedTime() < rightInfo->modifiedTime(); } } return QSortFilterProxyModel::lessThan(source_left, source_right); } peony/peony-qt-desktop/peony-qt-desktop-style.qrc0000644000175000017500000000014413610734767021160 0ustar fengfeng desktop-icon-view.qss peony/peony-qt-desktop/desktop-menu-plugin-manager.cpp0000644000175000017500000000654013610734767022121 0ustar fengfeng/* * Peony-Qt * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License * along with this program. If not, see . * * Authors: Yue Lan * */ #include "desktop-menu-plugin-manager.h" #include "style-plugin-iface.h" #include #include #include #include #include #include using namespace Peony; static DesktopMenuPluginManager *global_instance = nullptr; static bool m_is_loading = false; DesktopMenuPluginManager::DesktopMenuPluginManager(QObject *parent) : QObject(parent) { m_is_loading = true; loadAsync(); } DesktopMenuPluginManager::~DesktopMenuPluginManager() { for (auto plugin : m_map) { delete plugin; } m_map.clear(); } void DesktopMenuPluginManager::loadAsync() { qDebug()<<"test start"; QDir pluginsDir("/usr/lib/peony-qt-extensions"); pluginsDir.setFilter(QDir::Files); Q_FOREACH(QString fileName, pluginsDir.entryList(QDir::Files)) { QPluginLoader pluginLoader(pluginsDir.absoluteFilePath(fileName)); QObject *plugin = pluginLoader.instance(); if (!plugin) continue; StylePluginIface *splugin = dynamic_cast(plugin); if (splugin) { QApplication::setStyle(splugin->getStyle()); break; } } QtConcurrent::run([=](){ qDebug()<(plugin); if (!piface) continue; qDebug()<<"ok"; if (!m_map.value(piface->name())) m_map.insert(piface->name(), piface); m_is_loaded = true; } }); } DesktopMenuPluginManager *DesktopMenuPluginManager::getInstance() { if (!global_instance) { if (!m_is_loading) { m_is_loading = true; global_instance = new DesktopMenuPluginManager; global_instance->loadAsync(); } } return global_instance; } const QStringList DesktopMenuPluginManager::getPluginIds() { return m_map.keys(); } MenuPluginInterface *DesktopMenuPluginManager::getPlugin(const QString &pluginId) { return m_map.value(pluginId); } QList DesktopMenuPluginManager::getPlugins() { return m_map.values(); } peony/peony-qt-desktop/desktop-window.cpp0000644000175000017500000004721113642614372017552 0ustar fengfeng/* * Peony-Qt * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License * along with this program. If not, see . * * Authors: Yue Lan * Authors: Meihong He * */ #include "desktop-window.h" #include "file-info-job.h" #include "file-info.h" #include "file-item-model.h" #include "file-item-proxy-filter-sort-model.h" #include "file-launch-manager.h" #include "file-operation-utils.h" #include "desktop-menu.h" #include "desktop-icon-view.h" #include "desktop-item-model.h" #include "clipboard-utils.h" #include "file-copy-operation.h" #include "file-move-operation.h" #include "file-operation-manager.h" #include "file-trash-operation.h" #include "properties-window.h" #include "peony-desktop-application.h" #include "singleapplication.h" #include #include #include #include #include #include #include #include #include #include #include // NOTE build failed on Archlinux. Can't detect `QGSettings/QGSettings' header // fixed by replaced `QGSettings/QGSettings' with `QGSettings' #include // backup settings #include #include #define BACKGROUND_SETTINGS "org.mate.background" #define PICTRUE "picture-filename" #define FALLBACK_COLOR "primary-color" using namespace Peony; DesktopWindow::DesktopWindow(QScreen *screen, bool is_primary, QWidget *parent) : QMainWindow(parent) { initGSettings(); m_opacity = new QVariantAnimation(this); m_opacity->setDuration(1000); m_opacity->setStartValue(double(0)); m_opacity->setEndValue(double(1)); connect(m_opacity, &QVariantAnimation::valueChanged, this, [=](){ this->update(); }); connect(m_opacity, &QVariantAnimation::finished, this, [=](){ m_bg_back_pixmap = m_bg_font_pixmap; m_bg_back_cache_pixmap = m_bg_font_cache_pixmap; m_last_pure_color = m_color_to_be_set; }); m_screen = screen; //connect(m_screen, &QScreen::availableGeometryChanged, this, &DesktopWindow::updateView); connectSignal(); m_is_primary = is_primary; setContentsMargins(0, 0, 0, 0); qDebug() << "DesktopWindow is_primary:" << is_primary << screen->objectName() << screen->name(); setWindowFlags(Qt::FramelessWindowHint); setAttribute(Qt::WA_X11NetWmWindowTypeDesktop); setAttribute(Qt::WA_TranslucentBackground); setGeometry(screen->geometry()); setContextMenuPolicy(Qt::CustomContextMenu); // menu connect(this, &QMainWindow::customContextMenuRequested, [=](const QPoint &pos) { // FIXME: use other menu qDebug() << "menu request"; auto contentMargins = contentsMargins(); auto fixedPos = pos - QPoint(contentMargins.left(), contentMargins.top()); auto index = PeonyDesktopApplication::getIconView()->indexAt(fixedPos); if (!index.isValid() || !centralWidget()) { PeonyDesktopApplication::getIconView()->clearSelection(); } else { if (!PeonyDesktopApplication::getIconView()->selectionModel()->selection().indexes().contains(index)) { PeonyDesktopApplication::getIconView()->clearSelection(); PeonyDesktopApplication::getIconView()->selectionModel()->select(index, QItemSelectionModel::Select); } } QTimer::singleShot(1, [=]() { DesktopMenu menu(PeonyDesktopApplication::getIconView()); if (PeonyDesktopApplication::getIconView()->getSelections().isEmpty()) { auto action = menu.addAction(tr("set background")); connect(action, &QAction::triggered, [=]() { //go to control center set background gotoSetBackground(); // QFileDialog dlg; // dlg.setNameFilters(QStringList() << "*.jpg" // << "*.png"); // if (dlg.exec()) { // auto url = dlg.selectedUrls().first(); // this->setBg(url.path()); // // qDebug()<changeBg(url.path()); // } }); } menu.exec(mapToGlobal(pos)); auto urisToEdit = menu.urisToEdit(); if (urisToEdit.count() == 1) { QTimer::singleShot( 100, this, [=]() { PeonyDesktopApplication::getIconView()->editUri(urisToEdit.first()); }); } }); }); connect(m_screen, &QScreen::geometryChanged, this, &DesktopWindow::geometryChangedProcess); connect(m_screen, &QScreen::virtualGeometryChanged, this, &DesktopWindow::virtualGeometryChangedProcess); if (!m_is_primary || true) { setBg(getCurrentBgPath()); return; } } DesktopWindow::~DesktopWindow() {} void DesktopWindow::initGSettings() { if (!QGSettings::isSchemaInstalled(BACKGROUND_SETTINGS)) { m_backup_setttings = new QSettings("org.ukui", "peony-qt-desktop", this); if (m_backup_setttings->value("color").isNull()) { auto defaultColor = QColor(Qt::cyan).darker(); m_backup_setttings->setValue("color", defaultColor); } return; } m_bg_settings = new QGSettings(BACKGROUND_SETTINGS, QByteArray(), this); connect(m_bg_settings, &QGSettings::changed, this, [=](const QString &key) { qDebug() << "bg settings changed:" << key; if (key == "pictureFilename") { auto bg_path = m_bg_settings->get("pictureFilename").toString(); if (!QFile::exists(bg_path)) { // use pure color; auto colorString = m_bg_settings->get("primary-color").toString(); auto color = QColor(colorString); qDebug() << colorString; this->setBg(color); } else { if (m_current_bg_path == bg_path) return; this->setBg(bg_path); } } if (key == "primaryColor") { auto bg_path = m_bg_settings->get("pictureFilename").toString(); if (!bg_path.startsWith("/")) { auto colorString = m_bg_settings->get("primary-color").toString(); auto color = QColor(colorString); qDebug() << colorString; this->setBg(color); } else { // do nothing } } }); } void DesktopWindow::gotoSetBackground() { QProcess p; p.setProgram("ukui-control-center"); //old version use -a, new version use -b as para p.setArguments(QStringList()<<"-b"); p.startDetached(); p.waitForFinished(-1); } void DesktopWindow::paintEvent(QPaintEvent *e) { QPainter p(this); p.setRenderHint(QPainter::Antialiasing); if (m_opacity->state() == QVariantAnimation::Running) { //draw bg? if (m_use_pure_color) { auto opacity = m_opacity->currentValue().toDouble(); p.fillRect(this->rect(), m_last_pure_color); p.save(); p.setOpacity(opacity); p.fillRect(this->rect(), m_color_to_be_set); p.restore(); } else { auto opacity = m_opacity->currentValue().toDouble(); p.drawPixmap(this->rect(), m_bg_back_cache_pixmap, m_bg_back_cache_pixmap.rect()); p.save(); p.setOpacity(opacity); p.drawPixmap(this->rect(), m_bg_font_cache_pixmap, m_bg_font_cache_pixmap.rect()); p.restore(); } } else { //draw bg? if (m_use_pure_color) { p.fillRect(this->rect(), m_last_pure_color); } else { p.drawPixmap(this->rect(), m_bg_back_cache_pixmap, m_bg_back_cache_pixmap.rect()); } } QMainWindow::paintEvent(e); } const QString DesktopWindow::getCurrentBgPath() { // FIXME: implement custom bg settings storage if (m_current_bg_path.isEmpty()) { if (m_bg_settings) m_current_bg_path = m_bg_settings->get("pictureFilename").toString(); else m_current_bg_path = m_backup_setttings->value("pictrue").toString(); } return m_current_bg_path; } const QColor DesktopWindow::getCurrentColor() { QColor color; if (m_bg_settings) { color = qvariant_cast(m_bg_settings->get("primary-color")); } else { color = qvariant_cast(m_backup_setttings->value("color")); } return color; } void DesktopWindow::setBg(const QString &path) { qDebug() << path; if (path.isNull()) { setBg(getCurrentColor()); return; } m_use_pure_color = false; m_bg_back_pixmap = m_bg_font_pixmap; m_bg_font_pixmap = QPixmap(path); // FIXME: implement different pixmap clip algorithm. m_bg_back_cache_pixmap = m_bg_back_pixmap.scaled(m_screen->size(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation); m_bg_font_cache_pixmap = m_bg_font_pixmap.scaled(m_screen->size(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation); m_current_bg_path = path; setBgPath(path); if (m_opacity->state() == QVariantAnimation::Running) { m_opacity->setCurrentTime(500); } else { m_opacity->stop(); m_opacity->start(); } } void DesktopWindow::setBg(const QColor &color) { m_color_to_be_set = color; m_use_pure_color = true; if (m_opacity->state() == QVariantAnimation::Running) { m_opacity->setCurrentTime(500); } else { m_opacity->stop(); m_opacity->start(); } } void DesktopWindow::setBgPath(const QString &bgPath) { if (m_bg_settings) { m_bg_settings->set(PICTRUE, bgPath); } else { m_backup_setttings->setValue("pictrue", bgPath); m_backup_setttings->sync(); Q_EMIT this->changeBg(bgPath); } } void DesktopWindow::setScreen(QScreen *screen) { m_screen = screen; } void DesktopWindow::setIsPrimary(bool is_primary) { m_is_primary = is_primary; } void DesktopWindow::connectSignal() { connect(m_screen, &QScreen::geometryChanged, this, &DesktopWindow::geometryChangedProcess); connect(m_screen, &QScreen::virtualGeometryChanged, this, &DesktopWindow::virtualGeometryChangedProcess); connect(m_screen, &QScreen::availableGeometryChanged, this, &DesktopWindow::availableGeometryChangedProcess); } void DesktopWindow::disconnectSignal() { disconnect(m_screen, &QScreen::geometryChanged, this, &DesktopWindow::geometryChangedProcess); disconnect(m_screen, &QScreen::virtualGeometryChanged, this, &DesktopWindow::virtualGeometryChangedProcess); if (m_is_primary) { disconnect(m_screen, &QScreen::availableGeometryChanged, this, &DesktopWindow::availableGeometryChangedProcess); } } void DesktopWindow::scaleBg(const QRect &geometry) { if (this->geometry() == geometry) return; setGeometry(geometry); /*! * \note * There is a bug in kwin, if we directly set window * geometry or showFullScreen, window will not be resized * correctly. * * reset the window flags will resovle the problem, * but screen will be black a while. * this is not user's expected. */ setWindowFlag(Qt::FramelessWindowHint, false); setWindowFlag(Qt::FramelessWindowHint); show(); m_bg_back_cache_pixmap = m_bg_back_pixmap.scaled(geometry.size(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation); m_bg_font_cache_pixmap = m_bg_font_pixmap.scaled(geometry.size(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation); this->update(); } void DesktopWindow::initShortcut() { // shotcut return; QAction *copyAction = new QAction(this); copyAction->setShortcut(QKeySequence::Copy); connect(copyAction, &QAction::triggered, [=]() { auto selectedUris = PeonyDesktopApplication::getIconView()->getSelections(); if (!selectedUris.isEmpty()) ClipboardUtils::setClipboardFiles(selectedUris, false); }); addAction(copyAction); QAction *cutAction = new QAction(this); cutAction->setShortcut(QKeySequence::Cut); connect(cutAction, &QAction::triggered, [=]() { auto selectedUris = PeonyDesktopApplication::getIconView()->getSelections(); if (!selectedUris.isEmpty()) ClipboardUtils::setClipboardFiles(selectedUris, true); }); addAction(cutAction); QAction *pasteAction = new QAction(this); pasteAction->setShortcut(QKeySequence::Paste); connect(pasteAction, &QAction::triggered, [=]() { auto clipUris = ClipboardUtils::getClipboardFilesUris(); if (ClipboardUtils::isClipboardHasFiles()) { ClipboardUtils::pasteClipboardFiles(PeonyDesktopApplication::getIconView()->getDirectoryUri()); } }); addAction(pasteAction); QAction *trashAction = new QAction(this); trashAction->setShortcut(QKeySequence::Delete); connect(trashAction, &QAction::triggered, [=]() { auto selectedUris = PeonyDesktopApplication::getIconView()->getSelections(); if (!selectedUris.isEmpty()) { auto op = new FileTrashOperation(selectedUris); FileOperationManager::getInstance()->startOperation(op, true); } }); addAction(trashAction); QAction *undoAction = new QAction(this); undoAction->setShortcut(QKeySequence::Undo); connect(undoAction, &QAction::triggered, [=]() { FileOperationManager::getInstance()->undo(); }); addAction(undoAction); QAction *redoAction = new QAction(this); redoAction->setShortcut(QKeySequence::Redo); connect(redoAction, &QAction::triggered, [=]() { FileOperationManager::getInstance()->redo(); }); addAction(redoAction); QAction *zoomInAction = new QAction(this); zoomInAction->setShortcut(QKeySequence::ZoomIn); connect(zoomInAction, &QAction::triggered, [=]() { PeonyDesktopApplication::getIconView()->zoomIn(); }); addAction(zoomInAction); QAction *zoomOutAction = new QAction(this); zoomOutAction->setShortcut(QKeySequence::ZoomOut); connect(zoomOutAction, &QAction::triggered, [=]() { PeonyDesktopApplication::getIconView()->zoomOut(); }); addAction(zoomOutAction); QAction *renameAction = new QAction(this); renameAction->setShortcuts(QList()<getSelections(); if (selections.count() == 1) { PeonyDesktopApplication::getIconView()->editUri(selections.first()); } }); addAction(renameAction); QAction *removeAction = new QAction(this); removeAction->setShortcuts(QList()<getSelections(); FileOperationUtils::executeRemoveActionWithDialog(PeonyDesktopApplication::getIconView()->getSelections()); }); addAction(removeAction); auto propertiesWindowAction = new QAction(this); propertiesWindowAction->setShortcuts(QList()<getSelections().count() > 0) { PropertiesWindow *w = new PropertiesWindow(PeonyDesktopApplication::getIconView()->getSelections()); w->show(); } }); addAction(propertiesWindowAction); auto newFolderAction = new QAction(this); newFolderAction->setShortcuts(QList()<getDirectoryUri(), CreateTemplateOperation::EmptyFolder, tr("New Folder")); op.run(); auto targetUri = op.target(); #if QT_VERSION > QT_VERSION_CHECK(5, 12, 0) QTimer::singleShot(500, this, [=](){ #else QTimer::singleShot(500, [=](){ #endif PeonyDesktopApplication::getIconView()->scrollToSelection(targetUri); }); }); addAction(newFolderAction); auto refreshAction = new QAction(this); refreshAction->setShortcut(Qt::Key_F5); connect(refreshAction, &QAction::triggered, this, [=](){ PeonyDesktopApplication::getIconView()->refresh(); }); addAction(refreshAction); QAction *editAction = new QAction(PeonyDesktopApplication::getIconView()); editAction->setShortcuts(QList()<getSelections(); if (selections.count() == 1) { PeonyDesktopApplication::getIconView()->editUri(selections.first()); } }); addAction(editAction); } void DesktopWindow::availableGeometryChangedProcess(const QRect &geometry) { updateView(); } void DesktopWindow::virtualGeometryChangedProcess(const QRect &geometry) { updateWinGeometry(); } void DesktopWindow::geometryChangedProcess(const QRect &geometry) { // screen resolution ratio change updateWinGeometry(); } void DesktopWindow::updateView() { auto avaliableGeometry = m_screen->availableGeometry(); auto geomerty = m_screen->geometry(); int top = qAbs(avaliableGeometry.top() - geomerty.top()); int left = qAbs(avaliableGeometry.left() - geomerty.left()); int bottom = qAbs(avaliableGeometry.bottom() - geomerty.bottom()); int right = qAbs(avaliableGeometry.right() - geomerty.right()); //skip unexpected avaliable geometry, it might lead by ukui-panel. if (top > 200 | left > 200 | bottom > 200 | right > 200) { setContentsMargins(0, 0, 0, 0); return; } setContentsMargins(left, top, right, bottom); } void DesktopWindow::updateWinGeometry() { auto screenName = m_screen->name(); auto screenSize = m_screen->size(); auto g = getScreen()->geometry(); auto vg = getScreen()->virtualGeometry(); auto ag = getScreen()->availableGeometry(); // this->move(m_screen->geometry().topLeft()); // this->setFixedSize(m_screen->geometry().size()); // /*! // \bug // can not set window geometry correctly in kwin. // strangely it works in ukwm. // */ // this->setGeometry(m_screen->geometry()); // Q_EMIT this->checkWindow(); scaleBg(g); auto name = m_screen->name(); if (m_screen == qApp->primaryScreen()) { if (auto view = qobject_cast(centralWidget())) { this->show(); } } else { if (m_screen->geometry() == qApp->primaryScreen()->geometry()) this->hide(); else this->show(); } //updateView(); } peony/peony-qt-desktop/desktop-icon-view.h0000644000175000017500000001054413642614372017607 0ustar fengfeng/* * Peony-Qt * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License * along with this program. If not, see . * * Authors: Yue Lan * */ #ifndef DESKTOPICONVIEW_H #define DESKTOPICONVIEW_H #include #include "directory-view-plugin-iface.h" #include #include class QLabel; namespace Peony { class DesktopItemModel; class DesktopItemProxyModel; class DesktopIconView : public QListView, public DirectoryViewIface { friend class DesktopIndexWidget; friend class DesktopIconViewDelegate; Q_OBJECT public: enum ZoomLevel { Invalid, Small, //icon: 24x24; grid: 64x64; hover rect: 60x60; font: system*0.8 Normal, //icon: 48x48; grid: 96x96; hover rect = 90x90; font: system Large, //icon: 64x64; grid: 115x135; hover rect = 105x118; font: system*1.2 Huge //icon: 96x96; grid: 140x170; hover rect = 120x140; font: system*1.4 }; Q_ENUM(ZoomLevel) explicit DesktopIconView(QWidget *parent = nullptr); ~DesktopIconView(); bool eventFilter(QObject *obj, QEvent *e); void initShoutCut(); void initMenu(); void initDoubleClick(); void bindModel(FileItemModel *sourceModel, FileItemProxyFilterSortModel *proxyModel) {Q_UNUSED(sourceModel) Q_UNUSED(proxyModel)} void setProxy(DirectoryViewProxyIface *proxy) {Q_UNUSED(proxy)} const QString viewId() {return tr("Desktop Icon View");} //location const QString getDirectoryUri() {return "file://" + QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);} //selections const QStringList getSelections(); //children const QStringList getAllFileUris(); int getSortType(); int getSortOrder(); QRect visualRect(const QModelIndex &index) const; const QFont getViewItemFont(QStyleOptionViewItem *item); Q_SIGNALS: void zoomLevelChanged(ZoomLevel level); public Q_SLOTS: //location void open(const QStringList &uris, bool newWindow) {} void setDirectoryUri(const QString &uri) {} void beginLocationChange() {} void stopLocationChange() {} void closeView(); //selections void setSelections(const QStringList &uris); void invertSelections(); void scrollToSelection(const QString &uri); //clipboard void setCutFiles(const QStringList &uris); DirectoryViewProxyIface *getProxy() {return nullptr;} void setSortType(int sortType); void setSortOrder(int sortOrder); //edit void editUri(const QString &uri); void editUris(const QStringList uris); //zoom void setDefaultZoomLevel(ZoomLevel level); ZoomLevel zoomLevel() const; void zoomIn(); void zoomOut(); void clearAllIndexWidgets(); void refresh(); void saveAllItemPosistionInfos(); void saveItemPositionInfo(const QString &uri); void resetAllItemPositionInfos(); void resetItemPosistionInfo(const QString &uri); void updateItemPosistions(const QString &uri = nullptr); protected: void mousePressEvent(QMouseEvent *e); void mouseReleaseEvent(QMouseEvent *e); void mouseDoubleClickEvent(QMouseEvent *event); void dragEnterEvent(QDragEnterEvent *e); void dragMoveEvent(QDragMoveEvent *e); void dropEvent(QDropEvent *e); void wheelEvent(QWheelEvent *e); void keyPressEvent(QKeyEvent *e); void keyReleaseEvent(QKeyEvent *e); void resizeEvent(QResizeEvent *e); private: ZoomLevel m_zoom_level = Invalid; QModelIndex m_last_index; QTimer m_edit_trigger_timer; DesktopItemModel *m_model = nullptr; DesktopItemProxyModel *m_proxy_model; QStringList m_new_files_to_be_selected; bool m_is_refreshing = false; bool m_real_do_edit = false; bool m_ctrl_or_shift_pressed = false; }; } #endif // DESKTOPICONVIEW_H peony/peony-qt-desktop/peony-desktop-application.cpp0000644000175000017500000003663113642614372021702 0ustar fengfeng/* * Peony-Qt * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License * along with this program. If not, see . * * Authors: Yue Lan * Authors: Meihong He * */ #include "peony-desktop-application.h" #include "fm-dbus-service.h" #include "desktop-menu-plugin-manager.h" #include "volume-manager.h" #include "desktop-icon-view.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define KYLIN_USER_GUIDE_PATH "/" #define KYLIN_USER_GUIDE_SERVICE QString("com.kylinUserGuide.hotel_%1").arg(getuid()) #define KYLIN_USER_GUIDE_INTERFACE "com.guide.hotel" static bool has_desktop = false; static bool has_daemon = false; static Peony::DesktopIconView *desktop_icon_view = nullptr; void trySetDefaultFolderUrlHandler() { //NOTE: //There is a bug in qt concurrent. If we use QtConcurrent::run() //to start a async function in the init stage, the qapplication will //not quit when we call "peony-qt-desktop -q" in command line. // //To solve this problem, the simplest way is delaying a while to execute the //async lambda function. QTimer::singleShot(1000, [](){ QtConcurrent::run([=](){ GList *apps = g_app_info_get_all_for_type("inode/directory"); bool hasPeonyQtAppInfo = false; GList *l = apps; while (l) { GAppInfo *info = static_cast(l->data); QString cmd = g_app_info_get_executable(info); if (cmd.contains("peony")) { hasPeonyQtAppInfo = true; g_app_info_set_as_default_for_type(info, "inode/directory", nullptr); break; } l = l->next; } if (apps) { g_list_free_full(apps, g_object_unref); } if (!hasPeonyQtAppInfo) { GAppInfo *peony_qt = g_app_info_create_from_commandline("peony", nullptr, G_APP_INFO_CREATE_SUPPORTS_URIS, nullptr); g_app_info_set_as_default_for_type(peony_qt, "inode/directory", nullptr); g_object_unref(peony_qt); } return; }); }); } PeonyDesktopApplication::PeonyDesktopApplication(int &argc, char *argv[], const char *applicationName) : SingleApplication (argc, argv, applicationName, true) { setApplicationVersion("v2.1.0"); setApplicationName("peony-qt-desktop"); //setApplicationDisplayName(tr("Peony-Qt Desktop")); QTranslator *t = new QTranslator(this); t->load("/usr/share/libpeony-qt/libpeony-qt_"+QLocale::system().name()); QApplication::installTranslator(t); QTranslator *t2 = new QTranslator(this); t2->load("/usr/share/peony-qt-desktop/peony-qt-desktop_"+QLocale::system().name()); QApplication::installTranslator(t2); QTranslator *t3 = new QTranslator(this); t3->load("/usr/share/qt5/translations/qt_"+QLocale::system().name()); QApplication::installTranslator(t3); if (this->isPrimary()) { qDebug()<<"isPrimary screen"; connect(this, &SingleApplication::receivedMessage, [=](quint32 id, QByteArray msg){ this->parseCmd(id, msg, true); }); QFile file(":/desktop-icon-view.qss"); file.open(QFile::ReadOnly); setStyleSheet(QString::fromLatin1(file.readAll())); file.close(); Peony::DesktopMenuPluginManager::getInstance(); /* QSystemTrayIcon *trayIcon = new QSystemTrayIcon(this); auto volumeManager = Peony::VolumeManager::getInstance(); connect(volumeManager, &Peony::VolumeManager::driveConnected, this, [=](const std::shared_ptr &drive){ trayIcon->show(); trayIcon->showMessage(tr("Drive"), tr("%1 connected").arg(drive->name())); }); connect(volumeManager, &Peony::VolumeManager::driveDisconnected, this, [=](const std::shared_ptr &drive){ trayIcon->show(); trayIcon->showMessage(tr("Drive"), tr("%1 disconnected").arg(drive->name())); }); connect(trayIcon, &QSystemTrayIcon::messageClicked, trayIcon, &QSystemTrayIcon::hide); */ } connect(this, &SingleApplication::layoutDirectionChanged, this, &PeonyDesktopApplication::layoutDirectionChangedProcess); connect(this, &SingleApplication::primaryScreenChanged, this, &PeonyDesktopApplication::primaryScreenChangedProcess); connect(this, &SingleApplication::screenAdded, this, &PeonyDesktopApplication::screenAddedProcess); connect(this, &SingleApplication::screenRemoved, this, &PeonyDesktopApplication::screenRemovedProcess); //parse cmd auto message = this->arguments().join(' ').toUtf8(); parseCmd(this->instanceId(), message, isPrimary()); } Peony::DesktopIconView *PeonyDesktopApplication::getIconView() { if (!desktop_icon_view) desktop_icon_view = new Peony::DesktopIconView; return desktop_icon_view; } bool PeonyDesktopApplication::userGuideDaemonRunning() { QDBusConnection conn = QDBusConnection::sessionBus(); if (!conn.isConnected()) return false; QDBusReply reply = conn.interface()->call("GetNameOwner", KYLIN_USER_GUIDE_SERVICE); return reply != ""; } void PeonyDesktopApplication::showGuide(const QString &appName) { if (!userGuideDaemonRunning()) { QUrl url = QUrl("help:ubuntu-kylin-help", QUrl::TolerantMode); QDesktopServices::openUrl(url); return; } bool bRet = false; QDBusMessage m = QDBusMessage::createMethodCall(KYLIN_USER_GUIDE_SERVICE, KYLIN_USER_GUIDE_PATH, KYLIN_USER_GUIDE_INTERFACE, "showGuide"); m << appName; QDBusMessage response = QDBusConnection::sessionBus().call(m); if (response.type()== QDBusMessage::ReplyMessage) { //bRet = response.arguments().at(0).toBool(); } else { QUrl url = QUrl("help:ubuntu-kylin-help", QUrl::TolerantMode); QDesktopServices::openUrl(url); } } void PeonyDesktopApplication::parseCmd(quint32 id, QByteArray msg, bool isPrimary) { QCommandLineParser parser; QCommandLineOption quitOption(QStringList()<<"q"<<"quit", tr("Close the peony desktop window")); parser.addOption(quitOption); QCommandLineOption daemonOption(QStringList()<<"d"<<"daemon", tr("Take over the dbus service.")); parser.addOption(daemonOption); QCommandLineOption desktopOption(QStringList()<<"w"<<"desktop-window", tr("Take over the desktop displaying")); parser.addOption(desktopOption); if (isPrimary) { if (m_first_parse) { auto helpOption = parser.addHelpOption(); auto versionOption = parser.addVersionOption(); m_first_parse = false; } Q_UNUSED(id) const QStringList args = QString(msg).split(' '); parser.process(args); if (parser.isSet(quitOption)) { QTimer::singleShot(1, [=](){ qApp->quit(); }); return; } if (parser.isSet(daemonOption)) { if (!has_daemon) { qDebug()<<"-d"; trySetDefaultFolderUrlHandler(); //FIXME: take over org.freedesktop.FileManager1 Peony::FMDBusService *service = new Peony::FMDBusService(this); connect(service, &Peony::FMDBusService::showItemsRequest, [=](const QStringList &urisList){ QProcess p; #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) p.setProgram("peony"); p.setArguments(QStringList()<<"--show-items"<= QT_VERSION_CHECK(5, 10, 0) p.setProgram("peony"); p.setArguments(QStringList()<<"--show-folders"<= QT_VERSION_CHECK(5, 10, 0) p.setProgram("peony"); p.setArguments(QStringList()<<"--show-properties"<screens()) { addWindow(screen); } } has_desktop = true; } connect(this, &QApplication::paletteChanged, this, [=](const QPalette &pal){ for (auto w : allWidgets()) { w->setPalette(pal); w->update(); } }); } else { auto helpOption = parser.addHelpOption(); auto versionOption = parser.addVersionOption(); if (arguments().count() < 2) { parser.showHelp(); } parser.process(arguments()); sendMessage(msg); } } void PeonyDesktopApplication::addWindow(QScreen *screen, bool checkPrimay) { Peony::DesktopWindow *window; if (checkPrimay) { bool is_primary = isPrimaryScreen(screen); window = new Peony::DesktopWindow(screen, is_primary); if (is_primary) { window->setCentralWidget(desktop_icon_view); window->updateView(); //connect(window, &Peony::DesktopWindow::changeBg, this, &PeonyDesktopApplication::changeBgProcess); } } else { window = new Peony::DesktopWindow(screen, false); } connect(window, &Peony::DesktopWindow::checkWindow, this, &PeonyDesktopApplication::checkWindowProcess); //window->showFullScreen(); m_window_list<updateWinGeometry(); } } void PeonyDesktopApplication::layoutDirectionChangedProcess(Qt::LayoutDirection direction) { //not regular operate, to complete later qDebug()<<"layoutDirectionChangedProcess"<name()<geometry()<availableGeometry()<virtualGeometry(); bool need_exchange = false; QScreen *preMainScreen = nullptr; Peony::DesktopWindow *rawPrimaryWindow = nullptr; Peony::DesktopWindow *currentPrimayWindow = nullptr; for(auto win : m_window_list) { if (win->centralWidget()) rawPrimaryWindow = win; if (win->getScreen() == screen) currentPrimayWindow = win; //need exchange window screen // if (win->getView() && win->getScreen() != screen) // { // preMainScreen = win->getScreen(); // need_exchange = true; // break; // } } if (rawPrimaryWindow && currentPrimayWindow) { currentPrimayWindow->setCentralWidget(getIconView()); //desktop_icon_view->show(); currentPrimayWindow->updateView(); } return; //do not check window need exchange //cause we always put the desktop icon view into window //which in current primary screen. if (need_exchange) { for(auto win : m_window_list) { //qDebug()<<"before screen info"<getScreen()->name()<getScreen()->geometry()<geometry()<name(); win->disconnectSignal(); if (win->getScreen() == preMainScreen) { win->setScreen(screen); win->setIsPrimary(true); } else if (win->getScreen() == screen) { win->setScreen(preMainScreen); win->setIsPrimary(false); } win->connectSignal(); win->updateWinGeometry(); //qDebug()<<"end screen info"<getScreen()->name()<getScreen()->geometry()<geometry(); //if (win->getView()) //qDebug()<<"view info:"<getView(); } } } void PeonyDesktopApplication::screenAddedProcess(QScreen *screen) { if (screen != nullptr) qDebug()<<"screenAdded"<name()<availableSize(); addWindow(screen, false); } void PeonyDesktopApplication::screenRemovedProcess(QScreen *screen) { if (screen != nullptr) qDebug()<<"screenRemoved"<name()<serialNumber(); //window manage for(auto win :m_window_list) { //screen not changed if (win->getScreen() == screen) { qDebug()<<"remove window"; m_window_list.removeOne(win); win->deleteLater(); } } } bool PeonyDesktopApplication::isPrimaryScreen(QScreen *screen) { if (screen == this->primaryScreen()) return true; return false; } void PeonyDesktopApplication::changeBgProcess(const QString& bgPath) { // for (auto win : m_window_list) { // if (!isPrimaryScreen(win->getScreen())) // win->setBg(bgPath); // } } void PeonyDesktopApplication::checkWindowProcess() { //do not check windows, primary window should be handled to exchange in //primaryScreenChanged signal emitted. return; for(auto win : m_window_list) { //fix duplicate screen cover main screen view problem if (win->getScreen() != this->primaryScreen()) { if (win->getScreen()->geometry() == this->primaryScreen()->geometry()) { win->setVisible(false); } else { win->setVisible(true); } } } } peony/peony-qt-desktop/fm-dbus-service.h0000644000175000017500000000317413610734767017242 0ustar fengfeng/* * Peony-Qt * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License * along with this program. If not, see . * * Authors: Yue Lan * */ #ifndef FMDBUSSERVICE_H #define FMDBUSSERVICE_H #include namespace Peony { class FMDBusService : public QObject { Q_OBJECT //Do not modify this row. Q_CLASSINFO("D-Bus Interface", "org.freedesktop.FileManager1") public: explicit FMDBusService(QObject *parent = nullptr); Q_SCRIPTABLE void ShowFolders(const QStringList& uriList, const QString& startUpId); Q_SCRIPTABLE void ShowItems(const QStringList& uriList, const QString& startUpId); Q_SCRIPTABLE void ShowItemProperties(const QStringList& uriList, const QString& startUpId); Q_SIGNALS: void showFolderRequest(const QStringList& uriList, const QString& startUpId); void showItemsRequest(const QStringList& uriList, const QString& startUpId); void showItemPropertiesRequest(const QStringList& uriList, const QString& startUpId); }; } #endif // FMDBUSSERVICE_H peony/peony-qt-desktop/desktop-index-widget.cpp0000644000175000017500000002162013642614372020627 0ustar fengfeng/* * Peony-Qt * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License * along with this program. If not, see . * * Authors: Yue Lan * */ #include "icon-view-delegate.h" #include "desktop-index-widget.h" #include "desktop-icon-view-delegate.h" #include "desktop-icon-view.h" #include #include #include #include #include #include #include using namespace Peony; DesktopIndexWidget::DesktopIndexWidget(DesktopIconViewDelegate *delegate, const QStyleOptionViewItem &option, const QModelIndex &index, QWidget *parent) : QWidget(parent) { setContentsMargins(0, 0, 0, 0); m_option = option; m_index = index; m_delegate = delegate; m_current_font = QApplication::font(); updateItem(); connect(qApp, &QApplication::fontChanged, this, [=](){ m_delegate->getView()->setIndexWidget(m_index, nullptr); }); auto view = m_delegate->getView(); view->m_real_do_edit = false; view->m_edit_trigger_timer.stop(); view->m_edit_trigger_timer.start(); } DesktopIndexWidget::~DesktopIndexWidget() { } void DesktopIndexWidget::paintEvent(QPaintEvent *e) { //qDebug()<<"paint"; auto visualRect = m_delegate->getView()->visualRect(m_index); move(visualRect.topLeft()); Q_UNUSED(e) QPainter p(this); auto bgColor = m_option.palette.highlight().color(); bgColor.setAlpha(255*0.7); p.fillRect(this->rect(), bgColor); auto view = m_delegate->getView(); //auto font = view->getViewItemFont(&m_option); auto opt = m_option; auto iconSizeExcepted = m_delegate->getView()->iconSize(); auto iconRect = QApplication::style()->subElementRect(QStyle::SE_ItemViewItemDecoration, &opt, opt.widget); int y_delta = iconSizeExcepted.height() - iconRect.height(); opt.rect.moveTo(opt.rect.x(), opt.rect.y() + y_delta); //setFixedHeight(opt.rect.height() + y_delta); // draw icon opt.text = nullptr; QApplication::style()->drawControl(QStyle::CE_ItemViewItem, &opt, &p, m_delegate->getView()); p.save(); p.translate(0, 5 + m_delegate->getView()->iconSize().height() + 5); // draw text shadow p.save(); p.translate(1, 1); QColor shadow = Qt::black; shadow.setAlpha(127); p.setPen(shadow); Peony::DirectoryView::IconViewTextHelper::paintText(&p, m_option, m_index, 9999, 2, 0, false); // QFontMetrics fm(m_current_font); // style()->drawItemText(&p, // m_text_rect, // Qt::AlignTop|Qt::TextWrapAnywhere|Qt::AlignHCenter, // this->palette(), // true, // m_option.text, // QPalette::Shadow); p.restore(); // draw text p.setPen(m_option.palette.highlightedText().color()); Peony::DirectoryView::IconViewTextHelper::paintText(&p, m_option, m_index, 9999, 2, 0, false); // style()->drawItemText(&p, // m_text_rect, // Qt::AlignTop|Qt::TextWrapAnywhere|Qt::AlignHCenter, // this->palette(), // true, // m_option.text, // QPalette::HighlightedText); p.restore(); bgColor.setAlpha(255*0.8); p.setPen(bgColor); p.drawRect(this->rect().adjusted(0, 0, -1, -1)); } void DesktopIndexWidget::mousePressEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton) { auto view = m_delegate->getView(); view->m_real_do_edit = true; if (view->m_edit_trigger_timer.isActive()) { if (view->m_edit_trigger_timer.remainingTime() < 2250 && view->m_edit_trigger_timer.remainingTime() > 0) { QTimer::singleShot(300, view, [=](){ if (view->m_real_do_edit) { //not allow to edit special items:computer,trash and personal home path folder name bool special_index = false; QString homeUri = "file://" + QStandardPaths::writableLocation(QStandardPaths::HomeLocation); special_index = (m_index.data(Qt::UserRole).toString() == "computer:///" || m_index.data(Qt::UserRole).toString() == "trash:///" || m_index.data(Qt::UserRole).toString() == homeUri); if (special_index) return ; view->setIndexWidget(m_index, nullptr); view->edit(m_index); } }); } else { view->m_real_do_edit = false; view->m_edit_trigger_timer.stop(); } } else { view->m_real_do_edit = false; view->m_edit_trigger_timer.start(); } event->accept(); return; // if (m_edit_trigger.isActive()) { // qDebug()<<"IconViewIndexWidget::mousePressEvent: edit"<type(); // m_delegate->getView()->setIndexWidget(m_index, nullptr); // m_delegate->getView()->edit(m_index); // return; // } } QWidget::mousePressEvent(event); } void DesktopIndexWidget::mouseDoubleClickEvent(QMouseEvent *event) { m_delegate->getView()->doubleClicked(m_index); m_delegate->getView()->setIndexWidget(m_index, nullptr); return; } void DesktopIndexWidget::updateItem() { auto view = m_delegate->getView(); m_option = view->viewOptions(); m_delegate->initStyleOption(&m_option, m_index); QSize size = m_delegate->sizeHint(m_option, m_index); auto visualRect = m_delegate->getView()->visualRect(m_index); move(visualRect.topLeft()); setFixedWidth(visualRect.width()); m_option.rect.setWidth(visualRect.width()); int rawHeight = m_option.rect.height(); auto textSize = Peony::DirectoryView::IconViewTextHelper::getTextSizeForIndex(m_option, m_index, 2); int fixedHeight = 5 + m_delegate->getView()->iconSize().height() + 5 + textSize.height() + 5; if (fixedHeight < rawHeight) fixedHeight = rawHeight; setMinimumHeight(size.height()); m_option.text = m_index.data().toString(); //qDebug()<getViewItemFont(&m_option); auto rawTextRect = QApplication::style()->subElementRect(QStyle::SE_ItemViewItemText, &m_option, m_option.widget); auto iconSizeExcepted = m_delegate->getView()->iconSize(); auto iconRect = QApplication::style()->subElementRect(QStyle::SE_ItemViewItemDecoration, &m_option, m_option.widget); auto y_delta = iconSizeExcepted.height() - iconRect.height(); rawTextRect.setTop(iconRect.bottom() + y_delta + 5); rawTextRect.setHeight(9999); QFontMetrics fm(m_current_font); auto textRect = QApplication::style()->itemTextRect(fm, rawTextRect, Qt::AlignTop|Qt::AlignHCenter|Qt::TextWrapAnywhere, true, m_option.text); m_text_rect = textRect; //m_option.font = font; auto opt = m_option; qDebug()<. * * Authors: Yue Lan * */ #ifndef DESKTOPICONVIEWDELEGATE_H #define DESKTOPICONVIEWDELEGATE_H #include class QPushButton; namespace Peony { class DesktopIconView; class DesktopIconViewDelegate : public QStyledItemDelegate { Q_OBJECT public: explicit DesktopIconViewDelegate(QObject *parent = nullptr); ~DesktopIconViewDelegate() override; void initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const override {return QStyledItemDelegate::initStyleOption(option, index);} QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; DesktopIconView *getView() const; protected: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; //edit QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override; void setEditorData(QWidget *editor, const QModelIndex &index) const override; void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override; void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override; private: QPushButton *m_styled_button; }; } #endif // DESKTOPICONVIEWDELEGATE_H peony/peony-qt-desktop/desktop-window.h0000644000175000017500000000556113635337635017227 0ustar fengfeng/* * Peony-Qt * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License * along with this program. If not, see . * * Authors: Yue Lan * Authors: Meihong He * */ #ifndef DESKTOP_WINDOW_H #define DESKTOP_WINDOW_H #include #include #include class QVariantAnimation; class QLabel; class QListView; class QGraphicsOpacityEffect; class QGSettings; class QSettings; namespace Peony { class DesktopIconView; class DesktopWindow : public QMainWindow { Q_OBJECT public: DesktopWindow(QScreen *screen, bool is_primary, QWidget *parent = nullptr); ~DesktopWindow(); public: const QString getCurrentBgPath(); const QColor getCurrentColor(); bool getIsPrimary(){return m_is_primary;} void setIsPrimary(bool is_primary); QScreen *getScreen(){return m_screen;} void setScreen(QScreen *screen); DesktopIconView *getView(){return m_view;} static void gotoSetBackground(); Q_SIGNALS: void changeBg(const QString &bgPath); void checkWindow(); public Q_SLOTS: void setBgPath(const QString &bgPath); void availableGeometryChangedProcess(const QRect &geometry); void virtualGeometryChangedProcess(const QRect &geometry); void geometryChangedProcess(const QRect &geometry); void scaleBg(const QRect &geometry); void updateView(); void updateWinGeometry(); void connectSignal(); void disconnectSignal(); protected: void paintEvent(QPaintEvent *e); protected Q_SLOTS: void setBg(const QString &bgPath); void setBg(const QColor &color); protected: void initShortcut(); void initGSettings(); private: QString m_current_bg_path; DesktopIconView *m_view; QPixmap m_bg_font_pixmap; QPixmap m_bg_back_pixmap; QPixmap m_bg_font_cache_pixmap; QPixmap m_bg_back_cache_pixmap; QGraphicsOpacityEffect *m_opacity_effect; QScreen *m_screen; QStackedLayout *m_layout; bool m_is_primary; QGSettings *m_bg_settings = nullptr; QSettings *m_backup_setttings = nullptr; QColor m_last_pure_color = Qt::transparent; QColor m_color_to_be_set = Qt::transparent; bool m_use_pure_color = false; QVariantAnimation *m_opacity = nullptr; }; } #endif // DESKTOP-WINDOW_H peony/peony-qt-desktop/desktop-icon-view.cpp0000644000175000017500000010154013642614372020137 0ustar fengfeng/* * Peony-Qt * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License * along with this program. If not, see . * * Authors: Yue Lan * */ #include "peony-desktop-application.h" #include "desktop-icon-view.h" #include "icon-view-style.h" #include "desktop-icon-view-delegate.h" #include "desktop-item-model.h" #include "desktop-item-proxy-model.h" #include "file-operation-manager.h" #include "file-move-operation.h" #include "file-copy-operation.h" #include "file-trash-operation.h" #include "clipboard-utils.h" #include "properties-window.h" #include "file-utils.h" #include "file-operation-utils.h" #include "desktop-menu.h" #include "desktop-window.h" #include "file-item-model.h" #include "file-info-job.h" #include "file-launch-manager.h" #include #include #include "desktop-index-widget.h" #include "file-meta-info.h" #include "global-settings.h" #include #include #include #include #include #include #include #include #include #include using namespace Peony; #define ITEM_POS_ATTRIBUTE "metadata::peony-qt-desktop-item-position" DesktopIconView::DesktopIconView(QWidget *parent) : QListView(parent) { installEventFilter(this); initShoutCut(); //initMenu(); initDoubleClick(); connect(qApp, &QApplication::paletteChanged, this, [=](){ viewport()->update(); }); m_edit_trigger_timer.setSingleShot(true); m_edit_trigger_timer.setInterval(3000); m_last_index = QModelIndex(); setContentsMargins(0, 0, 0, 0); setAttribute(Qt::WA_TranslucentBackground); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); //fix rubberband style. setStyle(DirectoryView::IconViewStyle::getStyle()); setItemDelegate(new DesktopIconViewDelegate(this)); setDefaultDropAction(Qt::MoveAction); setSelectionMode(QListView::ExtendedSelection); setEditTriggers(QListView::NoEditTriggers); setViewMode(QListView::IconMode); setMovement(QListView::Snap); setFlow(QListView::TopToBottom); setResizeMode(QListView::Adjust); setWordWrap(true); setDragDropMode(QListView::DragDrop); //setContextMenuPolicy(Qt::CustomContextMenu); setSelectionMode(QListView::ExtendedSelection); auto zoomLevel = this->zoomLevel(); setDefaultZoomLevel(zoomLevel); //#if QT_VERSION > QT_VERSION_CHECK(5, 12, 0) // QTimer::singleShot(500, this, [=](){ //#else // QTimer::singleShot(500, [=](){ //#endif // connect(this->selectionModel(), &QItemSelectionModel::selectionChanged, [=](const QItemSelection &selection, const QItemSelection &deselection){ // //qDebug()<<"selection changed"; // m_real_do_edit = false; // this->setIndexWidget(m_last_index, nullptr); // auto currentSelections = this->selectionModel()->selection().indexes(); // if (currentSelections.count() == 1) { // //qDebug()<<"set index widget"; // m_last_index = currentSelections.first(); // auto delegate = qobject_cast(itemDelegate()); // this->setIndexWidget(m_last_index, new DesktopIndexWidget(delegate, viewOptions(), m_last_index, this)); // } else { // m_last_index = QModelIndex(); // for (auto index : deselection.indexes()) { // this->setIndexWidget(index, nullptr); // } // } // }); // }); m_model = new DesktopItemModel(this); m_proxy_model = new DesktopItemProxyModel(m_model); m_proxy_model->setSourceModel(m_model); //connect(m_model, &DesktopItemModel::dataChanged, this, &DesktopIconView::clearAllIndexWidgets); connect(m_model, &DesktopItemModel::refreshed, this, [=](){ this->updateItemPosistions(nullptr); this->m_is_refreshing = false; }); connect(m_model, &DesktopItemModel::requestClearIndexWidget, this, &DesktopIconView::clearAllIndexWidgets); connect(m_model, &DesktopItemModel::requestLayoutNewItem, this, [=](const QString &uri){ auto index = m_proxy_model->mapFromSource(m_model->indexFromUri(uri)); //qDebug()<<"=====================layout new item"<contentsMargins().left(), this->contentsMargins().top()); auto grid = this->gridSize(); auto viewRect = this->rect(); auto next = rect; while (true) { if (this->indexAt(next.center()).data(Qt::UserRole).toString() == uri) { this->setPositionForIndex(next.topLeft(), index); this->saveItemPositionInfo(uri); return; } if (!this->indexAt(next.center()).isValid()) { //put it into empty qDebug()<<"put"<setPositionForIndex(next.topLeft(), index); this->saveItemPositionInfo(uri); break; } //aligin. next = QListView::visualRect(this->indexAt(next.center())); next.translate(0, grid.height()); if (next.bottom() > viewRect.bottom()) { int top = next.y(); while (true) { if (top < gridSize().height()) { break; } top-=gridSize().height(); } //put item to next column first column next.moveTo(next.x() + grid.width(), top); } } }); connect(m_model, &DesktopItemModel::requestUpdateItemPositions, this, &DesktopIconView::updateItemPosistions); connect(m_model, &DesktopItemModel::fileCreated, this, [=](const QString &uri){ if (m_new_files_to_be_selected.isEmpty()) { m_new_files_to_be_selected< QT_VERSION_CHECK(5, 12, 0) QTimer::singleShot(500, this, [=](){ #else QTimer::singleShot(500, [=](){ #endif if (this->state() & QAbstractItemView::EditingState) return; this->setSelections(m_new_files_to_be_selected); m_new_files_to_be_selected.clear(); }); } else { if (!m_new_files_to_be_selected.contains(uri)) { m_new_files_to_be_selected<getSortType() == DesktopItemProxyModel::Other) { return; } if (m_proxy_model->sortColumn() != 0) { return; } //qDebug()<<"save===================================="; #if QT_VERSION > QT_VERSION_CHECK(5, 12, 0) QTimer::singleShot(100, this, [=](){ #else QTimer::singleShot(100, [=](){ #endif this->saveAllItemPosistionInfos(); }); }); connect(this, &QListView::iconSizeChanged, this, [=](){ //qDebug()<<"save============="; this->setSortType(GlobalSettings::getInstance()->getValue(LAST_DESKTOP_SORT_ORDER).toInt()); #if QT_VERSION > QT_VERSION_CHECK(5, 12, 0) QTimer::singleShot(100, this, [=](){ #else QTimer::singleShot(100, [=](){ #endif this->saveAllItemPosistionInfos(); }); }); setModel(m_proxy_model); //m_proxy_model->sort(0); this->refresh(); } DesktopIconView::~DesktopIconView() { //saveAllItemPosistionInfos(); } bool DesktopIconView::eventFilter(QObject *obj, QEvent *e) { if (e->type() == QEvent::StyleChange) { if (m_model) updateItemPosistions(); } return false; } void DesktopIconView::initShoutCut() { QAction *copyAction = new QAction(this); copyAction->setShortcut(QKeySequence::Copy); connect(copyAction, &QAction::triggered, [=]() { auto selectedUris = this->getSelections(); if (!selectedUris.isEmpty()) ClipboardUtils::setClipboardFiles(selectedUris, false); }); addAction(copyAction); QAction *cutAction = new QAction(this); cutAction->setShortcut(QKeySequence::Cut); connect(cutAction, &QAction::triggered, [=]() { auto selectedUris = this->getSelections(); if (!selectedUris.isEmpty()) ClipboardUtils::setClipboardFiles(selectedUris, true); }); addAction(cutAction); QAction *pasteAction = new QAction(this); pasteAction->setShortcut(QKeySequence::Paste); connect(pasteAction, &QAction::triggered, [=]() { auto clipUris = ClipboardUtils::getClipboardFilesUris(); if (ClipboardUtils::isClipboardHasFiles()) { ClipboardUtils::pasteClipboardFiles(this->getDirectoryUri()); } }); addAction(pasteAction); QAction *trashAction = new QAction(this); trashAction->setShortcut(QKeySequence::Delete); connect(trashAction, &QAction::triggered, [=]() { auto selectedUris = this->getSelections(); if (!selectedUris.isEmpty()) { auto op = new FileTrashOperation(selectedUris); FileOperationManager::getInstance()->startOperation(op, true); } }); addAction(trashAction); QAction *undoAction = new QAction(this); undoAction->setShortcut(QKeySequence::Undo); connect(undoAction, &QAction::triggered, [=]() { FileOperationManager::getInstance()->undo(); }); addAction(undoAction); QAction *redoAction = new QAction(this); redoAction->setShortcut(QKeySequence::Redo); connect(redoAction, &QAction::triggered, [=]() { FileOperationManager::getInstance()->redo(); }); addAction(redoAction); QAction *zoomInAction = new QAction(this); zoomInAction->setShortcut(QKeySequence::ZoomIn); connect(zoomInAction, &QAction::triggered, [=]() { this->zoomIn(); }); addAction(zoomInAction); QAction *zoomOutAction = new QAction(this); zoomOutAction->setShortcut(QKeySequence::ZoomOut); connect(zoomOutAction, &QAction::triggered, [=]() { this->zoomOut(); }); addAction(zoomOutAction); QAction *renameAction = new QAction(this); renameAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_E)); connect(renameAction, &QAction::triggered, [=]() { auto selections = this->getSelections(); if (selections.count() == 1) { this->editUri(selections.first()); } }); addAction(renameAction); QAction *removeAction = new QAction(this); removeAction->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_Delete)); connect(removeAction, &QAction::triggered, [=]() { qDebug() << "delete" << this->getSelections(); FileOperationUtils::executeRemoveActionWithDialog(this->getSelections()); }); addAction(removeAction); QAction *helpAction = new QAction(this); helpAction->setShortcut(Qt::Key_F1); connect(helpAction, &QAction::triggered, this, [=](){ PeonyDesktopApplication::showGuide(); }); addAction(helpAction); auto propertiesWindowAction = new QAction(this); propertiesWindowAction->setShortcuts(QList()<getSelections().count() > 0) { PropertiesWindow *w = new PropertiesWindow(this->getSelections()); w->show(); } }); addAction(propertiesWindowAction); auto newFolderAction = new QAction(this); newFolderAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_N)); connect(newFolderAction, &QAction::triggered, this, [=](){ CreateTemplateOperation op(this->getDirectoryUri(), CreateTemplateOperation::EmptyFolder, tr("New Folder")); op.run(); auto targetUri = op.target(); #if QT_VERSION > QT_VERSION_CHECK(5, 12, 0) QTimer::singleShot(500, this, [=](){ #else QTimer::singleShot(500, [=](){ #endif this->scrollToSelection(targetUri); }); }); addAction(newFolderAction); auto refreshAction = new QAction(this); refreshAction->setShortcut(Qt::Key_F5); connect(refreshAction, &QAction::triggered, this, [=](){ this->refresh(); }); addAction(refreshAction); QAction *editAction = new QAction(this); editAction->setShortcuts(QList()<getSelections(); if (selections.count() == 1) { this->editUri(selections.first()); } }); addAction(editAction); } void DesktopIconView::initMenu() { /*! * \bug * * when view switch to another desktop window, * menu might no be callable. */ return; setContextMenuPolicy(Qt::CustomContextMenu); // menu connect(this, &QListView::customContextMenuRequested, this, [=](const QPoint &pos) { // FIXME: use other menu qDebug() << "menu request"; if (!this->indexAt(pos).isValid()) { this->clearSelection(); } else { this->clearSelection(); this->selectionModel()->select(this->indexAt(pos), QItemSelectionModel::Select); } QTimer::singleShot(1, [=]() { DesktopMenu menu(this); if (this->getSelections().isEmpty()) { auto action = menu.addAction(tr("set background")); connect(action, &QAction::triggered, [=]() { //go to control center set background DesktopWindow::gotoSetBackground(); // QFileDialog dlg; // dlg.setNameFilters(QStringList() << "*.jpg" // << "*.png"); // if (dlg.exec()) { // auto url = dlg.selectedUrls().first(); // this->setBg(url.path()); // // qDebug()<changeBg(url.path()); // } }); } menu.exec(QCursor::pos()); auto urisToEdit = menu.urisToEdit(); if (urisToEdit.count() == 1) { QTimer::singleShot( 100, this, [=]() { this->editUri(urisToEdit.first()); }); } }); }, Qt::UniqueConnection); } void DesktopIconView::initDoubleClick() { connect(this, &QListView::doubleClicked, this, [=](const QModelIndex &index) { qDebug() << "double click" << index.data(FileItemModel::UriRole); auto uri = index.data(FileItemModel::UriRole).toString(); auto info = FileInfo::fromUri(uri, false); auto job = new FileInfoJob(info); job->setAutoDelete(); job->connect(job, &FileInfoJob::queryAsyncFinished, [=]() { if (info->isDir() || info->isVolume() || info->isVirtual()) { #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) QProcess p; QUrl url = uri; p.setProgram("peony"); p.setArguments(QStringList() << url.toEncoded()); p.startDetached(); #else QProcess p; p.startDetached("peony", QStringList()<clearSelection(); }); job->queryAsync(); }, Qt::UniqueConnection); } void DesktopIconView::saveAllItemPosistionInfos() { //qDebug()<<"======================save"; for (int i = 0; i < m_proxy_model->rowCount(); i++) { auto index = m_proxy_model->index(i, 0); auto indexRect = QListView::visualRect(index); QStringList topLeft; topLeft<setMetaInfoStringList(ITEM_POS_ATTRIBUTE, topLeft); } } //qDebug()<<"======================save finished"; } void DesktopIconView::saveItemPositionInfo(const QString &uri) { auto index = m_proxy_model->mapFromSource(m_model->indexFromUri(uri)); auto indexRect = QListView::visualRect(index); QStringList topLeft; topLeft<setMetaInfoStringList(ITEM_POS_ATTRIBUTE, topLeft); } } void DesktopIconView::resetAllItemPositionInfos() { for (int i = 0; i < m_proxy_model->rowCount(); i++) { auto index = m_proxy_model->index(i, 0); auto indexRect = QListView::visualRect(index); QStringList topLeft; topLeft<setMetaInfoStringList(ITEM_POS_ATTRIBUTE, tmp); } } } void DesktopIconView::resetItemPosistionInfo(const QString &uri) { auto metaInfo = FileMetaInfo::fromUri(uri); if (metaInfo) metaInfo->removeMetaInfo(ITEM_POS_ATTRIBUTE); } void DesktopIconView::updateItemPosistions(const QString &uri) { if (uri.isNull()) { for (int i = 0; i < m_proxy_model->rowCount(); i++) { auto index = m_proxy_model->index(i, 0); auto metaInfo = FileMetaInfo::fromUri(index.data(Qt::UserRole).toString()); if (metaInfo) { updateItemPosistions(index.data(Qt::UserRole).toString()); } } return; } auto index = m_proxy_model->mapFromSource(m_model->indexFromUri(uri)); //qDebug()<<"update"<getMetaInfoStringList(ITEM_POS_ATTRIBUTE); if (!list.isEmpty()) { if (list.count() == 2) { int top = list.first().toInt(); int left = list.at(1).toInt(); if (top >= 0 && left >= 0) { // auto rect = visualRect(index); // auto grid = gridSize(); // if (abs(rect.top() - top) < grid.width() && abs(rect.left() - left)) // return; QPoint p(left, top); //qDebug()<<"set"<selection().indexes(); for (auto index : indexes) { uris<rowCount(); i++) { auto index = m_proxy_model->index(i, 0); if (uris.contains(index.data(Qt::UserRole).toString())) { selectionModel()->select(index, QItemSelectionModel::Select); } } } void DesktopIconView::invertSelections() { } void DesktopIconView::scrollToSelection(const QString &uri) { } int DesktopIconView::getSortType() { return m_proxy_model->getSortType(); } void DesktopIconView::setSortType(int sortType) { //resetAllItemPositionInfos(); m_proxy_model->setSortType(sortType); m_proxy_model->sort(1); m_proxy_model->sort(0, m_proxy_model->sortOrder()); } int DesktopIconView::getSortOrder() { return m_proxy_model->sortOrder(); } void DesktopIconView::setSortOrder(int sortOrder) { m_proxy_model->sort(0, Qt::SortOrder(sortOrder)); } void DesktopIconView::editUri(const QString &uri) { clearAllIndexWidgets(); #if QT_VERSION > QT_VERSION_CHECK(5, 12, 0) QTimer::singleShot(100, this, [=](){ #else QTimer::singleShot(100, [=](){ #endif edit(m_proxy_model->mapFromSource(m_model->indexFromUri(uri))); }); } void DesktopIconView::editUris(const QStringList uris) { } void DesktopIconView::setCutFiles(const QStringList &uris) { ClipboardUtils::setClipboardFiles(uris, true); } void DesktopIconView::closeView() { deleteLater(); } void DesktopIconView::wheelEvent(QWheelEvent *e) { if (QApplication::keyboardModifiers() == Qt::ControlModifier) { if (e->delta() > 0) { zoomIn(); } else { zoomOut(); } resetAllItemPositionInfos(); } } void DesktopIconView::keyPressEvent(QKeyEvent *e) { switch (e->key()) { case Qt::Key_Up: { if (getSelections().isEmpty()) { selectionModel()->select(model()->index(0, 0), QItemSelectionModel::SelectCurrent); } else { auto index = selectionModel()->selectedIndexes().first(); auto center = visualRect(index).center(); auto up = center - QPoint(0, gridSize().height()); auto upIndex = indexAt(up); if (upIndex.isValid()) { clearAllIndexWidgets(); selectionModel()->select(upIndex, QItemSelectionModel::SelectCurrent); auto delegate = qobject_cast(itemDelegate()); setIndexWidget(upIndex, new DesktopIndexWidget(delegate, viewOptions(), upIndex, this)); } } return; } case Qt::Key_Down: { if (getSelections().isEmpty()) { selectionModel()->select(model()->index(0, 0), QItemSelectionModel::SelectCurrent); } else { auto index = selectionModel()->selectedIndexes().first(); auto center = visualRect(index).center(); auto down = center + QPoint(0, gridSize().height()); auto downIndex = indexAt(down); if (downIndex.isValid()) { clearAllIndexWidgets(); selectionModel()->select(downIndex, QItemSelectionModel::SelectCurrent); auto delegate = qobject_cast(itemDelegate()); setIndexWidget(downIndex, new DesktopIndexWidget(delegate, viewOptions(), downIndex, this)); } } return; } case Qt::Key_Left: { if (getSelections().isEmpty()) { selectionModel()->select(model()->index(0, 0), QItemSelectionModel::SelectCurrent); } else { auto index = selectionModel()->selectedIndexes().first(); auto center = visualRect(index).center(); auto left = center - QPoint(gridSize().width(), 0); auto leftIndex = indexAt(left); if (leftIndex.isValid()) { clearAllIndexWidgets(); selectionModel()->select(leftIndex, QItemSelectionModel::SelectCurrent); auto delegate = qobject_cast(itemDelegate()); setIndexWidget(leftIndex, new DesktopIndexWidget(delegate, viewOptions(), leftIndex, this)); } } return; } case Qt::Key_Right: { if (getSelections().isEmpty()) { selectionModel()->select(model()->index(0, 0), QItemSelectionModel::SelectCurrent); } else { auto index = selectionModel()->selectedIndexes().first(); auto center = visualRect(index).center(); auto right = center + QPoint(gridSize().width(), 0); auto rightIndex = indexAt(right); if (rightIndex.isValid()) { clearAllIndexWidgets(); selectionModel()->select(rightIndex, QItemSelectionModel::SelectCurrent); auto delegate = qobject_cast(itemDelegate()); setIndexWidget(rightIndex, new DesktopIndexWidget(delegate, viewOptions(), rightIndex, this)); } } return; } case Qt::Key_Shift: case Qt::Key_Control: m_ctrl_or_shift_pressed = true; break; default: return QListView::keyPressEvent(e); } } void DesktopIconView::keyReleaseEvent(QKeyEvent *e) { QListView::keyReleaseEvent(e); m_ctrl_or_shift_pressed = false; } void DesktopIconView::resizeEvent(QResizeEvent *e) { QListView::resizeEvent(e); refresh(); } void DesktopIconView::zoomOut() { clearAllIndexWidgets(); switch (zoomLevel()) { case Huge: setDefaultZoomLevel(Large); break; case Large: setDefaultZoomLevel(Normal); break; case Normal: setDefaultZoomLevel(Small); break; default: setDefaultZoomLevel(zoomLevel()); break; } } void DesktopIconView::zoomIn() { clearAllIndexWidgets(); switch (zoomLevel()) { case Small: setDefaultZoomLevel(Normal); break; case Normal: setDefaultZoomLevel(Large); break; case Large: setDefaultZoomLevel(Huge); break; default: setDefaultZoomLevel(zoomLevel()); break; } } /* Small, //icon: 32x32; grid: 56x64; hover rect: 40x56; font: system*0.8 Normal, //icon: 48x48; grid: 64x72; hover rect = 56x64; font: system Large, //icon: 64x64; grid: 115x135; hover rect = 105x118; font: system*1.2 Huge //icon: 96x96; grid: 130x150; hover rect = 120x140; font: system*1.4 */ void DesktopIconView::setDefaultZoomLevel(ZoomLevel level) { //qDebug()<<"set default zoom level:"<setMetaInfoInt("peony-qt-desktop-zoom-level", int(m_zoom_level)); } else { } } DesktopIconView::ZoomLevel DesktopIconView::zoomLevel() const { //FIXME: if (m_zoom_level != Invalid) return m_zoom_level; auto metaInfo = FileMetaInfo::fromUri("computer:///"); if (metaInfo) { auto i = metaInfo->getMetaInfoInt("peony-qt-desktop-zoom-level"); return ZoomLevel(i); } GFile *computer = g_file_new_for_uri("computer:///"); GFileInfo *info = g_file_query_info(computer, "metadata::peony-qt-desktop-zoom-level", G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, nullptr, nullptr); char* zoom_level = g_file_info_get_attribute_as_string(info, "metadata::peony-qt-desktop-zoom-level"); if (!zoom_level) { //qDebug()<<"======================no zoom level meta info\n\n\n"; g_object_unref(info); g_object_unref(computer); return Normal; } g_object_unref(info); g_object_unref(computer); QString zoomLevel = zoom_level; g_free(zoom_level); //qDebug()<pos()).isValid()) { clearAllIndexWidgets(); clearSelection(); } else { auto index = indexAt(e->pos()); clearAllIndexWidgets(); m_last_index = index; if (!indexWidget(m_last_index)) { setIndexWidget(m_last_index, new DesktopIndexWidget(qobject_cast(itemDelegate()), viewOptions(), m_last_index)); } } } //qDebug()<button() != Qt::LeftButton) { return; } QListView::mousePressEvent(e); } void DesktopIconView::mouseReleaseEvent(QMouseEvent *e) { QListView::mouseReleaseEvent(e); } void DesktopIconView::mouseDoubleClickEvent(QMouseEvent *event) { QListView::mouseDoubleClickEvent(event); m_real_do_edit = false; } void DesktopIconView::dragEnterEvent(QDragEnterEvent *e) { m_real_do_edit = false; //qDebug()<<"drag enter event"; if (e->mimeData()->hasUrls()) { e->setDropAction(Qt::MoveAction); e->acceptProposedAction(); } } void DesktopIconView::dragMoveEvent(QDragMoveEvent *e) { m_real_do_edit = false; auto index = indexAt(e->pos()); if (index.isValid() && index != m_last_index) { QHoverEvent he(QHoverEvent::HoverMove, e->posF(), e->posF()); viewportEvent(&he); } else { QHoverEvent he(QHoverEvent::HoverLeave, e->posF(), e->posF()); viewportEvent(&he); } if (e->isAccepted()) return; //qDebug()<<"drag move event"; if (this == e->source()) { e->accept(); return QListView::dragMoveEvent(e); } e->setDropAction(Qt::CopyAction); e->accept(); } void DesktopIconView::dropEvent(QDropEvent *e) { m_real_do_edit = false; //qDebug()<<"drop event"; /*! \todo fix the bug that move drop action can not move the desktop item to correct position. i use copy action to avoid this bug, but the drop indicator is incorrect. */ m_edit_trigger_timer.stop(); if (this == e->source()) { auto index = indexAt(e->pos()); if (index.isValid()) { auto info = FileInfo::fromUri(index.data(Qt::UserRole).toString()); if (!info->isDir()) return; } QListView::dropEvent(e); auto urls = e->mimeData()->urls(); for (auto url : urls) { // if (url.path() == QStandardPaths::writableLocation(QStandardPaths::HomeLocation)) // continue; saveItemPositionInfo(url.toDisplayString()); } return; } m_model->dropMimeData(e->mimeData(), Qt::MoveAction, -1, -1, this->indexAt(e->pos())); //FIXME: save item position } const QFont DesktopIconView::getViewItemFont(QStyleOptionViewItem *item) { auto font = item->font; if (font.pixelSize() <= 0) { font = QApplication::font(); } switch (zoomLevel()) { case DesktopIconView::Small: font.setPixelSize(int(font.pixelSize() * 0.8)); break; case DesktopIconView::Large: font.setPixelSize(int(font.pixelSize() * 1.2)); break; case DesktopIconView::Huge: font.setPixelSize(int(font.pixelSize() * 1.4)); break; default: break; } return font; } void DesktopIconView::clearAllIndexWidgets() { if (!model()) return; int row = 0; auto index = model()->index(row, 0); while (index.isValid()) { setIndexWidget(index, nullptr); row++; index = model()->index(row, 0); } } void DesktopIconView::refresh() { if (!m_model) return; if (m_is_refreshing) return; m_is_refreshing = true; m_model->refresh(); } QRect DesktopIconView::visualRect(const QModelIndex &index) const { auto rect = QListView::visualRect(index); QPoint p(10, 5); switch (zoomLevel()) { case Small: p *= 0.8; break; case Large: p *= 1.2; break; case Huge: p *= 1.4; break; default: break; } rect.moveTo(rect.topLeft() + p); return rect; } peony/peony-qt-desktop/main.cpp0000644000175000017500000000564013633643335015521 0ustar fengfeng/* * Peony-Qt * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License * along with this program. If not, see . * * Authors: Yue Lan * */ #include "desktop-window.h" #include "peony-desktop-application.h" #include #include #include #include #include void messageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) { QByteArray localMsg = msg.toLocal8Bit(); QByteArray currentTime = QTime::currentTime().toString().toLocal8Bit(); QString logFilePath = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + "/ukui/peony-qt-desktop.log"; bool showDebug = true; if (!QFile::exists(logFilePath)) { showDebug = false; } FILE *log_file = nullptr; if (showDebug) { log_file = fopen(logFilePath.toLocal8Bit().constData(), "a+"); } const char *file = context.file ? context.file : ""; const char *function = context.function ? context.function : ""; switch (type) { case QtDebugMsg: if (!log_file) { break; } fprintf(log_file, "Debug: %s: %s (%s:%u, %s)\n", currentTime.constData(), localMsg.constData(), file, context.line, function); break; case QtInfoMsg: fprintf(log_file? log_file: stdout, "Info: %s: %s (%s:%u, %s)\n", currentTime.constData(), localMsg.constData(), file, context.line, function); break; case QtWarningMsg: fprintf(log_file? log_file: stderr, "Warning: %s: %s (%s:%u, %s)\n", currentTime.constData(), localMsg.constData(), file, context.line, function); break; case QtCriticalMsg: fprintf(log_file? log_file: stderr, "Critical: %s: %s (%s:%u, %s)\n", currentTime.constData(), localMsg.constData(), file, context.line, function); break; case QtFatalMsg: fprintf(log_file? log_file: stderr, "Fatal: %s: %s (%s:%u, %s)\n", currentTime.constData(), localMsg.constData(), file, context.line, function); break; } if (log_file) fclose(log_file); } int main(int argc, char *argv[]) { qInstallMessageHandler(messageOutput); //PeonyDesktopApplication::setAttribute(Qt::AA_EnableHighDpiScaling); PeonyDesktopApplication a(argc, argv); if (a.isSecondary()) return 0; return a.exec(); } peony/peony-qt-desktop/peony-qt-desktop.pro0000644000175000017500000000435213621435375020035 0ustar fengfeng#------------------------------------------------- # # Project created by QtCreator 2019-10-28T14:12:53 # #------------------------------------------------- QT += core gui x11extras dbus concurrent greaterThan(QT_MAJOR_VERSION, 4): QT += widgets VERSION = 2.0.0 TARGET = peony-qt-desktop TEMPLATE = app # The following define makes your compiler emit warnings if you use # any feature of Qt which has been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 include(../libpeony-qt/libpeony-qt-header.pri) include(../3rd-parties/SingleApplication/singleapplication.pri) DEFINES += QAPPLICATION_CLASS=QApplication PKGCONFIG +=gio-2.0 glib-2.0 gio-unix-2.0 gsettings-qt CONFIG += c++11 link_pkgconfig no_keywords LIBS += -L$$PWD/../libpeony-qt/ -lpeony TRANSLATIONS += ../translations/peony-qt-desktop/peony-qt-desktop_zh_CN.ts SOURCES += \ main.cpp \ desktop-window.cpp \ peony-desktop-application.cpp \ fm-dbus-service.cpp \ desktop-item-model.cpp \ desktop-icon-view.cpp \ desktop-icon-view-delegate.cpp \ desktop-index-widget.cpp \ desktop-menu.cpp \ desktop-menu-plugin-manager.cpp \ desktop-item-proxy-model.cpp HEADERS += \ desktop-window.h \ peony-desktop-application.h \ fm-dbus-service.h \ desktop-item-model.h \ desktop-icon-view.h \ desktop-icon-view-delegate.h \ desktop-index-widget.h \ desktop-menu.h \ desktop-menu-plugin-manager.h \ desktop-item-proxy-model.h target.path = /usr/bin !isEmpty(target.path): INSTALLS += target translation.path = /usr/share/peony-qt-desktop translation.files += ../translations/peony-qt-desktop/* INSTALLS += translation data.path = /etc/xdg/autostart data.files += ../data/peony-desktop.desktop DISTFILES += RESOURCES += \ peony-qt-desktop-style.qrc peony/peony-qt-desktop/peony-desktop-application.h0000644000175000017500000000371213640373337021342 0ustar fengfeng/* * Peony-Qt * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License * along with this program. If not, see . * * Authors: Yue Lan * Authors: Meihong He * */ #ifndef PEONYDESKTOPAPPLICATION_H #define PEONYDESKTOPAPPLICATION_H #include "singleapplication.h" #include "desktop-window.h" #include #include class PeonyDesktopApplication : public SingleApplication { Q_OBJECT public: explicit PeonyDesktopApplication(int &argc, char *argv[], const char *applicationName = "peony-qt-desktop"); static Peony::DesktopIconView *getIconView(); static bool userGuideDaemonRunning(); static void showGuide(const QString &appName = "peony-dekstop"); protected Q_SLOTS: void parseCmd(quint32 id, QByteArray msg, bool isPrimary); bool isPrimaryScreen(QScreen *screen); public Q_SLOTS: void layoutDirectionChangedProcess(Qt::LayoutDirection direction); void primaryScreenChangedProcess(QScreen *screen); void screenAddedProcess(QScreen *screen); void screenRemovedProcess(QScreen *screen); void addWindow(QScreen *screen, bool checkPrimay = true); void changeBgProcess(const QString& bgPath); void checkWindowProcess(); private: bool m_first_parse = true; QList m_window_list; }; #endif // PEONYDESKTOPAPPLICATION_H peony/peony-qt-desktop/desktop-item-model.cpp0000644000175000017500000003163013635337635020303 0ustar fengfeng/* * Peony-Qt * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License * along with this program. If not, see . * * Authors: Yue Lan * */ #include "desktop-item-model.h" #include "file-enumerator.h" #include "file-info.h" #include "file-info-job.h" #include "file-info-manager.h" #include "file-watcher.h" #include "file-operation-manager.h" #include "file-move-operation.h" #include "file-trash-operation.h" #include "thumbnail-manager.h" #include "file-meta-info.h" #include #include #include #include #include #include using namespace Peony; DesktopItemModel::DesktopItemModel(QObject *parent) : QAbstractListModel(parent) { m_thumbnail_watcher = std::make_shared("thumbnail:///, this"); connect(m_thumbnail_watcher.get(), &FileWatcher::fileChanged, this, [=](const QString &uri){ for (auto info : m_files) { if (info->uri() == uri) { auto index = indexFromUri(uri); Q_EMIT this->dataChanged(index, index); } } }); m_trash_watcher = std::make_shared("trash:///", this); this->connect(m_trash_watcher.get(), &FileWatcher::fileCreated, [=](){ //qDebug()<<"trash changed"; auto trash = FileInfo::fromUri("trash:///", true); auto job = new FileInfoJob(trash); job->setAutoDelete(); connect(job, &FileInfoJob::infoUpdated, [=](){ auto trashIndex = this->indexFromUri("trash:///"); this->dataChanged(trashIndex, trashIndex); Q_EMIT this->requestClearIndexWidget(); }); job->queryAsync(); }); this->connect(m_trash_watcher.get(), &FileWatcher::fileDeleted, [=](){ //qDebug()<<"trash changed"; auto trash = FileInfo::fromUri("trash:///", true); auto job = new FileInfoJob(trash); job->setAutoDelete(); connect(job, &FileInfoJob::infoUpdated, [=](){ auto trashIndex = this->indexFromUri("trash:///"); this->dataChanged(trashIndex, trashIndex); Q_EMIT this->requestClearIndexWidget(); }); job->queryAsync(); }); m_desktop_watcher = std::make_shared("file://" + QStandardPaths::writableLocation(QStandardPaths::DesktopLocation), this); m_desktop_watcher->setMonitorChildrenChange(true); this->connect(m_desktop_watcher.get(), &FileWatcher::fileCreated, [=](const QString &uri){ //qDebug()<<"created"<uri() == info->uri()) { exsited = true; break; } } if (!exsited) { auto job = new FileInfoJob(info); job->setAutoDelete(); connect(job, &FileInfoJob::infoUpdated, [=](){ //this->beginResetModel(); this->beginInsertRows(QModelIndex(), m_files.count(), m_files.count()); ThumbnailManager::getInstance()->createThumbnail(info->uri(), m_desktop_watcher); m_files<insertRows(m_files.indexOf(info), 1); this->endInsertRows(); //this->endResetModel(); Q_EMIT this->requestUpdateItemPositions(); Q_EMIT this->requestLayoutNewItem(info->uri()); Q_EMIT this->fileCreated(uri); }); job->queryAsync(); } }); this->connect(m_desktop_watcher.get(), &FileWatcher::fileDeleted, [=](const QString &uri){ for (auto info : m_files) { if (info->uri() == uri) { //this->beginResetModel(); this->beginRemoveRows(QModelIndex(), m_files.indexOf(info), m_files.indexOf(info)); m_files.removeOne(info); this->endRemoveRows(); //this->endResetModel(); Q_EMIT this->requestClearIndexWidget(); Q_EMIT this->requestUpdateItemPositions(); FileInfoManager::getInstance()->remove(info); } } }); this->connect(m_desktop_watcher.get(), &FileWatcher::fileChanged, [=](const QString &uri){ for (auto info : m_files) { if (info->uri() == uri) { auto job = new FileInfoJob(info); job->setAutoDelete(); connect(job, &FileInfoJob::queryAsyncFinished, this, [=](){ ThumbnailManager::getInstance()->createThumbnail(uri, m_thumbnail_watcher); this->dataChanged(indexFromUri(uri), indexFromUri(uri)); Q_EMIT this->requestClearIndexWidget(); }); job->queryAsync(); this->dataChanged(indexFromUri(uri), indexFromUri(uri)); return; } } }); } DesktopItemModel::~DesktopItemModel() { FileInfoManager::getInstance()->clear(); } void DesktopItemModel::refresh() { ThumbnailManager::getInstance()->syncThumbnailPreferences(); beginResetModel(); //removeRows(0, m_files.count()); FileInfoManager::getInstance()->clear(); //m_trash_watcher->stopMonitor(); //m_desktop_watcher->stopMonitor(); for (auto info : m_files) { ThumbnailManager::getInstance()->releaseThumbnail(info->uri()); } m_files.clear(); m_enumerator = new FileEnumerator(this); m_enumerator->setAutoDelete(); m_enumerator->setEnumerateDirectory("file://" + QStandardPaths::writableLocation(QStandardPaths::DesktopLocation)); m_enumerator->connect(m_enumerator, &FileEnumerator::enumerateFinished, this, &DesktopItemModel::onEnumerateFinished); m_enumerator->enumerateAsync(); endResetModel(); } int DesktopItemModel::rowCount(const QModelIndex &parent) const { // For list models only the root node (an invalid parent) should return the list's size. For all // other (valid) parents, rowCount() should return 0 so that it does not become a tree model. if (parent.isValid()) return 0; return m_files.count(); } QVariant DesktopItemModel::data(const QModelIndex &index, int role) const { if (!index.isValid()) return QVariant(); //qDebug()<<"data"<uri(); auto info = m_files.at(index.row()); switch (role) { case Qt::DisplayRole: return info->displayName(); case Qt::ToolTipRole: return info->displayName(); case Qt::DecorationRole: { //auto thumbnail = info->thumbnail(); auto thumbnail = ThumbnailManager::getInstance()->tryGetThumbnail(info->uri()); if (!thumbnail.isNull()) { if (info->uri().endsWith(".desktop") && !info->canExecute()) { return QIcon::fromTheme(info->iconName(), QIcon::fromTheme("text-x-generic")); } return thumbnail; } return QIcon::fromTheme(info->iconName(), QIcon::fromTheme("text-x-generic")); } case UriRole: return info->uri(); case IsLinkRole: return info->isSymbolLink(); } return QVariant(); } void DesktopItemModel::onEnumerateFinished() { //beginResetModel(); FileInfoManager::getInstance()->clear(); m_files.clear(); auto computer = FileInfo::fromUri("computer:///", true); auto personal = FileInfo::fromPath(QStandardPaths::writableLocation(QStandardPaths::HomeLocation), true); auto trash = FileInfo::fromUri("trash:///", true); QList> infos; infos<getChildren(true); //qDebug()<endResetModel(); for (auto info : infos) { m_info_query_queue<uri(); m_files<insertRow(m_files.indexOf(info)); auto job = new FileInfoJob(info); connect(job, &FileInfoJob::infoUpdated, [=](){ //qDebug()<<"info updated"<uri(); this->dataChanged(this->index(m_files.indexOf(info)), this->index(m_files.indexOf(info))); ThumbnailManager::getInstance()->createThumbnail(info->uri(), m_desktop_watcher); m_info_query_queue.removeOne(info->uri()); if (m_info_query_queue.isEmpty()) { this->beginResetModel(); this->endResetModel(); Q_EMIT this->refreshed(); } }); job->setAutoDelete(); job->queryAsync(); } //qDebug()<<"startMornitor"; m_trash_watcher->startMonitor(); m_desktop_watcher->startMonitor(); } const QModelIndex DesktopItemModel::indexFromUri(const QString &uri) { for (auto info : m_files) { if (info->uri() == uri) { return index(m_files.indexOf(info)); } } return QModelIndex(); } const QString DesktopItemModel::indexUri(const QModelIndex &index) { if (index.row() < 0 || index.row() >= m_files.count()) { return nullptr; } return m_files.at(index.row())->uri(); } bool DesktopItemModel::insertRows(int row, int count, const QModelIndex &parent) { beginInsertRows(parent, row, row + count); endInsertRows(); return true; } bool DesktopItemModel::insertRow(int row, const QModelIndex &parent) { beginInsertRows(parent, row, row); endInsertRows(); return true; } bool DesktopItemModel::removeRows(int row, int count, const QModelIndex &parent) { beginRemoveRows(parent, row, row + count); endRemoveRows(); return true; } bool DesktopItemModel::removeRow(int row, const QModelIndex &parent) { beginRemoveRows(parent, row, row); endRemoveRows(); return true; } Qt::ItemFlags DesktopItemModel::flags(const QModelIndex &index) const { auto uri = index.data(UriRole).toString(); auto info = FileInfo::fromUri(uri, false); if (index.isValid()) { Qt::ItemFlags flags = QAbstractItemModel::flags(index); flags |= Qt::ItemIsDragEnabled; flags |= Qt::ItemIsEditable; if (info->isDir()) { flags |= Qt::ItemIsDropEnabled; } return flags; } else { return Qt::ItemIsDropEnabled; } } QMimeData *DesktopItemModel::mimeData(const QModelIndexList &indexes) const { QMimeData* data = QAbstractItemModel::mimeData(indexes); //set urls data URLs correspond to the MIME type text/uri-list. QList urls; for (auto index : indexes) { QUrl url = index.data(UriRole).toString(); urls<setUrls(urls); return data; } bool DesktopItemModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) { //qDebug()<isDir()) { return false; } //NOTE: //do not allow drop on it self. auto urls = data->urls(); if (urls.isEmpty()) { return false; } QStringList srcUris; for (auto url : urls) { srcUris<startOperation(trashOp, addHistory); } else { FileMoveOperation *moveOp = new FileMoveOperation(srcUris, destDirUri); moveOp->setCopyMove(true); fileOpMgr->startOperation(moveOp, addHistory); } //NOTE: //we have to handle the dnd with file operation, so do not //use QAbstractModel::dropMimeData() here; return QAbstractItemModel::dropMimeData(data, action, row, column, parent); } Qt::DropActions DesktopItemModel::supportedDropActions() const { //return Qt::MoveAction; return QAbstractItemModel::supportedDropActions(); } peony/peony-qt-desktop/desktop-icon-view-delegate.cpp0000644000175000017500000002457413642614372021722 0ustar fengfeng/* * Peony-Qt * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 General Public License * along with this program. If not, see . * * Authors: Yue Lan * */ #include "desktop-icon-view-delegate.h" #include "desktop-icon-view.h" #include "icon-view-editor.h" #include "file-operation-manager.h" #include "file-rename-operation.h" #include "icon-view-delegate.h" #include #include #include #include #include using namespace Peony; using namespace Peony::DirectoryView; DesktopIconViewDelegate::DesktopIconViewDelegate(QObject *parent) : QStyledItemDelegate(parent) { m_styled_button = new QPushButton; } DesktopIconViewDelegate::~DesktopIconViewDelegate() { m_styled_button->deleteLater(); } void DesktopIconViewDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { painter->save(); auto view = qobject_cast(parent()); auto style = option.widget->style(); QStyleOptionViewItem opt = option; initStyleOption(&opt, index); if (view->state() == DesktopIconView::DraggingState) { if (auto widget = view->indexWidget(index)) { view->setIndexWidget(index, nullptr); } if (view->selectionModel()->selection().contains(index)) { painter->setOpacity(0.8); } } else if (opt.state.testFlag(QStyle::State_Selected)) { if (view->indexWidget(index)) { opt.text = nullptr; } } //paint background if (!view->indexWidget(index)) { //painter->setClipRect(opt.rect); painter->save(); if (opt.state.testFlag(QStyle::State_MouseOver) && !opt.state.testFlag(QStyle::State_Selected)) { QColor color = m_styled_button->palette().highlight().color(); color.setAlpha(255*0.3);//half transparent painter->fillRect(opt.rect, color); color.setAlpha(255*0.5); painter->setPen(color.darker(100)); painter->drawRect(opt.rect.adjusted(0, 0, -1, -1)); } if (opt.state.testFlag(QStyle::State_Selected)) { QColor color = m_styled_button->palette().highlight().color(); color.setAlpha(255*0.7);//half transparent painter->fillRect(opt.rect, color); color.setAlpha(255*0.8); painter->setPen(color); painter->drawRect(opt.rect.adjusted(0, 0, -1, -1)); } painter->restore(); } auto iconSizeExpected = view->iconSize(); auto iconRect = style->subElementRect(QStyle::SE_ItemViewItemDecoration, &opt, opt.widget); int y_delta = iconSizeExpected.height() - iconRect.height(); opt.rect.translate(0, y_delta); int maxTextHight = opt.rect.height() - iconSizeExpected.height() - 10; if (maxTextHight < 0) { maxTextHight = 0; } //paint icon item auto color = QColor(230, 230, 230); opt.palette.setColor(QPalette::Text, color); color.setRgb(240, 240, 240); opt.palette.setColor(QPalette::HighlightedText, color); auto text = opt.text; opt.text = nullptr; style->drawControl(QStyle::CE_ItemViewItem, &opt, painter, opt.widget); opt.text = text; painter->save(); //painter->translate(visualRect.topLeft()); painter->translate(opt.rect.topLeft()); painter->translate(0, -y_delta); //paint text shadow painter->save(); painter->translate(1, 1 + iconSizeExpected.height() + 10); //painter->setFont(opt.font); QColor shadow = Qt::black; shadow.setAlpha(127); painter->setPen(shadow); IconViewTextHelper::paintText(painter, opt, index, maxTextHight, 0, 2, false); painter->restore(); //paint text painter->save(); painter->translate(0, 0 + iconSizeExpected.height() + 10); //painter->setFont(opt.font); painter->setPen(opt.palette.highlightedText().color()); IconViewTextHelper::paintText(painter, opt, index, maxTextHight, 0, 2, false); painter->restore(); painter->restore(); //paint link icon if (index.data(Qt::UserRole + 1).toBool()) { QSize symbolicIconSize = QSize(16, 16); int offset = 8; switch (view->zoomLevel()) { case DesktopIconView::Small: { symbolicIconSize = QSize(8, 8); offset = 10; break; } case DesktopIconView::Normal: { break; } case DesktopIconView::Large: { offset = 4; symbolicIconSize = QSize(24, 24); break; } case DesktopIconView::Huge: { offset = 2; symbolicIconSize = QSize(32, 32); break; } default: { break; } } auto topRight = opt.rect.topRight(); topRight.setX(topRight.x() - offset - symbolicIconSize.width()); topRight.setY(topRight.y() + offset); auto linkRect = QRect(topRight, symbolicIconSize); QIcon symbolicLinkIcon = QIcon::fromTheme("emblem-symbolic-link"); symbolicLinkIcon.paint(painter, linkRect, Qt::AlignCenter); } /* qDebug()<visualRect(index); qDebug()<rectForIndex(index); qDebug()<subElementRect(QStyle::SE_ItemViewItemText, &opt, opt.widget); */ painter->restore(); //return QStyledItemDelegate::paint(painter, option, index); } QSize DesktopIconViewDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const { auto view = qobject_cast(parent()); auto zoomLevel = view->zoomLevel(); switch (zoomLevel) { case DesktopIconView::Small: return QSize(60, 60); case DesktopIconView::Normal: return QSize(90, 90); case DesktopIconView::Large: return QSize(105, 118); case DesktopIconView::Huge: return QSize(120, 140); default: return QSize(90, 90); } } QWidget *DesktopIconViewDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const { auto edit = new IconViewEditor(parent); auto font = option.font; auto view = qobject_cast(this->parent()); // switch (view->zoomLevel()) { // case DesktopIconView::Small: // font.setPixelSize(int(font.pixelSize() * 0.8)); // break; // case DesktopIconView::Large: // font.setPixelSize(int(font.pixelSize() * 1.2)); // break; // case DesktopIconView::Huge: // font.setPixelSize(int(font.pixelSize() * 1.4)); // break; // default: // break; // } edit->setFont(font); edit->setContentsMargins(0, 0, 0, 0); edit->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); edit->setMinimumSize(sizeHint(option, index).width(), 54); edit->setText(index.data(Qt::DisplayRole).toString()); edit->setAlignment(Qt::AlignCenter); //NOTE: if we directly call this method, there will be //nothing happen. add a very short delay will ensure that //the edit be resized. QTimer::singleShot(1, [=](){ edit->minimalAdjust(); }); connect(edit, &IconViewEditor::returnPressed, [=](){ this->setModelData(edit, nullptr, index); edit->deleteLater(); }); return edit; } void DesktopIconViewDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const { IconViewEditor *edit = qobject_cast(editor); if (!edit) return; auto cursor = edit->textCursor(); cursor.setPosition(0, QTextCursor::MoveAnchor); cursor.movePosition(QTextCursor::End, QTextCursor::KeepAnchor); //qDebug()<toPlainText().contains(".") && !edit->toPlainText().startsWith(".")) { cursor.movePosition(QTextCursor::WordLeft, QTextCursor::KeepAnchor, 2); //qDebug()<setTextCursor(cursor); } void DesktopIconViewDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const { QStyledItemDelegate::updateEditorGeometry(editor, option, index); auto edit = qobject_cast(editor); if (!edit) return; auto opt = option; auto iconExpectedSize = getView()->iconSize(); //auto iconRect = opt.widget->style()->subElementRect(QStyle::SE_ItemViewItemDecoration, &opt, opt.widget); //auto y_delta = iconExpectedSize.height() - iconRect.height(); //edit->move(opt.rect.x(), opt.rect.y() + y_delta + 10); edit->move(opt.rect.x(), opt.rect.y() + iconExpectedSize.height() + 15); edit->resize(edit->document()->size().width(), edit->document()->size().height() + 10); } void DesktopIconViewDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const { IconViewEditor *edit = qobject_cast(editor); if (!edit) return; auto newName = edit->toPlainText(); if (!newName.isNull()) { if (newName != index.data(Qt::DisplayRole).toString()) { auto fileOpMgr = FileOperationManager::getInstance(); auto renameOp = new FileRenameOperation(index.data(Qt::UserRole).toString(), newName); fileOpMgr->startOperation(renameOp, true); } } } DesktopIconView *DesktopIconViewDelegate::getView() const { auto view = qobject_cast(parent()); return view; } peony/peony-qt-plugin-test/0000755000175000017500000000000013610734767014673 5ustar fengfengpeony/peony-qt-plugin-test/properties-window-tab-page-plugin-example/0000755000175000017500000000000013610734767024777 5ustar fengfeng././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootpeony/peony-qt-plugin-test/properties-window-tab-page-plugin-example/properties-window-tab-page-examplefactory.hpeony/peony-qt-plugin-test/properties-window-tab-page-plugin-example/properties-window-tab-page-exam0000644000175000017500000000444513610734767033040 0ustar fengfeng/* * Peony-Qt's Library * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * 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 3 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 General Public License * along with this library. If not, see . * * Authors: Yue Lan * */ #ifndef PROPERTIESWINDOWTABPAGEEXAMPLEFACTORY_H #define PROPERTIESWINDOWTABPAGEEXAMPLEFACTORY_H #include "properties-window-tab-page-plugin-example_global.h" #include "properties-window-tab-page-plugin-iface.h" #include class PROPERTIESWINDOWTABPAGEPLUGINEXAMPLESHARED_EXPORT PropertiesWindowTabPageExampleFactory : public QObject, public Peony::PropertiesWindowTabPagePluginIface { Q_OBJECT Q_PLUGIN_METADATA(IID PropertiesWindowTabPagePluginIface_iid) Q_INTERFACES(Peony::PropertiesWindowTabPagePluginIface) public: explicit PropertiesWindowTabPageExampleFactory(QObject *parent = nullptr); ~PropertiesWindowTabPageExampleFactory() override; PluginInterface::PluginType pluginType() override {return PluginInterface::PropertiesWindowPlugin;} const QString name() override {return "Properties Page Plugin Example";} const QString description() override {return "This plugin is a factory plugin providing the add-on properties page for peony-qt's properties window";} const QIcon icon() override {return QIcon::fromTheme("view-paged-symbolic");} void setEnable(bool enable) override {m_enable = enable;} bool isEnable() override {return m_enable;} int tabOrder() override {return 0;} bool supportUris(const QStringList &uris) override {return true;} QWidget *createTabPage(const QStringList &uris) override; void closeFactory() override {deleteLater();} private: bool m_enable = true; }; #endif // PROPERTIESWINDOWTABPAGEEXAMPLEFACTORY_H ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootpeony/peony-qt-plugin-test/properties-window-tab-page-plugin-example/properties-window-tab-page-plugin-example.propeony/peony-qt-plugin-test/properties-window-tab-page-plugin-example/properties-window-tab-page-plug0000644000175000017500000000240113610734767033043 0ustar fengfeng#------------------------------------------------- # # Project created by QtCreator 2019-10-24T13:53:42 # #------------------------------------------------- QT += widgets TARGET = properties-window-tab-page-plugin-example TEMPLATE = lib DEFINES += PROPERTIESWINDOWTABPAGEPLUGINEXAMPLE_LIBRARY # The following define makes your compiler emit warnings if you use # any feature of Qt which has been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 include(../../plugin-iface/plugin-iface.pri) SOURCES += \ properties-window-tab-page-examplefactory.cpp HEADERS += \ properties-window-tab-page-examplefactory.h \ properties-window-tab-page-plugin-example_global.h DESTDIR = ../../testdir unix { target.path = /usr/lib/peony-qt-extensions INSTALLS += target } ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootpeony/peony-qt-plugin-test/properties-window-tab-page-plugin-example/properties-window-tab-page-plugin-example_global.hpeony/peony-qt-plugin-test/properties-window-tab-page-plugin-example/properties-window-tab-page-plug0000644000175000017500000000231313610734767033045 0ustar fengfeng/* * Peony-Qt's Library * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * 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 3 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 General Public License * along with this library. If not, see . * * Authors: Yue Lan * */ #ifndef PROPERTIESWINDOWTABPAGEPLUGINEXAMPLE_GLOBAL_H #define PROPERTIESWINDOWTABPAGEPLUGINEXAMPLE_GLOBAL_H #include #if defined(PROPERTIESWINDOWTABPAGEPLUGINEXAMPLE_LIBRARY) # define PROPERTIESWINDOWTABPAGEPLUGINEXAMPLESHARED_EXPORT Q_DECL_EXPORT #else # define PROPERTIESWINDOWTABPAGEPLUGINEXAMPLESHARED_EXPORT Q_DECL_IMPORT #endif #endif // PROPERTIESWINDOWTABPAGEPLUGINEXAMPLE_GLOBAL_H ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootpeony/peony-qt-plugin-test/properties-window-tab-page-plugin-example/properties-window-tab-page-examplefactory.cpppeony/peony-qt-plugin-test/properties-window-tab-page-plugin-example/properties-window-tab-page-exam0000644000175000017500000000262413610734767033035 0ustar fengfeng/* * Peony-Qt's Library * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * 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 3 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 General Public License * along with this library. If not, see . * * Authors: Yue Lan * */ #include "properties-window-tab-page-examplefactory.h" #include PropertiesWindowTabPageExampleFactory::PropertiesWindowTabPageExampleFactory(QObject *parent) : QObject (parent) { } PropertiesWindowTabPageExampleFactory::~PropertiesWindowTabPageExampleFactory() { } QWidget *PropertiesWindowTabPageExampleFactory::createTabPage(const QStringList &uris) { QStringList l = uris; auto label = new QLabel(tr("This page is an external plugin page.\n" "uris:\n" "%1").arg(l.join(",\n"))); label->setWordWrap(true); return label; } peony/peony-qt-plugin-test/peony-qt-menu-plugin-mate-terminal/0000755000175000017500000000000013610734767023442 5ustar fengfengpeony/peony-qt-plugin-test/peony-qt-menu-plugin-mate-terminal/translations/0000755000175000017500000000000013610734767026163 5ustar fengfeng././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootpeony/peony-qt-plugin-test/peony-qt-menu-plugin-mate-terminal/translations/peony-qt-mate-terminal-extension_zh_CN.tspeony/peony-qt-plugin-test/peony-qt-menu-plugin-mate-terminal/translations/peony-qt-mate-terminal-ex0000644000175000017500000000157313610734767033037 0ustar fengfeng Peony::MateTerminalMenuPlugin Open Directory in Terminal 打开终端 Peony-Qt Mate Terminal Menu Extension UKUI文件管理器终端扩展 Open Terminal with menu. 使用右键菜单打开终端。 ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootpeony/peony-qt-plugin-test/peony-qt-menu-plugin-mate-terminal/translations/peony-qt-mate-terminal-extension_zh_CN.qmpeony/peony-qt-plugin-test/peony-qt-menu-plugin-mate-terminal/translations/peony-qt-mate-terminal-ex0000644000175000017500000000052713610734767033035 0ustar fengfeng translations/peony-qt-mate-terminal-extension_zh_CN.ts translations/peony-qt-mate-terminal-extension_zh_CN.qm ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootpeony/peony-qt-plugin-test/peony-qt-menu-plugin-mate-terminal/peony-qt-menu-plugin-mate-terminal_global.hpeony/peony-qt-plugin-test/peony-qt-menu-plugin-mate-terminal/peony-qt-menu-plugin-mate-terminal_glo0000644000175000017500000000224113610734767032774 0ustar fengfeng/* * Peony-Qt's Library * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * 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 3 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 General Public License * along with this library. If not, see . * * Authors: Yue Lan * */ #ifndef PEONYQTMENUPLUGINMATETERMINAL_GLOBAL_H #define PEONYQTMENUPLUGINMATETERMINAL_GLOBAL_H #include #if defined(PEONYQTMENUPLUGINMATETERMINAL_LIBRARY) # define PEONYQTMENUPLUGINMATETERMINALSHARED_EXPORT Q_DECL_EXPORT #else # define PEONYQTMENUPLUGINMATETERMINALSHARED_EXPORT Q_DECL_IMPORT #endif #endif // PEONYQTMENUPLUGINMATETERMINAL_GLOBAL_H peony/peony-qt-plugin-test/peony-qt-menu-plugin-mate-terminal/mate-terminal-menu-plugin.cpp0000644000175000017500000000600513610734767031144 0ustar fengfeng/* * Peony-Qt's Library * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * 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 3 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 General Public License * along with this library. If not, see . * * Authors: Yue Lan * */ #include "mate-terminal-menu-plugin.h" #include "file-info.h" #include #include #include #include #include #include #include using namespace Peony; MateTerminalMenuPlugin::MateTerminalMenuPlugin(QObject *parent) : QObject (parent) { QTranslator *t = new QTranslator(this); qDebug()<<"\n\n\n\n\n\n\ntranslate:"<load(":/translations/peony-qt-mate-terminal-extension_"+QLocale::system().name()); QApplication::installTranslator(t); } void openTerminal(const QString &uri){ qDebug()<<"triggered"<message; g_error_free(err); err = nullptr; } g_strfreev (argv); } QList MateTerminalMenuPlugin::menuActions(Types types, const QString &uri, const QStringList &selectionUris) { QList actions; if (types == MenuPluginInterface::DirectoryView || types == MenuPluginInterface::DesktopWindow) { if (selectionUris.isEmpty()) { QAction *dirAction = new QAction(QIcon::fromTheme("utilities-terminal-symbolic"), tr("Open Directory in Terminal")); dirAction->connect(dirAction, &QAction::triggered, [=](){ openTerminal(uri); }); actions<isDir()) { QAction *dirAction = new QAction(QIcon::fromTheme("utilities-terminal-symbolic"), tr("Open Directory in Terminal")); dirAction->connect(dirAction, &QAction::triggered, [=](){ openTerminal(selectionUris.first()); }); actions<. * * Authors: Yue Lan * */ #ifndef MATETERMINALMENUPLUGIN_H #define MATETERMINALMENUPLUGIN_H #include "peony-qt-menu-plugin-mate-terminal_global.h" #include #include #include "menu-plugin-iface.h" namespace Peony { class PEONYQTMENUPLUGINMATETERMINALSHARED_EXPORT MateTerminalMenuPlugin : public QObject, public MenuPluginInterface { Q_OBJECT Q_PLUGIN_METADATA(IID MenuPluginInterface_iid) Q_INTERFACES(Peony::MenuPluginInterface) public: explicit MateTerminalMenuPlugin(QObject *parent = nullptr); PluginInterface::PluginType pluginType() override {return PluginInterface::MenuPlugin;} const QString name() override {return tr("Peony-Qt Mate Terminal Menu Extension");} const QString description() override {return tr("Open Terminal with menu.");} const QIcon icon() override {return QIcon::fromTheme("utilities-terminal-symbolic");} void setEnable(bool enable) override {m_enable = enable;} bool isEnable() override {return m_enable;} QString testPlugin() override {return "test";} QList menuActions(Types types, const QString &uri, const QStringList &selectionUris) override; private: bool m_enable; }; } #endif // MATETERMINALMENUPLUGIN_H peony/peony-qt-plugin-test/gtk2-style-enhanced-plugin/0000755000175000017500000000000013610734767021737 5ustar fengfengpeony/peony-qt-plugin-test/gtk2-style-enhanced-plugin/gtk2-style-enhanced-plugin.h0000644000175000017500000000352613610734767027162 0ustar fengfeng/* * Peony-Qt's Library * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * 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 3 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 General Public License * along with this library. If not, see . * * Authors: Yue Lan * */ #ifndef GTK2STYLEENHANCEDPLUGIN_H #define GTK2STYLEENHANCEDPLUGIN_H #include "gtk2-style-enhanced-plugin_global.h" #include #include #include "style-plugin-iface.h" namespace Peony { class GTK2STYLEENHANCEDPLUGINSHARED_EXPORT Gtk2StyleEnhancedPlugin : public QObject, public StylePluginIface { Q_OBJECT Q_PLUGIN_METADATA(IID StylePluginIface_iid) Q_INTERFACES(Peony::StylePluginIface) public: explicit Gtk2StyleEnhancedPlugin(QObject *parent = nullptr); PluginInterface::PluginType pluginType() {return PluginInterface::StylePlugin;} const QString name() {return tr("Gtk theme enhanced extension");} const QString description() {return tr("Improve the gtk-themed controls' style and painting");} const QIcon icon() {return QIcon::fromTheme("utilities-terminal-symbolic");} void setEnable(bool enable) {m_enable = enable;} bool isEnable() {return m_enable;} int defaultPriority() {return 0;} QProxyStyle *getStyle(); private: bool m_enable; }; } #endif // GTK2STYLEENHANCEDPLUGIN_H peony/peony-qt-plugin-test/gtk2-style-enhanced-plugin/gtk2-style-enhanced-plugin.pro0000644000175000017500000000255513610734767027534 0ustar fengfeng#------------------------------------------------- # # Project created by QtCreator 2019-11-13T10:58:32 # #------------------------------------------------- QT += widgets TARGET = gtk2-style-enhanced-plugin TEMPLATE = lib DEFINES += GTK2STYLEENHANCEDPLUGIN_LIBRARY # The following define makes your compiler emit warnings if you use # any feature of Qt which has been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 include(../../plugin-iface/plugin-iface.pri) include(../../libpeony-qt/libpeony-qt-header.pri) PKGCONFIG +=gio-2.0 glib-2.0 gio-unix-2.0 CONFIG += c++11 link_pkgconfig no_keywords LIBS += -L$$PWD/../../libpeony-qt/ -lpeony-qt SOURCES += \ gtk2-style-enhanced-plugin.cpp HEADERS += \ gtk2-style-enhanced-plugin.h \ gtk2-style-enhanced-plugin_global.h DESTDIR += ../../testdir unix { target.path = /usr/lib/peony-qt-extensions INSTALLS += target } peony/peony-qt-plugin-test/gtk2-style-enhanced-plugin/gtk2-style-enhanced-plugin_global.h0000644000175000017500000000217513610734767030501 0ustar fengfeng/* * Peony-Qt's Library * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * 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 3 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 General Public License * along with this library. If not, see . * * Authors: Yue Lan * */ #ifndef GTK2STYLEENHANCEDPLUGIN_GLOBAL_H #define GTK2STYLEENHANCEDPLUGIN_GLOBAL_H #include #if defined(GTK2STYLEENHANCEDPLUGIN_LIBRARY) # define GTK2STYLEENHANCEDPLUGINSHARED_EXPORT Q_DECL_EXPORT #else # define GTK2STYLEENHANCEDPLUGINSHARED_EXPORT Q_DECL_IMPORT #endif #endif // GTK2STYLEENHANCEDPLUGIN_GLOBAL_H peony/peony-qt-plugin-test/gtk2-style-enhanced-plugin/gtk2-style-enhanced-plugin.cpp0000644000175000017500000000211013610734767027501 0ustar fengfeng/* * Peony-Qt's Library * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * 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 3 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 General Public License * along with this library. If not, see . * * Authors: Yue Lan * */ #include "gtk2-style-enhanced-plugin.h" #include "complementary-style.h" using namespace Peony; Gtk2StyleEnhancedPlugin::Gtk2StyleEnhancedPlugin(QObject *parent) : QObject(parent) { } QProxyStyle *Gtk2StyleEnhancedPlugin::getStyle() { return ComplementaryStyle::getStyle(); } peony/peony-qt-plugin-test/directory-view-extensions-plugin-test/0000755000175000017500000000000013610734767024315 5ustar fengfeng././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootpeony/peony-qt-plugin-test/directory-view-extensions-plugin-test/directory-view-extensions-plugin-test.propeony/peony-qt-plugin-test/directory-view-extensions-plugin-test/directory-view-extensions-plugin-te0000644000175000017500000000261213610734767033314 0ustar fengfeng#------------------------------------------------- # # Project created by QtCreator 2019-11-18T09:07:42 # #------------------------------------------------- QT += widgets TARGET = directory-view-extensions-plugin-test TEMPLATE = lib DEFINES += DIRECTORYVIEWEXTENSIONSPLUGINTEST_LIBRARY # The following define makes your compiler emit warnings if you use # any feature of Qt which has been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 include(../../plugin-iface/plugin-iface.pri) include(../../libpeony-qt/libpeony-qt-header.pri) PKGCONFIG +=gio-2.0 glib-2.0 gio-unix-2.0 CONFIG += c++11 link_pkgconfig no_keywords LIBS += -L$$PWD/../../libpeony-qt/ -lpeony-qt SOURCES += \ directory-view-extensions-test-plugin.cpp HEADERS += \ directory-view-extensions-test-plugin.h \ directory-view-extensions-plugin-test_global.h unix { target.path = /usr/lib/peony-qt-extensions INSTALLS += target } ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootpeony/peony-qt-plugin-test/directory-view-extensions-plugin-test/directory-view-extensions-test-plugin.hpeony/peony-qt-plugin-test/directory-view-extensions-plugin-test/directory-view-extensions-test-plug0000644000175000017500000000446513610734767033344 0ustar fengfeng/* * Peony-Qt's Library * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * 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 3 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 General Public License * along with this library. If not, see . * * Authors: Yue Lan * */ #ifndef DIRECTORYVIEWEXTENSIONSTESTPLUGIN_H #define DIRECTORYVIEWEXTENSIONSTESTPLUGIN_H #include "directory-view-extensions-plugin-test_global.h" #include "directory-view-plugin-iface2.h" namespace Peony { class DIRECTORYVIEWEXTENSIONSPLUGINTESTSHARED_EXPORT DirectoryViewExtensionsTestPlugin : public QObject, public DirectoryViewPluginIface2 { Q_OBJECT Q_PLUGIN_METADATA(IID DirectoryViewPluginIface2_iid) Q_INTERFACES(Peony::DirectoryViewPluginIface2) public: explicit DirectoryViewExtensionsTestPlugin(QObject *parent = nullptr); //plugin implement const QString name() override {return QObject::tr("Directory View Plugin");} PluginType pluginType() override {return PluginType::DirectoryViewPlugin2;} const QString description() override {return QObject::tr("Show the folder children as icons.");} const QIcon icon() override {return QIcon::fromTheme("folder");} void setEnable(bool enable) override {Q_UNUSED(enable)} bool isEnable() override {return true;} //directory view plugin implemeny QString viewIdentity() override {return QObject::tr("Directory View Plugin");} QIcon viewIcon() override {return QIcon::fromTheme("folder");} bool supportUri(const QString &uri) override {return !uri.isEmpty();} //void fillDirectoryView(DirectoryViewWidget *view) override; DirectoryViewWidget *create() override; int zoom_level_hint() override {return 0;} int priority(const QString &) override {return -1;} }; } #endif // DIRECTORYVIEWEXTENSIONSTESTPLUGIN_H ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootpeony/peony-qt-plugin-test/directory-view-extensions-plugin-test/directory-view-extensions-test-plugin.cpppeony/peony-qt-plugin-test/directory-view-extensions-plugin-test/directory-view-extensions-test-plug0000644000175000017500000000312013610734767033327 0ustar fengfeng/* * Peony-Qt's Library * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * 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 3 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 General Public License * along with this library. If not, see . * * Authors: Yue Lan * */ #include "directory-view-extensions-test-plugin.h" #include "directory-view-widget.h" #include #include #include using namespace Peony; DirectoryViewExtensionsTestPlugin::DirectoryViewExtensionsTestPlugin(QObject *parent) : QObject(parent) { } //void DirectoryViewExtensionsTestPlugin::fillDirectoryView(DirectoryViewWidget *view) //{ // auto layout = new QVBoxLayout(view); // layout->addWidget(new QLabel("test icon view", nullptr)); // view->setLayout(layout); //} DirectoryViewWidget *DirectoryViewExtensionsTestPlugin::create() { qDebug()<<"create directory view"; auto w = new DirectoryViewWidget; auto layout = new QVBoxLayout(w); layout->addWidget(new QLabel("test directory view", w)); w->setLayout(layout); return w; } ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootpeony/peony-qt-plugin-test/directory-view-extensions-plugin-test/directory-view-extensions-plugin-test_global.hpeony/peony-qt-plugin-test/directory-view-extensions-plugin-test/directory-view-extensions-plugin-te0000644000175000017500000000227113610734767033315 0ustar fengfeng/* * Peony-Qt's Library * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * 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 3 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 General Public License * along with this library. If not, see . * * Authors: Yue Lan * */ #ifndef DIRECTORYVIEWEXTENSIONSPLUGINTEST_GLOBAL_H #define DIRECTORYVIEWEXTENSIONSPLUGINTEST_GLOBAL_H #include #if defined(DIRECTORYVIEWEXTENSIONSPLUGINTEST_LIBRARY) # define DIRECTORYVIEWEXTENSIONSPLUGINTESTSHARED_EXPORT Q_DECL_EXPORT #else # define DIRECTORYVIEWEXTENSIONSPLUGINTESTSHARED_EXPORT Q_DECL_IMPORT #endif #endif // DIRECTORYVIEWEXTENSIONSPLUGINTEST_GLOBAL_H peony/peony-qt-plugin-test/peony-qt-menu-plugin-example/0000755000175000017500000000000013610734767022336 5ustar fengfengpeony/peony-qt-plugin-test/peony-qt-menu-plugin-example/peony-qt-menu-plugin-example.pro0000644000175000017500000000226013610734767030523 0ustar fengfeng#------------------------------------------------- # # Project created by QtCreator 2019-10-29T09:29:17 # #------------------------------------------------- QT += widgets TARGET = peony-qt-menu-plugin-example TEMPLATE = lib DEFINES += PEONYQTMENUPLUGINEXAMPLE_LIBRARY # The following define makes your compiler emit warnings if you use # any feature of Qt which has been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 include(../../plugin-iface/plugin-iface.pri) SOURCES += \ menu-plugin-example.cpp HEADERS += \ menu-plugin-example.h \ peony-qt-menu-plugin-example_global.h DESTDIR += ../../testdir unix { target.path = /usr/lib/peony-qt-extensions INSTALLS += target } peony/peony-qt-plugin-test/peony-qt-menu-plugin-example/peony-qt-menu-plugin-example_global.h0000644000175000017500000000220313610734767031467 0ustar fengfeng/* * Peony-Qt's Library * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * 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 3 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 General Public License * along with this library. If not, see . * * Authors: Yue Lan * */ #ifndef PEONYQTMENUPLUGINEXAMPLE_GLOBAL_H #define PEONYQTMENUPLUGINEXAMPLE_GLOBAL_H #include #if defined(PEONYQTMENUPLUGINEXAMPLE_LIBRARY) # define PEONYQTMENUPLUGINEXAMPLESHARED_EXPORT Q_DECL_EXPORT #else # define PEONYQTMENUPLUGINEXAMPLESHARED_EXPORT Q_DECL_IMPORT #endif #endif // PEONYQTMENUPLUGINEXAMPLE_GLOBAL_H peony/peony-qt-plugin-test/peony-qt-menu-plugin-example/menu-plugin-example.h0000644000175000017500000000360613610734767026405 0ustar fengfeng/* * Peony-Qt's Library * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * 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 3 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 General Public License * along with this library. If not, see . * * Authors: Yue Lan * */ #ifndef MENUPLUGINEXAMPLE_H #define MENUPLUGINEXAMPLE_H #include "peony-qt-menu-plugin-example_global.h" #include #include #include "menu-plugin-iface.h" namespace Peony { class PEONYQTMENUPLUGINEXAMPLESHARED_EXPORT MenuPluginExample : public QObject, public MenuPluginInterface { Q_OBJECT Q_PLUGIN_METADATA(IID MenuPluginInterface_iid) Q_INTERFACES(Peony::MenuPluginInterface) public: explicit MenuPluginExample(QObject *parent = nullptr); PluginInterface::PluginType pluginType() override {return PluginInterface::MenuPlugin;} const QString name() override {return "testMenuPlugin1";} const QString description() override {return "This is a menu type test plugin";} const QIcon icon() override {return QIcon::fromTheme("search");} void setEnable(bool enable) override {m_enable = enable;} bool isEnable() override {return m_enable;} QString testPlugin() override; QList menuActions(Types types, const QString &uri, const QStringList &selectionUris) override; private: bool m_enable; }; } #endif // MENUPLUGINEXAMPLE_H peony/peony-qt-plugin-test/peony-qt-menu-plugin-example/menu-plugin-example.cpp0000644000175000017500000000374213610734767026741 0ustar fengfeng/* * Peony-Qt's Library * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * 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 3 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 General Public License * along with this library. If not, see . * * Authors: Yue Lan * */ #include "menu-plugin-example.h" #include #include #include using namespace Peony; MenuPluginExample::MenuPluginExample(QObject *parent) : QObject(parent) { } QString MenuPluginExample::testPlugin() { qDebug()<<"menu test plugin1"; return QString("MenuPluginExample"); } QList MenuPluginExample::menuActions(Types types, const QString &uri, const QStringList &selectionUris) { //return QList(); Q_UNUSED(types); Q_UNUSED(uri); Q_UNUSED(selectionUris); QList actions; QAction *action = new QAction(QIcon::fromTheme("search"), tr("plugin-sub-menu test")); actions<parentWidget()); connect(action, &QAction::destroyed, [=](){ qDebug()<<"delete sub menu"; menu->deleteLater(); }); menu->addAction("sub test1"); menu->addSeparator(); menu->addAction("sub test2"); action->setMenu(menu); QAction *action2 = new QAction(QIcon::fromTheme("media-eject"), tr("plugin-action test")); connect(action2, &QAction::triggered, [=](){ qDebug()<<"action triggered"; }); actions<. * * Authors: Yue Lan * */ #include "content-preview-page-factory.h" #include "content-preview-page.h" ContentPreviewPageFactory::ContentPreviewPageFactory(QObject *parent) : QObject (parent) { } ContentPreviewPageFactory::~ContentPreviewPageFactory() { } Peony::PreviewPageIface *ContentPreviewPageFactory::createPreviewPage() { return new ContentPreviewPage; } ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootpeony/peony-qt-plugin-test/peony-qt-preview-file-content-plugin/peony-qt-preview-file-content-plugin.propeony/peony-qt-plugin-test/peony-qt-preview-file-content-plugin/peony-qt-preview-file-content-plugin0000644000175000017500000000251613610734767033052 0ustar fengfeng#------------------------------------------------- # # Project created by QtCreator 2019-10-24T09:25:02 # #------------------------------------------------- QT += widgets #network webengine webenginewidgets webkit webkitwidgets TARGET = peony-qt-preview-file-content-plugin TEMPLATE = lib DEFINES += PEONYQTPREVIEWFILECONTENTPLUGIN_LIBRARY # The following define makes your compiler emit warnings if you use # any feature of Qt which has been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 include(../../plugin-iface/plugin-iface.pri) SOURCES += \ content-preview-page-factory.cpp \ content-preview-page.cpp HEADERS += \ content-preview-page-factory.h \ peony-qt-preview-file-content-plugin_global.h \ content-preview-page.h DESTDIR += ../../testdir unix { target.path = /usr/lib/peony-qt-extensions INSTALLS += target } peony/peony-qt-plugin-test/peony-qt-preview-file-content-plugin/content-preview-page.cpp0000644000175000017500000000256213610734767030563 0ustar fengfeng/* * Peony-Qt's Library * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * 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 3 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 General Public License * along with this library. If not, see . * * Authors: Yue Lan * */ #include "content-preview-page.h" #include #include ContentPreviewPage::ContentPreviewPage(QWidget *parent) : QWidget(parent) { QVBoxLayout *layout = new QVBoxLayout(this); setLayout(layout); m_label = new QLabel(tr("This page is a part of peony-qt extension"), this); layout->addWidget(m_label); } ContentPreviewPage::~ContentPreviewPage() { } void ContentPreviewPage::startPreview() { m_label->setText(m_current_uri); } void ContentPreviewPage::cancel() { m_label->setText(tr("This page is a part of peony-qt extension")); } ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootpeony/peony-qt-plugin-test/peony-qt-preview-file-content-plugin/peony-qt-preview-file-content-plugin_global.hpeony/peony-qt-plugin-test/peony-qt-preview-file-content-plugin/peony-qt-preview-file-content-plugin0000644000175000017500000000225513610734767033052 0ustar fengfeng/* * Peony-Qt's Library * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * 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 3 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 General Public License * along with this library. If not, see . * * Authors: Yue Lan * */ #ifndef PEONYQTPREVIEWFILECONTENTPLUGIN_GLOBAL_H #define PEONYQTPREVIEWFILECONTENTPLUGIN_GLOBAL_H #include #if defined(PEONYQTPREVIEWFILECONTENTPLUGIN_LIBRARY) # define PEONYQTPREVIEWFILECONTENTPLUGINSHARED_EXPORT Q_DECL_EXPORT #else # define PEONYQTPREVIEWFILECONTENTPLUGINSHARED_EXPORT Q_DECL_IMPORT #endif #endif // PEONYQTPREVIEWFILECONTENTPLUGIN_GLOBAL_H peony/peony-qt-plugin-test/peony-qt-preview-file-content-plugin/content-preview-page.h0000644000175000017500000000320013610734767030216 0ustar fengfeng/* * Peony-Qt's Library * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * 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 3 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 General Public License * along with this library. If not, see . * * Authors: Yue Lan * */ #ifndef CONTENTPREVIEWPAGE_H #define CONTENTPREVIEWPAGE_H #include #include "preview-page-plugin-iface.h" class QLabel; class ContentPreviewPage : public QWidget, public Peony::PreviewPageIface { Q_OBJECT public: explicit ContentPreviewPage(QWidget *parent = nullptr); ~ContentPreviewPage() override; void prepare(const QString &uri, PreviewType type) override {m_current_uri = uri; m_current_type = type;} void prepare(const QString &uri) override {m_current_uri = uri;} void startPreview() override; void cancel() override; void closePreviewPage() override {deleteLater();} signals: public slots: private: QLabel *m_label = nullptr; QString m_current_uri = nullptr; Peony::PreviewPageIface::PreviewType m_current_type = Peony::PreviewPageIface::Other; }; #endif // CONTENTPREVIEWPAGE_H peony/peony-qt-plugin-test/peony-qt-preview-file-content-plugin/content-preview-page-factory.h0000644000175000017500000000513713610734767031676 0ustar fengfeng/* * Peony-Qt's Library * * Copyright (C) 2019, Tianjin KYLIN Information Technology Co., Ltd. * * 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 3 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 General Public License * along with this library. If not, see . * * Authors: Yue Lan * */ #ifndef CONTENTPREVIEWPAGEFACTORY_H #define CONTENTPREVIEWPAGEFACTORY_H #include "peony-qt-preview-file-content-plugin_global.h" #include "preview-page-plugin-iface.h" /*! * \brief The ContentPreviewPageFactory class * * \details This example is showing you how to * implement a preview page plugin for peony-qt. * We should start at implement the PreviewPagePluginIface * with your own factory. * * You have to declare your factory * as PreviewPagePluginIface derived class * and override all virtual method both * Peony::PreviewPagePluginIface and Peony::PluginIface provided. * * \note * You don't need declare the PreviewPageIface as a plugin interface, * But you should aslo implement your own PreviewPage * by deriving Peony::PreviewPageIface for the return value * as this class's createPreviewPage() method. */ class PEONYQTPREVIEWFILECONTENTPLUGINSHARED_EXPORT ContentPreviewPageFactory : public QObject, public Peony::PreviewPagePluginIface { Q_OBJECT Q_PLUGIN_METADATA(IID PreviewPagePluginIface_iid) Q_INTERFACES(Peony::PreviewPagePluginIface) public: explicit ContentPreviewPageFactory(QObject *parent = nullptr); ~ContentPreviewPageFactory() override; PluginInterface::PluginType pluginType() override {return PluginInterface::PreviewPagePlugin;} const QString name() override {return "Preview Page Plugin";} const QString description() override {return "This plugin is a factory plugin providing the content preview page for FMWindow";} const QIcon icon() override {return QIcon::fromTheme("ukui-preview-file-details");} void setEnable(bool enable) override {m_enable = enable;} bool isEnable() override {return m_enable;} Peony::PreviewPageIface *createPreviewPage() override; private: bool m_enable = true; }; #endif // CONTENTPREVIEWPAGEFACTORY_H peony/doxygen/0000755000175000017500000000000013610734767012323 5ustar fengfengpeony/doxygen/Doxyfile.in0000644000175000017500000032462113610734767014446 0ustar fengfeng# Doxyfile 1.8.13 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. # # All text after a double hash (##) is considered a comment and is placed in # front of the TAG it is preceding. # # All text after a single hash (#) is considered a comment and will be ignored. # The format is: # TAG = value [value, ...] # For lists, items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (\" \"). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all text # before the first occurrence of this tag. Doxygen uses libiconv (or the iconv # built into libc) for the transcoding. See http://www.gnu.org/software/libiconv # for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded by # double-quotes, unless you are using Doxywizard) that should identify the # project for which the documentation is generated. This name is used in the # title of most generated pages and in a few other places. # The default value is: My Project. PROJECT_NAME = "Peony Qt" # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version # control system is used. PROJECT_NUMBER = # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. PROJECT_BRIEF = "Poeny Qt 是基于qt前端和gio后端的文件管理器,除了peony-qt文件管理本身,它也将提供一个libpeony-qt的文件管理器开发包用于文件管理器的二次开发。整个项目开源,目前项目地址为:https://github.com/ukui/peony。注:peony-qt基于GPLv3发布,而libpeony-qt基于LGPLv3发布。" # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. OUTPUT_DIRECTORY = ./out # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and # will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where # putting all generated files in the same directory would otherwise causes # performance problems for the file system. # The default value is: NO. CREATE_SUBDIRS = YES # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII # characters to appear in the names of generated files. If set to NO, non-ASCII # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode # U+3044. # The default value is: NO. ALLOW_UNICODE_NAMES = YES # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, # Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), # Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, # Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), # Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, # Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, # Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, # Ukrainian and Vietnamese. # The default value is: English. OUTPUT_LANGUAGE = Chinese # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. # The default value is: YES. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator that is # used to form the text in various listings. Each string in this list, if found # as the leading text of the brief description, will be stripped from the text # and the result, after processing the whole list, is used as the annotated # text. Otherwise, the brief description is used as-is. If left blank, the # following values are used ($name is automatically replaced with the name of # the entity):The $name class, The $name widget, The $name file, is, provides, # specifies, contains, represents, a, an and the. ABBREVIATE_BRIEF = "The $name class" \ "The $name widget" \ "The $name file" \ is \ provides \ specifies \ contains \ represents \ a \ an \ the # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # doxygen will generate a detailed section even if there is only a brief # description. # The default value is: NO. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. # The default value is: NO. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. FULL_PATH_NAMES = YES # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # Stripping is only done if one of the specified strings matches the left-hand # part of the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the path to # strip. # # Note that you can specify absolute paths here, but also relative paths, which # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which # header file to include in order to use a class. If left blank only the name of # the header file containing the class definition is used. Otherwise one should # specify the list of include paths that are normally passed to the compiler # using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't # support long names like on DOS, Mac, or CD-ROM. # The default value is: NO. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the # first line (until the first dot) of a Javadoc-style comment as the brief # description. If set to NO, the Javadoc-style will behave just like regular Qt- # style comments (thus requiring an explicit @brief command for a brief # description.) # The default value is: NO. JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus # requiring an explicit \brief command for a brief description.) # The default value is: NO. QT_AUTOBRIEF = YES # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a # multi-line C++ special comment block (i.e. a block of //! or /// comments) as # a brief description. This used to be the default behavior. The new default is # to treat a multi-line C++ comment block as a detailed description. Set this # tag to YES if you prefer the old behavior instead. # # Note that setting this tag to YES also means that rational rose comments are # not recognized any more. # The default value is: NO. MULTILINE_CPP_IS_BRIEF = YES # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new # page for each member. If set to NO, the documentation of a member will be part # of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen # uses this value to replace tabs by spaces in code fragments. # Minimum value: 1, maximum value: 16, default value: 4. TAB_SIZE = 4 # This tag can be used to specify a number of aliases that act as commands in # the documentation. An alias has the form: # name=value # For example adding # "sideeffect=@par Side Effects:\n" # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all # members will be omitted, etc. # The default value is: NO. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or # Python sources only. Doxygen will then generate output that is more tailored # for that language. For instance, namespaces will be presented as packages, # qualified scopes will look different, etc. # The default value is: NO. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources. Doxygen will then generate output that is tailored for Fortran. # The default value is: NO. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for VHDL. # The default value is: NO. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and # language is one of the parsers supported by doxygen: IDL, Java, Javascript, # C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: # FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: # Fortran. In the later case the parser tries to guess whether the code is fixed # or free formatted code, this is the default for Fortran type files), VHDL. For # instance to make doxygen treat .inc files as Fortran files (default is PHP), # and .f files as C (default is Fortran), use: inc=Fortran f=C. # # Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable # documentation. See http://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. # The default value is: YES. MARKDOWN_SUPPORT = YES # When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up # to that level are automatically included in the table of contents, even if # they do not have an id attribute. # Note: This feature currently applies only to Markdown headings. # Minimum value: 0, maximum value: 99, default value: 0. # This tag requires that the tag MARKDOWN_SUPPORT is set to YES. TOC_INCLUDE_HEADINGS = 0 # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by putting a % sign in front of the word or # globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should set this # tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); # versus func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. # The default value is: NO. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. # The default value is: NO. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: # http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate # getter and setter methods for a property. Setting this option to YES will make # doxygen to replace the get and set methods by a property in the documentation. # This will only work if the methods are indeed getting or setting a simple # type. If this is not the case, or you want to show the methods anyway, you # should set this option to NO. # The default value is: YES. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. DISTRIBUTE_GROUP_DOC = NO # If one adds a struct or class to a group and this option is enabled, then also # any nested class or struct is added to the same group. By default this option # is disabled and one has to add nested compounds explicitly via \ingroup. # The default value is: NO. GROUP_NESTED_COMPOUNDS = NO # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that # type (e.g. under the Public Functions section). Set it to NO to prevent # subgrouping. Alternatively, this can be done per class using the # \nosubgrouping command. # The default value is: YES. SUBGROUPING = YES # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions # are shown inside the group in which they are included (e.g. using \ingroup) # instead of on a separate page (for HTML and Man pages) or section (for LaTeX # and RTF). # # Note that this feature does not work in combination with # SEPARATE_MEMBER_PAGES. # The default value is: NO. INLINE_GROUPED_CLASSES = NO # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions # with only public data fields or simple typedef fields will be shown inline in # the documentation of the scope in which they are defined (i.e. file, # namespace, or group documentation), provided this scope is documented. If set # to NO, structs, classes, and unions are shown on a separate page (for HTML and # Man pages) or section (for LaTeX and RTF). # The default value is: NO. INLINE_SIMPLE_STRUCTS = NO # When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or # enum is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically be # useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. # The default value is: NO. TYPEDEF_HIDES_STRUCT = NO # The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This # cache is used to resolve symbols given their name and scope. Since this can be # an expensive process and often the same symbol appears multiple times in the # code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small # doxygen will become slower. If the cache is too large, memory is wasted. The # cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range # is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 # symbols. At the end of a run doxygen will report the cache usage and suggest # the optimal cache size from a speed point of view. # Minimum value: 0, maximum value: 9, default value: 0. LOOKUP_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. # Note: This will also disable the warnings about undocumented members that are # normally produced when WARNINGS is set to YES. # The default value is: NO. EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = YES # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = YES # If the EXTRACT_STATIC tag is set to YES, all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined # locally in source files will be included in the documentation. If set to NO, # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. If set to YES, local methods, # which are defined in the implementation section but not in the interface are # included in the documentation. If set to NO, only methods in the interface are # included. # The default value is: NO. EXTRACT_LOCAL_METHODS = YES # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base name of # the file that contains the anonymous namespace. By default anonymous namespace # are hidden. # The default value is: NO. EXTRACT_ANON_NSPACES = YES # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation # section is generated. This option has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set # to NO, these classes will be included in the various overviews. This option # has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend # (class|struct|union) declarations. If set to NO, these declarations will be # included in the documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any # documentation blocks found inside the body of a function. If set to NO, these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation that is typed after a # \internal command is included. If the tag is set to NO then the documentation # will be excluded. Set it to YES to include the internal documentation. # The default value is: NO. INTERNAL_DOCS = YES # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file # names in lower-case letters. If set to YES, upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. # The default value is: system dependent. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with # their full class and namespace scopes in the documentation. If set to YES, the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO # If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will # append additional text to a page's title, such as Class Reference. If set to # YES the compound reference will be hidden. # The default value is: NO. HIDE_COMPOUND_REFERENCE= NO # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. SHOW_INCLUDE_FILES = YES # If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each # grouped member an include statement to the documentation, telling the reader # which file to include in order to use the member. # The default value is: NO. SHOW_GROUPED_MEMB_INC = NO # If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include # files with double quotes in the documentation rather than with sharp brackets. # The default value is: NO. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the # documentation for inline members. # The default value is: YES. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. SORT_BRIEF_DOCS = YES # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the # (brief and detailed) documentation of class members so that constructors and # destructors are listed first. If set to NO the constructors will appear in the # respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. # Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief # member documentation. # Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting # detailed member documentation. # The default value is: NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy # of group names into alphabetical order. If set to NO the group names will # appear in their defined order. # The default value is: NO. SORT_GROUP_NAMES = YES # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by # fully-qualified names, including namespaces. If set to NO, the class list will # be sorted only by class name, not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the alphabetical # list. # The default value is: NO. SORT_BY_SCOPE_NAME = YES # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper # type resolution of all parameters of a function it will reject a match between # the prototype and the implementation of a member function even if there is # only one candidate or it is obvious which candidate to choose by doing a # simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still # accept a match between prototype and implementation in such cases. # The default value is: NO. STRICT_PROTO_MATCHING = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo # list. This list is created by putting \todo commands in the documentation. # The default value is: YES. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test # list. This list is created by putting \test commands in the documentation. # The default value is: YES. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional documentation # sections, marked by \if ... \endif and \cond # ... \endcond blocks. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the # documentation. If the initializer consists of more lines than specified here # it will be hidden. Use a value of 0 to hide initializers completely. The # appearance of the value of individual variables and macros / defines can be # controlled using \showinitializer or \hideinitializer command in the # documentation regardless of this setting. # Minimum value: 0, maximum value: 10000, default value: 30. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at # the bottom of the documentation of classes and structs. If set to YES, the # list will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. This # will remove the Files entry from the Quick Index and from the Folder Tree View # (if specified). # The default value is: YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces # page. This will remove the Namespaces entry from the Quick Index and from the # Folder Tree View (if specified). # The default value is: YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command command input-file, where command is the value of the # FILE_VERSION_FILTER tag, and input-file is the name of an input file provided # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. You can # optionally specify a file name after the option, if omitted DoxygenLayout.xml # will be used as the name of the layout file. # # Note that if you run doxygen from a directory containing a file called # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool # to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated to # standard output by doxygen. If QUIET is set to YES this implies that the # messages are off. # The default value is: NO. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. # The default value is: YES. WARNINGS = YES # If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. WARN_IF_UNDOCUMENTED = YES # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some parameters # in a documented function, or documenting parameters that don't exist or using # markup commands wrongly. # The default value is: YES. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return # value. If set to NO, doxygen will only warn about wrong or incomplete # parameter documentation, but not about the absence of documentation. # The default value is: NO. WARN_NO_PARAMDOC = NO # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when # a warning is encountered. # The default value is: NO. WARN_AS_ERROR = NO # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated # and the warning text. Optionally the format may contain $version, which will # be replaced by the version of the file (if it could be obtained via # FILE_VERSION_FILTER) # The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard # error (stderr). WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. INPUT = ../ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv # documentation (see: http://www.gnu.org/software/libiconv) for the list of # possible encodings. # The default value is: UTF-8. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and # *.h) to filter out the source-files in the directories. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # read by doxygen. # # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, # *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, # *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, # *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. FILE_PATTERNS = *.c \ *.cc \ *.cxx \ *.cpp \ *.c++ \ *.java \ *.ii \ *.ixx \ *.ipp \ *.i++ \ *.inl \ *.idl \ *.ddl \ *.odl \ *.h \ *.hh \ *.hxx \ *.hpp \ *.h++ \ *.cs \ *.d \ *.php \ *.php4 \ *.php5 \ *.phtml \ *.inc \ *.m \ *.markdown \ *.md \ *.mm \ *.dox \ *.py \ *.pyw \ *.f90 \ *.f95 \ *.f03 \ *.f08 \ *.f \ *.for \ *.tcl \ *.vhd \ *.vhdl \ *.ucf \ *.qsf # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. # The default value is: NO. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. # # Note that relative paths are relative to the directory from which doxygen is # run. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. # The default value is: NO. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and # *.h) to filter out the source-files in the directories. If left blank all # files are included. EXAMPLE_PATTERNS = * # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude commands # irrespective of the value of the RECURSIVE tag. # The default value is: NO. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or directories # that contain images that are to be included in the documentation (see the # \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command: # # # # where is the value of the INPUT_FILTER tag, and is the # name of an input file. Doxygen will then use the output that the filter # program writes to standard output. If FILTER_PATTERNS is specified, this tag # will be ignored. # # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: pattern=filter # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. FILTER_SOURCE_FILES = NO # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file # pattern. A pattern will override the setting for FILTER_PATTERN (if any) and # it is also possible to disable source filtering for a specific pattern using # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will be # generated. Documented entities will be cross-referenced with these sources. # # Note: To get rid of all source code in the generated output, make sure that # also VERBATIM_HEADERS is set to NO. # The default value is: NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body of functions, # classes and enums directly into the documentation. # The default value is: NO. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any # special comment blocks from generated source code fragments. Normal C, C++ and # Fortran comments will always remain visible. # The default value is: YES. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented # function all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES then for each documented function # all documented entities called/used by that function will be listed. # The default value is: NO. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set # to YES then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. REFERENCES_LINK_SOURCE = YES # If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the # source code will show a tooltip with additional information such as prototype, # brief description and links to the definition and documentation. Since this # will make the HTML file larger and loading of large files a bit slower, you # can opt to disable this feature. # The default value is: YES. # This tag requires that the tag SOURCE_BROWSER is set to YES. SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system # (see http://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global # - Enable SOURCE_BROWSER and USE_HTAGS in the config file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # # Doxygen will invoke htags (and that will in turn invoke gtags), so these # tools must be available from the command line (i.e. in the search path). # # The result: instead of the source browser generated by doxygen, the links to # source code will now point to the output of htags. # The default value is: NO. # This tag requires that the tag SOURCE_BROWSER is set to YES. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a # verbatim copy of the header file for each class for which an include is # specified. Set to NO to disable this. # See also: Section \class. # The default value is: YES. VERBATIM_HEADERS = YES # If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the # clang parser (see: http://clang.llvm.org/) for more accurate parsing at the # cost of reduced performance. This can be particularly helpful with template # rich C++ code for which doxygen's built-in parser lacks the necessary type # information. # Note: The availability of this option depends on whether or not doxygen was # generated with the -Duse-libclang=ON option for CMake. # The default value is: NO. CLANG_ASSISTED_PARSING = NO # If clang assisted parsing is enabled you can provide the compiler with command # line options that you would normally use when invoking the compiler. Note that # the include paths will already be set by doxygen for the files and directories # specified with INPUT and INCLUDE_PATH. # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. CLANG_OPTIONS = #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all # compounds will be generated. Enable this if the project contains a lot of # classes, structs, unions or interfaces. # The default value is: YES. ALPHABETICAL_INDEX = YES # The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in # which the alphabetical index list will be split. # Minimum value: 1, maximum value: 20, default value: 5. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of # it. # The default directory is: html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each # generated HTML page (for example: .htm, .php, .asp). # The default value is: .html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a user-defined HTML header file for # each generated HTML page. If the tag is left blank doxygen will generate a # standard header. # # To get valid HTML the header file that includes any scripts and style sheets # that doxygen needs, which is dependent on the configuration options used (e.g. # the setting GENERATE_TREEVIEW). It is highly recommended to start with a # default header using # doxygen -w html new_header.html new_footer.html new_stylesheet.css # YourConfigFile # and then modify the file new_header.html. See also section "Doxygen usage" # for information on how to generate the default header that doxygen normally # uses. # Note: The header is subject to change so you typically have to regenerate the # default header when upgrading to a newer version of doxygen. For a description # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard # footer. See HTML_HEADER for more information on how to generate a default # footer and what special commands can be used inside the footer. See also # section "Doxygen usage" for information on how to generate the default footer # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of # the HTML output. If left blank doxygen will generate a default style sheet. # See also section "Doxygen usage" for information on how to generate the style # sheet that doxygen normally uses. # Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as # it is more robust and this tag (HTML_STYLESHEET) will in the future become # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the # standard style sheet and is therefore more robust against future updates. # Doxygen will copy the style sheet files to the output directory. # Note: The order of the extra style sheet files is of importance (e.g. the last # style sheet in the list overrules the setting of the previous ones in the # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the # $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these # files. In the HTML_STYLESHEET file, use the file name only. Also note that the # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see # http://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors # in the HTML output. For a value of 0 the output will use grayscales only. A # value of 255 will produce the most vivid colors. # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_SAT = 100 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the # luminance component of the colors in the HTML output. Values below 100 # gradually make the output lighter, whereas values above 100 make the output # darker. The value divided by 100 is the actual gamma applied, so 80 represents # a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not # change the gamma. # Minimum value: 40, maximum value: 240, default value: 80. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this # to YES can help to show when doxygen was last run and thus if the # documentation is up to date. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = NO # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_DYNAMIC_SECTIONS = NO # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries # shown in the various tree structured indices initially; the user can expand # and collapse entries dynamically later on. Doxygen will expand the tree to # such a level that at most the specified number of entries are visible (unless # a fully collapsed tree already exceeds this amount). So setting the number of # entries 1 will produce a full collapsed tree by default. 0 is a special value # representing an infinite number of entries and will result in a full expanded # tree by default. # Minimum value: 0, maximum value: 9999, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development # environment (see: http://developer.apple.com/tools/xcode/), introduced with # OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at # startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html # for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_DOCSET = NO # This tag determines the name of the docset feed. A documentation feed provides # an umbrella under which multiple documentation sets from a single provider # (such as a company or product suite) can be grouped. # The default value is: Doxygen generated docs. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_FEEDNAME = "Doxygen generated docs" # This tag specifies a string that should uniquely identify the documentation # set bundle. This should be a reverse domain-name style string, e.g. # com.mycompany.MyDocSet. Doxygen will append .docset to the name. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_BUNDLE_ID = org.doxygen.Project # The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify # the documentation publisher. This should be a reverse domain-name style # string, e.g. com.mycompany.MyDocSet.documentation. # The default value is: org.doxygen.Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_ID = org.doxygen.Publisher # The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. # The default value is: Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop # (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on # Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML # files are now used as the Windows 98 help format, and will replace the old # Windows help format (.hlp) on all Windows platforms in the future. Compressed # HTML files also contain an index, a table of contents, and you can search for # words in the documentation. The HTML workshop also contains a viewer for # compressed HTML files. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_HTMLHELP = NO # The CHM_FILE tag can be used to specify the file name of the resulting .chm # file. You can add a path in front of the file if the result should not be # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the master .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO # The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it # enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members to # the table of contents of the HTML help documentation and to the tree view. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that # can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help # (.qch) of the generated HTML documentation. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify # the file name of the resulting .qch file. The path specified is relative to # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace # (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual # Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- # folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To # install this plugin and make it available under the help contents menu in # Eclipse, the contents of the directory containing the HTML and XML files needs # to be copied into the plugins directory of eclipse. The name of the directory # within the plugins directory should be the same as the ECLIPSE_DOC_ID value. # After copying Eclipse needs to be restarted before the help appears. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_ECLIPSEHELP = NO # A unique identifier for the Eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have this # name. Each documentation set should have its own identifier. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. ECLIPSE_DOC_ID = org.doxygen.Project # If you want full control over the layout of the generated HTML pages it might # be necessary to disable the index and replace it with your own. The # DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top # of each HTML page. A value of NO enables the index and the value YES disables # it. Since the tabs in the index contain the same information as the navigation # tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. DISABLE_INDEX = NO # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. If the tag # value is set to YES, a side panel will be generated containing a tree-like # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the # HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can # further fine-tune the look of the index. As an example, the default style # sheet generated by doxygen has an example that shows how to put an image at # the root of the tree instead of the PROJECT_NAME. Since the tree basically has # the same information as the tab index, you could consider setting # DISABLE_INDEX to YES when enabling this option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_TREEVIEW = NO # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. # # Note that a value of 0 will completely suppress the enum values from appearing # in the overview section. # Minimum value: 0, maximum value: 20, default value: 4. # This tag requires that the tag GENERATE_HTML is set to YES. ENUM_VALUES_PER_LINE = 4 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used # to set the initial width (in pixels) of the frame in which the tree is shown. # Minimum value: 0, maximum value: 1500, default value: 250. # This tag requires that the tag GENERATE_HTML is set to YES. TREEVIEW_WIDTH = 250 # If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. EXT_LINKS_IN_WINDOW = NO # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML # output directory to force them to be regenerated. # Minimum value: 8, maximum value: 50, default value: 10. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_FONTSIZE = 10 # Use the FORMULA_TRANPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # # Note that when changing this option you need to delete any form_*.png files in # the HTML output directory before the changes have effect. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # http://www.mathjax.org) which uses client side Javascript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. USE_MATHJAX = NO # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: # http://docs.mathjax.org/en/latest/output.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_FORMAT = HTML-CSS # When MathJax is enabled you need to specify the location relative to the HTML # output directory using the MATHJAX_RELPATH option. The destination directory # should contain the MathJax.js script. For instance, if the mathjax directory # is located at the same level as the HTML output directory, then # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of # MathJax from http://www.mathjax.org before deployment. # The default value is: http://cdn.mathjax.org/mathjax/latest. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site # (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and # should work on any modern browser. Note that when using HTML help # (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) # there is already a search function so this one should typically be disabled. # For large projects the javascript based search engine can be slow, then # enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to # search using the keyboard; to jump to the search box use + S # (what the is depends on the OS and browser, but it is typically # , /