aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/panel-plugins/systemtray/TrayIcon.h
diff options
context:
space:
mode:
authorKris Moore <kris@pcbsd.org>2014-09-04 11:42:13 -0400
committerKris Moore <kris@pcbsd.org>2014-09-04 11:42:13 -0400
commit71737f70949bd25f9aa8bc4e7d03039ba83c6cb1 (patch)
treeab29e864d1ae59d10cc6875af9541e3ad306b2fb /lumina-desktop/panel-plugins/systemtray/TrayIcon.h
parentInitial commit (diff)
downloadlumina-71737f70949bd25f9aa8bc4e7d03039ba83c6cb1.tar.gz
lumina-71737f70949bd25f9aa8bc4e7d03039ba83c6cb1.tar.bz2
lumina-71737f70949bd25f9aa8bc4e7d03039ba83c6cb1.zip
Initial import of the lumina code from pcbsd git repo
Diffstat (limited to 'lumina-desktop/panel-plugins/systemtray/TrayIcon.h')
-rw-r--r--lumina-desktop/panel-plugins/systemtray/TrayIcon.h60
1 files changed, 60 insertions, 0 deletions
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 <QWidget>
+#include <QTimer>
+#include <QPaintEvent>
+#include <QMoveEvent>
+#include <QResizeEvent>
+#include <QPainter>
+#include <QPixmap>
+#include <QImage>
+
+// libLumina includes
+#include <LuminaX11.h>
+
+//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
bgstack15