diff options
Diffstat (limited to 'lib/wx/api_gen')
-rw-r--r-- | lib/wx/api_gen/wx_doxygen.conf | 4 | ||||
-rw-r--r-- | lib/wx/api_gen/wx_extra/wxListCtrl.c_src | 4 | ||||
-rw-r--r-- | lib/wx/api_gen/wx_gen.erl | 12 | ||||
-rw-r--r-- | lib/wx/api_gen/wx_gen_cpp.erl | 51 | ||||
-rw-r--r-- | lib/wx/api_gen/wx_gen_erl.erl | 26 | ||||
-rw-r--r-- | lib/wx/api_gen/wxapi.conf | 34 |
6 files changed, 100 insertions, 31 deletions
diff --git a/lib/wx/api_gen/wx_doxygen.conf b/lib/wx/api_gen/wx_doxygen.conf index 829702cbbf..f4d3c99ec0 100644 --- a/lib/wx/api_gen/wx_doxygen.conf +++ b/lib/wx/api_gen/wx_doxygen.conf @@ -57,7 +57,6 @@ GENERATE_DEPRECATEDLIST= NO ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = YES -SHOW_DIRECTORIES = YES FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages @@ -110,7 +109,6 @@ HTML_FILE_EXTENSION = .html HTML_HEADER = HTML_FOOTER = HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = NO CHM_FILE = HHC_LOCATION = @@ -251,7 +249,9 @@ PREDEFINED = \ wxUSE_DATAOBJ=1 \ wxUSE_SLIDER=1 \ wxUSE_CLIPBOARD=1 \ + wxUSE_POPUPWIN=1 \ wxUSE_SYSTEM_OPTIONS=1 \ + wxUSE_INTL=1 \ wxABI_VERSION=20809 \ __WXGTK24__=1 \ __WXGTK20__=1 \ diff --git a/lib/wx/api_gen/wx_extra/wxListCtrl.c_src b/lib/wx/api_gen/wx_extra/wxListCtrl.c_src index 8fa31e512e..d6196d11a2 100644 --- a/lib/wx/api_gen/wx_extra/wxListCtrl.c_src +++ b/lib/wx/api_gen/wx_extra/wxListCtrl.c_src @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2011-2013. All Rights Reserved. +%% Copyright Ericsson AB 2011-2014. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -165,7 +165,7 @@ case ~s: { // wxListCtrl::SortItems taylormade callbackInfo* cb = new callbackInfo(); cb->port = Ecmd.port; cb->callbackID = sortCallback; - bool Result = This->SortItems(wxEListCtrlCompare, (long)cb); + bool Result = This->SortItems(wxEListCtrlCompare, (wxeIntPtr)cb); delete cb; /* Destroy the callback, see wxEPrintout::clear_cb */ diff --git a/lib/wx/api_gen/wx_gen.erl b/lib/wx/api_gen/wx_gen.erl index 0f28b3dd5e..a60a9a93d5 100644 --- a/lib/wx/api_gen/wx_gen.erl +++ b/lib/wx/api_gen/wx_gen.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2013. All Rights Reserved. +%% Copyright Ericsson AB 2008-2014. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -743,7 +743,14 @@ parse_type2([N="wxTreeItemData"|R],Info,Opts,T) -> parse_type2(R,Info,Opts,T#type{name="wxETreeItemData",base={term,N}}); parse_type2([N="wxClientData"|R],Info,Opts,T) -> parse_type2(R,Info,Opts,T#type{name="wxeErlTerm",base={term,N}}); -parse_type2([N="wxChar"|R],Info,Opts,T) -> +parse_type2([N="wxChar",{by_ref,_}|R],Info,Opts,T = #type{mod=[const]}) -> + case get(current_class) of + "wxLocale" -> %% Special since changed between 2.8 and 3.0 + parse_type2(R,Info,Opts,T#type{name="wxeLocaleC",base=string}); + _ -> + parse_type2(R,Info,Opts,T#type{name=N,base=int,single=false}) + end; +parse_type2([N="wxChar"|R],Info,Opts,T) -> parse_type2(R,Info,Opts,T#type{name=N,base=int}); parse_type2(["wxUint32"|R],Info,Opts,T=#type{mod=Mod}) -> parse_type2(R,Info,Opts,T#type{name=int,base=int,mod=[unsigned|Mod]}); @@ -1274,6 +1281,7 @@ parse_enums([File|Files], Parsed) -> %%io:format("Parse Enums in ~s ~n", [FileName]), case xmerl_scan:file(FileName, [{space, normalize}]) of {error, enoent} -> + %% io:format("Ignore ~p~n", [FileName]), parse_enums(Files, gb_sets:add(File,Parsed)); {Doc, _} -> ES = "./compounddef/sectiondef/memberdef[@kind=\"enum\"]", diff --git a/lib/wx/api_gen/wx_gen_cpp.erl b/lib/wx/api_gen/wx_gen_cpp.erl index ea5d89be72..107d064f4a 100644 --- a/lib/wx/api_gen/wx_gen_cpp.erl +++ b/lib/wx/api_gen/wx_gen_cpp.erl @@ -71,7 +71,8 @@ gen_derived_dest_2(C=#class{name=Class, options=Opts}) -> if Derived andalso (TaylorMade =:= false) -> case lists:keysearch(ifdef,1,Opts) of - {value, {ifdef, What}} -> w("#if ~p~n",[What]); + {value, {ifdef, What}} when is_list(What)-> w("#if ~s~n",[What]); + {value, {ifdef, What}} when is_atom(What) -> w("#if ~p~n",[What]); _ -> ok end, w("class E~s : public ~s {~n",[Class,Class]), @@ -190,13 +191,14 @@ gen_funcs(Defs) -> %% w(" case WXE_REMOVE_PORT:~n", []), %% w(" { destroyMemEnv(Ecmd.port); } break;~n", []), w(" case DESTROY_OBJECT: {~n"), - w(" wxObject *This = (wxObject *) getPtr(bp,memenv);~n"), - w(" if(This) {~n"), - w(" if(recurse_level > 1) {~n"), + w(" void *This = getPtr(bp,memenv);~n"), + w(" wxeRefData *refd = getRefData(This);~n"), + w(" if(This && refd) {~n"), + w(" if(recurse_level > 1 && refd->type != 4) {~n"), w(" delayed_delete->Append(Ecmd.Save());~n"), w(" } else {~n"), - w(" ((WxeApp *) wxTheApp)->clearPtr((void *) This);~n"), - w(" delete This; }~n"), + w(" ((WxeApp *) wxTheApp)->clearPtr(This);~n"), + w(" delete_object(This, refd); }~n"), w(" } } break;~n"), w(" case WXE_REGISTER_OBJECT: {~n" " registerPid(bp, Ecmd.caller, memenv);~n" @@ -235,24 +237,27 @@ gen_funcs(Defs) -> "wxFileDataObject", "wxTextDataObject", "wxBitmapDataObject" ], - w("void WxeApp::delete_object(void *ptr, wxeRefData *refd) {~n", []), + w("bool WxeApp::delete_object(void *ptr, wxeRefData *refd) {~n", []), w(" switch(refd->type) {~n", []), - Case = fun(#class{name=Class, id=Id, abstract=IsAbs, parent=P}) when P /= "static" -> + Case = fun(C=#class{name=Class, id=Id, abstract=IsAbs, parent=P}) when P /= "static" -> UglyWorkaround = lists:member(Class, UglySkipList), + HaveVirtual = virtual_dest(C), case hd(reverse(wx_gen_erl:parents(Class))) of - root when IsAbs == false, UglyWorkaround == false -> - w(" case ~p: delete (~s *) ptr; break;~n", [Id, Class]); root when IsAbs == false, UglyWorkaround == true -> w(" case ~p: /* delete (~s *) ptr;" "These objects must be deleted by owner object */ " "break;~n", [Id, Class]); + root when IsAbs == false, HaveVirtual == true -> + w(" case ~p: delete (E~s *) ptr; return false;~n", [Id, Class]); + root when IsAbs == false, UglyWorkaround == false -> + w(" case ~p: delete (~s *) ptr; break;~n", [Id, Class]); _ -> ok end; (_) -> ok end, [Case(Class) || Class <- Defs], - w(" default: delete (wxObject *) ptr;~n", []), - w("}}~n~n", []), + w(" default: delete (wxObject *) ptr; return false;~n", []), + w(" }~n return true;~n}~n~n", []), Res. gen_class(C=#class{name=Name,methods=Ms,options=Opts}) -> @@ -267,7 +272,8 @@ gen_class(C=#class{name=Name,methods=Ms,options=Opts}) -> false -> case lists:keysearch(ifdef,1,Opts) of {value, {ifdef, What}} -> - w("#if ~p~n",[What]), + is_atom(What) andalso w("#if ~p~n",[What]), + is_list(What) andalso w("#if ~s~n",[What]), Methods = lists:flatten(Ms), MsR = [gen_method(Name,M) || M <- lists:keysort(#method.id, Methods)], @@ -401,6 +407,8 @@ declare_type(N,true,Def,#type{base=Base,single=true,name=Type,by_val=false,ref={ w(" ~s *~s=~s;~n", [Type,N,Def]); declare_type(N,true,Def,#type{single=true,name="wxArtClient"}) -> w(" wxArtClient ~s= ~s;~n", [N,Def]); +declare_type(N,true,_Def,#type{name="wxeLocaleC", single=true,base=string}) -> + w(" wxString ~s= wxEmptyString;~n", [N]); declare_type(N,true,Def,#type{single=true,base=string}) -> w(" wxString ~s= ~s;~n", [N,Def]); %% declare_type(N,true,_Def,#type{name="wxString"}) -> @@ -730,9 +738,13 @@ call_wx(_N,{constructor,_},#type{base={class,RClass}},Ps) -> false -> 0 end; false -> - case hd(reverse(wx_gen_erl:parents(RClass))) of - root -> Id; - _ -> 1 + case is_dc(RClass) of + true -> 4; + false -> + case hd(reverse(wx_gen_erl:parents(RClass))) of + root -> Id; + _ -> 1 + end end end, case virtual_dest(ClassDef) orelse (CType =/= 0) of @@ -894,6 +906,10 @@ is_window(Class) -> is_dialog(Class) -> lists:member("wxDialog", wx_gen_erl:parents(Class)). +is_dc(Class) -> + Parents = wx_gen_erl:parents(Class), + lists:member("wxDC", Parents) orelse lists:member("wxGraphicsContext", Parents). + build_return_vals(Type,Ps) -> HaveType = case Type of void -> 0; _ -> 1 end, NoOut = lists:sum([1 || #param{in=In} <- Ps, In =/= true]) + HaveType, @@ -997,6 +1013,8 @@ build_ret(Name,_,#type{base=float,single=true}) -> w(" rt.addFloat(~s);~n",[Name]); build_ret(Name,_,#type{base=double,single=true}) -> w(" rt.addFloat(~s);~n",[Name]); +build_ret(Name,_,#type{name="wxeLocaleC"}) -> + w(" rt.add(wxeLocaleC2String(~s));~n",[Name]); build_ret(Name,_,#type{base=string,single=true}) -> w(" rt.add(~s);~n",[Name]); build_ret(Name,_,#type{name="wxArrayString", single=array}) -> @@ -1090,6 +1108,7 @@ gen_macros() -> w("#include <wx/listbook.h>~n"), w("#include <wx/treebook.h>~n"), w("#include <wx/taskbar.h>~n"), + w("#include <wx/popupwin.h>~n"), w("#include <wx/html/htmlwin.h>~n"), w("#include <wx/html/htmlcell.h>~n"), w("#include <wx/filename.h>~n"), diff --git a/lib/wx/api_gen/wx_gen_erl.erl b/lib/wx/api_gen/wx_gen_erl.erl index a4b03d3fd1..5ac781b40c 100644 --- a/lib/wx/api_gen/wx_gen_erl.erl +++ b/lib/wx/api_gen/wx_gen_erl.erl @@ -44,7 +44,11 @@ gen(Defs) -> gen_unique_names(Defs), gen_event_recs(), gen_enums_ints(), - [gen_class(Class) || Class <- Defs], + Static = gen_static([C || C=#class{parent="static"} <- Defs]), + Replace = fun(C=#class{name=Name}, Dfs) -> + lists:keyreplace(Name, #class.name, Dfs, C) + end, + [gen_class(Class) || Class <- lists:foldl(Replace, Defs, Static)], gen_funcnames(). gen_class(Class) -> @@ -54,9 +58,8 @@ gen_class(Class) -> Class end. -gen_class1(C=#class{name=Name,parent="static",methods=Ms,options=_Opts}) -> +gen_static(Files) -> open_write("../src/gen/wx_misc.erl"), - put(current_class, Name), erl_copyright(), w("", []), w("%% This file is generated DO NOT EDIT~n~n", []), @@ -67,17 +70,27 @@ gen_class1(C=#class{name=Name,parent="static",methods=Ms,options=_Opts}) -> w("-module(wx_misc).~n", []), w("-include(\"wxe.hrl\").~n",[]), %% w("-compile(export_all).~n~n", []), %% XXXX remove ??? + [gen_static_exports(C) || C <- Files], + Classes = [gen_static_methods(C) || C <- Files], + close(), + Classes. + +gen_static_exports(C=#class{parent="static",methods=Ms}) -> Exp = fun(M) -> gen_export(C,M) end, ExportList = lists:usort(lists:append(lists:map(Exp,reverse(Ms)))), w("-export([~s]).~n~n", [args(fun({EF,_}) -> EF end, ",", ExportList, 60)]), + ok. +gen_static_methods(C=#class{name=Name, parent="static",methods=Ms}) -> + put(current_class, Name), Gen = fun(M) -> gen_method(Name,M) end, NewMs = lists:map(Gen,reverse(Ms)), - close(), erase(current_class), - C#class{methods=NewMs}; + C#class{methods=NewMs}. +gen_class1(C=#class{parent="static"}) -> + C; gen_class1(C=#class{name=Name,parent=Parent,methods=Ms,options=Opts}) -> case Opts of ["ignore"] -> throw(skipped); @@ -755,7 +768,7 @@ write_spec(Args, Optional, {complex, Res}, Eol) -> optional_type(Opts, Eol) -> "Option :: " ++ args(fun optional_type2/1, Eol++"\t\t | ", Opts). -optional_type2(#param{name=Name, def=Def, type=T}) -> +optional_type2(#param{name=Name, def=_Def, type=T}) -> "{" ++ erl_option_name(Name) ++ ", " ++ doc_arg_type2(T) ++ "}". %% %% Default: " ++ Def. doc_link("utils", Func) -> @@ -1357,4 +1370,3 @@ split_list(F, Keep, [M|Ms], Acc) -> split_list(_, _, [], []) -> []; split_list(_, _, [], Acc) -> [lists:reverse(Acc)]. - diff --git a/lib/wx/api_gen/wxapi.conf b/lib/wx/api_gen/wxapi.conf index 73c5af43d8..2e961cce98 100644 --- a/lib/wx/api_gen/wxapi.conf +++ b/lib/wx/api_gen/wxapi.conf @@ -31,7 +31,8 @@ %% wxALWAYS_NATIVE_DOUBLE_BUFFER, wxGAUGE_EMULATE_INDETERMINATE_MODE, - wxTR_DEFAULT_STYLE + wxTR_DEFAULT_STYLE, + wxSL_LABELS ]}. {gvars, @@ -877,6 +878,7 @@ {class, wxTextCtrl, wxControl, [], ['wxTextCtrl','~wxTextCtrl','AppendText','CanCopy','CanCut','CanPaste', 'CanRedo','CanUndo','Clear','Copy','Create','Cut','DiscardEdits', + 'ChangeValue', 'EmulateKeyPress','GetDefaultStyle','GetInsertionPoint','GetLastPosition', 'GetLineLength','GetLineText','GetNumberOfLines','GetRange','GetSelection', 'GetStringSelection','GetStyle','GetValue',%'HitTest', %no Mac @@ -1577,9 +1579,14 @@ 'wxShutdown', {'wxShell', 1}, 'wxLaunchDefaultBrowser', {'wxGetEmailAddress',0}, {'wxGetUserId',0}, {'wxGetHomeDir',0}, 'wxNewId', 'wxRegisterId', 'wxGetCurrentId', - 'wxGetOsDescription', 'wxIsPlatformLittleEndian', 'wxIsPlatform64Bit' + 'wxGetOsDescription', 'wxIsPlatformLittleEndian', 'wxIsPlatform64Bit' ]}. +{class, gdicmn, static, [], + [ {'wxDisplaySize', [{"width", [out]}, {"height", [out]}]}, 'wxSetCursor' + ]}. + + {class, wxPrintout, object, [{alias, [{wxePrintout, wxePrintout}]}], [{'wxPrintout', [{where, taylormade}]},'~wxPrintout', 'GetDC', %% 'GetPageInfo',Callback @@ -1885,3 +1892,26 @@ wxEVT_TASKBAR_LEFT_DCLICK,wxEVT_TASKBAR_RIGHT_DCLICK]}],[]}. {class, wxInitDialogEvent, wxEvent, [{event,[wxEVT_INIT_DIALOG]}], []}. + +{class, wxLocale, root, [{skip, [{'wxLocale', 5}, {'Init', 6}]}], + ['wxLocale', '~wxLocale', 'Init', + 'AddCatalog','AddCatalogLookupPathPrefix', + %%'AddLanguage','FindLanguageInfo', 'GetLanguageInfo', + 'GetCanonicalName','GetLanguage', + 'GetLanguageName','GetLocale','GetName','GetString', + 'GetHeaderValue', + 'GetSysName', + 'GetSystemEncoding','GetSystemEncodingName', + 'GetSystemLanguage', + 'IsLoaded','IsOk']}. + +{class, wxActivateEvent, wxEvent, + [{acc, [{m_active, "GetActive()"}]}, + {event, [wxEVT_ACTIVATE, wxEVT_ACTIVATE_APP, wxEVT_HIBERNATE]}], + ['GetActive']}. + +{class, wxPopupWindow, wxWindow, [{ifdef, wxUSE_POPUPWIN}], + ['wxPopupWindow', '~wxPopupWindow', 'Create', 'Position']}. + +{class, wxPopupTransientWindow, wxPopupWindow, [{ifdef, wxUSE_POPUPWIN}], + ['wxPopupTransientWindow', '~wxPopupTransientWindow', 'Popup', 'Dismiss']}. |