diff options
author | Dan Gudmundsson <[email protected]> | 2015-09-16 11:49:14 +0200 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2015-09-16 11:49:14 +0200 |
commit | acc47d90e34e4552ffe99766da7ac95423db1e30 (patch) | |
tree | ba4b9838ac573456db2fe1b523b5bfa372888275 /lib/wx/api_gen | |
parent | e23ea97d7dce3c12f54f06cb90354a0b3a55d073 (diff) | |
parent | e7d0b4e0f19280daa03292214163880cd7337cb2 (diff) | |
download | otp-acc47d90e34e4552ffe99766da7ac95423db1e30.tar.gz otp-acc47d90e34e4552ffe99766da7ac95423db1e30.tar.bz2 otp-acc47d90e34e4552ffe99766da7ac95423db1e30.zip |
Merge branch 'dgud/wx/add-missing-aui-func/OTP-12961' into maint
* dgud/wx/add-missing-aui-func/OTP-12961:
wx: Fix wxAuiManager:getAllPanes/1
wx: Add missing aui functionality
Diffstat (limited to 'lib/wx/api_gen')
-rw-r--r-- | lib/wx/api_gen/Makefile | 2 | ||||
-rw-r--r-- | lib/wx/api_gen/wx_extra/added_func.h | 28 | ||||
-rw-r--r-- | lib/wx/api_gen/wx_gen.erl | 9 | ||||
-rw-r--r-- | lib/wx/api_gen/wx_gen_cpp.erl | 26 | ||||
-rw-r--r-- | lib/wx/api_gen/wxapi.conf | 54 |
5 files changed, 104 insertions, 15 deletions
diff --git a/lib/wx/api_gen/Makefile b/lib/wx/api_gen/Makefile index d605f3d8d8..3fa8f1feee 100644 --- a/lib/wx/api_gen/Makefile +++ b/lib/wx/api_gen/Makefile @@ -49,7 +49,7 @@ opt: $(WX) $(GL) $(WX): wxxml_generated $(COMPILER_T) wxapi.conf $(wildcard wx_extra/wx*.c_src) $(wildcard wx_extra/wx*.erl) erl -noshell -run wx_gen code && touch wx_code_generated -wxxml_generated: wx_doxygen.conf wx_extra/bugs.h wx_extra/wxe_evth.h +wxxml_generated: wx_doxygen.conf wx_extra/bugs.h wx_extra/wxe_evth.h wx_extra/added_func.h sed -e 's|@WXGTK_DIR@|$(WXGTK_DIR)|g' wx_doxygen.conf > wx_doxygen doxygen wx_doxygen && touch wxxml_generated diff --git a/lib/wx/api_gen/wx_extra/added_func.h b/lib/wx/api_gen/wx_extra/added_func.h new file mode 100644 index 0000000000..2323529368 --- /dev/null +++ b/lib/wx/api_gen/wx_extra/added_func.h @@ -0,0 +1,28 @@ +// Added 3.0 functionality + +class WXDLLIMPEXP_AUI wxAuiTabArt +{ +public: + virtual void SetColour(const wxColour& colour) = 0; + virtual void SetActiveColour(const wxColour& colour) = 0; +}; + +// Api to get data out of paneinfo +class WXDLLIMPEXP_AUI wxAuiPaneInfo +{ + public: + wxString GetName(); + wxString GetCaption(); + wxIcon GetIcon(); + + wxWindow* GetWindow(); + wxFrame* GetFrame(); + + int GetDirection(); + int GetLayer(); + int GetRow(); + int GetPosition(); + + wxPoint GetFloatingPosition(); + wxSize GetFloatingSize(); +}; diff --git a/lib/wx/api_gen/wx_gen.erl b/lib/wx/api_gen/wx_gen.erl index 114b3e561e..5cf09e5eee 100644 --- a/lib/wx/api_gen/wx_gen.erl +++ b/lib/wx/api_gen/wx_gen.erl @@ -771,14 +771,19 @@ parse_type2([N="wxGridCellCoordsArray"|R],Info,Opts,T) -> parse_type2(R,Info,Opts,T#type{name=N,base={comp,"wxGridCellCoords", [{int,"R"},{int,"C"}]}, single=array}); +parse_type2([N="wxAuiPaneInfoArray"|R],Info,Opts,T) -> + parse_type2(R,Info,Opts,T#type{name=N,base={class,"wxAuiPaneInfo"}, + single=array}); + parse_type2([N="wxRect"|R],Info,Opts,T) -> parse_type2(R,Info,Opts,T#type{name=N,base={comp,N,[{int,"X"},{int,"Y"}, {int,"W"},{int,"H"}]}}); parse_type2([N="wxColour"|R],Info,Opts,T) -> parse_type2(R,Info,Opts,T#type{name=N, base={comp,N,[{int,"R"},{int,"G"},{int,"B"},{int,"A"}]}}); -parse_type2([N="wxColor"|R],Info,Opts,T) -> - parse_type2(R,Info,Opts,T#type{name="wxColour", +parse_type2(["wxColor"|R],Info,Opts,T) -> + N = "wxColour", + parse_type2(R,Info,Opts,T#type{name=N, base={comp,N,[{int,"R"},{int,"G"},{int,"B"},{int,"A"}]}}); parse_type2([N="wxPoint2DDouble"|R],Info,Opts,T) -> diff --git a/lib/wx/api_gen/wx_gen_cpp.erl b/lib/wx/api_gen/wx_gen_cpp.erl index 2ce6295078..5649336b5d 100644 --- a/lib/wx/api_gen/wx_gen_cpp.erl +++ b/lib/wx/api_gen/wx_gen_cpp.erl @@ -235,7 +235,8 @@ gen_funcs(Defs) -> w("}} /* The End */~n~n~n"), UglySkipList = ["wxCaret", "wxCalendarDateAttr", - "wxFileDataObject", "wxTextDataObject", "wxBitmapDataObject" + "wxFileDataObject", "wxTextDataObject", "wxBitmapDataObject", + "wxAuiSimpleTabArt" ], w("bool WxeApp::delete_object(void *ptr, wxeRefData *refd) {~n", []), @@ -323,12 +324,8 @@ gen_method(CName, M=#method{name=N,params=Ps0,type=T,method_type=MT,id=MethodId put(current_func, N), put(bin_count,-1), ?WTC("gen_method"), - Endif = case lists:keysearch(deprecated, 1, FOpts) of - {value, {deprecated, IfDef}} -> - w("#if ~s~n", [IfDef]), - true; - _ -> false - end, + Endif1 = gen_if(deprecated, FOpts), + Endif2 = gen_if(test_if, FOpts), w("case ~s: { // ~s::~s~n", [wx_gen_erl:get_unique_name(MethodId),CName,N]), Ps1 = declare_variables(void, Ps0), {Ps2,Align} = decode_arguments(Ps1), @@ -347,10 +344,19 @@ gen_method(CName, M=#method{name=N,params=Ps0,type=T,method_type=MT,id=MethodId free_args(), build_return_vals(T,Ps3), w(" break;~n}~n", []), - Endif andalso w("#endif~n", []), + Endif1 andalso w("#endif~n", []), + Endif2 andalso w("#endif~n", []), erase(current_func), M. +gen_if(What, Opts) -> + case lists:keysearch(What, 1, Opts) of + {value, {What, IfDef}} -> + w("#if ~s~n", [IfDef]), + true; + _ -> false + end. + declare_variables(void,Ps) -> [declare_var(P) || P <- Ps]; declare_variables(T, Ps) -> @@ -1014,6 +1020,10 @@ build_ret(Name,_,#type{base={comp,_,_},single=array}) -> w(" for(unsigned int i=0; i < ~s.GetCount(); i++) {~n", [Name]), w(" rt.add(~s[i]);~n }~n",[Name]), w(" rt.endList(~s.GetCount());~n",[Name]); +build_ret(Name,_,#type{base={class,Class},single=array}) -> + w(" for(unsigned int i=0; i < ~s.GetCount(); i++) {~n", [Name]), + w(" rt.addRef(getRef((void *) &~s.Item(i), memenv), \"~s\");~n }~n",[Name, Class]), + w(" rt.endList(~s.GetCount());~n",[Name]); build_ret(Name,_,#type{name=List,single=list,base={class,Class}}) -> w(" int i=0;~n"), w(" for(~s::const_iterator it = ~s.begin(); it != ~s.end(); ++it) {~n", diff --git a/lib/wx/api_gen/wxapi.conf b/lib/wx/api_gen/wxapi.conf index 0d1fef6272..f076323bea 100644 --- a/lib/wx/api_gen/wxapi.conf +++ b/lib/wx/api_gen/wxapi.conf @@ -1246,7 +1246,8 @@ 'SetArtProvider','SetDockSizeConstraint','SetFlags','SetManagedWindow', 'ShowHint','UnInit','Update']}. -{class, wxAuiPaneInfo, root, [{ifdef, wxUSE_AUI}], +{class, wxAuiPaneInfo, root, + [{ifdef, wxUSE_AUI}], [ wxAuiPaneInfo,'~wxAuiPaneInfo', 'BestSize','Bottom','BottomDockable','Caption','CaptionVisible', @@ -1263,7 +1264,44 @@ 'MinSize','MinimizeButton','Movable','Name', 'PaneBorder','PinButton','Position','Resizable','Right', 'RightDockable','Row','SafeSet','SetFlag','Show','ToolbarPane', - 'Top','TopDockable','Window']}. + 'Top','TopDockable','Window', + %% Extended func + %% These are not initilized by default and thus cause crashes + %% {'GetName', + %% [{pre_hook, [{c, "#if 0\n"}]}, + %% {post_hook, [{c, "#endif\n if(!This) throw wxe_badarg(0);\n wxString Result = This->name"}]}]}, + %% {'GetCaption', + %% [{pre_hook, [{c, "#if 0\n"}]}, + %% {post_hook, [{c, "#endif\n if(!This) throw wxe_badarg(0);\n wxString Result = This->caption"}]}]}, + %% {'GetIcon', + %% [{pre_hook, [{c, "#if 0\n"}]}, + %% {post_hook, [{c, "#endif\n if(!This) throw wxe_badarg(0);\n wxIcon Result = This->icon"}]}]}, + {'GetWindow', + [{pre_hook, [{c, "#if 0\n"}]}, + {post_hook, [{c, "#endif\n if(!This) throw wxe_badarg(0);\n wxWindow* Result = This->window"}]}]}, + {'GetFrame', + [{pre_hook, [{c, "#if 0\n"}]}, + {post_hook, [{c, "#endif\n if(!This) throw wxe_badarg(0);\n wxFrame* Result = This->frame"}]}]}, + {'GetDirection', + [{pre_hook, [{c, "#if 0\n"}]}, + {post_hook, [{c, "#endif\n if(!This) throw wxe_badarg(0);\n int Result = This->dock_direction"}]}]}, + {'GetLayer', + [{pre_hook, [{c, "#if 0\n"}]}, + {post_hook, [{c, "#endif\n if(!This) throw wxe_badarg(0);\n int Result = This->dock_layer"}]}]}, + {'GetRow', + [{pre_hook, [{c, "#if 0\n"}]}, + {post_hook, [{c, "#endif\n if(!This) throw wxe_badarg(0);\n int Result = This->dock_row"}]}]}, + {'GetPosition', + [{pre_hook, [{c, "#if 0\n"}]}, + {post_hook, [{c, "#endif\n if(!This) throw wxe_badarg(0);\n int Result = This->dock_pos"}]}]}, + {'GetFloatingPosition', + [{pre_hook, [{c, "#if 0\n"}]}, + {post_hook, [{c, "#endif\n if(!This) throw wxe_badarg(0);\n wxPoint Result = This->floating_pos"}]}]}, + {'GetFloatingSize', + [{pre_hook, [{c, "#if 0\n"}]}, + {post_hook, [{c, "#endif\n if(!This) throw wxe_badarg(0);\n wxSize Result = This->floating_size"}]}]} + +]}. {class, wxAuiNotebook, wxControl, [{ifdef, wxUSE_AUI}], ['wxAuiNotebook','AddPage',%'AdvanceSelection', @@ -1282,15 +1320,22 @@ %'Clone','DrawBackground','DrawButton','DrawTab','GetBestTabCtrlSize', %'GetIndentSize','GetTabSize','SetFlags','SetMeasuringFont', %'SetNormalFont','SetSelectedFont','SetSizingInfo'%,'ShowWindowList' + 'SetFlags', 'SetMeasuringFont', 'SetNormalFont', 'SetSelectedFont', + {'SetColour', [{test_if, "wxCHECK_VERSION(3,0,0)"}]}, + {'SetActiveColour', [{test_if, "wxCHECK_VERSION(3,0,0)"}]} ]}. {class,wxAuiDockArt, root, [{ifdef, wxUSE_AUI}], [%% 'wxAuiDockArt','~wxAuiDockArt' %, %%'DrawBackground','DrawBorder','DrawCaption', %% Pure virtual funcs %%'DrawGripper','DrawPaneButton','DrawSash', - %%'GetColor','GetColour','GetFont','GetMetric','SetColor','SetColour','SetFont','SetMetric' + 'GetColour','GetFont','GetMetric','SetColour','SetFont','SetMetric' ]}. +{class,wxAuiSimpleTabArt, wxAuiTabArt, [{ifdef, wxUSE_AUI}], + [wxAuiSimpleTabArt]}. + + {class, wxMDIParentFrame, wxFrame, [], [ 'wxMDIParentFrame', @@ -1870,7 +1915,7 @@ ]}. -{class, wxAuiManagerEvent, wxEvent, +{class, wxAuiManagerEvent, wxEvent, [{acc, [{button, "GetButton()"}, {dc, "GetDC()"}, {pane, "GetPane()"}, @@ -1880,6 +1925,7 @@ wxEVT_AUI_PANE_CLOSE, wxEVT_AUI_PANE_MAXIMIZE, wxEVT_AUI_PANE_RESTORE, + {wxEVT_AUI_PANE_ACTIVATED, {test_if, "wxCHECK_VERSION(2,9,5)"}}, wxEVT_AUI_RENDER, wxEVT_AUI_FIND_MANAGER ]}], |