bsnes/higan/phoenix/core/layout/fixed-layout.hpp

28 lines
611 B
C++
Raw Normal View History

Update to v075r12 release. byuu says: phoenix has been completely rewritten from scratch, and bsnes/ui + bsnes/ui-gameboy have been updated to use the new API. Debugger works too. Currently, only phoenix/Qt is completed, and there are two known issues: 1: font sizes of menu items are wrong, I can fix this easily enough 2: there's some sort of multi-second lag when loading games, not sure what's happening there yet The new phoenix isn't exactly complete yet, still making some key changes, and then I'll start on phoenix/Windows and phoenix/GTK+. The most noticeable difference is that you don't have to give all of the header paths and PHOENIX_PLATFORM defines when compiling individual GUI object files. It's only needed for phoenix.cpp itself. The overall structure of the phoenix source folder is much saner as well for sync.sh. I'm really surprised things are working as well as they are for a two-day power rewrite of an entire phoenix target. The other targets won't be as bad insofar as the core stuff is completed this time. And thank god for that, I was about ready to kill myself after writing dozens of lines like this: HorizontalSlider::HorizontalSlider() : state(*new State), base_from_member<pHorizontalSlider&>(*new pHorizontalSlider(*this)), Widget(base_from_member<pHorizontalSlider&>::value), p(base_from_member<pHorizontalSlider&>::value) {} But each platform does have some new, unique problems. phoenix/GTK+ was acting screwy prior to the rewrite, and will most likely still have issues. Even more important, one of the major points of this rewrite was having the new phoenix/core cache widget settings/data, so that I can destroy and recreate widgets rather than relying on SetParent. This means that simple copying of the old phoenix/Windows won't work, and this new method is significantly more involved.
2011-02-15 12:22:37 +00:00
struct FixedLayout : Layout {
void append(Sizable &sizable, const Geometry &geometry);
void append(Sizable &sizable);
bool enabled();
Geometry minimumGeometry();
void remove(Sizable &sizable);
void reset();
void setEnabled(bool enabled = true);
void setGeometry(const Geometry &geometry);
void setVisible(bool visible = true);
void synchronizeLayout();
bool visible();
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
FixedLayout();
~FixedLayout();
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
//private:
struct State {
bool enabled;
bool visible;
} state;
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
struct Children {
Sizable *sizable;
Update to v075r12 release. byuu says: phoenix has been completely rewritten from scratch, and bsnes/ui + bsnes/ui-gameboy have been updated to use the new API. Debugger works too. Currently, only phoenix/Qt is completed, and there are two known issues: 1: font sizes of menu items are wrong, I can fix this easily enough 2: there's some sort of multi-second lag when loading games, not sure what's happening there yet The new phoenix isn't exactly complete yet, still making some key changes, and then I'll start on phoenix/Windows and phoenix/GTK+. The most noticeable difference is that you don't have to give all of the header paths and PHOENIX_PLATFORM defines when compiling individual GUI object files. It's only needed for phoenix.cpp itself. The overall structure of the phoenix source folder is much saner as well for sync.sh. I'm really surprised things are working as well as they are for a two-day power rewrite of an entire phoenix target. The other targets won't be as bad insofar as the core stuff is completed this time. And thank god for that, I was about ready to kill myself after writing dozens of lines like this: HorizontalSlider::HorizontalSlider() : state(*new State), base_from_member<pHorizontalSlider&>(*new pHorizontalSlider(*this)), Widget(base_from_member<pHorizontalSlider&>::value), p(base_from_member<pHorizontalSlider&>::value) {} But each platform does have some new, unique problems. phoenix/GTK+ was acting screwy prior to the rewrite, and will most likely still have issues. Even more important, one of the major points of this rewrite was having the new phoenix/core cache widget settings/data, so that I can destroy and recreate widgets rather than relying on SetParent. This means that simple copying of the old phoenix/Windows won't work, and this new method is significantly more involved.
2011-02-15 12:22:37 +00:00
Geometry geometry;
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
};
nall::vector<Children> children;
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
};