mirror of https://github.com/bsnes-emu/bsnes.git
Update to v104r13 release.
byuu says: Changelog: - nall/GNUmakefile: build=release changed to -O2, build=optimize is now -O3 - hiro: added Monitor::dpi(uint index) → Position [returns logical DPI for x, y] - Position is a bad name, but dpi(monitor).(x,y)() make more sense than .(width,height)() - hiro: Position, Size, Geometry, Font changed from using signed int to float - hiro: Alignment changed from using double to float - hiro: added skeleton (unused) Application::scale(), setScale() functions Errata: - hiro/cocoa's Monitor::dpi() is untested. Probably will cause issues with macOS' automatic scaling. - hiro/gtk lacks a way to get both per-monitor and per-axis (x,y) DPI scaling - hiro/qt lacks a way to get per-monitor DPI scaling (Qt 5.x has this, but I still use Qt 4.x) - and just to get global DPI, hiro/qt's DPI retrieval has to use undocumented functions ... fun The goal with this WIP was basically to prepare hiro for potential automatic scaling. It'll be extremely difficult, but I'm convinced that it must be possible if macOS can do it. By moving from signed integers to floats for coordinates, we can now scale and unscale without losing precision. That of course isn't the hard part, though. The hard part is where and how to do the scaling. In the ideal application, hiro/core and hiro/extension will handle 100% of this, and the per-platform hiro/(cocoa,gtk,qt,windows) will not be aware of what's going on, but ... to even make that possible, things will need to change in every per-platform core, eg the per-platform code will have to call a core function to change geometry, which will know about the scaling and unscale the values back down again. Gonna be a lot of work, but ... it's a start.
This commit is contained in:
parent
2e4cd09800
commit
1ff315838e
|
@ -1,4 +1,4 @@
|
||||||
build := release
|
build := optimize
|
||||||
include ../nall/GNUmakefile
|
include ../nall/GNUmakefile
|
||||||
|
|
||||||
target := tomoko
|
target := tomoko
|
||||||
|
|
|
@ -12,7 +12,7 @@ using namespace nall;
|
||||||
|
|
||||||
namespace Emulator {
|
namespace Emulator {
|
||||||
static const string Name = "higan";
|
static const string Name = "higan";
|
||||||
static const string Version = "104.12";
|
static const string Version = "104.13";
|
||||||
static const string Author = "byuu";
|
static const string Author = "byuu";
|
||||||
static const string License = "GPLv3";
|
static const string License = "GPLv3";
|
||||||
static const string Website = "https://byuu.org/";
|
static const string Website = "https://byuu.org/";
|
||||||
|
|
|
@ -8,6 +8,15 @@ auto pMonitor::count() -> uint {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto pMonitor::dpi(uint monitor) -> Position {
|
||||||
|
@autoreleasepool {
|
||||||
|
NSScreen* screen = [[NSScreen screens] objectAtIndex:monitor];
|
||||||
|
NSDistionary* dictionary = [screen deviceDescription];
|
||||||
|
NSSize dpi = [[dictionary objectForKey:NSDeviceSize] sizeValue];
|
||||||
|
return {dpi.width, dpi.height};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
auto pMonitor::geometry(uint monitor) -> Geometry {
|
auto pMonitor::geometry(uint monitor) -> Geometry {
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
NSRect rectangle = [[[NSScreen screens] objectAtIndex:monitor] frame];
|
NSRect rectangle = [[[NSScreen screens] objectAtIndex:monitor] frame];
|
||||||
|
|
|
@ -4,6 +4,7 @@ namespace hiro {
|
||||||
|
|
||||||
struct pMonitor {
|
struct pMonitor {
|
||||||
static auto count() -> uint;
|
static auto count() -> uint;
|
||||||
|
static auto dpi(uint monitor) -> Position;
|
||||||
static auto geometry(uint monitor) -> Geometry;
|
static auto geometry(uint monitor) -> Geometry;
|
||||||
static auto primary() -> uint;
|
static auto primary() -> uint;
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,7 +4,7 @@ Alignment::Alignment() {
|
||||||
setAlignment(-1.0, -1.0);
|
setAlignment(-1.0, -1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Alignment::Alignment(double horizontal, double vertical) {
|
Alignment::Alignment(float horizontal, float vertical) {
|
||||||
setAlignment(horizontal, vertical);
|
setAlignment(horizontal, vertical);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ Alignment::operator bool() const {
|
||||||
&& state.vertical >= 0.0 && state.vertical <= 1.0;
|
&& state.vertical >= 0.0 && state.vertical <= 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Alignment::horizontal() const -> double {
|
auto Alignment::horizontal() const -> float {
|
||||||
return state.horizontal;
|
return state.horizontal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,23 +21,23 @@ auto Alignment::reset() -> type& {
|
||||||
return setAlignment(-1.0, -1.0);
|
return setAlignment(-1.0, -1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Alignment::setAlignment(double horizontal, double vertical) -> type& {
|
auto Alignment::setAlignment(float horizontal, float vertical) -> type& {
|
||||||
state.horizontal = horizontal;
|
state.horizontal = horizontal;
|
||||||
state.vertical = vertical;
|
state.vertical = vertical;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Alignment::setHorizontal(double horizontal) -> type& {
|
auto Alignment::setHorizontal(float horizontal) -> type& {
|
||||||
state.horizontal = horizontal;
|
state.horizontal = horizontal;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Alignment::setVertical(double vertical) -> type& {
|
auto Alignment::setVertical(float vertical) -> type& {
|
||||||
state.vertical = vertical;
|
state.vertical = vertical;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Alignment::vertical() const -> double {
|
auto Alignment::vertical() const -> float {
|
||||||
return state.vertical;
|
return state.vertical;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,14 @@ auto Application::quit() -> void {
|
||||||
return pApplication::quit();
|
return pApplication::quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto Application::scale() -> float {
|
||||||
|
return state.scale;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto Application::scale(float value) -> float {
|
||||||
|
return value * state.scale;
|
||||||
|
}
|
||||||
|
|
||||||
auto Application::setFont(const Font& font) -> void {
|
auto Application::setFont(const Font& font) -> void {
|
||||||
state.font = font;
|
state.font = font;
|
||||||
}
|
}
|
||||||
|
@ -43,6 +51,10 @@ auto Application::setName(const string& name) -> void {
|
||||||
state.name = name;
|
state.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto Application::setScale(float scale) -> void {
|
||||||
|
state.scale = scale;
|
||||||
|
}
|
||||||
|
|
||||||
//Windows
|
//Windows
|
||||||
//=======
|
//=======
|
||||||
|
|
||||||
|
|
|
@ -90,8 +90,8 @@ Declare(Viewport)
|
||||||
|
|
||||||
#undef Declare
|
#undef Declare
|
||||||
|
|
||||||
enum class Orientation : unsigned { Horizontal, Vertical };
|
enum class Orientation : uint { Horizontal, Vertical };
|
||||||
enum class Navigation : unsigned { Top, Bottom, Left, Right };
|
enum class Navigation : uint { Top, Bottom, Left, Right };
|
||||||
|
|
||||||
#if defined(Hiro_Color)
|
#if defined(Hiro_Color)
|
||||||
struct Color {
|
struct Color {
|
||||||
|
@ -153,18 +153,18 @@ struct Alignment {
|
||||||
using type = Alignment;
|
using type = Alignment;
|
||||||
|
|
||||||
Alignment();
|
Alignment();
|
||||||
Alignment(double horizontal, double vertical = 0.5);
|
Alignment(float horizontal, float vertical = 0.5);
|
||||||
|
|
||||||
explicit operator bool() const;
|
explicit operator bool() const;
|
||||||
auto operator==(const Alignment& source) const -> bool;
|
auto operator==(const Alignment& source) const -> bool;
|
||||||
auto operator!=(const Alignment& source) const -> bool;
|
auto operator!=(const Alignment& source) const -> bool;
|
||||||
|
|
||||||
auto horizontal() const -> double;
|
auto horizontal() const -> float;
|
||||||
auto reset() -> type&;
|
auto reset() -> type&;
|
||||||
auto setAlignment(double horizontal = -1.0, double vertical = 0.5) -> type&;
|
auto setAlignment(float horizontal = -1.0, float vertical = 0.5) -> type&;
|
||||||
auto setHorizontal(double horizontal) -> type&;
|
auto setHorizontal(float horizontal) -> type&;
|
||||||
auto setVertical(double vertical) -> type&;
|
auto setVertical(float vertical) -> type&;
|
||||||
auto vertical() const -> double;
|
auto vertical() const -> float;
|
||||||
|
|
||||||
//private:
|
//private:
|
||||||
struct State {
|
struct State {
|
||||||
|
@ -203,9 +203,9 @@ struct Position {
|
||||||
using type = Position;
|
using type = Position;
|
||||||
|
|
||||||
Position();
|
Position();
|
||||||
Position(signed x, signed y);
|
Position(float x, float y);
|
||||||
template<typename X, typename Y>
|
template<typename X, typename Y>
|
||||||
Position(X x, Y y) : Position((signed)x, (signed)y) {}
|
Position(X x, Y y) : Position((float)x, (float)y) {}
|
||||||
|
|
||||||
explicit operator bool() const;
|
explicit operator bool() const;
|
||||||
auto operator==(const Position& source) const -> bool;
|
auto operator==(const Position& source) const -> bool;
|
||||||
|
@ -213,16 +213,16 @@ struct Position {
|
||||||
|
|
||||||
auto reset() -> type&;
|
auto reset() -> type&;
|
||||||
auto setPosition(Position position = {}) -> type&;
|
auto setPosition(Position position = {}) -> type&;
|
||||||
auto setPosition(signed x, signed y) -> type&;
|
auto setPosition(float x, float y) -> type&;
|
||||||
auto setX(signed x) -> type&;
|
auto setX(float x) -> type&;
|
||||||
auto setY(signed y) -> type&;
|
auto setY(float y) -> type&;
|
||||||
auto x() const -> signed;
|
auto x() const -> float;
|
||||||
auto y() const -> signed;
|
auto y() const -> float;
|
||||||
|
|
||||||
//private:
|
//private:
|
||||||
struct State {
|
struct State {
|
||||||
signed x;
|
float x;
|
||||||
signed y;
|
float y;
|
||||||
} state;
|
} state;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -232,29 +232,29 @@ struct Size {
|
||||||
using type = Size;
|
using type = Size;
|
||||||
|
|
||||||
Size();
|
Size();
|
||||||
Size(signed width, signed height);
|
Size(float width, float height);
|
||||||
template<typename W, typename H>
|
template<typename W, typename H>
|
||||||
Size(W width, H height) : Size((signed)width, (signed)height) {}
|
Size(W width, H height) : Size((float)width, (float)height) {}
|
||||||
|
|
||||||
explicit operator bool() const;
|
explicit operator bool() const;
|
||||||
auto operator==(const Size& source) const -> bool;
|
auto operator==(const Size& source) const -> bool;
|
||||||
auto operator!=(const Size& source) const -> bool;
|
auto operator!=(const Size& source) const -> bool;
|
||||||
|
|
||||||
auto height() const -> signed;
|
auto height() const -> float;
|
||||||
auto reset() -> type&;
|
auto reset() -> type&;
|
||||||
auto setHeight(signed height) -> type&;
|
auto setHeight(float height) -> type&;
|
||||||
auto setSize(Size source = {}) -> type&;
|
auto setSize(Size source = {}) -> type&;
|
||||||
auto setSize(signed width, signed height) -> type&;
|
auto setSize(float width, float height) -> type&;
|
||||||
auto setWidth(signed width) -> type&;
|
auto setWidth(float width) -> type&;
|
||||||
auto width() const -> signed;
|
auto width() const -> float;
|
||||||
|
|
||||||
static const signed Maximum = ~0; //~0 == -1
|
static constexpr float Maximum = -1.0;
|
||||||
static const signed Minimum = 0;
|
static constexpr float Minimum = +0.0;
|
||||||
|
|
||||||
//private:
|
//private:
|
||||||
struct State {
|
struct State {
|
||||||
signed width;
|
float width;
|
||||||
signed height;
|
float height;
|
||||||
} state;
|
} state;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -265,39 +265,39 @@ struct Geometry {
|
||||||
|
|
||||||
Geometry();
|
Geometry();
|
||||||
Geometry(Position position, Size size);
|
Geometry(Position position, Size size);
|
||||||
Geometry(signed x, signed y, signed width, signed height);
|
Geometry(float x, float y, float width, float height);
|
||||||
template<typename X, typename Y, typename W, typename H>
|
template<typename X, typename Y, typename W, typename H>
|
||||||
Geometry(X x, Y y, W width, H height) : Geometry((signed)x, (signed)y, (signed)width, (signed)height) {}
|
Geometry(X x, Y y, W width, H height) : Geometry((float)x, (float)y, (float)width, (float)height) {}
|
||||||
|
|
||||||
explicit operator bool() const;
|
explicit operator bool() const;
|
||||||
auto operator==(const Geometry& source) const -> bool;
|
auto operator==(const Geometry& source) const -> bool;
|
||||||
auto operator!=(const Geometry& source) const -> bool;
|
auto operator!=(const Geometry& source) const -> bool;
|
||||||
|
|
||||||
auto height() const -> signed;
|
auto height() const -> float;
|
||||||
auto position() const -> Position;
|
auto position() const -> Position;
|
||||||
auto reset() -> type&;
|
auto reset() -> type&;
|
||||||
auto setGeometry(Geometry geometry = {}) -> type&;
|
auto setGeometry(Geometry geometry = {}) -> type&;
|
||||||
auto setGeometry(Position position, Size size) -> type&;
|
auto setGeometry(Position position, Size size) -> type&;
|
||||||
auto setGeometry(signed x, signed y, signed width, signed height) -> type&;
|
auto setGeometry(float x, float y, float width, float height) -> type&;
|
||||||
auto setHeight(signed height) -> type&;
|
auto setHeight(float height) -> type&;
|
||||||
auto setPosition(Position position = {}) -> type&;
|
auto setPosition(Position position = {}) -> type&;
|
||||||
auto setPosition(signed x, signed y) -> type&;
|
auto setPosition(float x, float y) -> type&;
|
||||||
auto setSize(Size size = {}) -> type&;
|
auto setSize(Size size = {}) -> type&;
|
||||||
auto setSize(signed width, signed height) -> type&;
|
auto setSize(float width, float height) -> type&;
|
||||||
auto setWidth(signed width) -> type&;
|
auto setWidth(float width) -> type&;
|
||||||
auto setX(signed x) -> type&;
|
auto setX(float x) -> type&;
|
||||||
auto setY(signed y) -> type&;
|
auto setY(float y) -> type&;
|
||||||
auto size() const -> Size;
|
auto size() const -> Size;
|
||||||
auto width() const -> signed;
|
auto width() const -> float;
|
||||||
auto x() const -> signed;
|
auto x() const -> float;
|
||||||
auto y() const -> signed;
|
auto y() const -> float;
|
||||||
|
|
||||||
//private:
|
//private:
|
||||||
struct State {
|
struct State {
|
||||||
signed x;
|
float x;
|
||||||
signed y;
|
float y;
|
||||||
signed width;
|
float width;
|
||||||
signed height;
|
float height;
|
||||||
} state;
|
} state;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -306,7 +306,7 @@ struct Geometry {
|
||||||
struct Font {
|
struct Font {
|
||||||
using type = Font;
|
using type = Font;
|
||||||
|
|
||||||
Font(const string& family = "", unsigned size = 0);
|
Font(const string& family = "", float size = 0);
|
||||||
|
|
||||||
explicit operator bool() const;
|
explicit operator bool() const;
|
||||||
auto operator==(const Font& source) const -> bool;
|
auto operator==(const Font& source) const -> bool;
|
||||||
|
@ -319,8 +319,8 @@ struct Font {
|
||||||
auto setBold(bool bold = true) -> type&;
|
auto setBold(bool bold = true) -> type&;
|
||||||
auto setFamily(const string& family = "") -> type&;
|
auto setFamily(const string& family = "") -> type&;
|
||||||
auto setItalic(bool italic = true) -> type&;
|
auto setItalic(bool italic = true) -> type&;
|
||||||
auto setSize(unsigned size = 0) -> type&;
|
auto setSize(float size = 0) -> type&;
|
||||||
auto size() const -> unsigned;
|
auto size() const -> float;
|
||||||
auto size(const string& text) const -> Size;
|
auto size(const string& text) const -> Size;
|
||||||
|
|
||||||
static const string Sans;
|
static const string Sans;
|
||||||
|
@ -330,7 +330,7 @@ struct Font {
|
||||||
//private:
|
//private:
|
||||||
struct State {
|
struct State {
|
||||||
string family;
|
string family;
|
||||||
unsigned size;
|
float size;
|
||||||
bool bold;
|
bool bold;
|
||||||
bool italic;
|
bool italic;
|
||||||
} state;
|
} state;
|
||||||
|
@ -377,11 +377,14 @@ struct Application {
|
||||||
static auto name() -> string;
|
static auto name() -> string;
|
||||||
static auto onMain(const function<void ()>& callback = {}) -> void;
|
static auto onMain(const function<void ()>& callback = {}) -> void;
|
||||||
static auto run() -> void;
|
static auto run() -> void;
|
||||||
|
static auto scale() -> float;
|
||||||
|
static auto scale(float value) -> float;
|
||||||
static auto pendingEvents() -> bool;
|
static auto pendingEvents() -> bool;
|
||||||
static auto processEvents() -> void;
|
static auto processEvents() -> void;
|
||||||
static auto quit() -> void;
|
static auto quit() -> void;
|
||||||
static auto setFont(const Font& font = {}) -> void;
|
static auto setFont(const Font& font = {}) -> void;
|
||||||
static auto setName(const string& name = "") -> void;
|
static auto setName(const string& name = "") -> void;
|
||||||
|
static auto setScale(float scale = 1.0) -> void;
|
||||||
|
|
||||||
struct Windows {
|
struct Windows {
|
||||||
static auto doModalChange(bool modal) -> void;
|
static auto doModalChange(bool modal) -> void;
|
||||||
|
@ -405,6 +408,7 @@ struct Application {
|
||||||
string name;
|
string name;
|
||||||
function<void ()> onMain;
|
function<void ()> onMain;
|
||||||
bool quit = false;
|
bool quit = false;
|
||||||
|
float scale = 1.0;
|
||||||
|
|
||||||
struct Windows {
|
struct Windows {
|
||||||
function<void (bool)> onModalChange;
|
function<void (bool)> onModalChange;
|
||||||
|
@ -435,9 +439,10 @@ struct Desktop {
|
||||||
struct Monitor {
|
struct Monitor {
|
||||||
Monitor() = delete;
|
Monitor() = delete;
|
||||||
|
|
||||||
static auto count() -> unsigned;
|
static auto count() -> uint;
|
||||||
static auto geometry(unsigned monitor) -> Geometry;
|
static auto dpi(uint monitor) -> Position;
|
||||||
static auto primary() -> unsigned;
|
static auto geometry(uint monitor) -> Geometry;
|
||||||
|
static auto primary() -> uint;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1680,7 +1685,7 @@ struct mTableViewColumn : mObject {
|
||||||
auto editable() const -> bool;
|
auto editable() const -> bool;
|
||||||
auto expandable() const -> bool;
|
auto expandable() const -> bool;
|
||||||
auto foregroundColor() const -> Color;
|
auto foregroundColor() const -> Color;
|
||||||
auto horizontalAlignment() const -> double;
|
auto horizontalAlignment() const -> float;
|
||||||
auto icon() const -> image;
|
auto icon() const -> image;
|
||||||
auto remove() -> type& override;
|
auto remove() -> type& override;
|
||||||
auto resizable() const -> bool;
|
auto resizable() const -> bool;
|
||||||
|
@ -1690,18 +1695,18 @@ struct mTableViewColumn : mObject {
|
||||||
auto setEditable(bool editable = true) -> type&;
|
auto setEditable(bool editable = true) -> type&;
|
||||||
auto setExpandable(bool expandable = true) -> type&;
|
auto setExpandable(bool expandable = true) -> type&;
|
||||||
auto setForegroundColor(Color color = {}) -> type&;
|
auto setForegroundColor(Color color = {}) -> type&;
|
||||||
auto setHorizontalAlignment(double alignment = 0.0) -> type&;
|
auto setHorizontalAlignment(float alignment = 0.0) -> type&;
|
||||||
auto setIcon(const image& icon = {}) -> type&;
|
auto setIcon(const image& icon = {}) -> type&;
|
||||||
auto setResizable(bool resizable = true) -> type&;
|
auto setResizable(bool resizable = true) -> type&;
|
||||||
auto setSortable(bool sortable = true) -> type&;
|
auto setSortable(bool sortable = true) -> type&;
|
||||||
auto setText(const string& text = "") -> type&;
|
auto setText(const string& text = "") -> type&;
|
||||||
auto setVerticalAlignment(double alignment = 0.5) -> type&;
|
auto setVerticalAlignment(float alignment = 0.5) -> type&;
|
||||||
auto setVisible(bool visible = true) -> type&;
|
auto setVisible(bool visible = true) -> type&;
|
||||||
auto setWidth(signed width = 0) -> type&;
|
auto setWidth(float width = 0) -> type&;
|
||||||
auto sortable() const -> bool;
|
auto sortable() const -> bool;
|
||||||
auto text() const -> string;
|
auto text() const -> string;
|
||||||
auto verticalAlignment() const -> double;
|
auto verticalAlignment() const -> float;
|
||||||
auto width() const -> signed;
|
auto width() const -> float;
|
||||||
|
|
||||||
//private:
|
//private:
|
||||||
struct State {
|
struct State {
|
||||||
|
@ -1710,14 +1715,14 @@ struct mTableViewColumn : mObject {
|
||||||
bool editable = false;
|
bool editable = false;
|
||||||
bool expandable = false;
|
bool expandable = false;
|
||||||
Color foregroundColor;
|
Color foregroundColor;
|
||||||
double horizontalAlignment = 0.0;
|
float horizontalAlignment = 0.0;
|
||||||
image icon;
|
image icon;
|
||||||
bool resizable = true;
|
bool resizable = true;
|
||||||
bool sortable = false;
|
bool sortable = false;
|
||||||
string text;
|
string text;
|
||||||
double verticalAlignment = 0.5;
|
float verticalAlignment = 0.5;
|
||||||
bool visible = true;
|
bool visible = true;
|
||||||
signed width = 0;
|
float width = 0;
|
||||||
} state;
|
} state;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -4,7 +4,7 @@ const string Font::Sans = "{sans}";
|
||||||
const string Font::Serif = "{serif}";
|
const string Font::Serif = "{serif}";
|
||||||
const string Font::Mono = "{mono}";
|
const string Font::Mono = "{mono}";
|
||||||
|
|
||||||
Font::Font(const string& family, unsigned size) {
|
Font::Font(const string& family, float size) {
|
||||||
setFamily(family);
|
setFamily(family);
|
||||||
setSize(size);
|
setSize(size);
|
||||||
state.bold = false;
|
state.bold = false;
|
||||||
|
@ -58,12 +58,12 @@ auto Font::setItalic(bool italic) -> type& {
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Font::setSize(unsigned size) -> type& {
|
auto Font::setSize(float size) -> type& {
|
||||||
state.size = size;
|
state.size = size;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Font::size() const -> unsigned {
|
auto Font::size() const -> float {
|
||||||
return state.size;
|
return state.size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ Geometry::Geometry(Position position, Size size) {
|
||||||
setGeometry(position, size);
|
setGeometry(position, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
Geometry::Geometry(signed x, signed y, signed width, signed height) {
|
Geometry::Geometry(float x, float y, float width, float height) {
|
||||||
setGeometry(x, y, width, height);
|
setGeometry(x, y, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ auto Geometry::operator!=(const Geometry& source) const -> bool {
|
||||||
return !operator==(source);
|
return !operator==(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Geometry::height() const -> signed {
|
auto Geometry::height() const -> float {
|
||||||
return state.height;
|
return state.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ auto Geometry::reset() -> type& {
|
||||||
return setGeometry(0, 0, 0, 0);
|
return setGeometry(0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Geometry::setHeight(signed height) -> type& {
|
auto Geometry::setHeight(float height) -> type& {
|
||||||
state.height = height;
|
state.height = height;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ auto Geometry::setGeometry(Position position, Size size) -> type& {
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Geometry::setGeometry(signed x, signed y, signed width, signed height) -> type& {
|
auto Geometry::setGeometry(float x, float y, float width, float height) -> type& {
|
||||||
state.x = x;
|
state.x = x;
|
||||||
state.y = y;
|
state.y = y;
|
||||||
state.width = width;
|
state.width = width;
|
||||||
|
@ -62,7 +62,7 @@ auto Geometry::setPosition(Position position) -> type& {
|
||||||
return setPosition(position.x(), position.y());
|
return setPosition(position.x(), position.y());
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Geometry::setPosition(signed x, signed y) -> type& {
|
auto Geometry::setPosition(float x, float y) -> type& {
|
||||||
state.x = x;
|
state.x = x;
|
||||||
state.y = y;
|
state.y = y;
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -72,23 +72,23 @@ auto Geometry::setSize(Size size) -> type& {
|
||||||
return setSize(size.width(), size.height());
|
return setSize(size.width(), size.height());
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Geometry::setSize(signed width, signed height) -> type& {
|
auto Geometry::setSize(float width, float height) -> type& {
|
||||||
state.width = width;
|
state.width = width;
|
||||||
state.height = height;
|
state.height = height;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Geometry::setWidth(signed width) -> type& {
|
auto Geometry::setWidth(float width) -> type& {
|
||||||
state.width = width;
|
state.width = width;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Geometry::setX(signed x) -> type& {
|
auto Geometry::setX(float x) -> type& {
|
||||||
state.x = x;
|
state.x = x;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Geometry::setY(signed y) -> type& {
|
auto Geometry::setY(float y) -> type& {
|
||||||
state.y = y;
|
state.y = y;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@ -97,15 +97,15 @@ auto Geometry::size() const -> Size {
|
||||||
return {state.width, state.height};
|
return {state.width, state.height};
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Geometry::width() const -> signed {
|
auto Geometry::width() const -> float {
|
||||||
return state.width;
|
return state.width;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Geometry::x() const -> signed {
|
auto Geometry::x() const -> float {
|
||||||
return state.x;
|
return state.x;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Geometry::y() const -> signed {
|
auto Geometry::y() const -> float {
|
||||||
return state.y;
|
return state.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
#if defined(Hiro_Monitor)
|
#if defined(Hiro_Monitor)
|
||||||
|
|
||||||
auto Monitor::count() -> unsigned {
|
auto Monitor::count() -> uint {
|
||||||
return pMonitor::count();
|
return pMonitor::count();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Monitor::geometry(unsigned monitor) -> Geometry {
|
auto Monitor::dpi(uint monitor) -> Position {
|
||||||
|
return pMonitor::dpi(monitor);
|
||||||
|
}
|
||||||
|
|
||||||
|
auto Monitor::geometry(uint monitor) -> Geometry {
|
||||||
return pMonitor::geometry(monitor);
|
return pMonitor::geometry(monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Monitor::primary() -> unsigned {
|
auto Monitor::primary() -> uint {
|
||||||
return pMonitor::primary();
|
return pMonitor::primary();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ Position::Position() {
|
||||||
setPosition(0, 0);
|
setPosition(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Position::Position(signed x, signed y) {
|
Position::Position(float x, float y) {
|
||||||
setPosition(x, y);
|
setPosition(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,27 +28,27 @@ auto Position::setPosition(Position position) -> type& {
|
||||||
return setPosition(position.x(), position.y());
|
return setPosition(position.x(), position.y());
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Position::setPosition(signed x, signed y) -> type& {
|
auto Position::setPosition(float x, float y) -> type& {
|
||||||
state.x = x;
|
state.x = x;
|
||||||
state.y = y;
|
state.y = y;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Position::setX(signed x) -> type& {
|
auto Position::setX(float x) -> type& {
|
||||||
state.x = x;
|
state.x = x;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Position::setY(signed y) -> type& {
|
auto Position::setY(float y) -> type& {
|
||||||
state.y = y;
|
state.y = y;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Position::x() const -> signed {
|
auto Position::x() const -> float {
|
||||||
return state.x;
|
return state.x;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Position::y() const -> signed {
|
auto Position::y() const -> float {
|
||||||
return state.y;
|
return state.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -648,11 +648,13 @@ struct TableViewColumn : sTableViewColumn {
|
||||||
auto setEditable(bool editable = true) { return self().setEditable(editable), *this; }
|
auto setEditable(bool editable = true) { return self().setEditable(editable), *this; }
|
||||||
auto setExpandable(bool expandable = true) { return self().setExpandable(expandable), *this; }
|
auto setExpandable(bool expandable = true) { return self().setExpandable(expandable), *this; }
|
||||||
auto setForegroundColor(Color color = {}) { return self().setForegroundColor(color), *this; }
|
auto setForegroundColor(Color color = {}) { return self().setForegroundColor(color), *this; }
|
||||||
|
auto setHorizontalAlignment(float alignment = 0.0) { return self().setHorizontalAlignment(alignment), *this; }
|
||||||
auto setIcon(const image& icon = {}) { return self().setIcon(icon), *this; }
|
auto setIcon(const image& icon = {}) { return self().setIcon(icon), *this; }
|
||||||
auto setResizable(bool resizable = true) { return self().setResizable(resizable), *this; }
|
auto setResizable(bool resizable = true) { return self().setResizable(resizable), *this; }
|
||||||
auto setSortable(bool sortable = true) { return self().setSortable(sortable), *this; }
|
auto setSortable(bool sortable = true) { return self().setSortable(sortable), *this; }
|
||||||
auto setText(const string& text = "") { return self().setText(text), *this; }
|
auto setText(const string& text = "") { return self().setText(text), *this; }
|
||||||
auto setWidth(signed width = 0) { return self().setWidth(width), *this; }
|
auto setVerticalAlignment(float alignment = 0.5) { return self().setVerticalAlignment(alignment), *this; }
|
||||||
|
auto setWidth(float width = 0) { return self().setWidth(width), *this; }
|
||||||
auto sortable() const { return self().sortable(); }
|
auto sortable() const { return self().sortable(); }
|
||||||
auto text() const { return self().text(); }
|
auto text() const { return self().text(); }
|
||||||
auto verticalAlignment() const { return self().verticalAlignment(); }
|
auto verticalAlignment() const { return self().verticalAlignment(); }
|
||||||
|
|
|
@ -4,7 +4,7 @@ Size::Size() {
|
||||||
setSize(0, 0);
|
setSize(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Size::Size(signed width, signed height) {
|
Size::Size(float width, float height) {
|
||||||
setSize(width, height);
|
setSize(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ auto Size::operator!=(const Size& source) const -> bool {
|
||||||
return !operator==(source);
|
return !operator==(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Size::height() const -> signed {
|
auto Size::height() const -> float {
|
||||||
return state.height;
|
return state.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ auto Size::reset() -> type& {
|
||||||
return setSize(0, 0);
|
return setSize(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Size::setHeight(signed height) -> type& {
|
auto Size::setHeight(float height) -> type& {
|
||||||
state.height = height;
|
state.height = height;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@ -37,18 +37,18 @@ auto Size::setSize(Size size) -> type& {
|
||||||
return setSize(size.width(), size.height());
|
return setSize(size.width(), size.height());
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Size::setSize(signed width, signed height) -> type& {
|
auto Size::setSize(float width, float height) -> type& {
|
||||||
state.width = width;
|
state.width = width;
|
||||||
state.height = height;
|
state.height = height;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Size::setWidth(signed width) -> type& {
|
auto Size::setWidth(float width) -> type& {
|
||||||
state.width = width;
|
state.width = width;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Size::width() const -> signed {
|
auto Size::width() const -> float {
|
||||||
return state.width;
|
return state.width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ auto mTableViewColumn::foregroundColor() const -> Color {
|
||||||
return state.foregroundColor;
|
return state.foregroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto mTableViewColumn::horizontalAlignment() const -> double {
|
auto mTableViewColumn::horizontalAlignment() const -> float {
|
||||||
return state.horizontalAlignment;
|
return state.horizontalAlignment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ auto mTableViewColumn::setForegroundColor(Color color) -> type& {
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto mTableViewColumn::setHorizontalAlignment(double alignment) -> type& {
|
auto mTableViewColumn::setHorizontalAlignment(float alignment) -> type& {
|
||||||
alignment = max(0.0, min(1.0, alignment));
|
alignment = max(0.0, min(1.0, alignment));
|
||||||
state.horizontalAlignment = alignment;
|
state.horizontalAlignment = alignment;
|
||||||
signal(setHorizontalAlignment, alignment);
|
signal(setHorizontalAlignment, alignment);
|
||||||
|
@ -115,7 +115,7 @@ auto mTableViewColumn::setText(const string& text) -> type& {
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto mTableViewColumn::setVerticalAlignment(double alignment) -> type& {
|
auto mTableViewColumn::setVerticalAlignment(float alignment) -> type& {
|
||||||
alignment = max(0.0, min(1.0, alignment));
|
alignment = max(0.0, min(1.0, alignment));
|
||||||
state.verticalAlignment = alignment;
|
state.verticalAlignment = alignment;
|
||||||
signal(setVerticalAlignment, alignment);
|
signal(setVerticalAlignment, alignment);
|
||||||
|
@ -128,7 +128,7 @@ auto mTableViewColumn::setVisible(bool visible) -> type& {
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto mTableViewColumn::setWidth(signed width) -> type& {
|
auto mTableViewColumn::setWidth(float width) -> type& {
|
||||||
state.width = max(0, width);
|
state.width = max(0, width);
|
||||||
signal(setWidth, width);
|
signal(setWidth, width);
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -142,11 +142,11 @@ auto mTableViewColumn::text() const -> string {
|
||||||
return state.text;
|
return state.text;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto mTableViewColumn::verticalAlignment() const -> double {
|
auto mTableViewColumn::verticalAlignment() const -> float {
|
||||||
return state.verticalAlignment;
|
return state.verticalAlignment;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto mTableViewColumn::width() const -> signed {
|
auto mTableViewColumn::width() const -> float {
|
||||||
return state.width;
|
return state.width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ auto mFixedLayout::modify(sSizable sizable, Geometry geometry) -> type& {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto mFixedLayout::minimumSize() const -> Size {
|
auto mFixedLayout::minimumSize() const -> Size {
|
||||||
signed width = Size::Minimum, height = Size::Minimum;
|
float width = Size::Minimum, height = Size::Minimum;
|
||||||
for(auto n : range(sizableCount())) {
|
for(auto n : range(sizableCount())) {
|
||||||
width = max(width, sizable(n)->minimumSize().width());
|
width = max(width, sizable(n)->minimumSize().width());
|
||||||
height = max(height, sizable(n)->minimumSize().height());
|
height = max(height, sizable(n)->minimumSize().height());
|
||||||
|
|
|
@ -14,10 +14,10 @@ struct mFixedLayout : mLayout {
|
||||||
auto setFont(const Font& font = {}) -> type& override;
|
auto setFont(const Font& font = {}) -> type& override;
|
||||||
auto setVisible(bool visible = true) ->type& override;
|
auto setVisible(bool visible = true) ->type& override;
|
||||||
|
|
||||||
struct Properties {
|
struct Property {
|
||||||
Geometry geometry;
|
Geometry geometry;
|
||||||
};
|
};
|
||||||
vector<Properties> properties;
|
vector<Property> properties;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,41 +1,41 @@
|
||||||
#if defined(Hiro_HorizontalLayout)
|
#if defined(Hiro_HorizontalLayout)
|
||||||
|
|
||||||
auto mHorizontalLayout::append(sSizable sizable, Size size, signed spacing) -> type& {
|
auto mHorizontalLayout::append(sSizable sizable, Size size, float spacing) -> type& {
|
||||||
properties.append({size.width(), size.height(), spacing < 0 ? settings.spacing : spacing});
|
properties.append({size.width(), size.height(), spacing < 0 ? settings.spacing : spacing});
|
||||||
mLayout::append(sizable);
|
mLayout::append(sizable);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto mHorizontalLayout::modify(sSizable sizable, Size size, signed spacing) -> type& {
|
auto mHorizontalLayout::modify(sSizable sizable, Size size, float spacing) -> type& {
|
||||||
if(sizable && this->sizable(sizable->offset()) == sizable) {
|
if(sizable && this->sizable(sizable->offset()) == sizable) {
|
||||||
auto& properties = this->properties[sizable->offset()];
|
auto& properties = this->properties[sizable->offset()];
|
||||||
properties.width = size.width();
|
properties.setWidth(size.width());
|
||||||
properties.height = size.height();
|
properties.setHeight(size.height());
|
||||||
properties.spacing = spacing;
|
properties.setSpacing(spacing);
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto mHorizontalLayout::minimumSize() const -> Size {
|
auto mHorizontalLayout::minimumSize() const -> Size {
|
||||||
signed width = 0, height = 0;
|
float width = 0, height = 0;
|
||||||
|
|
||||||
for(auto n : range(sizableCount())) {
|
for(auto n : range(sizableCount())) {
|
||||||
auto& child = properties[sizable(n)->offset()];
|
auto& child = properties[sizable(n)->offset()];
|
||||||
if(child.width == Size::Minimum || child.width == Size::Maximum) {
|
if(child.width() == Size::Minimum || child.width() == Size::Maximum) {
|
||||||
width += sizable(n)->minimumSize().width();
|
width += sizable(n)->minimumSize().width();
|
||||||
} else {
|
} else {
|
||||||
width += child.width;
|
width += child.width();
|
||||||
}
|
}
|
||||||
if(&child != &properties.right()) width += child.spacing;
|
if(&child != &properties.right()) width += child.spacing();
|
||||||
}
|
}
|
||||||
|
|
||||||
for(auto n : range(sizableCount())) {
|
for(auto n : range(sizableCount())) {
|
||||||
auto& child = properties[sizable(n)->offset()];
|
auto& child = properties[sizable(n)->offset()];
|
||||||
if(child.height == Size::Minimum || child.height == Size::Maximum) {
|
if(child.height() == Size::Minimum || child.height() == Size::Maximum) {
|
||||||
height = max(height, sizable(n)->minimumSize().height());
|
height = max(height, sizable(n)->minimumSize().height());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
height = max(height, child.height);
|
height = max(height, child.height());
|
||||||
}
|
}
|
||||||
|
|
||||||
return {settings.margin * 2 + width, settings.margin * 2 + height};
|
return {settings.margin * 2 + width, settings.margin * 2 + height};
|
||||||
|
@ -53,7 +53,7 @@ auto mHorizontalLayout::reset() -> type& {
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto mHorizontalLayout::setAlignment(double alignment) -> type& {
|
auto mHorizontalLayout::setAlignment(float alignment) -> type& {
|
||||||
settings.alignment = max(0.0, min(1.0, alignment));
|
settings.alignment = max(0.0, min(1.0, alignment));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@ -80,8 +80,8 @@ auto mHorizontalLayout::setGeometry(Geometry containerGeometry) -> type& {
|
||||||
auto properties = this->properties;
|
auto properties = this->properties;
|
||||||
for(auto n : range(sizableCount())) {
|
for(auto n : range(sizableCount())) {
|
||||||
auto& child = properties[sizable(n)->offset()];
|
auto& child = properties[sizable(n)->offset()];
|
||||||
if(child.width == Size::Minimum) child.width = sizable(n)->minimumSize().width();
|
if(child.width() == Size::Minimum) child.setWidth(sizable(n)->minimumSize().width());
|
||||||
if(child.height == Size::Minimum) child.height = sizable(n)->minimumSize().height();
|
if(child.height() == Size::Minimum) child.setHeight(sizable(n)->minimumSize().height());
|
||||||
}
|
}
|
||||||
|
|
||||||
Geometry geometry = containerGeometry;
|
Geometry geometry = containerGeometry;
|
||||||
|
@ -90,42 +90,42 @@ auto mHorizontalLayout::setGeometry(Geometry containerGeometry) -> type& {
|
||||||
geometry.setWidth (geometry.width() - settings.margin * 2);
|
geometry.setWidth (geometry.width() - settings.margin * 2);
|
||||||
geometry.setHeight(geometry.height() - settings.margin * 2);
|
geometry.setHeight(geometry.height() - settings.margin * 2);
|
||||||
|
|
||||||
signed minimumWidth = 0, maximumWidthCounter = 0;
|
float minimumWidth = 0, maximumWidthCounter = 0;
|
||||||
for(auto& child : properties) {
|
for(auto& child : properties) {
|
||||||
if(child.width == Size::Maximum) maximumWidthCounter++;
|
if(child.width() == Size::Maximum) maximumWidthCounter++;
|
||||||
if(child.width != Size::Maximum) minimumWidth += child.width;
|
if(child.width() != Size::Maximum) minimumWidth += child.width();
|
||||||
if(&child != &properties.right()) minimumWidth += child.spacing;
|
if(&child != &properties.right()) minimumWidth += child.spacing();
|
||||||
}
|
}
|
||||||
|
|
||||||
for(auto& child : properties) {
|
for(auto& child : properties) {
|
||||||
if(child.width == Size::Maximum) child.width = (geometry.width() - minimumWidth) / maximumWidthCounter;
|
if(child.width() == Size::Maximum) child.setWidth((geometry.width() - minimumWidth) / maximumWidthCounter);
|
||||||
if(child.height == Size::Maximum) child.height = geometry.height();
|
if(child.height() == Size::Maximum) child.setHeight(geometry.height());
|
||||||
}
|
}
|
||||||
|
|
||||||
signed maximumHeight = 0;
|
float maximumHeight = 0;
|
||||||
for(auto& child : properties) maximumHeight = max(maximumHeight, child.height);
|
for(auto& child : properties) maximumHeight = max(maximumHeight, child.height());
|
||||||
|
|
||||||
for(auto n : range(sizableCount())) {
|
for(auto n : range(sizableCount())) {
|
||||||
auto& child = properties[sizable(n)->offset()];
|
auto& child = properties[sizable(n)->offset()];
|
||||||
signed pivot = (maximumHeight - child.height) * settings.alignment;
|
float pivot = (maximumHeight - child.height()) * settings.alignment;
|
||||||
Geometry childGeometry = {geometry.x(), geometry.y() + pivot, child.width, child.height};
|
Geometry childGeometry = {geometry.x(), geometry.y() + pivot, child.width(), child.height()};
|
||||||
if(childGeometry.width() < 1) childGeometry.setWidth (1);
|
if(childGeometry.width() < 1) childGeometry.setWidth (1);
|
||||||
if(childGeometry.height() < 1) childGeometry.setHeight(1);
|
if(childGeometry.height() < 1) childGeometry.setHeight(1);
|
||||||
sizable(n)->setGeometry(childGeometry);
|
sizable(n)->setGeometry(childGeometry);
|
||||||
|
|
||||||
geometry.setX (geometry.x() + child.width + child.spacing);
|
geometry.setX (geometry.x() + child.width() + child.spacing());
|
||||||
geometry.setWidth(geometry.width() - child.width + child.spacing);
|
geometry.setWidth(geometry.width() - child.width() + child.spacing());
|
||||||
}
|
}
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto mHorizontalLayout::setMargin(signed margin) -> type& {
|
auto mHorizontalLayout::setMargin(float margin) -> type& {
|
||||||
settings.margin = margin;
|
settings.margin = margin;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto mHorizontalLayout::setSpacing(signed spacing) -> type& {
|
auto mHorizontalLayout::setSpacing(float spacing) -> type& {
|
||||||
settings.spacing = spacing;
|
settings.spacing = spacing;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,29 +5,31 @@ struct mHorizontalLayout : mLayout {
|
||||||
using mLayout::append;
|
using mLayout::append;
|
||||||
using mLayout::remove;
|
using mLayout::remove;
|
||||||
|
|
||||||
auto append(sSizable sizable, Size size, signed spacing = 5) -> type&;
|
auto append(sSizable sizable, Size size, float spacing = 5) -> type&;
|
||||||
auto minimumSize() const -> Size override;
|
auto minimumSize() const -> Size override;
|
||||||
auto modify(sSizable sizable, Size size, signed spacing = 5) -> type&;
|
auto modify(sSizable sizable, Size size, float spacing = 5) -> type&;
|
||||||
auto remove(sSizable sizable) -> type& override;
|
auto remove(sSizable sizable) -> type& override;
|
||||||
auto reset() -> type& override;
|
auto reset() -> type& override;
|
||||||
auto setAlignment(double alignment = 0.5) -> type&;
|
auto setAlignment(float alignment = 0.5) -> type&;
|
||||||
auto setEnabled(bool enabled = true) -> type& override;
|
auto setEnabled(bool enabled = true) -> type& override;
|
||||||
auto setFont(const Font& font = {}) -> type& override;
|
auto setFont(const Font& font = {}) -> type& override;
|
||||||
auto setGeometry(Geometry geometry) -> type& override;
|
auto setGeometry(Geometry geometry) -> type& override;
|
||||||
auto setMargin(signed margin = 0) -> type&;
|
auto setMargin(float margin = 0) -> type&;
|
||||||
auto setSpacing(signed spacing = 5) -> type&;
|
auto setSpacing(float spacing = 5) -> type&;
|
||||||
auto setVisible(bool visible = true) -> type&;
|
auto setVisible(bool visible = true) -> type&;
|
||||||
|
|
||||||
struct Settings {
|
struct Settings {
|
||||||
double alignment = 0.5;
|
float alignment = 0.5;
|
||||||
signed margin = 0;
|
float margin = 0;
|
||||||
signed spacing = 5;
|
float spacing = 5;
|
||||||
} settings;
|
} settings;
|
||||||
|
|
||||||
struct Property {
|
struct Property : Size {
|
||||||
signed width;
|
Property() = default;
|
||||||
signed height;
|
Property(float width, float height, float spacing) : Size(width, height), _spacing(spacing) {}
|
||||||
signed spacing;
|
auto setSpacing(float spacing) -> Property& { return _spacing = spacing, *this; }
|
||||||
|
auto spacing() const -> float { return _spacing; }
|
||||||
|
float _spacing = 0;
|
||||||
};
|
};
|
||||||
vector<Property> properties;
|
vector<Property> properties;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,41 +1,41 @@
|
||||||
#if defined(Hiro_VerticalLayout)
|
#if defined(Hiro_VerticalLayout)
|
||||||
|
|
||||||
auto mVerticalLayout::append(sSizable sizable, Size size, signed spacing) -> type& {
|
auto mVerticalLayout::append(sSizable sizable, Size size, float spacing) -> type& {
|
||||||
properties.append({size.width(), size.height(), spacing < 0 ? settings.spacing : spacing});
|
properties.append({size.width(), size.height(), spacing < 0 ? settings.spacing : spacing});
|
||||||
mLayout::append(sizable);
|
mLayout::append(sizable);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto mVerticalLayout::modify(sSizable sizable, Size size, signed spacing) -> type& {
|
auto mVerticalLayout::modify(sSizable sizable, Size size, float spacing) -> type& {
|
||||||
if(sizable && this->sizable(sizable->offset()) == sizable) {
|
if(sizable && this->sizable(sizable->offset()) == sizable) {
|
||||||
auto& properties = this->properties[sizable->offset()];
|
auto& properties = this->properties[sizable->offset()];
|
||||||
properties.width = size.width();
|
properties.setWidth(size.width());
|
||||||
properties.height = size.height();
|
properties.setHeight(size.height());
|
||||||
properties.spacing = spacing;
|
properties.setSpacing(spacing);
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto mVerticalLayout::minimumSize() const -> Size {
|
auto mVerticalLayout::minimumSize() const -> Size {
|
||||||
signed width = 0, height = 0;
|
float width = 0, height = 0;
|
||||||
|
|
||||||
for(auto n : range(sizableCount())) {
|
for(auto n : range(sizableCount())) {
|
||||||
auto& child = properties[sizable(n)->offset()];
|
auto& child = properties[sizable(n)->offset()];
|
||||||
if(child.width == Size::Minimum || child.width == Size::Maximum) {
|
if(child.width() == Size::Minimum || child.width() == Size::Maximum) {
|
||||||
width = max(width, sizable(n)->minimumSize().width());
|
width = max(width, sizable(n)->minimumSize().width());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
width = max(width, child.width);
|
width = max(width, child.width());
|
||||||
}
|
}
|
||||||
|
|
||||||
for(auto n : range(sizableCount())) {
|
for(auto n : range(sizableCount())) {
|
||||||
auto& child = properties[sizable(n)->offset()];
|
auto& child = properties[sizable(n)->offset()];
|
||||||
if(child.height == Size::Minimum || child.height == Size::Maximum) {
|
if(child.height() == Size::Minimum || child.height() == Size::Maximum) {
|
||||||
height += sizable(n)->minimumSize().height();
|
height += sizable(n)->minimumSize().height();
|
||||||
} else {
|
} else {
|
||||||
height += child.height;
|
height += child.height();
|
||||||
}
|
}
|
||||||
if(&child != &properties.right()) height += child.spacing;
|
if(&child != &properties.right()) height += child.spacing();
|
||||||
}
|
}
|
||||||
|
|
||||||
return {settings.margin * 2 + width, settings.margin * 2 + height};
|
return {settings.margin * 2 + width, settings.margin * 2 + height};
|
||||||
|
@ -53,7 +53,7 @@ auto mVerticalLayout::reset() -> type& {
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto mVerticalLayout::setAlignment(double alignment) -> type& {
|
auto mVerticalLayout::setAlignment(float alignment) -> type& {
|
||||||
settings.alignment = max(0.0, min(1.0, alignment));
|
settings.alignment = max(0.0, min(1.0, alignment));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@ -80,8 +80,8 @@ auto mVerticalLayout::setGeometry(Geometry containerGeometry) -> type& {
|
||||||
auto properties = this->properties;
|
auto properties = this->properties;
|
||||||
for(auto n : range(sizableCount())) {
|
for(auto n : range(sizableCount())) {
|
||||||
auto& child = properties[sizable(n)->offset()];
|
auto& child = properties[sizable(n)->offset()];
|
||||||
if(child.width == Size::Minimum) child.width = sizable(n)->minimumSize().width();
|
if(child.width() == Size::Minimum) child.setWidth(sizable(n)->minimumSize().width());
|
||||||
if(child.height == Size::Minimum) child.height = sizable(n)->minimumSize().height();
|
if(child.height() == Size::Minimum) child.setHeight(sizable(n)->minimumSize().height());
|
||||||
}
|
}
|
||||||
|
|
||||||
Geometry geometry = containerGeometry;
|
Geometry geometry = containerGeometry;
|
||||||
|
@ -90,42 +90,42 @@ auto mVerticalLayout::setGeometry(Geometry containerGeometry) -> type& {
|
||||||
geometry.setWidth (geometry.width() - settings.margin * 2);
|
geometry.setWidth (geometry.width() - settings.margin * 2);
|
||||||
geometry.setHeight(geometry.height() - settings.margin * 2);
|
geometry.setHeight(geometry.height() - settings.margin * 2);
|
||||||
|
|
||||||
signed minimumHeight = 0, maximumHeightCounter = 0;
|
float minimumHeight = 0, maximumHeightCounter = 0;
|
||||||
for(auto& child : properties) {
|
for(auto& child : properties) {
|
||||||
if(child.height == Size::Maximum) maximumHeightCounter++;
|
if(child.height() == Size::Maximum) maximumHeightCounter++;
|
||||||
if(child.height != Size::Maximum) minimumHeight += child.height;
|
if(child.height() != Size::Maximum) minimumHeight += child.height();
|
||||||
if(&child != &properties.right()) minimumHeight += child.spacing;
|
if(&child != &properties.right()) minimumHeight += child.spacing();
|
||||||
}
|
}
|
||||||
|
|
||||||
for(auto& child : properties) {
|
for(auto& child : properties) {
|
||||||
if(child.width == Size::Maximum) child.width = geometry.width();
|
if(child.width() == Size::Maximum) child.setWidth(geometry.width());
|
||||||
if(child.height == Size::Maximum) child.height = (geometry.height() - minimumHeight) / maximumHeightCounter;
|
if(child.height() == Size::Maximum) child.setHeight((geometry.height() - minimumHeight) / maximumHeightCounter);
|
||||||
}
|
}
|
||||||
|
|
||||||
signed maximumWidth = 0;
|
float maximumWidth = 0;
|
||||||
for(auto& child : properties) maximumWidth = max(maximumWidth, child.width);
|
for(auto& child : properties) maximumWidth = max(maximumWidth, child.width());
|
||||||
|
|
||||||
for(auto n : range(sizableCount())) {
|
for(auto n : range(sizableCount())) {
|
||||||
auto& child = properties[sizable(n)->offset()];
|
auto& child = properties[sizable(n)->offset()];
|
||||||
signed pivot = (maximumWidth - child.width) * settings.alignment;
|
float pivot = (maximumWidth - child.width()) * settings.alignment;
|
||||||
Geometry childGeometry = {geometry.x() + pivot, geometry.y(), child.width, child.height};
|
Geometry childGeometry = {geometry.x() + pivot, geometry.y(), child.width(), child.height()};
|
||||||
if(childGeometry.width() < 1) childGeometry.setWidth (1);
|
if(childGeometry.width() < 1) childGeometry.setWidth (1);
|
||||||
if(childGeometry.height() < 1) childGeometry.setHeight(1);
|
if(childGeometry.height() < 1) childGeometry.setHeight(1);
|
||||||
sizable(n)->setGeometry(childGeometry);
|
sizable(n)->setGeometry(childGeometry);
|
||||||
|
|
||||||
geometry.setY (geometry.y() + child.height + child.spacing);
|
geometry.setY (geometry.y() + child.height() + child.spacing());
|
||||||
geometry.setHeight(geometry.height() - child.height + child.spacing);
|
geometry.setHeight(geometry.height() - child.height() + child.spacing());
|
||||||
}
|
}
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto mVerticalLayout::setMargin(signed margin) -> type& {
|
auto mVerticalLayout::setMargin(float margin) -> type& {
|
||||||
settings.margin = margin;
|
settings.margin = margin;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto mVerticalLayout::setSpacing(signed spacing) -> type& {
|
auto mVerticalLayout::setSpacing(float spacing) -> type& {
|
||||||
settings.spacing = spacing;
|
settings.spacing = spacing;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,31 +5,33 @@ struct mVerticalLayout : mLayout {
|
||||||
using mLayout::append;
|
using mLayout::append;
|
||||||
using mLayout::remove;
|
using mLayout::remove;
|
||||||
|
|
||||||
auto append(sSizable sizable, Size size, signed spacing = 5) -> type&;
|
auto append(sSizable sizable, Size size, float spacing = 5) -> type&;
|
||||||
auto modify(sSizable sizable, Size size, signed spacing = 5) -> type&;
|
auto modify(sSizable sizable, Size size, float spacing = 5) -> type&;
|
||||||
auto minimumSize() const -> Size override;
|
auto minimumSize() const -> Size override;
|
||||||
auto remove(sSizable sizable) -> type& override;
|
auto remove(sSizable sizable) -> type& override;
|
||||||
auto reset() -> type& override;
|
auto reset() -> type& override;
|
||||||
auto setAlignment(double alignment = 0.0) -> type&;
|
auto setAlignment(float alignment = 0.0) -> type&;
|
||||||
auto setEnabled(bool enabled = true) -> type& override;
|
auto setEnabled(bool enabled = true) -> type& override;
|
||||||
auto setFont(const Font& font = {}) -> type& override;
|
auto setFont(const Font& font = {}) -> type& override;
|
||||||
auto setGeometry(Geometry geometry) -> type& override;
|
auto setGeometry(Geometry geometry) -> type& override;
|
||||||
auto setMargin(signed margin = 0) -> type&;
|
auto setMargin(float margin = 0) -> type&;
|
||||||
auto setSpacing(signed spacing = 5) -> type&;
|
auto setSpacing(float spacing = 5) -> type&;
|
||||||
auto setVisible(bool visible = true) -> type& override;
|
auto setVisible(bool visible = true) -> type& override;
|
||||||
|
|
||||||
struct Settings {
|
struct Settings {
|
||||||
double alignment = 0.0;
|
float alignment = 0.0;
|
||||||
signed margin = 0;
|
float margin = 0;
|
||||||
signed spacing = 5;
|
float spacing = 5;
|
||||||
} settings;
|
} settings;
|
||||||
|
|
||||||
struct Properties {
|
struct Property : Size {
|
||||||
signed width;
|
Property() = default;
|
||||||
signed height;
|
Property(float width, float height, float spacing) : Size(width, height), _spacing(spacing) {}
|
||||||
signed spacing;
|
auto setSpacing(float spacing) -> Property& { return _spacing = spacing, *this; }
|
||||||
|
auto spacing() const -> float { return _spacing; }
|
||||||
|
float _spacing = 0;
|
||||||
};
|
};
|
||||||
vector<Properties> properties;
|
vector<Property> properties;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -6,6 +6,12 @@ auto pMonitor::count() -> uint {
|
||||||
return gdk_screen_get_n_monitors(gdk_screen_get_default());
|
return gdk_screen_get_n_monitors(gdk_screen_get_default());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto pMonitor::dpi(uint monitor) -> Position {
|
||||||
|
//GTK+ does not support either per-monitor or per-axis DPI reporting
|
||||||
|
float dpi = round(gdk_screen_get_resolution(gdk_screen_get_default()));
|
||||||
|
return {dpi, dpi};
|
||||||
|
}
|
||||||
|
|
||||||
auto pMonitor::geometry(uint monitor) -> Geometry {
|
auto pMonitor::geometry(uint monitor) -> Geometry {
|
||||||
GdkRectangle rectangle = {0};
|
GdkRectangle rectangle = {0};
|
||||||
gdk_screen_get_monitor_geometry(gdk_screen_get_default(), monitor, &rectangle);
|
gdk_screen_get_monitor_geometry(gdk_screen_get_default(), monitor, &rectangle);
|
||||||
|
|
|
@ -4,7 +4,8 @@ namespace hiro {
|
||||||
|
|
||||||
struct pMonitor {
|
struct pMonitor {
|
||||||
static auto count() -> uint;
|
static auto count() -> uint;
|
||||||
static auto geometry(unsigned monitor) -> Geometry;
|
static auto dpi(uint monitor) -> Position;
|
||||||
|
static auto geometry(uint monitor) -> Geometry;
|
||||||
static auto primary() -> uint;
|
static auto primary() -> uint;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2,16 +2,24 @@
|
||||||
|
|
||||||
namespace hiro {
|
namespace hiro {
|
||||||
|
|
||||||
auto pMonitor::count() -> unsigned {
|
auto pMonitor::count() -> uint {
|
||||||
return QApplication::desktop()->screenCount();
|
return QApplication::desktop()->screenCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto pMonitor::geometry(unsigned monitor) -> Geometry {
|
auto pMonitor::dpi(uint monitor) -> Position {
|
||||||
|
//Qt does not support per-monitor DPI retrieval
|
||||||
|
return {
|
||||||
|
QApplication::desktop()->logicalDpiX(),
|
||||||
|
QApplication::desktop()->logicalDpiY()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
auto pMonitor::geometry(uint monitor) -> Geometry {
|
||||||
QRect rectangle = QApplication::desktop()->screenGeometry(monitor);
|
QRect rectangle = QApplication::desktop()->screenGeometry(monitor);
|
||||||
return {rectangle.x(), rectangle.y(), rectangle.width(), rectangle.height()};
|
return {rectangle.x(), rectangle.y(), rectangle.width(), rectangle.height()};
|
||||||
}
|
}
|
||||||
|
|
||||||
auto pMonitor::primary() -> unsigned {
|
auto pMonitor::primary() -> uint {
|
||||||
return QApplication::desktop()->primaryScreen();
|
return QApplication::desktop()->primaryScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,10 @@
|
||||||
namespace hiro {
|
namespace hiro {
|
||||||
|
|
||||||
struct pMonitor {
|
struct pMonitor {
|
||||||
static auto count() -> unsigned;
|
static auto count() -> uint;
|
||||||
static auto geometry(unsigned monitor) -> Geometry;
|
static auto dpi(uint monitor) -> Position;
|
||||||
static auto primary() -> unsigned;
|
static auto geometry(uint monitor) -> Geometry;
|
||||||
|
static auto primary() -> uint;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,42 +3,53 @@
|
||||||
namespace hiro {
|
namespace hiro {
|
||||||
|
|
||||||
struct MonitorInfo {
|
struct MonitorInfo {
|
||||||
unsigned monitor = 0;
|
uint monitor = 0;
|
||||||
unsigned primary = 0;
|
uint primary = 0;
|
||||||
unsigned index = 0;
|
float dpiX = 0;
|
||||||
|
float dpiY = 0;
|
||||||
Geometry geometry;
|
Geometry geometry;
|
||||||
|
uint index = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
static auto CALLBACK MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) -> BOOL {
|
static auto CALLBACK MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) -> BOOL {
|
||||||
MonitorInfo& info = *(MonitorInfo*)dwData;
|
MonitorInfo& info = *(MonitorInfo*)dwData;
|
||||||
MONITORINFOEX mi;
|
MONITORINFOEX mi{sizeof(MONITORINFOEX)};
|
||||||
memset(&mi, 0, sizeof(MONITORINFOEX));
|
|
||||||
mi.cbSize = sizeof(MONITORINFOEX);
|
|
||||||
GetMonitorInfo(hMonitor, &mi);
|
GetMonitorInfo(hMonitor, &mi);
|
||||||
string displayName = (const char*)utf8_t(mi.szDevice);
|
string displayName = (const char*)utf8_t(mi.szDevice);
|
||||||
if(displayName.beginsWith(R"(\\.\DISPLAYV)")) return TRUE; //ignore pseudo-monitors
|
if(displayName.beginsWith(R"(\\.\DISPLAYV)")) return true; //ignore pseudo-monitors
|
||||||
if(mi.dwFlags & MONITORINFOF_PRIMARY) info.primary = info.index;
|
if(mi.dwFlags & MONITORINFOF_PRIMARY) info.primary = info.index;
|
||||||
if(info.monitor == info.index) {
|
if(info.monitor == info.index) {
|
||||||
|
UINT dpiX = 0, dpiY = 0;
|
||||||
|
GetDpiForMonitor(hMonitor, MDT_EFFECTIVE_DPI, &dpiX, &dpiY);
|
||||||
|
info.dpiX = dpiX;
|
||||||
|
info.dpiY = dpiY;
|
||||||
info.geometry = {lprcMonitor->left, lprcMonitor->top, lprcMonitor->right - lprcMonitor->left, lprcMonitor->bottom - lprcMonitor->top};
|
info.geometry = {lprcMonitor->left, lprcMonitor->top, lprcMonitor->right - lprcMonitor->left, lprcMonitor->bottom - lprcMonitor->top};
|
||||||
}
|
}
|
||||||
info.index++;
|
info.index++;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto pMonitor::count() -> unsigned {
|
auto pMonitor::count() -> uint {
|
||||||
return GetSystemMetrics(SM_CMONITORS);
|
return GetSystemMetrics(SM_CMONITORS);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto pMonitor::geometry(unsigned monitor) -> Geometry {
|
auto pMonitor::dpi(uint monitor) -> Position {
|
||||||
MonitorInfo info;
|
MonitorInfo info;
|
||||||
info.monitor = monitor;
|
info.monitor = monitor;
|
||||||
EnumDisplayMonitors(NULL, NULL, MonitorEnumProc, (LPARAM)&info);
|
EnumDisplayMonitors(nullptr, nullptr, MonitorEnumProc, (LPARAM)&info);
|
||||||
|
return {info.dpiX, info.dpiY};
|
||||||
|
}
|
||||||
|
|
||||||
|
auto pMonitor::geometry(uint monitor) -> Geometry {
|
||||||
|
MonitorInfo info;
|
||||||
|
info.monitor = monitor;
|
||||||
|
EnumDisplayMonitors(nullptr, nullptr, MonitorEnumProc, (LPARAM)&info);
|
||||||
return info.geometry;
|
return info.geometry;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto pMonitor::primary() -> unsigned {
|
auto pMonitor::primary() -> uint {
|
||||||
MonitorInfo info;
|
MonitorInfo info;
|
||||||
EnumDisplayMonitors(NULL, NULL, MonitorEnumProc, (LPARAM)&info);
|
EnumDisplayMonitors(nullptr, nullptr, MonitorEnumProc, (LPARAM)&info);
|
||||||
return info.primary;
|
return info.primary;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,10 @@
|
||||||
namespace hiro {
|
namespace hiro {
|
||||||
|
|
||||||
struct pMonitor {
|
struct pMonitor {
|
||||||
static auto count() -> unsigned;
|
static auto count() -> uint;
|
||||||
static auto geometry(unsigned monitor) -> Geometry;
|
static auto dpi(uint monitor) -> Position;
|
||||||
static auto primary() -> unsigned;
|
static auto geometry(uint monitor) -> Geometry;
|
||||||
|
static auto primary() -> uint;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
build := release
|
build := optimize
|
||||||
include ../nall/GNUmakefile
|
include ../nall/GNUmakefile
|
||||||
include ../hiro/GNUmakefile
|
include ../hiro/GNUmakefile
|
||||||
|
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>org.byuu.icarus</string>
|
|
||||||
<key>CFBundleDisplayName</key>
|
|
||||||
<string>icarus</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>icarus</string>
|
|
||||||
<!--
|
|
||||||
<key>CFBundleIconFile</key>
|
|
||||||
<string>icarus.icns</string>
|
|
||||||
-->
|
|
||||||
<key>NSHighResolutionCapable</key>
|
|
||||||
<true/>
|
|
||||||
<key>NSSupportsAutomaticGraphicsSwitching</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
|
@ -60,8 +60,10 @@ ifeq ($(compiler),)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# build settings
|
# build settings
|
||||||
ifeq ($(build),release)
|
ifeq ($(build),optimize)
|
||||||
flags += -O3
|
flags += -O3
|
||||||
|
else ifeq ($(build),release)
|
||||||
|
flags += -O2
|
||||||
else ifeq ($(build),stable)
|
else ifeq ($(build),stable)
|
||||||
flags += -O1
|
flags += -O1
|
||||||
else ifeq ($(build),debug)
|
else ifeq ($(build),debug)
|
||||||
|
|
Loading…
Reference in New Issue