Panda3D

gtkStatsChartMenu.h

00001 // Filename: gtkStatsChartMenu.h
00002 // Created by:  drose (16Jan06)
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 GTKSTATSCHARTMENU_H
00016 #define GTKSTATSCHARTMENU_H
00017 
00018 #include "pandatoolbase.h"
00019 
00020 #include <gtk/gtk.h>
00021 
00022 class GtkStatsMonitor;
00023 class PStatView;
00024 class PStatViewLevel;
00025 
00026 ////////////////////////////////////////////////////////////////////
00027 //       Class : GtkStatsChartMenu
00028 // Description : A pulldown menu of charts available for a particular
00029 //               thread.
00030 ////////////////////////////////////////////////////////////////////
00031 class GtkStatsChartMenu {
00032 public:
00033   GtkStatsChartMenu(GtkStatsMonitor *monitor, int thread_index);
00034   ~GtkStatsChartMenu();
00035 
00036   GtkWidget *get_menu_widget();
00037   void add_to_menu_bar(GtkWidget *menu_bar, int position);
00038 
00039   void check_update();
00040   void do_update();
00041 
00042 private:
00043   void add_view(GtkWidget *parent_menu, const PStatViewLevel *view_level,
00044                 bool show_level);
00045 
00046   static void handle_menu(gpointer data);
00047   static void remove_menu_child(GtkWidget *widget, gpointer data);
00048 
00049   GtkStatsMonitor *_monitor;
00050   int _thread_index;
00051 
00052   int _last_level_index;
00053   GtkWidget *_menu;
00054 };
00055 
00056 #endif
00057 
 All Classes Functions Variables Enumerations