Some wx gui related changes.
- Moved wx gui plugin entry point to wx.cc, so we can use the macro PLUGIN_ENTRY_FOR_GUI_MODULE to be compatible with the other guis. - Updated gui Makefile dependencies.
This commit is contained in:
parent
3f760e2900
commit
d46c80562e
@ -307,8 +307,7 @@ wx.o: wx.@CPP_SUFFIX@ ../config.h ../bochs.h ../config.h ../osdep.h \
|
|||||||
../instrument/stubs/instrument.h ../param_names.h keymap.h \
|
../instrument/stubs/instrument.h ../param_names.h keymap.h \
|
||||||
../iodev/iodev.h ../plugin.h ../extplugin.h font/vga.bitmap.h wxmain.h
|
../iodev/iodev.h ../plugin.h ../extplugin.h font/vga.bitmap.h wxmain.h
|
||||||
wxdialog.o: wxdialog.@CPP_SUFFIX@ ../config.h ../param_names.h ../osdep.h \
|
wxdialog.o: wxdialog.@CPP_SUFFIX@ ../config.h ../param_names.h ../osdep.h \
|
||||||
../gui/siminterface.h ../cpudb.h ../gui/paramtree.h ../bxversion.h \
|
../gui/siminterface.h ../cpudb.h ../gui/paramtree.h wxdialog.h wxmain.h
|
||||||
wxdialog.h wxmain.h
|
|
||||||
wxmain.o: wxmain.@CPP_SUFFIX@ ../config.h ../param_names.h ../osdep.h \
|
wxmain.o: wxmain.@CPP_SUFFIX@ ../config.h ../param_names.h ../osdep.h \
|
||||||
../gui/siminterface.h ../cpudb.h ../gui/paramtree.h ../bxversion.h \
|
../gui/siminterface.h ../cpudb.h ../gui/paramtree.h ../bxversion.h \
|
||||||
wxdialog.h wxmain.h ../extplugin.h bitmaps/cdromd.xpm bitmaps/copy.xpm \
|
wxdialog.h wxmain.h ../extplugin.h bitmaps/cdromd.xpm bitmaps/copy.xpm \
|
||||||
@ -429,8 +428,7 @@ wx.lo: wx.@CPP_SUFFIX@ ../config.h ../bochs.h ../config.h ../osdep.h \
|
|||||||
../instrument/stubs/instrument.h ../param_names.h keymap.h \
|
../instrument/stubs/instrument.h ../param_names.h keymap.h \
|
||||||
../iodev/iodev.h ../plugin.h ../extplugin.h font/vga.bitmap.h wxmain.h
|
../iodev/iodev.h ../plugin.h ../extplugin.h font/vga.bitmap.h wxmain.h
|
||||||
wxdialog.lo: wxdialog.@CPP_SUFFIX@ ../config.h ../param_names.h ../osdep.h \
|
wxdialog.lo: wxdialog.@CPP_SUFFIX@ ../config.h ../param_names.h ../osdep.h \
|
||||||
../gui/siminterface.h ../cpudb.h ../gui/paramtree.h ../bxversion.h \
|
../gui/siminterface.h ../cpudb.h ../gui/paramtree.h wxdialog.h wxmain.h
|
||||||
wxdialog.h wxmain.h
|
|
||||||
wxmain.lo: wxmain.@CPP_SUFFIX@ ../config.h ../param_names.h ../osdep.h \
|
wxmain.lo: wxmain.@CPP_SUFFIX@ ../config.h ../param_names.h ../osdep.h \
|
||||||
../gui/siminterface.h ../cpudb.h ../gui/paramtree.h ../bxversion.h \
|
../gui/siminterface.h ../cpudb.h ../gui/paramtree.h ../bxversion.h \
|
||||||
wxdialog.h wxmain.h ../extplugin.h bitmaps/cdromd.xpm bitmaps/copy.xpm \
|
wxdialog.h wxmain.h ../extplugin.h bitmaps/cdromd.xpm bitmaps/copy.xpm \
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// $Id$
|
// $Id$
|
||||||
/////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Copyright (C) 2002-2020 The Bochs Project
|
// Copyright (C) 2002-2021 The Bochs Project
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
@ -69,6 +69,19 @@
|
|||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
// plugin support
|
// plugin support
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
PLUGIN_ENTRY_FOR_GUI_MODULE(wx)
|
||||||
|
{
|
||||||
|
if (init) {
|
||||||
|
wxLogDebug(wxT("plugin_entry() for wxmain.cc"));
|
||||||
|
wxLogDebug(wxT("installing wxWidgets as the configuration interface"));
|
||||||
|
SIM->register_configuration_interface("wx", wx_ci_callback, NULL);
|
||||||
|
wxLogDebug(wxT("installing %s as the Bochs GUI"), wxT("wxWidgets"));
|
||||||
|
SIM->get_param_enum(BXPN_SEL_DISPLAY_LIBRARY)->set_enabled(0);
|
||||||
|
MyPanel::OnPluginInit();
|
||||||
|
}
|
||||||
|
return 0; // success
|
||||||
|
}
|
||||||
|
|
||||||
class bx_wx_gui_c : public bx_gui_c {
|
class bx_wx_gui_c : public bx_gui_c {
|
||||||
public:
|
public:
|
||||||
bx_wx_gui_c(void) {}
|
bx_wx_gui_c(void) {}
|
||||||
|
@ -180,7 +180,7 @@ public:
|
|||||||
// wxWidgets startup
|
// wxWidgets startup
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static int ci_callback(void *userdata, ci_command_t command)
|
int wx_ci_callback(void *userdata, ci_command_t command)
|
||||||
{
|
{
|
||||||
switch (command)
|
switch (command)
|
||||||
{
|
{
|
||||||
@ -209,19 +209,6 @@ static int ci_callback(void *userdata, ci_command_t command)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" int libwx_gui_plugin_entry(plugin_t *plugin, plugintype_t type, bool init)
|
|
||||||
{
|
|
||||||
if (init) {
|
|
||||||
wxLogDebug(wxT("plugin_entry() for wxmain.cc"));
|
|
||||||
wxLogDebug(wxT("installing wxWidgets as the configuration interface"));
|
|
||||||
SIM->register_configuration_interface("wx", ci_callback, NULL);
|
|
||||||
wxLogDebug(wxT("installing %s as the Bochs GUI"), wxT("wxWidgets"));
|
|
||||||
SIM->get_param_enum(BXPN_SEL_DISPLAY_LIBRARY)->set_enabled(0);
|
|
||||||
MyPanel::OnPluginInit();
|
|
||||||
}
|
|
||||||
return 0; // success
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// MyApp: the wxWidgets application
|
// MyApp: the wxWidgets application
|
||||||
@ -232,11 +219,11 @@ IMPLEMENT_APP_NO_MAIN(MyApp)
|
|||||||
// this is the entry point of the wxWidgets code. It is called as follows:
|
// this is the entry point of the wxWidgets code. It is called as follows:
|
||||||
// 1. main() loads the wxWidgets plugin (if necessary) and calls
|
// 1. main() loads the wxWidgets plugin (if necessary) and calls
|
||||||
// libwx_LTX_plugin_entry(), which installs a function pointer to the
|
// libwx_LTX_plugin_entry(), which installs a function pointer to the
|
||||||
// ci_callback() function.
|
// wx_ci_callback() function.
|
||||||
// 2. main() calls SIM->configuration_interface.
|
// 2. main() calls SIM->configuration_interface.
|
||||||
// 3. bx_real_sim_c::configuration_interface calls the function pointer that
|
// 3. bx_real_sim_c::configuration_interface calls the function pointer that
|
||||||
// points to ci_callback() in this file, with command=CI_START.
|
// points to wx_ci_callback() in this file, with command=CI_START.
|
||||||
// 4. ci_callback() calls wxEntry() in the wxWidgets library
|
// 4. wx_ci_callback() calls wxEntry() in the wxWidgets library
|
||||||
// 5. wxWidgets library creates the app and calls OnInit().
|
// 5. wxWidgets library creates the app and calls OnInit().
|
||||||
//
|
//
|
||||||
// Before this code is called, the command line has already been parsed, and a
|
// Before this code is called, the command line has already been parsed, and a
|
||||||
|
@ -136,6 +136,7 @@ enum
|
|||||||
|
|
||||||
|
|
||||||
// defined in wxmain.cc
|
// defined in wxmain.cc
|
||||||
|
int wx_ci_callback(void *userdata, ci_command_t command);
|
||||||
void safeWxStrcpy(char *dest, wxString src, int destlen);
|
void safeWxStrcpy(char *dest, wxString src, int destlen);
|
||||||
|
|
||||||
/// the MyPanel methods are defined in wx.cc
|
/// the MyPanel methods are defined in wx.cc
|
||||||
|
Loading…
x
Reference in New Issue
Block a user