00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef GTKSTATSLABEL_H
00016 #define GTKSTATSLABEL_H
00017
00018 #include "pandatoolbase.h"
00019
00020 #include <gtk/gtk.h>
00021
00022 class GtkStatsMonitor;
00023 class GtkStatsGraph;
00024
00025
00026
00027
00028
00029
00030
00031
00032 class GtkStatsLabel {
00033 public:
00034 GtkStatsLabel(GtkStatsMonitor *monitor, GtkStatsGraph *graph,
00035 int thread_index, int collector_index, bool use_fullname);
00036 ~GtkStatsLabel();
00037
00038 GtkWidget *get_widget() const;
00039 int get_height() const;
00040
00041 int get_collector_index() const;
00042
00043 void set_highlight(bool highlight);
00044 bool get_highlight() const;
00045
00046 private:
00047 void set_mouse_within(bool mouse_within);
00048 static gboolean expose_event_callback(GtkWidget *widget,
00049 GdkEventExpose *event, gpointer data);
00050 static gboolean enter_notify_event_callback(GtkWidget *widget,
00051 GdkEventCrossing *event,
00052 gpointer data);
00053 static gboolean leave_notify_event_callback(GtkWidget *widget,
00054 GdkEventCrossing *event,
00055 gpointer data);
00056 static gboolean button_press_event_callback(GtkWidget *widget,
00057 GdkEventButton *event,
00058 gpointer data);
00059
00060 GtkStatsMonitor *_monitor;
00061 GtkStatsGraph *_graph;
00062 int _thread_index;
00063 int _collector_index;
00064 string _text;
00065 GtkWidget *_widget;
00066 GdkColor _fg_color;
00067 GdkColor _bg_color;
00068 PangoLayout *_layout;
00069
00070
00071
00072
00073
00074
00075
00076
00077 bool _highlight;
00078 bool _mouse_within;
00079 int _height;
00080
00081 static int _left_margin, _right_margin;
00082 static int _top_margin, _bottom_margin;
00083 };
00084
00085 #endif
00086