diff options
author | Dan Gudmundsson <[email protected]> | 2012-02-16 13:55:08 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2012-02-17 10:19:45 +0100 |
commit | 953ee650a80d863a85c99e82ef69501496db0ad6 (patch) | |
tree | 637e728152ec48479bc06275e0976250c47a1d23 /lib/wx/api_gen/wx_gen_cpp.erl | |
parent | 2e3260f90ce4cb595296a36fbd212578e10a7e94 (diff) | |
download | otp-953ee650a80d863a85c99e82ef69501496db0ad6.tar.gz otp-953ee650a80d863a85c99e82ef69501496db0ad6.tar.bz2 otp-953ee650a80d863a85c99e82ef69501496db0ad6.zip |
[wx] Fix wxGraphicContext bugs
* Lines had wrong arguments
* Change float() to number in guards, when packing arguments
integers are converted floats to automaticly anyway.
Diffstat (limited to 'lib/wx/api_gen/wx_gen_cpp.erl')
-rw-r--r-- | lib/wx/api_gen/wx_gen_cpp.erl | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/wx/api_gen/wx_gen_cpp.erl b/lib/wx/api_gen/wx_gen_cpp.erl index 1b4c32db24..4bc58533ad 100644 --- a/lib/wx/api_gen/wx_gen_cpp.erl +++ b/lib/wx/api_gen/wx_gen_cpp.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 @@ -645,6 +645,16 @@ decode_arg(N,#type{name=Type,single=list,base={class,Class}},arg,A0) -> w(" ~s.Append(*(~s *) getPtr(bp,memenv)); bp += 4;}~n", [N,Class]), w(" bp += ((~p+ *~sLen)%2 )*4;~n", [A,N]), 0; +decode_arg(N,#type{single=array,base={comp,Class="wxPoint2DDouble",_}},arg,A0) -> + w(" int * ~sLen = (int *) bp; bp += 4;~n", [N]), + w(" ~s *~s;~n",[Class,N]), + w(" ~s = (~s *) driver_alloc(sizeof(~s) * *~sLen);~n",[N,Class,Class,N]), + store_free(N), + align(A0+1,64), + w(" for(int i=0; i < *~sLen; i++) {~n", [N]), + w(" double x = * (double *) bp; bp += 8;~n double y = * (double *) bp; bp += 8;~n", []), + w(" ~s[i] = wxPoint2DDouble(x,y);}~n", [N]), + 0; decode_arg(Name,T, Arg,_A) -> ?error({unhandled_type, {Name,T, Arg}}). |