diff options
author | Dan Gudmundsson <[email protected]> | 2011-12-10 09:50:23 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2011-12-10 09:50:23 +0100 |
commit | 8d03b919f06db216a271bc90cf90d9c697a5a5c8 (patch) | |
tree | 49dc8f7773e4ee0db65c84b8a79fdb19bad6663d /lib/wx/src/wx_object.erl | |
parent | f20b520b0d2d990ab70b56345b63a8b508edde1a (diff) | |
parent | 44d21ab66987c4dc4df461901600618efd2907c3 (diff) | |
download | otp-8d03b919f06db216a271bc90cf90d9c697a5a5c8.tar.gz otp-8d03b919f06db216a271bc90cf90d9c697a5a5c8.tar.bz2 otp-8d03b919f06db216a271bc90cf90d9c697a5a5c8.zip |
Merge branch 'dgud/wx/behaviour-spec'
* dgud/wx/behaviour-spec:
[wx] Add handle_cast to avoid behaviour warning
[wx] Avoid missing wx_object behaviour warning
[wx] Remove warnings Add an additional cast when casting buffer offsets, to remove warnings "cast to pointer from integer of different size"
[wx] Add callback specs to wx_object
Diffstat (limited to 'lib/wx/src/wx_object.erl')
-rw-r--r-- | lib/wx/src/wx_object.erl | 51 |
1 files changed, 41 insertions, 10 deletions
diff --git a/lib/wx/src/wx_object.erl b/lib/wx/src/wx_object.erl index bc85cd93d4..80f8937656 100644 --- a/lib/wx/src/wx_object.erl +++ b/lib/wx/src/wx_object.erl @@ -108,7 +108,38 @@ get_pid/1 ]). --export([behaviour_info/1]). +%% -export([behaviour_info/1]). +-callback init(Args :: term()) -> + {#wx_ref{}, State :: term()} | {#wx_ref{}, State :: term(), timeout() | hibernate} | + {stop, Reason :: term()} | ignore. +-callback handle_event(Request :: #wx{}, State :: term()) -> + {noreply, NewState :: term()} | + {noreply, NewState :: term(), timeout() | hibernate} | + {stop, Reason :: term(), NewState :: term()}. +-callback handle_call(Request :: term(), From :: {pid(), Tag :: term()}, + State :: term()) -> + {reply, Reply :: term(), NewState :: term()} | + {reply, Reply :: term(), NewState :: term(), timeout() | hibernate} | + {noreply, NewState :: term()} | + {noreply, NewState :: term(), timeout() | hibernate} | + {stop, Reason :: term(), Reply :: term(), NewState :: term()} | + {stop, Reason :: term(), NewState :: term()}. +-callback handle_cast(Request :: term(), State :: term()) -> + {noreply, NewState :: term()} | + {noreply, NewState :: term(), timeout() | hibernate} | + {stop, Reason :: term(), NewState :: term()}. +-callback handle_info(Info :: timeout() | term(), State :: term()) -> + {noreply, NewState :: term()} | + {noreply, NewState :: term(), timeout() | hibernate} | + {stop, Reason :: term(), NewState :: term()}. +-callback terminate(Reason :: (normal | shutdown | {shutdown, term()} | + term()), + State :: term()) -> + term(). +-callback code_change(OldVsn :: (term() | {down, term()}), State :: term(), + Extra :: term()) -> + {ok, NewState :: term()} | {error, Reason :: term()}. + %% System exports -export([system_continue/3, @@ -125,15 +156,15 @@ %%% API %%%========================================================================= %% @hidden -behaviour_info(callbacks) -> - [{init,1}, - {handle_call,3}, - {handle_info,2}, - {handle_event,2}, - {terminate,2}, - {code_change,3}]; -behaviour_info(_Other) -> - undefined. +%% behaviour_info(callbacks) -> +%% [{init,1}, +%% {handle_call,3}, +%% {handle_info,2}, +%% {handle_event,2}, +%% {terminate,2}, +%% {code_change,3}]; +%% behaviour_info(_Other) -> +%% undefined. %% ----------------------------------------------------------------- |