From a181c06152a3c935fdf63659322020fb7625b577 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Thu, 16 Feb 2012 11:04:18 +0100 Subject: [wx] Generated types for all wx classes --- lib/wx/src/gen/wxSystemOptions.erl | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'lib/wx/src/gen/wxSystemOptions.erl') diff --git a/lib/wx/src/gen/wxSystemOptions.erl b/lib/wx/src/gen/wxSystemOptions.erl index d5e504632b..a94b74136f 100644 --- a/lib/wx/src/gen/wxSystemOptions.erl +++ b/lib/wx/src/gen/wxSystemOptions.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 @@ -29,50 +29,52 @@ %% inherited exports -export([parent_class/1]). +-export_type([wxSystemOptions/0]). %% @hidden parent_class(_Class) -> erlang:error({badtype, ?MODULE}). -%% @spec (Name::string()) -> string() +-type wxSystemOptions() :: wx:wx_object(). %% @doc See external documentation. +-spec getOption(Name) -> string() when + Name::string(). getOption(Name) when is_list(Name) -> Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxSystemOptions_GetOption, <<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>). -%% @spec (Name::string()) -> integer() %% @doc See external documentation. +-spec getOptionInt(Name) -> integer() when + Name::string(). getOptionInt(Name) when is_list(Name) -> Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxSystemOptions_GetOptionInt, <<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>). -%% @spec (Name::string()) -> bool() %% @doc See external documentation. +-spec hasOption(Name) -> boolean() when + Name::string(). hasOption(Name) when is_list(Name) -> Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxSystemOptions_HasOption, <<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>). -%% @spec (Name::string()) -> bool() %% @doc See external documentation. +-spec isFalse(Name) -> boolean() when + Name::string(). isFalse(Name) when is_list(Name) -> Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxSystemOptions_IsFalse, <<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>). -%% @spec (Name::string(),X::integer()|string()) -> ok %% @doc See external documentation. -%%
Alternatives: -%%

-%% setOption(Name::string(), Value::integer()) -> ok -%%

-%%

-%% setOption(Name::string(), Value::string()) -> ok -%%

+-spec setOption(Name, Value) -> ok when + Name::string(), Value::integer(); + (Name, Value) -> ok when + Name::string(), Value::string(). setOption(Name,Value) when is_list(Name),is_integer(Value) -> Name_UC = unicode:characters_to_binary([Name,0]), -- cgit v1.2.3 From 217343d158afe60a5a6a15e8b894b6fd62611ad3 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Tue, 21 Feb 2012 16:05:37 +0100 Subject: [wx] Fix spec errors --- lib/wx/src/gen/wxSystemOptions.erl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/wx/src/gen/wxSystemOptions.erl') diff --git a/lib/wx/src/gen/wxSystemOptions.erl b/lib/wx/src/gen/wxSystemOptions.erl index a94b74136f..69ef70b2ef 100644 --- a/lib/wx/src/gen/wxSystemOptions.erl +++ b/lib/wx/src/gen/wxSystemOptions.erl @@ -35,8 +35,8 @@ parent_class(_Class) -> erlang:error({badtype, ?MODULE}). -type wxSystemOptions() :: wx:wx_object(). %% @doc See external documentation. --spec getOption(Name) -> string() when - Name::string(). +-spec getOption(Name) -> unicode:charlist() when + Name::unicode:chardata(). getOption(Name) when is_list(Name) -> Name_UC = unicode:characters_to_binary([Name,0]), @@ -45,7 +45,7 @@ getOption(Name) %% @doc See external documentation. -spec getOptionInt(Name) -> integer() when - Name::string(). + Name::unicode:chardata(). getOptionInt(Name) when is_list(Name) -> Name_UC = unicode:characters_to_binary([Name,0]), @@ -54,7 +54,7 @@ getOptionInt(Name) %% @doc See external documentation. -spec hasOption(Name) -> boolean() when - Name::string(). + Name::unicode:chardata(). hasOption(Name) when is_list(Name) -> Name_UC = unicode:characters_to_binary([Name,0]), @@ -63,7 +63,7 @@ hasOption(Name) %% @doc See external documentation. -spec isFalse(Name) -> boolean() when - Name::string(). + Name::unicode:chardata(). isFalse(Name) when is_list(Name) -> Name_UC = unicode:characters_to_binary([Name,0]), @@ -72,9 +72,9 @@ isFalse(Name) %% @doc See external documentation. -spec setOption(Name, Value) -> ok when - Name::string(), Value::integer(); + Name::unicode:chardata(), Value::integer(); (Name, Value) -> ok when - Name::string(), Value::string(). + Name::unicode:chardata(), Value::unicode:chardata(). setOption(Name,Value) when is_list(Name),is_integer(Value) -> Name_UC = unicode:characters_to_binary([Name,0]), -- cgit v1.2.3 From ec9ee1b76343c146cec17d0642dd9d1db7bbf3d6 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Fri, 24 Feb 2012 11:53:41 +0100 Subject: [wx] Doc overloaded functions edoc do not handle overloaded type-specs, so doc them manually --- lib/wx/src/gen/wxSystemOptions.erl | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/wx/src/gen/wxSystemOptions.erl') diff --git a/lib/wx/src/gen/wxSystemOptions.erl b/lib/wx/src/gen/wxSystemOptions.erl index 69ef70b2ef..757eb698a2 100644 --- a/lib/wx/src/gen/wxSystemOptions.erl +++ b/lib/wx/src/gen/wxSystemOptions.erl @@ -71,6 +71,10 @@ isFalse(Name) <<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>). %% @doc See external documentation. +%%
Also:
+%% setOption(Name, Value) -> ok when
+%% Name::unicode:chardata(), Value::unicode:chardata().
+%% -spec setOption(Name, Value) -> ok when Name::unicode:chardata(), Value::integer(); (Name, Value) -> ok when -- cgit v1.2.3