mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-09-02 06:42:41 +02:00
Update to v094r11 release.
byuu says: I've hooked up the input subsystem, and the input manager to assign hotkeys. So far I only have digital buttons working (keyboard only), and I'm not planning on supporting input groups again (mapping multiple physical buttons to one emulated button), but it's progress. As with the rest of tomoko, the code's a lot more compact. The nice thing about redoing code so many times is that each time you get a little bit better at it. The input configuration is saved to ~/.config/tomoko/settings.bml (just realized that I'm an idiot and need to rename it to input.bml) Also hooked up game saves and cartridge unloading. Active controller changing isn't hooked up yet, and I'll probably do it differently. Oh, and I declared the ruby lines for other platforms. Still need to add Cydrak's Windows compilation fixes. I am nothing if not lazy :P
This commit is contained in:
@@ -37,14 +37,14 @@ void pApplication::initialize() {
|
||||
|
||||
#if 1
|
||||
int argc = 1;
|
||||
char* argv[] = {new char[8], nullptr};
|
||||
strcpy(argv[0], "phoenix");
|
||||
char* argv[] = {new char[5], nullptr};
|
||||
strcpy(argv[0], "hiro");
|
||||
#else
|
||||
//--g-fatal-warnings will force a trap on Gtk-CRITICAL errors
|
||||
//this allows gdb to perform a backtrace to find error origin point
|
||||
//this allows gdb to perform a backtrace to find an error's origin point
|
||||
int argc = 2;
|
||||
char* argv[] = {new char[8], new char[19], nullptr};
|
||||
strcpy(argv[0], "phoenix");
|
||||
char* argv[] = {new char[5], new char[19], nullptr};
|
||||
strcpy(argv[0], "hiro");
|
||||
strcpy(argv[1], "--g-fatal-warnings");
|
||||
#endif
|
||||
char** argvp = argv;
|
||||
@@ -54,20 +54,20 @@ void pApplication::initialize() {
|
||||
g_object_set(gtkSettings, "gtk-button-images", true, nullptr);
|
||||
|
||||
gtk_rc_parse_string(R"(
|
||||
style "PhoenixWindow"
|
||||
style "HiroWindow"
|
||||
{
|
||||
GtkWindow::resize-grip-width = 0
|
||||
GtkWindow::resize-grip-height = 0
|
||||
}
|
||||
class "GtkWindow" style "PhoenixWindow"
|
||||
class "GtkWindow" style "HiroWindow"
|
||||
|
||||
style "PhoenixTreeView"
|
||||
style "HiroTreeView"
|
||||
{
|
||||
GtkTreeView::vertical-separator = 0
|
||||
}
|
||||
class "GtkTreeView" style "PhoenixTreeView"
|
||||
class "GtkTreeView" style "HiroTreeView"
|
||||
|
||||
style "PhoenixTabFrameCloseButton"
|
||||
style "HiroTabFrameCloseButton"
|
||||
{
|
||||
GtkWidget::focus-line-width = 0
|
||||
GtkWidget::focus-padding = 0
|
||||
@@ -75,7 +75,7 @@ void pApplication::initialize() {
|
||||
GtkButton::default-outer-border = {0, 0, 0, 0}
|
||||
GtkButton::inner-border = {0, 1, 0, 0}
|
||||
}
|
||||
widget_class "*.<GtkNotebook>.<GtkHBox>.<GtkButton>" style "PhoenixTabFrameCloseButton"
|
||||
widget_class "*.<GtkNotebook>.<GtkHBox>.<GtkButton>" style "HiroTabFrameCloseButton"
|
||||
)");
|
||||
|
||||
pKeyboard::initialize();
|
||||
|
@@ -91,12 +91,23 @@ auto pTabFrame::append(sTabFrameItem item) -> void {
|
||||
}
|
||||
|
||||
auto pTabFrame::container(mWidget& widget) -> GtkWidget* {
|
||||
auto widgetLayout = widget.parentLayout();
|
||||
//TabFrame holds multiple TabFrameItem controls
|
||||
//each TabFrameItem has its own GtkWindow; plus its own layout
|
||||
//we need to recurse up from the widget to its topmost layout before the TabFrameItem
|
||||
//once we know the topmost layout, we search through all TabFrameItems for a match
|
||||
mObject* object = &widget;
|
||||
while(object) {
|
||||
if(object->parentTabFrameItem()) break;
|
||||
if(auto layout = object->parentLayout()) { object = layout; continue; }
|
||||
break;
|
||||
}
|
||||
|
||||
unsigned position = 0;
|
||||
for(auto& item : state().items) {
|
||||
if(item->state.layout.data() == widgetLayout) return tabs[position].child;
|
||||
if(item->state.layout.data() == object) return tabs[position].child;
|
||||
position++;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@@ -326,7 +326,7 @@ auto pWindow::setVisible(bool visible) -> void {
|
||||
auto pWindow::_append(mWidget& widget) -> void {
|
||||
if(!widget.self()) return;
|
||||
if(auto parent = widget.parentWidget(true)) {
|
||||
if(parent->self()) widget.self()->gtkParent = parent->self()->container(widget);
|
||||
if(auto instance = parent->self()) widget.self()->gtkParent = instance->container(widget);
|
||||
} else {
|
||||
widget.self()->gtkParent = formContainer;
|
||||
}
|
||||
|
Reference in New Issue
Block a user