2007-12-30 16:41:49 +00:00
|
|
|
#ifndef __GTRAYICON_H
|
|
|
|
#define __GTRAYICON_H
|
|
|
|
|
|
|
|
class gTrayIcon
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
//"Properties"
|
|
|
|
gTrayIcon();
|
|
|
|
~gTrayIcon();
|
|
|
|
|
|
|
|
void *hFree;
|
|
|
|
|
|
|
|
char *key();
|
|
|
|
gPicture* picture() { return _icon; }
|
|
|
|
void setPicture(gPicture *pic);
|
|
|
|
char* toolTip();
|
|
|
|
void setToolTip(char *txt);
|
|
|
|
bool isVisible();
|
|
|
|
void setVisible(bool vl);
|
|
|
|
long screenX();
|
|
|
|
long screenY();
|
|
|
|
long width();
|
|
|
|
long height();
|
|
|
|
|
|
|
|
//"Methods"
|
|
|
|
void destroy();
|
|
|
|
void show() { setVisible(true); }
|
|
|
|
void hide() { setVisible(false); }
|
|
|
|
|
|
|
|
//"Events"
|
|
|
|
void (*onDoubleClick)(gTrayIcon *sender);
|
|
|
|
void (*onMousePress)(gTrayIcon *sender);
|
|
|
|
void (*onMouseRelease)(gTrayIcon *sender);
|
|
|
|
void (*onMouseWheel)(gTrayIcon *sender);
|
|
|
|
void (*onMenu)(gTrayIcon *sender);
|
|
|
|
void (*onDestroy)(gTrayIcon *sender);
|
|
|
|
void (*onFocusEnter)(gTrayIcon *sender);
|
|
|
|
void (*onFocusLeave)(gTrayIcon *sender);
|
|
|
|
void (*onEnter)(gTrayIcon *sender);
|
|
|
|
void (*onLeave)(gTrayIcon *sender);
|
|
|
|
|
|
|
|
//"Static"
|
|
|
|
|
|
|
|
static int count() { return g_list_length(trayicons); }
|
|
|
|
static gTrayIcon *get(int index) { return (gTrayIcon *)g_list_nth_data(trayicons, index); }
|
|
|
|
static void exit();
|
2008-07-17 00:16:44 +00:00
|
|
|
static gPicture *defaultIcon();
|
2007-12-30 16:41:49 +00:00
|
|
|
|
|
|
|
//"Private"
|
|
|
|
GtkWidget *plug;
|
2008-07-17 00:16:44 +00:00
|
|
|
GtkWidget *icon;
|
2007-12-30 16:41:49 +00:00
|
|
|
gPicture *_icon;
|
|
|
|
char *buftext;
|
|
|
|
bool onHide;
|
2008-07-17 00:16:44 +00:00
|
|
|
gPicture *getIcon() { return _icon ? _icon : defaultIcon(); }
|
2007-12-30 16:41:49 +00:00
|
|
|
void updateMask();
|
|
|
|
void updateTooltip();
|
|
|
|
|
|
|
|
static GList *trayicons;
|
2008-07-17 00:16:44 +00:00
|
|
|
static gPicture *_default_icon;
|
2007-12-30 16:41:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|