Panda3D
gtkStatsLabelStack.h
1 // Filename: gtkStatsLabelStack.h
2 // Created by: drose (16Jan06)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef GTKSTATSLABELSTACK_H
16 #define GTKSTATSLABELSTACK_H
17 
18 #include "pandatoolbase.h"
19 #include "pvector.h"
20 
21 #include <gtk/gtk.h>
22 
23 class GtkStatsLabel;
24 class GtkStatsMonitor;
25 class GtkStatsGraph;
26 
27 ////////////////////////////////////////////////////////////////////
28 // Class : GtkStatsLabelStack
29 // Description : A widget that contains a stack of labels from bottom
30 // to top.
31 ////////////////////////////////////////////////////////////////////
33 public:
36 
37  GtkWidget *get_widget() const;
38 
39  int get_label_y(int label_index, GtkWidget *target_widget) const;
40  int get_label_height(int label_index) const;
41  int get_label_collector_index(int label_index) const;
42 
43  void clear_labels(bool delete_widgets = true);
44  int add_label(GtkStatsMonitor *monitor, GtkStatsGraph *graph,
45  int thread_index, int collector_index, bool use_fullname);
46  int get_num_labels() const;
47 
48  void highlight_label(int collector_index);
49 
50 private:
51  GtkWidget *_widget;
52  int _highlight_label;
53 
55  Labels _labels;
56 };
57 
58 #endif
59 
int add_label(GtkStatsMonitor *monitor, GtkStatsGraph *graph, int thread_index, int collector_index, bool use_fullname)
Adds a new label to the top of the stack; returns the new label index.
GtkWidget * get_widget() const
Returns the widget for this stack.
void clear_labels(bool delete_widgets=true)
Removes the set of labels and starts a new set.
void highlight_label(int collector_index)
Draws a highlight around the label representing the indicated collector, and removes the highlight fr...
A widget that contains a stack of labels from bottom to top.
This is just an abstract base class to provide a common pointer type for the various kinds of graphs ...
Definition: gtkStatsGraph.h:32
This class represents a connection to a PStatsClient and manages the data exchange with the client...
A text label that will draw in color appropriate for a particular collector.
Definition: gtkStatsLabel.h:32
int get_label_collector_index(int label_index) const
Returns the collector index associated with the indicated label.
int get_label_height(int label_index) const
Returns the height of the indicated label.
int get_num_labels() const
Returns the number of labels in the stack.
int get_label_y(int label_index, GtkWidget *target_widget) const
Returns the y position of the indicated label&#39;s bottom edge, relative to the indicated target widget...