mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00

1. taskmanager used to identify which entry should map to window in x11 environmrnt, listen to xevent in anohter thread, and handle those event when window create, destory, changed. use some way to identify which entry(desktopfile) should mapped to changed window. in wayland, connected plsamawindow signal(window created destoried. 2. use taskmanager instead of dbus in old dock code log: as title
60 lines
1.1 KiB
C++
60 lines
1.1 KiB
C++
// SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd.
|
|
//
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#ifndef PROCESSINFO_H
|
|
#define PROCESSINFO_H
|
|
|
|
#include <QMap>
|
|
#include <QVector>
|
|
#include <QStringList>
|
|
|
|
typedef QMap<QString, QString> Status;
|
|
|
|
// 进程信息
|
|
class ProcessInfo
|
|
{
|
|
public:
|
|
explicit ProcessInfo(int pid);
|
|
explicit ProcessInfo(QStringList cmd);
|
|
virtual ~ProcessInfo();
|
|
|
|
bool isValid();
|
|
bool initWithPid();
|
|
|
|
int getPid();
|
|
int getPpid();
|
|
|
|
QString getExe();
|
|
QString getCwd();
|
|
Status getStatus();
|
|
QString getEnv(const QString &key);
|
|
|
|
QStringList getArgs();
|
|
QStringList getCmdLine();
|
|
QMap<QString, QString> getEnviron();
|
|
|
|
private:
|
|
bool isExist();
|
|
QString getJoinedExeArgs();
|
|
QString getFile(const QString &file);
|
|
QStringList readFile(const QString &filePath);
|
|
|
|
private:
|
|
|
|
int m_pid;
|
|
int m_ppid;
|
|
bool m_hasPid;
|
|
bool m_isValid;
|
|
|
|
Status m_status;
|
|
QString m_exe;
|
|
QString m_cwd;
|
|
QStringList m_args;
|
|
QStringList m_cmdLine;
|
|
QVector<int> m_uids;
|
|
QMap<QString, QString> m_environ;
|
|
};
|
|
|
|
#endif // PROCESSINFO_H
|