Panda3D

gtkStatsLabelStack.h

00001 // Filename: gtkStatsLabelStack.h
00002 // Created by:  drose (16Jan06)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef GTKSTATSLABELSTACK_H
00016 #define GTKSTATSLABELSTACK_H
00017 
00018 #include "pandatoolbase.h"
00019 #include "pvector.h"
00020 
00021 #include <gtk/gtk.h>
00022 
00023 class GtkStatsLabel;
00024 class GtkStatsMonitor;
00025 class GtkStatsGraph;
00026 
00027 ////////////////////////////////////////////////////////////////////
00028 //       Class : GtkStatsLabelStack
00029 // Description : A widget that contains a stack of labels from bottom
00030 //               to top.
00031 ////////////////////////////////////////////////////////////////////
00032 class GtkStatsLabelStack {
00033 public:
00034   GtkStatsLabelStack();
00035   ~GtkStatsLabelStack();
00036 
00037   GtkWidget *get_widget() const;
00038 
00039   int get_label_y(int label_index, GtkWidget *target_widget) const;
00040   int get_label_height(int label_index) const;
00041   int get_label_collector_index(int label_index) const;
00042 
00043   void clear_labels(bool delete_widgets = true);
00044   int add_label(GtkStatsMonitor *monitor, GtkStatsGraph *graph,
00045                 int thread_index, int collector_index, bool use_fullname);
00046   int get_num_labels() const;
00047 
00048   void highlight_label(int collector_index);
00049 
00050 private:
00051   GtkWidget *_widget;
00052   int _highlight_label;
00053 
00054   typedef pvector<GtkStatsLabel *> Labels;
00055   Labels _labels;
00056 };
00057 
00058 #endif
00059 
 All Classes Functions Variables Enumerations