Panda3D
Loading...
Searching...
No Matches
winStatsLabelStack.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 winStatsLabelStack.h
10 * @author drose
11 * @date 2004-01-07
12 */
13
14#ifndef WINSTATSLABELSTACK_H
15#define WINSTATSLABELSTACK_H
16
17#include "pandatoolbase.h"
18#include "pvector.h"
19
20#ifndef WIN32_LEAN_AND_MEAN
21#define WIN32_LEAN_AND_MEAN 1
22#endif
23#include <windows.h>
24
25class WinStatsLabel;
26class WinStatsMonitor;
27class WinStatsGraph;
28
29/**
30 * A window that contains a stack of labels from bottom to top.
31 */
33public:
36
37 void setup(HWND parent_window);
38 bool is_setup() const;
39 void set_pos(int x, int y, int width, int height);
40
41 int get_x() const;
42 int get_y() const;
43 int get_width() const;
44 int get_height() const;
45 int get_ideal_width() const;
46
47 int get_label_y(int label_index) const;
48 int get_label_height(int label_index) const;
49 int get_label_collector_index(int label_index) const;
50
51 void clear_labels();
52 int add_label(WinStatsMonitor *monitor, WinStatsGraph *graph,
53 int thread_index, int collector_index, bool use_fullname);
54 int get_num_labels() const;
55
56 void highlight_label(int collector_index);
57
58private:
59 void create_window(HWND parent_window);
60 static void register_window_class(HINSTANCE application);
61
62 static LONG WINAPI static_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
63 LONG window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
64
65 HWND _window;
66 int _x;
67 int _y;
68 int _width;
69 int _height;
70 int _ideal_width;
71 int _highlight_label;
72
74 Labels _labels;
75
76 static bool _window_class_registered;
77 static const char * const _window_class_name;
78};
79
80#endif
This is just an abstract base class to provide a common pointer type for the various kinds of graphs ...
A window that contains a stack of labels from bottom to top.
int get_label_collector_index(int label_index) const
Returns the collector index associated with the indicated label.
void highlight_label(int collector_index)
Draws a highlight around the label representing the indicated collector, and removes the highlight fr...
int get_ideal_width() const
Returns the width the stack would really prefer to be.
bool is_setup() const
Returns true if the label stack has been set up, false otherwise.
void setup(HWND parent_window)
Creates the actual window object.
int get_width() const
Returns the width of the stack as we requested it.
int get_y() const
Returns the y position of the stack on its parent.
void clear_labels()
Removes the set of labels and starts a new set.
void set_pos(int x, int y, int width, int height)
Sets the position and size of the label stack on its parent.
int get_x() const
Returns the x position of the stack on its parent.
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) const
Returns the y position of the indicated label's bottom edge, relative to the label stack's parent win...
int add_label(WinStatsMonitor *monitor, WinStatsGraph *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.
int get_height() const
Returns the height of the stack as we requested it.
A text label that will draw in color appropriate for a particular collector.
This class represents a connection to a PStatsClient and manages the data exchange with the client.
This is our own Panda specialization on the default STL vector.
Definition pvector.h:42
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.