From: Volker R. <vru...@us...> - 2006-08-03 16:01:26
|
Update of /cvsroot/bochs/bochs/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13823/gui Modified Files: carbon.cc Log Message: - moved OSX beep implementation to the carbon gui code - improved carbon notify callback similar to the x11 implementation Index: carbon.cc =================================================================== RCS file: /cvsroot/bochs/bochs/gui/carbon.cc,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- carbon.cc 22 Feb 2006 19:43:55 -0000 1.31 +++ carbon.cc 3 Aug 2006 16:01:23 -0000 1.32 @@ -186,7 +186,9 @@ // Event handlers OSStatus HandleKey(EventRef theEvent, Bit32u keyState); -static BxEvent * CarbonSiminterfaceCallback (void *theClass, BxEvent *event); +static BxEvent * CarbonSiminterfaceCallback(void *theClass, BxEvent *event); +static bxevent_handler old_callback = NULL; +static void *old_callback_arg = NULL; // Show/hide UI elements void HidePointer(void); @@ -218,6 +220,8 @@ public: bx_carbon_gui_c (void) {} DECLARE_GUI_VIRTUAL_METHODS() + virtual void beep_on(float frequency); + virtual void beep_off(); }; // declare one instance of the gui object and call macro to insert the @@ -836,6 +840,8 @@ GetMouse(&prevPt); + // redirect notify callback to X11 specific code + SIM->get_notify_callback(&old_callback, &old_callback_arg); SIM->set_notify_callback(CarbonSiminterfaceCallback, NULL); UNUSED(argc); @@ -2054,9 +2060,19 @@ return(ret); } - void -bx_carbon_gui_c::mouse_enabled_changed_specific (bx_bool val) +void bx_carbon_gui_c::mouse_enabled_changed_specific (bx_bool val) +{ +} + +void bx_carbon_gui_c::beep_on(float frequency) +{ + AlertSoundPlay(); + BX_INFO(( "Carbon Beep ON (frequency=%.2f)",frequency)); +} + +void bx_carbon_gui_c::beep_off() { + BX_INFO(( "Carbon Beep OFF")); } // we need to handle "ask" events so that PANICs are properly reported @@ -2141,6 +2157,10 @@ } } #endif - return event; + if (old_callback != NULL) { + return (*old_callback)(old_callback_arg, event); + } else { + return event; + } } #endif /* if BX_WITH_CARBON */ |