| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- /**
- * PANDA 3D SOFTWARE
- * Copyright (c) Carnegie Mellon University. All rights reserved.
- *
- * All use of this software is subject to the terms of the revised BSD
- * license. You should have received a copy of this license along
- * with this source code in a file named "LICENSE."
- *
- * @file winStatsLabelStack.h
- * @author drose
- * @date 2004-01-07
- */
- #ifndef WINSTATSLABELSTACK_H
- #define WINSTATSLABELSTACK_H
- #include "pandatoolbase.h"
- #include "pvector.h"
- #include "vector_int.h"
- #ifndef WIN32_LEAN_AND_MEAN
- #define WIN32_LEAN_AND_MEAN 1
- #endif
- #include <windows.h>
- class WinStatsLabel;
- class WinStatsMonitor;
- class WinStatsGraph;
- /**
- * A window that contains a stack of labels from bottom to top.
- */
- class WinStatsLabelStack {
- public:
- WinStatsLabelStack();
- ~WinStatsLabelStack();
- void setup(HWND parent_window);
- bool is_setup() const;
- void set_pos(int x, int y, int width, int height,
- int top_margin, int bottom_margin);
- int get_x() const;
- int get_y() const;
- int get_width() const;
- int get_height() const;
- int get_ideal_width() const;
- int get_label_y(int label_index) const;
- int get_label_height(int label_index) const;
- int get_label_collector_index(int label_index) const;
- void clear_labels();
- int add_label(WinStatsMonitor *monitor, WinStatsGraph *graph,
- int thread_index, int collector_index, bool use_fullname);
- void replace_labels(WinStatsMonitor *monitor, WinStatsGraph *graph,
- int thread_index, const vector_int &collector_indices,
- bool use_fullname);
- int get_num_labels() const;
- void highlight_label(int collector_index);
- void update_label_color(int collector_index);
- private:
- void recalculate_label_positions();
- void create_window(HWND parent_window);
- static void register_window_class(HINSTANCE application);
- static LONG WINAPI static_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
- LONG window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
- HWND _window;
- int _x;
- int _y;
- int _width;
- int _height;
- int _ideal_width;
- int _highlight_label;
- int _top_margin = 0;
- int _bottom_margin = 0;
- int _scroll = 0;
- typedef pvector<WinStatsLabel *> Labels;
- Labels _labels;
- static bool _window_class_registered;
- static const char * const _window_class_name;
- };
- #endif
|