aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2012-10-30 11:31:22 +0100
committerDan Gudmundsson <[email protected]>2013-01-09 11:41:40 +0100
commit9cffd30e76296fec83b22a2b3aa07bd3435cbe30 (patch)
treea890e1b27557854cf8c34759d737bf57a76c38e8
parentc6b6e6b67a7b9f8e0e25385c2272327d9a706348 (diff)
downloadotp-9cffd30e76296fec83b22a2b3aa07bd3435cbe30.tar.gz
otp-9cffd30e76296fec83b22a2b3aa07bd3435cbe30.tar.bz2
otp-9cffd30e76296fec83b22a2b3aa07bd3435cbe30.zip
wx: Deprecate functions not available in wxWidgets-2.9
Prepare to remove functionality which is not available in coming wxWidgets versions.
-rw-r--r--lib/stdlib/src/otp_internal.erl35
-rw-r--r--lib/wx/api_gen/wx_gen_cpp.erl8
-rw-r--r--lib/wx/api_gen/wx_gen_erl.erl30
-rw-r--r--lib/wx/api_gen/wxapi.conf30
-rw-r--r--lib/wx/src/gen/wxCalendarCtrl.erl2
-rw-r--r--lib/wx/src/gen/wxClientDC.erl2
-rw-r--r--lib/wx/src/gen/wxDC.erl2
-rw-r--r--lib/wx/src/gen/wxGraphicsContext.erl2
-rw-r--r--lib/wx/src/gen/wxGraphicsRenderer.erl2
-rw-r--r--lib/wx/src/gen/wxGridCellEditor.erl2
-rw-r--r--lib/wx/src/gen/wxIdleEvent.erl2
-rw-r--r--lib/wx/src/gen/wxMDIClientWindow.erl2
-rw-r--r--lib/wx/src/gen/wxPaintDC.erl2
-rw-r--r--lib/wx/src/gen/wxPostScriptDC.erl2
-rw-r--r--lib/wx/src/gen/wxWindowDC.erl2
15 files changed, 96 insertions, 29 deletions
diff --git a/lib/stdlib/src/otp_internal.erl b/lib/stdlib/src/otp_internal.erl
index 400380a36d..05abc12aa5 100644
--- a/lib/stdlib/src/otp_internal.erl
+++ b/lib/stdlib/src/otp_internal.erl
@@ -359,6 +359,41 @@ obsolete_1(ssh, sign_data, 2) ->
"and public_key:sign/3 instead"};
obsolete_1(ssh, verify_data, 3) ->
{deprecated,"deprecated (will be removed in R16A); use public_key:ssh_decode/1, and public_key:verify/4 instead"};
+
+%% Added in R16
+obsolete_1(wxCalendarCtrl, enableYearChange, _) -> %% wx bug documented?
+ {deprecated,"deprecated function not available in wxWidgets-2.9 and later"};
+obsolete_1(wxDC, computeScaleAndOrigin, 1) ->
+ {deprecated,"deprecated function not available in wxWidgets-2.9 and later"};
+obsolete_1(wxClientDC, new, 0) ->
+ {deprecated,"deprecated function not available in wxWidgets-2.9 and later"};
+obsolete_1(wxPaintDC, new, 0) ->
+ {deprecated,"deprecated function not available in wxWidgets-2.9 and later"};
+obsolete_1(wxWindowDC, new, 0) ->
+ {deprecated,"deprecated function not available in wxWidgets-2.9 and later"};
+obsolete_1(wxGraphicsContext, createLinearGradientBrush, 7) ->
+ {deprecated,"deprecated function not available in wxWidgets-2.9 and later"};
+obsolete_1(wxGraphicsContext, createRadialGradientBrush, 8) ->
+ {deprecated,"deprecated function not available in wxWidgets-2.9 and later"};
+obsolete_1(wxGraphicsRenderer, createLinearGradientBrush, 7) ->
+ {deprecated,"deprecated function not available in wxWidgets-2.9 and later"};
+obsolete_1(wxGraphicsRenderer, createRadialGradientBrush, 8) ->
+ {deprecated,"deprecated function not available in wxWidgets-2.9 and later"};
+obsolete_1(wxGridCellEditor, endEdit, 4) ->
+ {deprecated,"deprecated function not available in wxWidgets-2.9 and later"};
+obsolete_1(wxGridCellEditor, paintBackground, 3) ->
+ {deprecated,"deprecated function not available in wxWidgets-2.9 and later"};
+obsolete_1(wxIdleEvent, canSend, 1) ->
+ {deprecated,"deprecated function not available in wxWidgets-2.9 and later"};
+obsolete_1(wxMDIClientWindow, new, 1) ->
+ {deprecated,"deprecated function not available in wxWidgets-2.9 and later"};
+obsolete_1(wxMDIClientWindow, new, 2) ->
+ {deprecated,"deprecated function not available in wxWidgets-2.9 and later"};
+obsolete_1(wxPostScriptDC, getResolution, 0) ->
+ {deprecated,"deprecated function not available in wxWidgets-2.9 and later"};
+obsolete_1(wxPostScriptDC, setResolution, 1) ->
+ {deprecated,"deprecated function not available in wxWidgets-2.9 and later"};
+
obsolete_1(_, _, _) ->
no.
diff --git a/lib/wx/api_gen/wx_gen_cpp.erl b/lib/wx/api_gen/wx_gen_cpp.erl
index ced9c965ff..04d3f9264c 100644
--- a/lib/wx/api_gen/wx_gen_cpp.erl
+++ b/lib/wx/api_gen/wx_gen_cpp.erl
@@ -124,8 +124,8 @@ gen_constructor(Class, _M=#method{params=Ps, opts=FOpts}) ->
CallA = fun(#param{name=N}) -> N end,
HaveMergedType = fun(#param{type={merged,_,_,_,_,_,_}}) -> true; (_) -> false end,
?WTC("gen_constructor"),
- Endif = case lists:keysearch(ifdef, 1, FOpts) of
- {value, {ifdef, IfDef}} ->
+ Endif = case lists:keysearch(deprecated, 1, FOpts) of
+ {value, {deprecated, IfDef}} ->
w("#if ~s~n", [IfDef]),
true;
_ -> false
@@ -304,8 +304,8 @@ gen_method(CName, M=#method{name=N,params=Ps0,type=T,method_type=MT,id=MethodId
put(current_func, N),
put(bin_count,-1),
?WTC("gen_method"),
- Endif = case lists:keysearch(ifdef, 1, FOpts) of
- {value, {ifdef, IfDef}} ->
+ Endif = case lists:keysearch(deprecated, 1, FOpts) of
+ {value, {deprecated, IfDef}} ->
w("#if ~s~n", [IfDef]),
true;
_ -> false
diff --git a/lib/wx/api_gen/wx_gen_erl.erl b/lib/wx/api_gen/wx_gen_erl.erl
index e30034f179..35eba29450 100644
--- a/lib/wx/api_gen/wx_gen_erl.erl
+++ b/lib/wx/api_gen/wx_gen_erl.erl
@@ -70,8 +70,7 @@ gen_class1(C=#class{name=Name,parent="static",methods=Ms,options=_Opts}) ->
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)]),
-
+ w("-export([~s]).~n~n", [args(fun({EF,_}) -> EF end, ",", ExportList, 60)]),
Gen = fun(M) -> gen_method(Name,M) end,
NewMs = lists:map(Gen,reverse(Ms)),
@@ -134,7 +133,7 @@ gen_class1(C=#class{name=Name,parent=Parent,methods=Ms,options=Opts}) ->
w("-include(\"wxe.hrl\").~n",[]),
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)]),
+ w("-export([~s]).~n~n", [args(fun({EF,_}) -> EF end, ",", ExportList, 60)]),
w("%% inherited exports~n",[]),
Done0 = ["Destroy", "New", "Create", "destroy", "new", "create"],
Done = gb_sets:from_list(Done0 ++ [M|| #method{name=M} <- lists:append(Ms)]),
@@ -143,6 +142,10 @@ gen_class1(C=#class{name=Name,parent=Parent,methods=Ms,options=Opts}) ->
lists:usort(["parent_class/1"|InExported]),
60)]),
w("-export_type([~s/0]).~n", [Name]),
+ case lists:filter(fun({_F,Depr}) -> Depr end, ExportList) of
+ [] -> ok;
+ Depr -> w("-deprecated([~s]).~n~n", [args(fun({EF,_}) -> EF end, ",", Depr, 60)])
+ end,
w("%% @hidden~n", []),
parents_check(Parents),
w("-type ~s() :: wx:wx_object().~n", [Name]),
@@ -218,33 +221,40 @@ gen_export(#class{name=Class,abstract=Abs},Ms0) ->
case Res of
[] -> [];
[M=#method{where=taylormade}|_] ->
- [taylormade_export(Class, M)];
+ [deprecated(M, taylormade_export(Class, M))];
Ms ->
- GetF = fun(#method{method_type=constructor,where=W,params=Ps}) ->
+ GetF = fun(M=#method{method_type=constructor,where=W,params=Ps}) ->
{Args,Opts} = split_optional(Ps),
OptLen = case Opts of
[] -> 0;
_ when W =:= erl_no_opt -> 0;
_ -> 1
end,
- "new/" ++ integer_to_list(length(Args)+OptLen);
- (#method{method_type=destructor}) ->
+ deprecated(M, "new" ++ "/" ++ integer_to_list(length(Args)+OptLen));
+ (M=#method{method_type=destructor}) ->
case Abs of
true -> [];
- _ -> "destroy/1"
+ _ -> deprecated(M, "destroy/1")
end;
- (#method{name=N,alias=A,where=W, params=Ps}) ->
+ (M=#method{name=N,alias=A,where=W, params=Ps}) ->
{Args,Opts} = split_optional(Ps),
OptLen = case Opts of
[] -> 0;
_ when W =:= erl_no_opt -> 0;
_ -> 1
end,
- erl_func_name(N,A) ++ "/" ++ integer_to_list(length(Args) + OptLen)
+ deprecated(M, erl_func_name(N,A) ++ "/" ++ integer_to_list(length(Args) + OptLen))
end,
lists:map(GetF, Ms)
end.
+deprecated(#method{opts=FOpts}, FA) ->
+ case lists:keysearch(deprecated, 1, FOpts) of
+ {value, {deprecated, _}} ->
+ {FA,true};
+ _ ->
+ {FA,false}
+ end.
gen_method(Class,Ms0) ->
RemoveC = fun(#method{where=merged_c}) -> false;(_Other) -> true end,
diff --git a/lib/wx/api_gen/wxapi.conf b/lib/wx/api_gen/wxapi.conf
index bb7732a140..385d7ca7f2 100644
--- a/lib/wx/api_gen/wxapi.conf
+++ b/lib/wx/api_gen/wxapi.conf
@@ -279,9 +279,9 @@
{class, wxGridCellEditor, root, [],
['Create',
'IsCreated', 'SetSize', 'Show',
- {'PaintBackground', [{ifdef, "!wxCHECK_VERSION(2,9,0)"}]},
+ {'PaintBackground', [{deprecated, "!wxCHECK_VERSION(2,9,0)"}]},
'BeginEdit',
- {'EndEdit', [{ifdef, "!wxCHECK_VERSION(2,9,0)"}]},
+ {'EndEdit', [{deprecated, "!wxCHECK_VERSION(2,9,0)"}]},
'Reset', 'StartingKey',
'StartingClick', 'HandleReturn'
%'Destroy','Clone','~wxGridCellEditor',
@@ -323,7 +323,7 @@
[{skip, [{'DrawEllipse',5},{'DrawRectangle',5},
{'DrawRoundedRectangle',6},{'SetClippingRegion',5}]}],
[{'Blit',7},'CalcBoundingBox','Clear',
- {'ComputeScaleAndOrigin',[{ifdef, "!wxCHECK_VERSION(2,9,0)"}]},
+ {'ComputeScaleAndOrigin',[{deprecated, "!wxCHECK_VERSION(2,9,0)"}]},
{'CrossHair',1},
'DestroyClippingRegion','DeviceToLogicalX','DeviceToLogicalXRel',
'DeviceToLogicalY','DeviceToLogicalYRel',{'DrawArc',3},{'DrawBitmap',3},
@@ -352,16 +352,16 @@
{class,wxScreenDC, wxDC, [], ['wxScreenDC', '~wxScreenDC']}.
{class,wxPostScriptDC,wxDC,[],
['wxPostScriptDC','~wxPostScriptDC',
- {'SetResolution', [{ifdef, "!wxCHECK_VERSION(2,9,0)"}]},
- {'GetResolution', [{ifdef, "!wxCHECK_VERSION(2,9,0)"}]}]}.
+ {'SetResolution', [{deprecated, "!wxCHECK_VERSION(2,9,0)"}]},
+ {'GetResolution', [{deprecated, "!wxCHECK_VERSION(2,9,0)"}]}]}.
{class,wxWindowDC, wxDC, [],
- [{'wxWindowDC', [{{func, 0}, [{ifdef, "!wxCHECK_VERSION(2,9,0)"}]}]},
+ [{'wxWindowDC', [{{func, 0}, [{deprecated, "!wxCHECK_VERSION(2,9,0)"}]}]},
'~wxWindowDC']}.
{class,wxClientDC,wxWindowDC,[],
- [{'wxClientDC', [{{func, 0}, [{ifdef, "!wxCHECK_VERSION(2,9,0)"}]}]},
+ [{'wxClientDC', [{{func, 0}, [{deprecated, "!wxCHECK_VERSION(2,9,0)"}]}]},
'~wxClientDC']}.
{class,wxPaintDC, wxWindowDC, [],
- [{'wxPaintDC', [{{func, 0}, [{ifdef, "!wxCHECK_VERSION(2,9,0)"}]}]},
+ [{'wxPaintDC', [{{func, 0}, [{deprecated, "!wxCHECK_VERSION(2,9,0)"}]}]},
'~wxPaintDC']}.
%%{class,wxPrinterDC, wxDC, [], ['wxPrinterDC','GetPaperRect']}. Not in GTK
{class,wxMemoryDC, wxDC, [], ['wxMemoryDC', '~wxMemoryDC','SelectObject','SelectObjectAsSource']}.
@@ -377,8 +377,8 @@
['~wxGraphicsContext',
'Create', %%CreateFromNative CreateFromNativeWindow
'CreatePen','CreateBrush',
- {'CreateRadialGradientBrush', [{ifdef, "!wxCHECK_VERSION(2,9,0)"}]},
- {'CreateLinearGradientBrush', [{ifdef, "!wxCHECK_VERSION(2,9,0)"}]},
+ {'CreateRadialGradientBrush', [{deprecated, "!wxCHECK_VERSION(2,9,0)"}]},
+ {'CreateLinearGradientBrush', [{deprecated, "!wxCHECK_VERSION(2,9,0)"}]},
'CreateFont','CreateMatrix',
'CreatePath','Clip','ResetClip',
'DrawBitmap','DrawEllipse','DrawIcon',
@@ -407,8 +407,8 @@
['GetDefaultRenderer','CreateContext',
%%'CreateContextFromNativeContext', 'CreateContextFromNativeWindow',
'CreatePen','CreateBrush',
- {'CreateLinearGradientBrush', [{ifdef, "!wxCHECK_VERSION(2,9,0)"}]},
- {'CreateRadialGradientBrush', [{ifdef, "!wxCHECK_VERSION(2,9,0)"}]},
+ {'CreateLinearGradientBrush', [{deprecated, "!wxCHECK_VERSION(2,9,0)"}]},
+ {'CreateRadialGradientBrush', [{deprecated, "!wxCHECK_VERSION(2,9,0)"}]},
'CreateFont',
'CreateMatrix','CreatePath']}.
@@ -712,7 +712,7 @@
{class, wxCalendarCtrl, wxControl, [],
['wxCalendarCtrl','Create','~wxCalendarCtrl','SetDate','GetDate',
- {'EnableYearChange', [{ifdef, "!wxCHECK_VERSION(2,9,0)"}]}, %% Temp bug in wx I assume
+ {'EnableYearChange', [{deprecated, "!wxCHECK_VERSION(2,9,0)"}]}, %% Temp bug in wx I assume
'EnableMonthChange','EnableHolidayDisplay',
'SetHeaderColours','GetHeaderColourFg','GetHeaderColourBg',
'SetHighlightColours','GetHighlightColourFg','GetHighlightColourBg',
@@ -1265,7 +1265,7 @@
['wxMDIChildFrame','~wxMDIChildFrame','Activate','Create','Maximize','Restore']}.
{class, wxMDIClientWindow, wxWindow, [],
- [{'wxMDIClientWindow', [{{func, 2}, [{ifdef, "!wxCHECK_VERSION(2,9,0)"}]}]},
+ [{'wxMDIClientWindow', [{{func, 2}, [{deprecated, "!wxCHECK_VERSION(2,9,0)"}]}]},
'~wxMDIClientWindow','CreateClient']}.
{class, wxLayoutAlgorithm, object, [],
@@ -1431,7 +1431,7 @@
['GetPosition','SetPosition']}.
{enum, wxIdleMode, "wxIDLE_"}.
{class, wxIdleEvent, wxEvent, [{event,[wxEVT_IDLE]}],
- [{'CanSend', [{ifdef, "!wxCHECK_VERSION(2,9,0)"}]},
+ [{'CanSend', [{deprecated, "!wxCHECK_VERSION(2,9,0)"}]},
'GetMode','RequestMore','MoreRequested','SetMode']}.
{class, wxGridEvent, wxNotifyEvent,
[{acc, [{m_row, "GetRow()"}, {m_col, "GetCol()"}, {m_x, "GetPosition().x"},{m_y, "GetPosition().y"},
diff --git a/lib/wx/src/gen/wxCalendarCtrl.erl b/lib/wx/src/gen/wxCalendarCtrl.erl
index 01d171800b..2a476c5e92 100644
--- a/lib/wx/src/gen/wxCalendarCtrl.erl
+++ b/lib/wx/src/gen/wxCalendarCtrl.erl
@@ -75,6 +75,8 @@
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
-export_type([wxCalendarCtrl/0]).
+-deprecated([enableYearChange/1,enableYearChange/2]).
+
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
diff --git a/lib/wx/src/gen/wxClientDC.erl b/lib/wx/src/gen/wxClientDC.erl
index 7dfebe4068..cb75fdc58d 100644
--- a/lib/wx/src/gen/wxClientDC.erl
+++ b/lib/wx/src/gen/wxClientDC.erl
@@ -54,6 +54,8 @@
startPage/1]).
-export_type([wxClientDC/0]).
+-deprecated([new/0]).
+
%% @hidden
parent_class(wxWindowDC) -> true;
parent_class(wxDC) -> true;
diff --git a/lib/wx/src/gen/wxDC.erl b/lib/wx/src/gen/wxDC.erl
index 9f57978849..aebd3e2498 100644
--- a/lib/wx/src/gen/wxDC.erl
+++ b/lib/wx/src/gen/wxDC.erl
@@ -50,6 +50,8 @@
-export([parent_class/1]).
-export_type([wxDC/0]).
+-deprecated([computeScaleAndOrigin/1]).
+
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
diff --git a/lib/wx/src/gen/wxGraphicsContext.erl b/lib/wx/src/gen/wxGraphicsContext.erl
index 1dfa0dd405..8cec84a596 100644
--- a/lib/wx/src/gen/wxGraphicsContext.erl
+++ b/lib/wx/src/gen/wxGraphicsContext.erl
@@ -40,6 +40,8 @@
-export([getRenderer/1,isNull/1,parent_class/1]).
-export_type([wxGraphicsContext/0]).
+-deprecated([createLinearGradientBrush/7,createRadialGradientBrush/8]).
+
%% @hidden
parent_class(wxGraphicsObject) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
diff --git a/lib/wx/src/gen/wxGraphicsRenderer.erl b/lib/wx/src/gen/wxGraphicsRenderer.erl
index 21082bde23..2b64f86182 100644
--- a/lib/wx/src/gen/wxGraphicsRenderer.erl
+++ b/lib/wx/src/gen/wxGraphicsRenderer.erl
@@ -32,6 +32,8 @@
-export([parent_class/1]).
-export_type([wxGraphicsRenderer/0]).
+-deprecated([createLinearGradientBrush/7,createRadialGradientBrush/8]).
+
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
diff --git a/lib/wx/src/gen/wxGridCellEditor.erl b/lib/wx/src/gen/wxGridCellEditor.erl
index e84cdeb49a..4f86e307b5 100644
--- a/lib/wx/src/gen/wxGridCellEditor.erl
+++ b/lib/wx/src/gen/wxGridCellEditor.erl
@@ -31,6 +31,8 @@
-export([parent_class/1]).
-export_type([wxGridCellEditor/0]).
+-deprecated([endEdit/4,paintBackground/3]).
+
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
diff --git a/lib/wx/src/gen/wxIdleEvent.erl b/lib/wx/src/gen/wxIdleEvent.erl
index 4749026446..a19fdcc48e 100644
--- a/lib/wx/src/gen/wxIdleEvent.erl
+++ b/lib/wx/src/gen/wxIdleEvent.erl
@@ -38,6 +38,8 @@
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
-export_type([wxIdleEvent/0]).
+-deprecated([canSend/1]).
+
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
diff --git a/lib/wx/src/gen/wxMDIClientWindow.erl b/lib/wx/src/gen/wxMDIClientWindow.erl
index 344dcdbbaf..bfdba336f8 100644
--- a/lib/wx/src/gen/wxMDIClientWindow.erl
+++ b/lib/wx/src/gen/wxMDIClientWindow.erl
@@ -69,6 +69,8 @@
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
-export_type([wxMDIClientWindow/0]).
+-deprecated([new/1,new/2]).
+
%% @hidden
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
diff --git a/lib/wx/src/gen/wxPaintDC.erl b/lib/wx/src/gen/wxPaintDC.erl
index 9e81bc31af..6648f278bb 100644
--- a/lib/wx/src/gen/wxPaintDC.erl
+++ b/lib/wx/src/gen/wxPaintDC.erl
@@ -54,6 +54,8 @@
startPage/1]).
-export_type([wxPaintDC/0]).
+-deprecated([new/0]).
+
%% @hidden
parent_class(wxWindowDC) -> true;
parent_class(wxDC) -> true;
diff --git a/lib/wx/src/gen/wxPostScriptDC.erl b/lib/wx/src/gen/wxPostScriptDC.erl
index 2eb25b6a8e..5329d4562e 100644
--- a/lib/wx/src/gen/wxPostScriptDC.erl
+++ b/lib/wx/src/gen/wxPostScriptDC.erl
@@ -53,6 +53,8 @@
startPage/1]).
-export_type([wxPostScriptDC/0]).
+-deprecated([getResolution/0,setResolution/1]).
+
%% @hidden
parent_class(wxDC) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
diff --git a/lib/wx/src/gen/wxWindowDC.erl b/lib/wx/src/gen/wxWindowDC.erl
index babb3c0e90..4515f0e6b9 100644
--- a/lib/wx/src/gen/wxWindowDC.erl
+++ b/lib/wx/src/gen/wxWindowDC.erl
@@ -53,6 +53,8 @@
startPage/1]).
-export_type([wxWindowDC/0]).
+-deprecated([new/0]).
+
%% @hidden
parent_class(wxDC) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).