Panda3D
|
00001 // Filename: winStatsLabelStack.h 00002 // Created by: drose (07Jan04) 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 WINSTATSLABELSTACK_H 00016 #define WINSTATSLABELSTACK_H 00017 00018 #include "pandatoolbase.h" 00019 #include "pvector.h" 00020 00021 #include <windows.h> 00022 00023 class WinStatsLabel; 00024 class WinStatsMonitor; 00025 class WinStatsGraph; 00026 00027 //////////////////////////////////////////////////////////////////// 00028 // Class : WinStatsLabelStack 00029 // Description : A window that contains a stack of labels from bottom 00030 // to top. 00031 //////////////////////////////////////////////////////////////////// 00032 class WinStatsLabelStack { 00033 public: 00034 WinStatsLabelStack(); 00035 ~WinStatsLabelStack(); 00036 00037 void setup(HWND parent_window); 00038 bool is_setup() const; 00039 void set_pos(int x, int y, int width, int height); 00040 00041 int get_x() const; 00042 int get_y() const; 00043 int get_width() const; 00044 int get_height() const; 00045 int get_ideal_width() const; 00046 00047 int get_label_y(int label_index) const; 00048 int get_label_height(int label_index) const; 00049 int get_label_collector_index(int label_index) const; 00050 00051 void clear_labels(); 00052 int add_label(WinStatsMonitor *monitor, WinStatsGraph *graph, 00053 int thread_index, int collector_index, bool use_fullname); 00054 int get_num_labels() const; 00055 00056 void highlight_label(int collector_index); 00057 00058 private: 00059 void create_window(HWND parent_window); 00060 static void register_window_class(HINSTANCE application); 00061 00062 static LONG WINAPI static_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); 00063 LONG window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); 00064 00065 HWND _window; 00066 int _x; 00067 int _y; 00068 int _width; 00069 int _height; 00070 int _ideal_width; 00071 int _highlight_label; 00072 00073 typedef pvector<WinStatsLabel *> Labels; 00074 Labels _labels; 00075 00076 static bool _window_class_registered; 00077 static const char * const _window_class_name; 00078 }; 00079 00080 #endif 00081