Panda3D
gtkStatsLabelStack.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file gtkStatsLabelStack.h
10  * @author drose
11  * @date 2006-01-16
12  */
13 
14 #ifndef GTKSTATSLABELSTACK_H
15 #define GTKSTATSLABELSTACK_H
16 
17 #include "pandatoolbase.h"
18 #include "pvector.h"
19 
20 #include <gtk/gtk.h>
21 
22 class GtkStatsLabel;
23 class GtkStatsMonitor;
24 class GtkStatsGraph;
25 
26 /**
27  * A widget that contains a stack of labels from bottom to top.
28  */
30 public:
33 
34  GtkWidget *get_widget() const;
35 
36  int get_label_y(int label_index, GtkWidget *target_widget) const;
37  int get_label_height(int label_index) const;
38  int get_label_collector_index(int label_index) const;
39 
40  void clear_labels(bool delete_widgets = true);
41  int add_label(GtkStatsMonitor *monitor, GtkStatsGraph *graph,
42  int thread_index, int collector_index, bool use_fullname);
43  int get_num_labels() const;
44 
45  void highlight_label(int collector_index);
46 
47 private:
48  GtkWidget *_widget;
49  int _highlight_label;
50 
52  Labels _labels;
53 };
54 
55 #endif
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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:29
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:29
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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's bottom edge, relative to the indicated target widget.