#ifndef USERTOOLTIPS_H #define USERTOOLTIPS_H #include #include "imuserdaemon.h" #include "settings.h" #include "icons.h" #include "utilities.h" #include "userutilities.h" typedef IMUserDaemon* (*UTWidgetFunc)(GtkWidget* w, GdkEventMotion *event, gpointer data); enum tooltipElements { TT_STATUS = 1, TT_PROTOCOL = 2, TT_REALNAME = 4, TT_EMAIL = 8, TT_IP = 16, TT_ONLINETIME = 32, TT_IDLETIME = 64, TT_AUTORESPONSE = 128, TT_ID = 256, TT_CLIENTNAME = 512 }; struct attachedWidgets { GtkWidget *w; UTWidgetFunc func; gpointer data; }; class userTooltips { public: userTooltips(); ~userTooltips(); void attachWidget(GtkWidget* w, UTWidgetFunc func, gpointer data); void detachWidget(GtkWidget* w); void setPopupDelay(gint newDelay); private: GList *attached; gint delay, timeoutSource; GtkWidget *wnd; IMUserDaemon *lastUser; // callbacks static gboolean cb_tooltipLeaveNotify(userTooltips* self, GdkEventCrossing* event); static gboolean cb_tooltipMoveNotify(GtkWidget* w, GdkEventMotion *event, userTooltips* self); static gboolean cb_tooltipShowTimeout(userTooltips* self); static gboolean cb_tooltipPaint(userTooltips* self); static void cb_tooltipRealize(userTooltips* self); }; #endif