From 71737f70949bd25f9aa8bc4e7d03039ba83c6cb1 Mon Sep 17 00:00:00 2001 From: Kris Moore Date: Thu, 4 Sep 2014 11:42:13 -0400 Subject: Initial import of the lumina code from pcbsd git repo --- lumina-desktop/panel-plugins/systemtray/TrayIcon.h | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 lumina-desktop/panel-plugins/systemtray/TrayIcon.h (limited to 'lumina-desktop/panel-plugins/systemtray/TrayIcon.h') diff --git a/lumina-desktop/panel-plugins/systemtray/TrayIcon.h b/lumina-desktop/panel-plugins/systemtray/TrayIcon.h new file mode 100644 index 00000000..97f2fdf5 --- /dev/null +++ b/lumina-desktop/panel-plugins/systemtray/TrayIcon.h @@ -0,0 +1,60 @@ +//=========================================== +// Lumina-DE source code +// Copyright (c) 2014, Ken Moore +// Available under the 3-clause BSD license +// See the LICENSE file for full details +//=========================================== +// Note: The basic idea behind this class that that it puts the app window +// in the same spot as the tray icon (to directly pass mouse events and such), +// while keeping the tray icon visual in sync with the app window +//=========================================== +#ifndef _LUMINA_PANEL_PLUGIN_SYSTEM_TRAY_ICON_H +#define _LUMINA_PANEL_PLUGIN_SYSTEM_TRAY_ICON_H + +//Qt includes +#include +#include +#include +#include +#include +#include +#include +#include + +// libLumina includes +#include + +//Local includes + +class TrayIcon : public QWidget{ + Q_OBJECT +public: + TrayIcon(QWidget* parent = 0); + ~TrayIcon(); + + WId appID(); //the ID for the attached application + void attachApp(WId id); + void setSizeSquare(int side); + +public slots: + void detachApp(); + void updateIcon(); + +private: + WId IID, AID; //icon ID and app ID + +private slots: + void slotAttach(); //so that the attachment can be done in a new thread + + +protected: + void paintEvent(QPaintEvent *event); + //void moveEvent(QMoveEvent *event); + void resizeEvent(QResizeEvent *event); + //bool x11Event(XEvent *event); + +signals: + void AppClosed(); + void AppAttached(); +}; +#endif \ No newline at end of file -- cgit