24#include <nlohmann/json.hpp>
27#include <wx/aui/framemanager.h>
30void to_json( nlohmann::json& aJson,
const wxPoint& aPoint )
32 aJson = nlohmann::json
40void from_json(
const nlohmann::json& aJson, wxPoint& aPoint )
42 aPoint.x = aJson.at(
"x" ).get<
int>();
43 aPoint.y = aJson.at(
"y" ).get<
int>();
47bool operator<(
const wxPoint& aLhs,
const wxPoint& aRhs )
49 int xDelta = aLhs.x - aRhs.x;
54 if( ( xDelta == 0 ) && (aLhs.y < aRhs.y ) )
61void to_json( nlohmann::json& aJson,
const wxSize& aSize )
63 aJson = nlohmann::json
71void from_json(
const nlohmann::json& aJson, wxSize& aSize )
73 aSize.SetWidth( aJson.at(
"width" ).get<
int>() );
74 aSize.SetHeight( aJson.at(
"height" ).get<
int>() );
78bool operator<(
const wxSize& aLhs,
const wxSize& aRhs )
80 int xDelta = aLhs.x - aRhs.x;
85 if( ( xDelta == 0 ) && (aLhs.y < aRhs.y ) )
92void to_json( nlohmann::json& aJson,
const wxRect& aRect )
94 aJson = nlohmann::json
96 {
"position", aRect.GetPosition() },
97 {
"size", aRect.GetSize() }
102void from_json(
const nlohmann::json& aJson, wxRect& aRect )
104 aRect.SetPosition( aJson.at(
"position" ).get<wxPoint>() );
105 aRect.SetSize( aJson.at(
"size" ).get<wxSize>() );
111 if( aLhs.GetSize() < aRhs.GetSize() )
114 if( aLhs.GetPosition() < aRhs.GetPosition() )
121void to_json( nlohmann::json& aJson,
const wxAuiPaneInfo& aPaneInfo )
123 aJson = nlohmann::json
125 {
"name", aPaneInfo.name },
126 {
"caption", aPaneInfo.caption },
127 {
"state", aPaneInfo.state },
128 {
"dock_direction", aPaneInfo.dock_direction },
129 {
"dock_layer", aPaneInfo.dock_layer },
130 {
"dock_row", aPaneInfo.dock_row },
131 {
"dock_pos", aPaneInfo.dock_pos },
132 {
"dock_proportion", aPaneInfo.dock_proportion },
133 {
"best_size", aPaneInfo.best_size },
134 {
"min_size", aPaneInfo.min_size },
135 {
"max_size", aPaneInfo.max_size },
136 {
"floating_pos", aPaneInfo.floating_pos },
137 {
"floating_size", aPaneInfo.floating_size },
138 {
"rect", aPaneInfo.rect }
143void from_json(
const nlohmann::json& aJson, wxAuiPaneInfo& aPaneInfo )
145 aPaneInfo.name = aJson.at(
"name" ).get<wxString>();
146 aPaneInfo.caption = aJson.at(
"caption" ).get<wxString>();
147 aPaneInfo.state = aJson.at(
"state" ).get<
int>();
148 aPaneInfo.dock_direction = aJson.at(
"dock_direction" ).get<
unsigned int>();
149 aPaneInfo.dock_layer = aJson.at(
"dock_layer" ).get<
int>();
150 aPaneInfo.dock_row = aJson.at(
"dock_row" ).get<
int>();
151 aPaneInfo.dock_pos = aJson.at(
"dock_pos" ).get<
int>();
152 aPaneInfo.dock_proportion = aJson.at(
"dock_proportion" ).get<
int>();
153 aPaneInfo.best_size = aJson.at(
"best_size" ).get<wxSize>();
154 aPaneInfo.min_size = aJson.at(
"min_size" ).get<wxSize>();
155 aPaneInfo.max_size = aJson.at(
"max_size" ).get<wxSize>();
156 aPaneInfo.floating_pos = aJson.at(
"floating_pos" ).get<wxPoint>();
157 aPaneInfo.floating_size = aJson.at(
"floating_size" ).get<wxSize>();
158 aPaneInfo.rect = aJson.at(
"rect" ).get<wxRect>();
162bool operator<(
const wxAuiPaneInfo& aLhs,
const wxAuiPaneInfo& aRhs )
164 if( aLhs.name < aRhs.name )
167 if( aLhs.caption < aRhs.caption )
170 if( aLhs.state < aRhs.state )
173 if( aLhs.dock_direction < aRhs.dock_direction )
176 if( aLhs.dock_layer < aRhs.dock_layer )
179 if( aLhs.dock_row < aRhs.dock_row )
182 if( aLhs.dock_pos < aRhs.dock_pos )
185 if( aLhs.dock_proportion < aRhs.dock_proportion )
188 if( aLhs.best_size < aRhs.best_size )
191 if( aLhs.min_size < aRhs.min_size )
194 if( aLhs.max_size < aRhs.max_size )
197 if( aLhs.floating_pos < aRhs.floating_pos )
200 if( aLhs.floating_size < aRhs.floating_size )
203 if( aLhs.rect < aRhs.rect )
210bool operator==(
const wxAuiPaneInfo& aLhs,
const wxAuiPaneInfo& aRhs )
212 if( aLhs.name != aRhs.name )
215 if( aLhs.caption != aRhs.caption )
218 if( aLhs.state != aRhs.state )
221 if( aLhs.dock_direction != aRhs.dock_direction )
224 if( aLhs.dock_layer != aRhs.dock_layer )
227 if( aLhs.dock_row != aRhs.dock_row )
230 if( aLhs.dock_pos != aRhs.dock_pos )
233 if( aLhs.dock_proportion != aRhs.dock_proportion )
236 if( aLhs.best_size != aRhs.best_size )
239 if( aLhs.min_size != aRhs.min_size )
242 if( aLhs.max_size != aRhs.max_size )
245 if( aLhs.floating_pos != aRhs.floating_pos )
248 if( aLhs.floating_size != aRhs.floating_size )
251 if( aLhs.rect != aRhs.rect )
void from_json(const nlohmann::json &aJson, wxPoint &aPoint)
bool operator==(const wxAuiPaneInfo &aLhs, const wxAuiPaneInfo &aRhs)
void to_json(nlohmann::json &aJson, const wxPoint &aPoint)
bool operator<(const wxPoint &aLhs, const wxPoint &aRhs)