Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/wx/api_gen/gen_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ erl_copyright_template(License) ->
w("%%~n",[]),
w("%% %CopyrightBegin%~n",[]),
w("%%~n",[]),
w("%% SPDX-License-Identifier: ~n",[License]),
w("%% SPDX-License-Identifier: ~ts~n",[License]),
w("%%~n",[]),
w("%% Copyright Ericsson AB ~p-~p. All Rights Reserved.~n",
[StartYear, CurrentYear]),
Expand Down Expand Up @@ -304,8 +304,8 @@ append_license(_) ->
c_copyright() ->
{CurrentYear,_,_} = erlang:date(),
w("/*~n",[]),
w(" * %CopyrightBegin%
w(" *
w(" * %CopyrightBegin%~n",[]),
w(" *~n",[]),
w(" * SPDX-License-Identifier: Apache-2.0~n",[]),
w(" *~n",[]),
w(" * Copyright Ericsson AB 2008-~p. All Rights Reserved.~n",[CurrentYear]),
Expand Down
2 changes: 1 addition & 1 deletion lib/wx/api_gen/wx_gen_erl.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ filter_attrs(#class{name=Name, parent=Parent,attributes=Attrs}) ->
gen_funcnames() ->
Ns = get_unique_names(),
open_write("../src/gen/wxe_funcs.hrl"),
erl_copyright(),
erl_wx_copyright(),
w("%% This file is generated DO NOT EDIT~n~n", []),
w("%% We define each id so we don't get huge diffs when adding new funcs/classes~n~n",[]),
[w("-define(~s_~s, ~p).~n", [Class,Name,Id]) || {Class,Name,_,Id} <- Ns],
Expand Down
11 changes: 9 additions & 2 deletions lib/wx/api_gen/wx_gen_nif.erl
Original file line number Diff line number Diff line change
Expand Up @@ -977,8 +977,13 @@ return_res1(#type{name="wxCharBuffer", base={binary,_},single=true,by_val=true})
{"char * Result = ", ".data()"};
return_res1(#type{name=Type,single=array,ref=reference}) ->
{Type ++ " Result = ", ""};
return_res1(#type{name=Type,single=true,by_val=true}) ->
{Type ++ " Result = ", ""}.
return_res1(#type{name=Type,single=true,by_val=true, mod=Mods}) ->
case lists:member(unsigned, Mods) of
true ->
{io_lib:format("unsigned ~s Result = ", [Type]), ""};
false ->
{Type ++ " Result = ", ""}
end.

filter(Ps) ->
lists:filter(fun filter_arg/1, Ps).
Expand Down Expand Up @@ -1458,10 +1463,12 @@ gen_macros() ->
w("#include <wx/sysopt.h>~n"),
w("#include <wx/overlay.h>~n"),
w("#include <wx/notifmsg.h>~n"),
w("#if WXE_WEBVIEW~n"),
w("#include <wx/webview.h>~n"),
w("#if wxUSE_WEBVIEW && wxUSE_WEBVIEW_IE~n"),
w("#include <wx/msw/webview_ie.h>~n"),
w("#endif~n"),
w("#endif~n"),
w("#if wxUSE_GLCANVAS_EGL && !wxCHECK_VERSION(3,2,3)~n"),
w("#include <EGL/egl.h>~n"),
w("#endif~n"),
Expand Down
14 changes: 7 additions & 7 deletions lib/wx/c_src/gen/wxe_wrapper_4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1842,7 +1842,7 @@ void wxImage_GetAlpha_2(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd)
int y;
if(!enif_get_int(env, argv[2], &y)) Badarg("y"); // int
if(!This) throw wxe_badarg("This");
char Result = This->GetAlpha(x,y);
unsigned char Result = This->GetAlpha(x,y);
wxeReturn rt = wxeReturn(memenv, Ecmd.caller, true);
rt.send( rt.make_uint(Result));

Expand All @@ -1860,7 +1860,7 @@ void wxImage_GetBlue(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd)
int y;
if(!enif_get_int(env, argv[2], &y)) Badarg("y"); // int
if(!This) throw wxe_badarg("This");
char Result = This->GetBlue(x,y);
unsigned char Result = This->GetBlue(x,y);
wxeReturn rt = wxeReturn(memenv, Ecmd.caller, true);
rt.send( rt.make_uint(Result));

Expand Down Expand Up @@ -1892,7 +1892,7 @@ void wxImage_GetGreen(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd)
int y;
if(!enif_get_int(env, argv[2], &y)) Badarg("y"); // int
if(!This) throw wxe_badarg("This");
char Result = This->GetGreen(x,y);
unsigned char Result = This->GetGreen(x,y);
wxeReturn rt = wxeReturn(memenv, Ecmd.caller, true);
rt.send( rt.make_uint(Result));

Expand Down Expand Up @@ -1948,7 +1948,7 @@ void wxImage_GetMaskBlue(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd)
wxImage *This;
This = (wxImage *) memenv->getPtr(env, argv[0], "This");
if(!This) throw wxe_badarg("This");
char Result = This->GetMaskBlue();
unsigned char Result = This->GetMaskBlue();
wxeReturn rt = wxeReturn(memenv, Ecmd.caller, true);
rt.send( rt.make_uint(Result));

Expand All @@ -1962,7 +1962,7 @@ void wxImage_GetMaskGreen(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd)
wxImage *This;
This = (wxImage *) memenv->getPtr(env, argv[0], "This");
if(!This) throw wxe_badarg("This");
char Result = This->GetMaskGreen();
unsigned char Result = This->GetMaskGreen();
wxeReturn rt = wxeReturn(memenv, Ecmd.caller, true);
rt.send( rt.make_uint(Result));

Expand All @@ -1976,7 +1976,7 @@ void wxImage_GetMaskRed(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd)
wxImage *This;
This = (wxImage *) memenv->getPtr(env, argv[0], "This");
if(!This) throw wxe_badarg("This");
char Result = This->GetMaskRed();
unsigned char Result = This->GetMaskRed();
wxeReturn rt = wxeReturn(memenv, Ecmd.caller, true);
rt.send( rt.make_uint(Result));

Expand Down Expand Up @@ -2030,7 +2030,7 @@ void wxImage_GetRed(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd)
int y;
if(!enif_get_int(env, argv[2], &y)) Badarg("y"); // int
if(!This) throw wxe_badarg("This");
char Result = This->GetRed(x,y);
unsigned char Result = This->GetRed(x,y);
wxeReturn rt = wxeReturn(memenv, Ecmd.caller, true);
rt.send( rt.make_uint(Result));

Expand Down
9 changes: 1 addition & 8 deletions lib/wx/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,7 @@
#

include ../vsn.mk
ifdef BOOTSTRAP
VSN = $(WX_VSN)
include $(ERL_TOP)/make/target.mk
include $(ERL_TOP)/make/$(TARGET)/otp.mk
RELSYSDIR = $(RELEASE_PATH)/lib/wx-$(VSN)
else # Normal build
include ../config.mk
endif
include ../config.mk

ESRC = .
EGEN = gen
Expand Down
19 changes: 16 additions & 3 deletions lib/wx/test/wx_class_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
init_per_testcase/2, end_per_testcase/2]).

-export([calendarCtrl/1, treeCtrl/1, notebook/1, staticBoxSizer/1,
clipboard/1, helpFrame/1, htmlWindow/1, listCtrlSort/1, listCtrlVirtual/1,
clipboard/1, helpFrame/1, htmlWindow/1, image/1, listCtrlSort/1, listCtrlVirtual/1,
radioBox/1, systemSettings/1, taskBarIcon/1, toolbar/1, popup/1, modal/1,
textCtrl/1, locale/1]).

Expand All @@ -54,8 +54,8 @@ end_per_testcase(Func,Config) ->
suite() -> [{ct_hooks,[ts_install_cth]}, {timetrap,{minutes,2}}].

all() ->
[calendarCtrl, treeCtrl, notebook, staticBoxSizer,
clipboard, helpFrame, htmlWindow, listCtrlSort, listCtrlVirtual,
[calendarCtrl, treeCtrl, notebook, staticBoxSizer, clipboard,
helpFrame, htmlWindow, image, listCtrlSort, listCtrlVirtual,
radioBox, systemSettings, taskBarIcon, toolbar, popup, modal,
textCtrl, locale].

Expand Down Expand Up @@ -623,6 +623,19 @@ locale(_Config) ->
io:format("initiated ~p~n",[R0]),
lang_env(),
ok.

image(_Config) when is_list(_Config) ->
wx:new(),
Bin = << <<220:8, Row:8, Col:8>> ||
Row <- lists:seq(0, 127),
Col <- lists:seq(0, 127) >>,
Image = wxImage:new(128, 128, Bin),
220 = wxImage:getRed(Image, 42, 13),
42 = wxImage:getBlue(Image, 42, 13),
13 = wxImage:getGreen(Image, 42, 13),
ok.


%% wx_test_lib:wx_destroy(Frame,Config).

lang_env() ->
Expand Down
Loading