Panda3D
 All Classes Functions Variables Enumerations
gtkStatsChartMenu.h
1 // Filename: gtkStatsChartMenu.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 GTKSTATSCHARTMENU_H
16 #define GTKSTATSCHARTMENU_H
17 
18 #include "pandatoolbase.h"
19 
20 #include <gtk/gtk.h>
21 
22 class GtkStatsMonitor;
23 class PStatView;
24 class PStatViewLevel;
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : GtkStatsChartMenu
28 // Description : A pulldown menu of charts available for a particular
29 // thread.
30 ////////////////////////////////////////////////////////////////////
32 public:
33  GtkStatsChartMenu(GtkStatsMonitor *monitor, int thread_index);
35 
36  GtkWidget *get_menu_widget();
37  void add_to_menu_bar(GtkWidget *menu_bar, int position);
38 
39  void check_update();
40  void do_update();
41 
42 private:
43  void add_view(GtkWidget *parent_menu, const PStatViewLevel *view_level,
44  bool show_level);
45 
46  static void handle_menu(gpointer data);
47  static void remove_menu_child(GtkWidget *widget, gpointer data);
48 
49  GtkStatsMonitor *_monitor;
50  int _thread_index;
51 
52  int _last_level_index;
53  GtkWidget *_menu;
54 };
55 
56 #endif
57 
void check_update()
Checks to see if the menu needs to be updated (e.g.
void do_update()
Unconditionally updates the menu with the latest data from the client.
This is a single level value, or band of color, within a View.
GtkWidget * get_menu_widget()
Returns the gtk widget for this particular menu.
A View boils down the frame data to a linear list of times spent in a number of different Collectors...
Definition: pStatView.h:34
A pulldown menu of charts available for a particular thread.
void add_to_menu_bar(GtkWidget *menu_bar, int position)
Adds the menu to the end of the indicated menu bar.
This class represents a connection to a PStatsClient and manages the data exchange with the client...