00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef GTKSTATSSTRIPCHART_H
00020 #define GTKSTATSSTRIPCHART_H
00021
00022 #include <pandatoolbase.h>
00023
00024 #include "gtkStatsMonitor.h"
00025
00026 #include <pStatStripChart.h>
00027 #include <pointerTo.h>
00028
00029 #include <gtk--.h>
00030 #include "pmap.h"
00031
00032 class PStatView;
00033 class GtkStatsGuide;
00034
00035
00036
00037
00038
00039
00040 class GtkStatsStripChart : public Gtk::DrawingArea, public PStatStripChart {
00041 public:
00042 GtkStatsStripChart(GtkStatsMonitor *monitor,
00043 PStatView &view, int collector_index,
00044 int xsize, int ysize);
00045
00046 void mark_dead();
00047
00048 Gtk::Alignment *get_labels();
00049 GtkStatsGuide *get_guide();
00050
00051 Gdk_GC get_collector_gc(int collector_index);
00052
00053
00054
00055 SigC::Signal1<void, int> collector_picked;
00056
00057 private:
00058 virtual void clear_region();
00059 virtual void copy_region(int start_x, int end_x, int dest_x);
00060 virtual void draw_slice(int x, int frame_number);
00061 virtual void draw_empty(int x);
00062 virtual void draw_cursor(int x);
00063 virtual void end_draw(int from_x, int to_x);
00064 virtual void idle();
00065
00066 virtual gint configure_event_impl(GdkEventConfigure *event);
00067 virtual gint expose_event_impl(GdkEventExpose *event);
00068 virtual gint button_press_event_impl(GdkEventButton *button);
00069
00070 void pack_labels();
00071 void setup_white_gc();
00072
00073 private:
00074
00075 Gdk_Pixmap _pixmap;
00076
00077
00078
00079
00080 Gdk_GC _white_gc;
00081 Gdk_GC _black_gc;
00082 Gdk_GC _dark_gc;
00083 Gdk_GC _light_gc;
00084
00085
00086 typedef pmap<int, Gdk_GC> GCs;
00087 GCs _gcs;
00088
00089 Gtk::Alignment *_label_align;
00090 Gtk::VBox *_label_box;
00091 GtkStatsGuide *_guide;
00092 bool _is_dead;
00093 };
00094
00095 #include "gtkStatsStripChart.I"
00096
00097 #endif
00098