00001 // This is core/vgui/impl/gtk/vgui_gtk_utils.h 00002 #ifndef vgui_gtk_utils_h_ 00003 #define vgui_gtk_utils_h_ 00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE 00005 #pragma interface 00006 #endif 00007 //: 00008 // \file 00009 // \author Robotics Research Group, University of Oxford 00010 // \date 19-DEC-1999 00011 // \brief GTK support for menus. 00012 // 00013 // Contains classes: vgui_gtk_utils 00014 // 00015 // \verbatim 00016 // Modifications 00017 // 13-JUL-2000 Marko Bacic, Oxford RRG -- Added support for menu accelerators 00018 // 13-SEP-2002 00019 // \endverbatim 00020 00021 00022 #include <vgui/vgui_event.h> 00023 #include <vgui/vgui_menu.h> 00024 #include <gtk/gtk.h> 00025 00026 00027 //: GTK support for menus. 00028 class vgui_gtk_utils 00029 { 00030 public: 00031 static vgui_button translate_button(int button); 00032 static vgui_key translate_key(GdkEventKey const *gev); 00033 static void set_coordinates(vgui_event &e, const gdouble x, const gdouble y); 00034 static void set_modifiers(vgui_event &e, const guint state); 00035 static bool is_modifier(GdkEvent const *gev); 00036 00037 static void add_submenu(GtkWidget *widget, const vgui_menu& menu); 00038 static void set_menu(GtkWidget *widget, const vgui_menu& menu, bool is_menubar=false); 00039 static GtkAccelGroup *accel_group; 00040 }; 00041 00042 #endif // vgui_gtk_utils_h_