summaryrefslogtreecommitdiff
path: root/lib/wx/src/gen/wxBrush.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <dgud@Dan.localdomain>2020-08-26 10:16:52 +0200
committerDan Gudmundsson <dgud@erlang.org>2020-12-21 11:51:41 +0100
commit2d41154f6b2cd7413c97af69a45862b472625d5f (patch)
tree5564d4c151d5ad1280d2a0d97c14bdb9551ade7a /lib/wx/src/gen/wxBrush.erl
parent31c707f5e8345a0dfb9fa677c76177e8308fcf60 (diff)
downloaderlang-2d41154f6b2cd7413c97af69a45862b472625d5f.tar.gz
Rewrite wx, use wxWidgets 3 as base and use nif interface
Complete overhaul of wx. Use nif interface instead of erlang driver interface. Use wxWidgets interface files as base for doxygen and code generation. This upgrades the base to 3.1.4. Change the interface files so we can generate code that is backward as compatible as possible. Compatibility with the old 2.8 API Reduce incompatibility with the old API as much as possible. Changes to the old API include: wxNotebookEvent have been replaced by the wxBookctrlEvent (NOTE) wxWindowDC default creators have been removed wxClientDC default creators have been removed wxPaintDC default creators have been removed wxWindow:setVirtualSizeHints(..) have been deprecated wxWindow:makeModal(..) have been deprecated wxWindow:makeModal(..) have been deprecated wxToolBar add/insertTool without label have been deprecated wxStyledTextCtrl some functions have changed args from boolean to int wxSizerItem:new() Some args have become options Removed depr wxSizerItem:setWindow() use assignWindow Removed depr wxSizerItem:setSpacer() use assignSpacer Removed depr wxSizerItem:setSpacer() use assignSpacer Removed depr wxSizerItem:setSizer() use assignSizer wxMenu append/insert/prepend have changed return value and lost IsCheckable argument wxListCtrl:setItem/4 changed return value wxListCtrl:setItem/4 changed return value wxImage::convertToGreyscale opts incompatible wxGridSizer::wxGridSizer opts incompatible wxGrid API have many changes wxGraphicsRenderer:create*GradientBrush(..) uses GradientStops now wxGraphicsRenderer:createPen(..) have been removed wxGraphicsRenderer:create*GradientBrush(..) uses GradientStops now wxGLCanvas API is incompatible wxFlexGridSizer::wxFlexGridSizer opts incompatible wxDisplay::wxDisplay opts incompatible wxCalendarDateAttr:new(ColText [,OptList]) have been removed wxBitmapButton:[g|s]etBitmapSelected have been removed
Diffstat (limited to 'lib/wx/src/gen/wxBrush.erl')
-rw-r--r--lib/wx/src/gen/wxBrush.erl118
1 files changed, 62 insertions, 56 deletions
diff --git a/lib/wx/src/gen/wxBrush.erl b/lib/wx/src/gen/wxBrush.erl
index 8f5eced1b9..ce30fdadf1 100644
--- a/lib/wx/src/gen/wxBrush.erl
+++ b/lib/wx/src/gen/wxBrush.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2020. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -39,118 +39,124 @@ parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxbrush.html#wxbrushwxbrush">external documentation</a>.
-spec new() -> wxBrush().
new() ->
- wxe_util:construct(?wxBrush_new_0,
- <<>>).
+ wxe_util:queue_cmd(?get_env(), ?wxBrush_new_0),
+ wxe_util:rec(?wxBrush_new_0).
%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxbrush.html#wxbrushwxbrush">external documentation</a>.
%% <br /> Also:<br />
-%% new(StippleBitmap) -> wxBrush() when<br />
-%% StippleBitmap::wxBitmap:wxBitmap().<br />
+%% new(Brush) -> wxBrush() when<br />
+%% Brush::wxBrush:wxBrush() | wxBitmap:wxBitmap().<br />
%%
+%%<br /> Style = ?wxBRUSHSTYLE_INVALID | ?wxBRUSHSTYLE_SOLID | ?wxBRUSHSTYLE_TRANSPARENT | ?wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE | ?wxBRUSHSTYLE_STIPPLE_MASK | ?wxBRUSHSTYLE_STIPPLE | ?wxBRUSHSTYLE_BDIAGONAL_HATCH | ?wxBRUSHSTYLE_CROSSDIAG_HATCH | ?wxBRUSHSTYLE_FDIAGONAL_HATCH | ?wxBRUSHSTYLE_CROSS_HATCH | ?wxBRUSHSTYLE_HORIZONTAL_HATCH | ?wxBRUSHSTYLE_VERTICAL_HATCH | ?wxBRUSHSTYLE_FIRST_HATCH | ?wxBRUSHSTYLE_LAST_HATCH
-spec new(Colour) -> wxBrush() when
Colour::wx:wx_colour();
- (StippleBitmap) -> wxBrush() when
- StippleBitmap::wxBitmap:wxBitmap().
+ (Brush) -> wxBrush() when
+ Brush::wxBrush:wxBrush() | wxBitmap:wxBitmap().
new(Colour)
when tuple_size(Colour) =:= 3; tuple_size(Colour) =:= 4 ->
new(Colour, []);
-new(#wx_ref{type=StippleBitmapT,ref=StippleBitmapRef}) ->
- ?CLASS(StippleBitmapT,wxBitmap),
- wxe_util:construct(?wxBrush_new_1,
- <<StippleBitmapRef:32/?UI>>).
+new(#wx_ref{type=BrushT}=Brush) ->
+ IswxBrush = ?CLASS_T(BrushT,wxBrush),
+ IswxBitmap = ?CLASS_T(BrushT,wxBitmap),
+ BrushType = if
+ IswxBrush -> wxBrush;
+ IswxBitmap -> wxBitmap;
+ true -> error({badarg, BrushT})
+ end,
+ wxe_util:queue_cmd(wx:typeCast(Brush, BrushType),?get_env(),?wxBrush_new_1),
+ wxe_util:rec(?wxBrush_new_1).
%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxbrush.html#wxbrushwxbrush">external documentation</a>.
+%%<br /> Style = ?wxBRUSHSTYLE_INVALID | ?wxBRUSHSTYLE_SOLID | ?wxBRUSHSTYLE_TRANSPARENT | ?wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE | ?wxBRUSHSTYLE_STIPPLE_MASK | ?wxBRUSHSTYLE_STIPPLE | ?wxBRUSHSTYLE_BDIAGONAL_HATCH | ?wxBRUSHSTYLE_CROSSDIAG_HATCH | ?wxBRUSHSTYLE_FDIAGONAL_HATCH | ?wxBRUSHSTYLE_CROSS_HATCH | ?wxBRUSHSTYLE_HORIZONTAL_HATCH | ?wxBRUSHSTYLE_VERTICAL_HATCH | ?wxBRUSHSTYLE_FIRST_HATCH | ?wxBRUSHSTYLE_LAST_HATCH
-spec new(Colour, [Option]) -> wxBrush() when
Colour::wx:wx_colour(),
- Option :: {'style', integer()}.
+ Option :: {'style', wx:wx_enum()}.
new(Colour, Options)
when tuple_size(Colour) =:= 3; tuple_size(Colour) =:= 4,is_list(Options) ->
- MOpts = fun({style, Style}, Acc) -> [<<1:32/?UI,Style:32/?UI>>|Acc];
- (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
- BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
- wxe_util:construct(?wxBrush_new_2,
- <<(wxe_util:colour_bin(Colour)):16/binary, BinOpt/binary>>).
+ MOpts = fun({style, _style} = Arg) -> Arg;
+ (BadOpt) -> erlang:error({badoption, BadOpt}) end,
+ Opts = lists:map(MOpts, Options),
+ wxe_util:queue_cmd(wxe_util:color(Colour), Opts,?get_env(),?wxBrush_new_2),
+ wxe_util:rec(?wxBrush_new_2).
%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxbrush.html#wxbrushgetcolour">external documentation</a>.
-spec getColour(This) -> wx:wx_colour4() when
This::wxBrush().
-getColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
+getColour(#wx_ref{type=ThisT}=This) ->
?CLASS(ThisT,wxBrush),
- wxe_util:call(?wxBrush_GetColour,
- <<ThisRef:32/?UI>>).
+ wxe_util:queue_cmd(This,?get_env(),?wxBrush_GetColour),
+ wxe_util:rec(?wxBrush_GetColour).
%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxbrush.html#wxbrushgetstipple">external documentation</a>.
-spec getStipple(This) -> wxBitmap:wxBitmap() when
This::wxBrush().
-getStipple(#wx_ref{type=ThisT,ref=ThisRef}) ->
+getStipple(#wx_ref{type=ThisT}=This) ->
?CLASS(ThisT,wxBrush),
- wxe_util:call(?wxBrush_GetStipple,
- <<ThisRef:32/?UI>>).
+ wxe_util:queue_cmd(This,?get_env(),?wxBrush_GetStipple),
+ wxe_util:rec(?wxBrush_GetStipple).
%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxbrush.html#wxbrushgetstyle">external documentation</a>.
--spec getStyle(This) -> integer() when
+%%<br /> Res = ?wxBRUSHSTYLE_INVALID | ?wxBRUSHSTYLE_SOLID | ?wxBRUSHSTYLE_TRANSPARENT | ?wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE | ?wxBRUSHSTYLE_STIPPLE_MASK | ?wxBRUSHSTYLE_STIPPLE | ?wxBRUSHSTYLE_BDIAGONAL_HATCH | ?wxBRUSHSTYLE_CROSSDIAG_HATCH | ?wxBRUSHSTYLE_FDIAGONAL_HATCH | ?wxBRUSHSTYLE_CROSS_HATCH | ?wxBRUSHSTYLE_HORIZONTAL_HATCH | ?wxBRUSHSTYLE_VERTICAL_HATCH | ?wxBRUSHSTYLE_FIRST_HATCH | ?wxBRUSHSTYLE_LAST_HATCH
+-spec getStyle(This) -> wx:wx_enum() when
This::wxBrush().
-getStyle(#wx_ref{type=ThisT,ref=ThisRef}) ->
+getStyle(#wx_ref{type=ThisT}=This) ->
?CLASS(ThisT,wxBrush),
- wxe_util:call(?wxBrush_GetStyle,
- <<ThisRef:32/?UI>>).
+ wxe_util:queue_cmd(This,?get_env(),?wxBrush_GetStyle),
+ wxe_util:rec(?wxBrush_GetStyle).
%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxbrush.html#wxbrushishatch">external documentation</a>.
-spec isHatch(This) -> boolean() when
This::wxBrush().
-isHatch(#wx_ref{type=ThisT,ref=ThisRef}) ->
+isHatch(#wx_ref{type=ThisT}=This) ->
?CLASS(ThisT,wxBrush),
- wxe_util:call(?wxBrush_IsHatch,
- <<ThisRef:32/?UI>>).
+ wxe_util:queue_cmd(This,?get_env(),?wxBrush_IsHatch),
+ wxe_util:rec(?wxBrush_IsHatch).
%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxbrush.html#wxbrushisok">external documentation</a>.
-spec isOk(This) -> boolean() when
This::wxBrush().
-isOk(#wx_ref{type=ThisT,ref=ThisRef}) ->
+isOk(#wx_ref{type=ThisT}=This) ->
?CLASS(ThisT,wxBrush),
- wxe_util:call(?wxBrush_IsOk,
- <<ThisRef:32/?UI>>).
+ wxe_util:queue_cmd(This,?get_env(),?wxBrush_IsOk),
+ wxe_util:rec(?wxBrush_IsOk).
%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxbrush.html#wxbrushsetcolour">external documentation</a>.
--spec setColour(This, Col) -> 'ok' when
- This::wxBrush(), Col::wx:wx_colour().
-setColour(#wx_ref{type=ThisT,ref=ThisRef},Col)
- when tuple_size(Col) =:= 3; tuple_size(Col) =:= 4 ->
+-spec setColour(This, Colour) -> 'ok' when
+ This::wxBrush(), Colour::wx:wx_colour().
+setColour(#wx_ref{type=ThisT}=This,Colour)
+ when tuple_size(Colour) =:= 3; tuple_size(Colour) =:= 4 ->
?CLASS(ThisT,wxBrush),
- wxe_util:cast(?wxBrush_SetColour_1,
- <<ThisRef:32/?UI,(wxe_util:colour_bin(Col)):16/binary>>).
+ wxe_util:queue_cmd(This,wxe_util:color(Colour),?get_env(),?wxBrush_SetColour_1).
%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxbrush.html#wxbrushsetcolour">external documentation</a>.
--spec setColour(This, R, G, B) -> 'ok' when
- This::wxBrush(), R::integer(), G::integer(), B::integer().
-setColour(#wx_ref{type=ThisT,ref=ThisRef},R,G,B)
- when is_integer(R),is_integer(G),is_integer(B) ->
+-spec setColour(This, Red, Green, Blue) -> 'ok' when
+ This::wxBrush(), Red::integer(), Green::integer(), Blue::integer().
+setColour(#wx_ref{type=ThisT}=This,Red,Green,Blue)
+ when is_integer(Red),is_integer(Green),is_integer(Blue) ->
?CLASS(ThisT,wxBrush),
- wxe_util:cast(?wxBrush_SetColour_3,
- <<ThisRef:32/?UI,R:32/?UI,G:32/?UI,B:32/?UI>>).
+ wxe_util:queue_cmd(This,Red,Green,Blue,?get_env(),?wxBrush_SetColour_3).
%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxbrush.html#wxbrushsetstipple">external documentation</a>.
--spec setStipple(This, Stipple) -> 'ok' when
- This::wxBrush(), Stipple::wxBitmap:wxBitmap().
-setStipple(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=StippleT,ref=StippleRef}) ->
+-spec setStipple(This, Bitmap) -> 'ok' when
+ This::wxBrush(), Bitmap::wxBitmap:wxBitmap().
+setStipple(#wx_ref{type=ThisT}=This,#wx_ref{type=BitmapT}=Bitmap) ->
?CLASS(ThisT,wxBrush),
- ?CLASS(StippleT,wxBitmap),
- wxe_util:cast(?wxBrush_SetStipple,
- <<ThisRef:32/?UI,StippleRef:32/?UI>>).
+ ?CLASS(BitmapT,wxBitmap),
+ wxe_util:queue_cmd(This,Bitmap,?get_env(),?wxBrush_SetStipple).
%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxbrush.html#wxbrushsetstyle">external documentation</a>.
+%%<br /> Style = ?wxBRUSHSTYLE_INVALID | ?wxBRUSHSTYLE_SOLID | ?wxBRUSHSTYLE_TRANSPARENT | ?wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE | ?wxBRUSHSTYLE_STIPPLE_MASK | ?wxBRUSHSTYLE_STIPPLE | ?wxBRUSHSTYLE_BDIAGONAL_HATCH | ?wxBRUSHSTYLE_CROSSDIAG_HATCH | ?wxBRUSHSTYLE_FDIAGONAL_HATCH | ?wxBRUSHSTYLE_CROSS_HATCH | ?wxBRUSHSTYLE_HORIZONTAL_HATCH | ?wxBRUSHSTYLE_VERTICAL_HATCH | ?wxBRUSHSTYLE_FIRST_HATCH | ?wxBRUSHSTYLE_LAST_HATCH
-spec setStyle(This, Style) -> 'ok' when
- This::wxBrush(), Style::integer().
-setStyle(#wx_ref{type=ThisT,ref=ThisRef},Style)
+ This::wxBrush(), Style::wx:wx_enum().
+setStyle(#wx_ref{type=ThisT}=This,Style)
when is_integer(Style) ->
?CLASS(ThisT,wxBrush),
- wxe_util:cast(?wxBrush_SetStyle,
- <<ThisRef:32/?UI,Style:32/?UI>>).
+ wxe_util:queue_cmd(This,Style,?get_env(),?wxBrush_SetStyle).
%% @doc Destroys this object, do not use object again
-spec destroy(This::wxBrush()) -> 'ok'.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxBrush),
- wxe_util:destroy(?DESTROY_OBJECT,Obj),
+ wxe_util:queue_cmd(Obj, ?get_env(), ?DESTROY_OBJECT),
ok.