aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/api_gen
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2012-02-17 13:07:28 +0100
committerDan Gudmundsson <[email protected]>2012-02-20 11:49:46 +0100
commit2c95eb0c575c95a2cdf3c2eacb562d1a5a8cfe08 (patch)
tree823354ee20475634f8abeb4bb2b4b0c404548ffa /lib/wx/api_gen
parent953ee650a80d863a85c99e82ef69501496db0ad6 (diff)
downloadotp-2c95eb0c575c95a2cdf3c2eacb562d1a5a8cfe08.tar.gz
otp-2c95eb0c575c95a2cdf3c2eacb562d1a5a8cfe08.tar.bz2
otp-2c95eb0c575c95a2cdf3c2eacb562d1a5a8cfe08.zip
[wx] Fix api bugs in wxDC
Some out arguments was in args.
Diffstat (limited to 'lib/wx/api_gen')
-rw-r--r--lib/wx/api_gen/wx_gen.erl9
-rw-r--r--lib/wx/api_gen/wx_gen_cpp.erl24
-rw-r--r--lib/wx/api_gen/wx_gen_erl.erl5
-rw-r--r--lib/wx/api_gen/wxapi.conf24
4 files changed, 43 insertions, 19 deletions
diff --git a/lib/wx/api_gen/wx_gen.erl b/lib/wx/api_gen/wx_gen.erl
index 209de48496..7f85151d03 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -665,7 +665,11 @@ extract_type_info2("&", Acc) -> [{by_ref,reference}|Acc];
extract_type_info2("WXDLLIMP" ++ _, Acc) -> Acc;
extract_type_info2(Type, Acc) -> [Type|Acc].
-parse_type2(["void"], _Info, _Opts, _T) -> void;
+parse_type2(["void"], _Info, _Opts, #type{by_val=ByVal}) ->
+ case ByVal of
+ true -> void;
+ false -> voidp
+ end;
parse_type2(["virtual"|R], _Info, _Opts, _T) ->
[] = R,
%% Bug in old doxygen virtual destructors have type virtual
@@ -1106,6 +1110,7 @@ type_foot_print(#type{base={enum,_}}) -> int;
type_foot_print(#type{base={ref,_}}) -> ref;
type_foot_print(#type{base={term,_}}) -> term;
type_foot_print(#type{base=eventType}) -> atom;
+type_foot_print(voidp) -> int;
%% type_foot_print({Type,Str}) when is_list(Str) ->
%% type_foot_print(Type);
type_foot_print(#type{base={comp,_,R={record,_}}}) ->
diff --git a/lib/wx/api_gen/wx_gen_cpp.erl b/lib/wx/api_gen/wx_gen_cpp.erl
index 4bc58533ad..1b50c49fb9 100644
--- a/lib/wx/api_gen/wx_gen_cpp.erl
+++ b/lib/wx/api_gen/wx_gen_cpp.erl
@@ -64,11 +64,16 @@ gen_derived_dest(Defs) ->
[gen_derived_dest_2(Class) || Class <- Defs],
ok.
-gen_derived_dest_2(C=#class{name=Class}) ->
+gen_derived_dest_2(C=#class{name=Class, options=Opts}) ->
?WTC("gen_derived_dest_2"),
Derived = is_derived(C),
TaylorMade = taylormade_class(C),
+
if Derived andalso (TaylorMade =:= false) ->
+ case lists:keysearch(ifdef,1,Opts) of
+ {value, {ifdef, What}} -> w("#if ~p~n",[What]);
+ _ -> ok
+ end,
w("class E~s : public ~s {~n",[Class,Class]),
case Class of
"wxGLCanvas" -> %% Special for cleaning up gl context
@@ -78,7 +83,13 @@ gen_derived_dest_2(C=#class{name=Class}) ->
w(" public: ~~E~s() {((WxeApp *)wxTheApp)->clearPtr(this);};~n", [Class])
end,
gen_constructors(C),
- w("};~n~n", []);
+ case lists:keysearch(ifdef,1,Opts) of
+ {value, {ifdef, Endif}} ->
+ w("};~n", []),
+ w("#endif // ~p~n~n",[Endif]);
+ _ ->
+ w("};~n~n", [])
+ end;
TaylorMade /= false ->
w("~s~n", [TaylorMade]);
true ->
@@ -324,6 +335,8 @@ declare_var(P = #param{name=Name,in=In,def=Def,type=Type}) ->
declare_type(N,false,_,#type{name="wxArrayInt"}) ->
w(" wxArrayInt ~s;~n", [N]);
+declare_type(N,false,_,#type{name="wxArrayDouble"}) ->
+ w(" wxArrayDouble ~s;~n", [N]);
declare_type(N,false,_,#type{name="wxArrayString"}) ->
w(" wxArrayString ~s;~n", [N]);
declare_type(N,false,_,#type{base=Base,single=true,name=Type,by_val=false,mod=Mod})
@@ -335,6 +348,8 @@ declare_type(N,false,_,#type{name="wxArrayTreeItemIds",ref=reference}) ->
w(" wxArrayTreeItemIds ~s;~n", [N]);
declare_type(N,false,_,#type{name="wxDateTime"}) ->
w(" wxDateTime ~s;~n", [N]);
+declare_type(N,false,_,#type{name="wxColour"}) ->
+ w(" wxColour ~s;~n", [N]);
declare_type(N,false,_,#type{name=Type, base=int64, ref=reference}) ->
w(" ~s ~s;~n", [Type,N]);
declare_type(N,true,Def,#type{base=Base,single=true,name=Type,by_val=true})
@@ -363,6 +378,8 @@ declare_type(N,true,Def,#type{base=binary, name=char}) ->
w(" char ~sD[] = {~s}, * ~s = ~sD;~n", [N,Def,N,N]);
declare_type(_N,true,_Def,void) ->
skip;
+declare_type(_N,true,_Def,voidp) ->
+ skip;
declare_type(N,true,Def,#type{name=Type, ref={pointer,2}}) ->
%% xxxx
w(" ~s ** ~s = ~s;~n", [Type,N,Def]);
@@ -802,6 +819,7 @@ call_arg(#param{name=N,type={merged,_,#type{base={class,_},single=true,
when ByVal =:= true; Ref =:= reference ->
"*" ++ N;
call_arg(#param{def=Def, type=void}) when Def =/= none -> Def;
+call_arg(#param{def=Def, type=voidp}) when Def =/= none -> Def;
call_arg(#param{name=N,type=#type{base={ref,_},by_val=true,single=true}}) -> N;
call_arg(#param{name=N,type={merged,_,_,_,_,_,_}}) -> N.
@@ -927,6 +945,8 @@ build_ret(Name,_,#type{base=int,single=true,mod=M}) ->
end;
build_ret(Name,_,#type{name="wxArrayInt"}) ->
w(" rt.add(~s);~n", [Name]);
+build_ret(Name,_,#type{name="wxArrayDouble"}) ->
+ w(" rt.add(~s);~n", [Name]);
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]),
diff --git a/lib/wx/api_gen/wx_gen_erl.erl b/lib/wx/api_gen/wx_gen_erl.erl
index 00bb7e20d0..b75ff8f7c6 100644
--- a/lib/wx/api_gen/wx_gen_erl.erl
+++ b/lib/wx/api_gen/wx_gen_erl.erl
@@ -307,11 +307,6 @@ gen_dest(#class{name=CName,abstract=Abs}, Ms) ->
false ->
case lists:keysearch(destructor,#method.method_type, lists:append(Ms)) of
{value, #method{method_type=destructor, id=Id}} ->
- case CName of
- "wxGraphicsCo" ++ _ ->
- io:format("parents ~p~n",[parents(CName)]);
- _ -> ok
- end,
case hd(reverse(parents(CName))) of
object ->
gen_dest2(CName, object);
diff --git a/lib/wx/api_gen/wxapi.conf b/lib/wx/api_gen/wxapi.conf
index fe86838c2f..1e94cbe617 100644
--- a/lib/wx/api_gen/wxapi.conf
+++ b/lib/wx/api_gen/wxapi.conf
@@ -330,9 +330,11 @@
{'DrawRotatedText',3}, 'DrawRoundedRectangle',%'DrawSpline',
{'DrawText',2},
'EndDoc','EndPage',{'FloodFill',3},'GetBackground','GetBackgroundMode',
- 'GetBrush','GetCharHeight','GetCharWidth',{'GetClippingBox',1},'GetFont',
- 'GetLayoutDirection','GetLogicalFunction','GetMapMode','GetMultiLineTextExtent',
- 'GetPartialTextExtents','GetPen',{'GetPixel',2},'GetPPI','GetSize','GetSizeMM',
+ 'GetBrush','GetCharHeight','GetCharWidth',{'GetClippingBox',[{"rect", skip_member}]},
+ 'GetFont','GetLayoutDirection','GetLogicalFunction','GetMapMode','GetMultiLineTextExtent',
+ {'GetPartialTextExtents', [{"widths", out}]},
+ 'GetPen',{'GetPixel', [{"col", out}, {"x", skip_member}]},
+ 'GetPPI','GetSize','GetSizeMM',
'GetTextBackground','GetTextExtent','GetTextForeground',
'GetUserScale','GradientFillConcentric','GradientFillLinear',
'LogicalToDeviceX','LogicalToDeviceXRel','LogicalToDeviceY','LogicalToDeviceYRel',
@@ -367,14 +369,16 @@
{'DrawLines', [{"n",{c_only,{length,"points"}}}, {"points", {single,array}}]},
'DrawPath',
'DrawRectangle','DrawRoundedRectangle','DrawText','FillPath',
- 'StrokePath','GetNativeContext','GetPartialTextExtents',
+ 'StrokePath', %% 'GetNativeContext',
+ {'GetPartialTextExtents', [{"widths", out}]},
'GetTextExtent','Rotate','Scale','Translate',
'GetTransform','SetTransform','ConcatTransform',
'SetBrush','SetFont','SetPen','StrokeLine',
{'StrokeLines', [{"n",{c_only,{length,"points"}}}, {"points", {single,array}}]}
]}.
{class, wxGraphicsMatrix, wxGraphicsObject, [{ifdef, wxUSE_GRAPHICS_CONTEXT}],
- ['Concat','Get','GetNativeMatrix','Invert','IsEqual','IsIdentity',
+ ['Concat','Get',%%'GetNativeMatrix',
+ 'Invert','IsEqual','IsIdentity',
'Rotate','Scale','Translate','Set','TransformPoint','TransformDistance']}.
{class, wxGraphicsPath, wxGraphicsObject, [{ifdef, wxUSE_GRAPHICS_CONTEXT}],
['MoveToPoint','AddArc','AddArcToPoint','AddCircle','AddCurveToPoint',
@@ -406,17 +410,17 @@
{class, wxControl, wxWindow, [], [% 'Command','GetLabelText',
'GetLabel','SetLabel']}.
-{class, wxControlWithItems, wxControl,
- [{skip, [{'GetClientObject',1},{'SetClientObject',2}]}],
+{class, wxControlWithItems, wxControl,
+ [{skip, [{'GetClientObject',1},{'SetClientObject',2}]}],
[
- {'Append',[{"clientData",[{skip_member, void}]},
- {"strings", [{erl_func, "appendStrings"}]}]},
+ {'Append',[{"clientData",[{skip_member, voidp}]},
+ {"strings", [{erl_func, "appendStrings"}]}]},
'Clear','Delete','FindString',
%% 'GetClientData','SetClientData',
{'GetClientObject', [{"n", [{erl_func, "getClientData"}]}]},
{'SetClientObject', [{"n", [{erl_func, "setClientData"}]}]},
'GetCount','GetSelection','GetString','GetStringSelection',
- {'Insert',[{"clientData",[{skip_member, void}]}]},%'Number',
+ {'Insert',[{"clientData",[{skip_member, voidp}]}]},%'Number',
'IsEmpty','Select','SetSelection','SetString','SetStringSelection'
]}.