Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

pandatool/src/gtk-stats/gtkStatsStripChart.h

Go to the documentation of this file.
00001 // Filename: gtkStatsStripChart.h
00002 // Created by:  drose (14Jul00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
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 //       Class : GtkStatsStripChart
00037 // Description : A special widget that draws a strip chart, given a
00038 //               view.
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   // This signal is thrown when the user float-clicks on a label or
00054   // on a band of color.
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   // Backing pixmap for drawing area.
00075   Gdk_Pixmap _pixmap;
00076 
00077   // Graphics contexts for fg/bg.  We don't use the contexts defined
00078   // in the style, because that would probably interfere with the
00079   // visibility of the strip chart.
00080   Gdk_GC _white_gc;
00081   Gdk_GC _black_gc;
00082   Gdk_GC _dark_gc;
00083   Gdk_GC _light_gc;
00084 
00085   // Table of graphics contexts for our various collectors.
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 

Generated on Fri May 2 03:20:03 2003 for Panda-Tool by doxygen1.3