2013-07-29 09:42:45 +00:00
|
|
|
void FixedLayout::append(Sizable& sizable, Geometry geometry) {
|
2013-04-09 13:31:46 +00:00
|
|
|
children.append({&sizable, geometry});
|
Update to v082r15 release.
byuu says:
7.5 hours of power coding. Das Keyboard definitely helped (but didn't
eliminate) RSI, neato.
Okay, the NES resampler was using 315 / 88.8 by mistake, so the output
rate was wrong, causing way more video/audio stuttering than necessary.
STILL forgot the NES APU frame IRQ clear thing on $4015 reads, blah. Why
do I always remember things right after uploading the WIPs?
Recreated the input manager with a new design, works much nicer than the
old one, a whole lot less duplicated code.
Recreated the input settings window to work with the new multi-system
emulation.
All input settings are saved to their own configuration file, input.cfg.
Going to batch folder for now.
Okay, so the new input settings window ... basically there are now three
drop-downs, and I'm not even trying to label them anymore.
They are primary, secondary, tertiary selectors for the listed group
below. Examples:
"NES -> Controller Port 1 -> Gamepad"
"SNES -> Controller Port 2 -> Super Scope"
"User Interface -> Hotkeys -> Save States"
I am aware that "Clear" gets disabled when assigning. I will work on
that later, being lazy for now and disabling the entire window. Have to
add the mouse binders back, too.
Escape and modifiers are both mappable as individual keys now. If you
want to clear, click the damn clear button :P
Oh, and all input goes to all windows for now. That'll be fixed too when
input focus stuff is re-added.
2011-09-17 06:42:17 +00:00
|
|
|
synchronizeLayout();
|
2011-10-24 11:35:34 +00:00
|
|
|
if(window()) window()->synchronizeLayout();
|
2011-09-05 03:48:23 +00:00
|
|
|
}
|
|
|
|
|
2013-05-02 11:25:45 +00:00
|
|
|
void FixedLayout::append(Sizable& sizable) {
|
|
|
|
for(auto& child : children) if(child.sizable == &sizable) return;
|
2011-09-05 03:48:23 +00:00
|
|
|
Layout::append(sizable);
|
2011-10-24 11:35:34 +00:00
|
|
|
if(window()) window()->synchronizeLayout();
|
2011-09-05 03:48:23 +00:00
|
|
|
}
|
|
|
|
|
2013-03-15 13:11:33 +00:00
|
|
|
Size FixedLayout::minimumSize() {
|
2013-11-28 10:29:01 +00:00
|
|
|
unsigned width = Size::Minimum, height = Size::Minimum;
|
2013-05-02 11:25:45 +00:00
|
|
|
for(auto& child : children) {
|
2013-03-15 13:11:33 +00:00
|
|
|
width = max(width, child.sizable->minimumSize().width);
|
|
|
|
height = max(height, child.sizable->minimumSize().height);
|
2011-08-22 11:27:04 +00:00
|
|
|
}
|
2013-03-15 13:11:33 +00:00
|
|
|
return {width, height};
|
Update to v075r09 release.
byuu says:
Ported phoenix/Windows and phoenix/GTK+ over to the new system. There
are some problems that need to be addressed:
- Windows ComboBox height setting needs widget creation height to
properly scale itself (make Widget::setGeometry virtual and override
ComboBox::setGeometry)
- Windows Canvas is completely broken
- GTK+ Canvas is slow as shit compared to Qt Canvas, probably nothing
I can do about it, have to do a very costly conversion because GTK+ is
stupid and uses BGR like Nintendo
- GTK+ listboxes are fucking insanely complicated to set up. Currently
I just split the second-half of creation to the setHeaderText call,
but when you don't call that, things explode
- I'm probably going to have to completely destroy and recreate
listboxes when changing the header text / column count
- Qt resize code is still impossible to get right, it's not letting me
size a window > 2/3rds of the screen size (it's in their docs)
- I swear, Qt is the most painful API in the world to move/size
windows with
- now that Window is separate, it really needs geometry() and
frameGeometry() as the two are quite different
- I need a way to toggle window resizability for fixed layouts, Qt is
once again going to be a nightmare as it lacks a way to do this other
than fixed layouts
- GTK+ currently explodes on bsnes, millions of console messages,
wonderful
- plenty more I'm forgetting
One bit of really cool/good news though: I made
Fixed/Horizontal/Vertical layouts external to phoenix itself. The code
is included for all targets so that it's always there and compiled into
one object, but the great news is that you can easily write your own
layout widgets and they'll work on all toolkits instantly.
That resize issue with bsnes was so simple it's annoying: my FixedLayout
container was repositioning on geometry updates. Made it only do it once
at creation like it should.
bsnes now has a fancy resize, grow the window and get black borders,
shrink it and the video shrinks with it. I plan to make it fancier with
constraint settings (center, scale, stretch). Basically I want to turn
the fullscreen setting into a general setting that also applies to
windowed scaling. I will probably turn the video scale X sizes into
regular items instead of radio boxes, so you can easily reset to a fixed
size whenever you want. Update bsnes to remember width,height geometry
as well and it should be quite nice.
2011-02-07 09:18:01 +00:00
|
|
|
}
|
|
|
|
|
2013-05-02 11:25:45 +00:00
|
|
|
void FixedLayout::remove(Sizable& sizable) {
|
2011-09-05 03:48:23 +00:00
|
|
|
for(unsigned n = 0; n < children.size(); n++) {
|
|
|
|
if(children[n].sizable == &sizable) {
|
|
|
|
children.remove(n);
|
|
|
|
Layout::remove(sizable);
|
2011-10-24 11:35:34 +00:00
|
|
|
if(window()) window()->synchronizeLayout();
|
2011-09-05 03:48:23 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
Update to v075r09 release.
byuu says:
Ported phoenix/Windows and phoenix/GTK+ over to the new system. There
are some problems that need to be addressed:
- Windows ComboBox height setting needs widget creation height to
properly scale itself (make Widget::setGeometry virtual and override
ComboBox::setGeometry)
- Windows Canvas is completely broken
- GTK+ Canvas is slow as shit compared to Qt Canvas, probably nothing
I can do about it, have to do a very costly conversion because GTK+ is
stupid and uses BGR like Nintendo
- GTK+ listboxes are fucking insanely complicated to set up. Currently
I just split the second-half of creation to the setHeaderText call,
but when you don't call that, things explode
- I'm probably going to have to completely destroy and recreate
listboxes when changing the header text / column count
- Qt resize code is still impossible to get right, it's not letting me
size a window > 2/3rds of the screen size (it's in their docs)
- I swear, Qt is the most painful API in the world to move/size
windows with
- now that Window is separate, it really needs geometry() and
frameGeometry() as the two are quite different
- I need a way to toggle window resizability for fixed layouts, Qt is
once again going to be a nightmare as it lacks a way to do this other
than fixed layouts
- GTK+ currently explodes on bsnes, millions of console messages,
wonderful
- plenty more I'm forgetting
One bit of really cool/good news though: I made
Fixed/Horizontal/Vertical layouts external to phoenix itself. The code
is included for all targets so that it's always there and compiled into
one object, but the great news is that you can easily write your own
layout widgets and they'll work on all toolkits instantly.
That resize issue with bsnes was so simple it's annoying: my FixedLayout
container was repositioning on geometry updates. Made it only do it once
at creation like it should.
bsnes now has a fancy resize, grow the window and get black borders,
shrink it and the video shrinks with it. I plan to make it fancier with
constraint settings (center, scale, stretch). Basically I want to turn
the fullscreen setting into a general setting that also applies to
windowed scaling. I will probably turn the video scale X sizes into
regular items instead of radio boxes, so you can easily reset to a fixed
size whenever you want. Update bsnes to remember width,height geometry
as well and it should be quite nice.
2011-02-07 09:18:01 +00:00
|
|
|
}
|
|
|
|
|
2011-09-05 03:48:23 +00:00
|
|
|
void FixedLayout::reset() {
|
2013-05-02 11:25:45 +00:00
|
|
|
for(auto& child : children) {
|
2011-09-05 03:48:23 +00:00
|
|
|
if(window() && dynamic_cast<Widget*>(child.sizable)) window()->remove((Widget&)*child.sizable);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void FixedLayout::setEnabled(bool enabled) {
|
2013-11-28 10:29:01 +00:00
|
|
|
Sizable::state.enabled = enabled;
|
2013-05-02 11:25:45 +00:00
|
|
|
for(auto& child : children) {
|
2013-11-28 10:29:01 +00:00
|
|
|
child.sizable->setEnabled(child.sizable->enabled());
|
2011-09-05 03:48:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-29 09:42:45 +00:00
|
|
|
void FixedLayout::setGeometry(Geometry geometry) {
|
2011-08-22 11:27:04 +00:00
|
|
|
}
|
|
|
|
|
2011-02-24 09:25:20 +00:00
|
|
|
void FixedLayout::setVisible(bool visible) {
|
2013-11-28 10:29:01 +00:00
|
|
|
Sizable::state.visible = visible;
|
2013-05-02 11:25:45 +00:00
|
|
|
for(auto& child : children) {
|
2013-11-28 10:29:01 +00:00
|
|
|
child.sizable->setVisible(child.sizable->visible());
|
2011-08-22 11:27:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Update to v082r15 release.
byuu says:
7.5 hours of power coding. Das Keyboard definitely helped (but didn't
eliminate) RSI, neato.
Okay, the NES resampler was using 315 / 88.8 by mistake, so the output
rate was wrong, causing way more video/audio stuttering than necessary.
STILL forgot the NES APU frame IRQ clear thing on $4015 reads, blah. Why
do I always remember things right after uploading the WIPs?
Recreated the input manager with a new design, works much nicer than the
old one, a whole lot less duplicated code.
Recreated the input settings window to work with the new multi-system
emulation.
All input settings are saved to their own configuration file, input.cfg.
Going to batch folder for now.
Okay, so the new input settings window ... basically there are now three
drop-downs, and I'm not even trying to label them anymore.
They are primary, secondary, tertiary selectors for the listed group
below. Examples:
"NES -> Controller Port 1 -> Gamepad"
"SNES -> Controller Port 2 -> Super Scope"
"User Interface -> Hotkeys -> Save States"
I am aware that "Clear" gets disabled when assigning. I will work on
that later, being lazy for now and disabling the entire window. Have to
add the mouse binders back, too.
Escape and modifiers are both mappable as individual keys now. If you
want to clear, click the damn clear button :P
Oh, and all input goes to all windows for now. That'll be fixed too when
input focus stuff is re-added.
2011-09-17 06:42:17 +00:00
|
|
|
void FixedLayout::synchronizeLayout() {
|
2013-05-02 11:25:45 +00:00
|
|
|
for(auto& child : children) {
|
2011-09-05 03:48:23 +00:00
|
|
|
Layout::append(*child.sizable);
|
2013-11-28 10:29:01 +00:00
|
|
|
Geometry childGeometry = child.geometry;
|
|
|
|
if((signed)childGeometry.width < 1) childGeometry.width = 1;
|
|
|
|
if((signed)childGeometry.height < 1) childGeometry.height = 1;
|
|
|
|
child.sizable->setGeometry(childGeometry);
|
2011-09-05 03:48:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
FixedLayout::~FixedLayout() {
|
|
|
|
while(children.size()) remove(*children[0].sizable);
|
Update to v075r09 release.
byuu says:
Ported phoenix/Windows and phoenix/GTK+ over to the new system. There
are some problems that need to be addressed:
- Windows ComboBox height setting needs widget creation height to
properly scale itself (make Widget::setGeometry virtual and override
ComboBox::setGeometry)
- Windows Canvas is completely broken
- GTK+ Canvas is slow as shit compared to Qt Canvas, probably nothing
I can do about it, have to do a very costly conversion because GTK+ is
stupid and uses BGR like Nintendo
- GTK+ listboxes are fucking insanely complicated to set up. Currently
I just split the second-half of creation to the setHeaderText call,
but when you don't call that, things explode
- I'm probably going to have to completely destroy and recreate
listboxes when changing the header text / column count
- Qt resize code is still impossible to get right, it's not letting me
size a window > 2/3rds of the screen size (it's in their docs)
- I swear, Qt is the most painful API in the world to move/size
windows with
- now that Window is separate, it really needs geometry() and
frameGeometry() as the two are quite different
- I need a way to toggle window resizability for fixed layouts, Qt is
once again going to be a nightmare as it lacks a way to do this other
than fixed layouts
- GTK+ currently explodes on bsnes, millions of console messages,
wonderful
- plenty more I'm forgetting
One bit of really cool/good news though: I made
Fixed/Horizontal/Vertical layouts external to phoenix itself. The code
is included for all targets so that it's always there and compiled into
one object, but the great news is that you can easily write your own
layout widgets and they'll work on all toolkits instantly.
That resize issue with bsnes was so simple it's annoying: my FixedLayout
container was repositioning on geometry updates. Made it only do it once
at creation like it should.
bsnes now has a fancy resize, grow the window and get black borders,
shrink it and the video shrinks with it. I plan to make it fancier with
constraint settings (center, scale, stretch). Basically I want to turn
the fullscreen setting into a general setting that also applies to
windowed scaling. I will probably turn the video scale X sizes into
regular items instead of radio boxes, so you can easily reset to a fixed
size whenever you want. Update bsnes to remember width,height geometry
as well and it should be quite nice.
2011-02-07 09:18:01 +00:00
|
|
|
}
|